earthsdk3-ue 3.0.7-beta.4 → 3.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -336,10 +336,10 @@ Msg: ${t}`;console.warn(o)}};x.verboseLogLevel=5,function(v){v.LIST_STREAMERS="l
|
|
|
336
336
|
content: "" !important;
|
|
337
337
|
display: none !important;
|
|
338
338
|
}`,Wv=function(v){zv(v,"."+Fo+Gv+Eu+`
|
|
339
|
-
.`+Qo+jv+Eu)},zv=function(v,e){var t=v.ownerDocument;if(t){var o=t.createElement("style");o.textContent=e,v.appendChild(o)}},Fu=function(){function v(){}return v.getOrigin=function(e){var t=v._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},v.isSameOrigin=function(e){return v.getOrigin(e)===v._origin},v.setContext=function(e){v._link=e.document.createElement("a"),v._origin=v.getOrigin(e.location.href)},v._origin="about:blank",v}(),Jv=function(){function v(e,t){this.context=e,this._options=t,this._cache={}}return v.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(Uo(e)||Zv(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},v.prototype.match=function(e){return this._cache[e]},v.prototype.loadImage=function(e){return Re(this,void 0,void 0,function(){var t,o,y,B,A=this;return xe(this,function(h){switch(h.label){case 0:return t=Fu.isSameOrigin(e),o=!So(e)&&this._options.useCORS===!0&&Ie.SUPPORT_CORS_IMAGES&&!t,y=!So(e)&&!t&&!Uo(e)&&typeof this._options.proxy=="string"&&Ie.SUPPORT_CORS_XHR&&!o,!t&&this._options.allowTaint===!1&&!So(e)&&!Uo(e)&&!y&&!o?[2]:(B=e,y?[4,this.proxy(B)]:[3,2]);case 1:B=h.sent(),h.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(m,g){var w=new Image;w.onload=function(){return m(w)},w.onerror=g,(qv(B)||o)&&(w.crossOrigin="anonymous"),w.src=B,w.complete===!0&&setTimeout(function(){return m(w)},500),A._options.imageTimeout>0&&setTimeout(function(){return g("Timed out ("+A._options.imageTimeout+"ms) loading image")},A._options.imageTimeout)})];case 3:return[2,h.sent()]}})})},v.prototype.has=function(e){return typeof this._cache[e]<"u"},v.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},v.prototype.proxy=function(e){var t=this,o=this._options.proxy;if(!o)throw new Error("No proxy defined");var y=e.substring(0,256);return new Promise(function(B,A){var h=Ie.SUPPORT_RESPONSE_TYPE?"blob":"text",m=new XMLHttpRequest;m.onload=function(){if(m.status===200)if(h==="text")B(m.response);else{var p=new FileReader;p.addEventListener("load",function(){return B(p.result)},!1),p.addEventListener("error",function(u){return A(u)},!1),p.readAsDataURL(m.response)}else A("Failed to proxy resource "+y+" with status code "+m.status)},m.onerror=A;var g=o.indexOf("?")>-1?"&":"?";if(m.open("GET",""+o+g+"url="+encodeURIComponent(e)+"&responseType="+h),h!=="text"&&m instanceof XMLHttpRequest&&(m.responseType=h),t._options.imageTimeout){var w=t._options.imageTimeout;m.timeout=w,m.ontimeout=function(){return A("Timed out ("+w+"ms) proxying "+y)}}m.send()})},v}(),Xv=/^data:image\/svg\+xml/i,Yv=/^data:image\/.*;base64,/i,$v=/^data:image\/.*/i,Zv=function(v){return Ie.SUPPORT_SVG_DRAWING||!ey(v)},So=function(v){return $v.test(v)},qv=function(v){return Yv.test(v)},Uo=function(v){return v.substr(0,4)==="blob"},ey=function(v){return v.substr(-3).toLowerCase()==="svg"||Xv.test(v)},q=function(){function v(e,t){this.type=0,this.x=e,this.y=t}return v.prototype.add=function(e,t){return new v(this.x+e,this.y+t)},v}(),Yt=function(v,e,t){return new q(v.x+(e.x-v.x)*t,v.y+(e.y-v.y)*t)},Kn=function(){function v(e,t,o,y){this.type=1,this.start=e,this.startControl=t,this.endControl=o,this.end=y}return v.prototype.subdivide=function(e,t){var o=Yt(this.start,this.startControl,e),y=Yt(this.startControl,this.endControl,e),B=Yt(this.endControl,this.end,e),A=Yt(o,y,e),h=Yt(y,B,e),m=Yt(A,h,e);return t?new v(this.start,o,A,m):new v(m,h,B,this.end)},v.prototype.add=function(e,t){return new v(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},v.prototype.reverse=function(){return new v(this.end,this.endControl,this.startControl,this.start)},v}(),We=function(v){return v.type===1},ty=function(){function v(e){var t=e.styles,o=e.bounds,y=yr(t.borderTopLeftRadius,o.width,o.height),B=y[0],A=y[1],h=yr(t.borderTopRightRadius,o.width,o.height),m=h[0],g=h[1],w=yr(t.borderBottomRightRadius,o.width,o.height),p=w[0],u=w[1],f=yr(t.borderBottomLeftRadius,o.width,o.height),c=f[0],a=f[1],n=[];n.push((B+m)/o.width),n.push((c+p)/o.width),n.push((A+a)/o.height),n.push((g+u)/o.height);var s=Math.max.apply(Math,n);s>1&&(B/=s,A/=s,m/=s,g/=s,p/=s,u/=s,c/=s,a/=s);var r=o.width-m,i=o.height-u,l=o.width-p,d=o.height-a,C=t.borderTopWidth,_=t.borderRightWidth,b=t.borderBottomWidth,E=t.borderLeftWidth,F=pe(t.paddingTop,e.bounds.width),Q=pe(t.paddingRight,e.bounds.width),U=pe(t.paddingBottom,e.bounds.width),T=pe(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=B>0||A>0?ve(o.left+E/3,o.top+C/3,B-E/3,A-C/3,le.TOP_LEFT):new q(o.left+E/3,o.top+C/3),this.topRightBorderDoubleOuterBox=B>0||A>0?ve(o.left+r,o.top+C/3,m-_/3,g-C/3,le.TOP_RIGHT):new q(o.left+o.width-_/3,o.top+C/3),this.bottomRightBorderDoubleOuterBox=p>0||u>0?ve(o.left+l,o.top+i,p-_/3,u-b/3,le.BOTTOM_RIGHT):new q(o.left+o.width-_/3,o.top+o.height-b/3),this.bottomLeftBorderDoubleOuterBox=c>0||a>0?ve(o.left+E/3,o.top+d,c-E/3,a-b/3,le.BOTTOM_LEFT):new q(o.left+E/3,o.top+o.height-b/3),this.topLeftBorderDoubleInnerBox=B>0||A>0?ve(o.left+E*2/3,o.top+C*2/3,B-E*2/3,A-C*2/3,le.TOP_LEFT):new q(o.left+E*2/3,o.top+C*2/3),this.topRightBorderDoubleInnerBox=B>0||A>0?ve(o.left+r,o.top+C*2/3,m-_*2/3,g-C*2/3,le.TOP_RIGHT):new q(o.left+o.width-_*2/3,o.top+C*2/3),this.bottomRightBorderDoubleInnerBox=p>0||u>0?ve(o.left+l,o.top+i,p-_*2/3,u-b*2/3,le.BOTTOM_RIGHT):new q(o.left+o.width-_*2/3,o.top+o.height-b*2/3),this.bottomLeftBorderDoubleInnerBox=c>0||a>0?ve(o.left+E*2/3,o.top+d,c-E*2/3,a-b*2/3,le.BOTTOM_LEFT):new q(o.left+E*2/3,o.top+o.height-b*2/3),this.topLeftBorderStroke=B>0||A>0?ve(o.left+E/2,o.top+C/2,B-E/2,A-C/2,le.TOP_LEFT):new q(o.left+E/2,o.top+C/2),this.topRightBorderStroke=B>0||A>0?ve(o.left+r,o.top+C/2,m-_/2,g-C/2,le.TOP_RIGHT):new q(o.left+o.width-_/2,o.top+C/2),this.bottomRightBorderStroke=p>0||u>0?ve(o.left+l,o.top+i,p-_/2,u-b/2,le.BOTTOM_RIGHT):new q(o.left+o.width-_/2,o.top+o.height-b/2),this.bottomLeftBorderStroke=c>0||a>0?ve(o.left+E/2,o.top+d,c-E/2,a-b/2,le.BOTTOM_LEFT):new q(o.left+E/2,o.top+o.height-b/2),this.topLeftBorderBox=B>0||A>0?ve(o.left,o.top,B,A,le.TOP_LEFT):new q(o.left,o.top),this.topRightBorderBox=m>0||g>0?ve(o.left+r,o.top,m,g,le.TOP_RIGHT):new q(o.left+o.width,o.top),this.bottomRightBorderBox=p>0||u>0?ve(o.left+l,o.top+i,p,u,le.BOTTOM_RIGHT):new q(o.left+o.width,o.top+o.height),this.bottomLeftBorderBox=c>0||a>0?ve(o.left,o.top+d,c,a,le.BOTTOM_LEFT):new q(o.left,o.top+o.height),this.topLeftPaddingBox=B>0||A>0?ve(o.left+E,o.top+C,Math.max(0,B-E),Math.max(0,A-C),le.TOP_LEFT):new q(o.left+E,o.top+C),this.topRightPaddingBox=m>0||g>0?ve(o.left+Math.min(r,o.width-_),o.top+C,r>o.width+_?0:Math.max(0,m-_),Math.max(0,g-C),le.TOP_RIGHT):new q(o.left+o.width-_,o.top+C),this.bottomRightPaddingBox=p>0||u>0?ve(o.left+Math.min(l,o.width-E),o.top+Math.min(i,o.height-b),Math.max(0,p-_),Math.max(0,u-b),le.BOTTOM_RIGHT):new q(o.left+o.width-_,o.top+o.height-b),this.bottomLeftPaddingBox=c>0||a>0?ve(o.left+E,o.top+Math.min(d,o.height-b),Math.max(0,c-E),Math.max(0,a-b),le.BOTTOM_LEFT):new q(o.left+E,o.top+o.height-b),this.topLeftContentBox=B>0||A>0?ve(o.left+E+T,o.top+C+F,Math.max(0,B-(E+T)),Math.max(0,A-(C+F)),le.TOP_LEFT):new q(o.left+E+T,o.top+C+F),this.topRightContentBox=m>0||g>0?ve(o.left+Math.min(r,o.width+E+T),o.top+C+F,r>o.width+E+T?0:m-E+T,g-(C+F),le.TOP_RIGHT):new q(o.left+o.width-(_+Q),o.top+C+F),this.bottomRightContentBox=p>0||u>0?ve(o.left+Math.min(l,o.width-(E+T)),o.top+Math.min(i,o.height+C+F),Math.max(0,p-(_+Q)),u-(b+U),le.BOTTOM_RIGHT):new q(o.left+o.width-(_+Q),o.top+o.height-(b+U)),this.bottomLeftContentBox=c>0||a>0?ve(o.left+E+T,o.top+d,Math.max(0,c-(E+T)),a-(b+U),le.BOTTOM_LEFT):new q(o.left+E+T,o.top+o.height-(b+U))}return v}(),le;(function(v){v[v.TOP_LEFT=0]="TOP_LEFT",v[v.TOP_RIGHT=1]="TOP_RIGHT",v[v.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",v[v.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(le||(le={}));var ve=function(v,e,t,o,y){var B=4*((Math.sqrt(2)-1)/3),A=t*B,h=o*B,m=v+t,g=e+o;switch(y){case le.TOP_LEFT:return new Kn(new q(v,g),new q(v,g-h),new q(m-A,e),new q(m,e));case le.TOP_RIGHT:return new Kn(new q(v,e),new q(v+A,e),new q(m,g-h),new q(m,g));case le.BOTTOM_RIGHT:return new Kn(new q(m,e),new q(m,e+h),new q(v+A,g),new q(v,g));case le.BOTTOM_LEFT:default:return new Kn(new q(m,g),new q(m-A,g),new q(v,e+h),new q(v,e))}},Nn=function(v){return[v.topLeftBorderBox,v.topRightBorderBox,v.bottomRightBorderBox,v.bottomLeftBorderBox]},ry=function(v){return[v.topLeftContentBox,v.topRightContentBox,v.bottomRightContentBox,v.bottomLeftContentBox]},Vn=function(v){return[v.topLeftPaddingBox,v.topRightPaddingBox,v.bottomRightPaddingBox,v.bottomLeftPaddingBox]},Ay=function(){function v(e,t,o){this.offsetX=e,this.offsetY=t,this.matrix=o,this.type=0,this.target=6}return v}(),Gn=function(){function v(e,t){this.path=e,this.target=t,this.type=1}return v}(),ny=function(){function v(e){this.opacity=e,this.type=2,this.target=6}return v}(),iy=function(v){return v.type===0},Qu=function(v){return v.type===1},oy=function(v){return v.type===2},Su=function(v,e){return v.length===e.length?v.some(function(t,o){return t===e[o]}):!1},sy=function(v,e,t,o,y){return v.map(function(B,A){switch(A){case 0:return B.add(e,t);case 1:return B.add(e+o,t);case 2:return B.add(e+o,t+y);case 3:return B.add(e,t+y)}return B})},Uu=function(){function v(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return v}(),Tu=function(){function v(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new ty(this.container),this.container.styles.opacity<1&&this.effects.push(new ny(this.container.styles.opacity)),this.container.styles.transform!==null){var o=this.container.bounds.left+this.container.styles.transformOrigin[0].number,y=this.container.bounds.top+this.container.styles.transformOrigin[1].number,B=this.container.styles.transform;this.effects.push(new Ay(o,y,B))}if(this.container.styles.overflowX!==0){var A=Nn(this.curves),h=Vn(this.curves);Su(A,h)?this.effects.push(new Gn(A,6)):(this.effects.push(new Gn(A,2)),this.effects.push(new Gn(h,4)))}}return v.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,o=this.parent,y=this.effects.slice(0);o;){var B=o.effects.filter(function(m){return!Qu(m)});if(t||o.container.styles.position!==0||!o.parent){if(y.unshift.apply(y,B),t=[2,3].indexOf(o.container.styles.position)===-1,o.container.styles.overflowX!==0){var A=Nn(o.curves),h=Vn(o.curves);Su(A,h)||y.unshift(new Gn(h,6))}}else y.unshift.apply(y,B);o=o.parent}return y.filter(function(m){return Qe(m.target,e)})},v}(),To=function(v,e,t,o){v.container.elements.forEach(function(y){var B=Qe(y.flags,4),A=Qe(y.flags,2),h=new Tu(y,v);Qe(y.styles.display,2048)&&o.push(h);var m=Qe(y.flags,8)?[]:o;if(B||A){var g=B||y.styles.isPositioned()?t:e,w=new Uu(h);if(y.styles.isPositioned()||y.styles.opacity<1||y.styles.isTransformed()){var p=y.styles.zIndex.order;if(p<0){var u=0;g.negativeZIndex.some(function(c,a){return p>c.element.container.styles.zIndex.order?(u=a,!1):u>0}),g.negativeZIndex.splice(u,0,w)}else if(p>0){var f=0;g.positiveZIndex.some(function(c,a){return p>=c.element.container.styles.zIndex.order?(f=a+1,!1):f>0}),g.positiveZIndex.splice(f,0,w)}else g.zeroOrAutoZIndexOrTransformedOrOpacity.push(w)}else y.styles.isFloating()?g.nonPositionedFloats.push(w):g.nonPositionedInlineLevel.push(w);To(h,w,B?w:t,m)}else y.styles.isInlineLevel()?e.inlineLevel.push(h):e.nonInlineLevel.push(h),To(h,e,t,m);Qe(y.flags,8)&&Iu(y,m)})},Iu=function(v,e){for(var t=v instanceof mo?v.start:1,o=v instanceof mo?v.reversed:!1,y=0;y<e.length;y++){var B=e[y];B.container instanceof ru&&typeof B.container.value=="number"&&B.container.value!==0&&(t=B.container.value),B.listValue=_r(t,B.container.styles.listStyleType,!0),t+=o?-1:1}},ay=function(v){var e=new Tu(v,null),t=new Uu(e),o=[];return To(e,t,t,o),Iu(e.container,o),t},Pu=function(v,e){switch(e){case 0:return ze(v.topLeftBorderBox,v.topLeftPaddingBox,v.topRightBorderBox,v.topRightPaddingBox);case 1:return ze(v.topRightBorderBox,v.topRightPaddingBox,v.bottomRightBorderBox,v.bottomRightPaddingBox);case 2:return ze(v.bottomRightBorderBox,v.bottomRightPaddingBox,v.bottomLeftBorderBox,v.bottomLeftPaddingBox);case 3:default:return ze(v.bottomLeftBorderBox,v.bottomLeftPaddingBox,v.topLeftBorderBox,v.topLeftPaddingBox)}},cy=function(v,e){switch(e){case 0:return ze(v.topLeftBorderBox,v.topLeftBorderDoubleOuterBox,v.topRightBorderBox,v.topRightBorderDoubleOuterBox);case 1:return ze(v.topRightBorderBox,v.topRightBorderDoubleOuterBox,v.bottomRightBorderBox,v.bottomRightBorderDoubleOuterBox);case 2:return ze(v.bottomRightBorderBox,v.bottomRightBorderDoubleOuterBox,v.bottomLeftBorderBox,v.bottomLeftBorderDoubleOuterBox);case 3:default:return ze(v.bottomLeftBorderBox,v.bottomLeftBorderDoubleOuterBox,v.topLeftBorderBox,v.topLeftBorderDoubleOuterBox)}},ly=function(v,e){switch(e){case 0:return ze(v.topLeftBorderDoubleInnerBox,v.topLeftPaddingBox,v.topRightBorderDoubleInnerBox,v.topRightPaddingBox);case 1:return ze(v.topRightBorderDoubleInnerBox,v.topRightPaddingBox,v.bottomRightBorderDoubleInnerBox,v.bottomRightPaddingBox);case 2:return ze(v.bottomRightBorderDoubleInnerBox,v.bottomRightPaddingBox,v.bottomLeftBorderDoubleInnerBox,v.bottomLeftPaddingBox);case 3:default:return ze(v.bottomLeftBorderDoubleInnerBox,v.bottomLeftPaddingBox,v.topLeftBorderDoubleInnerBox,v.topLeftPaddingBox)}},uy=function(v,e){switch(e){case 0:return jn(v.topLeftBorderStroke,v.topRightBorderStroke);case 1:return jn(v.topRightBorderStroke,v.bottomRightBorderStroke);case 2:return jn(v.bottomRightBorderStroke,v.bottomLeftBorderStroke);case 3:default:return jn(v.bottomLeftBorderStroke,v.topLeftBorderStroke)}},jn=function(v,e){var t=[];return We(v)?t.push(v.subdivide(.5,!1)):t.push(v),We(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},ze=function(v,e,t,o){var y=[];return We(v)?y.push(v.subdivide(.5,!1)):y.push(v),We(t)?y.push(t.subdivide(.5,!0)):y.push(t),We(o)?y.push(o.subdivide(.5,!0).reverse()):y.push(o),We(e)?y.push(e.subdivide(.5,!1).reverse()):y.push(e),y},xu=function(v){var e=v.bounds,t=v.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},Wn=function(v){var e=v.styles,t=v.bounds,o=pe(e.paddingLeft,t.width),y=pe(e.paddingRight,t.width),B=pe(e.paddingTop,t.width),A=pe(e.paddingBottom,t.width);return t.add(o+e.borderLeftWidth,B+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+o+y),-(e.borderTopWidth+e.borderBottomWidth+B+A))},dy=function(v,e){return v===0?e.bounds:v===2?Wn(e):xu(e)},fy=function(v,e){return v===0?e.bounds:v===2?Wn(e):xu(e)},Io=function(v,e,t){var o=dy(Zt(v.styles.backgroundOrigin,e),v),y=fy(Zt(v.styles.backgroundClip,e),v),B=hy(Zt(v.styles.backgroundSize,e),t,o),A=B[0],h=B[1],m=yr(Zt(v.styles.backgroundPosition,e),o.width-A,o.height-h),g=py(Zt(v.styles.backgroundRepeat,e),m,B,o,y),w=Math.round(o.left+m[0]),p=Math.round(o.top+m[1]);return[g,w,p,A,h]},$t=function(v){return fe(v)&&v.value===Wt.AUTO},zn=function(v){return typeof v=="number"},hy=function(v,e,t){var o=e[0],y=e[1],B=e[2],A=v[0],h=v[1];if(!A)return[0,0];if(Ee(A)&&h&&Ee(h))return[pe(A,t.width),pe(h,t.height)];var m=zn(B);if(fe(A)&&(A.value===Wt.CONTAIN||A.value===Wt.COVER)){if(zn(B)){var g=t.width/t.height;return g<B!=(A.value===Wt.COVER)?[t.width,t.width/B]:[t.height*B,t.height]}return[t.width,t.height]}var w=zn(o),p=zn(y),u=w||p;if($t(A)&&(!h||$t(h))){if(w&&p)return[o,y];if(!m&&!u)return[t.width,t.height];if(u&&m){var f=w?o:y*B,c=p?y:o/B;return[f,c]}var a=w?o:t.width,n=p?y:t.height;return[a,n]}if(m){var s=0,r=0;return Ee(A)?s=pe(A,t.width):Ee(h)&&(r=pe(h,t.height)),$t(A)?s=r*B:(!h||$t(h))&&(r=s/B),[s,r]}var i=null,l=null;if(Ee(A)?i=pe(A,t.width):h&&Ee(h)&&(l=pe(h,t.height)),i!==null&&(!h||$t(h))&&(l=w&&p?i/o*y:t.height),l!==null&&$t(A)&&(i=w&&p?l/y*o:t.width),i!==null&&l!==null)return[i,l];throw new Error("Unable to calculate background-size for element")},Zt=function(v,e){var t=v[e];return typeof t>"u"?v[0]:t},py=function(v,e,t,o,y){var B=e[0],A=e[1],h=t[0],m=t[1];switch(v){case 2:return[new q(Math.round(o.left),Math.round(o.top+A)),new q(Math.round(o.left+o.width),Math.round(o.top+A)),new q(Math.round(o.left+o.width),Math.round(m+o.top+A)),new q(Math.round(o.left),Math.round(m+o.top+A))];case 3:return[new q(Math.round(o.left+B),Math.round(o.top)),new q(Math.round(o.left+B+h),Math.round(o.top)),new q(Math.round(o.left+B+h),Math.round(o.height+o.top)),new q(Math.round(o.left+B),Math.round(o.height+o.top))];case 1:return[new q(Math.round(o.left+B),Math.round(o.top+A)),new q(Math.round(o.left+B+h),Math.round(o.top+A)),new q(Math.round(o.left+B+h),Math.round(o.top+A+m)),new q(Math.round(o.left+B),Math.round(o.top+A+m))];default:return[new q(Math.round(y.left),Math.round(y.top)),new q(Math.round(y.left+y.width),Math.round(y.top)),new q(Math.round(y.left+y.width),Math.round(y.height+y.top)),new q(Math.round(y.left),Math.round(y.height+y.top))]}},gy="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Ou="Hidden Text",vy=function(){function v(e){this._data={},this._document=e}return v.prototype.parseMetrics=function(e,t){var o=this._document.createElement("div"),y=this._document.createElement("img"),B=this._document.createElement("span"),A=this._document.body;o.style.visibility="hidden",o.style.fontFamily=e,o.style.fontSize=t,o.style.margin="0",o.style.padding="0",o.style.whiteSpace="nowrap",A.appendChild(o),y.src=gy,y.width=1,y.height=1,y.style.margin="0",y.style.padding="0",y.style.verticalAlign="baseline",B.style.fontFamily=e,B.style.fontSize=t,B.style.margin="0",B.style.padding="0",B.appendChild(this._document.createTextNode(Ou)),o.appendChild(B),o.appendChild(y);var h=y.offsetTop-B.offsetTop+2;o.removeChild(B),o.appendChild(this._document.createTextNode(Ou)),o.style.lineHeight="normal",y.style.verticalAlign="super";var m=y.offsetTop-o.offsetTop+2;return A.removeChild(o),{baseline:h,middle:m}},v.prototype.getMetrics=function(e,t){var o=e+" "+t;return typeof this._data[o]>"u"&&(this._data[o]=this.parseMetrics(e,t)),this._data[o]},v}(),Mu=function(){function v(e,t){this.context=e,this.options=t}return v}(),yy=1e4,my=function(v){Xe(e,v);function e(t,o){var y=v.call(this,t,o)||this;return y._activeEffects=[],y.canvas=o.canvas?o.canvas:document.createElement("canvas"),y.ctx=y.canvas.getContext("2d"),o.canvas||(y.canvas.width=Math.floor(o.width*o.scale),y.canvas.height=Math.floor(o.height*o.scale),y.canvas.style.width=o.width+"px",y.canvas.style.height=o.height+"px"),y.fontMetrics=new vy(document),y.ctx.scale(y.options.scale,y.options.scale),y.ctx.translate(-o.x,-o.y),y.ctx.textBaseline="bottom",y._activeEffects=[],y.context.logger.debug("Canvas renderer initialized ("+o.width+"x"+o.height+") with scale "+o.scale),y}return e.prototype.applyEffects=function(t){for(var o=this;this._activeEffects.length;)this.popEffect();t.forEach(function(y){return o.applyEffect(y)})},e.prototype.applyEffect=function(t){this.ctx.save(),oy(t)&&(this.ctx.globalAlpha=t.opacity),iy(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),Qu(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(t){return Re(this,void 0,void 0,function(){var o;return xe(this,function(y){switch(y.label){case 0:return o=t.element.container.styles,o.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:y.sent(),y.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(t){return Re(this,void 0,void 0,function(){return xe(this,function(o){switch(o.label){case 0:if(Qe(t.container.flags,16))debugger;return t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return o.sent(),[4,this.renderNodeContent(t)];case 2:o.sent(),o.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(t,o,y){var B=this;if(o===0)this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+y);else{var A=yo(t.text);A.reduce(function(h,m){return B.ctx.fillText(m,h,t.bounds.top+y),h+B.ctx.measureText(m).width},t.bounds.left)}},e.prototype.createFontStyle=function(t){var o=t.fontVariant.filter(function(A){return A==="normal"||A==="small-caps"}).join(""),y=_y(t.fontFamily).join(", "),B=vr(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,o,t.fontWeight,B,y].join(" "),y,B]},e.prototype.renderTextNode=function(t,o){return Re(this,void 0,void 0,function(){var y,B,A,h,m,g,w,p,u=this;return xe(this,function(f){return y=this.createFontStyle(o),B=y[0],A=y[1],h=y[2],this.ctx.font=B,this.ctx.direction=o.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",m=this.fontMetrics.getMetrics(A,h),g=m.baseline,w=m.middle,p=o.paintOrder,t.textBounds.forEach(function(c){p.forEach(function(a){switch(a){case 0:u.ctx.fillStyle=Se(o.color),u.renderTextWithLetterSpacing(c,o.letterSpacing,g);var n=o.textShadow;n.length&&c.text.trim().length&&(n.slice(0).reverse().forEach(function(s){u.ctx.shadowColor=Se(s.color),u.ctx.shadowOffsetX=s.offsetX.number*u.options.scale,u.ctx.shadowOffsetY=s.offsetY.number*u.options.scale,u.ctx.shadowBlur=s.blur.number,u.renderTextWithLetterSpacing(c,o.letterSpacing,g)}),u.ctx.shadowColor="",u.ctx.shadowOffsetX=0,u.ctx.shadowOffsetY=0,u.ctx.shadowBlur=0),o.textDecorationLine.length&&(u.ctx.fillStyle=Se(o.textDecorationColor||o.color),o.textDecorationLine.forEach(function(s){switch(s){case 1:u.ctx.fillRect(c.bounds.left,Math.round(c.bounds.top+g),c.bounds.width,1);break;case 2:u.ctx.fillRect(c.bounds.left,Math.round(c.bounds.top),c.bounds.width,1);break;case 3:u.ctx.fillRect(c.bounds.left,Math.ceil(c.bounds.top+w),c.bounds.width,1);break}}));break;case 1:o.webkitTextStrokeWidth&&c.text.trim().length&&(u.ctx.strokeStyle=Se(o.webkitTextStrokeColor),u.ctx.lineWidth=o.webkitTextStrokeWidth,u.ctx.lineJoin=window.chrome?"miter":"round",u.ctx.strokeText(c.text,c.bounds.left,c.bounds.top+g)),u.ctx.strokeStyle="",u.ctx.lineWidth=0,u.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(t,o,y){if(y&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var B=Wn(t),A=Vn(o);this.path(A),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(y,0,0,t.intrinsicWidth,t.intrinsicHeight,B.left,B.top,B.width,B.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return Re(this,void 0,void 0,function(){var o,y,B,A,h,m,r,r,g,w,p,u,l,f,c,d,a,n,s,r,i,l,d;return xe(this,function(C){switch(C.label){case 0:this.applyEffects(t.getEffects(4)),o=t.container,y=t.curves,B=o.styles,A=0,h=o.textNodes,C.label=1;case 1:return A<h.length?(m=h[A],[4,this.renderTextNode(m,B)]):[3,4];case 2:C.sent(),C.label=3;case 3:return A++,[3,1];case 4:if(!(o instanceof ql))return[3,8];C.label=5;case 5:return C.trys.push([5,7,,8]),[4,this.context.cache.match(o.src)];case 6:return r=C.sent(),this.renderReplacedElement(o,y,r),[3,8];case 7:return C.sent(),this.context.logger.error("Error loading image "+o.src),[3,8];case 8:if(o instanceof eu&&this.renderReplacedElement(o,y,o.canvas),!(o instanceof tu))return[3,12];C.label=9;case 9:return C.trys.push([9,11,,12]),[4,this.context.cache.match(o.svg)];case 10:return r=C.sent(),this.renderReplacedElement(o,y,r),[3,12];case 11:return C.sent(),this.context.logger.error("Error loading svg "+o.svg.substring(0,255)),[3,12];case 12:return o instanceof ou&&o.tree?(g=new e(this.context,{scale:this.options.scale,backgroundColor:o.backgroundColor,x:0,y:0,width:o.width,height:o.height}),[4,g.render(o.tree)]):[3,14];case 13:w=C.sent(),o.width&&o.height&&this.ctx.drawImage(w,0,0,o.width,o.height,o.bounds.left,o.bounds.top,o.bounds.width,o.bounds.height),C.label=14;case 14:if(o instanceof wo&&(p=Math.min(o.bounds.width,o.bounds.height),o.type===Mn?o.checked&&(this.ctx.save(),this.path([new q(o.bounds.left+p*.39363,o.bounds.top+p*.79),new q(o.bounds.left+p*.16,o.bounds.top+p*.5549),new q(o.bounds.left+p*.27347,o.bounds.top+p*.44071),new q(o.bounds.left+p*.39694,o.bounds.top+p*.5649),new q(o.bounds.left+p*.72983,o.bounds.top+p*.23),new q(o.bounds.left+p*.84,o.bounds.top+p*.34085),new q(o.bounds.left+p*.39363,o.bounds.top+p*.79)]),this.ctx.fillStyle=Se(Au),this.ctx.fill(),this.ctx.restore()):o.type===Hn&&o.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(o.bounds.left+p/2,o.bounds.top+p/2,p/4,0,Math.PI*2,!0),this.ctx.fillStyle=Se(Au),this.ctx.fill(),this.ctx.restore())),wy(o)&&o.value.length){switch(u=this.createFontStyle(B),l=u[0],f=u[1],c=this.fontMetrics.getMetrics(l,f).baseline,this.ctx.font=l,this.ctx.fillStyle=Se(B.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Cy(o.styles.textAlign),d=Wn(o),a=0,o.styles.textAlign){case 1:a+=d.width/2;break;case 2:a+=d.width;break}n=d.add(a,0,0,-d.height/2+1),this.ctx.save(),this.path([new q(d.left,d.top),new q(d.left+d.width,d.top),new q(d.left+d.width,d.top+d.height),new q(d.left,d.top+d.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Cr(o.value,n),B.letterSpacing,c),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!Qe(o.styles.display,2048))return[3,20];if(o.styles.listStyleImage===null)return[3,19];if(s=o.styles.listStyleImage,s.type!==0)return[3,18];r=void 0,i=s.url,C.label=15;case 15:return C.trys.push([15,17,,18]),[4,this.context.cache.match(i)];case 16:return r=C.sent(),this.ctx.drawImage(r,o.bounds.left-(r.width+10),o.bounds.top),[3,18];case 17:return C.sent(),this.context.logger.error("Error loading list-style-image "+i),[3,18];case 18:return[3,20];case 19:t.listValue&&o.styles.listStyleType!==-1&&(l=this.createFontStyle(B)[0],this.ctx.font=l,this.ctx.fillStyle=Se(B.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",d=new ot(o.bounds.left,o.bounds.top+pe(o.styles.paddingTop,o.bounds.width),o.bounds.width,Ol(B.lineHeight,B.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Cr(t.listValue,d),B.letterSpacing,Ol(B.lineHeight,B.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),C.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(t){return Re(this,void 0,void 0,function(){var o,y,s,B,A,s,h,m,s,g,w,s,p,u,s,f,c,s,a,n,s;return xe(this,function(r){switch(r.label){case 0:if(Qe(t.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:r.sent(),o=0,y=t.negativeZIndex,r.label=2;case 2:return o<y.length?(s=y[o],[4,this.renderStack(s)]):[3,5];case 3:r.sent(),r.label=4;case 4:return o++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:r.sent(),B=0,A=t.nonInlineLevel,r.label=7;case 7:return B<A.length?(s=A[B],[4,this.renderNode(s)]):[3,10];case 8:r.sent(),r.label=9;case 9:return B++,[3,7];case 10:h=0,m=t.nonPositionedFloats,r.label=11;case 11:return h<m.length?(s=m[h],[4,this.renderStack(s)]):[3,14];case 12:r.sent(),r.label=13;case 13:return h++,[3,11];case 14:g=0,w=t.nonPositionedInlineLevel,r.label=15;case 15:return g<w.length?(s=w[g],[4,this.renderStack(s)]):[3,18];case 16:r.sent(),r.label=17;case 17:return g++,[3,15];case 18:p=0,u=t.inlineLevel,r.label=19;case 19:return p<u.length?(s=u[p],[4,this.renderNode(s)]):[3,22];case 20:r.sent(),r.label=21;case 21:return p++,[3,19];case 22:f=0,c=t.zeroOrAutoZIndexOrTransformedOrOpacity,r.label=23;case 23:return f<c.length?(s=c[f],[4,this.renderStack(s)]):[3,26];case 24:r.sent(),r.label=25;case 25:return f++,[3,23];case 26:a=0,n=t.positiveZIndex,r.label=27;case 27:return a<n.length?(s=n[a],[4,this.renderStack(s)]):[3,30];case 28:r.sent(),r.label=29;case 29:return a++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(t){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(t.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},e.prototype.formatPath=function(t){var o=this;t.forEach(function(y,B){var A=We(y)?y.start:y;B===0?o.ctx.moveTo(A.x,A.y):o.ctx.lineTo(A.x,A.y),We(y)&&o.ctx.bezierCurveTo(y.startControl.x,y.startControl.y,y.endControl.x,y.endControl.y,y.end.x,y.end.y)})},e.prototype.renderRepeat=function(t,o,y,B){this.path(t),this.ctx.fillStyle=o,this.ctx.translate(y,B),this.ctx.fill(),this.ctx.translate(-y,-B)},e.prototype.resizeImage=function(t,o,y){var B;if(t.width===o&&t.height===y)return t;var A=(B=this.canvas.ownerDocument)!==null&&B!==void 0?B:document,h=A.createElement("canvas");h.width=Math.max(1,o),h.height=Math.max(1,y);var m=h.getContext("2d");return m.drawImage(t,0,0,t.width,t.height,0,0,o,y),h},e.prototype.renderBackgroundImage=function(t){return Re(this,void 0,void 0,function(){var o,y,B,A,h,m;return xe(this,function(g){switch(g.label){case 0:o=t.styles.backgroundImage.length-1,y=function(w){var p,u,f,F,I,M,T,S,b,c,F,I,M,T,S,a,n,s,r,i,l,d,C,_,b,E,F,Q,U,T,S,P,I,M,K,W,L,O,H,k,G,D;return xe(this,function(R){switch(R.label){case 0:if(w.type!==0)return[3,5];p=void 0,u=w.url,R.label=1;case 1:return R.trys.push([1,3,,4]),[4,B.context.cache.match(u)];case 2:return p=R.sent(),[3,4];case 3:return R.sent(),B.context.logger.error("Error loading background-image "+u),[3,4];case 4:return p&&(f=Io(t,o,[p.width,p.height,p.width/p.height]),F=f[0],I=f[1],M=f[2],T=f[3],S=f[4],b=B.ctx.createPattern(B.resizeImage(p,T,S),"repeat"),B.renderRepeat(F,b,I,M)),[3,6];case 5:ip(w)?(c=Io(t,o,[null,null,null]),F=c[0],I=c[1],M=c[2],T=c[3],S=c[4],a=ep(w.angle,T,S),n=a[0],s=a[1],r=a[2],i=a[3],l=a[4],d=document.createElement("canvas"),d.width=T,d.height=S,C=d.getContext("2d"),_=C.createLinearGradient(s,i,r,l),bl(w.stops,n).forEach(function(N){return _.addColorStop(N.stop,Se(N.color))}),C.fillStyle=_,C.fillRect(0,0,T,S),T>0&&S>0&&(b=B.ctx.createPattern(d,"repeat"),B.renderRepeat(F,b,I,M))):op(w)&&(E=Io(t,o,[null,null,null]),F=E[0],Q=E[1],U=E[2],T=E[3],S=E[4],P=w.position.length===0?[ro]:w.position,I=pe(P[0],T),M=pe(P[P.length-1],S),K=tp(w,I,M,T,S),W=K[0],L=K[1],W>0&&L>0&&(O=B.ctx.createRadialGradient(Q+I,U+M,0,Q+I,U+M,W),bl(w.stops,W*2).forEach(function(N){return O.addColorStop(N.stop,Se(N.color))}),B.path(F),B.ctx.fillStyle=O,W!==L?(H=t.bounds.left+.5*t.bounds.width,k=t.bounds.top+.5*t.bounds.height,G=L/W,D=1/G,B.ctx.save(),B.ctx.translate(H,k),B.ctx.transform(1,0,0,G,0,0),B.ctx.translate(-H,-k),B.ctx.fillRect(Q,D*(U-k)+k,T,S*D),B.ctx.restore()):B.ctx.fill())),R.label=6;case 6:return o--,[2]}})},B=this,A=0,h=t.styles.backgroundImage.slice(0).reverse(),g.label=1;case 1:return A<h.length?(m=h[A],[5,y(m)]):[3,4];case 2:g.sent(),g.label=3;case 3:return A++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(t,o,y){return Re(this,void 0,void 0,function(){return xe(this,function(B){return this.path(Pu(y,o)),this.ctx.fillStyle=Se(t),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(t,o,y,B){return Re(this,void 0,void 0,function(){var A,h;return xe(this,function(m){switch(m.label){case 0:return o<3?[4,this.renderSolidBorder(t,y,B)]:[3,2];case 1:return m.sent(),[2];case 2:return A=cy(B,y),this.path(A),this.ctx.fillStyle=Se(t),this.ctx.fill(),h=ly(B,y),this.path(h),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(t){return Re(this,void 0,void 0,function(){var o,y,B,A,h,m,g,w,p=this;return xe(this,function(u){switch(u.label){case 0:return this.applyEffects(t.getEffects(2)),o=t.container.styles,y=!gt(o.backgroundColor)||o.backgroundImage.length,B=[{style:o.borderTopStyle,color:o.borderTopColor,width:o.borderTopWidth},{style:o.borderRightStyle,color:o.borderRightColor,width:o.borderRightWidth},{style:o.borderBottomStyle,color:o.borderBottomColor,width:o.borderBottomWidth},{style:o.borderLeftStyle,color:o.borderLeftColor,width:o.borderLeftWidth}],A=By(Zt(o.backgroundClip,0),t.curves),y||o.boxShadow.length?(this.ctx.save(),this.path(A),this.ctx.clip(),gt(o.backgroundColor)||(this.ctx.fillStyle=Se(o.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:u.sent(),this.ctx.restore(),o.boxShadow.slice(0).reverse().forEach(function(f){p.ctx.save();var c=Nn(t.curves),a=f.inset?0:yy,n=sy(c,-a+(f.inset?1:-1)*f.spread.number,(f.inset?1:-1)*f.spread.number,f.spread.number*(f.inset?-2:2),f.spread.number*(f.inset?-2:2));f.inset?(p.path(c),p.ctx.clip(),p.mask(n)):(p.mask(c),p.ctx.clip(),p.path(n)),p.ctx.shadowOffsetX=f.offsetX.number+a,p.ctx.shadowOffsetY=f.offsetY.number,p.ctx.shadowColor=Se(f.color),p.ctx.shadowBlur=f.blur.number,p.ctx.fillStyle=f.inset?Se(f.color):"rgba(0,0,0,1)",p.ctx.fill(),p.ctx.restore()}),u.label=2;case 2:h=0,m=0,g=B,u.label=3;case 3:return m<g.length?(w=g[m],w.style!==0&&!gt(w.color)&&w.width>0?w.style!==2?[3,5]:[4,this.renderDashedDottedBorder(w.color,w.width,h,t.curves,2)]:[3,11]):[3,13];case 4:return u.sent(),[3,11];case 5:return w.style!==3?[3,7]:[4,this.renderDashedDottedBorder(w.color,w.width,h,t.curves,3)];case 6:return u.sent(),[3,11];case 7:return w.style!==4?[3,9]:[4,this.renderDoubleBorder(w.color,w.width,h,t.curves)];case 8:return u.sent(),[3,11];case 9:return[4,this.renderSolidBorder(w.color,h,t.curves)];case 10:u.sent(),u.label=11;case 11:h++,u.label=12;case 12:return m++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(t,o,y,B,A){return Re(this,void 0,void 0,function(){var h,m,g,w,p,u,f,c,a,n,s,r,i,l,d,C,d,C;return xe(this,function(_){return this.ctx.save(),h=uy(B,y),m=Pu(B,y),A===2&&(this.path(m),this.ctx.clip()),We(m[0])?(g=m[0].start.x,w=m[0].start.y):(g=m[0].x,w=m[0].y),We(m[1])?(p=m[1].end.x,u=m[1].end.y):(p=m[1].x,u=m[1].y),y===0||y===2?f=Math.abs(g-p):f=Math.abs(w-u),this.ctx.beginPath(),A===3?this.formatPath(h):this.formatPath(m.slice(0,2)),c=o<3?o*3:o*2,a=o<3?o*2:o,A===3&&(c=o,a=o),n=!0,f<=c*2?n=!1:f<=c*2+a?(s=f/(2*c+a),c*=s,a*=s):(r=Math.floor((f+a)/(c+a)),i=(f-r*c)/(r-1),l=(f-(r+1)*c)/r,a=l<=0||Math.abs(a-i)<Math.abs(a-l)?i:l),n&&(A===3?this.ctx.setLineDash([0,c+a]):this.ctx.setLineDash([c,a])),A===3?(this.ctx.lineCap="round",this.ctx.lineWidth=o):this.ctx.lineWidth=o*2+1.1,this.ctx.strokeStyle=Se(t),this.ctx.stroke(),this.ctx.setLineDash([]),A===2&&(We(m[0])&&(d=m[3],C=m[0],this.ctx.beginPath(),this.formatPath([new q(d.end.x,d.end.y),new q(C.start.x,C.start.y)]),this.ctx.stroke()),We(m[1])&&(d=m[1],C=m[2],this.ctx.beginPath(),this.formatPath([new q(d.end.x,d.end.y),new q(C.start.x,C.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(t){return Re(this,void 0,void 0,function(){var o;return xe(this,function(y){switch(y.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Se(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),o=ay(t),[4,this.renderStack(o)];case 1:return y.sent(),this.applyEffects([]),[2,this.canvas]}})})},e}(Mu),wy=function(v){return v instanceof iu||v instanceof nu?!0:v instanceof wo&&v.type!==Hn&&v.type!==Mn},By=function(v,e){switch(v){case 0:return Nn(e);case 2:return ry(e);case 1:default:return Vn(e)}},Cy=function(v){switch(v){case 1:return"center";case 2:return"right";case 0:default:return"left"}},by=["-apple-system","system-ui"],_y=function(v){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?v.filter(function(e){return by.indexOf(e)===-1}):v},Ey=function(v){Xe(e,v);function e(t,o){var y=v.call(this,t,o)||this;return y.canvas=o.canvas?o.canvas:document.createElement("canvas"),y.ctx=y.canvas.getContext("2d"),y.options=o,y.canvas.width=Math.floor(o.width*o.scale),y.canvas.height=Math.floor(o.height*o.scale),y.canvas.style.width=o.width+"px",y.canvas.style.height=o.height+"px",y.ctx.scale(y.options.scale,y.options.scale),y.ctx.translate(-o.x,-o.y),y.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+o.width+"x"+o.height+" at "+o.x+","+o.y+") with scale "+o.scale),y}return e.prototype.render=function(t){return Re(this,void 0,void 0,function(){var o,y;return xe(this,function(B){switch(B.label){case 0:return o=vo(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,Fy(o)];case 1:return y=B.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Se(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(y,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e}(Mu),Fy=function(v){return new Promise(function(e,t){var o=new Image;o.onload=function(){e(o)},o.onerror=t,o.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(v))})},Qy=function(){function v(e){var t=e.id,o=e.enabled;this.id=t,this.enabled=o,this.start=Date.now()}return v.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,en([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},v.prototype.getTime=function(){return Date.now()-this.start},v.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,en([this.id,this.getTime()+"ms"],e))},v.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,en([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},v.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,en([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},v.instances={},v}(),Sy=function(){function v(e,t){var o;this.windowBounds=t,this.instanceName="#"+v.instanceCount++,this.logger=new Qy({id:this.instanceName,enabled:e.logging}),this.cache=(o=e.cache)!==null&&o!==void 0?o:new Jv(this,e)}return v.instanceCount=1,v}(),Uy=function(v,e){return e===void 0&&(e={}),Ty(v,e)};typeof window<"u"&&Fu.setContext(window);var Ty=function(v,e){return Re(void 0,void 0,void 0,function(){var t,o,y,B,A,h,m,g,w,p,u,f,c,a,n,s,r,i,l,d,_,C,_,b,E,F,Q,U,T,S,P,I,M,K,W,L,O,H,k,G;return xe(this,function(D){switch(D.label){case 0:if(!v||typeof v!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=v.ownerDocument,!t)throw new Error("Element is not attached to a Document");if(o=t.defaultView,!o)throw new Error("Document is not attached to a Window");return y={allowTaint:(b=e.allowTaint)!==null&&b!==void 0?b:!1,imageTimeout:(E=e.imageTimeout)!==null&&E!==void 0?E:15e3,proxy:e.proxy,useCORS:(F=e.useCORS)!==null&&F!==void 0?F:!1},B=Mi({logging:(Q=e.logging)!==null&&Q!==void 0?Q:!0,cache:e.cache},y),A={windowWidth:(U=e.windowWidth)!==null&&U!==void 0?U:o.innerWidth,windowHeight:(T=e.windowHeight)!==null&&T!==void 0?T:o.innerHeight,scrollX:(S=e.scrollX)!==null&&S!==void 0?S:o.pageXOffset,scrollY:(P=e.scrollY)!==null&&P!==void 0?P:o.pageYOffset},h=new ot(A.scrollX,A.scrollY,A.windowWidth,A.windowHeight),m=new Sy(B,h),g=(I=e.foreignObjectRendering)!==null&&I!==void 0?I:!1,w={allowTaint:(M=e.allowTaint)!==null&&M!==void 0?M:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:g,copyStyles:g},m.logger.debug("Starting document clone with size "+h.width+"x"+h.height+" scrolled to "+-h.left+","+-h.top),p=new _u(m,v,w),u=p.clonedReferenceElement,u?[4,p.toIFrame(t,h)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return f=D.sent(),c=Co(u)||Iv(u)?sf(u.ownerDocument):tn(m,u),a=c.width,n=c.height,s=c.left,r=c.top,i=Iy(m,u,e.backgroundColor),l={canvas:e.canvas,backgroundColor:i,scale:(W=(K=e.scale)!==null&&K!==void 0?K:o.devicePixelRatio)!==null&&W!==void 0?W:1,x:((L=e.x)!==null&&L!==void 0?L:0)+s,y:((O=e.y)!==null&&O!==void 0?O:0)+r,width:(H=e.width)!==null&&H!==void 0?H:Math.ceil(a),height:(k=e.height)!==null&&k!==void 0?k:Math.ceil(n)},g?(m.logger.debug("Document cloned, using foreign object rendering"),_=new Ey(m,l),[4,_.render(u)]):[3,3];case 2:return d=D.sent(),[3,5];case 3:return m.logger.debug("Document cloned, element located at "+s+","+r+" with size "+a+"x"+n+" using computed rendering"),m.logger.debug("Starting DOM parsing"),C=au(m,u),i===C.styles.backgroundColor&&(C.styles.backgroundColor=at.TRANSPARENT),m.logger.debug("Starting renderer for element at "+l.x+","+l.y+" with size "+l.width+"x"+l.height),_=new my(m,l),[4,_.render(C)];case 4:d=D.sent(),D.label=5;case 5:return(!((G=e.removeContainer)!==null&&G!==void 0)||G)&&(_u.destroy(f)||m.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),m.logger.debug("Finished rendering"),[2,d]}})})},Iy=function(v,e,t){var o=e.ownerDocument,y=o.documentElement?mr(v,getComputedStyle(o.documentElement).backgroundColor):at.TRANSPARENT,B=o.body?mr(v,getComputedStyle(o.body).backgroundColor):at.TRANSPARENT,A=typeof t=="string"?mr(v,t):t===null?at.TRANSPARENT:4294967295;return e===o.documentElement?gt(y)?gt(B)?A:B:y:A};const Xr=class Xr extends j.EngineObject{constructor(t,o){super(t,o);z(this,"_imageLabel",this.dv(new j.ESImageLabel(`${this.sceneObject.id}_ESImageLabel`)));z(this,"_hasClassDivAndPos",{});const y=o.viewer;if(!y){console.warn("viewer is undefined!");return}t.mainClass=this._imageLabel;const B=this._imageLabel;o.add(B),this.d(()=>o.delete(B));{const A=()=>{if(!y)return;if(!t.instanceClass)throw new Error("!sceneObject.instanceClass");const g=document.createElement("div"),w=this.dv(new t.instanceClass(g,t,o))._container;if(w.style.opacity=t.opacity.toString()??j.ESGeoDiv.defaults.opacity,w.style.position="fixed",w.style.zIndex="-1",w.style.top="0px",!document.body.contains(w)){document.body.appendChild(w);let u=w?w.querySelectorAll("*[class]"):[];for(let f=0;f<u.length;f++){const c=u[f];var p=c.getBoundingClientRect();this._hasClassDivAndPos[c.className]=[c.offsetLeft,c.offsetTop,c.offsetLeft+p.width,c.offsetTop+p.height]}}Uy(w,{backgroundColor:null,allowTaint:!0,useCORS:!0,width:w.offsetWidth,height:w.offsetHeight,scale:1}).then(u=>{document.body.contains(w)&&document.body.removeChild(w),B.url=u.toDataURL(),B.show=t.show}).catch(()=>{document.body.contains(w)&&document.body.removeChild(w)})},h=()=>{try{t.instanceClass?A():(B.url="",B.show=!1)}catch(g){console.error(g)}};h();const m=this.dv(V.createNextAnimateFrameEvent(t.instanceClassChanged,t.opacityChanged));this.d(m.don(h))}{const A=()=>{B.show=t.show};B.show=!1,this.ad(t.showChanged.don(A))}this.d(V.track([B,"anchor"],[t,"anchor"])),this.d(V.bind([B,"position"],[t,"position"])),this.d(V.bind([B,"rotation"],[t,"rotation"])),this.d(V.bind([B,"flyToParam"],[t,"flyToParam"])),this.d(V.bind([B,"flyInParam"],[t,"flyInParam"])),this.d(V.bind([B,"allowPicking"],[t,"allowPicking"])),this.d(V.bind([B,"scale"],[t,"scale"])),this.d(V.track([B,"minVisibleDistance"],[t,"minVisibleDistance"])),this.d(V.track([B,"maxVisibleDistance"],[t,"maxVisibleDistance"])),this.ad(t.automaticLandingEvent.don(()=>{B.automaticLanding()})),this.d(B.pickedEvent.don(A=>{(t.allowPicking??!1)&&t.pickedEvent.emit(A)})),this.d(o.widgetEvent.don(A=>{if(A.objId!==this._imageLabel.id)return;const{type:h,add:m}=A;if(h==="leftClick"&&m){const g=(m==null?void 0:m.classNames)??[],w=Object.keys(this._hasClassDivAndPos);for(let p=0;p<w.length;p++){const u=w[p];let f=this._hasClassDivAndPos[u];m&&m.mouseRelativePos&&m.mouseRelativePos[0]>=f[0]&&m.mouseRelativePos[0]<=f[2]&&m.mouseRelativePos[1]>=f[1]&&m.mouseRelativePos[1]<=f[3]&&g.push(u)}m.classNames=g}t.widgetEvent.emit({type:h,add:m})})),this.d(t.calcFlyToParamEvent.don(()=>{Lt(y,B.id)})),this.d(t.calcFlyInParamEvent.don(()=>{const A=o.getCurrentCameraInfo();if(!A)return;const{position:h,rotation:m}=A;t.flyInParam={position:h,rotation:m,flyDuration:1}})),this.d(t.smoothMoveEvent.don((A,h)=>{zA(y,B.id,A,h)})),this.d(t.smoothMoveWithRotationEvent.don((A,h,m)=>{GA(y,B.id,A,h,m)})),this.d(t.smoothMoveOnGroundEvent.don((A,h,m,g)=>{jA(y,B.id,A,h,g,m)})),this.d(t.smoothMoveWithRotationOnGroundEvent.don((A,h,m,g,w)=>{WA(y,B.id,A,h,m,g,w)})),this.d(t.flyToEvent.don((A,h)=>{B.flyTo(A)})),this.d(t.flyInEvent.don(A=>{B.flyIn(A)}))}};z(Xr,"type",Xr.register("ESUeViewer",j.ESGeoDiv.type,Xr));let Po=Xr;const Yr=class Yr extends De{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.d(e.flyToFeatureIndexEvent.don((y,B)=>{o.callUeFunc({f:"flyToFeatureIndex",p:{id:e.id,index:y,duration:B}})})),this.d(e.flyToFeatureEvent.don((y,B,A)=>{o.callUeFunc({f:"flyToFeature",p:{id:e.id,key:y,value:B,duration:A}})}))}};z(Yr,"type",Yr.register("ESUeViewer",j.ESGeoJson.type,Yr));let xo=Yr;const $r=class $r extends Pe{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z($r,"type",$r.register("ESUeViewer",j.ESGeoLineString.type,$r));let Jn=$r;const Zr=class Zr extends Pe{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(Zr,"type",Zr.register("ESUeViewer",j.ESGeoRectangle.type,Zr));let Oo=Zr;const qr=class qr extends Ne{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(qr,"type",qr.register("ESUeViewer",j.ESGeoWater.type,qr));let Mo=qr;const Pt=class Pt extends de{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.d(e.setNodePositionEvent.don((y,B)=>{Rs(o,e.id,y,B)})),this.d(e.setNodeRotationEvent.don((y,B)=>{ks(o,e.id,y,B)})),this.d(e.setNodeScaleEvent.don((y,B)=>{Ks(o,e.id,y,B)}))}};z(Pt,"forceUeUpdateProps",[...de.forceUeUpdateProps,"url"]),z(Pt,"propValFuncs",{...de.propValFuncs,url:e=>typeof e=="string"?j.ESSceneObject.context.getStrFromEnv(j.rpToap(e)):(e.url=j.ESSceneObject.context.getStrFromEnv(j.rpToap(e.url)),e),czmMaximumScale:null,czmMinimumPixelSize:null,czmNativeScale:null,czmColor:null}),z(Pt,"type",Pt.register("ESUeViewer",j.ESGltfModel.type,Pt));let Ho=Pt;const eA=class eA extends Pe{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(eA,"type",eA.register("ESUeViewer",j.ESHeightMeasurement.type,eA));let Lo=eA;const tA=class tA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const y=async(A,h,m,g)=>{const{viewer:w}=A;if(!w){console.error("AIMoveTo: ueViewer.viewer is undefined");return}const p=await w.callUeFunc({f:"AIMoveTo",p:{id:h,Destination:m,Time:g}});return p.error&&console.error("AIMoveTo:",p.error),p};this.d(e.aiMoveToEvent.don((A,h)=>{y(t,e.id,A,h)}));const B=async(A,h)=>{const{viewer:m}=A;if(!m){console.error("StopAIMove: ueViewer.viewer is undefined");return}const g=await m.callUeFunc({f:"StopAIMove",p:{id:h}});return g.error&&console.error("StopAIMove:",g.error),g};this.d(e.stopAIMoveEvent.don(()=>{B(t,e.id)}))}};z(tA,"type",tA.register("ESUeViewer",j.ESHuman.type,tA));let Do=tA;const xt=class xt extends $e{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}e.anchor=[.5,1]}};z(xt,"type",xt.register("ESUeViewer",j.ESImageLabel.type,xt)),z(xt,"forceUeUpdateProps",[...$e.forceUeUpdateProps,"url"]),z(xt,"propValFuncs",{...$e.propValFuncs,url:e=>typeof e=="string"?j.ESSceneObject.context.getStrFromEnv(j.rpToap(e)):(e.url=j.ESSceneObject.context.getStrFromEnv(j.rpToap(e.url)),e)});let Ro=xt;const rA=class rA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(rA,"type",rA.register("ESUeViewer",j.ESLevelRuntimeModel.type,rA));let ko=rA;const AA=class AA extends $A{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(AA,"type",AA.register("ESUeViewer",j.ESLocalCircle.type,AA));let Ko=AA;const nA=class nA extends De{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(nA,"type",nA.register("ESUeViewer",j.ESLocalPolygonZ.type,nA));let No=nA;const iA=class iA extends $A{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(iA,"type",iA.register("ESUeViewer",j.ESLocalRectangle.type,iA));let Vo=iA;const oA=class oA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(oA,"type",oA.register("ESUeViewer",j.ESLocalSkyBox.type,oA));let Go=oA;const sA=class sA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(sA,"type",sA.register("ESUeViewer",j.ESLocationMeasurement.type,sA));let jo=sA;const aA=class aA extends Pe{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(aA,"type",aA.register("ESUeViewer",j.ESPipeFence.type,aA));let Wo=aA;const cA=class cA extends Jn{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(cA,"type",cA.register("ESUeViewer",j.ESPipeline.type,cA));let zo=cA;const lA=class lA extends ZA{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.d(e.highlightFeatureEvent.don(y=>{const B=typeof y=="number"?y.toString():y;Ms(o,e.id,B)})),this.d(e.highlightFeatureAndFlyToEvent.don((y,B,A,h)=>{const m=typeof y=="number"?y.toString():y;Hs(o,e.id,m,h??1)})),this.d(e.setLayerVisibleEvent.don((y,B)=>{let A="";typeof B!="string"?A=JSON.stringify(B):A=B,Ls(o,e.id,A)})),this.d(e.setLayerColorEvent.don((y,B)=>{let A="";typeof B!="string"?A=JSON.stringify(B):A=B,Ds(o,e.id,A)}))}};z(lA,"type",lA.register("ESUeViewer",j.ESPipeserTileset.type,lA));let Jo=lA;const uA=class uA extends Ne{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(uA,"type",uA.register("ESUeViewer",j.ESPit.type,uA));let Xo=uA;const dA=class dA extends $e{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.ad(e.getInitialStyleEvent.don(async()=>{try{const y=await o.callUeFunc({f:"GetInitialStyle",p:{id:e.id}});y.error!=""&&console.error("getInitialStyleEvent:",y.error),e.initialStyle.value=structuredClone(y.re)}catch(y){console.error("getInitialStyleEvent:",y),e.initialStyle.value=void 0}}))}};z(dA,"type",dA.register("ESUeViewer",j.ESPoi2D.type,dA));let Yo=dA;const fA=class fA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(fA,"type",fA.register("ESUeViewer",j.ESPoi3D.type,fA));let $o=fA;const Ot=class Ot extends De{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(Ot,"type",Ot.register("ESUeViewer",j.ESPoiTileset.type,Ot)),z(Ot,"forceUeUpdateProps",[...De.forceUeUpdateProps,"url"]),z(Ot,"propValFuncs",{...De.propValFuncs,url:e=>typeof e=="string"?j.ESSceneObject.context.getStrFromEnv(e):(e.url=j.ESSceneObject.context.getStrFromEnv(e.url),e)});let Zo=Ot;const hA=class hA extends Pe{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(hA,"type",hA.register("ESUeViewer",j.ESPolygonFence.type,hA));let qo=hA;const pA=class pA extends Ne{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(pA,"type",pA.register("ESUeViewer",j.ESPolygonFlattenedPlane.type,pA));let es=pA;const gA=class gA extends Ne{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(gA,"type",gA.register("ESUeViewer",j.ESPolygonWithHole.type,gA));let ts=gA;const vA=class vA extends _t{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(()=>{e.ids=[]}),this.d(e.highlightInner3DtilesetEvent.don(y=>{y.highlight=!0})),this.d(e.removeHighlightInner3DtilesetEvent.don(y=>{y.highlight=!1}));{const y=h=>{h=h.toLocaleLowerCase();let m=[255,255,255,1];if(h.startsWith("#")){if(h.length===4){let g=parseInt(h[1]+h[1],16),w=parseInt(h[2]+h[2],16),p=parseInt(h[3]+h[3],16);m=[g,w,p,1]}else if(h.length===7){let g=parseInt(h.substring(1,3),16),w=parseInt(h.substring(3,5),16),p=parseInt(h.substring(5,7),16);m=[g,w,p,1]}}else if(h.startsWith("rgba")){let g=h.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/);if(g){let w=parseInt(g[1]),p=parseInt(g[2]),u=parseInt(g[3]),f=parseFloat(g[4]);m=[w,p,u,f]}}else if(h.startsWith("rgb")){let g=h.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);if(g){let w=parseInt(g[1]),p=parseInt(g[2]),u=parseInt(g[3]);m=[w,p,u,1]}}else console.error("color类型只能为#rrggbb、#rgb、rgba(r,g,b,a)、rgb(r,g,b)");return[m[0]/255,m[1]/255,m[2]/255,m[3]]},B=()=>{const h=e.layerConfig;if(!h)return;const m=[];h.forEach(g=>{m.push({condition:[{field:"layer",op:"==",value:g.layer},{field:"dataset",op:"==",value:g.dataset}],color:y(g.value.color??"rgb(255,255,255)"),show:g.value.visible})}),e.setFeatureStyle(m)};B();const A=this.dv(V.createNextAnimateFrameEvent(e.layerConfigChanged));this.d(A.don(()=>{B()}))}}};z(vA,"type",vA.register("ESUeViewer",j.ESRtsTileset.type,vA));let rs=vA;const yA=class yA extends De{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(e.addTreesEvent.don(y=>{j.addTreesCallFunc(t,e.id,y)})),this.d(e.removeAllTreesEvent.don(()=>{j.removeAllTreesCallFunc(t,e.id)})),this.d(e.updateTreeParamsEvent.don(y=>{j.updateTreeParamsCallFunc(t,e.id,y)})),this.d(e.cutDownTreesEvent.don((y,B)=>{j.cutDownTreesCallFunc(t,e.id,y,B)})),this.d(e.growthSimulationEvent.don((y,B,A)=>{j.growthSimulationCallFunc(t,e.id,y,B,A)}))}};z(yA,"type",yA.register("ESUeViewer",j.ESSeparateFoliage.type,yA));let As=yA;const mA=class mA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(mA,"type",mA.register("ESUeViewer",j.ESSubmergingAnalysis.type,mA));let ns=mA;const wA=class wA extends Ne{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{o.callUeFunc({f:"Start",p:{id:e.id}})})),this.d(e.stopEvent.don(()=>{o.callUeFunc({f:"Stop",p:{id:e.id}})}))}};z(wA,"type",wA.register("ESUeViewer",j.ESSunshineAnalysis.type,wA));let is=wA;const BA=class BA extends Ne{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{o.callUeFunc({f:"Start",p:{id:e.id}})}))}};z(BA,"type",BA.register("ESUeViewer",j.ESSurfaceAreaMeasurement.type,BA));let os=BA;const CA=class CA extends $e{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(CA,"type",CA.register("ESUeViewer",j.ESTextLabel.type,CA));let ss=CA;const qt=class qt extends $e{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.d(e.callFunctionEvent.don(async(y,B)=>{const A=await ti(o,e.id,y,B);e.__callFunctionResultEvent.emit(A)}))}};z(qt,"type",qt.register("ESUeViewer",j.ESUEWidget.type,qt)),z(qt,"propValFuncs",{...$e.propValFuncs,info:e=>JSON.stringify(e??{})});let as=qt;const Hu=v=>{switch(v){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"未搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是场景原有的,而是新建的,无法绑定";case 4:return"搜索到ActorTag对应的Actor是地形或3DTileset,无法绑定";default:return"未知错误"}},Py=v=>{switch(v){case 0:return"创建成功";case 1:return"未找到对应的资源,无法创建";case 2:return"Id与场景中现有的ActorTag重复,创建后可能出现问题,创建失败";default:return"未知错误"}},bA=class bA extends j.EngineObject{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn(`${e.id} UeESUnrealActor viewer is undefined!`);return}this.d(()=>{qn(o,e.id)});const y=async()=>{g()||await o.callUeFunc({f:"update",p:{id:e.id,name:e.name,show:e.show,rotation:e.rotation,flyToParam:e.flyToParam??j.ESVisualObject.defaults.flyToParam,flyInParam:e.flyInParam??j.ESVisualObject.defaults.flyInParam,highlight:e.highlight,collision:e.collision,scale:e.scale,minVisibleDistance:e.minVisibleDistance,maxVisibleDistance:e.maxVisibleDistance}})},B=this.dv(V.createNextAnimateFrameEvent(e.showChanged,e.nameChanged,e.rotationChanged,e.flyToParamChanged,e.flyInParamChanged,e.highlightChanged,e.collisionChanged,e.scaleChanged,e.minVisibleDistanceChanged,e.maxVisibleDistanceChanged));this.d(B.don(y)),this.d(e.flushEvent.don(()=>B.flush()));let A,h;const m=async()=>{g()||(await o.callUeFunc({f:"update",p:{id:e.id,position:e.position}}),(t.debug??!1)&&console.log(`updatePostion:${e.position},actorTag:${e.actorTag},actorClass:${e.actorClass}`))},g=()=>!A&&!h?(console.warn(`${e.id} 未绑定ActorTag或未创建ActorClass!`),!0):!1,w=async()=>{const{id:u}=e,f=await t.unBindActorByID(u);f&&f.error!==""&&console.warn(`${e.id} UeESUnrealActor UnBindActorByID: ${f.error}`),A=void 0;const c=await o.callUeFunc({f:"destroy",p:{id:u}});if(c&&c.error!==""){console.warn(`${e.id} UeESUnrealActor DestroyActorByID: ${c.error}`);return}h=void 0},p=this.dv(V.react({type:"ActorClass",actorClass:"default"}));{const u=this.dv(V.createNextAnimateFrameEvent(e.actorClassChanged,e.actorTagChanged)),f=async()=>{e.actorTag!==""?p.value={type:"ActorTag",actorTag:e.actorTag}:p.value={type:"ActorClass",actorClass:e.actorClass===""?"default":e.actorClass}};f(),this.d(u.don(f)),this.d(e.flushEvent.don(()=>u.flush()))}{const u=this.dv(V.createProcessingFromAsyncFunc(async c=>{if(await c.promise(w()),p.value.type==="ActorTag"){const{actorTag:a}=p.value;await c.promise(w());try{e.lastActorStatus="null";const n=await c.promise(t.bindActorByTag(e.id,a));if(!n)return;if(n.error!==""){console.warn(`${e.id} UeESUnrealActor BindActorByTag:${a},${n.error}`);return}if(n.re.type===0)e.lastActorStatus="bound",A=a;else if(n.re.type===1)e.lastActorStatus="bound",A=a,console.warn(`${e.id} UeESUnrealActor BindActorByTag:${a},${Hu(n.re.type)}`);else{A=void 0,console.warn(`${e.id} UeESUnrealActor BindActorByTag error:${a}, ${Hu(n.re.type)}`);return}}catch(n){console.warn(`${e.id} UeESUnrealActor BindActorByTag catch error:${a}, ${n}`);return}}else if(p.value.type==="ActorClass"){const{actorClass:a}=p.value;try{const n=await c.promise(t.createActorByClass(e.id,a));if(!n)return;if(n.error!==""){console.warn(`${e.id} UeESUnrealActor CreateActorByClass error :${a}, ${n.error}`);return}if(n.re.type===0)e.lastActorStatus="created",h=a;else{console.warn(`${e.id} UeESUnrealActor CreateActorByClass error type :${a},${Py(n.re.type)}`);return}}catch(n){console.warn(`${e.id} UeESUnrealActor CreateActorByClass error catch :${a}, ${JSON.stringify(n)}`);return}}await c.promise(y()),await c.promise(m())})),f=async()=>{u.restart()};f(),this.d(p.changed.don(f))}this.d(e.positionChanged.don(m)),this.d(e.callFunctionEvent.don(async(u,f)=>{if(g()){e.__callFunctionResultEvent.emit(void 0);return}const c=await ti(o,e.id,u,f);e.__callFunctionResultEvent.emit(c)})),this.d(e.smoothMoveEvent.don((u,f)=>{g()||zA(o,e.id,u,f)})),this.d(e.smoothMoveWithRotationEvent.don((u,f,c)=>{g()||GA(o,e.id,u,f,c)})),this.d(e.smoothMoveOnGroundEvent.don((u,f,c,a)=>{g()||jA(o,e.id,u,f,a,c)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((u,f,c,a,n)=>{g()||WA(o,e.id,u,f,c,a,n)})),this.d(e.automaticLandingEvent.don(u=>{if(g())return;const f=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(c=>{c!==null&&(e.position=[...f,c],e.collision=u)})})),this.d(e.flyToEvent.don(async(u,f)=>{if(g())return;const c=await Ht(o,e.id,u);let a="over";c===void 0?a="error":c.endType===0?a="over":c.endType===1&&(a="cancelled"),e.flyOverEvent.emit(f,a,t)})),this.d(e.calcFlyToParamEvent.don(()=>{g()||Lt(o,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const u=await t.getCurrentCameraInfo();if(!u)return;const{position:f,rotation:c}=u;e.flyInParam={position:f,rotation:c,flyDuration:1}})),this.d(t.propChanged.don(u=>{g()||u.objId===e.id&&Object.keys(u.props).forEach(f=>{const c=u.props[f]===null?void 0:u.props[f];e[f]=c})}))}};z(bA,"type",bA.register("ESUeViewer",j.ESUnrealActor.type,bA));let cs=bA;const _A=class _A extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(_A,"type",_A.register("ESUeViewer",j.ESVideoFusion.type,_A));let ls=_A;const EA=class EA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(EA,"type",EA.register("ESUeViewer",j.ESViewShed.type,EA));let us=EA;const FA=class FA extends Pe{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};z(FA,"type",FA.register("ESUeViewer",j.ESVisibilityAnalysis.type,FA));let ds=FA;const QA=class QA extends Ne{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{o.callUeFunc({f:"Start",p:{id:e.id}})})),this.d(e.clearEvent.don(()=>{o.callUeFunc({f:"Clear",p:{id:e.id}})}))}};z(QA,"type",QA.register("ESUeViewer",j.ESVolumeMeasurement.type,QA));let fs=QA;const er=class er extends $e{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(er,"type",er.register("ESUeViewer",j.ESWidget.type,er)),z(er,"propValFuncs",{...$e.propValFuncs,info:e=>JSON.stringify(e??{})});let hs=er;const SA=class SA extends j.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=""})}};z(SA,"type",SA.register("ESUeViewer",j.ESHumanPoi.type,SA));let ps=SA;j.ESSceneObject.context.getStrFromEnv(j.ESNavigator.defaults.imgUrl);const UA=class UA extends j.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const y=this.disposeVar(new j.ESCustomDiv);t.add(y),this.dispose(()=>t.delete(y)),this.dispose(V.track([y,"show"],[e,"show"])),y.instanceClass=class extends V.Destroyable{constructor(A,h,m){super(),this._subContainer=A;const g=document.createElement("div");this._subContainer.appendChild(g),this.dispose(()=>this._subContainer.removeChild(g));{const u=async()=>{const f=await t.getCurrentCameraInfo(),c=f==null?void 0:f.position,n=[...f==null?void 0:f.rotation];n[0]=360,t.flyIn(c,n)};g.addEventListener("click",u),g.style.cursor="pointer",this.dispose(()=>g.removeEventListener("click",u))}{const u=()=>{g.style.width=`${e.cssSize?e.cssSize:j.ESNavigator.defaults.cssSize}px`,g.style.height=`${e.cssSize?e.cssSize:j.ESNavigator.defaults.cssSize}px`};u(),e.dispose(e.cssSizeChanged.disposableOn(u))}g.style.position="fixed";{const u=()=>{g.style.top=`${e.cssPosition?e.cssPosition[0]:j.ESNavigator.defaults.cssPosition[0]}px`,g.style.right=`${e.cssPosition?e.cssPosition[1]:j.ESNavigator.defaults.cssPosition[1]}px`};u(),e.dispose(e.cssPositionChanged.disposableOn(u))}g.style.transition=" right 0.4s linear",g.style.cursor="pointer";const w=document.createElement("div");g.appendChild(w),this.dispose(()=>g.removeChild(w)),w.style.width="100%",w.style.height="100%",w.style.position="relative";const p=document.createElement("img");w.appendChild(p),this.dispose(()=>w.removeChild(p)),p.style.width="100%",p.style.height="100%",p.style.border="none";{const u=()=>p.src=e.imgUrl;u(),e.dispose(e.imgUrlChanged.disposableOn(u))}{const u=()=>{const n=-t.getCurrentCameraInfo().rotation[0];p.style.transform=`rotate(${n}deg)`};let f;const c=async()=>{u(),e.show?(g.style.display="block",f=setInterval(()=>{u()},1e3)):(g.style.display="none",clearInterval(f))};this.dispose(e.showChanged.disposableOn(c)),c(),this.dispose(()=>clearInterval(f))}p.style.transformOrigin="50% 50%"}}}};z(UA,"type",UA.register("ESUeViewer",j.ESNavigator.type,UA));let gs=UA;const Mt=class Mt extends Pe{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}{const y=()=>{let B=e.materialMode==="blue"?"multipleArrows":e.materialMode==="purple"?"singleArrow":e.materialMode;o.callUeFunc({f:"update",p:{id:e.id,materialMode:B}})};this.dispose(e.materialModeChanged.disposableOn(y)),this.dispose(e.createdEvent.disposableOn(y))}}};z(Mt,"type",Mt.register("ESUeViewer",j.ESPath.type,Mt)),z(Mt,"forceUeUpdateProps",[...Pe.forceUeUpdateProps]),z(Mt,"propValFuncs",{...Pe.propValFuncs,materialMode:null});let vs=Mt;async function xy(v){navigator.clipboard.writeText(v).then(function(){console.log("复制成功")},function(e){console.log("复制失败")})}const TA=class TA extends j.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const y=this.disposeVar(new j.ESCustomDiv);t.add(y),this.dispose(()=>t.delete(y)),y.instanceClass=class extends V.Destroyable{constructor(A,h,m){if(super(),this._subContainer=A,!m||!(m instanceof it))return;const g=document.createElement("div");this._subContainer.appendChild(g),this.dispose(()=>this._subContainer.removeChild(g)),g.style.width="100%",g.style.position="absolute",g.style.height=`${j.ESViewerStatusBar.defaults.height}px`,g.style.left="0",g.style.bottom="0",g.style.color="#fff",g.style.padding="0 20px 0 0",g.style.boxSizing="border-box",g.style.lineHeight=`${j.ESViewerStatusBar.defaults.height}px`,g.style.zIndex="100",g.style.alignContent="center",g.style.justifyContent="space-between";const w=document.createElement("span");g.appendChild(w),this.dispose(()=>g.removeChild(w));const p=document.createElement("span");w.appendChild(p),this.dispose(()=>w.removeChild(p));const u=document.createElement("span");w.appendChild(u),u.addEventListener("dblclick",function(){let c=u.innerHTML;c.startsWith("鼠标位置")&&(c=c.slice(5)),xy(c)}),u.style.cursor="pointer",this.dispose(()=>w.removeChild(u));const f=document.createElement("span");g.appendChild(f),this.dispose(()=>g.removeChild(f));{const c=()=>{g.style.height=(e.height??j.ESViewerStatusBar.defaults.height)+"px",g.style.lineHeight=(e.height??j.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(c)),c()}{const c=()=>{g.style.fontSize=(e.fontSize??j.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(c)),c()}{const c=()=>{e.bgColor?g.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:g.style.background=`rgba(${j.ESViewerStatusBar.defaults.bgColor[0]},${j.ESViewerStatusBar.defaults.bgColor[1]},${j.ESViewerStatusBar.defaults.bgColor[2]},${j.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(c)),c()}m.getVersion().then(c=>{c&&(f.innerText=`Ue 版本 : ${c[0]} `)}).catch(c=>{console.log(c)});{const c=()=>{let s="",r="";s+=`帧率:${m.getFPS().toFixed(0)}FPS`,p.innerText=s;const i=t.getCurrentCameraInfo();s+=` 经度: ${i.position[0].toFixed(5)}° 纬度: ${i.position[1].toFixed(5)}° 高度: ${i.position[2].toFixed(2)}米 偏航角: ${i.rotation[0].toFixed(2)}° 俯仰角: ${i.rotation[1].toFixed(2)}° 翻滚角:${i.rotation[2].toFixed(2)}° `,p.innerText=s,t.pick().then(l=>{if(l){const{pickResult:d}=l;if(d&&d.position){const{position:C}=d;r+=`鼠标位置:${C[0].toFixed(5)}° ${C[1].toFixed(5)}° ${C[2].toFixed(2)}m`}else r+="暂时无法获取鼠标位置...";u.innerText=r}}).catch(l=>{console.log(l)})};let a;const n=async()=>{c(),e.show?(g.style.display="flex",a=setInterval(()=>{c()},1e3)):(g.style.display="none",clearInterval(a))};this.dispose(e.showChanged.disposableOn(n)),n(),this.dispose(()=>clearInterval(a))}}}}};z(TA,"type",TA.register("ESUeViewer",j.ESViewerStatusBar.type,TA));let ys=TA;const IA=class IA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(IA,"type",IA.register("ESUeViewer",j.ESGaussianSplatting.type,IA));let ms=IA;const PA=class PA extends _t{constructor(t,o){super(t,o);z(this,"_es3DTileset",this.dv(new j.ES3DTileset(`${this.sceneObject.id}_ES3DTileset`)));if(!o.viewer){console.warn("viewer is undefined!");return}t.mainClass=this._es3DTileset;{const B=this._es3DTileset;o.add(B),this.dispose(()=>o.delete(B)),this.d(V.track([B,"allowPicking"],[t,"allowPicking"])),this.d(V.track([B,"collision"],[t,"collision"])),this.d(V.bind([B,"flyToParam"],[t,"flyToParam"])),this.d(V.bind([B,"flyToParam"],[t,"flyToParam"])),this.d(V.track([B,"url"],[t,"url"])),this.d(V.track([B,"actorTag"],[t,"actorTag"])),this.d(V.track([B,"materialMode"],[t,"materialMode"])),this.d(V.track([B,"highlight"],[t,"highlight"])),this.d(V.track([B,"maximumScreenSpaceError"],[t,"maximumScreenSpaceError"])),this.d(V.track([B,"highlightID"],[t,"highlightID"])),this.d(V.track([B,"highlightColor"],[t,"highlightColor"])),this.d(V.bind([B,"offset"],[t,"offset"])),this.d(V.bind([B,"rotation"],[t,"rotation"])),this.d(V.track([B,"czmImageBasedLightingFactor"],[t,"czmImageBasedLightingFactor"])),this.d(V.track([B,"czmLuminanceAtZenith"],[t,"czmLuminanceAtZenith"])),this.d(V.track([B,"czmMaximumMemoryUsage"],[t,"czmMaximumMemoryUsage"])),this.d(V.track([B,"czmClassificationType"],[t,"czmClassificationType"])),this.d(V.track([B,"czmStyleJson"],[t,"czmStyleJson"])),this.d(V.track([B,"czmBackFaceCulling"],[t,"czmBackFaceCulling"])),this.d(V.track([B,"czmDebugShowBoundingVolume"],[t,"czmDebugShowBoundingVolume"])),this.d(V.track([B,"czmDebugShowContentBoundingVolume"],[t,"czmDebugShowContentBoundingVolume"])),this.d(V.track([B,"colorBlendMode"],[t,"colorBlendMode"])),this.d(V.track([B,"cacheBytes"],[t,"cacheBytes"])),this.d(V.track([B,"clippingPlaneEnabled"],[t,"clippingPlaneEnabled"])),this.d(V.track([B,"unionClippingRegions"],[t,"unionClippingRegions"])),this.d(V.track([B,"clippingPlaneEdgeColor"],[t,"clippingPlaneEdgeColor"])),this.d(V.track([B,"clippingPlaneEdgeWidth"],[t,"clippingPlaneEdgeWidth"])),this.d(V.track([B,"materialParams"],[t,"materialParams"])),this.d(V.bind([B,"supportEdit"],[t,"supportEdit"])),this.d(V.bind([B,"clippingPlanesId"],[t,"clippingPlanesId"])),this.d(V.bind([B,"clippingPlaneIds"],[t,"clippingPlaneIds"])),this.d(V.bind([B,"flattenedPlaneId"],[t,"flattenedPlaneId"])),this.d(V.bind([B,"flattenedPlaneEnabled"],[t,"flattenedPlaneEnabled"])),this.d(V.bind([B,"clippingPlaneId"],[t,"clippingPlaneId"])),this.d(V.bind([B,"excavateId"],[t,"excavateId"]))}{const B=this._es3DTileset;this.d(t.refreshTilesetEvent.don(()=>{B.refreshTileset()})),this.d(t.highlightFeatureEvent.don((...A)=>{B.highlightFeature(...A)})),this.d(t.highlightFeatureAndFlyToEvent.don((...A)=>{B.highlightFeatureAndFlyTo(...A)})),this.d(t.setFeatureColorEvent.don((...A)=>{B.setFeatureColor(...A)})),this.d(t.setFeatureVisableEvent.don((...A)=>{B.setFeatureVisable(...A)})),this.d(t.resetFeatureStyleEvent.don((...A)=>{B.resetFeatureStyle(...A)})),this.d(t.flyInEvent.don((...A)=>{B.flyIn(A[0])})),this.d(t.flyToEvent.don((...A)=>{B.flyTo(A[0])})),this.d(t.calcFlyToParamEvent.don((...A)=>{B.calcFlyToParam(...A)})),this.d(t.calcFlyInParamEvent.don((...A)=>{B.calcFlyInParam(...A)}))}{const B=this._es3DTileset;this.d(B.tilesetReady.don(A=>{t.tilesetReady.emit(A)})),this.d(B.pickedEvent.don(A=>{A.assign({sceneObject:t}),t.pickedEvent.emit(A)}))}{const B=()=>{this.es3DTileset.show=t.show};B(),this.d(t.showChanged.don(()=>{B()}))}}get es3DTileset(){return this._es3DTileset}};z(PA,"type",PA.register("ESUeViewer",j.ESRtsFeatureEditing.type,PA));let ws=PA;const xA=class xA extends _t{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(xA,"type",xA.register("ESUeViewer",j.ESMsTileset.type,xA));let Bs=xA;const OA=class OA extends Ne{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}const y=()=>{o.callUeFunc({f:"update",p:{id:e.id,height:e.height??j.ESGeoExtrudedPolygon.defaults.height,extrudedHeight:e.extrudedHeight??j.ESGeoExtrudedPolygon.defaults.extrudedHeight,perPositionHeight:e.perPositionHeight??j.ESGeoExtrudedPolygon.defaults.perPositionHeight}})},B=this.disposeVar(V.createNextAnimateFrameEvent(e.heightChanged,e.extrudedHeightChanged,e.perPositionHeightChanged));this.dispose(B.disposableOn(y)),this.dispose(e.createdEvent.disposableOn(y))}};z(OA,"type",OA.register("ESUeViewer",j.ESGeoExtrudedPolygon.type,OA));let Cs=OA;const MA=class MA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(MA,"type",MA.register("ESUeViewer",j.ESStaticMesh.type,MA));let bs=MA;const HA=class HA extends Pe{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{o.callUeFunc({f:"Start",p:{id:e.id}})})),this.d(e.clearEvent.don(()=>{o.callUeFunc({f:"Clear",p:{id:e.id}})}))}};z(HA,"type",HA.register("ESUeViewer",j.ESSkylineAnalysis.type,HA));let _s=HA;J.copyright=void 0;try{const v="earthsdk3-ue",e="3.0.7-beta.4",t="2025-06-06T08:35:29.000Z",o="北京西部世界科技有限公司",y="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",B="2667f9bff0536a7431f4eba77c5d1b1c2308f5d4",h=((Date.now()-1749198929e3)/36e5).toFixed(1),m=`%c🌏 ${v}%c ${e}.${B.slice(0,8)}.${t} (距今${h}个小时)
|
|
339
|
+
.`+Qo+jv+Eu)},zv=function(v,e){var t=v.ownerDocument;if(t){var o=t.createElement("style");o.textContent=e,v.appendChild(o)}},Fu=function(){function v(){}return v.getOrigin=function(e){var t=v._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},v.isSameOrigin=function(e){return v.getOrigin(e)===v._origin},v.setContext=function(e){v._link=e.document.createElement("a"),v._origin=v.getOrigin(e.location.href)},v._origin="about:blank",v}(),Jv=function(){function v(e,t){this.context=e,this._options=t,this._cache={}}return v.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(Uo(e)||Zv(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},v.prototype.match=function(e){return this._cache[e]},v.prototype.loadImage=function(e){return Re(this,void 0,void 0,function(){var t,o,y,B,A=this;return xe(this,function(h){switch(h.label){case 0:return t=Fu.isSameOrigin(e),o=!So(e)&&this._options.useCORS===!0&&Ie.SUPPORT_CORS_IMAGES&&!t,y=!So(e)&&!t&&!Uo(e)&&typeof this._options.proxy=="string"&&Ie.SUPPORT_CORS_XHR&&!o,!t&&this._options.allowTaint===!1&&!So(e)&&!Uo(e)&&!y&&!o?[2]:(B=e,y?[4,this.proxy(B)]:[3,2]);case 1:B=h.sent(),h.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(m,g){var w=new Image;w.onload=function(){return m(w)},w.onerror=g,(qv(B)||o)&&(w.crossOrigin="anonymous"),w.src=B,w.complete===!0&&setTimeout(function(){return m(w)},500),A._options.imageTimeout>0&&setTimeout(function(){return g("Timed out ("+A._options.imageTimeout+"ms) loading image")},A._options.imageTimeout)})];case 3:return[2,h.sent()]}})})},v.prototype.has=function(e){return typeof this._cache[e]<"u"},v.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},v.prototype.proxy=function(e){var t=this,o=this._options.proxy;if(!o)throw new Error("No proxy defined");var y=e.substring(0,256);return new Promise(function(B,A){var h=Ie.SUPPORT_RESPONSE_TYPE?"blob":"text",m=new XMLHttpRequest;m.onload=function(){if(m.status===200)if(h==="text")B(m.response);else{var p=new FileReader;p.addEventListener("load",function(){return B(p.result)},!1),p.addEventListener("error",function(u){return A(u)},!1),p.readAsDataURL(m.response)}else A("Failed to proxy resource "+y+" with status code "+m.status)},m.onerror=A;var g=o.indexOf("?")>-1?"&":"?";if(m.open("GET",""+o+g+"url="+encodeURIComponent(e)+"&responseType="+h),h!=="text"&&m instanceof XMLHttpRequest&&(m.responseType=h),t._options.imageTimeout){var w=t._options.imageTimeout;m.timeout=w,m.ontimeout=function(){return A("Timed out ("+w+"ms) proxying "+y)}}m.send()})},v}(),Xv=/^data:image\/svg\+xml/i,Yv=/^data:image\/.*;base64,/i,$v=/^data:image\/.*/i,Zv=function(v){return Ie.SUPPORT_SVG_DRAWING||!ey(v)},So=function(v){return $v.test(v)},qv=function(v){return Yv.test(v)},Uo=function(v){return v.substr(0,4)==="blob"},ey=function(v){return v.substr(-3).toLowerCase()==="svg"||Xv.test(v)},q=function(){function v(e,t){this.type=0,this.x=e,this.y=t}return v.prototype.add=function(e,t){return new v(this.x+e,this.y+t)},v}(),Yt=function(v,e,t){return new q(v.x+(e.x-v.x)*t,v.y+(e.y-v.y)*t)},Kn=function(){function v(e,t,o,y){this.type=1,this.start=e,this.startControl=t,this.endControl=o,this.end=y}return v.prototype.subdivide=function(e,t){var o=Yt(this.start,this.startControl,e),y=Yt(this.startControl,this.endControl,e),B=Yt(this.endControl,this.end,e),A=Yt(o,y,e),h=Yt(y,B,e),m=Yt(A,h,e);return t?new v(this.start,o,A,m):new v(m,h,B,this.end)},v.prototype.add=function(e,t){return new v(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},v.prototype.reverse=function(){return new v(this.end,this.endControl,this.startControl,this.start)},v}(),We=function(v){return v.type===1},ty=function(){function v(e){var t=e.styles,o=e.bounds,y=yr(t.borderTopLeftRadius,o.width,o.height),B=y[0],A=y[1],h=yr(t.borderTopRightRadius,o.width,o.height),m=h[0],g=h[1],w=yr(t.borderBottomRightRadius,o.width,o.height),p=w[0],u=w[1],f=yr(t.borderBottomLeftRadius,o.width,o.height),c=f[0],a=f[1],n=[];n.push((B+m)/o.width),n.push((c+p)/o.width),n.push((A+a)/o.height),n.push((g+u)/o.height);var s=Math.max.apply(Math,n);s>1&&(B/=s,A/=s,m/=s,g/=s,p/=s,u/=s,c/=s,a/=s);var r=o.width-m,i=o.height-u,l=o.width-p,d=o.height-a,C=t.borderTopWidth,_=t.borderRightWidth,b=t.borderBottomWidth,E=t.borderLeftWidth,F=pe(t.paddingTop,e.bounds.width),Q=pe(t.paddingRight,e.bounds.width),U=pe(t.paddingBottom,e.bounds.width),T=pe(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=B>0||A>0?ve(o.left+E/3,o.top+C/3,B-E/3,A-C/3,le.TOP_LEFT):new q(o.left+E/3,o.top+C/3),this.topRightBorderDoubleOuterBox=B>0||A>0?ve(o.left+r,o.top+C/3,m-_/3,g-C/3,le.TOP_RIGHT):new q(o.left+o.width-_/3,o.top+C/3),this.bottomRightBorderDoubleOuterBox=p>0||u>0?ve(o.left+l,o.top+i,p-_/3,u-b/3,le.BOTTOM_RIGHT):new q(o.left+o.width-_/3,o.top+o.height-b/3),this.bottomLeftBorderDoubleOuterBox=c>0||a>0?ve(o.left+E/3,o.top+d,c-E/3,a-b/3,le.BOTTOM_LEFT):new q(o.left+E/3,o.top+o.height-b/3),this.topLeftBorderDoubleInnerBox=B>0||A>0?ve(o.left+E*2/3,o.top+C*2/3,B-E*2/3,A-C*2/3,le.TOP_LEFT):new q(o.left+E*2/3,o.top+C*2/3),this.topRightBorderDoubleInnerBox=B>0||A>0?ve(o.left+r,o.top+C*2/3,m-_*2/3,g-C*2/3,le.TOP_RIGHT):new q(o.left+o.width-_*2/3,o.top+C*2/3),this.bottomRightBorderDoubleInnerBox=p>0||u>0?ve(o.left+l,o.top+i,p-_*2/3,u-b*2/3,le.BOTTOM_RIGHT):new q(o.left+o.width-_*2/3,o.top+o.height-b*2/3),this.bottomLeftBorderDoubleInnerBox=c>0||a>0?ve(o.left+E*2/3,o.top+d,c-E*2/3,a-b*2/3,le.BOTTOM_LEFT):new q(o.left+E*2/3,o.top+o.height-b*2/3),this.topLeftBorderStroke=B>0||A>0?ve(o.left+E/2,o.top+C/2,B-E/2,A-C/2,le.TOP_LEFT):new q(o.left+E/2,o.top+C/2),this.topRightBorderStroke=B>0||A>0?ve(o.left+r,o.top+C/2,m-_/2,g-C/2,le.TOP_RIGHT):new q(o.left+o.width-_/2,o.top+C/2),this.bottomRightBorderStroke=p>0||u>0?ve(o.left+l,o.top+i,p-_/2,u-b/2,le.BOTTOM_RIGHT):new q(o.left+o.width-_/2,o.top+o.height-b/2),this.bottomLeftBorderStroke=c>0||a>0?ve(o.left+E/2,o.top+d,c-E/2,a-b/2,le.BOTTOM_LEFT):new q(o.left+E/2,o.top+o.height-b/2),this.topLeftBorderBox=B>0||A>0?ve(o.left,o.top,B,A,le.TOP_LEFT):new q(o.left,o.top),this.topRightBorderBox=m>0||g>0?ve(o.left+r,o.top,m,g,le.TOP_RIGHT):new q(o.left+o.width,o.top),this.bottomRightBorderBox=p>0||u>0?ve(o.left+l,o.top+i,p,u,le.BOTTOM_RIGHT):new q(o.left+o.width,o.top+o.height),this.bottomLeftBorderBox=c>0||a>0?ve(o.left,o.top+d,c,a,le.BOTTOM_LEFT):new q(o.left,o.top+o.height),this.topLeftPaddingBox=B>0||A>0?ve(o.left+E,o.top+C,Math.max(0,B-E),Math.max(0,A-C),le.TOP_LEFT):new q(o.left+E,o.top+C),this.topRightPaddingBox=m>0||g>0?ve(o.left+Math.min(r,o.width-_),o.top+C,r>o.width+_?0:Math.max(0,m-_),Math.max(0,g-C),le.TOP_RIGHT):new q(o.left+o.width-_,o.top+C),this.bottomRightPaddingBox=p>0||u>0?ve(o.left+Math.min(l,o.width-E),o.top+Math.min(i,o.height-b),Math.max(0,p-_),Math.max(0,u-b),le.BOTTOM_RIGHT):new q(o.left+o.width-_,o.top+o.height-b),this.bottomLeftPaddingBox=c>0||a>0?ve(o.left+E,o.top+Math.min(d,o.height-b),Math.max(0,c-E),Math.max(0,a-b),le.BOTTOM_LEFT):new q(o.left+E,o.top+o.height-b),this.topLeftContentBox=B>0||A>0?ve(o.left+E+T,o.top+C+F,Math.max(0,B-(E+T)),Math.max(0,A-(C+F)),le.TOP_LEFT):new q(o.left+E+T,o.top+C+F),this.topRightContentBox=m>0||g>0?ve(o.left+Math.min(r,o.width+E+T),o.top+C+F,r>o.width+E+T?0:m-E+T,g-(C+F),le.TOP_RIGHT):new q(o.left+o.width-(_+Q),o.top+C+F),this.bottomRightContentBox=p>0||u>0?ve(o.left+Math.min(l,o.width-(E+T)),o.top+Math.min(i,o.height+C+F),Math.max(0,p-(_+Q)),u-(b+U),le.BOTTOM_RIGHT):new q(o.left+o.width-(_+Q),o.top+o.height-(b+U)),this.bottomLeftContentBox=c>0||a>0?ve(o.left+E+T,o.top+d,Math.max(0,c-(E+T)),a-(b+U),le.BOTTOM_LEFT):new q(o.left+E+T,o.top+o.height-(b+U))}return v}(),le;(function(v){v[v.TOP_LEFT=0]="TOP_LEFT",v[v.TOP_RIGHT=1]="TOP_RIGHT",v[v.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",v[v.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(le||(le={}));var ve=function(v,e,t,o,y){var B=4*((Math.sqrt(2)-1)/3),A=t*B,h=o*B,m=v+t,g=e+o;switch(y){case le.TOP_LEFT:return new Kn(new q(v,g),new q(v,g-h),new q(m-A,e),new q(m,e));case le.TOP_RIGHT:return new Kn(new q(v,e),new q(v+A,e),new q(m,g-h),new q(m,g));case le.BOTTOM_RIGHT:return new Kn(new q(m,e),new q(m,e+h),new q(v+A,g),new q(v,g));case le.BOTTOM_LEFT:default:return new Kn(new q(m,g),new q(m-A,g),new q(v,e+h),new q(v,e))}},Nn=function(v){return[v.topLeftBorderBox,v.topRightBorderBox,v.bottomRightBorderBox,v.bottomLeftBorderBox]},ry=function(v){return[v.topLeftContentBox,v.topRightContentBox,v.bottomRightContentBox,v.bottomLeftContentBox]},Vn=function(v){return[v.topLeftPaddingBox,v.topRightPaddingBox,v.bottomRightPaddingBox,v.bottomLeftPaddingBox]},Ay=function(){function v(e,t,o){this.offsetX=e,this.offsetY=t,this.matrix=o,this.type=0,this.target=6}return v}(),Gn=function(){function v(e,t){this.path=e,this.target=t,this.type=1}return v}(),ny=function(){function v(e){this.opacity=e,this.type=2,this.target=6}return v}(),iy=function(v){return v.type===0},Qu=function(v){return v.type===1},oy=function(v){return v.type===2},Su=function(v,e){return v.length===e.length?v.some(function(t,o){return t===e[o]}):!1},sy=function(v,e,t,o,y){return v.map(function(B,A){switch(A){case 0:return B.add(e,t);case 1:return B.add(e+o,t);case 2:return B.add(e+o,t+y);case 3:return B.add(e,t+y)}return B})},Uu=function(){function v(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return v}(),Tu=function(){function v(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new ty(this.container),this.container.styles.opacity<1&&this.effects.push(new ny(this.container.styles.opacity)),this.container.styles.transform!==null){var o=this.container.bounds.left+this.container.styles.transformOrigin[0].number,y=this.container.bounds.top+this.container.styles.transformOrigin[1].number,B=this.container.styles.transform;this.effects.push(new Ay(o,y,B))}if(this.container.styles.overflowX!==0){var A=Nn(this.curves),h=Vn(this.curves);Su(A,h)?this.effects.push(new Gn(A,6)):(this.effects.push(new Gn(A,2)),this.effects.push(new Gn(h,4)))}}return v.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,o=this.parent,y=this.effects.slice(0);o;){var B=o.effects.filter(function(m){return!Qu(m)});if(t||o.container.styles.position!==0||!o.parent){if(y.unshift.apply(y,B),t=[2,3].indexOf(o.container.styles.position)===-1,o.container.styles.overflowX!==0){var A=Nn(o.curves),h=Vn(o.curves);Su(A,h)||y.unshift(new Gn(h,6))}}else y.unshift.apply(y,B);o=o.parent}return y.filter(function(m){return Qe(m.target,e)})},v}(),To=function(v,e,t,o){v.container.elements.forEach(function(y){var B=Qe(y.flags,4),A=Qe(y.flags,2),h=new Tu(y,v);Qe(y.styles.display,2048)&&o.push(h);var m=Qe(y.flags,8)?[]:o;if(B||A){var g=B||y.styles.isPositioned()?t:e,w=new Uu(h);if(y.styles.isPositioned()||y.styles.opacity<1||y.styles.isTransformed()){var p=y.styles.zIndex.order;if(p<0){var u=0;g.negativeZIndex.some(function(c,a){return p>c.element.container.styles.zIndex.order?(u=a,!1):u>0}),g.negativeZIndex.splice(u,0,w)}else if(p>0){var f=0;g.positiveZIndex.some(function(c,a){return p>=c.element.container.styles.zIndex.order?(f=a+1,!1):f>0}),g.positiveZIndex.splice(f,0,w)}else g.zeroOrAutoZIndexOrTransformedOrOpacity.push(w)}else y.styles.isFloating()?g.nonPositionedFloats.push(w):g.nonPositionedInlineLevel.push(w);To(h,w,B?w:t,m)}else y.styles.isInlineLevel()?e.inlineLevel.push(h):e.nonInlineLevel.push(h),To(h,e,t,m);Qe(y.flags,8)&&Iu(y,m)})},Iu=function(v,e){for(var t=v instanceof mo?v.start:1,o=v instanceof mo?v.reversed:!1,y=0;y<e.length;y++){var B=e[y];B.container instanceof ru&&typeof B.container.value=="number"&&B.container.value!==0&&(t=B.container.value),B.listValue=_r(t,B.container.styles.listStyleType,!0),t+=o?-1:1}},ay=function(v){var e=new Tu(v,null),t=new Uu(e),o=[];return To(e,t,t,o),Iu(e.container,o),t},Pu=function(v,e){switch(e){case 0:return ze(v.topLeftBorderBox,v.topLeftPaddingBox,v.topRightBorderBox,v.topRightPaddingBox);case 1:return ze(v.topRightBorderBox,v.topRightPaddingBox,v.bottomRightBorderBox,v.bottomRightPaddingBox);case 2:return ze(v.bottomRightBorderBox,v.bottomRightPaddingBox,v.bottomLeftBorderBox,v.bottomLeftPaddingBox);case 3:default:return ze(v.bottomLeftBorderBox,v.bottomLeftPaddingBox,v.topLeftBorderBox,v.topLeftPaddingBox)}},cy=function(v,e){switch(e){case 0:return ze(v.topLeftBorderBox,v.topLeftBorderDoubleOuterBox,v.topRightBorderBox,v.topRightBorderDoubleOuterBox);case 1:return ze(v.topRightBorderBox,v.topRightBorderDoubleOuterBox,v.bottomRightBorderBox,v.bottomRightBorderDoubleOuterBox);case 2:return ze(v.bottomRightBorderBox,v.bottomRightBorderDoubleOuterBox,v.bottomLeftBorderBox,v.bottomLeftBorderDoubleOuterBox);case 3:default:return ze(v.bottomLeftBorderBox,v.bottomLeftBorderDoubleOuterBox,v.topLeftBorderBox,v.topLeftBorderDoubleOuterBox)}},ly=function(v,e){switch(e){case 0:return ze(v.topLeftBorderDoubleInnerBox,v.topLeftPaddingBox,v.topRightBorderDoubleInnerBox,v.topRightPaddingBox);case 1:return ze(v.topRightBorderDoubleInnerBox,v.topRightPaddingBox,v.bottomRightBorderDoubleInnerBox,v.bottomRightPaddingBox);case 2:return ze(v.bottomRightBorderDoubleInnerBox,v.bottomRightPaddingBox,v.bottomLeftBorderDoubleInnerBox,v.bottomLeftPaddingBox);case 3:default:return ze(v.bottomLeftBorderDoubleInnerBox,v.bottomLeftPaddingBox,v.topLeftBorderDoubleInnerBox,v.topLeftPaddingBox)}},uy=function(v,e){switch(e){case 0:return jn(v.topLeftBorderStroke,v.topRightBorderStroke);case 1:return jn(v.topRightBorderStroke,v.bottomRightBorderStroke);case 2:return jn(v.bottomRightBorderStroke,v.bottomLeftBorderStroke);case 3:default:return jn(v.bottomLeftBorderStroke,v.topLeftBorderStroke)}},jn=function(v,e){var t=[];return We(v)?t.push(v.subdivide(.5,!1)):t.push(v),We(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},ze=function(v,e,t,o){var y=[];return We(v)?y.push(v.subdivide(.5,!1)):y.push(v),We(t)?y.push(t.subdivide(.5,!0)):y.push(t),We(o)?y.push(o.subdivide(.5,!0).reverse()):y.push(o),We(e)?y.push(e.subdivide(.5,!1).reverse()):y.push(e),y},xu=function(v){var e=v.bounds,t=v.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},Wn=function(v){var e=v.styles,t=v.bounds,o=pe(e.paddingLeft,t.width),y=pe(e.paddingRight,t.width),B=pe(e.paddingTop,t.width),A=pe(e.paddingBottom,t.width);return t.add(o+e.borderLeftWidth,B+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+o+y),-(e.borderTopWidth+e.borderBottomWidth+B+A))},dy=function(v,e){return v===0?e.bounds:v===2?Wn(e):xu(e)},fy=function(v,e){return v===0?e.bounds:v===2?Wn(e):xu(e)},Io=function(v,e,t){var o=dy(Zt(v.styles.backgroundOrigin,e),v),y=fy(Zt(v.styles.backgroundClip,e),v),B=hy(Zt(v.styles.backgroundSize,e),t,o),A=B[0],h=B[1],m=yr(Zt(v.styles.backgroundPosition,e),o.width-A,o.height-h),g=py(Zt(v.styles.backgroundRepeat,e),m,B,o,y),w=Math.round(o.left+m[0]),p=Math.round(o.top+m[1]);return[g,w,p,A,h]},$t=function(v){return fe(v)&&v.value===Wt.AUTO},zn=function(v){return typeof v=="number"},hy=function(v,e,t){var o=e[0],y=e[1],B=e[2],A=v[0],h=v[1];if(!A)return[0,0];if(Ee(A)&&h&&Ee(h))return[pe(A,t.width),pe(h,t.height)];var m=zn(B);if(fe(A)&&(A.value===Wt.CONTAIN||A.value===Wt.COVER)){if(zn(B)){var g=t.width/t.height;return g<B!=(A.value===Wt.COVER)?[t.width,t.width/B]:[t.height*B,t.height]}return[t.width,t.height]}var w=zn(o),p=zn(y),u=w||p;if($t(A)&&(!h||$t(h))){if(w&&p)return[o,y];if(!m&&!u)return[t.width,t.height];if(u&&m){var f=w?o:y*B,c=p?y:o/B;return[f,c]}var a=w?o:t.width,n=p?y:t.height;return[a,n]}if(m){var s=0,r=0;return Ee(A)?s=pe(A,t.width):Ee(h)&&(r=pe(h,t.height)),$t(A)?s=r*B:(!h||$t(h))&&(r=s/B),[s,r]}var i=null,l=null;if(Ee(A)?i=pe(A,t.width):h&&Ee(h)&&(l=pe(h,t.height)),i!==null&&(!h||$t(h))&&(l=w&&p?i/o*y:t.height),l!==null&&$t(A)&&(i=w&&p?l/y*o:t.width),i!==null&&l!==null)return[i,l];throw new Error("Unable to calculate background-size for element")},Zt=function(v,e){var t=v[e];return typeof t>"u"?v[0]:t},py=function(v,e,t,o,y){var B=e[0],A=e[1],h=t[0],m=t[1];switch(v){case 2:return[new q(Math.round(o.left),Math.round(o.top+A)),new q(Math.round(o.left+o.width),Math.round(o.top+A)),new q(Math.round(o.left+o.width),Math.round(m+o.top+A)),new q(Math.round(o.left),Math.round(m+o.top+A))];case 3:return[new q(Math.round(o.left+B),Math.round(o.top)),new q(Math.round(o.left+B+h),Math.round(o.top)),new q(Math.round(o.left+B+h),Math.round(o.height+o.top)),new q(Math.round(o.left+B),Math.round(o.height+o.top))];case 1:return[new q(Math.round(o.left+B),Math.round(o.top+A)),new q(Math.round(o.left+B+h),Math.round(o.top+A)),new q(Math.round(o.left+B+h),Math.round(o.top+A+m)),new q(Math.round(o.left+B),Math.round(o.top+A+m))];default:return[new q(Math.round(y.left),Math.round(y.top)),new q(Math.round(y.left+y.width),Math.round(y.top)),new q(Math.round(y.left+y.width),Math.round(y.height+y.top)),new q(Math.round(y.left),Math.round(y.height+y.top))]}},gy="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Ou="Hidden Text",vy=function(){function v(e){this._data={},this._document=e}return v.prototype.parseMetrics=function(e,t){var o=this._document.createElement("div"),y=this._document.createElement("img"),B=this._document.createElement("span"),A=this._document.body;o.style.visibility="hidden",o.style.fontFamily=e,o.style.fontSize=t,o.style.margin="0",o.style.padding="0",o.style.whiteSpace="nowrap",A.appendChild(o),y.src=gy,y.width=1,y.height=1,y.style.margin="0",y.style.padding="0",y.style.verticalAlign="baseline",B.style.fontFamily=e,B.style.fontSize=t,B.style.margin="0",B.style.padding="0",B.appendChild(this._document.createTextNode(Ou)),o.appendChild(B),o.appendChild(y);var h=y.offsetTop-B.offsetTop+2;o.removeChild(B),o.appendChild(this._document.createTextNode(Ou)),o.style.lineHeight="normal",y.style.verticalAlign="super";var m=y.offsetTop-o.offsetTop+2;return A.removeChild(o),{baseline:h,middle:m}},v.prototype.getMetrics=function(e,t){var o=e+" "+t;return typeof this._data[o]>"u"&&(this._data[o]=this.parseMetrics(e,t)),this._data[o]},v}(),Mu=function(){function v(e,t){this.context=e,this.options=t}return v}(),yy=1e4,my=function(v){Xe(e,v);function e(t,o){var y=v.call(this,t,o)||this;return y._activeEffects=[],y.canvas=o.canvas?o.canvas:document.createElement("canvas"),y.ctx=y.canvas.getContext("2d"),o.canvas||(y.canvas.width=Math.floor(o.width*o.scale),y.canvas.height=Math.floor(o.height*o.scale),y.canvas.style.width=o.width+"px",y.canvas.style.height=o.height+"px"),y.fontMetrics=new vy(document),y.ctx.scale(y.options.scale,y.options.scale),y.ctx.translate(-o.x,-o.y),y.ctx.textBaseline="bottom",y._activeEffects=[],y.context.logger.debug("Canvas renderer initialized ("+o.width+"x"+o.height+") with scale "+o.scale),y}return e.prototype.applyEffects=function(t){for(var o=this;this._activeEffects.length;)this.popEffect();t.forEach(function(y){return o.applyEffect(y)})},e.prototype.applyEffect=function(t){this.ctx.save(),oy(t)&&(this.ctx.globalAlpha=t.opacity),iy(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),Qu(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(t){return Re(this,void 0,void 0,function(){var o;return xe(this,function(y){switch(y.label){case 0:return o=t.element.container.styles,o.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:y.sent(),y.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(t){return Re(this,void 0,void 0,function(){return xe(this,function(o){switch(o.label){case 0:if(Qe(t.container.flags,16))debugger;return t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return o.sent(),[4,this.renderNodeContent(t)];case 2:o.sent(),o.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(t,o,y){var B=this;if(o===0)this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+y);else{var A=yo(t.text);A.reduce(function(h,m){return B.ctx.fillText(m,h,t.bounds.top+y),h+B.ctx.measureText(m).width},t.bounds.left)}},e.prototype.createFontStyle=function(t){var o=t.fontVariant.filter(function(A){return A==="normal"||A==="small-caps"}).join(""),y=_y(t.fontFamily).join(", "),B=vr(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,o,t.fontWeight,B,y].join(" "),y,B]},e.prototype.renderTextNode=function(t,o){return Re(this,void 0,void 0,function(){var y,B,A,h,m,g,w,p,u=this;return xe(this,function(f){return y=this.createFontStyle(o),B=y[0],A=y[1],h=y[2],this.ctx.font=B,this.ctx.direction=o.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",m=this.fontMetrics.getMetrics(A,h),g=m.baseline,w=m.middle,p=o.paintOrder,t.textBounds.forEach(function(c){p.forEach(function(a){switch(a){case 0:u.ctx.fillStyle=Se(o.color),u.renderTextWithLetterSpacing(c,o.letterSpacing,g);var n=o.textShadow;n.length&&c.text.trim().length&&(n.slice(0).reverse().forEach(function(s){u.ctx.shadowColor=Se(s.color),u.ctx.shadowOffsetX=s.offsetX.number*u.options.scale,u.ctx.shadowOffsetY=s.offsetY.number*u.options.scale,u.ctx.shadowBlur=s.blur.number,u.renderTextWithLetterSpacing(c,o.letterSpacing,g)}),u.ctx.shadowColor="",u.ctx.shadowOffsetX=0,u.ctx.shadowOffsetY=0,u.ctx.shadowBlur=0),o.textDecorationLine.length&&(u.ctx.fillStyle=Se(o.textDecorationColor||o.color),o.textDecorationLine.forEach(function(s){switch(s){case 1:u.ctx.fillRect(c.bounds.left,Math.round(c.bounds.top+g),c.bounds.width,1);break;case 2:u.ctx.fillRect(c.bounds.left,Math.round(c.bounds.top),c.bounds.width,1);break;case 3:u.ctx.fillRect(c.bounds.left,Math.ceil(c.bounds.top+w),c.bounds.width,1);break}}));break;case 1:o.webkitTextStrokeWidth&&c.text.trim().length&&(u.ctx.strokeStyle=Se(o.webkitTextStrokeColor),u.ctx.lineWidth=o.webkitTextStrokeWidth,u.ctx.lineJoin=window.chrome?"miter":"round",u.ctx.strokeText(c.text,c.bounds.left,c.bounds.top+g)),u.ctx.strokeStyle="",u.ctx.lineWidth=0,u.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(t,o,y){if(y&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var B=Wn(t),A=Vn(o);this.path(A),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(y,0,0,t.intrinsicWidth,t.intrinsicHeight,B.left,B.top,B.width,B.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return Re(this,void 0,void 0,function(){var o,y,B,A,h,m,r,r,g,w,p,u,l,f,c,d,a,n,s,r,i,l,d;return xe(this,function(C){switch(C.label){case 0:this.applyEffects(t.getEffects(4)),o=t.container,y=t.curves,B=o.styles,A=0,h=o.textNodes,C.label=1;case 1:return A<h.length?(m=h[A],[4,this.renderTextNode(m,B)]):[3,4];case 2:C.sent(),C.label=3;case 3:return A++,[3,1];case 4:if(!(o instanceof ql))return[3,8];C.label=5;case 5:return C.trys.push([5,7,,8]),[4,this.context.cache.match(o.src)];case 6:return r=C.sent(),this.renderReplacedElement(o,y,r),[3,8];case 7:return C.sent(),this.context.logger.error("Error loading image "+o.src),[3,8];case 8:if(o instanceof eu&&this.renderReplacedElement(o,y,o.canvas),!(o instanceof tu))return[3,12];C.label=9;case 9:return C.trys.push([9,11,,12]),[4,this.context.cache.match(o.svg)];case 10:return r=C.sent(),this.renderReplacedElement(o,y,r),[3,12];case 11:return C.sent(),this.context.logger.error("Error loading svg "+o.svg.substring(0,255)),[3,12];case 12:return o instanceof ou&&o.tree?(g=new e(this.context,{scale:this.options.scale,backgroundColor:o.backgroundColor,x:0,y:0,width:o.width,height:o.height}),[4,g.render(o.tree)]):[3,14];case 13:w=C.sent(),o.width&&o.height&&this.ctx.drawImage(w,0,0,o.width,o.height,o.bounds.left,o.bounds.top,o.bounds.width,o.bounds.height),C.label=14;case 14:if(o instanceof wo&&(p=Math.min(o.bounds.width,o.bounds.height),o.type===Mn?o.checked&&(this.ctx.save(),this.path([new q(o.bounds.left+p*.39363,o.bounds.top+p*.79),new q(o.bounds.left+p*.16,o.bounds.top+p*.5549),new q(o.bounds.left+p*.27347,o.bounds.top+p*.44071),new q(o.bounds.left+p*.39694,o.bounds.top+p*.5649),new q(o.bounds.left+p*.72983,o.bounds.top+p*.23),new q(o.bounds.left+p*.84,o.bounds.top+p*.34085),new q(o.bounds.left+p*.39363,o.bounds.top+p*.79)]),this.ctx.fillStyle=Se(Au),this.ctx.fill(),this.ctx.restore()):o.type===Hn&&o.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(o.bounds.left+p/2,o.bounds.top+p/2,p/4,0,Math.PI*2,!0),this.ctx.fillStyle=Se(Au),this.ctx.fill(),this.ctx.restore())),wy(o)&&o.value.length){switch(u=this.createFontStyle(B),l=u[0],f=u[1],c=this.fontMetrics.getMetrics(l,f).baseline,this.ctx.font=l,this.ctx.fillStyle=Se(B.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Cy(o.styles.textAlign),d=Wn(o),a=0,o.styles.textAlign){case 1:a+=d.width/2;break;case 2:a+=d.width;break}n=d.add(a,0,0,-d.height/2+1),this.ctx.save(),this.path([new q(d.left,d.top),new q(d.left+d.width,d.top),new q(d.left+d.width,d.top+d.height),new q(d.left,d.top+d.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Cr(o.value,n),B.letterSpacing,c),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!Qe(o.styles.display,2048))return[3,20];if(o.styles.listStyleImage===null)return[3,19];if(s=o.styles.listStyleImage,s.type!==0)return[3,18];r=void 0,i=s.url,C.label=15;case 15:return C.trys.push([15,17,,18]),[4,this.context.cache.match(i)];case 16:return r=C.sent(),this.ctx.drawImage(r,o.bounds.left-(r.width+10),o.bounds.top),[3,18];case 17:return C.sent(),this.context.logger.error("Error loading list-style-image "+i),[3,18];case 18:return[3,20];case 19:t.listValue&&o.styles.listStyleType!==-1&&(l=this.createFontStyle(B)[0],this.ctx.font=l,this.ctx.fillStyle=Se(B.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",d=new ot(o.bounds.left,o.bounds.top+pe(o.styles.paddingTop,o.bounds.width),o.bounds.width,Ol(B.lineHeight,B.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Cr(t.listValue,d),B.letterSpacing,Ol(B.lineHeight,B.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),C.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(t){return Re(this,void 0,void 0,function(){var o,y,s,B,A,s,h,m,s,g,w,s,p,u,s,f,c,s,a,n,s;return xe(this,function(r){switch(r.label){case 0:if(Qe(t.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:r.sent(),o=0,y=t.negativeZIndex,r.label=2;case 2:return o<y.length?(s=y[o],[4,this.renderStack(s)]):[3,5];case 3:r.sent(),r.label=4;case 4:return o++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:r.sent(),B=0,A=t.nonInlineLevel,r.label=7;case 7:return B<A.length?(s=A[B],[4,this.renderNode(s)]):[3,10];case 8:r.sent(),r.label=9;case 9:return B++,[3,7];case 10:h=0,m=t.nonPositionedFloats,r.label=11;case 11:return h<m.length?(s=m[h],[4,this.renderStack(s)]):[3,14];case 12:r.sent(),r.label=13;case 13:return h++,[3,11];case 14:g=0,w=t.nonPositionedInlineLevel,r.label=15;case 15:return g<w.length?(s=w[g],[4,this.renderStack(s)]):[3,18];case 16:r.sent(),r.label=17;case 17:return g++,[3,15];case 18:p=0,u=t.inlineLevel,r.label=19;case 19:return p<u.length?(s=u[p],[4,this.renderNode(s)]):[3,22];case 20:r.sent(),r.label=21;case 21:return p++,[3,19];case 22:f=0,c=t.zeroOrAutoZIndexOrTransformedOrOpacity,r.label=23;case 23:return f<c.length?(s=c[f],[4,this.renderStack(s)]):[3,26];case 24:r.sent(),r.label=25;case 25:return f++,[3,23];case 26:a=0,n=t.positiveZIndex,r.label=27;case 27:return a<n.length?(s=n[a],[4,this.renderStack(s)]):[3,30];case 28:r.sent(),r.label=29;case 29:return a++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(t){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(t.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},e.prototype.formatPath=function(t){var o=this;t.forEach(function(y,B){var A=We(y)?y.start:y;B===0?o.ctx.moveTo(A.x,A.y):o.ctx.lineTo(A.x,A.y),We(y)&&o.ctx.bezierCurveTo(y.startControl.x,y.startControl.y,y.endControl.x,y.endControl.y,y.end.x,y.end.y)})},e.prototype.renderRepeat=function(t,o,y,B){this.path(t),this.ctx.fillStyle=o,this.ctx.translate(y,B),this.ctx.fill(),this.ctx.translate(-y,-B)},e.prototype.resizeImage=function(t,o,y){var B;if(t.width===o&&t.height===y)return t;var A=(B=this.canvas.ownerDocument)!==null&&B!==void 0?B:document,h=A.createElement("canvas");h.width=Math.max(1,o),h.height=Math.max(1,y);var m=h.getContext("2d");return m.drawImage(t,0,0,t.width,t.height,0,0,o,y),h},e.prototype.renderBackgroundImage=function(t){return Re(this,void 0,void 0,function(){var o,y,B,A,h,m;return xe(this,function(g){switch(g.label){case 0:o=t.styles.backgroundImage.length-1,y=function(w){var p,u,f,F,I,M,T,S,b,c,F,I,M,T,S,a,n,s,r,i,l,d,C,_,b,E,F,Q,U,T,S,P,I,M,K,W,L,O,H,k,G,D;return xe(this,function(R){switch(R.label){case 0:if(w.type!==0)return[3,5];p=void 0,u=w.url,R.label=1;case 1:return R.trys.push([1,3,,4]),[4,B.context.cache.match(u)];case 2:return p=R.sent(),[3,4];case 3:return R.sent(),B.context.logger.error("Error loading background-image "+u),[3,4];case 4:return p&&(f=Io(t,o,[p.width,p.height,p.width/p.height]),F=f[0],I=f[1],M=f[2],T=f[3],S=f[4],b=B.ctx.createPattern(B.resizeImage(p,T,S),"repeat"),B.renderRepeat(F,b,I,M)),[3,6];case 5:ip(w)?(c=Io(t,o,[null,null,null]),F=c[0],I=c[1],M=c[2],T=c[3],S=c[4],a=ep(w.angle,T,S),n=a[0],s=a[1],r=a[2],i=a[3],l=a[4],d=document.createElement("canvas"),d.width=T,d.height=S,C=d.getContext("2d"),_=C.createLinearGradient(s,i,r,l),bl(w.stops,n).forEach(function(N){return _.addColorStop(N.stop,Se(N.color))}),C.fillStyle=_,C.fillRect(0,0,T,S),T>0&&S>0&&(b=B.ctx.createPattern(d,"repeat"),B.renderRepeat(F,b,I,M))):op(w)&&(E=Io(t,o,[null,null,null]),F=E[0],Q=E[1],U=E[2],T=E[3],S=E[4],P=w.position.length===0?[ro]:w.position,I=pe(P[0],T),M=pe(P[P.length-1],S),K=tp(w,I,M,T,S),W=K[0],L=K[1],W>0&&L>0&&(O=B.ctx.createRadialGradient(Q+I,U+M,0,Q+I,U+M,W),bl(w.stops,W*2).forEach(function(N){return O.addColorStop(N.stop,Se(N.color))}),B.path(F),B.ctx.fillStyle=O,W!==L?(H=t.bounds.left+.5*t.bounds.width,k=t.bounds.top+.5*t.bounds.height,G=L/W,D=1/G,B.ctx.save(),B.ctx.translate(H,k),B.ctx.transform(1,0,0,G,0,0),B.ctx.translate(-H,-k),B.ctx.fillRect(Q,D*(U-k)+k,T,S*D),B.ctx.restore()):B.ctx.fill())),R.label=6;case 6:return o--,[2]}})},B=this,A=0,h=t.styles.backgroundImage.slice(0).reverse(),g.label=1;case 1:return A<h.length?(m=h[A],[5,y(m)]):[3,4];case 2:g.sent(),g.label=3;case 3:return A++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(t,o,y){return Re(this,void 0,void 0,function(){return xe(this,function(B){return this.path(Pu(y,o)),this.ctx.fillStyle=Se(t),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(t,o,y,B){return Re(this,void 0,void 0,function(){var A,h;return xe(this,function(m){switch(m.label){case 0:return o<3?[4,this.renderSolidBorder(t,y,B)]:[3,2];case 1:return m.sent(),[2];case 2:return A=cy(B,y),this.path(A),this.ctx.fillStyle=Se(t),this.ctx.fill(),h=ly(B,y),this.path(h),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(t){return Re(this,void 0,void 0,function(){var o,y,B,A,h,m,g,w,p=this;return xe(this,function(u){switch(u.label){case 0:return this.applyEffects(t.getEffects(2)),o=t.container.styles,y=!gt(o.backgroundColor)||o.backgroundImage.length,B=[{style:o.borderTopStyle,color:o.borderTopColor,width:o.borderTopWidth},{style:o.borderRightStyle,color:o.borderRightColor,width:o.borderRightWidth},{style:o.borderBottomStyle,color:o.borderBottomColor,width:o.borderBottomWidth},{style:o.borderLeftStyle,color:o.borderLeftColor,width:o.borderLeftWidth}],A=By(Zt(o.backgroundClip,0),t.curves),y||o.boxShadow.length?(this.ctx.save(),this.path(A),this.ctx.clip(),gt(o.backgroundColor)||(this.ctx.fillStyle=Se(o.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:u.sent(),this.ctx.restore(),o.boxShadow.slice(0).reverse().forEach(function(f){p.ctx.save();var c=Nn(t.curves),a=f.inset?0:yy,n=sy(c,-a+(f.inset?1:-1)*f.spread.number,(f.inset?1:-1)*f.spread.number,f.spread.number*(f.inset?-2:2),f.spread.number*(f.inset?-2:2));f.inset?(p.path(c),p.ctx.clip(),p.mask(n)):(p.mask(c),p.ctx.clip(),p.path(n)),p.ctx.shadowOffsetX=f.offsetX.number+a,p.ctx.shadowOffsetY=f.offsetY.number,p.ctx.shadowColor=Se(f.color),p.ctx.shadowBlur=f.blur.number,p.ctx.fillStyle=f.inset?Se(f.color):"rgba(0,0,0,1)",p.ctx.fill(),p.ctx.restore()}),u.label=2;case 2:h=0,m=0,g=B,u.label=3;case 3:return m<g.length?(w=g[m],w.style!==0&&!gt(w.color)&&w.width>0?w.style!==2?[3,5]:[4,this.renderDashedDottedBorder(w.color,w.width,h,t.curves,2)]:[3,11]):[3,13];case 4:return u.sent(),[3,11];case 5:return w.style!==3?[3,7]:[4,this.renderDashedDottedBorder(w.color,w.width,h,t.curves,3)];case 6:return u.sent(),[3,11];case 7:return w.style!==4?[3,9]:[4,this.renderDoubleBorder(w.color,w.width,h,t.curves)];case 8:return u.sent(),[3,11];case 9:return[4,this.renderSolidBorder(w.color,h,t.curves)];case 10:u.sent(),u.label=11;case 11:h++,u.label=12;case 12:return m++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(t,o,y,B,A){return Re(this,void 0,void 0,function(){var h,m,g,w,p,u,f,c,a,n,s,r,i,l,d,C,d,C;return xe(this,function(_){return this.ctx.save(),h=uy(B,y),m=Pu(B,y),A===2&&(this.path(m),this.ctx.clip()),We(m[0])?(g=m[0].start.x,w=m[0].start.y):(g=m[0].x,w=m[0].y),We(m[1])?(p=m[1].end.x,u=m[1].end.y):(p=m[1].x,u=m[1].y),y===0||y===2?f=Math.abs(g-p):f=Math.abs(w-u),this.ctx.beginPath(),A===3?this.formatPath(h):this.formatPath(m.slice(0,2)),c=o<3?o*3:o*2,a=o<3?o*2:o,A===3&&(c=o,a=o),n=!0,f<=c*2?n=!1:f<=c*2+a?(s=f/(2*c+a),c*=s,a*=s):(r=Math.floor((f+a)/(c+a)),i=(f-r*c)/(r-1),l=(f-(r+1)*c)/r,a=l<=0||Math.abs(a-i)<Math.abs(a-l)?i:l),n&&(A===3?this.ctx.setLineDash([0,c+a]):this.ctx.setLineDash([c,a])),A===3?(this.ctx.lineCap="round",this.ctx.lineWidth=o):this.ctx.lineWidth=o*2+1.1,this.ctx.strokeStyle=Se(t),this.ctx.stroke(),this.ctx.setLineDash([]),A===2&&(We(m[0])&&(d=m[3],C=m[0],this.ctx.beginPath(),this.formatPath([new q(d.end.x,d.end.y),new q(C.start.x,C.start.y)]),this.ctx.stroke()),We(m[1])&&(d=m[1],C=m[2],this.ctx.beginPath(),this.formatPath([new q(d.end.x,d.end.y),new q(C.start.x,C.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(t){return Re(this,void 0,void 0,function(){var o;return xe(this,function(y){switch(y.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Se(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),o=ay(t),[4,this.renderStack(o)];case 1:return y.sent(),this.applyEffects([]),[2,this.canvas]}})})},e}(Mu),wy=function(v){return v instanceof iu||v instanceof nu?!0:v instanceof wo&&v.type!==Hn&&v.type!==Mn},By=function(v,e){switch(v){case 0:return Nn(e);case 2:return ry(e);case 1:default:return Vn(e)}},Cy=function(v){switch(v){case 1:return"center";case 2:return"right";case 0:default:return"left"}},by=["-apple-system","system-ui"],_y=function(v){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?v.filter(function(e){return by.indexOf(e)===-1}):v},Ey=function(v){Xe(e,v);function e(t,o){var y=v.call(this,t,o)||this;return y.canvas=o.canvas?o.canvas:document.createElement("canvas"),y.ctx=y.canvas.getContext("2d"),y.options=o,y.canvas.width=Math.floor(o.width*o.scale),y.canvas.height=Math.floor(o.height*o.scale),y.canvas.style.width=o.width+"px",y.canvas.style.height=o.height+"px",y.ctx.scale(y.options.scale,y.options.scale),y.ctx.translate(-o.x,-o.y),y.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+o.width+"x"+o.height+" at "+o.x+","+o.y+") with scale "+o.scale),y}return e.prototype.render=function(t){return Re(this,void 0,void 0,function(){var o,y;return xe(this,function(B){switch(B.label){case 0:return o=vo(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,Fy(o)];case 1:return y=B.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Se(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(y,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e}(Mu),Fy=function(v){return new Promise(function(e,t){var o=new Image;o.onload=function(){e(o)},o.onerror=t,o.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(v))})},Qy=function(){function v(e){var t=e.id,o=e.enabled;this.id=t,this.enabled=o,this.start=Date.now()}return v.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,en([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},v.prototype.getTime=function(){return Date.now()-this.start},v.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,en([this.id,this.getTime()+"ms"],e))},v.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,en([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},v.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,en([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},v.instances={},v}(),Sy=function(){function v(e,t){var o;this.windowBounds=t,this.instanceName="#"+v.instanceCount++,this.logger=new Qy({id:this.instanceName,enabled:e.logging}),this.cache=(o=e.cache)!==null&&o!==void 0?o:new Jv(this,e)}return v.instanceCount=1,v}(),Uy=function(v,e){return e===void 0&&(e={}),Ty(v,e)};typeof window<"u"&&Fu.setContext(window);var Ty=function(v,e){return Re(void 0,void 0,void 0,function(){var t,o,y,B,A,h,m,g,w,p,u,f,c,a,n,s,r,i,l,d,_,C,_,b,E,F,Q,U,T,S,P,I,M,K,W,L,O,H,k,G;return xe(this,function(D){switch(D.label){case 0:if(!v||typeof v!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=v.ownerDocument,!t)throw new Error("Element is not attached to a Document");if(o=t.defaultView,!o)throw new Error("Document is not attached to a Window");return y={allowTaint:(b=e.allowTaint)!==null&&b!==void 0?b:!1,imageTimeout:(E=e.imageTimeout)!==null&&E!==void 0?E:15e3,proxy:e.proxy,useCORS:(F=e.useCORS)!==null&&F!==void 0?F:!1},B=Mi({logging:(Q=e.logging)!==null&&Q!==void 0?Q:!0,cache:e.cache},y),A={windowWidth:(U=e.windowWidth)!==null&&U!==void 0?U:o.innerWidth,windowHeight:(T=e.windowHeight)!==null&&T!==void 0?T:o.innerHeight,scrollX:(S=e.scrollX)!==null&&S!==void 0?S:o.pageXOffset,scrollY:(P=e.scrollY)!==null&&P!==void 0?P:o.pageYOffset},h=new ot(A.scrollX,A.scrollY,A.windowWidth,A.windowHeight),m=new Sy(B,h),g=(I=e.foreignObjectRendering)!==null&&I!==void 0?I:!1,w={allowTaint:(M=e.allowTaint)!==null&&M!==void 0?M:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:g,copyStyles:g},m.logger.debug("Starting document clone with size "+h.width+"x"+h.height+" scrolled to "+-h.left+","+-h.top),p=new _u(m,v,w),u=p.clonedReferenceElement,u?[4,p.toIFrame(t,h)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return f=D.sent(),c=Co(u)||Iv(u)?sf(u.ownerDocument):tn(m,u),a=c.width,n=c.height,s=c.left,r=c.top,i=Iy(m,u,e.backgroundColor),l={canvas:e.canvas,backgroundColor:i,scale:(W=(K=e.scale)!==null&&K!==void 0?K:o.devicePixelRatio)!==null&&W!==void 0?W:1,x:((L=e.x)!==null&&L!==void 0?L:0)+s,y:((O=e.y)!==null&&O!==void 0?O:0)+r,width:(H=e.width)!==null&&H!==void 0?H:Math.ceil(a),height:(k=e.height)!==null&&k!==void 0?k:Math.ceil(n)},g?(m.logger.debug("Document cloned, using foreign object rendering"),_=new Ey(m,l),[4,_.render(u)]):[3,3];case 2:return d=D.sent(),[3,5];case 3:return m.logger.debug("Document cloned, element located at "+s+","+r+" with size "+a+"x"+n+" using computed rendering"),m.logger.debug("Starting DOM parsing"),C=au(m,u),i===C.styles.backgroundColor&&(C.styles.backgroundColor=at.TRANSPARENT),m.logger.debug("Starting renderer for element at "+l.x+","+l.y+" with size "+l.width+"x"+l.height),_=new my(m,l),[4,_.render(C)];case 4:d=D.sent(),D.label=5;case 5:return(!((G=e.removeContainer)!==null&&G!==void 0)||G)&&(_u.destroy(f)||m.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),m.logger.debug("Finished rendering"),[2,d]}})})},Iy=function(v,e,t){var o=e.ownerDocument,y=o.documentElement?mr(v,getComputedStyle(o.documentElement).backgroundColor):at.TRANSPARENT,B=o.body?mr(v,getComputedStyle(o.body).backgroundColor):at.TRANSPARENT,A=typeof t=="string"?mr(v,t):t===null?at.TRANSPARENT:4294967295;return e===o.documentElement?gt(y)?gt(B)?A:B:y:A};const Xr=class Xr extends j.EngineObject{constructor(t,o){super(t,o);z(this,"_imageLabel",this.dv(new j.ESImageLabel(`${this.sceneObject.id}_ESImageLabel`)));z(this,"_hasClassDivAndPos",{});const y=o.viewer;if(!y){console.warn("viewer is undefined!");return}t.mainClass=this._imageLabel;const B=this._imageLabel;o.add(B),this.d(()=>o.delete(B));{const A=()=>{if(!y)return;if(!t.instanceClass)throw new Error("!sceneObject.instanceClass");const g=document.createElement("div"),w=this.dv(new t.instanceClass(g,t,o))._container;if(w.style.opacity=t.opacity.toString()??j.ESGeoDiv.defaults.opacity,w.style.position="fixed",w.style.zIndex="-1",w.style.top="0px",!document.body.contains(w)){document.body.appendChild(w);let u=w?w.querySelectorAll("*[class]"):[];for(let f=0;f<u.length;f++){const c=u[f];var p=c.getBoundingClientRect();this._hasClassDivAndPos[c.className]=[c.offsetLeft,c.offsetTop,c.offsetLeft+p.width,c.offsetTop+p.height]}}Uy(w,{backgroundColor:null,allowTaint:!0,useCORS:!0,width:w.offsetWidth,height:w.offsetHeight,scale:1}).then(u=>{document.body.contains(w)&&document.body.removeChild(w),B.url=u.toDataURL(),B.show=t.show}).catch(()=>{document.body.contains(w)&&document.body.removeChild(w)})},h=()=>{try{t.instanceClass?A():(B.url="",B.show=!1)}catch(g){console.error(g)}};h();const m=this.dv(V.createNextAnimateFrameEvent(t.instanceClassChanged,t.opacityChanged));this.d(m.don(h))}{const A=()=>{B.show=t.show};B.show=!1,this.ad(t.showChanged.don(A))}this.d(V.track([B,"anchor"],[t,"anchor"])),this.d(V.bind([B,"position"],[t,"position"])),this.d(V.bind([B,"rotation"],[t,"rotation"])),this.d(V.bind([B,"flyToParam"],[t,"flyToParam"])),this.d(V.bind([B,"flyInParam"],[t,"flyInParam"])),this.d(V.bind([B,"allowPicking"],[t,"allowPicking"])),this.d(V.bind([B,"scale"],[t,"scale"])),this.d(V.track([B,"minVisibleDistance"],[t,"minVisibleDistance"])),this.d(V.track([B,"maxVisibleDistance"],[t,"maxVisibleDistance"])),this.ad(t.automaticLandingEvent.don(()=>{B.automaticLanding()})),this.d(B.pickedEvent.don(A=>{(t.allowPicking??!1)&&t.pickedEvent.emit(A)})),this.d(o.widgetEvent.don(A=>{if(A.objId!==this._imageLabel.id)return;const{type:h,add:m}=A;if(h==="leftClick"&&m){const g=(m==null?void 0:m.classNames)??[],w=Object.keys(this._hasClassDivAndPos);for(let p=0;p<w.length;p++){const u=w[p];let f=this._hasClassDivAndPos[u];m&&m.mouseRelativePos&&m.mouseRelativePos[0]>=f[0]&&m.mouseRelativePos[0]<=f[2]&&m.mouseRelativePos[1]>=f[1]&&m.mouseRelativePos[1]<=f[3]&&g.push(u)}m.classNames=g}t.widgetEvent.emit({type:h,add:m})})),this.d(t.calcFlyToParamEvent.don(()=>{Lt(y,B.id)})),this.d(t.calcFlyInParamEvent.don(()=>{const A=o.getCurrentCameraInfo();if(!A)return;const{position:h,rotation:m}=A;t.flyInParam={position:h,rotation:m,flyDuration:1}})),this.d(t.smoothMoveEvent.don((A,h)=>{zA(y,B.id,A,h)})),this.d(t.smoothMoveWithRotationEvent.don((A,h,m)=>{GA(y,B.id,A,h,m)})),this.d(t.smoothMoveOnGroundEvent.don((A,h,m,g)=>{jA(y,B.id,A,h,g,m)})),this.d(t.smoothMoveWithRotationOnGroundEvent.don((A,h,m,g,w)=>{WA(y,B.id,A,h,m,g,w)})),this.d(t.flyToEvent.don((A,h)=>{B.flyTo(A)})),this.d(t.flyInEvent.don(A=>{B.flyIn(A)}))}};z(Xr,"type",Xr.register("ESUeViewer",j.ESGeoDiv.type,Xr));let Po=Xr;const Yr=class Yr extends De{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.d(e.flyToFeatureIndexEvent.don((y,B)=>{o.callUeFunc({f:"flyToFeatureIndex",p:{id:e.id,index:y,duration:B}})})),this.d(e.flyToFeatureEvent.don((y,B,A)=>{o.callUeFunc({f:"flyToFeature",p:{id:e.id,key:y,value:B,duration:A}})}))}};z(Yr,"type",Yr.register("ESUeViewer",j.ESGeoJson.type,Yr));let xo=Yr;const $r=class $r extends Pe{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z($r,"type",$r.register("ESUeViewer",j.ESGeoLineString.type,$r));let Jn=$r;const Zr=class Zr extends Pe{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(Zr,"type",Zr.register("ESUeViewer",j.ESGeoRectangle.type,Zr));let Oo=Zr;const qr=class qr extends Ne{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(qr,"type",qr.register("ESUeViewer",j.ESGeoWater.type,qr));let Mo=qr;const Pt=class Pt extends de{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.d(e.setNodePositionEvent.don((y,B)=>{Rs(o,e.id,y,B)})),this.d(e.setNodeRotationEvent.don((y,B)=>{ks(o,e.id,y,B)})),this.d(e.setNodeScaleEvent.don((y,B)=>{Ks(o,e.id,y,B)}))}};z(Pt,"forceUeUpdateProps",[...de.forceUeUpdateProps,"url"]),z(Pt,"propValFuncs",{...de.propValFuncs,url:e=>typeof e=="string"?j.ESSceneObject.context.getStrFromEnv(j.rpToap(e)):(e.url=j.ESSceneObject.context.getStrFromEnv(j.rpToap(e.url)),e),czmMaximumScale:null,czmMinimumPixelSize:null,czmNativeScale:null,czmColor:null}),z(Pt,"type",Pt.register("ESUeViewer",j.ESGltfModel.type,Pt));let Ho=Pt;const eA=class eA extends Pe{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(eA,"type",eA.register("ESUeViewer",j.ESHeightMeasurement.type,eA));let Lo=eA;const tA=class tA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const y=async(A,h,m,g)=>{const{viewer:w}=A;if(!w){console.error("AIMoveTo: ueViewer.viewer is undefined");return}const p=await w.callUeFunc({f:"AIMoveTo",p:{id:h,Destination:m,Time:g}});return p.error&&console.error("AIMoveTo:",p.error),p};this.d(e.aiMoveToEvent.don((A,h)=>{y(t,e.id,A,h)}));const B=async(A,h)=>{const{viewer:m}=A;if(!m){console.error("StopAIMove: ueViewer.viewer is undefined");return}const g=await m.callUeFunc({f:"StopAIMove",p:{id:h}});return g.error&&console.error("StopAIMove:",g.error),g};this.d(e.stopAIMoveEvent.don(()=>{B(t,e.id)}))}};z(tA,"type",tA.register("ESUeViewer",j.ESHuman.type,tA));let Do=tA;const xt=class xt extends $e{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}e.anchor=[.5,1]}};z(xt,"type",xt.register("ESUeViewer",j.ESImageLabel.type,xt)),z(xt,"forceUeUpdateProps",[...$e.forceUeUpdateProps,"url"]),z(xt,"propValFuncs",{...$e.propValFuncs,url:e=>typeof e=="string"?j.ESSceneObject.context.getStrFromEnv(j.rpToap(e)):(e.url=j.ESSceneObject.context.getStrFromEnv(j.rpToap(e.url)),e)});let Ro=xt;const rA=class rA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(rA,"type",rA.register("ESUeViewer",j.ESLevelRuntimeModel.type,rA));let ko=rA;const AA=class AA extends $A{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(AA,"type",AA.register("ESUeViewer",j.ESLocalCircle.type,AA));let Ko=AA;const nA=class nA extends De{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(nA,"type",nA.register("ESUeViewer",j.ESLocalPolygonZ.type,nA));let No=nA;const iA=class iA extends $A{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(iA,"type",iA.register("ESUeViewer",j.ESLocalRectangle.type,iA));let Vo=iA;const oA=class oA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(oA,"type",oA.register("ESUeViewer",j.ESLocalSkyBox.type,oA));let Go=oA;const sA=class sA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(sA,"type",sA.register("ESUeViewer",j.ESLocationMeasurement.type,sA));let jo=sA;const aA=class aA extends Pe{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(aA,"type",aA.register("ESUeViewer",j.ESPipeFence.type,aA));let Wo=aA;const cA=class cA extends Jn{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(cA,"type",cA.register("ESUeViewer",j.ESPipeline.type,cA));let zo=cA;const lA=class lA extends ZA{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.d(e.highlightFeatureEvent.don(y=>{const B=typeof y=="number"?y.toString():y;Ms(o,e.id,B)})),this.d(e.highlightFeatureAndFlyToEvent.don((y,B,A,h)=>{const m=typeof y=="number"?y.toString():y;Hs(o,e.id,m,h??1)})),this.d(e.setLayerVisibleEvent.don((y,B)=>{let A="";typeof B!="string"?A=JSON.stringify(B):A=B,Ls(o,e.id,A)})),this.d(e.setLayerColorEvent.don((y,B)=>{let A="";typeof B!="string"?A=JSON.stringify(B):A=B,Ds(o,e.id,A)}))}};z(lA,"type",lA.register("ESUeViewer",j.ESPipeserTileset.type,lA));let Jo=lA;const uA=class uA extends Ne{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(uA,"type",uA.register("ESUeViewer",j.ESPit.type,uA));let Xo=uA;const dA=class dA extends $e{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.ad(e.getInitialStyleEvent.don(async()=>{try{const y=await o.callUeFunc({f:"GetInitialStyle",p:{id:e.id}});y.error!=""&&console.error("getInitialStyleEvent:",y.error),e.initialStyle.value=structuredClone(y.re)}catch(y){console.error("getInitialStyleEvent:",y),e.initialStyle.value=void 0}}))}};z(dA,"type",dA.register("ESUeViewer",j.ESPoi2D.type,dA));let Yo=dA;const fA=class fA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(fA,"type",fA.register("ESUeViewer",j.ESPoi3D.type,fA));let $o=fA;const Ot=class Ot extends De{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(Ot,"type",Ot.register("ESUeViewer",j.ESPoiTileset.type,Ot)),z(Ot,"forceUeUpdateProps",[...De.forceUeUpdateProps,"url"]),z(Ot,"propValFuncs",{...De.propValFuncs,url:e=>typeof e=="string"?j.ESSceneObject.context.getStrFromEnv(e):(e.url=j.ESSceneObject.context.getStrFromEnv(e.url),e)});let Zo=Ot;const hA=class hA extends Pe{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(hA,"type",hA.register("ESUeViewer",j.ESPolygonFence.type,hA));let qo=hA;const pA=class pA extends Ne{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(pA,"type",pA.register("ESUeViewer",j.ESPolygonFlattenedPlane.type,pA));let es=pA;const gA=class gA extends Ne{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(gA,"type",gA.register("ESUeViewer",j.ESPolygonWithHole.type,gA));let ts=gA;const vA=class vA extends _t{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(()=>{e.ids=[]}),this.d(e.highlightInner3DtilesetEvent.don(y=>{y.highlight=!0})),this.d(e.removeHighlightInner3DtilesetEvent.don(y=>{y.highlight=!1}));{const y=h=>{h=h.toLocaleLowerCase();let m=[255,255,255,1];if(h.startsWith("#")){if(h.length===4){let g=parseInt(h[1]+h[1],16),w=parseInt(h[2]+h[2],16),p=parseInt(h[3]+h[3],16);m=[g,w,p,1]}else if(h.length===7){let g=parseInt(h.substring(1,3),16),w=parseInt(h.substring(3,5),16),p=parseInt(h.substring(5,7),16);m=[g,w,p,1]}}else if(h.startsWith("rgba")){let g=h.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/);if(g){let w=parseInt(g[1]),p=parseInt(g[2]),u=parseInt(g[3]),f=parseFloat(g[4]);m=[w,p,u,f]}}else if(h.startsWith("rgb")){let g=h.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);if(g){let w=parseInt(g[1]),p=parseInt(g[2]),u=parseInt(g[3]);m=[w,p,u,1]}}else console.error("color类型只能为#rrggbb、#rgb、rgba(r,g,b,a)、rgb(r,g,b)");return[m[0]/255,m[1]/255,m[2]/255,m[3]]},B=()=>{const h=e.layerConfig;if(!h)return;const m=[];h.forEach(g=>{m.push({condition:[{field:"layer",op:"==",value:g.layer},{field:"dataset",op:"==",value:g.dataset}],color:y(g.value.color??"rgb(255,255,255)"),show:g.value.visible})}),e.setFeatureStyle(m)};B();const A=this.dv(V.createNextAnimateFrameEvent(e.layerConfigChanged));this.d(A.don(()=>{B()}))}}};z(vA,"type",vA.register("ESUeViewer",j.ESRtsTileset.type,vA));let rs=vA;const yA=class yA extends De{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(e.addTreesEvent.don(y=>{j.addTreesCallFunc(t,e.id,y)})),this.d(e.removeAllTreesEvent.don(()=>{j.removeAllTreesCallFunc(t,e.id)})),this.d(e.updateTreeParamsEvent.don(y=>{j.updateTreeParamsCallFunc(t,e.id,y)})),this.d(e.cutDownTreesEvent.don((y,B)=>{j.cutDownTreesCallFunc(t,e.id,y,B)})),this.d(e.growthSimulationEvent.don((y,B,A)=>{j.growthSimulationCallFunc(t,e.id,y,B,A)}))}};z(yA,"type",yA.register("ESUeViewer",j.ESSeparateFoliage.type,yA));let As=yA;const mA=class mA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(mA,"type",mA.register("ESUeViewer",j.ESSubmergingAnalysis.type,mA));let ns=mA;const wA=class wA extends Ne{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{o.callUeFunc({f:"Start",p:{id:e.id}})})),this.d(e.stopEvent.don(()=>{o.callUeFunc({f:"Stop",p:{id:e.id}})}))}};z(wA,"type",wA.register("ESUeViewer",j.ESSunshineAnalysis.type,wA));let is=wA;const BA=class BA extends Ne{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{o.callUeFunc({f:"Start",p:{id:e.id}})}))}};z(BA,"type",BA.register("ESUeViewer",j.ESSurfaceAreaMeasurement.type,BA));let os=BA;const CA=class CA extends $e{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(CA,"type",CA.register("ESUeViewer",j.ESTextLabel.type,CA));let ss=CA;const qt=class qt extends $e{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.d(e.callFunctionEvent.don(async(y,B)=>{const A=await ti(o,e.id,y,B);e.__callFunctionResultEvent.emit(A)}))}};z(qt,"type",qt.register("ESUeViewer",j.ESUEWidget.type,qt)),z(qt,"propValFuncs",{...$e.propValFuncs,info:e=>JSON.stringify(e??{})});let as=qt;const Hu=v=>{switch(v){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"未搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是场景原有的,而是新建的,无法绑定";case 4:return"搜索到ActorTag对应的Actor是地形或3DTileset,无法绑定";default:return"未知错误"}},Py=v=>{switch(v){case 0:return"创建成功";case 1:return"未找到对应的资源,无法创建";case 2:return"Id与场景中现有的ActorTag重复,创建后可能出现问题,创建失败";default:return"未知错误"}},bA=class bA extends j.EngineObject{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn(`${e.id} UeESUnrealActor viewer is undefined!`);return}this.d(()=>{qn(o,e.id)});const y=async()=>{g()||await o.callUeFunc({f:"update",p:{id:e.id,name:e.name,show:e.show,rotation:e.rotation,flyToParam:e.flyToParam??j.ESVisualObject.defaults.flyToParam,flyInParam:e.flyInParam??j.ESVisualObject.defaults.flyInParam,highlight:e.highlight,collision:e.collision,scale:e.scale,minVisibleDistance:e.minVisibleDistance,maxVisibleDistance:e.maxVisibleDistance}})},B=this.dv(V.createNextAnimateFrameEvent(e.showChanged,e.nameChanged,e.rotationChanged,e.flyToParamChanged,e.flyInParamChanged,e.highlightChanged,e.collisionChanged,e.scaleChanged,e.minVisibleDistanceChanged,e.maxVisibleDistanceChanged));this.d(B.don(y)),this.d(e.flushEvent.don(()=>B.flush()));let A,h;const m=async()=>{g()||(await o.callUeFunc({f:"update",p:{id:e.id,position:e.position}}),(t.debug??!1)&&console.log(`updatePostion:${e.position},actorTag:${e.actorTag},actorClass:${e.actorClass}`))},g=()=>!A&&!h?(console.warn(`${e.id} 未绑定ActorTag或未创建ActorClass!`),!0):!1,w=async()=>{const{id:u}=e,f=await t.unBindActorByID(u);f&&f.error!==""&&console.warn(`${e.id} UeESUnrealActor UnBindActorByID: ${f.error}`),A=void 0;const c=await o.callUeFunc({f:"destroy",p:{id:u}});if(c&&c.error!==""){console.warn(`${e.id} UeESUnrealActor DestroyActorByID: ${c.error}`);return}h=void 0},p=this.dv(V.react({type:"ActorClass",actorClass:"default"}));{const u=this.dv(V.createNextAnimateFrameEvent(e.actorClassChanged,e.actorTagChanged)),f=async()=>{e.actorTag!==""?p.value={type:"ActorTag",actorTag:e.actorTag}:p.value={type:"ActorClass",actorClass:e.actorClass===""?"default":e.actorClass}};f(),this.d(u.don(f)),this.d(e.flushEvent.don(()=>u.flush()))}{const u=this.dv(V.createProcessingFromAsyncFunc(async c=>{if(await c.promise(w()),p.value.type==="ActorTag"){const{actorTag:a}=p.value;await c.promise(w());try{e.lastActorStatus="null";const n=await c.promise(t.bindActorByTag(e.id,a));if(!n)return;if(n.error!==""){console.warn(`${e.id} UeESUnrealActor BindActorByTag:${a},${n.error}`);return}if(n.re.type===0)e.lastActorStatus="bound",A=a;else if(n.re.type===1)e.lastActorStatus="bound",A=a,console.warn(`${e.id} UeESUnrealActor BindActorByTag:${a},${Hu(n.re.type)}`);else{A=void 0,console.warn(`${e.id} UeESUnrealActor BindActorByTag error:${a}, ${Hu(n.re.type)}`);return}}catch(n){console.warn(`${e.id} UeESUnrealActor BindActorByTag catch error:${a}, ${n}`);return}}else if(p.value.type==="ActorClass"){const{actorClass:a}=p.value;try{const n=await c.promise(t.createActorByClass(e.id,a));if(!n)return;if(n.error!==""){console.warn(`${e.id} UeESUnrealActor CreateActorByClass error :${a}, ${n.error}`);return}if(n.re.type===0)e.lastActorStatus="created",h=a;else{console.warn(`${e.id} UeESUnrealActor CreateActorByClass error type :${a},${Py(n.re.type)}`);return}}catch(n){console.warn(`${e.id} UeESUnrealActor CreateActorByClass error catch :${a}, ${JSON.stringify(n)}`);return}}await c.promise(y()),await c.promise(m())})),f=async()=>{u.restart()};f(),this.d(p.changed.don(f))}this.d(e.positionChanged.don(m)),this.d(e.callFunctionEvent.don(async(u,f)=>{if(g()){e.__callFunctionResultEvent.emit(void 0);return}const c=await ti(o,e.id,u,f);e.__callFunctionResultEvent.emit(c)})),this.d(e.smoothMoveEvent.don((u,f)=>{g()||zA(o,e.id,u,f)})),this.d(e.smoothMoveWithRotationEvent.don((u,f,c)=>{g()||GA(o,e.id,u,f,c)})),this.d(e.smoothMoveOnGroundEvent.don((u,f,c,a)=>{g()||jA(o,e.id,u,f,a,c)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((u,f,c,a,n)=>{g()||WA(o,e.id,u,f,c,a,n)})),this.d(e.automaticLandingEvent.don(u=>{if(g())return;const f=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(c=>{c!==null&&(e.position=[...f,c],e.collision=u)})})),this.d(e.flyToEvent.don(async(u,f)=>{if(g())return;const c=await Ht(o,e.id,u);let a="over";c===void 0?a="error":c.endType===0?a="over":c.endType===1&&(a="cancelled"),e.flyOverEvent.emit(f,a,t)})),this.d(e.calcFlyToParamEvent.don(()=>{g()||Lt(o,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const u=await t.getCurrentCameraInfo();if(!u)return;const{position:f,rotation:c}=u;e.flyInParam={position:f,rotation:c,flyDuration:1}})),this.d(t.propChanged.don(u=>{g()||u.objId===e.id&&Object.keys(u.props).forEach(f=>{const c=u.props[f]===null?void 0:u.props[f];e[f]=c})}))}};z(bA,"type",bA.register("ESUeViewer",j.ESUnrealActor.type,bA));let cs=bA;const _A=class _A extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(_A,"type",_A.register("ESUeViewer",j.ESVideoFusion.type,_A));let ls=_A;const EA=class EA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(EA,"type",EA.register("ESUeViewer",j.ESViewShed.type,EA));let us=EA;const FA=class FA extends Pe{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};z(FA,"type",FA.register("ESUeViewer",j.ESVisibilityAnalysis.type,FA));let ds=FA;const QA=class QA extends Ne{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{o.callUeFunc({f:"Start",p:{id:e.id}})})),this.d(e.clearEvent.don(()=>{o.callUeFunc({f:"Clear",p:{id:e.id}})}))}};z(QA,"type",QA.register("ESUeViewer",j.ESVolumeMeasurement.type,QA));let fs=QA;const er=class er extends $e{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(er,"type",er.register("ESUeViewer",j.ESWidget.type,er)),z(er,"propValFuncs",{...$e.propValFuncs,info:e=>JSON.stringify(e??{})});let hs=er;const SA=class SA extends j.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=""})}};z(SA,"type",SA.register("ESUeViewer",j.ESHumanPoi.type,SA));let ps=SA;j.ESSceneObject.context.getStrFromEnv(j.ESNavigator.defaults.imgUrl);const UA=class UA extends j.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const y=this.disposeVar(new j.ESCustomDiv);t.add(y),this.dispose(()=>t.delete(y)),this.dispose(V.track([y,"show"],[e,"show"])),y.instanceClass=class extends V.Destroyable{constructor(A,h,m){super(),this._subContainer=A;const g=document.createElement("div");this._subContainer.appendChild(g),this.dispose(()=>this._subContainer.removeChild(g));{const u=async()=>{const f=await t.getCurrentCameraInfo(),c=f==null?void 0:f.position,n=[...f==null?void 0:f.rotation];n[0]=360,t.flyIn(c,n)};g.addEventListener("click",u),g.style.cursor="pointer",this.dispose(()=>g.removeEventListener("click",u))}{const u=()=>{g.style.width=`${e.cssSize?e.cssSize:j.ESNavigator.defaults.cssSize}px`,g.style.height=`${e.cssSize?e.cssSize:j.ESNavigator.defaults.cssSize}px`};u(),e.dispose(e.cssSizeChanged.disposableOn(u))}g.style.position="fixed";{const u=()=>{g.style.top=`${e.cssPosition?e.cssPosition[0]:j.ESNavigator.defaults.cssPosition[0]}px`,g.style.right=`${e.cssPosition?e.cssPosition[1]:j.ESNavigator.defaults.cssPosition[1]}px`};u(),e.dispose(e.cssPositionChanged.disposableOn(u))}g.style.transition=" right 0.4s linear",g.style.cursor="pointer";const w=document.createElement("div");g.appendChild(w),this.dispose(()=>g.removeChild(w)),w.style.width="100%",w.style.height="100%",w.style.position="relative";const p=document.createElement("img");w.appendChild(p),this.dispose(()=>w.removeChild(p)),p.style.width="100%",p.style.height="100%",p.style.border="none";{const u=()=>p.src=e.imgUrl;u(),e.dispose(e.imgUrlChanged.disposableOn(u))}{const u=()=>{const n=-t.getCurrentCameraInfo().rotation[0];p.style.transform=`rotate(${n}deg)`};let f;const c=async()=>{u(),e.show?(g.style.display="block",f=setInterval(()=>{u()},1e3)):(g.style.display="none",clearInterval(f))};this.dispose(e.showChanged.disposableOn(c)),c(),this.dispose(()=>clearInterval(f))}p.style.transformOrigin="50% 50%"}}}};z(UA,"type",UA.register("ESUeViewer",j.ESNavigator.type,UA));let gs=UA;const Mt=class Mt extends Pe{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}{const y=()=>{let B=e.materialMode==="blue"?"multipleArrows":e.materialMode==="purple"?"singleArrow":e.materialMode;o.callUeFunc({f:"update",p:{id:e.id,materialMode:B}})};this.dispose(e.materialModeChanged.disposableOn(y)),this.dispose(e.createdEvent.disposableOn(y))}}};z(Mt,"type",Mt.register("ESUeViewer",j.ESPath.type,Mt)),z(Mt,"forceUeUpdateProps",[...Pe.forceUeUpdateProps]),z(Mt,"propValFuncs",{...Pe.propValFuncs,materialMode:null});let vs=Mt;async function xy(v){navigator.clipboard.writeText(v).then(function(){console.log("复制成功")},function(e){console.log("复制失败")})}const TA=class TA extends j.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const y=this.disposeVar(new j.ESCustomDiv);t.add(y),this.dispose(()=>t.delete(y)),y.instanceClass=class extends V.Destroyable{constructor(A,h,m){if(super(),this._subContainer=A,!m||!(m instanceof it))return;const g=document.createElement("div");this._subContainer.appendChild(g),this.dispose(()=>this._subContainer.removeChild(g)),g.style.width="100%",g.style.position="absolute",g.style.height=`${j.ESViewerStatusBar.defaults.height}px`,g.style.left="0",g.style.bottom="0",g.style.color="#fff",g.style.padding="0 20px 0 0",g.style.boxSizing="border-box",g.style.lineHeight=`${j.ESViewerStatusBar.defaults.height}px`,g.style.zIndex="100",g.style.alignContent="center",g.style.justifyContent="space-between";const w=document.createElement("span");g.appendChild(w),this.dispose(()=>g.removeChild(w));const p=document.createElement("span");w.appendChild(p),this.dispose(()=>w.removeChild(p));const u=document.createElement("span");w.appendChild(u),u.addEventListener("dblclick",function(){let c=u.innerHTML;c.startsWith("鼠标位置")&&(c=c.slice(5)),xy(c)}),u.style.cursor="pointer",this.dispose(()=>w.removeChild(u));const f=document.createElement("span");g.appendChild(f),this.dispose(()=>g.removeChild(f));{const c=()=>{g.style.height=(e.height??j.ESViewerStatusBar.defaults.height)+"px",g.style.lineHeight=(e.height??j.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(c)),c()}{const c=()=>{g.style.fontSize=(e.fontSize??j.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(c)),c()}{const c=()=>{e.bgColor?g.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:g.style.background=`rgba(${j.ESViewerStatusBar.defaults.bgColor[0]},${j.ESViewerStatusBar.defaults.bgColor[1]},${j.ESViewerStatusBar.defaults.bgColor[2]},${j.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(c)),c()}m.getVersion().then(c=>{c&&(f.innerText=`Ue 版本 : ${c[0]} `)}).catch(c=>{console.log(c)});{const c=()=>{let s="",r="";s+=`帧率:${m.getFPS().toFixed(0)}FPS`,p.innerText=s;const i=t.getCurrentCameraInfo();s+=` 经度: ${i.position[0].toFixed(5)}° 纬度: ${i.position[1].toFixed(5)}° 高度: ${i.position[2].toFixed(2)}米 偏航角: ${i.rotation[0].toFixed(2)}° 俯仰角: ${i.rotation[1].toFixed(2)}° 翻滚角:${i.rotation[2].toFixed(2)}° `,p.innerText=s,t.pick().then(l=>{if(l){const{pickResult:d}=l;if(d&&d.position){const{position:C}=d;r+=`鼠标位置:${C[0].toFixed(5)}° ${C[1].toFixed(5)}° ${C[2].toFixed(2)}m`}else r+="暂时无法获取鼠标位置...";u.innerText=r}}).catch(l=>{console.log(l)})};let a;const n=async()=>{c(),e.show?(g.style.display="flex",a=setInterval(()=>{c()},1e3)):(g.style.display="none",clearInterval(a))};this.dispose(e.showChanged.disposableOn(n)),n(),this.dispose(()=>clearInterval(a))}}}}};z(TA,"type",TA.register("ESUeViewer",j.ESViewerStatusBar.type,TA));let ys=TA;const IA=class IA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(IA,"type",IA.register("ESUeViewer",j.ESGaussianSplatting.type,IA));let ms=IA;const PA=class PA extends _t{constructor(t,o){super(t,o);z(this,"_es3DTileset",this.dv(new j.ES3DTileset(`${this.sceneObject.id}_ES3DTileset`)));if(!o.viewer){console.warn("viewer is undefined!");return}t.mainClass=this._es3DTileset;{const B=this._es3DTileset;o.add(B),this.dispose(()=>o.delete(B)),this.d(V.track([B,"allowPicking"],[t,"allowPicking"])),this.d(V.track([B,"collision"],[t,"collision"])),this.d(V.bind([B,"flyToParam"],[t,"flyToParam"])),this.d(V.bind([B,"flyToParam"],[t,"flyToParam"])),this.d(V.track([B,"url"],[t,"url"])),this.d(V.track([B,"actorTag"],[t,"actorTag"])),this.d(V.track([B,"materialMode"],[t,"materialMode"])),this.d(V.track([B,"highlight"],[t,"highlight"])),this.d(V.track([B,"maximumScreenSpaceError"],[t,"maximumScreenSpaceError"])),this.d(V.track([B,"highlightID"],[t,"highlightID"])),this.d(V.track([B,"highlightColor"],[t,"highlightColor"])),this.d(V.bind([B,"offset"],[t,"offset"])),this.d(V.bind([B,"rotation"],[t,"rotation"])),this.d(V.track([B,"czmImageBasedLightingFactor"],[t,"czmImageBasedLightingFactor"])),this.d(V.track([B,"czmLuminanceAtZenith"],[t,"czmLuminanceAtZenith"])),this.d(V.track([B,"czmMaximumMemoryUsage"],[t,"czmMaximumMemoryUsage"])),this.d(V.track([B,"czmClassificationType"],[t,"czmClassificationType"])),this.d(V.track([B,"czmStyleJson"],[t,"czmStyleJson"])),this.d(V.track([B,"czmBackFaceCulling"],[t,"czmBackFaceCulling"])),this.d(V.track([B,"czmDebugShowBoundingVolume"],[t,"czmDebugShowBoundingVolume"])),this.d(V.track([B,"czmDebugShowContentBoundingVolume"],[t,"czmDebugShowContentBoundingVolume"])),this.d(V.track([B,"colorBlendMode"],[t,"colorBlendMode"])),this.d(V.track([B,"cacheBytes"],[t,"cacheBytes"])),this.d(V.track([B,"clippingPlaneEnabled"],[t,"clippingPlaneEnabled"])),this.d(V.track([B,"unionClippingRegions"],[t,"unionClippingRegions"])),this.d(V.track([B,"clippingPlaneEdgeColor"],[t,"clippingPlaneEdgeColor"])),this.d(V.track([B,"clippingPlaneEdgeWidth"],[t,"clippingPlaneEdgeWidth"])),this.d(V.track([B,"materialParams"],[t,"materialParams"])),this.d(V.bind([B,"supportEdit"],[t,"supportEdit"])),this.d(V.bind([B,"clippingPlanesId"],[t,"clippingPlanesId"])),this.d(V.bind([B,"clippingPlaneIds"],[t,"clippingPlaneIds"])),this.d(V.bind([B,"flattenedPlaneId"],[t,"flattenedPlaneId"])),this.d(V.bind([B,"flattenedPlaneEnabled"],[t,"flattenedPlaneEnabled"])),this.d(V.bind([B,"clippingPlaneId"],[t,"clippingPlaneId"])),this.d(V.bind([B,"excavateId"],[t,"excavateId"]))}{const B=this._es3DTileset;this.d(t.refreshTilesetEvent.don(()=>{B.refreshTileset()})),this.d(t.highlightFeatureEvent.don((...A)=>{B.highlightFeature(...A)})),this.d(t.highlightFeatureAndFlyToEvent.don((...A)=>{B.highlightFeatureAndFlyTo(...A)})),this.d(t.setFeatureColorEvent.don((...A)=>{B.setFeatureColor(...A)})),this.d(t.setFeatureVisableEvent.don((...A)=>{B.setFeatureVisable(...A)})),this.d(t.resetFeatureStyleEvent.don((...A)=>{B.resetFeatureStyle(...A)})),this.d(t.flyInEvent.don((...A)=>{B.flyIn(A[0])})),this.d(t.flyToEvent.don((...A)=>{B.flyTo(A[0])})),this.d(t.calcFlyToParamEvent.don((...A)=>{B.calcFlyToParam(...A)})),this.d(t.calcFlyInParamEvent.don((...A)=>{B.calcFlyInParam(...A)}))}{const B=this._es3DTileset;this.d(B.tilesetReady.don(A=>{t.tilesetReady.emit(A)})),this.d(B.pickedEvent.don(A=>{A.assign({sceneObject:t}),t.pickedEvent.emit(A)}))}{const B=()=>{this.es3DTileset.show=t.show};B(),this.d(t.showChanged.don(()=>{B()}))}}get es3DTileset(){return this._es3DTileset}};z(PA,"type",PA.register("ESUeViewer",j.ESRtsFeatureEditing.type,PA));let ws=PA;const xA=class xA extends _t{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(xA,"type",xA.register("ESUeViewer",j.ESMsTileset.type,xA));let Bs=xA;const OA=class OA extends Ne{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}const y=()=>{o.callUeFunc({f:"update",p:{id:e.id,height:e.height??j.ESGeoExtrudedPolygon.defaults.height,extrudedHeight:e.extrudedHeight??j.ESGeoExtrudedPolygon.defaults.extrudedHeight,perPositionHeight:e.perPositionHeight??j.ESGeoExtrudedPolygon.defaults.perPositionHeight}})},B=this.disposeVar(V.createNextAnimateFrameEvent(e.heightChanged,e.extrudedHeightChanged,e.perPositionHeightChanged));this.dispose(B.disposableOn(y)),this.dispose(e.createdEvent.disposableOn(y))}};z(OA,"type",OA.register("ESUeViewer",j.ESGeoExtrudedPolygon.type,OA));let Cs=OA;const MA=class MA extends de{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};z(MA,"type",MA.register("ESUeViewer",j.ESStaticMesh.type,MA));let bs=MA;const HA=class HA extends Pe{constructor(e,t){super(e,t);const o=t.viewer;if(!o){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{o.callUeFunc({f:"Start",p:{id:e.id}})})),this.d(e.clearEvent.don(()=>{o.callUeFunc({f:"Clear",p:{id:e.id}})}))}};z(HA,"type",HA.register("ESUeViewer",j.ESSkylineAnalysis.type,HA));let _s=HA;J.copyright=void 0;try{const v="earthsdk3-ue",e="3.0.7",t="2025-06-17T01:46:57.000Z",o="北京西部世界科技有限公司",y="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",B="edf147b7826beaf136ce605d8be893b716cc4a69",h=((Date.now()-1750124817e3)/36e5).toFixed(1),m=`%c🌏 ${v}%c ${e}.${B.slice(0,8)}.${t} (距今${h}个小时)
|
|
340
340
|
%c${y?y+`
|
|
341
341
|
`:""}当前网站正在使用${v},此软件版权归${o}所有
|
|
342
|
-
`;J.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
342
|
+
`;J.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","edf147b7826beaf136ce605d8be893b716cc4a69")},get info(){return m},get date(){return"2025-06-17T01:46:57.000Z"},get author(){return"suplyang"},get version(){return"3.0.7"},get name(){return"earthsdk3-ue"},get commitId(){return"edf147b7826beaf136ce605d8be893b716cc4a69"},print(g=!1){!g&&window._xe2_no_copy_print||console.info(this.info,`
|
|
343
343
|
font-size: 18px;
|
|
344
344
|
font-weight: 1000;
|
|
345
345
|
line-height: 1;
|
package/dist/earthsdk3-ue.js
CHANGED
|
@@ -5048,7 +5048,7 @@ const ge = class ge extends D {
|
|
|
5048
5048
|
p(ge, "type", ge.register("ESUeViewer", zn.type, ge));
|
|
5049
5049
|
let oi = ge, Be;
|
|
5050
5050
|
try {
|
|
5051
|
-
const a = "earthsdk3-ue", e = "3.0.7
|
|
5051
|
+
const a = "earthsdk3-ue", e = "3.0.7", t = "2025-06-17T01:46:57.000Z", r = "北京西部世界科技有限公司", i = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", n = "edf147b7826beaf136ce605d8be893b716cc4a69", o = ((Date.now() - 1750124817e3) / 36e5).toFixed(1), u = `%c🌏 ${a}%c ${e}.${n.slice(0, 8)}.${t} (距今${o}个小时)
|
|
5052
5052
|
%c${i ? i + `
|
|
5053
5053
|
` : ""}当前网站正在使用${a},此软件版权归${r}所有
|
|
5054
5054
|
`;
|
|
@@ -5062,7 +5062,7 @@ try {
|
|
|
5062
5062
|
},
|
|
5063
5063
|
// @ts-ignore
|
|
5064
5064
|
get gituri() {
|
|
5065
|
-
return GITURI_ && GITURI_.replace("${commitId}", "
|
|
5065
|
+
return GITURI_ && GITURI_.replace("${commitId}", "edf147b7826beaf136ce605d8be893b716cc4a69");
|
|
5066
5066
|
},
|
|
5067
5067
|
// @ts-ignore
|
|
5068
5068
|
get info() {
|
|
@@ -5070,7 +5070,7 @@ try {
|
|
|
5070
5070
|
},
|
|
5071
5071
|
// @ts-ignore
|
|
5072
5072
|
get date() {
|
|
5073
|
-
return "2025-06-
|
|
5073
|
+
return "2025-06-17T01:46:57.000Z";
|
|
5074
5074
|
},
|
|
5075
5075
|
// @ts-ignore
|
|
5076
5076
|
get author() {
|
|
@@ -5078,7 +5078,7 @@ try {
|
|
|
5078
5078
|
},
|
|
5079
5079
|
// @ts-ignore
|
|
5080
5080
|
get version() {
|
|
5081
|
-
return "3.0.7
|
|
5081
|
+
return "3.0.7";
|
|
5082
5082
|
},
|
|
5083
5083
|
// @ts-ignore
|
|
5084
5084
|
get name() {
|
|
@@ -5086,7 +5086,7 @@ try {
|
|
|
5086
5086
|
},
|
|
5087
5087
|
// @ts-ignore
|
|
5088
5088
|
get commitId() {
|
|
5089
|
-
return "
|
|
5089
|
+
return "edf147b7826beaf136ce605d8be893b716cc4a69";
|
|
5090
5090
|
},
|
|
5091
5091
|
print(d = !1) {
|
|
5092
5092
|
!d && window._xe2_no_copy_print || console.info(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(f,u){typeof exports=="object"&&typeof module<"u"?u(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"],u):(f=typeof globalThis<"u"?globalThis:f||self,u(f.EarthSDK3_UE={},f.EarthSDK3,f["xbsj-base"],f.libPixelstreamingfrontendUe5_2,f.html2canvas))})(this,function(f,u,a,L,Gn){"use strict";var yr=Object.defineProperty;var mr=(f,u,a)=>u in f?yr(f,u,{enumerable:!0,configurable:!0,writable:!0,value:a}):f[u]=a;var p=(f,u,a)=>mr(f,typeof u!="symbol"?u+"":u,a);const Jn={...u.ESViewer.defaults,geoReferenceOrigin:void 0,keepWorldOriginNearCamera:!1,useCache:!0,widgetInteractionDistance:200,memReportInterval:10,sceneControlled:!0,brightness:0,emissiveIntensity:1,statusUpdateInterval:.5,baseUrl:window.location.href??""},Ni=()=>({...u.ESViewer.createCommonProps(),apiKey:"",apiUrl:"",secretKey:"",speechVoiceMode:"",geoReferenceOrigin:a.reactArrayWithUndefined(void 0),keepWorldOriginNearCamera:void 0,useCache:void 0,widgetInteractionDistance:void 0,memReportInterval:void 0,sceneControlled:void 0,brightness:void 0,emissiveIntensity:void 0,statusUpdateInterval:void 0,baseUrl:void 0});function se(){const c=Ni(),e=[];return Object.keys(c).forEach(t=>{e.push(t)}),e}function we(c){const{defaults:e}=W,t=se(),i={};return t.forEach(n=>{i[n]=c[n]??e[n]}),i}const B=async(c,e,t,i,n,r="default")=>{const o=await c.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(c,e)=>{const t=await c.callUeFunc({f:"destroy",p:{id:e}});return t.error&&console.error(t.error),t},K=(c,e)=>{c.callUeFunc({f:"calcFlyToParam",p:{id:e}}).then(t=>{t.error&&console.error("calcFlyToParam:",t.error)}).catch(t=>{console.error("calcFlyToParam:",t)})},zi=(c,e)=>{c.callUeFunc({f:"refreshTileset",p:{id:e}}).then(t=>{t.error&&console.error("refreshTileset:",t.error)}).catch(t=>{console.error("refreshTileset:",t)})},V=async(c,e,t,i,n,r="default")=>{const o=await c.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(c,e)=>{if(!c){console.warn("DefaultCameraFlyIn: viewer is undefined");return}const t=await c.callUeFunc({f:"DefaultCameraFlyIn",p:{Duration:e??1}});if(t.error){console.error("DefaultCameraFlyIn:",t.error);return}return t},Hi=async c=>{if(!c){console.warn("StartVoice:viewer is undefined");return}const e=await c.callUeFunc({f:"StartVoice",p:{}});if(e.error){console.error("StartVoice:",e.error);return}return e},Gi=async c=>{if(!c){console.warn("StopVoice:viewer is undefined");return}const e=await c.callUeFunc({f:"StopVoice",p:{}});if(e.error){console.error("StopVoice:",e.error);return}return e},Ji=async(c,e)=>{if(!c){console.warn("mountPakFiles:viewer is undefined");return}const t=await c.callUeFunc({f:"MountPakFiles",p:{json:e}});if(t.error){console.error("mountPakFiles:",t.error);return}return t},Bi=async c=>{if(!c){console.warn("generateMemReport:viewer is undefined");return}const e=await c.callUeFunc({f:"GenerateMemReport",p:{}});if(e.error){console.error("generateMemReport:",e.error);return}return e},me=async(c,e)=>{const t=await c.callUeFunc({f:"resetWithCurrentCamera",p:{id:e}});return t.error&&console.error("resetWithCurrentCamera:",t.error),t},ae=(c,e,t,i,n)=>{c.callUeFunc({f:"smoothMoveWithRotation",p:{id:e,Destination:t,NewRotation:i,Time:n}}).then(r=>{r.error&&console.error("smoothMoveWithRotation:",r.error)}).catch(r=>{console.error("smoothMoveWithRotation:",r)})},le=(c,e,t,i,n,r)=>{c.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)})},de=(c,e,t,i,n,r,o)=>{c.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=(c,e,t)=>{c.callUeFunc({f:"HighlightFeature",p:{id:e,HlId:t}}).then(i=>{i.error&&console.error("HighlightFeature:",i.error)}).catch(i=>{console.error("HighlightFeature:",i)})},qi=(c,e,t,i)=>{c.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=(c,e,t)=>{c.callUeFunc({f:"SetLayerVisible",p:{id:e,LayerJson:t}}).then(i=>{i.error&&console.error("SetLayerVisible:",i.error)}).catch(i=>{console.error("SetLayerVisible:",i)})},Zi=(c,e,t)=>{c.callUeFunc({f:"SetLayerColor",p:{id:e,LayerJson:t}}).then(i=>{i.error&&console.error("SetLayerColor:",i.error)}).catch(i=>{console.error("SetLayerColor:",i)})},ce=(c,e,t,i)=>{c.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(c,e,t,i)=>{const n=await c.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},Vi=(c,e,t,i)=>{c.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)})},Qi=(c,e,t,i)=>{c.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)})},Yi=(c,e,t,i)=>{c.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(c,e)=>{const t=await c.callUeFunc({f:"ChangeNavigationMode",p:e});if(t.error){console.error("ChangeNavigationMode:",t.error);return}return t},bi=async(c,e)=>{const t=await c.callUeFunc({f:"setGlobalProperty",p:e});if(t.error){console.error("setGlobalProperty:",t.error);return}return t},xi=async c=>{const e=await c.callUeFunc({f:"Quit",p:void 0});if(e.error){console.error("Quit:",e.error);return}return e},Oi=async(c,e,t,i)=>{console.log("pickCallFunc",e,t,i);const n=await c.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;const s=r?u.ESSceneObject.getSceneObject(r):void 0;return s&&Reflect.has(s,"allowPicking")&&Reflect.has(s,"pickedEvent")&&(s.allowPicking??!1)&&(o=new u.ESJPickedResult(n.re,s,n.re.features,n.re.add,t,e),s.pickedEvent.emit(o)),s&&Reflect.has(s,"allowPicking")&&!s.allowPicking?new u.ESJPickedResult:o},ji=async(c,e)=>{const t=await c.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(c,e,t,i="ECC_Visibility")=>{const n=await c.callUeFunc({f:"GetHeightByLonLat",p:{Lon:e,Lat:t,Channel:i}});if(n.error){console.warn(`GetHeightByLonLat:${n.error}`);return}return n.re},en=async(c,e,t="ECC_Visibility")=>{const i=await c.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(c,e=64,t=64)=>{const i=await c.callUeFunc({f:"capture",p:{resx:e,resy:t}});if(i.error){console.warn(i.error);return}return i.re.image},rn=async(c,e,t=[64,64])=>{const i=await c.callUeFunc({f:"partialCapture",p:{startPos:e,size:t}});if(i.error){console.warn(i.error);return}return i.re.image},on=async(c,e)=>{const t=await c.callUeFunc({f:"LonLatAltToScreenPosition",p:{LonLatAlt:e}});return t.error&&console.warn(t.error),t.re},sn=async(c,e)=>{const t=await c.callUeFunc({f:"UEPositionToLonLatAlt",p:{UEPosition:e}});if(t.error){console.warn(t.error);return}return[...t.re.LonLatAlt]},an=async(c,e)=>{const t=await c.callUeFunc({f:"GetAllSocketNamesByActorTag",p:{ActorTag:e}});if(t.error){console.warn(t.error);return}return[...t.re.socketNames]},ln=async c=>{const e=await c.callUeFunc({f:"GetVersion",p:void 0});if(e.error){console.warn("GetVersion:",e.error);return}return e.re.version},dn=async(c,e)=>{const t=await c.callUeFunc({f:"GetBoundSphere",p:{id:e}});if(t.error){console.warn(t.error);return}return t.re},cn=async(c,e)=>{const t=await c.callUeFunc({f:"GetBoundSphereWithChildren",p:{id:e}});if(t.error){console.warn(`GetBoundSphereWithChildren:${t.error}`);return}return t.re},un=async(c,e)=>{const t=await c.callUeFunc({f:"GetStrokeMaterialParamInfo",p:{id:e}});if(t.error){console.warn(`GetStrokeMaterialParamInfo:${t.error}`);return}return t.re},hn=async(c,e)=>{const t=await c.callUeFunc({f:"GetFillMaterialParamInfo",p:{id:e}});if(t.error){console.warn(`GetFillMaterialParamInfo:${t.error}`);return}return t.re},vn=async(c,e)=>{const t=await c.callUeFunc({f:"getGlobalProperty",p:{props:e}});if(t.error){console.warn(`getGlobalProperty:${t.error}`);return}return t.re},gn=async(c,e)=>{const t=await c.callUeFunc({f:"GetObjectByInfo",p:{info:e}});if(t.error){console.warn(`GetObjectByInfo:${t.error}`);return}return t.re},fn=async(c,e,t)=>await c.callUeFunc({f:"BindActorByTag",p:{ID:e,ActorTag:t}}),pn=async c=>await c.callUeFunc({f:"RestoreOriginalScene",p:void 0}),wn=async(c,e)=>await c.callUeFunc({f:"UnBindActorByID",p:{ID:e}}),yn=async(c,e)=>await c.callUeFunc({f:"UnBindActorByTag",p:{ActorTag:e}}),mn=async(c,e,t)=>await c.callUeFunc({f:"CreateActorByClass",p:{ID:e,ActorClass:t}}),Cn=async function(c,e,t){return await c.callUeFunc({f:"Bind3DTilesetByTag",p:{ID:e,ActorTag:t}})},En=async function(c,e){return await c.callUeFunc({f:"UnBind3DTilesetByTag",p:{ActorTag:e}})},Fn=async function(c,e){return await c.callUeFunc({f:"UnBind3DTilesetById",p:{ID:e}})},Sn=async function(c,e,t,i){return await c.callUeFunc({f:"BindImageryByTag",p:{ID:e,ActorTag:t,ComponentTag:i}})},In=async function(c,e,t){return await c.callUeFunc({f:"UnBindImageryByTag",p:{ActorTag:e,ComponentTag:t}})},Tn=async function(c,e){return await c.callUeFunc({f:"UnBindImageryById",p:{ID:e}})},Rn=async function(c,e,t,i){return await c.callUeFunc({f:"GetIdByComponentNameAndHitItem",p:{id:e,ComponentName:t,HitItem:i}})},Dn=async function(c,e="ECC_Visibility"){return await c.callUeFunc({f:"GetCameraRelativeHeight",p:{Channel:e}})},Ln=async function(c,e,t,i){const n=await c.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(c,e,t=!0){const i=await c.callUeFunc({f:"HighlightActorByTag",p:{ActorTag:e,Highlight:t}});return i.error!==""&&console.warn("HighlightActorByTag: ",i.error),i},Un=async function(c,e){const t=await c.callUeFunc({f:"SendCustomMessage",p:{Message:e}});return t.error!==""&&console.warn("SendCustomMessage: ",t.error),t},Mn=async function(c){const e=await c.callUeFunc({f:"GetStatus",p:void 0});if(e.error){console.warn(`GetStatus:${e.error}`);return}return e.re},An=async(c,e,t,i,n=!0)=>{const r=await c.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 c=>{const e=await c.callUeFunc({f:"stopEditing",p:void 0});if(e.error){console.error("stopEditing:",e.error);return}return e},$n=async(c,e,t)=>{const i=await c.callUeFunc({f:"moveObjects",p:{sceneObjectIDs:e,editingID:t}});if(i.error){console.error("moveObjects:",i.error);return}return i},_n=async c=>{const e=await c.callUeFunc({f:"GetTilesetMaterialIDList",p:void 0});if(e.error){console.error("GetTilesetMaterialIDList:",e.error);return}return e.re.materialIDList};class Q extends a.Destroyable{}const Bn={Response:1},ue={UIInteraction:50,MouseWheel:75};class Kn extends a.HasOwner{constructor(t,i){super(t);p(this,"_processResponseFn",t=>this.esUeViewer.processResponse(t));p(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]===Bn.Response){s+=4;let v=o[s/4];s+=4;for(let l=0;l<v;l++){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 Xn extends a.Destroyable{constructor(t,i){super();p(this,"_eventTarget",new EventTarget);p(this,"debug",!1);p(this,"uiInteractionCallbacks",new Map);p(this,"_pixelStream");p(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 v=s.webRtcController.sendMessageController.dataChannelSender.sendData;s.webRtcController.sendMessageController.dataChannelSender.constructor.prototype.sendData=function(l){s.esMsgWsWrapper?s.esMsgWsWrapper.sendInputData(l):v.call(this,l)}}}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:!0,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 Kn(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=a.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=a.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 v=Math.ceil(o/r)|0;[...new Array(v).keys()].map(y=>n.slice(y*r,(y+1)*r)).forEach((y,w)=>{this.esMsgWsWrapper&&this.esMsgWsWrapper.emitDescriptorWithString(ue.UIInteraction,`${s}-${w}/${v}-`+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 Zn extends a.Destroyable{constructor(t,i,n){super();p(this,"_instance");p(this,"_event",this.dv(new a.Event));this._container=t,this._wsuri=i,this._esmsgWsUri=n,this._instance=this.dv(new Xn(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 Vn extends Q{constructor(t,i,n,r){super();p(this,"_esueViewerWrapper");p(this,"_ueFuncResultWithIdsEvent",this.dv(new a.Event));p(this,"_ueFuncWithIdAndResultCallbacks",[]);p(this,"_waitingUeFuncIdAndResultCallbacks",new Map);p(this,"_waitingUeCalls",new Set);p(this,"_ueEvent",this.dv(new a.Event));p(this,"_errorEvent",this.dv(new a.Event));p(this,"_readyEvent",this.dv(new a.Event));p(this,"_esmsgwsopen",this.dv(a.react(!1)));p(this,"_videoinited",this.dv(a.react(!1)));p(this,"_webRtcConnected",this.dv(a.react(!1)));this._ueViewer=r,console.log("CSTMPSViewer init ! 以官方像素流 + 独立通信的模式启动!");const o=this._ueViewer;this._esueViewerWrapper=this.dv(new Zn(t,i,n));const s=this._esueViewerWrapper;{const g=()=>s.debug=o.debug??!1;g(),this.d(o.debugChanged.don(g))}let v=!1;{const g=()=>{if(v)return;const h=s.webSocketReady;if(this.videoinited&&this.webRtcConnected&&h){console.log("%c[EarthSDK: esmsgWebSocket && videoinited && webRtcConnected]","background: #a6ec99; color: black");const m={eventType:"init",params:{}};s.emitUIInteractionForBigData(m),this._readyEvent.emit(),v=!0}};this.d(this.videoinitedChanged.don(()=>{g()})),this.d(this.webRtcConnectedChanged.don(()=>{g()})),this.d(this.esmsgwsopenChanged.don(()=>{g()}))}this.d(s.event.don((g,h)=>{if(g==="error")this._errorEvent.emit(h);else if(g==="ueevent"){const m=JSON.parse(h);if(m.t==="cr"){const C=m;if(C.frs&&this._ueFuncResultWithIdsEvent.emit(C.frs),C.ers)for(let E of C.ers)this._ueEvent.emit(E)}}else g==="webRtcConnected"?this.webRtcConnected=!0:g==="videoinited"?this.videoinited=!0:g==="esmsgwsopen"&&(this.esmsgwsopen=!0)}));{const g=this.dv(a.createAnimateFrame());let h,m;g.start(()=>{if(h!==t.offsetWidth||m!==t.offsetHeight){if(h=t.offsetWidth,m=t.offsetHeight,h===void 0||m===void 0||!Number.isFinite(h)||!Number.isFinite(m)||h<0||m<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${h} ${m}`);return}s.resize(h,m),console.log(`resize: ${h} ${m}`)}})}this.d(this._ueFuncResultWithIdsEvent.don(g=>{for(const h of g){const m=this._waitingUeFuncIdAndResultCallbacks.get(h.fid);m&&(this._waitingUeFuncIdAndResultCallbacks.delete(h.fid),m.resultCallback(h.r))}}));let l=0;const y=g=>{const h={n:l++,tt:Date.now(),t:"c",fs:g};this._waitingUeCalls.add(h),o.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(h,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd()),this._esueViewerWrapper.emitUIInteractionForBigData(h,()=>{this._waitingUeCalls.delete(h)})},w=()=>{if(!v||this._ueFuncWithIdAndResultCallbacks.length===0)return;const g=this._ueFuncWithIdAndResultCallbacks.map(([h])=>h);for(const[h,m]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(h.fid,m);this._ueFuncWithIdAndResultCallbacks.length=0;{const h=window.g_emitDescriptor_maxBytes,m=g.map(R=>({f:R,s:JSON.stringify(R).length}));let C=m.length,E=0,I=0,F=[];do{do{const{f:R,s:T}=m[E];if(F.push(R),++E,I+T>h||F.length>=20)break}while(E<C);F.length>0&&(o.debug&&console.log(`传送${F.length}条消息...`),y([...F]),F.length=0,I=0)}while(E<C)}};this.dv(a.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:a.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,{timeStamp:Date.now(),ueFunc:t,resultCallback:i}])})}disposableOnUeEvent(t,i){(this._ueViewer.debug??!1)&&console.log(`disposableOnUeEvent from UeCloudViewer, type:${t}`);const n=a.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},o=this._ueEvent.don(s=>{s.et===t&&s.eid===n&&i(s)});return()=>{o(),r()}}}function Qn(c){let e="";const t=new Uint8Array(c),i=t.length;for(let n=0;n<i;n++)e+=String.fromCharCode(t[n]);return btoa(e)}const Yn=c=>{const e={type:"input",inputdata:Qn(c)};return JSON.stringify(e)};function bn(c){return typeof c=="string"?document.getElementById(c):c}window.g_emitDescriptor_maxBytes=3e4,console.log("全局可设置消息体最大字节, window.g_emitDescriptor_maxBytes 默认 30000 。");let xn=-1;L.Logger.SetLoggerVerbosity(1);class On extends a.Destroyable{constructor(t,i){super();p(this,"debug",!1);p(this,"_error",this.dv(new a.Event));p(this,"_connected",this.dv(new a.Event));p(this,"_ueevent",this.dv(new a.Event));p(this,"_pixelStream");p(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(Yn(s)):o.call(this,s)}}{const r=o=>{const s=this._pixelStream._webRtcController.mouseController;setTimeout(()=>{const v=s.coordinateConverter.normalizeAndQuantizeUnsigned(o.offsetX,o.offsetY),y=s.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp");y&&y([o.button,v.x,v.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 bn(this._container)}get pixelStream(){return this._pixelStream}get webSocketReady(){return this.pixelStream.webSocketController.webSocket.readyState===1}processResponse(t){if(this.debug??!1)try{const i=JSON.parse(t);console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(i,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()}catch(i){console.error(`processResponse(${t}) error: ${i}`,i)}this.resolveCallback(t)||this.ueevent.emit(t)}emitUIInteractionForBigData(t,i){typeof i=="function"&&(t.callid=a.createGuid(),this.uiInteractionCallbacks.set(t.callid,i));const n=JSON.stringify(t),r=window.g_emitDescriptor_maxBytes??3e4,o=n.length,s=++xn;if(o<r){const y={type:"earthsdk",time:new Date().getTime(),params:`${s}-0/1-`+n};this.sendData(JSON.stringify(y));return}const v=Math.ceil(o/r)|0;[...new Array(v).keys()].map(y=>n.slice(y*r,(y+1)*r)).forEach((y,w)=>{const d={type:"earthsdk",time:new Date().getTime(),params:`${s}-${w}/${v}-`+y};this.sendData(JSON.stringify(d))})}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 jn extends a.Destroyable{constructor(t,i,n){super();p(this,"_instance");p(this,"_event",this.dv(new a.Event));this._container=t,this._wsuri=i,this._esmsgWsUri=n,this._instance=this.dv(new On(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 tr extends Q{constructor(t,i,n,r){super();p(this,"_videoInitialized",this.dv(a.react(!1)));p(this,"_webRtcConnected",this.dv(a.react(!1)));p(this,"_webSocketOpen",this.dv(a.react(!1)));p(this,"_ue5ViewerWrapper");p(this,"_ueFuncResultWithIdsEvent",this.dv(new a.Event));p(this,"_ueFuncWithIdAndResultCallbacks",[]);p(this,"_waitingUeFuncIdAndResultCallbacks",new Map);p(this,"_waitingUeCalls",new Set);p(this,"_ueEvent",this.dv(new a.Event));p(this,"_errorEvent",this.dv(new a.Event));p(this,"_readyEvent",this.dv(new a.Event));this._ueViewer=r,console.log("INNPSViewer init ! 以内置信令服务器模式启动!");const o=this._ueViewer,s=this.dv(new jn(t,i,n));this._ue5ViewerWrapper=s;{const d=()=>s.debug=o.debug??!1;d(),this.d(o.debugChanged.don(d))}{let d=!1;const g=this.dv(a.createNextAnimateFrameEvent(this._videoInitialized.changed,this._webRtcConnected.changed,this._webSocketOpen.changed));this.d(g.don(()=>{if(d)return;const h=this._ue5ViewerWrapper.instance.webSocketReady;if(this.videoInitialized&&this.webRtcConnected&&h){this._ue5ViewerWrapper.instance.emitUIInteraction(),this._readyEvent.emit(),d=!0,console.log("%c[EarthSDK videoInitialized && webRtcConnected && webSocketReady]","background: #a6ec99; color: black");const m={eventType:"init",params:{}};this._ue5ViewerWrapper.emitUIInteractionForBigData(m)}else console.warn("webSocketReady",h),d=!1}))}this.d(s.event.don((d,g)=>{if(d==="errorEvent")this._errorEvent.emit(g);else if(d==="videoInitialized")this._videoInitialized.value=!0;else if(d==="webRtcConnected")this._webRtcConnected.value=!0;else if(d==="webSocketOpen")this._webSocketOpen.value=!0;else if(d==="ueevent"){const h=JSON.parse(g);if(h.t==="cr"){const m=h;if(m.frs&&this._ueFuncResultWithIdsEvent.emit(m.frs),m.ers)for(let C of m.ers)this._ueEvent.emit(C)}}}));{const d=this.dv(a.createAnimateFrame());let g,h,m;d.start(()=>{if(g!==t.offsetWidth||h!==t.offsetHeight||m!==o.resolutionScale){if(g=t.offsetWidth,h=t.offsetHeight,g===void 0||h===void 0||!Number.isFinite(g)||!Number.isFinite(h)||g<0||h<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${g} ${h}`);return}m=o.resolutionScale,s.resize(g/m,h/m)}})}this.d(this._ueFuncResultWithIdsEvent.don(d=>{for(const g of d){const h=this._waitingUeFuncIdAndResultCallbacks.get(g.fid);h&&(this._waitingUeFuncIdAndResultCallbacks.delete(g.fid),h.resultCallback(g.r))}}));let v=0;const l=d=>{const g={n:v++,tt:Date.now(),t:"c",fs:d};this._waitingUeCalls.add(g),o.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(g,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd()),this._ue5ViewerWrapper.emitUIInteractionForBigData(g,()=>{this._waitingUeCalls.delete(g)})},y=()=>{if(!this._ue5ViewerWrapper.instance.webSocketReady||this._ueFuncWithIdAndResultCallbacks.length===0)return;const g=this._ueFuncWithIdAndResultCallbacks.map(([h])=>h);for(const[h,m]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(h.fid,m);this._ueFuncWithIdAndResultCallbacks.length=0;{const h=window.g_emitDescriptor_maxBytes,m=g.map(R=>({f:R,s:JSON.stringify(R).length}));let C=m.length,E=0,I=0,F=[];do{do{const{f:R,s:T}=m[E];if(F.push(R),++E,I+T>h||F.length>=20)break}while(E<C);F.length>0&&(o.debug&&console.log(`传送${F.length}条消息...`),l([...F]),F.length=0,I=0)}while(E<C)}};this.dv(a.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:a.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,{timeStamp:Date.now(),ueFunc:t,resultCallback:i}])})}disposableOnUeEvent(t,i){const n=a.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},o=this._ueEvent.don(s=>{s.et===t&&s.eid===n&&i(s)});return()=>{o(),r()}}}class er extends a.Destroyable{constructor(t,i,n,r){super();p(this,"_onRuntimeInitialized",this.dv(new a.Event));p(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 v=u.ESSceneObject.getStrFromEnv(n+`/web/${i}.html`);s.src=v,s.onload=()=>{const l=s.contentWindow;if(!l){console.error("iframeWindow is null");return}console.log("iwindow.Module",l.Module),l.Module.onRuntimeInitialized=()=>{this._onRuntimeInitialized.emit(),o.setStatus("Created"),o.setStatusLog("创建成功"),l.Module.UE4_resizeCanvas(),l.console.log("创建成功__________________________________________")}}}}get onRuntimeInitialized(){return this._onRuntimeInitialized}get vIframe(){return this._vIframe}}const Nn=typeof TextDecoder<"u"?new TextDecoder:void 0,ir=(c,e=0,t=NaN)=>{const i=e+t;let n=e;for(;c[n]&&!(n>=i);)++n;if(n-e>16&&c.buffer&&Nn)return Nn.decode(c.subarray(e,n));let r="";for(;e<n;){var o=c[e++];if(!(o&128)){r+=String.fromCharCode(o);continue}var s=c[e++]&63;if((o&224)==192){r+=String.fromCharCode((o&31)<<6|s);continue}var v=c[e++]&63;if((o&240)==224?o=(o&15)<<12|s<<6|v:((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|v<<6|c[e++]&63),o<65536)r+=String.fromCharCode(o);else{var l=o-65536;r+=String.fromCharCode(55296|l>>10,56320|l&1023)}}return r};class nr extends a.Destroyable{constructor(e,t,i){super();{const n=()=>{const v=we(t);t.setGlobalProperty(v)};n();const r=se(),o=[];r.forEach(v=>{const l=t[v+"Changed"];o.push(l)});const s=this.dv(a.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 u.ViewerCustomInteraction(t,e)),this.dv(new a.ObjResettingWithEvent(t.statusUpdateIntervalChanged,n=>{if((t.statusUpdateInterval??.5)===0)return;const o=new a.Destroyable;return o.d(i.disposableOnUeEvent("statusUpdate",s=>{t.statusUpdateEvent.emit(s)})),o})),this.dv(new a.ObjResettingWithEvent(t.propChangedListeningChanged,()=>{if(!(t.propChangedListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("propChanged",o=>{t.propChanged.emit(o)})),r})),this.dv(new a.ObjResettingWithEvent(t.objectEventListeningChanged,()=>{if(!(t.objectEventListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("objectEvent",o=>{t.objectEvent.emit(o)})),r})),this.dv(new a.ObjResettingWithEvent(t.widgetEventListeningChanged,()=>{if(!(t.widgetEventListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("widgetEvent",o=>{t.widgetEvent.emit(o)})),r})),this.dv(new a.ObjResettingWithEvent(t.speechRecognitionListeningChanged,()=>{if(!(t.speechRecognitionListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("speechRecognition",o=>{t.speechRecognition.emit(o)})),r})),this.dv(new a.ObjResettingWithEvent(t.customMessageListeningChanged,()=>{if(!(t.customMessageListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("customMessage",o=>{t.customMessage.emit(o)})),r})),this.dv(new a.ObjResettingWithEvent(t.editingEventListeningChanged,()=>{if(!(t.editingEventListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("editingEvent",o=>{o.objectIDs=o.objectIDs.map(s=>s.split("_")[0]),t.editingEvent.emit(o)})),r}))}}let rr=-1;class or extends Q{constructor(t,i,n="${earthsdk3-ue-h5-assets-script-dir}",r){super();p(this,"_ueFuncResultWithIdsEvent",this.dv(new a.Event));p(this,"_ueFuncWithIdAndResultCallbacks",[]);p(this,"_waitingUeFuncIdAndResultCallbacks",new Map);p(this,"_waitingUeCalls",new Map);p(this,"_ueEvent",this.dv(new a.Event));this._ueViewer=r;const o=this._ueViewer,s=this.dv(new er(t,i,n,o));let v=!1,l=null;this.d(s.onRuntimeInitialized.don(()=>{var g;if(v=!0,(g=s==null?void 0:s.vIframe)!=null&&g.contentWindow){l=s.vIframe.contentWindow;const h=s.vIframe.contentWindow.document.getElementById("mainarea");h?this.dv(new nr(h,o,this)):console.error("h5Container is null")}else{console.error("iframeWindow is null");return}l.UE_JSHTML5Communication?l.UE_JSHTML5Communication.UESendMessageToJS=h=>{try{const m=ir(l.HEAPU8,h),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(g=>{for(const h of g){const m=this._waitingUeFuncIdAndResultCallbacks.get(h.fid);m&&(this._waitingUeFuncIdAndResultCallbacks.delete(h.fid),m(h.r))}}));let y=0;const w=()=>{if(!v||!l||!l.UE_JSHTML5Communication||!l.UE_JSHTML5Communication.JSSendMessageToUE||this._ueFuncWithIdAndResultCallbacks.length===0)return;const g=this._ueFuncWithIdAndResultCallbacks.map(([T])=>T),h={n:y++,tt:Date.now(),t:"c",fs:g,callid:a.createGuid()};for(const[T,$]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(T.fid,$);this._ueFuncWithIdAndResultCallbacks.length=0,this._waitingUeCalls.set(h.callid,h),o.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(h,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd());const m=JSON.stringify(h),C=window.g_emitDescriptor_maxBytes??3e4,E=m.length,I=++rr;if(E<C){const T=`${I}-0/1-`+m;l.UE_JSHTML5Communication.JSSendMessageToUE(T);return}const F=Math.ceil(E/C)|0;[...new Array(F).keys()].map(T=>m.slice(T*C,(T+1)*C)).forEach((T,$)=>{const pe=`${I}-${$}/${F}-`+T;l.UE_JSHTML5Communication.JSSendMessageToUE(pe)})};this.dv(a.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:a.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,i])})}disposableOnUeEvent(t,i){const n=a.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},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 sr=-1;class ar extends Q{constructor(t,i){super();p(this,"_ueFuncResultWithIdsEvent",this.dv(new a.Event));p(this,"_ueFuncWithIdAndResultCallbacks",[]);p(this,"_waitingUeFuncIdAndResultCallbacks",new Map);p(this,"_waitingUeCalls",new Set);p(this,"_ueEvent",this.dv(new a.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 d=JSON.parse(w);if(d.t==="cr"){const g=d;if(g.frs&&this._ueFuncResultWithIdsEvent.emit(g.frs),g.ers)for(let h of g.ers)this._ueEvent.emit(h)}}catch(d){console.error(d)}},this.dispose(this._ueFuncResultWithIdsEvent.disposableOn(y=>{for(const w of y){const d=this._waitingUeFuncIdAndResultCallbacks.get(w.fid);d&&(this._waitingUeFuncIdAndResultCallbacks.delete(w.fid),d(w.r))}}));let s=0;const v=()=>{if(!r||this._ueFuncWithIdAndResultCallbacks.length===0)return;const y=this._ueFuncWithIdAndResultCallbacks.map(([g])=>g),w={n:s++,tt:Date.now(),t:"c",fs:y};for(const[g,h]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(g.fid,h);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 d=++sr;window.ue.es.oncommand(`${d}-0/1-`+JSON.stringify(w)).then(()=>{this._waitingUeCalls.delete(w)})};this.dv(a.createInterval()).start(v,50)}callUeFunc(t){return new Promise(i=>{const r={fid:a.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,i])})}disposableOnUeEvent(t,i){const n=a.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},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 lr extends a.Destroyable{constructor(e,t){super();{const i=()=>{const s=we(e);e.setGlobalProperty(s)};i();const n=se(),r=[];n.forEach(s=>{const v=e[s+"Changed"];r.push(v)});const o=this.dv(a.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 a.ObjResettingWithEvent(e.statusUpdateIntervalChanged,i=>{if((e.statusUpdateInterval??.5)===0)return;const r=new a.Destroyable;return r.d(t.disposableOnUeEvent("statusUpdate",o=>{e.statusUpdateEvent.emit(o)})),r})),this.dv(new a.ObjResettingWithEvent(e.propChangedListeningChanged,()=>{if(!(e.propChangedListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("propChanged",r=>{e.propChanged.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.objectEventListeningChanged,()=>{if(!(e.objectEventListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("objectEvent",r=>{e.objectEvent.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.widgetEventListeningChanged,()=>{if(!(e.widgetEventListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("widgetEvent",r=>{e.widgetEvent.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.speechRecognitionListeningChanged,()=>{if(!(e.speechRecognitionListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("speechRecognition",r=>{e.speechRecognition.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.customMessageListeningChanged,()=>{if(!(e.customMessageListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("customMessage",r=>{e.customMessage.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.editingEventListeningChanged,()=>{if(!(e.editingEventListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("editingEvent",r=>{r.objectIDs=r.objectIDs.map(o=>o.split("_")[0]),e.editingEvent.emit(r)})),n}))}}class dr extends a.Destroyable{constructor(e,t,i){super();{const r=()=>{const l=we(t);t.setGlobalProperty(l)};r();const o=se(),s=[];o.forEach(l=>{const y=t[l+"Changed"];s.push(y)});const v=this.dv(a.createNextAnimateFrameEvent(...s));this.d(v.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=(l,y)=>{window.ue.esinput.setinterceptevent(y),l.preventDefault()},o=l=>{r(l,!1)},s=l=>{r(l,!0)},v=l=>{r(l,!1)};n.addEventListener("mouseenter",o),n.addEventListener("mouseleave",s),n.addEventListener("mousemove",v),this.d(()=>{n.removeEventListener("mouseenter",o),n.removeEventListener("mouseleave",s),n.removeEventListener("mousemove",v)})}t.useCustomInteraction=!1,this.dv(new u.ViewerCustomInteraction(t,n)),this.dv(new a.ObjResettingWithEvent(t.statusUpdateIntervalChanged,r=>{if((t.statusUpdateInterval??.5)===0)return;const s=new a.Destroyable;return s.d(i.disposableOnUeEvent("statusUpdate",v=>{t.statusUpdateEvent.emit(v)})),s})),this.dv(new a.ObjResettingWithEvent(t.propChangedListeningChanged,()=>{if(!(t.propChangedListening??!0))return;const o=new a.Destroyable;return o.d(i.disposableOnUeEvent("propChanged",s=>{t.propChanged.emit(s)})),o})),this.dv(new a.ObjResettingWithEvent(t.objectEventListeningChanged,()=>{if(!(t.objectEventListening??!0))return;const o=new a.Destroyable;return o.d(i.disposableOnUeEvent("objectEvent",s=>{t.objectEvent.emit(s)})),o})),this.dv(new a.ObjResettingWithEvent(t.widgetEventListeningChanged,()=>{if(!(t.widgetEventListening??!0))return;const o=new a.Destroyable;return o.d(i.disposableOnUeEvent("widgetEvent",s=>{t.widgetEvent.emit(s)})),o})),this.dv(new a.ObjResettingWithEvent(t.speechRecognitionListeningChanged,()=>{if(!(t.speechRecognitionListening??!0))return;const o=new a.Destroyable;return o.d(i.disposableOnUeEvent("speechRecognition",s=>{t.speechRecognition.emit(s)})),o})),this.dv(new a.ObjResettingWithEvent(t.customMessageListeningChanged,()=>{if(!(t.customMessageListening??!0))return;const o=new a.Destroyable;return o.d(i.disposableOnUeEvent("customMessage",s=>{t.customMessage.emit(s)})),o})),this.dv(new a.ObjResettingWithEvent(t.editingEventListeningChanged,()=>{if(!(t.editingEventListening??!0))return;const o=new a.Destroyable;return o.d(i.disposableOnUeEvent("editingEvent",s=>{s.objectIDs=s.objectIDs.map(v=>v.split("_")[0]),t.editingEvent.emit(s)})),o}))}}class cr extends a.Destroyable{constructor(t,i,n){super();p(this,"_reconnectEvent",this.dv(new a.Event));const r=(v,l)=>v.hasOwnProperty(l);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 v=this.dv(new ar(t,n));this.d(()=>n.viewer=void 0),n.viewer=v,n.setStatus("Created"),n.setStatusLog("本地视口创建成功!"),this.dv(new dr(t,n,v))}else n.setStatus("Error"),n.setStatusLog("请升级 ESWebView !");else if(r(i.options,"ws")||r(i.options,"uri")&&r(i.options,"app")){n.setStatus("Creating"),n.setStatusLog("开始创建云渲染视口...");let v;this.d(()=>{n.setStatus("Raw"),n.setStatusLog(""),t&&v&&t.removeChild(v)&&(v=void 0)});const l=this.dv(a.createProcessingFromAsyncFunc(async y=>{n.viewer&&!n.viewer.isDestroyed()&&n.viewer.destroy(),n.viewer=void 0,v&&t.removeChild(v)&&(v=void 0),v=document.createElement("div"),v.setAttribute("earthsdk3-ue","earthsdk3-ue-videoContainer"),v.style.cssText="position:relative; height: 100%;width:100%;",t.appendChild(v);let w,d,g;if(r(i.options,"ws")){const{ws:E,esmsg:I,uselnternalSignallingServer:F}=i.options;w=E,d=I,g=F??!1}if(r(i.options,"uri")&&r(i.options,"app")){const{offsetWidth:E,offsetHeight:I}=v;let{uri:F,app:R,token:T}=i.options;F.endsWith("/")||(F+="/");const $=T?`?essstoken=${T}`:"",pe=`/${R}/${E??1920}/${I??1080}`+$;console.log(`请求信令服务器: ${F}instance${pe}`);const vr=await y.promise(fetch(`${F}instance${pe}`,{method:"GET"})),Z=await y.promise(vr.json());if(Z&&Z.status!=="ok"){n.setStatus("Error"),n.setStatusLog(`信令服务器请求失败 ${Z.status}`),this._reconnectEvent.emit(void 0);return}else{console.log(`信令服务器请求成功! ${JSON.stringify(Z,void 0," ")}`),await a.sleep(2e3);const{server:gr,esmsg:fr,instanceId:pr,useInternalSignallingServer:wr}=Z;if(!pr){n.setStatus("Error"),n.setStatusLog("检查信令服务器版本,返回数据错误! "),console.log("信令服务器返回数据错误!不包含instanceId!请升级到 ESSS V3.0+ 版本!"),this._reconnectEvent.emit(void 0);return}w=gr,d=fr,g=wr??!1,n.esssResponse=Z}}const h=this.dv(g?new tr(v,w,d,n):new Vn(v,w,d,n));this.d(()=>n.viewer=void 0),this.d(h.errorEvent.don(E=>{const I=`[${E}]:像素流连接错误!`;n.setStatus("Error"),n.setStatusLog(I),this._reconnectEvent.emit(h)})),await y.promise(new Promise(E=>this.d(h.readyEvent.donce(E)))),n.setStatus("Created"),n.setStatusLog("云渲染视口创建成功!"),o=0,s&&clearTimeout(s),s=void 0;const{offsetWidth:m,offsetHeight:C}=v;h.resize(m*window.devicePixelRatio,C*window.devicePixelRatio),n.viewer=h,this.d(()=>n.viewer=void 0),this.dv(new lr(n,h))}));l.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(()=>{l.restart()},o)))})),this.d(l.errorEvent.don(y=>{n.setStatus("Error"),n.setStatusLog("云渲染视口创建失败!"),console.warn("云渲染视口创建失败!",y),this._reconnectEvent.emit(void 0)}))}else if(r(i.options,"project")){const v=i,l=v.options.project,y=v.options.baseUrl;n.setStatus("Creating"),n.setStatusLog("下载编译中...");const w=this.dv(new or(t,l,y,n));n.viewer=w,this.d(()=>n.viewer=void 0)}else n.setStatus("Error"),n.setStatusLog("视口创建失败!"),console.warn("视口创建失败: 参数错误!")}}const N=class N extends u.ESViewer{constructor(t){super(t);p(this,"_viewer",this.dv(a.react(void 0)));p(this,"_esssResponse");p(this,"_speechRecognition",this.dv(new a.Event));p(this,"_propChanged",this.dv(new a.Event));p(this,"_objectEvent",this.dv(new a.Event));p(this,"_widgetEvent",this.dv(new a.Event));p(this,"_customMessage",this.dv(new a.Event));p(this,"_statusUpdateEvent",this.dv(new a.Event));p(this,"_statusUpdateEventdon",(()=>{this.d(this.statusUpdateEvent.don(t=>{this._statusInfo.fps=t.FPS??0,this._statusInfo.length=t.length??0,this._statusInfo.position=t.position??[0,0,0],this._statusInfo.rotation=t.rotation??[0,0,0]}))})());if(t.type!=="ESUeViewer")throw new Error("option.type must be ESUeViewer");const i=t;this.d(this._viewer.changed.don(()=>{this.viewerChanged.emit(this.viewer)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new cr(this.subContainer,i,this)}))}get defaultProps(){return N.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 Hi(this.viewer)}async stopVoice(){if(!this.viewer){console.warn("startVoice:viewer is undefined");return}return await Gi(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 fn(this.viewer,t,i)}async restoreOriginalScene(){if(!this.viewer){console.warn("RestoreOriginalScene: viewer is undefined");return}return await pn(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 Fn(this.viewer,t)}async bindImageryByTag(t,i,n){if(!this.viewer){console.warn("BindImageryByTag: viewer is undefined");return}return await Sn(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 Un(this.viewer,t)}async getStatus(){if(!this.viewer){console.warn("GetStatus:viewer is undefined");return}return await Mn(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:v,y:l}=this.container.getBoundingClientRect();r=[v+o,l+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 flyIn(t,i=[0,0,0],n=1,r="default"){if(!this.viewer)return;const o=await V(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 B(this.viewer,void 0,void 0,t,i,n);if(r)return r.endType===0&&console.warn(`flyTo:flyTo is end! endType:${r.endType}`),r.endType===1&&console.warn(`flyTo:飞行中断! endType:${r.endType}`),r}flyToBoundingSphere(t,i,n=1){const r=[[t[0],t[1],0],[t[0],t[3],0],[t[2],t[3],0],[t[2],t[1],0]],o=u.getGeoBoundingSphereFromPositions(r);if(!o)return;const{center:s,radius:v}=o,l={distance:i??v,heading:0,pitch:-90,flyDuration:n,hDelta:0,pDelta:0};this.flyTo(l,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){if(!this.viewer)return;const n={mode:"Walk",position:t,jumpZVelocity:i},r=await A(this.viewer,n);return r&&!r.error&&(this._navigationMode.value=n.mode),r}async changeToMap(){if(!this.viewer)return;const t={mode:"Map"},i=await 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 v={mode:"Line",geoLineStringId:t,speed:i,heightOffset:n,loop:r,turnRateDPS:o,lineMode:s},l=await A(this.viewer,v);return l&&!l.error&&(this._navigationMode.value=v.mode),l}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},v=await A(this.viewer,s);return v&&!v.error&&(this._navigationMode.value=s.mode),v}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},v=await A(this.viewer,s);return v&&!v.error&&(this._navigationMode.value=s.mode),v}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}_${a.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=a.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()]}};p(N,"type",N.register("ESUeViewer",N)),p(N,"defaults",{...Jn});let W=N;(c=>{c.createDefaultProps=()=>({...u.ESViewer.createDefaultProps(),...Ni(),resolutionScale:1,autoReconnect:!1,propChangedListening:void 0,objectEventListening:void 0,widgetEventListening:void 0,speechRecognitionListening:void 0,customMessageListening:void 0})})(W||(W={})),a.extendClassProps(W.prototype,W.createDefaultProps);class _ extends u.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(i&&(e.combinationClass||this.d(this.createdEvent.don(()=>{const n=this.constructor.propValFuncs,r=e.defaultProps,o=Object.keys(r).filter(d=>n[d]!==null);o.push(...this.constructor.forceUeUpdateProps);const s=e.constructor.defaults,v={val:{}},l=[];for(let d of o){const g=d+"Changed",h=e[g];l.push(h);const m=n[d];if(m===null)throw console.error("vf === null error"),new Error("vf === null error");const C=()=>{const E=e[d]??s[d];let I=m?m(E,this,t,e):E;if(I===void 0){console.warn(`UE自动更新的属性,不应该为undefined! 属性名:${d} 对象名:${e.name} 对象id: ${e.id}`);return}v.val[d]=I};C(),this.d(h.don(C))}const y=()=>{i.callUeFunc({f:"update",p:{id:e.id,...v.val}}),v.val={}},w=this.dv(a.createNextAnimateFrameEvent(...l));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))}}}p(_,"propValFuncs",{ref:null,devTags:null,extras:null,execOnceFuncStr:null,updateFuncStr:null,toDestroyFuncStr:null}),p(_,"forceUeUpdateProps",[]);class P extends _{constructor(e,t){super(e,t);const i=t.viewer;i&&(this.d(e.flyToEvent.don(n=>{B(i,e.id,n)})),this.d(e.flyInEvent.don(n=>{var r,o;V(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(()=>{K(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 S 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(a.createNextAnimateFrameEvent(e.positionChanged,e.rotationChanged,e.editingChanged));this.d(r.don(()=>{setTimeout(n,0)})),this.d(e.smoothMoveEvent.don((v,l)=>{ce(i,e.id,v,l)})),this.d(e.smoothMoveWithRotationEvent.don((v,l,y)=>{ae(i,e.id,v,l,y)})),this.d(e.smoothMoveOnGroundEvent.don((v,l,y,w)=>{le(i,e.id,v,l,w,y)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((v,l,y,w,d)=>{de(i,e.id,v,l,y,w,d)})),this.d(e.smoothMoveKeepPitchEvent.don(async(v,l)=>{const y=await i.callUeFunc({f:"SmoothMoveKeepPitch",p:{id:e.id,Destination:v,Time:l}});y.error&&console.error("SmoothMoveKeepPitch:",y.error)})),this.d(e.automaticLandingEvent.don(v=>{const l=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(y=>{y!==null&&(e.position=[...l,y],e.collision=v)})}));const o=async(v,l,y,w)=>{const{viewer:d}=v;if(!d){console.error("SmoothMoveRelatively: ueViewer.viewer is undefined");return}const g=await d.callUeFunc({f:"SmoothMoveRelatively",p:{id:l,RelativePosition:y,Time:w}});return g.error&&console.error("SmoothMoveRelatively:",g.error),g};this.d(e.smoothMoveRelativelyEvent.don((v,l)=>{o(t,e.id,v,l)}));const s=async(v,l,y,w,d)=>{const{viewer:g}=v;if(!g){console.error("SmoothMoveRelativelyWithRotation: ueViewer.viewer is undefined");return}const h=await g.callUeFunc({f:"SmoothMoveRelativelyWithRotation",p:{id:l,RelativePosition:y,NewRotation:w,Time:d}});return h.error&&console.error("SmoothMoveRelativelyWithRotation:",h.error),h};this.d(e.smoothMoveRelativelyWithRotationEvent.don((v,l,y)=>{s(t,e.id,v,l,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(a.createNextAnimateFrameEvent(e.pointsChanged,e.editingChanged));this.d(r.don(()=>{setTimeout(n,0)}))}}p(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 M extends S{constructor(e,t){super(e,t),t.viewer&&this.d(t.widgetEvent.don(n=>{if(n.objId!==e.id)return;const{type:r,add:o}=n;e.widgetEvent.emit({type:r,add:o})}))}}class Ee extends S{constructor(e,t){super(e,t),t.viewer}}p(Ee,"propValFuncs",{...S.propValFuncs,pointStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})}),strokeStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})}),fillStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})})});class he extends Ee{constructor(e,t){super(e,t),t.viewer}}const zn=c=>{switch(c){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"没搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是3dTileset,无法绑定";default:return"未知错误"}},Y=class Y extends u.EngineObject{constructor(t,i){super(t,i);p(this,"_styleColor",this.dv(a.react([])));p(this,"_styleVisable",this.dv(a.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??u.ESVisualObject.defaults.flyToParam,flyInParam:t.flyInParam??u.ESVisualObject.defaults.flyInParam,highlightID:t.highlightID,highlightColor:t.highlightColor,highlight:t.highlight,materialMode:t.materialMode,maximumScreenSpaceError:t.maximumScreenSpaceError,colorMode:Reflect.has(t,"colorMode")?t.colorMode:void 0,offset:t.offset,rotation:t.rotation,cacheBytes:t.cacheBytes,colorBlendMode:t.colorBlendMode,materialOverrideMap:t.materialOverrideMap}})},v=this.dv(a.createNextAnimateFrameEvent(t.urlChanged,t.showChanged,t.flyToParamChanged,t.flyInParamChanged,t.collisionChanged,t.allowPickingChanged,t.highlightIDChanged,t.highlightColorChanged,t.highlightChanged,t.materialModeChanged,t.maximumScreenSpaceErrorChanged,t.offsetChanged,t.rotationChanged,t.cacheBytesChanged,t.colorBlendModeChanged,t.materialOverrideMapChanged));s(),this.d(v.don(s)),Reflect.has(t,"colorMode")&&this.d(t.colorModeChanged.don(()=>s()));const l=this.dv(a.react(void 0));{const w=this.dv(a.createNextAnimateFrameEvent(t.actorTagChanged,t.urlChanged)),d=()=>{t.actorTag?l.value={type:"ActorTag",actorTag:t.actorTag}:t.url?l.value={type:"CreatedUrl",url:t.url}:l.value=void 0,t.editing=!1};d(),this.d(w.don(d))}const y=async()=>{const{id:w}=t;if(r!==void 0){r=void 0;try{const d=await i.unBind3DTilesetById(w);if(!d)return;if(d.error!==""){console.warn(`UeES3DTileset UnBind3DTilesetById: ${d.error}`);return}}catch(d){console.warn(`UeES3DTileset UnBind3DTilesetById: ${d}`);return}}if(o!==void 0){o=void 0;try{const d=await n.callUeFunc({f:"destroy",p:{id:w}});if(!d)return;if(d.error!==""){console.warn(`UeES3DTileset Destroy: ${d.error}`);return}}catch(d){console.warn(`UeES3DTileset Destroy: ${d}`);return}}};this.d(()=>{y()});{const w=this.dv(a.createProcessingFromAsyncFunc(async g=>{if(l.value===void 0){await g.promise(y());return}if(l.value.type==="ActorTag"){const{actorTag:h}=l.value;if(r!==h&&await g.promise(y()),r!==void 0||h===void 0)return;try{r=h;const m=await g.promise(i.bind3DTilesetByTag(t.id,h));if(!m)return;if(m.error!==""){console.warn(`UeES3DTileset Bind3DTilesetByTag: ${m.error}`);return}if(m.re.type!==0)if(m.re.type===1)console.warn(`UeES3DTileset Bind3DTilesetByTag: ${zn(m.re.type)}`);else{console.warn(`UeES3DTileset Bind3DTilesetByTag: ${zn(m.re.type)}`);return}}catch(m){console.warn(`UeES3DTileset Bind3DTilesetByTag: ${m}`);return}}else if(l.value.type==="CreatedUrl"){const{url:h}=l.value;if(h!==o&&await y(),o!==void 0||h===void 0)return;try{o=h;const m=await g.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 g.promise(s())})),d=async()=>{w.restart()};d(),this.d(l.changed.don(d))}this.d(t.refreshTilesetEvent.don(()=>{zi(n,t.id)})),this.d(t.flyToEvent.don(async(w,d)=>{if(!r&&!o)return;const g=await B(n,t.id,w);let h="over";g===void 0?h="error":g.endType===0?h="over":g.endType===1&&(h="cancelled"),t.flyOverEvent.emit(d,h,i)})),this.d(t.calcFlyToParamEvent.don(()=>{!r&&!o||K(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:d,rotation:g}=w;t.flyInParam={position:d,rotation:g,flyDuration:1}})),this.d(i.propChanged.don(w=>{!r&&!o||w.objId===t.id&&Object.keys(w.props).forEach(d=>{const g=w.props[d]===null?void 0:w.props[d];t[d]=g})})),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}},d=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}},g=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}},h=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],d(m,E)})),this.d(t.resetFeatureStyleEvent.don(()=>{g(),this.styleColor=[],this.styleVisable=[]})),this.d(t.setFeatureStyleEvent.don(m=>{h(m)}))}{const w=async()=>{if(!r&&!o){t._featureTableResultEvent.emit(void 0);return}try{const d=await n.callUeFunc({f:"GetFeatureTable",p:{id:t.id}});d.error!==""&&console.warn(`UeES3DTileset GetFeatureTable: ${d.error}`),t._featureTableResultEvent.emit(d.re.table)}catch(d){console.warn(`UeES3DTileset GetFeatureTable: ${d}`),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 d=await n.callUeFunc({f:"GetMaterialNameList",p:{id:t.id}});d.error!==""&&console.warn(`UeES3DTileset GetMaterialNameList: ${d.error}`),t.getMaterialNameListEvent.emit(d.re.materialNameList)}catch(d){console.warn(`UeES3DTileset GetMaterialNameList: ${d}`),t.getMaterialNameListEvent.emit(void 0)}};this.ad(t.getMaterialNameListEvent.don(d=>{d=="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}};p(Y,"type",Y.register("ESUeViewer",u.ES3DTileset.type,Y));let ve=Y;const kn=c=>{switch(c){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"没搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag对应的Actor是地形,无法绑定";case 4:return"没搜索到ComponentTag,无法绑定";default:return"未知错误"}},b=class b extends u.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}let n,r;const o=this.dv(a.react(void 0)),s=this.ad(a.reactJson(""));{const w=()=>{if(typeof e.url=="string")s.value=u.ESSceneObject.context.getStrFromEnv(e.url);else{const d=e.url;d.url=u.ESSceneObject.context.getStrFromEnv(d.url),s.value=d}};w(),this.ad(e.urlChanged.don(w))}const v=async()=>{!n&&!r||await i.callUeFunc({f:"update",p:{id:e.id,show:e.show??!0,rectangle:e.rectangle??[-180,-90,180,90],collision:e.collision??!0,allowPicking:e.allowPicking??!1,flyToParam:e.flyToParam??u.ESVisualObject.defaults.flyToParam,flyInParam:e.flyInParam??u.ESVisualObject.defaults.flyInParam,url:s.value??"",zIndex:e.zIndex??0,maximumLevel:e.maximumLevel??u.ESImageryLayer.defaults.maximumLevel,minimumLevel:e.minimumLevel??u.ESImageryLayer.defaults.minimumLevel,options:e.options??u.ESImageryLayer.defaults.options,targetID:e.targetID??u.ESImageryLayer.defaults.targetID,opacity:e.opacity??u.ESImageryLayer.defaults.opacity}})},l=this.dv(a.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));this.d(l.don(v));const y=async()=>{const{id:w}=e;if(n!==void 0){n=void 0;try{const d=await t.unBindImageryById(w);if(!d)return;if(d.error!==""){console.warn(`UeESImageryLayer UnImageryByID: ${d.error}`);return}}catch(d){console.warn(`UeESImageryLayer UnImageryByID promise: ${d}`);return}}if(r!==void 0){r=void 0;try{const d=await i.callUeFunc({f:"destroy",p:{id:w,test:"UeESImageryLayer"}});if(!d)return;if(d.error!==""){console.warn(`UeESImageryLayer Destroy: ${d.error}`);return}}catch(d){console.warn(`UeESImageryLayer Destroy promise: ${d}`);return}}};this.d(()=>{y()});{const w=this.dv(a.createProcessingFromAsyncFunc(async g=>{if(o.value===void 0){await g.promise(y());return}if(o.value.type==="ActorTag"){const{actorTag:h,componentTag:m}=o.value;if(n!==h&&await g.promise(y()),n!==void 0||h===void 0)return;try{n=h;const C=await g.promise(t.bindImageryByTag(e.id,h,m));if(!C)return;if(C.error!==""){console.warn(`ESImageryLayer BindImageryByTag: ${C.error}`);return}if(C.re.type!==0)if(C.re.type===1)console.warn(`ESImageryLayer BindImageryByTag: ${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:h}=o.value;if(h!==r&&await g.promise(y()),r!==void 0||h===void 0)return;try{r=h;const m=await g.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 g.promise(v())})),d=async()=>{w.restart()};d(),this.d(o.changed.don(d))}{const w=this.dv(a.createNextAnimateFrameEvent(e.actorTagChanged,s.changed,e.componentTagChanged)),d=()=>{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};d(),this.d(w.don(d))}this.d(e.flyToEvent.don(async(w,d)=>{if(!n&&!r)return;const g=await B(i,e.id,w);let h="over";g===void 0?h="error":g.endType===0?h="over":g.endType===1&&(h="cancelled"),e.flyOverEvent.emit(d,h,t)})),this.d(e.flyInEvent.don(async(w,d)=>{var m,C;if(!n&&!r)return;const g=await V(i,e.id,(m=e.flyInParam)==null?void 0:m.position,(C=e.flyInParam)==null?void 0:C.rotation,w??1);let h="over";g===void 0?h="error":g.endType===0?h="over":g.endType===1&&(h="cancelled"),e.flyOverEvent.emit(d,h,t)})),this.d(e.calcFlyToParamEvent.don(()=>{!n&&!r||K(i,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const w=await t.getCurrentCameraInfo();if(!w)return;const{position:d,rotation:g}=w;e.flyInParam={position:d,rotation:g,flyDuration:1}})),this.d(t.propChanged.don(w=>{!n&&!r||w.objId===e.id&&Object.keys(w.props).forEach(d=>{const g=w.props[d]===null?void 0:w.props[d];e[d]=g})}))}};p(b,"type",b.register("ESUeViewer",u.ESImageryLayer.type,b));let Fe=b;const z=class z extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(z,"type",z.register("ESUeViewer",u.ESTerrainLayer.type,z)),p(z,"forceUeUpdateProps",[...P.forceUeUpdateProps,"url"]),p(z,"propValFuncs",{...P.propValFuncs,url:e=>typeof e=="string"?u.ESSceneObject.context.getStrFromEnv(e):(e.url=u.ESSceneObject.context.getStrFromEnv(e.url),e),czmMaxzoom:null,czmMinzoom:null});let Se=z;const x=class x extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(x,"type",x.register("ESUeViewer",u.ESAlarm.type,x));let Ie=x;const O=class O extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(O,"type",O.register("ESUeViewer",u.ESApertureEffect.type,O));let Te=O;const j=class j extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(j,"type",j.register("ESUeViewer",u.ESGeoPolygon.type,j));let U=j;const tt=class tt extends U{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let o=u.ESAreaMeasurement.defaults.fillStyle;try{o={...e.fillStyle??u.ESAreaMeasurement.defaults.fillStyle}}catch(s){console.error("ESAreaMeasurement fillStyle 属性类型错误!",s),o={...u.ESAreaMeasurement.defaults.fillStyle}}o.materialParams=JSON.stringify(o.materialParams),i.callUeFunc({f:"update",p:{id:e.id,stroked:e.stroked??u.ESAreaMeasurement.defaults.stroked,fillStyle:o,filled:e.filled??u.ESAreaMeasurement.defaults.filled}}),console.log(o)},r=this.dv(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.strokedChanged,e.filledChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};p(tt,"type",tt.register("ESUeViewer",u.ESAreaMeasurement.type,tt));let Re=tt;const et=class et extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(et,"type",et.register("ESUeViewer",u.ESBlastParticleSystem.type,et));let De=et;const it=class it extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};p(it,"type",it.register("ESUeViewer",u.ESBoxClipping.type,it));let Le=it;const nt=class nt extends S{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.dispose(e.flyInEvent.don((n,r,o="default")=>{const{id:s,duration:v,position:l,rotation:y}=e;V(i,s,l,y,v??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)})}))}};p(nt,"type",nt.register("ESUeViewer",u.ESCameraView.type,nt));let Pe=nt;const rt=class rt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(rt,"type",rt.register("ESUeViewer",u.ESCameraVisibleRange.type,rt));let Ue=rt;const ot=class ot extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(ot,"type",ot.register("ESUeViewer",u.ESCar.type,ot));let Me=ot;const st=class st extends D{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let o=u.ESClassification.defaults.fillStyle;try{o={...e.fillStyle??u.ESClassification.defaults.fillStyle}}catch(s){console.error("ESClassification fillStyle 属性类型错误!",s),o={...u.ESClassification.defaults.fillStyle}}o.materialParams=JSON.stringify(o.materialParams),i.callUeFunc({f:"update",p:{id:e.id,filled:e.filled??u.ESClassification.defaults.filled,fillStyle:o}})},r=this.dv(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};p(st,"type",st.register("ESUeViewer",u.ESClassification.type,st));let Ae=st;const at=class at extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};p(at,"type",at.register("ESUeViewer",u.ESClippingPlane.type,at));let We=at;const lt=class lt extends S{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=this.ad(a.reactJson(""));{const s=()=>{if(typeof e.url=="string")n.value=u.ESSceneObject.context.getStrFromEnv(e.url??u.ESDataMesh.defaults.url);else{const v=e.url;v.url=u.ESSceneObject.context.getStrFromEnv(v.url??u.ESDataMesh.defaults.url),n.value=v}};s(),this.ad(e.urlChanged.don(s))}const r=()=>{const s=e.colorStops??u.ESDataMesh.defaults.colorStops;i.callUeFunc({f:"update",p:{id:e.id,url:n.value??u.ESDataMesh.defaults.url,currentTime:e.currentTime??u.ESDataMesh.defaults.currentTime,minPropValue:e.minPropValue??u.ESDataMesh.defaults.minPropValue,maxPropValue:e.maxPropValue??u.ESDataMesh.defaults.maxPropValue,colorStops:JSON.stringify(s)}})},o=this.dv(a.createNextAnimateFrameEvent(n.changed,e.currentTimeChanged,e.minPropValueChanged,e.maxPropValueChanged,e.colorStopsChanged));this.d(o.don(r)),this.d(e.createdEvent.don(r))}};p(lt,"type",lt.register("ESUeViewer",u.ESDataMesh.type,lt));let $e=lt;const dt=class dt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(dt,"type",dt.register("ESUeViewer",u.ESDatasmithRuntimeModel.type,dt));let _e=dt;const ct=class ct extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(ct,"type",ct.register("ESUeViewer",u.ESDirectionMeasurement.type,ct));let Ne=ct;const ut=class ut 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??u.ESDistanceMeasurement.defaults.strokeStyle}}catch(s){console.error("ESDistanceMeasurement strokeStyle 属性类型错误!",s),o={...u.ESDistanceMeasurement.defaults.strokeStyle}}i.callUeFunc({f:"update",p:{id:e.id,strokeStyle:o}})},r=this.dv(a.createNextAnimateFrameEvent(e.strokeStyleChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};p(ut,"type",ut.register("ESUeViewer",u.ESDistanceMeasurement.type,ut));let ze=ut;const ht=class ht extends he{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(ht,"type",ht.register("ESUeViewer",u.ESLocalPolygon.type,ht));let ge=ht;const vt=class vt extends ge{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(vt,"type",vt.register("ESUeViewer",u.ESDynamicWater.type,vt));let ke=vt;const gt=class gt 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})}))}};p(gt,"type",gt.register("ESUeViewer",u.ESEntityCluster.type,gt));let He=gt;const ft=class ft extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(ft,"type",ft.register("ESUeViewer",u.ESExcavate.type,ft));let Ge=ft;const pt=class pt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(pt,"type",pt.register("ESUeViewer",u.ESFireParticleSystem.type,pt));let Je=pt;const wt=class wt extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=this.ad(a.reactJson(""));{const s=()=>{if(typeof e.url=="string")n.value=u.ESSceneObject.context.getStrFromEnv(e.url);else{const v=e.url;v.url=u.ESSceneObject.context.getStrFromEnv(v.url),n.value=v}};s(),this.ad(e.urlChanged.don(s))}const r=()=>{i.callUeFunc({f:"update",p:{id:e.id,url:n.value??u.ESForestTileset.defaults.url,treeTypes:e.treeTypes??u.ESForestTileset.defaults.treeTypes,xiaoBanWidget:e.xiaoBanWidget??u.ESForestTileset.defaults.xiaoBanWidgetDefault,youShiSZ:e.youShiSZ??u.ESForestTileset.defaults.youShiSZ,diLei:e.diLei??u.ESForestTileset.defaults.diLei,senLinLB:e.senLinLB??u.ESForestTileset.defaults.senLinLB,labelMaterial:e.labelMaterial??u.ESForestTileset.defaults.labelMaterial,heightOffset:e.heightOffset??u.ESForestTileset.defaults.heightOffset}})},o=this.dv(a.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))}};p(wt,"type",wt.register("ESUeViewer",u.ESForestTileset.type,wt));let Be=wt;const yt=class yt extends u.EngineObject{constructor(t,i){super(t,i);p(this,"_imageLabel",this.dv(new u.ESImageLabel(`${this.sceneObject.id}_ESImageLabel`)));p(this,"_hasClassDivAndPos",{});const n=i.viewer;if(!n){console.warn("viewer is undefined!");return}t.mainClass=this._imageLabel;const r=this._imageLabel;i.add(r),this.d(()=>i.delete(r));{const o=()=>{if(!n)return;if(!t.instanceClass)throw new Error("!sceneObject.instanceClass");const l=document.createElement("div"),y=this.dv(new t.instanceClass(l,t,i))._container;if(y.style.opacity=t.opacity.toString()??u.ESGeoDiv.defaults.opacity,y.style.position="fixed",y.style.zIndex="-1",y.style.top="0px",!document.body.contains(y)){document.body.appendChild(y);let d=y?y.querySelectorAll("*[class]"):[];for(let g=0;g<d.length;g++){const h=d[g];var w=h.getBoundingClientRect();this._hasClassDivAndPos[h.className]=[h.offsetLeft,h.offsetTop,h.offsetLeft+w.width,h.offsetTop+w.height]}}Gn(y,{backgroundColor:null,allowTaint:!0,useCORS:!0,width:y.offsetWidth,height:y.offsetHeight,scale:1}).then(d=>{document.body.contains(y)&&document.body.removeChild(y),r.url=d.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(l){console.error(l)}};s();const v=this.dv(a.createNextAnimateFrameEvent(t.instanceClassChanged,t.opacityChanged));this.d(v.don(s))}{const o=()=>{r.show=t.show};r.show=!1,this.ad(t.showChanged.don(o))}this.d(a.track([r,"anchor"],[t,"anchor"])),this.d(a.bind([r,"position"],[t,"position"])),this.d(a.bind([r,"rotation"],[t,"rotation"])),this.d(a.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(a.bind([r,"flyInParam"],[t,"flyInParam"])),this.d(a.bind([r,"allowPicking"],[t,"allowPicking"])),this.d(a.bind([r,"scale"],[t,"scale"])),this.d(a.track([r,"minVisibleDistance"],[t,"minVisibleDistance"])),this.d(a.track([r,"maxVisibleDistance"],[t,"maxVisibleDistance"])),this.ad(t.automaticLandingEvent.don(()=>{r.automaticLanding()})),this.d(r.pickedEvent.don(o=>{(t.allowPicking??!1)&&t.pickedEvent.emit(o)})),this.d(i.widgetEvent.don(o=>{if(o.objId!==this._imageLabel.id)return;const{type:s,add:v}=o;if(s==="leftClick"&&v){const l=(v==null?void 0:v.classNames)??[],y=Object.keys(this._hasClassDivAndPos);for(let w=0;w<y.length;w++){const d=y[w];let g=this._hasClassDivAndPos[d];v&&v.mouseRelativePos&&v.mouseRelativePos[0]>=g[0]&&v.mouseRelativePos[0]<=g[2]&&v.mouseRelativePos[1]>=g[1]&&v.mouseRelativePos[1]<=g[3]&&l.push(d)}v.classNames=l}t.widgetEvent.emit({type:s,add:v})})),this.d(t.calcFlyToParamEvent.don(()=>{K(n,r.id)})),this.d(t.calcFlyInParamEvent.don(()=>{const o=i.getCurrentCameraInfo();if(!o)return;const{position:s,rotation:v}=o;t.flyInParam={position:s,rotation:v,flyDuration:1}})),this.d(t.smoothMoveEvent.don((o,s)=>{ce(n,r.id,o,s)})),this.d(t.smoothMoveWithRotationEvent.don((o,s,v)=>{ae(n,r.id,o,s,v)})),this.d(t.smoothMoveOnGroundEvent.don((o,s,v,l)=>{le(n,r.id,o,s,l,v)})),this.d(t.smoothMoveWithRotationOnGroundEvent.don((o,s,v,l,y)=>{de(n,r.id,o,s,v,l,y)})),this.d(t.flyToEvent.don((o,s)=>{r.flyTo(o)})),this.d(t.flyInEvent.don(o=>{r.flyIn(o)}))}};p(yt,"type",yt.register("ESUeViewer",u.ESGeoDiv.type,yt));let Ke=yt;const mt=class mt 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}})}))}};p(mt,"type",mt.register("ESUeViewer",u.ESGeoJson.type,mt));let qe=mt;const Ct=class Ct extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(Ct,"type",Ct.register("ESUeViewer",u.ESGeoLineString.type,Ct));let fe=Ct;const Et=class Et extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(Et,"type",Et.register("ESUeViewer",u.ESGeoRectangle.type,Et));let Xe=Et;const Ft=class Ft extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(Ft,"type",Ft.register("ESUeViewer",u.ESGeoWater.type,Ft));let Ze=Ft;const k=class k extends S{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.setNodePositionEvent.don((n,r)=>{Vi(i,e.id,n,r)})),this.d(e.setNodeRotationEvent.don((n,r)=>{Qi(i,e.id,n,r)})),this.d(e.setNodeScaleEvent.don((n,r)=>{Yi(i,e.id,n,r)}))}};p(k,"forceUeUpdateProps",[...S.forceUeUpdateProps,"url"]),p(k,"propValFuncs",{...S.propValFuncs,url:e=>typeof e=="string"?u.ESSceneObject.context.getStrFromEnv(u.rpToap(e)):(e.url=u.ESSceneObject.context.getStrFromEnv(u.rpToap(e.url)),e),czmMaximumScale:null,czmMinimumPixelSize:null,czmNativeScale:null,czmColor:null}),p(k,"type",k.register("ESUeViewer",u.ESGltfModel.type,k));let Ve=k;const St=class St extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(St,"type",St.register("ESUeViewer",u.ESHeightMeasurement.type,St));let Qe=St;const It=class It extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=async(o,s,v,l)=>{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:v,Time:l}});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:v}=o;if(!v){console.error("StopAIMove: ueViewer.viewer is undefined");return}const l=await v.callUeFunc({f:"StopAIMove",p:{id:s}});return l.error&&console.error("StopAIMove:",l.error),l};this.d(e.stopAIMoveEvent.don(()=>{r(t,e.id)}))}};p(It,"type",It.register("ESUeViewer",u.ESHuman.type,It));let Ye=It;const H=class H extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}e.anchor=[.5,1]}};p(H,"type",H.register("ESUeViewer",u.ESImageLabel.type,H)),p(H,"forceUeUpdateProps",[...M.forceUeUpdateProps,"url"]),p(H,"propValFuncs",{...M.propValFuncs,url:e=>typeof e=="string"?u.ESSceneObject.context.getStrFromEnv(u.rpToap(e)):(e.url=u.ESSceneObject.context.getStrFromEnv(u.rpToap(e.url)),e)});let be=H;const Tt=class Tt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(Tt,"type",Tt.register("ESUeViewer",u.ESLevelRuntimeModel.type,Tt));let xe=Tt;const Rt=class Rt extends he{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(Rt,"type",Rt.register("ESUeViewer",u.ESLocalCircle.type,Rt));let Oe=Rt;const Dt=class Dt extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(Dt,"type",Dt.register("ESUeViewer",u.ESLocalPolygonZ.type,Dt));let je=Dt;const Lt=class Lt extends he{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(Lt,"type",Lt.register("ESUeViewer",u.ESLocalRectangle.type,Lt));let ti=Lt;const Pt=class Pt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(Pt,"type",Pt.register("ESUeViewer",u.ESLocalSkyBox.type,Pt));let ei=Pt;const Ut=class Ut extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(Ut,"type",Ut.register("ESUeViewer",u.ESLocationMeasurement.type,Ut));let ii=Ut;const Mt=class Mt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(Mt,"type",Mt.register("ESUeViewer",u.ESPipeFence.type,Mt));let ni=Mt;const At=class At extends fe{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(At,"type",At.register("ESUeViewer",u.ESPipeline.type,At));let ri=At;const Wt=class Wt 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 v=typeof n=="number"?n.toString():n;qi(i,e.id,v,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,Zi(i,e.id,o)}))}};p(Wt,"type",Wt.register("ESUeViewer",u.ESPipeserTileset.type,Wt));let oi=Wt;const $t=class $t extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p($t,"type",$t.register("ESUeViewer",u.ESPit.type,$t));let si=$t;const _t=class _t extends M{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}}))}};p(_t,"type",_t.register("ESUeViewer",u.ESPoi2D.type,_t));let ai=_t;const Nt=class Nt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(Nt,"type",Nt.register("ESUeViewer",u.ESPoi3D.type,Nt));let li=Nt;const G=class G extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(G,"type",G.register("ESUeViewer",u.ESPoiTileset.type,G)),p(G,"forceUeUpdateProps",[...P.forceUeUpdateProps,"url"]),p(G,"propValFuncs",{...P.propValFuncs,url:e=>typeof e=="string"?u.ESSceneObject.context.getStrFromEnv(e):(e.url=u.ESSceneObject.context.getStrFromEnv(e.url),e)});let di=G;const zt=class zt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(zt,"type",zt.register("ESUeViewer",u.ESPolygonFence.type,zt));let ci=zt;const kt=class kt extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(kt,"type",kt.register("ESUeViewer",u.ESPolygonFlattenedPlane.type,kt));let ui=kt;const Ht=class Ht extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(Ht,"type",Ht.register("ESUeViewer",u.ESPolygonWithHole.type,Ht));let hi=Ht;const Gt=class Gt extends _{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(()=>{e.ids=[]}),this.d(e.highlightInner3DtilesetEvent.don(n=>{n.highlight=!0})),this.d(e.removeHighlightInner3DtilesetEvent.don(n=>{n.highlight=!1}));{const n=s=>{s=s.toLocaleLowerCase();let v=[255,255,255,1];if(s.startsWith("#")){if(s.length===4){let l=parseInt(s[1]+s[1],16),y=parseInt(s[2]+s[2],16),w=parseInt(s[3]+s[3],16);v=[l,y,w,1]}else if(s.length===7){let l=parseInt(s.substring(1,3),16),y=parseInt(s.substring(3,5),16),w=parseInt(s.substring(5,7),16);v=[l,y,w,1]}}else if(s.startsWith("rgba")){let l=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/);if(l){let y=parseInt(l[1]),w=parseInt(l[2]),d=parseInt(l[3]),g=parseFloat(l[4]);v=[y,w,d,g]}}else if(s.startsWith("rgb")){let l=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);if(l){let y=parseInt(l[1]),w=parseInt(l[2]),d=parseInt(l[3]);v=[y,w,d,1]}}else console.error("color类型只能为#rrggbb、#rgb、rgba(r,g,b,a)、rgb(r,g,b)");return[v[0]/255,v[1]/255,v[2]/255,v[3]]},r=()=>{const s=e.layerConfig;if(!s)return;const v=[];s.forEach(l=>{v.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})}),e.setFeatureStyle(v)};r();const o=this.dv(a.createNextAnimateFrameEvent(e.layerConfigChanged));this.d(o.don(()=>{r()}))}}};p(Gt,"type",Gt.register("ESUeViewer",u.ESRtsTileset.type,Gt));let vi=Gt;const Jt=class Jt extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(e.addTreesEvent.don(n=>{u.addTreesCallFunc(t,e.id,n)})),this.d(e.removeAllTreesEvent.don(()=>{u.removeAllTreesCallFunc(t,e.id)})),this.d(e.updateTreeParamsEvent.don(n=>{u.updateTreeParamsCallFunc(t,e.id,n)})),this.d(e.cutDownTreesEvent.don((n,r)=>{u.cutDownTreesCallFunc(t,e.id,n,r)})),this.d(e.growthSimulationEvent.don((n,r,o)=>{u.growthSimulationCallFunc(t,e.id,n,r,o)}))}};p(Jt,"type",Jt.register("ESUeViewer",u.ESSeparateFoliage.type,Jt));let gi=Jt;const Bt=class Bt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(Bt,"type",Bt.register("ESUeViewer",u.ESSubmergingAnalysis.type,Bt));let fi=Bt;const Kt=class Kt extends U{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}})}))}};p(Kt,"type",Kt.register("ESUeViewer",u.ESSunshineAnalysis.type,Kt));let pi=Kt;const qt=class qt extends U{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}})}))}};p(qt,"type",qt.register("ESUeViewer",u.ESSurfaceAreaMeasurement.type,qt));let wi=qt;const Xt=class Xt extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(Xt,"type",Xt.register("ESUeViewer",u.ESTextLabel.type,Xt));let yi=Xt;const q=class q extends M{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)}))}};p(q,"type",q.register("ESUeViewer",u.ESUEWidget.type,q)),p(q,"propValFuncs",{...M.propValFuncs,info:e=>JSON.stringify(e??{})});let mi=q;const Hn=c=>{switch(c){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"未搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是场景原有的,而是新建的,无法绑定";case 4:return"搜索到ActorTag对应的Actor是地形或3DTileset,无法绑定";default:return"未知错误"}},ur=c=>{switch(c){case 0:return"创建成功";case 1:return"未找到对应的资源,无法创建";case 2:return"Id与场景中现有的ActorTag重复,创建后可能出现问题,创建失败";default:return"未知错误"}},Zt=class Zt extends u.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn(`${e.id} UeESUnrealActor viewer is undefined!`);return}this.d(()=>{ye(i,e.id)});const n=async()=>{l()||await i.callUeFunc({f:"update",p:{id:e.id,name:e.name,show:e.show,rotation:e.rotation,flyToParam:e.flyToParam??u.ESVisualObject.defaults.flyToParam,flyInParam:e.flyInParam??u.ESVisualObject.defaults.flyInParam,highlight:e.highlight,collision:e.collision,scale:e.scale,minVisibleDistance:e.minVisibleDistance,maxVisibleDistance:e.maxVisibleDistance}})},r=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.nameChanged,e.rotationChanged,e.flyToParamChanged,e.flyInParamChanged,e.highlightChanged,e.collisionChanged,e.scaleChanged,e.minVisibleDistanceChanged,e.maxVisibleDistanceChanged));this.d(r.don(n)),this.d(e.flushEvent.don(()=>r.flush()));let o,s;const v=async()=>{l()||(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}`))},l=()=>!o&&!s?(console.warn(`${e.id} 未绑定ActorTag或未创建ActorClass!`),!0):!1,y=async()=>{const{id:d}=e,g=await t.unBindActorByID(d);g&&g.error!==""&&console.warn(`${e.id} UeESUnrealActor UnBindActorByID: ${g.error}`),o=void 0;const h=await i.callUeFunc({f:"destroy",p:{id:d}});if(h&&h.error!==""){console.warn(`${e.id} UeESUnrealActor DestroyActorByID: ${h.error}`);return}s=void 0},w=this.dv(a.react({type:"ActorClass",actorClass:"default"}));{const d=this.dv(a.createNextAnimateFrameEvent(e.actorClassChanged,e.actorTagChanged)),g=async()=>{e.actorTag!==""?w.value={type:"ActorTag",actorTag:e.actorTag}:w.value={type:"ActorClass",actorClass:e.actorClass===""?"default":e.actorClass}};g(),this.d(d.don(g)),this.d(e.flushEvent.don(()=>d.flush()))}{const d=this.dv(a.createProcessingFromAsyncFunc(async h=>{if(await h.promise(y()),w.value.type==="ActorTag"){const{actorTag:m}=w.value;await h.promise(y());try{e.lastActorStatus="null";const C=await h.promise(t.bindActorByTag(e.id,m));if(!C)return;if(C.error!==""){console.warn(`${e.id} UeESUnrealActor BindActorByTag:${m},${C.error}`);return}if(C.re.type===0)e.lastActorStatus="bound",o=m;else if(C.re.type===1)e.lastActorStatus="bound",o=m,console.warn(`${e.id} UeESUnrealActor BindActorByTag:${m},${Hn(C.re.type)}`);else{o=void 0,console.warn(`${e.id} UeESUnrealActor BindActorByTag error:${m}, ${Hn(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 h.promise(t.createActorByClass(e.id,m));if(!C)return;if(C.error!==""){console.warn(`${e.id} UeESUnrealActor CreateActorByClass error :${m}, ${C.error}`);return}if(C.re.type===0)e.lastActorStatus="created",s=m;else{console.warn(`${e.id} UeESUnrealActor CreateActorByClass error type :${m},${ur(C.re.type)}`);return}}catch(C){console.warn(`${e.id} UeESUnrealActor CreateActorByClass error catch :${m}, ${JSON.stringify(C)}`);return}}await h.promise(n()),await h.promise(v())})),g=async()=>{d.restart()};g(),this.d(w.changed.don(g))}this.d(e.positionChanged.don(v)),this.d(e.callFunctionEvent.don(async(d,g)=>{if(l()){e.__callFunctionResultEvent.emit(void 0);return}const h=await Ce(i,e.id,d,g);e.__callFunctionResultEvent.emit(h)})),this.d(e.smoothMoveEvent.don((d,g)=>{l()||ce(i,e.id,d,g)})),this.d(e.smoothMoveWithRotationEvent.don((d,g,h)=>{l()||ae(i,e.id,d,g,h)})),this.d(e.smoothMoveOnGroundEvent.don((d,g,h,m)=>{l()||le(i,e.id,d,g,m,h)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((d,g,h,m,C)=>{l()||de(i,e.id,d,g,h,m,C)})),this.d(e.automaticLandingEvent.don(d=>{if(l())return;const g=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(h=>{h!==null&&(e.position=[...g,h],e.collision=d)})})),this.d(e.flyToEvent.don(async(d,g)=>{if(l())return;const h=await B(i,e.id,d);let m="over";h===void 0?m="error":h.endType===0?m="over":h.endType===1&&(m="cancelled"),e.flyOverEvent.emit(g,m,t)})),this.d(e.calcFlyToParamEvent.don(()=>{l()||K(i,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const d=await t.getCurrentCameraInfo();if(!d)return;const{position:g,rotation:h}=d;e.flyInParam={position:g,rotation:h,flyDuration:1}})),this.d(t.propChanged.don(d=>{l()||d.objId===e.id&&Object.keys(d.props).forEach(g=>{const h=d.props[g]===null?void 0:d.props[g];e[g]=h})}))}};p(Zt,"type",Zt.register("ESUeViewer",u.ESUnrealActor.type,Zt));let Ci=Zt;const Vt=class Vt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(Vt,"type",Vt.register("ESUeViewer",u.ESVideoFusion.type,Vt));let Ei=Vt;const Qt=class Qt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(Qt,"type",Qt.register("ESUeViewer",u.ESViewShed.type,Qt));let Fi=Qt;const Yt=class Yt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};p(Yt,"type",Yt.register("ESUeViewer",u.ESVisibilityAnalysis.type,Yt));let Si=Yt;const bt=class bt extends U{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}})}))}};p(bt,"type",bt.register("ESUeViewer",u.ESVolumeMeasurement.type,bt));let Ii=bt;const X=class X extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(X,"type",X.register("ESUeViewer",u.ESWidget.type,X)),p(X,"propValFuncs",{...M.propValFuncs,info:e=>JSON.stringify(e??{})});let Ti=X;const xt=class xt extends u.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}e.poi.actorTag=e.human.id,e.poi.positionOffset=[0,0,e.poiOffsetHeight-.8],this.d(e.poiOffsetHeightChanged.don(()=>{e.poi.positionOffset=[0,0,e.poiOffsetHeight-.8]})),this.d(()=>{e.poi.actorTag=""})}};p(xt,"type",xt.register("ESUeViewer",u.ESHumanPoi.type,xt));let Ri=xt;u.ESSceneObject.context.getStrFromEnv(u.ESNavigator.defaults.imgUrl);const Ot=class Ot extends u.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new u.ESCustomDiv);t.add(n),this.dispose(()=>t.delete(n)),this.dispose(a.track([n,"show"],[e,"show"])),n.instanceClass=class extends a.Destroyable{constructor(o,s,v){super(),this._subContainer=o;const l=document.createElement("div");this._subContainer.appendChild(l),this.dispose(()=>this._subContainer.removeChild(l));{const d=async()=>{const g=await t.getCurrentCameraInfo(),h=g==null?void 0:g.position,C=[...g==null?void 0:g.rotation];C[0]=360,t.flyIn(h,C)};l.addEventListener("click",d),l.style.cursor="pointer",this.dispose(()=>l.removeEventListener("click",d))}{const d=()=>{l.style.width=`${e.cssSize?e.cssSize:u.ESNavigator.defaults.cssSize}px`,l.style.height=`${e.cssSize?e.cssSize:u.ESNavigator.defaults.cssSize}px`};d(),e.dispose(e.cssSizeChanged.disposableOn(d))}l.style.position="fixed";{const d=()=>{l.style.top=`${e.cssPosition?e.cssPosition[0]:u.ESNavigator.defaults.cssPosition[0]}px`,l.style.right=`${e.cssPosition?e.cssPosition[1]:u.ESNavigator.defaults.cssPosition[1]}px`};d(),e.dispose(e.cssPositionChanged.disposableOn(d))}l.style.transition=" right 0.4s linear",l.style.cursor="pointer";const y=document.createElement("div");l.appendChild(y),this.dispose(()=>l.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 d=()=>w.src=e.imgUrl;d(),e.dispose(e.imgUrlChanged.disposableOn(d))}{const d=()=>{const C=-t.getCurrentCameraInfo().rotation[0];w.style.transform=`rotate(${C}deg)`};let g;const h=async()=>{d(),e.show?(l.style.display="block",g=setInterval(()=>{d()},1e3)):(l.style.display="none",clearInterval(g))};this.dispose(e.showChanged.disposableOn(h)),h(),this.dispose(()=>clearInterval(g))}w.style.transformOrigin="50% 50%"}}}};p(Ot,"type",Ot.register("ESUeViewer",u.ESNavigator.type,Ot));let Di=Ot;const J=class J 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))}}};p(J,"type",J.register("ESUeViewer",u.ESPath.type,J)),p(J,"forceUeUpdateProps",[...D.forceUeUpdateProps]),p(J,"propValFuncs",{...D.propValFuncs,materialMode:null});let Li=J;async function hr(c){navigator.clipboard.writeText(c).then(function(){console.log("复制成功")},function(e){console.log("复制失败")})}const jt=class jt extends u.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new u.ESCustomDiv);t.add(n),this.dispose(()=>t.delete(n)),n.instanceClass=class extends a.Destroyable{constructor(o,s,v){if(super(),this._subContainer=o,!v||!(v instanceof W))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=`${u.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=`${u.ESViewerStatusBar.defaults.height}px`,l.style.zIndex="100",l.style.alignContent="center",l.style.justifyContent="space-between";const y=document.createElement("span");l.appendChild(y),this.dispose(()=>l.removeChild(y));const w=document.createElement("span");y.appendChild(w),this.dispose(()=>y.removeChild(w));const d=document.createElement("span");y.appendChild(d),d.addEventListener("dblclick",function(){let h=d.innerHTML;h.startsWith("鼠标位置")&&(h=h.slice(5)),hr(h)}),d.style.cursor="pointer",this.dispose(()=>y.removeChild(d));const g=document.createElement("span");l.appendChild(g),this.dispose(()=>l.removeChild(g));{const h=()=>{l.style.height=(e.height??u.ESViewerStatusBar.defaults.height)+"px",l.style.lineHeight=(e.height??u.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(h)),h()}{const h=()=>{l.style.fontSize=(e.fontSize??u.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(h)),h()}{const h=()=>{e.bgColor?l.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:l.style.background=`rgba(${u.ESViewerStatusBar.defaults.bgColor[0]},${u.ESViewerStatusBar.defaults.bgColor[1]},${u.ESViewerStatusBar.defaults.bgColor[2]},${u.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(h)),h()}v.getVersion().then(h=>{h&&(g.innerText=`Ue 版本 : ${h[0]} `)}).catch(h=>{console.log(h)});{const h=()=>{let E="",I="";E+=`帧率:${v.getFPS().toFixed(0)}FPS`,w.innerText=E;const F=t.getCurrentCameraInfo();E+=` 经度: ${F.position[0].toFixed(5)}° 纬度: ${F.position[1].toFixed(5)}° 高度: ${F.position[2].toFixed(2)}米 偏航角: ${F.rotation[0].toFixed(2)}° 俯仰角: ${F.rotation[1].toFixed(2)}° 翻滚角:${F.rotation[2].toFixed(2)}° `,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+="暂时无法获取鼠标位置...";d.innerText=I}}).catch(R=>{console.log(R)})};let m;const C=async()=>{h(),e.show?(l.style.display="flex",m=setInterval(()=>{h()},1e3)):(l.style.display="none",clearInterval(m))};this.dispose(e.showChanged.disposableOn(C)),C(),this.dispose(()=>clearInterval(m))}}}}};p(jt,"type",jt.register("ESUeViewer",u.ESViewerStatusBar.type,jt));let Pi=jt;const te=class te extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(te,"type",te.register("ESUeViewer",u.ESGaussianSplatting.type,te));let Ui=te;const ee=class ee extends _{constructor(t,i){super(t,i);p(this,"_es3DTileset",this.dv(new u.ES3DTileset(`${this.sceneObject.id}_ES3DTileset`)));if(!i.viewer){console.warn("viewer is undefined!");return}t.mainClass=this._es3DTileset;{const r=this._es3DTileset;i.add(r),this.dispose(()=>i.delete(r)),this.d(a.track([r,"allowPicking"],[t,"allowPicking"])),this.d(a.track([r,"collision"],[t,"collision"])),this.d(a.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(a.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(a.track([r,"url"],[t,"url"])),this.d(a.track([r,"actorTag"],[t,"actorTag"])),this.d(a.track([r,"materialMode"],[t,"materialMode"])),this.d(a.track([r,"highlight"],[t,"highlight"])),this.d(a.track([r,"maximumScreenSpaceError"],[t,"maximumScreenSpaceError"])),this.d(a.track([r,"highlightID"],[t,"highlightID"])),this.d(a.track([r,"highlightColor"],[t,"highlightColor"])),this.d(a.bind([r,"offset"],[t,"offset"])),this.d(a.bind([r,"rotation"],[t,"rotation"])),this.d(a.track([r,"czmImageBasedLightingFactor"],[t,"czmImageBasedLightingFactor"])),this.d(a.track([r,"czmLuminanceAtZenith"],[t,"czmLuminanceAtZenith"])),this.d(a.track([r,"czmMaximumMemoryUsage"],[t,"czmMaximumMemoryUsage"])),this.d(a.track([r,"czmClassificationType"],[t,"czmClassificationType"])),this.d(a.track([r,"czmStyleJson"],[t,"czmStyleJson"])),this.d(a.track([r,"czmBackFaceCulling"],[t,"czmBackFaceCulling"])),this.d(a.track([r,"czmDebugShowBoundingVolume"],[t,"czmDebugShowBoundingVolume"])),this.d(a.track([r,"czmDebugShowContentBoundingVolume"],[t,"czmDebugShowContentBoundingVolume"])),this.d(a.track([r,"colorBlendMode"],[t,"colorBlendMode"])),this.d(a.track([r,"cacheBytes"],[t,"cacheBytes"])),this.d(a.track([r,"clippingPlaneEnabled"],[t,"clippingPlaneEnabled"])),this.d(a.track([r,"unionClippingRegions"],[t,"unionClippingRegions"])),this.d(a.track([r,"clippingPlaneEdgeColor"],[t,"clippingPlaneEdgeColor"])),this.d(a.track([r,"clippingPlaneEdgeWidth"],[t,"clippingPlaneEdgeWidth"])),this.d(a.track([r,"materialParams"],[t,"materialParams"])),this.d(a.bind([r,"supportEdit"],[t,"supportEdit"])),this.d(a.bind([r,"clippingPlanesId"],[t,"clippingPlanesId"])),this.d(a.bind([r,"clippingPlaneIds"],[t,"clippingPlaneIds"])),this.d(a.bind([r,"flattenedPlaneId"],[t,"flattenedPlaneId"])),this.d(a.bind([r,"flattenedPlaneEnabled"],[t,"flattenedPlaneEnabled"])),this.d(a.bind([r,"clippingPlaneId"],[t,"clippingPlaneId"])),this.d(a.bind([r,"excavateId"],[t,"excavateId"]))}{const r=this._es3DTileset;this.d(t.refreshTilesetEvent.don(()=>{r.refreshTileset()})),this.d(t.highlightFeatureEvent.don((...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}};p(ee,"type",ee.register("ESUeViewer",u.ESRtsFeatureEditing.type,ee));let Mi=ee;const ie=class ie extends _{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(ie,"type",ie.register("ESUeViewer",u.ESMsTileset.type,ie));let Ai=ie;const ne=class ne extends U{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{i.callUeFunc({f:"update",p:{id:e.id,height:e.height??u.ESGeoExtrudedPolygon.defaults.height,extrudedHeight:e.extrudedHeight??u.ESGeoExtrudedPolygon.defaults.extrudedHeight,perPositionHeight:e.perPositionHeight??u.ESGeoExtrudedPolygon.defaults.perPositionHeight}})},r=this.disposeVar(a.createNextAnimateFrameEvent(e.heightChanged,e.extrudedHeightChanged,e.perPositionHeightChanged));this.dispose(r.disposableOn(n)),this.dispose(e.createdEvent.disposableOn(n))}};p(ne,"type",ne.register("ESUeViewer",u.ESGeoExtrudedPolygon.type,ne));let Wi=ne;const re=class re extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};p(re,"type",re.register("ESUeViewer",u.ESStaticMesh.type,re));let $i=re;const oe=class oe 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}})}))}};p(oe,"type",oe.register("ESUeViewer",u.ESSkylineAnalysis.type,oe));let _i=oe;f.copyright=void 0;try{const c="earthsdk3-ue",e="3.0.7-beta.4",t="2025-06-06T08:35:29.000Z",i="北京西部世界科技有限公司",n="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="2667f9bff0536a7431f4eba77c5d1b1c2308f5d4",s=((Date.now()-1749198929e3)/36e5).toFixed(1),v=`%c🌏 ${c}%c ${e}.${r.slice(0,8)}.${t} (距今${s}个小时)
|
|
1
|
+
(function(p,u){typeof exports=="object"&&typeof module<"u"?u(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"],u):(p=typeof globalThis<"u"?globalThis:p||self,u(p.EarthSDK3_UE={},p.EarthSDK3,p["xbsj-base"],p.libPixelstreamingfrontendUe5_2,p.html2canvas))})(this,function(p,u,a,L,Gn){"use strict";var yr=Object.defineProperty;var mr=(p,u,a)=>u in p?yr(p,u,{enumerable:!0,configurable:!0,writable:!0,value:a}):p[u]=a;var f=(p,u,a)=>mr(p,typeof u!="symbol"?u+"":u,a);const Jn={...u.ESViewer.defaults,geoReferenceOrigin:void 0,keepWorldOriginNearCamera:!1,useCache:!0,widgetInteractionDistance:200,memReportInterval:10,sceneControlled:!0,brightness:0,emissiveIntensity:1,statusUpdateInterval:.5,baseUrl:window.location.href??""},Ni=()=>({...u.ESViewer.createCommonProps(),apiKey:"",apiUrl:"",secretKey:"",speechVoiceMode:"",geoReferenceOrigin:a.reactArrayWithUndefined(void 0),keepWorldOriginNearCamera:void 0,useCache:void 0,widgetInteractionDistance:void 0,memReportInterval:void 0,sceneControlled:void 0,brightness:void 0,emissiveIntensity:void 0,statusUpdateInterval:void 0,baseUrl:void 0});function se(){const c=Ni(),e=[];return Object.keys(c).forEach(t=>{e.push(t)}),e}function we(c){const{defaults:e}=W,t=se(),i={};return t.forEach(n=>{i[n]=c[n]??e[n]}),i}const B=async(c,e,t,i,n,r="default")=>{const o=await c.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(c,e)=>{const t=await c.callUeFunc({f:"destroy",p:{id:e}});return t.error&&console.error(t.error),t},K=(c,e)=>{c.callUeFunc({f:"calcFlyToParam",p:{id:e}}).then(t=>{t.error&&console.error("calcFlyToParam:",t.error)}).catch(t=>{console.error("calcFlyToParam:",t)})},zi=(c,e)=>{c.callUeFunc({f:"refreshTileset",p:{id:e}}).then(t=>{t.error&&console.error("refreshTileset:",t.error)}).catch(t=>{console.error("refreshTileset:",t)})},V=async(c,e,t,i,n,r="default")=>{const o=await c.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(c,e)=>{if(!c){console.warn("DefaultCameraFlyIn: viewer is undefined");return}const t=await c.callUeFunc({f:"DefaultCameraFlyIn",p:{Duration:e??1}});if(t.error){console.error("DefaultCameraFlyIn:",t.error);return}return t},Hi=async c=>{if(!c){console.warn("StartVoice:viewer is undefined");return}const e=await c.callUeFunc({f:"StartVoice",p:{}});if(e.error){console.error("StartVoice:",e.error);return}return e},Gi=async c=>{if(!c){console.warn("StopVoice:viewer is undefined");return}const e=await c.callUeFunc({f:"StopVoice",p:{}});if(e.error){console.error("StopVoice:",e.error);return}return e},Ji=async(c,e)=>{if(!c){console.warn("mountPakFiles:viewer is undefined");return}const t=await c.callUeFunc({f:"MountPakFiles",p:{json:e}});if(t.error){console.error("mountPakFiles:",t.error);return}return t},Bi=async c=>{if(!c){console.warn("generateMemReport:viewer is undefined");return}const e=await c.callUeFunc({f:"GenerateMemReport",p:{}});if(e.error){console.error("generateMemReport:",e.error);return}return e},me=async(c,e)=>{const t=await c.callUeFunc({f:"resetWithCurrentCamera",p:{id:e}});return t.error&&console.error("resetWithCurrentCamera:",t.error),t},ae=(c,e,t,i,n)=>{c.callUeFunc({f:"smoothMoveWithRotation",p:{id:e,Destination:t,NewRotation:i,Time:n}}).then(r=>{r.error&&console.error("smoothMoveWithRotation:",r.error)}).catch(r=>{console.error("smoothMoveWithRotation:",r)})},le=(c,e,t,i,n,r)=>{c.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)})},de=(c,e,t,i,n,r,o)=>{c.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=(c,e,t)=>{c.callUeFunc({f:"HighlightFeature",p:{id:e,HlId:t}}).then(i=>{i.error&&console.error("HighlightFeature:",i.error)}).catch(i=>{console.error("HighlightFeature:",i)})},qi=(c,e,t,i)=>{c.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=(c,e,t)=>{c.callUeFunc({f:"SetLayerVisible",p:{id:e,LayerJson:t}}).then(i=>{i.error&&console.error("SetLayerVisible:",i.error)}).catch(i=>{console.error("SetLayerVisible:",i)})},Zi=(c,e,t)=>{c.callUeFunc({f:"SetLayerColor",p:{id:e,LayerJson:t}}).then(i=>{i.error&&console.error("SetLayerColor:",i.error)}).catch(i=>{console.error("SetLayerColor:",i)})},ce=(c,e,t,i)=>{c.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(c,e,t,i)=>{const n=await c.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},Vi=(c,e,t,i)=>{c.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)})},Qi=(c,e,t,i)=>{c.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)})},Yi=(c,e,t,i)=>{c.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(c,e)=>{const t=await c.callUeFunc({f:"ChangeNavigationMode",p:e});if(t.error){console.error("ChangeNavigationMode:",t.error);return}return t},bi=async(c,e)=>{const t=await c.callUeFunc({f:"setGlobalProperty",p:e});if(t.error){console.error("setGlobalProperty:",t.error);return}return t},xi=async c=>{const e=await c.callUeFunc({f:"Quit",p:void 0});if(e.error){console.error("Quit:",e.error);return}return e},Oi=async(c,e,t,i)=>{console.log("pickCallFunc",e,t,i);const n=await c.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;const s=r?u.ESSceneObject.getSceneObject(r):void 0;return s&&Reflect.has(s,"allowPicking")&&Reflect.has(s,"pickedEvent")&&(s.allowPicking??!1)&&(o=new u.ESJPickedResult(n.re,s,n.re.features,n.re.add,t,e),s.pickedEvent.emit(o)),s&&Reflect.has(s,"allowPicking")&&!s.allowPicking?new u.ESJPickedResult:o},ji=async(c,e)=>{const t=await c.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(c,e,t,i="ECC_Visibility")=>{const n=await c.callUeFunc({f:"GetHeightByLonLat",p:{Lon:e,Lat:t,Channel:i}});if(n.error){console.warn(`GetHeightByLonLat:${n.error}`);return}return n.re},en=async(c,e,t="ECC_Visibility")=>{const i=await c.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(c,e=64,t=64)=>{const i=await c.callUeFunc({f:"capture",p:{resx:e,resy:t}});if(i.error){console.warn(i.error);return}return i.re.image},rn=async(c,e,t=[64,64])=>{const i=await c.callUeFunc({f:"partialCapture",p:{startPos:e,size:t}});if(i.error){console.warn(i.error);return}return i.re.image},on=async(c,e)=>{const t=await c.callUeFunc({f:"LonLatAltToScreenPosition",p:{LonLatAlt:e}});return t.error&&console.warn(t.error),t.re},sn=async(c,e)=>{const t=await c.callUeFunc({f:"UEPositionToLonLatAlt",p:{UEPosition:e}});if(t.error){console.warn(t.error);return}return[...t.re.LonLatAlt]},an=async(c,e)=>{const t=await c.callUeFunc({f:"GetAllSocketNamesByActorTag",p:{ActorTag:e}});if(t.error){console.warn(t.error);return}return[...t.re.socketNames]},ln=async c=>{const e=await c.callUeFunc({f:"GetVersion",p:void 0});if(e.error){console.warn("GetVersion:",e.error);return}return e.re.version},dn=async(c,e)=>{const t=await c.callUeFunc({f:"GetBoundSphere",p:{id:e}});if(t.error){console.warn(t.error);return}return t.re},cn=async(c,e)=>{const t=await c.callUeFunc({f:"GetBoundSphereWithChildren",p:{id:e}});if(t.error){console.warn(`GetBoundSphereWithChildren:${t.error}`);return}return t.re},un=async(c,e)=>{const t=await c.callUeFunc({f:"GetStrokeMaterialParamInfo",p:{id:e}});if(t.error){console.warn(`GetStrokeMaterialParamInfo:${t.error}`);return}return t.re},hn=async(c,e)=>{const t=await c.callUeFunc({f:"GetFillMaterialParamInfo",p:{id:e}});if(t.error){console.warn(`GetFillMaterialParamInfo:${t.error}`);return}return t.re},vn=async(c,e)=>{const t=await c.callUeFunc({f:"getGlobalProperty",p:{props:e}});if(t.error){console.warn(`getGlobalProperty:${t.error}`);return}return t.re},gn=async(c,e)=>{const t=await c.callUeFunc({f:"GetObjectByInfo",p:{info:e}});if(t.error){console.warn(`GetObjectByInfo:${t.error}`);return}return t.re},pn=async(c,e,t)=>await c.callUeFunc({f:"BindActorByTag",p:{ID:e,ActorTag:t}}),fn=async c=>await c.callUeFunc({f:"RestoreOriginalScene",p:void 0}),wn=async(c,e)=>await c.callUeFunc({f:"UnBindActorByID",p:{ID:e}}),yn=async(c,e)=>await c.callUeFunc({f:"UnBindActorByTag",p:{ActorTag:e}}),mn=async(c,e,t)=>await c.callUeFunc({f:"CreateActorByClass",p:{ID:e,ActorClass:t}}),Cn=async function(c,e,t){return await c.callUeFunc({f:"Bind3DTilesetByTag",p:{ID:e,ActorTag:t}})},En=async function(c,e){return await c.callUeFunc({f:"UnBind3DTilesetByTag",p:{ActorTag:e}})},Fn=async function(c,e){return await c.callUeFunc({f:"UnBind3DTilesetById",p:{ID:e}})},Sn=async function(c,e,t,i){return await c.callUeFunc({f:"BindImageryByTag",p:{ID:e,ActorTag:t,ComponentTag:i}})},In=async function(c,e,t){return await c.callUeFunc({f:"UnBindImageryByTag",p:{ActorTag:e,ComponentTag:t}})},Tn=async function(c,e){return await c.callUeFunc({f:"UnBindImageryById",p:{ID:e}})},Rn=async function(c,e,t,i){return await c.callUeFunc({f:"GetIdByComponentNameAndHitItem",p:{id:e,ComponentName:t,HitItem:i}})},Dn=async function(c,e="ECC_Visibility"){return await c.callUeFunc({f:"GetCameraRelativeHeight",p:{Channel:e}})},Ln=async function(c,e,t,i){const n=await c.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(c,e,t=!0){const i=await c.callUeFunc({f:"HighlightActorByTag",p:{ActorTag:e,Highlight:t}});return i.error!==""&&console.warn("HighlightActorByTag: ",i.error),i},Un=async function(c,e){const t=await c.callUeFunc({f:"SendCustomMessage",p:{Message:e}});return t.error!==""&&console.warn("SendCustomMessage: ",t.error),t},Mn=async function(c){const e=await c.callUeFunc({f:"GetStatus",p:void 0});if(e.error){console.warn(`GetStatus:${e.error}`);return}return e.re},An=async(c,e,t,i,n=!0)=>{const r=await c.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 c=>{const e=await c.callUeFunc({f:"stopEditing",p:void 0});if(e.error){console.error("stopEditing:",e.error);return}return e},$n=async(c,e,t)=>{const i=await c.callUeFunc({f:"moveObjects",p:{sceneObjectIDs:e,editingID:t}});if(i.error){console.error("moveObjects:",i.error);return}return i},_n=async c=>{const e=await c.callUeFunc({f:"GetTilesetMaterialIDList",p:void 0});if(e.error){console.error("GetTilesetMaterialIDList:",e.error);return}return e.re.materialIDList};class Q extends a.Destroyable{}const Bn={Response:1},ue={UIInteraction:50,MouseWheel:75};class Kn extends a.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]===Bn.Response){s+=4;let v=o[s/4];s+=4;for(let l=0;l<v;l++){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 Xn extends a.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 v=s.webRtcController.sendMessageController.dataChannelSender.sendData;s.webRtcController.sendMessageController.dataChannelSender.constructor.prototype.sendData=function(l){s.esMsgWsWrapper?s.esMsgWsWrapper.sendInputData(l):v.call(this,l)}}}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:!0,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 Kn(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=a.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=a.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 v=Math.ceil(o/r)|0;[...new Array(v).keys()].map(y=>n.slice(y*r,(y+1)*r)).forEach((y,w)=>{this.esMsgWsWrapper&&this.esMsgWsWrapper.emitDescriptorWithString(ue.UIInteraction,`${s}-${w}/${v}-`+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 Zn extends a.Destroyable{constructor(t,i,n){super();f(this,"_instance");f(this,"_event",this.dv(new a.Event));this._container=t,this._wsuri=i,this._esmsgWsUri=n,this._instance=this.dv(new Xn(this._container,{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 Vn extends Q{constructor(t,i,n,r){super();f(this,"_esueViewerWrapper");f(this,"_ueFuncResultWithIdsEvent",this.dv(new a.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Set);f(this,"_ueEvent",this.dv(new a.Event));f(this,"_errorEvent",this.dv(new a.Event));f(this,"_readyEvent",this.dv(new a.Event));f(this,"_esmsgwsopen",this.dv(a.react(!1)));f(this,"_videoinited",this.dv(a.react(!1)));f(this,"_webRtcConnected",this.dv(a.react(!1)));this._ueViewer=r,console.log("CSTMPSViewer init ! 以官方像素流 + 独立通信的模式启动!");const o=this._ueViewer;this._esueViewerWrapper=this.dv(new Zn(t,i,n));const s=this._esueViewerWrapper;{const g=()=>s.debug=o.debug??!1;g(),this.d(o.debugChanged.don(g))}let v=!1;{const g=()=>{if(v)return;const h=s.webSocketReady;if(this.videoinited&&this.webRtcConnected&&h){console.log("%c[EarthSDK: esmsgWebSocket && videoinited && webRtcConnected]","background: #a6ec99; color: black");const m={eventType:"init",params:{}};s.emitUIInteractionForBigData(m),this._readyEvent.emit(),v=!0}};this.d(this.videoinitedChanged.don(()=>{g()})),this.d(this.webRtcConnectedChanged.don(()=>{g()})),this.d(this.esmsgwsopenChanged.don(()=>{g()}))}this.d(s.event.don((g,h)=>{if(g==="error")this._errorEvent.emit(h);else if(g==="ueevent"){const m=JSON.parse(h);if(m.t==="cr"){const C=m;if(C.frs&&this._ueFuncResultWithIdsEvent.emit(C.frs),C.ers)for(let E of C.ers)this._ueEvent.emit(E)}}else g==="webRtcConnected"?this.webRtcConnected=!0:g==="videoinited"?this.videoinited=!0:g==="esmsgwsopen"&&(this.esmsgwsopen=!0)}));{const g=this.dv(a.createAnimateFrame());let h,m;g.start(()=>{if(h!==t.offsetWidth||m!==t.offsetHeight){if(h=t.offsetWidth,m=t.offsetHeight,h===void 0||m===void 0||!Number.isFinite(h)||!Number.isFinite(m)||h<0||m<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${h} ${m}`);return}s.resize(h,m),console.log(`resize: ${h} ${m}`)}})}this.d(this._ueFuncResultWithIdsEvent.don(g=>{for(const h of g){const m=this._waitingUeFuncIdAndResultCallbacks.get(h.fid);m&&(this._waitingUeFuncIdAndResultCallbacks.delete(h.fid),m.resultCallback(h.r))}}));let l=0;const y=g=>{const h={n:l++,tt:Date.now(),t:"c",fs:g};this._waitingUeCalls.add(h),o.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(h,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd()),this._esueViewerWrapper.emitUIInteractionForBigData(h,()=>{this._waitingUeCalls.delete(h)})},w=()=>{if(!v||this._ueFuncWithIdAndResultCallbacks.length===0)return;const g=this._ueFuncWithIdAndResultCallbacks.map(([h])=>h);for(const[h,m]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(h.fid,m);this._ueFuncWithIdAndResultCallbacks.length=0;{const h=window.g_emitDescriptor_maxBytes,m=g.map(R=>({f:R,s:JSON.stringify(R).length}));let C=m.length,E=0,I=0,F=[];do{do{const{f:R,s:T}=m[E];if(F.push(R),++E,I+T>h||F.length>=20)break}while(E<C);F.length>0&&(o.debug&&console.log(`传送${F.length}条消息...`),y([...F]),F.length=0,I=0)}while(E<C)}};this.dv(a.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:a.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,{timeStamp:Date.now(),ueFunc:t,resultCallback:i}])})}disposableOnUeEvent(t,i){(this._ueViewer.debug??!1)&&console.log(`disposableOnUeEvent from UeCloudViewer, type:${t}`);const n=a.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},o=this._ueEvent.don(s=>{s.et===t&&s.eid===n&&i(s)});return()=>{o(),r()}}}function Qn(c){let e="";const t=new Uint8Array(c),i=t.length;for(let n=0;n<i;n++)e+=String.fromCharCode(t[n]);return btoa(e)}const Yn=c=>{const e={type:"input",inputdata:Qn(c)};return JSON.stringify(e)};function bn(c){return typeof c=="string"?document.getElementById(c):c}window.g_emitDescriptor_maxBytes=3e4,console.log("全局可设置消息体最大字节, window.g_emitDescriptor_maxBytes 默认 30000 。");let xn=-1;L.Logger.SetLoggerVerbosity(1);class On extends a.Destroyable{constructor(t,i){super();f(this,"debug",!1);f(this,"_error",this.dv(new a.Event));f(this,"_connected",this.dv(new a.Event));f(this,"_ueevent",this.dv(new a.Event));f(this,"_pixelStream");f(this,"uiInteractionCallbacks",new Map);this._container=t,this._option=i;const n=new 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(Yn(s)):o.call(this,s)}}{const r=o=>{const s=this._pixelStream._webRtcController.mouseController;setTimeout(()=>{const v=s.coordinateConverter.normalizeAndQuantizeUnsigned(o.offsetX,o.offsetY),y=s.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp");y&&y([o.button,v.x,v.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 bn(this._container)}get pixelStream(){return this._pixelStream}get webSocketReady(){return this.pixelStream.webSocketController.webSocket.readyState===1}processResponse(t){if(this.debug??!1)try{const i=JSON.parse(t);console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(i,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()}catch(i){console.error(`processResponse(${t}) error: ${i}`,i)}this.resolveCallback(t)||this.ueevent.emit(t)}emitUIInteractionForBigData(t,i){typeof i=="function"&&(t.callid=a.createGuid(),this.uiInteractionCallbacks.set(t.callid,i));const n=JSON.stringify(t),r=window.g_emitDescriptor_maxBytes??3e4,o=n.length,s=++xn;if(o<r){const y={type:"earthsdk",time:new Date().getTime(),params:`${s}-0/1-`+n};this.sendData(JSON.stringify(y));return}const v=Math.ceil(o/r)|0;[...new Array(v).keys()].map(y=>n.slice(y*r,(y+1)*r)).forEach((y,w)=>{const d={type:"earthsdk",time:new Date().getTime(),params:`${s}-${w}/${v}-`+y};this.sendData(JSON.stringify(d))})}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 jn extends a.Destroyable{constructor(t,i,n){super();f(this,"_instance");f(this,"_event",this.dv(new a.Event));this._container=t,this._wsuri=i,this._esmsgWsUri=n,this._instance=this.dv(new On(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 tr extends Q{constructor(t,i,n,r){super();f(this,"_videoInitialized",this.dv(a.react(!1)));f(this,"_webRtcConnected",this.dv(a.react(!1)));f(this,"_webSocketOpen",this.dv(a.react(!1)));f(this,"_ue5ViewerWrapper");f(this,"_ueFuncResultWithIdsEvent",this.dv(new a.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Set);f(this,"_ueEvent",this.dv(new a.Event));f(this,"_errorEvent",this.dv(new a.Event));f(this,"_readyEvent",this.dv(new a.Event));this._ueViewer=r,console.log("INNPSViewer init ! 以内置信令服务器模式启动!");const o=this._ueViewer,s=this.dv(new jn(t,i,n));this._ue5ViewerWrapper=s;{const d=()=>s.debug=o.debug??!1;d(),this.d(o.debugChanged.don(d))}{let d=!1;const g=this.dv(a.createNextAnimateFrameEvent(this._videoInitialized.changed,this._webRtcConnected.changed,this._webSocketOpen.changed));this.d(g.don(()=>{if(d)return;const h=this._ue5ViewerWrapper.instance.webSocketReady;if(this.videoInitialized&&this.webRtcConnected&&h){this._ue5ViewerWrapper.instance.emitUIInteraction(),this._readyEvent.emit(),d=!0,console.log("%c[EarthSDK videoInitialized && webRtcConnected && webSocketReady]","background: #a6ec99; color: black");const m={eventType:"init",params:{}};this._ue5ViewerWrapper.emitUIInteractionForBigData(m)}else console.warn("webSocketReady",h),d=!1}))}this.d(s.event.don((d,g)=>{if(d==="errorEvent")this._errorEvent.emit(g);else if(d==="videoInitialized")this._videoInitialized.value=!0;else if(d==="webRtcConnected")this._webRtcConnected.value=!0;else if(d==="webSocketOpen")this._webSocketOpen.value=!0;else if(d==="ueevent"){const h=JSON.parse(g);if(h.t==="cr"){const m=h;if(m.frs&&this._ueFuncResultWithIdsEvent.emit(m.frs),m.ers)for(let C of m.ers)this._ueEvent.emit(C)}}}));{const d=this.dv(a.createAnimateFrame());let g,h,m;d.start(()=>{if(g!==t.offsetWidth||h!==t.offsetHeight||m!==o.resolutionScale){if(g=t.offsetWidth,h=t.offsetHeight,g===void 0||h===void 0||!Number.isFinite(g)||!Number.isFinite(h)||g<0||h<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${g} ${h}`);return}m=o.resolutionScale,s.resize(g/m,h/m)}})}this.d(this._ueFuncResultWithIdsEvent.don(d=>{for(const g of d){const h=this._waitingUeFuncIdAndResultCallbacks.get(g.fid);h&&(this._waitingUeFuncIdAndResultCallbacks.delete(g.fid),h.resultCallback(g.r))}}));let v=0;const l=d=>{const g={n:v++,tt:Date.now(),t:"c",fs:d};this._waitingUeCalls.add(g),o.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(g,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd()),this._ue5ViewerWrapper.emitUIInteractionForBigData(g,()=>{this._waitingUeCalls.delete(g)})},y=()=>{if(!this._ue5ViewerWrapper.instance.webSocketReady||this._ueFuncWithIdAndResultCallbacks.length===0)return;const g=this._ueFuncWithIdAndResultCallbacks.map(([h])=>h);for(const[h,m]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(h.fid,m);this._ueFuncWithIdAndResultCallbacks.length=0;{const h=window.g_emitDescriptor_maxBytes,m=g.map(R=>({f:R,s:JSON.stringify(R).length}));let C=m.length,E=0,I=0,F=[];do{do{const{f:R,s:T}=m[E];if(F.push(R),++E,I+T>h||F.length>=20)break}while(E<C);F.length>0&&(o.debug&&console.log(`传送${F.length}条消息...`),l([...F]),F.length=0,I=0)}while(E<C)}};this.dv(a.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:a.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,{timeStamp:Date.now(),ueFunc:t,resultCallback:i}])})}disposableOnUeEvent(t,i){const n=a.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},o=this._ueEvent.don(s=>{s.et===t&&s.eid===n&&i(s)});return()=>{o(),r()}}}class er extends a.Destroyable{constructor(t,i,n,r){super();f(this,"_onRuntimeInitialized",this.dv(new a.Event));f(this,"_vIframe",null);this._ueViewer=r;const 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 v=u.ESSceneObject.getStrFromEnv(n+`/web/${i}.html`);s.src=v,s.onload=()=>{const l=s.contentWindow;if(!l){console.error("iframeWindow is null");return}console.log("iwindow.Module",l.Module),l.Module.onRuntimeInitialized=()=>{this._onRuntimeInitialized.emit(),o.setStatus("Created"),o.setStatusLog("创建成功"),l.Module.UE4_resizeCanvas(),l.console.log("创建成功__________________________________________")}}}}get onRuntimeInitialized(){return this._onRuntimeInitialized}get vIframe(){return this._vIframe}}const Nn=typeof TextDecoder<"u"?new TextDecoder:void 0,ir=(c,e=0,t=NaN)=>{const i=e+t;let n=e;for(;c[n]&&!(n>=i);)++n;if(n-e>16&&c.buffer&&Nn)return Nn.decode(c.subarray(e,n));let r="";for(;e<n;){var o=c[e++];if(!(o&128)){r+=String.fromCharCode(o);continue}var s=c[e++]&63;if((o&224)==192){r+=String.fromCharCode((o&31)<<6|s);continue}var v=c[e++]&63;if((o&240)==224?o=(o&15)<<12|s<<6|v:((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|v<<6|c[e++]&63),o<65536)r+=String.fromCharCode(o);else{var l=o-65536;r+=String.fromCharCode(55296|l>>10,56320|l&1023)}}return r};class nr extends a.Destroyable{constructor(e,t,i){super();{const n=()=>{const v=we(t);t.setGlobalProperty(v)};n();const r=se(),o=[];r.forEach(v=>{const l=t[v+"Changed"];o.push(l)});const s=this.dv(a.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 u.ViewerCustomInteraction(t,e)),this.dv(new a.ObjResettingWithEvent(t.statusUpdateIntervalChanged,n=>{if((t.statusUpdateInterval??.5)===0)return;const o=new a.Destroyable;return o.d(i.disposableOnUeEvent("statusUpdate",s=>{t.statusUpdateEvent.emit(s)})),o})),this.dv(new a.ObjResettingWithEvent(t.propChangedListeningChanged,()=>{if(!(t.propChangedListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("propChanged",o=>{t.propChanged.emit(o)})),r})),this.dv(new a.ObjResettingWithEvent(t.objectEventListeningChanged,()=>{if(!(t.objectEventListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("objectEvent",o=>{t.objectEvent.emit(o)})),r})),this.dv(new a.ObjResettingWithEvent(t.widgetEventListeningChanged,()=>{if(!(t.widgetEventListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("widgetEvent",o=>{t.widgetEvent.emit(o)})),r})),this.dv(new a.ObjResettingWithEvent(t.speechRecognitionListeningChanged,()=>{if(!(t.speechRecognitionListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("speechRecognition",o=>{t.speechRecognition.emit(o)})),r})),this.dv(new a.ObjResettingWithEvent(t.customMessageListeningChanged,()=>{if(!(t.customMessageListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("customMessage",o=>{t.customMessage.emit(o)})),r})),this.dv(new a.ObjResettingWithEvent(t.editingEventListeningChanged,()=>{if(!(t.editingEventListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("editingEvent",o=>{o.objectIDs=o.objectIDs.map(s=>s.split("_")[0]),t.editingEvent.emit(o)})),r}))}}let rr=-1;class or extends Q{constructor(t,i,n="${earthsdk3-ue-h5-assets-script-dir}",r){super();f(this,"_ueFuncResultWithIdsEvent",this.dv(new a.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Map);f(this,"_ueEvent",this.dv(new a.Event));this._ueViewer=r;const o=this._ueViewer,s=this.dv(new er(t,i,n,o));let v=!1,l=null;this.d(s.onRuntimeInitialized.don(()=>{var g;if(v=!0,(g=s==null?void 0:s.vIframe)!=null&&g.contentWindow){l=s.vIframe.contentWindow;const h=s.vIframe.contentWindow.document.getElementById("mainarea");h?this.dv(new nr(h,o,this)):console.error("h5Container is null")}else{console.error("iframeWindow is null");return}l.UE_JSHTML5Communication?l.UE_JSHTML5Communication.UESendMessageToJS=h=>{try{const m=ir(l.HEAPU8,h),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(g=>{for(const h of g){const m=this._waitingUeFuncIdAndResultCallbacks.get(h.fid);m&&(this._waitingUeFuncIdAndResultCallbacks.delete(h.fid),m(h.r))}}));let y=0;const w=()=>{if(!v||!l||!l.UE_JSHTML5Communication||!l.UE_JSHTML5Communication.JSSendMessageToUE||this._ueFuncWithIdAndResultCallbacks.length===0)return;const g=this._ueFuncWithIdAndResultCallbacks.map(([T])=>T),h={n:y++,tt:Date.now(),t:"c",fs:g,callid:a.createGuid()};for(const[T,$]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(T.fid,$);this._ueFuncWithIdAndResultCallbacks.length=0,this._waitingUeCalls.set(h.callid,h),o.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(h,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd());const m=JSON.stringify(h),C=window.g_emitDescriptor_maxBytes??3e4,E=m.length,I=++rr;if(E<C){const T=`${I}-0/1-`+m;l.UE_JSHTML5Communication.JSSendMessageToUE(T);return}const F=Math.ceil(E/C)|0;[...new Array(F).keys()].map(T=>m.slice(T*C,(T+1)*C)).forEach((T,$)=>{const fe=`${I}-${$}/${F}-`+T;l.UE_JSHTML5Communication.JSSendMessageToUE(fe)})};this.dv(a.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:a.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,i])})}disposableOnUeEvent(t,i){const n=a.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},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 sr=-1;class ar extends Q{constructor(t,i){super();f(this,"_ueFuncResultWithIdsEvent",this.dv(new a.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Set);f(this,"_ueEvent",this.dv(new a.Event));this._ueViewer=i;const n=this._ueViewer;let r=!1;const 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 d=JSON.parse(w);if(d.t==="cr"){const g=d;if(g.frs&&this._ueFuncResultWithIdsEvent.emit(g.frs),g.ers)for(let h of g.ers)this._ueEvent.emit(h)}}catch(d){console.error(d)}},this.dispose(this._ueFuncResultWithIdsEvent.disposableOn(y=>{for(const w of y){const d=this._waitingUeFuncIdAndResultCallbacks.get(w.fid);d&&(this._waitingUeFuncIdAndResultCallbacks.delete(w.fid),d(w.r))}}));let s=0;const v=()=>{if(!r||this._ueFuncWithIdAndResultCallbacks.length===0)return;const y=this._ueFuncWithIdAndResultCallbacks.map(([g])=>g),w={n:s++,tt:Date.now(),t:"c",fs:y};for(const[g,h]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(g.fid,h);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 d=++sr;window.ue.es.oncommand(`${d}-0/1-`+JSON.stringify(w)).then(()=>{this._waitingUeCalls.delete(w)})};this.dv(a.createInterval()).start(v,50)}callUeFunc(t){return new Promise(i=>{const r={fid:a.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,i])})}disposableOnUeEvent(t,i){const n=a.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},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 lr extends a.Destroyable{constructor(e,t){super();{const i=()=>{const s=we(e);e.setGlobalProperty(s)};i();const n=se(),r=[];n.forEach(s=>{const v=e[s+"Changed"];r.push(v)});const o=this.dv(a.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 a.ObjResettingWithEvent(e.statusUpdateIntervalChanged,i=>{if((e.statusUpdateInterval??.5)===0)return;const r=new a.Destroyable;return r.d(t.disposableOnUeEvent("statusUpdate",o=>{e.statusUpdateEvent.emit(o)})),r})),this.dv(new a.ObjResettingWithEvent(e.propChangedListeningChanged,()=>{if(!(e.propChangedListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("propChanged",r=>{e.propChanged.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.objectEventListeningChanged,()=>{if(!(e.objectEventListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("objectEvent",r=>{e.objectEvent.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.widgetEventListeningChanged,()=>{if(!(e.widgetEventListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("widgetEvent",r=>{e.widgetEvent.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.speechRecognitionListeningChanged,()=>{if(!(e.speechRecognitionListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("speechRecognition",r=>{e.speechRecognition.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.customMessageListeningChanged,()=>{if(!(e.customMessageListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("customMessage",r=>{e.customMessage.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.editingEventListeningChanged,()=>{if(!(e.editingEventListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("editingEvent",r=>{r.objectIDs=r.objectIDs.map(o=>o.split("_")[0]),e.editingEvent.emit(r)})),n}))}}class dr extends a.Destroyable{constructor(e,t,i){super();{const r=()=>{const l=we(t);t.setGlobalProperty(l)};r();const o=se(),s=[];o.forEach(l=>{const y=t[l+"Changed"];s.push(y)});const v=this.dv(a.createNextAnimateFrameEvent(...s));this.d(v.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=(l,y)=>{window.ue.esinput.setinterceptevent(y),l.preventDefault()},o=l=>{r(l,!1)},s=l=>{r(l,!0)},v=l=>{r(l,!1)};n.addEventListener("mouseenter",o),n.addEventListener("mouseleave",s),n.addEventListener("mousemove",v),this.d(()=>{n.removeEventListener("mouseenter",o),n.removeEventListener("mouseleave",s),n.removeEventListener("mousemove",v)})}t.useCustomInteraction=!1,this.dv(new u.ViewerCustomInteraction(t,n)),this.dv(new a.ObjResettingWithEvent(t.statusUpdateIntervalChanged,r=>{if((t.statusUpdateInterval??.5)===0)return;const s=new a.Destroyable;return s.d(i.disposableOnUeEvent("statusUpdate",v=>{t.statusUpdateEvent.emit(v)})),s})),this.dv(new a.ObjResettingWithEvent(t.propChangedListeningChanged,()=>{if(!(t.propChangedListening??!0))return;const o=new a.Destroyable;return o.d(i.disposableOnUeEvent("propChanged",s=>{t.propChanged.emit(s)})),o})),this.dv(new a.ObjResettingWithEvent(t.objectEventListeningChanged,()=>{if(!(t.objectEventListening??!0))return;const o=new a.Destroyable;return o.d(i.disposableOnUeEvent("objectEvent",s=>{t.objectEvent.emit(s)})),o})),this.dv(new a.ObjResettingWithEvent(t.widgetEventListeningChanged,()=>{if(!(t.widgetEventListening??!0))return;const o=new a.Destroyable;return o.d(i.disposableOnUeEvent("widgetEvent",s=>{t.widgetEvent.emit(s)})),o})),this.dv(new a.ObjResettingWithEvent(t.speechRecognitionListeningChanged,()=>{if(!(t.speechRecognitionListening??!0))return;const o=new a.Destroyable;return o.d(i.disposableOnUeEvent("speechRecognition",s=>{t.speechRecognition.emit(s)})),o})),this.dv(new a.ObjResettingWithEvent(t.customMessageListeningChanged,()=>{if(!(t.customMessageListening??!0))return;const o=new a.Destroyable;return o.d(i.disposableOnUeEvent("customMessage",s=>{t.customMessage.emit(s)})),o})),this.dv(new a.ObjResettingWithEvent(t.editingEventListeningChanged,()=>{if(!(t.editingEventListening??!0))return;const o=new a.Destroyable;return o.d(i.disposableOnUeEvent("editingEvent",s=>{s.objectIDs=s.objectIDs.map(v=>v.split("_")[0]),t.editingEvent.emit(s)})),o}))}}class cr extends a.Destroyable{constructor(t,i,n){super();f(this,"_reconnectEvent",this.dv(new a.Event));const r=(v,l)=>v.hasOwnProperty(l);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 v=this.dv(new ar(t,n));this.d(()=>n.viewer=void 0),n.viewer=v,n.setStatus("Created"),n.setStatusLog("本地视口创建成功!"),this.dv(new dr(t,n,v))}else n.setStatus("Error"),n.setStatusLog("请升级 ESWebView !");else if(r(i.options,"ws")||r(i.options,"uri")&&r(i.options,"app")){n.setStatus("Creating"),n.setStatusLog("开始创建云渲染视口...");let v;this.d(()=>{n.setStatus("Raw"),n.setStatusLog(""),t&&v&&t.removeChild(v)&&(v=void 0)});const l=this.dv(a.createProcessingFromAsyncFunc(async y=>{n.viewer&&!n.viewer.isDestroyed()&&n.viewer.destroy(),n.viewer=void 0,v&&t.removeChild(v)&&(v=void 0),v=document.createElement("div"),v.setAttribute("earthsdk3-ue","earthsdk3-ue-videoContainer"),v.style.cssText="position:relative; height: 100%;width:100%;",t.appendChild(v);let w,d,g;if(r(i.options,"ws")){const{ws:E,esmsg:I,uselnternalSignallingServer:F}=i.options;w=E,d=I,g=F??!1}if(r(i.options,"uri")&&r(i.options,"app")){const{offsetWidth:E,offsetHeight:I}=v;let{uri:F,app:R,token:T}=i.options;F.endsWith("/")||(F+="/");const $=T?`?essstoken=${T}`:"",fe=`/${R}/${E??1920}/${I??1080}`+$;console.log(`请求信令服务器: ${F}instance${fe}`);const vr=await y.promise(fetch(`${F}instance${fe}`,{method:"GET"})),Z=await y.promise(vr.json());if(Z&&Z.status!=="ok"){n.setStatus("Error"),n.setStatusLog(`信令服务器请求失败 ${Z.status}`),this._reconnectEvent.emit(void 0);return}else{console.log(`信令服务器请求成功! ${JSON.stringify(Z,void 0," ")}`),await a.sleep(2e3);const{server:gr,esmsg:pr,instanceId:fr,useInternalSignallingServer:wr}=Z;if(!fr){n.setStatus("Error"),n.setStatusLog("检查信令服务器版本,返回数据错误! "),console.log("信令服务器返回数据错误!不包含instanceId!请升级到 ESSS V3.0+ 版本!"),this._reconnectEvent.emit(void 0);return}w=gr,d=pr,g=wr??!1,n.esssResponse=Z}}const h=this.dv(g?new tr(v,w,d,n):new Vn(v,w,d,n));this.d(()=>n.viewer=void 0),this.d(h.errorEvent.don(E=>{const I=`[${E}]:像素流连接错误!`;n.setStatus("Error"),n.setStatusLog(I),this._reconnectEvent.emit(h)})),await y.promise(new Promise(E=>this.d(h.readyEvent.donce(E)))),n.setStatus("Created"),n.setStatusLog("云渲染视口创建成功!"),o=0,s&&clearTimeout(s),s=void 0;const{offsetWidth:m,offsetHeight:C}=v;h.resize(m*window.devicePixelRatio,C*window.devicePixelRatio),n.viewer=h,this.d(()=>n.viewer=void 0),this.dv(new lr(n,h))}));l.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(()=>{l.restart()},o)))})),this.d(l.errorEvent.don(y=>{n.setStatus("Error"),n.setStatusLog("云渲染视口创建失败!"),console.warn("云渲染视口创建失败!",y),this._reconnectEvent.emit(void 0)}))}else if(r(i.options,"project")){const v=i,l=v.options.project,y=v.options.baseUrl;n.setStatus("Creating"),n.setStatusLog("下载编译中...");const w=this.dv(new or(t,l,y,n));n.viewer=w,this.d(()=>n.viewer=void 0)}else n.setStatus("Error"),n.setStatusLog("视口创建失败!"),console.warn("视口创建失败: 参数错误!")}}const N=class N extends u.ESViewer{constructor(t){super(t);f(this,"_viewer",this.dv(a.react(void 0)));f(this,"_esssResponse");f(this,"_speechRecognition",this.dv(new a.Event));f(this,"_propChanged",this.dv(new a.Event));f(this,"_objectEvent",this.dv(new a.Event));f(this,"_widgetEvent",this.dv(new a.Event));f(this,"_customMessage",this.dv(new a.Event));f(this,"_statusUpdateEvent",this.dv(new a.Event));f(this,"_statusUpdateEventdon",(()=>{this.d(this.statusUpdateEvent.don(t=>{this._statusInfo.fps=t.FPS??0,this._statusInfo.length=t.length??0,this._statusInfo.position=t.position??[0,0,0],this._statusInfo.rotation=t.rotation??[0,0,0]}))})());if(t.type!=="ESUeViewer")throw new Error("option.type must be ESUeViewer");const i=t;this.d(this._viewer.changed.don(()=>{this.viewerChanged.emit(this.viewer)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new cr(this.subContainer,i,this)}))}get defaultProps(){return N.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 Hi(this.viewer)}async stopVoice(){if(!this.viewer){console.warn("startVoice:viewer is undefined");return}return await Gi(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 Fn(this.viewer,t)}async bindImageryByTag(t,i,n){if(!this.viewer){console.warn("BindImageryByTag: viewer is undefined");return}return await Sn(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 Un(this.viewer,t)}async getStatus(){if(!this.viewer){console.warn("GetStatus:viewer is undefined");return}return await Mn(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:v,y:l}=this.container.getBoundingClientRect();r=[v+o,l+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 flyIn(t,i=[0,0,0],n=1,r="default"){if(!this.viewer)return;const o=await V(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 B(this.viewer,void 0,void 0,t,i,n);if(r)return r.endType===0&&console.warn(`flyTo:flyTo is end! endType:${r.endType}`),r.endType===1&&console.warn(`flyTo:飞行中断! endType:${r.endType}`),r}flyToBoundingSphere(t,i,n=1){const r=[[t[0],t[1],0],[t[0],t[3],0],[t[2],t[3],0],[t[2],t[1],0]],o=u.getGeoBoundingSphereFromPositions(r);if(!o)return;const{center:s,radius:v}=o,l={distance:i??v,heading:0,pitch:-90,flyDuration:n,hDelta:0,pDelta:0};this.flyTo(l,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){if(!this.viewer)return;const n={mode:"Walk",position:t,jumpZVelocity:i},r=await A(this.viewer,n);return r&&!r.error&&(this._navigationMode.value=n.mode),r}async changeToMap(){if(!this.viewer)return;const t={mode:"Map"},i=await 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 v={mode:"Line",geoLineStringId:t,speed:i,heightOffset:n,loop:r,turnRateDPS:o,lineMode:s},l=await A(this.viewer,v);return l&&!l.error&&(this._navigationMode.value=v.mode),l}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},v=await A(this.viewer,s);return v&&!v.error&&(this._navigationMode.value=s.mode),v}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},v=await A(this.viewer,s);return v&&!v.error&&(this._navigationMode.value=s.mode),v}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}_${a.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=a.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(N,"type",N.register("ESUeViewer",N)),f(N,"defaults",{...Jn});let W=N;(c=>{c.createDefaultProps=()=>({...u.ESViewer.createDefaultProps(),...Ni(),resolutionScale:1,autoReconnect:!1,propChangedListening:void 0,objectEventListening:void 0,widgetEventListening:void 0,speechRecognitionListening:void 0,customMessageListening:void 0})})(W||(W={})),a.extendClassProps(W.prototype,W.createDefaultProps);class _ extends u.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(i&&(e.combinationClass||this.d(this.createdEvent.don(()=>{const n=this.constructor.propValFuncs,r=e.defaultProps,o=Object.keys(r).filter(d=>n[d]!==null);o.push(...this.constructor.forceUeUpdateProps);const s=e.constructor.defaults,v={val:{}},l=[];for(let d of o){const g=d+"Changed",h=e[g];l.push(h);const m=n[d];if(m===null)throw console.error("vf === null error"),new Error("vf === null error");const C=()=>{const E=e[d]??s[d];let I=m?m(E,this,t,e):E;if(I===void 0){console.warn(`UE自动更新的属性,不应该为undefined! 属性名:${d} 对象名:${e.name} 对象id: ${e.id}`);return}v.val[d]=I};C(),this.d(h.don(C))}const y=()=>{i.callUeFunc({f:"update",p:{id:e.id,...v.val}}),v.val={}},w=this.dv(a.createNextAnimateFrameEvent(...l));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(_,"propValFuncs",{ref:null,devTags:null,extras:null,execOnceFuncStr:null,updateFuncStr:null,toDestroyFuncStr:null}),f(_,"forceUeUpdateProps",[]);class P extends _{constructor(e,t){super(e,t);const i=t.viewer;i&&(this.d(e.flyToEvent.don(n=>{B(i,e.id,n)})),this.d(e.flyInEvent.don(n=>{var r,o;V(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(()=>{K(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 S 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(a.createNextAnimateFrameEvent(e.positionChanged,e.rotationChanged,e.editingChanged));this.d(r.don(()=>{setTimeout(n,0)})),this.d(e.smoothMoveEvent.don((v,l)=>{ce(i,e.id,v,l)})),this.d(e.smoothMoveWithRotationEvent.don((v,l,y)=>{ae(i,e.id,v,l,y)})),this.d(e.smoothMoveOnGroundEvent.don((v,l,y,w)=>{le(i,e.id,v,l,w,y)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((v,l,y,w,d)=>{de(i,e.id,v,l,y,w,d)})),this.d(e.smoothMoveKeepPitchEvent.don(async(v,l)=>{const y=await i.callUeFunc({f:"SmoothMoveKeepPitch",p:{id:e.id,Destination:v,Time:l}});y.error&&console.error("SmoothMoveKeepPitch:",y.error)})),this.d(e.automaticLandingEvent.don(v=>{const l=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(y=>{y!==null&&(e.position=[...l,y],e.collision=v)})}));const o=async(v,l,y,w)=>{const{viewer:d}=v;if(!d){console.error("SmoothMoveRelatively: ueViewer.viewer is undefined");return}const g=await d.callUeFunc({f:"SmoothMoveRelatively",p:{id:l,RelativePosition:y,Time:w}});return g.error&&console.error("SmoothMoveRelatively:",g.error),g};this.d(e.smoothMoveRelativelyEvent.don((v,l)=>{o(t,e.id,v,l)}));const s=async(v,l,y,w,d)=>{const{viewer:g}=v;if(!g){console.error("SmoothMoveRelativelyWithRotation: ueViewer.viewer is undefined");return}const h=await g.callUeFunc({f:"SmoothMoveRelativelyWithRotation",p:{id:l,RelativePosition:y,NewRotation:w,Time:d}});return h.error&&console.error("SmoothMoveRelativelyWithRotation:",h.error),h};this.d(e.smoothMoveRelativelyWithRotationEvent.don((v,l,y)=>{s(t,e.id,v,l,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(a.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 M extends S{constructor(e,t){super(e,t),t.viewer&&this.d(t.widgetEvent.don(n=>{if(n.objId!==e.id)return;const{type:r,add:o}=n;e.widgetEvent.emit({type:r,add:o})}))}}class Ee extends S{constructor(e,t){super(e,t),t.viewer}}f(Ee,"propValFuncs",{...S.propValFuncs,pointStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})}),strokeStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})}),fillStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})})});class he extends Ee{constructor(e,t){super(e,t),t.viewer}}const zn=c=>{switch(c){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"没搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是3dTileset,无法绑定";default:return"未知错误"}},Y=class Y extends u.EngineObject{constructor(t,i){super(t,i);f(this,"_styleColor",this.dv(a.react([])));f(this,"_styleVisable",this.dv(a.react([])));const n=i.viewer;if(!n){console.warn("UeES3DTileset: viewer is undefined!");return}let r,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??u.ESVisualObject.defaults.flyToParam,flyInParam:t.flyInParam??u.ESVisualObject.defaults.flyInParam,highlightID:t.highlightID,highlightColor:t.highlightColor,highlight:t.highlight,materialMode:t.materialMode,maximumScreenSpaceError:t.maximumScreenSpaceError,colorMode:Reflect.has(t,"colorMode")?t.colorMode:void 0,offset:t.offset,rotation:t.rotation,cacheBytes:t.cacheBytes,colorBlendMode:t.colorBlendMode,materialOverrideMap:t.materialOverrideMap}})},v=this.dv(a.createNextAnimateFrameEvent(t.urlChanged,t.showChanged,t.flyToParamChanged,t.flyInParamChanged,t.collisionChanged,t.allowPickingChanged,t.highlightIDChanged,t.highlightColorChanged,t.highlightChanged,t.materialModeChanged,t.maximumScreenSpaceErrorChanged,t.offsetChanged,t.rotationChanged,t.cacheBytesChanged,t.colorBlendModeChanged,t.materialOverrideMapChanged));s(),this.d(v.don(s)),Reflect.has(t,"colorMode")&&this.d(t.colorModeChanged.don(()=>s()));const l=this.dv(a.react(void 0));{const w=this.dv(a.createNextAnimateFrameEvent(t.actorTagChanged,t.urlChanged)),d=()=>{t.actorTag?l.value={type:"ActorTag",actorTag:t.actorTag}:t.url?l.value={type:"CreatedUrl",url:t.url}:l.value=void 0,t.editing=!1};d(),this.d(w.don(d))}const y=async()=>{const{id:w}=t;if(r!==void 0){r=void 0;try{const d=await i.unBind3DTilesetById(w);if(!d)return;if(d.error!==""){console.warn(`UeES3DTileset UnBind3DTilesetById: ${d.error}`);return}}catch(d){console.warn(`UeES3DTileset UnBind3DTilesetById: ${d}`);return}}if(o!==void 0){o=void 0;try{const d=await n.callUeFunc({f:"destroy",p:{id:w}});if(!d)return;if(d.error!==""){console.warn(`UeES3DTileset Destroy: ${d.error}`);return}}catch(d){console.warn(`UeES3DTileset Destroy: ${d}`);return}}};this.d(()=>{y()});{const w=this.dv(a.createProcessingFromAsyncFunc(async g=>{if(l.value===void 0){await g.promise(y());return}if(l.value.type==="ActorTag"){const{actorTag:h}=l.value;if(r!==h&&await g.promise(y()),r!==void 0||h===void 0)return;try{r=h;const m=await g.promise(i.bind3DTilesetByTag(t.id,h));if(!m)return;if(m.error!==""){console.warn(`UeES3DTileset Bind3DTilesetByTag: ${m.error}`);return}if(m.re.type!==0)if(m.re.type===1)console.warn(`UeES3DTileset Bind3DTilesetByTag: ${zn(m.re.type)}`);else{console.warn(`UeES3DTileset Bind3DTilesetByTag: ${zn(m.re.type)}`);return}}catch(m){console.warn(`UeES3DTileset Bind3DTilesetByTag: ${m}`);return}}else if(l.value.type==="CreatedUrl"){const{url:h}=l.value;if(h!==o&&await y(),o!==void 0||h===void 0)return;try{o=h;const m=await g.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 g.promise(s())})),d=async()=>{w.restart()};d(),this.d(l.changed.don(d))}this.d(t.refreshTilesetEvent.don(()=>{zi(n,t.id)})),this.d(t.flyToEvent.don(async(w,d)=>{if(!r&&!o)return;const g=await B(n,t.id,w);let h="over";g===void 0?h="error":g.endType===0?h="over":g.endType===1&&(h="cancelled"),t.flyOverEvent.emit(d,h,i)})),this.d(t.calcFlyToParamEvent.don(()=>{!r&&!o||K(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:d,rotation:g}=w;t.flyInParam={position:d,rotation:g,flyDuration:1}})),this.d(i.propChanged.don(w=>{!r&&!o||w.objId===t.id&&Object.keys(w.props).forEach(d=>{const g=w.props[d]===null?void 0:w.props[d];t[d]=g})})),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}},d=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}},g=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}},h=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],d(m,E)})),this.d(t.resetFeatureStyleEvent.don(()=>{g(),this.styleColor=[],this.styleVisable=[]})),this.d(t.setFeatureStyleEvent.don(m=>{h(m)}))}{const w=async()=>{if(!r&&!o){t._featureTableResultEvent.emit(void 0);return}try{const d=await n.callUeFunc({f:"GetFeatureTable",p:{id:t.id}});d.error!==""&&console.warn(`UeES3DTileset GetFeatureTable: ${d.error}`),t._featureTableResultEvent.emit(d.re.table)}catch(d){console.warn(`UeES3DTileset GetFeatureTable: ${d}`),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 d=await n.callUeFunc({f:"GetMaterialNameList",p:{id:t.id}});d.error!==""&&console.warn(`UeES3DTileset GetMaterialNameList: ${d.error}`),t.getMaterialNameListEvent.emit(d.re.materialNameList)}catch(d){console.warn(`UeES3DTileset GetMaterialNameList: ${d}`),t.getMaterialNameListEvent.emit(void 0)}};this.ad(t.getMaterialNameListEvent.don(d=>{d=="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(Y,"type",Y.register("ESUeViewer",u.ES3DTileset.type,Y));let ve=Y;const kn=c=>{switch(c){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"没搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag对应的Actor是地形,无法绑定";case 4:return"没搜索到ComponentTag,无法绑定";default:return"未知错误"}},b=class b extends u.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}let n,r;const o=this.dv(a.react(void 0)),s=this.ad(a.reactJson(""));{const w=()=>{if(typeof e.url=="string")s.value=u.ESSceneObject.context.getStrFromEnv(e.url);else{const d=e.url;d.url=u.ESSceneObject.context.getStrFromEnv(d.url),s.value=d}};w(),this.ad(e.urlChanged.don(w))}const v=async()=>{!n&&!r||await i.callUeFunc({f:"update",p:{id:e.id,show:e.show??!0,rectangle:e.rectangle??[-180,-90,180,90],collision:e.collision??!0,allowPicking:e.allowPicking??!1,flyToParam:e.flyToParam??u.ESVisualObject.defaults.flyToParam,flyInParam:e.flyInParam??u.ESVisualObject.defaults.flyInParam,url:s.value??"",zIndex:e.zIndex??0,maximumLevel:e.maximumLevel??u.ESImageryLayer.defaults.maximumLevel,minimumLevel:e.minimumLevel??u.ESImageryLayer.defaults.minimumLevel,options:e.options??u.ESImageryLayer.defaults.options,targetID:e.targetID??u.ESImageryLayer.defaults.targetID,opacity:e.opacity??u.ESImageryLayer.defaults.opacity}})},l=this.dv(a.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));this.d(l.don(v));const y=async()=>{const{id:w}=e;if(n!==void 0){n=void 0;try{const d=await t.unBindImageryById(w);if(!d)return;if(d.error!==""){console.warn(`UeESImageryLayer UnImageryByID: ${d.error}`);return}}catch(d){console.warn(`UeESImageryLayer UnImageryByID promise: ${d}`);return}}if(r!==void 0){r=void 0;try{const d=await i.callUeFunc({f:"destroy",p:{id:w,test:"UeESImageryLayer"}});if(!d)return;if(d.error!==""){console.warn(`UeESImageryLayer Destroy: ${d.error}`);return}}catch(d){console.warn(`UeESImageryLayer Destroy promise: ${d}`);return}}};this.d(()=>{y()});{const w=this.dv(a.createProcessingFromAsyncFunc(async g=>{if(o.value===void 0){await g.promise(y());return}if(o.value.type==="ActorTag"){const{actorTag:h,componentTag:m}=o.value;if(n!==h&&await g.promise(y()),n!==void 0||h===void 0)return;try{n=h;const C=await g.promise(t.bindImageryByTag(e.id,h,m));if(!C)return;if(C.error!==""){console.warn(`ESImageryLayer BindImageryByTag: ${C.error}`);return}if(C.re.type!==0)if(C.re.type===1)console.warn(`ESImageryLayer BindImageryByTag: ${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:h}=o.value;if(h!==r&&await g.promise(y()),r!==void 0||h===void 0)return;try{r=h;const m=await g.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 g.promise(v())})),d=async()=>{w.restart()};d(),this.d(o.changed.don(d))}{const w=this.dv(a.createNextAnimateFrameEvent(e.actorTagChanged,s.changed,e.componentTagChanged)),d=()=>{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};d(),this.d(w.don(d))}this.d(e.flyToEvent.don(async(w,d)=>{if(!n&&!r)return;const g=await B(i,e.id,w);let h="over";g===void 0?h="error":g.endType===0?h="over":g.endType===1&&(h="cancelled"),e.flyOverEvent.emit(d,h,t)})),this.d(e.flyInEvent.don(async(w,d)=>{var m,C;if(!n&&!r)return;const g=await V(i,e.id,(m=e.flyInParam)==null?void 0:m.position,(C=e.flyInParam)==null?void 0:C.rotation,w??1);let h="over";g===void 0?h="error":g.endType===0?h="over":g.endType===1&&(h="cancelled"),e.flyOverEvent.emit(d,h,t)})),this.d(e.calcFlyToParamEvent.don(()=>{!n&&!r||K(i,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const w=await t.getCurrentCameraInfo();if(!w)return;const{position:d,rotation:g}=w;e.flyInParam={position:d,rotation:g,flyDuration:1}})),this.d(t.propChanged.don(w=>{!n&&!r||w.objId===e.id&&Object.keys(w.props).forEach(d=>{const g=w.props[d]===null?void 0:w.props[d];e[d]=g})}))}};f(b,"type",b.register("ESUeViewer",u.ESImageryLayer.type,b));let Fe=b;const z=class z extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(z,"type",z.register("ESUeViewer",u.ESTerrainLayer.type,z)),f(z,"forceUeUpdateProps",[...P.forceUeUpdateProps,"url"]),f(z,"propValFuncs",{...P.propValFuncs,url:e=>typeof e=="string"?u.ESSceneObject.context.getStrFromEnv(e):(e.url=u.ESSceneObject.context.getStrFromEnv(e.url),e),czmMaxzoom:null,czmMinzoom:null});let Se=z;const x=class x extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(x,"type",x.register("ESUeViewer",u.ESAlarm.type,x));let Ie=x;const O=class O extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(O,"type",O.register("ESUeViewer",u.ESApertureEffect.type,O));let Te=O;const j=class j extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(j,"type",j.register("ESUeViewer",u.ESGeoPolygon.type,j));let U=j;const tt=class tt extends U{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let o=u.ESAreaMeasurement.defaults.fillStyle;try{o={...e.fillStyle??u.ESAreaMeasurement.defaults.fillStyle}}catch(s){console.error("ESAreaMeasurement fillStyle 属性类型错误!",s),o={...u.ESAreaMeasurement.defaults.fillStyle}}o.materialParams=JSON.stringify(o.materialParams),i.callUeFunc({f:"update",p:{id:e.id,stroked:e.stroked??u.ESAreaMeasurement.defaults.stroked,fillStyle:o,filled:e.filled??u.ESAreaMeasurement.defaults.filled}}),console.log(o)},r=this.dv(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.strokedChanged,e.filledChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};f(tt,"type",tt.register("ESUeViewer",u.ESAreaMeasurement.type,tt));let Re=tt;const et=class et extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(et,"type",et.register("ESUeViewer",u.ESBlastParticleSystem.type,et));let De=et;const it=class it extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};f(it,"type",it.register("ESUeViewer",u.ESBoxClipping.type,it));let Le=it;const nt=class nt extends S{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.dispose(e.flyInEvent.don((n,r,o="default")=>{const{id:s,duration:v,position:l,rotation:y}=e;V(i,s,l,y,v??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(nt,"type",nt.register("ESUeViewer",u.ESCameraView.type,nt));let Pe=nt;const rt=class rt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(rt,"type",rt.register("ESUeViewer",u.ESCameraVisibleRange.type,rt));let Ue=rt;const ot=class ot extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(ot,"type",ot.register("ESUeViewer",u.ESCar.type,ot));let Me=ot;const st=class st extends D{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let o=u.ESClassification.defaults.fillStyle;try{o={...e.fillStyle??u.ESClassification.defaults.fillStyle}}catch(s){console.error("ESClassification fillStyle 属性类型错误!",s),o={...u.ESClassification.defaults.fillStyle}}o.materialParams=JSON.stringify(o.materialParams),i.callUeFunc({f:"update",p:{id:e.id,filled:e.filled??u.ESClassification.defaults.filled,fillStyle:o}})},r=this.dv(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};f(st,"type",st.register("ESUeViewer",u.ESClassification.type,st));let Ae=st;const at=class at extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};f(at,"type",at.register("ESUeViewer",u.ESClippingPlane.type,at));let We=at;const lt=class lt extends S{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=this.ad(a.reactJson(""));{const s=()=>{if(typeof e.url=="string")n.value=u.ESSceneObject.context.getStrFromEnv(e.url??u.ESDataMesh.defaults.url);else{const v=e.url;v.url=u.ESSceneObject.context.getStrFromEnv(v.url??u.ESDataMesh.defaults.url),n.value=v}};s(),this.ad(e.urlChanged.don(s))}const r=()=>{const s=e.colorStops??u.ESDataMesh.defaults.colorStops;i.callUeFunc({f:"update",p:{id:e.id,url:n.value??u.ESDataMesh.defaults.url,currentTime:e.currentTime??u.ESDataMesh.defaults.currentTime,minPropValue:e.minPropValue??u.ESDataMesh.defaults.minPropValue,maxPropValue:e.maxPropValue??u.ESDataMesh.defaults.maxPropValue,colorStops:JSON.stringify(s)}})},o=this.dv(a.createNextAnimateFrameEvent(n.changed,e.currentTimeChanged,e.minPropValueChanged,e.maxPropValueChanged,e.colorStopsChanged));this.d(o.don(r)),this.d(e.createdEvent.don(r))}};f(lt,"type",lt.register("ESUeViewer",u.ESDataMesh.type,lt));let $e=lt;const dt=class dt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(dt,"type",dt.register("ESUeViewer",u.ESDatasmithRuntimeModel.type,dt));let _e=dt;const ct=class ct extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(ct,"type",ct.register("ESUeViewer",u.ESDirectionMeasurement.type,ct));let Ne=ct;const ut=class ut 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??u.ESDistanceMeasurement.defaults.strokeStyle}}catch(s){console.error("ESDistanceMeasurement strokeStyle 属性类型错误!",s),o={...u.ESDistanceMeasurement.defaults.strokeStyle}}i.callUeFunc({f:"update",p:{id:e.id,strokeStyle:o}})},r=this.dv(a.createNextAnimateFrameEvent(e.strokeStyleChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};f(ut,"type",ut.register("ESUeViewer",u.ESDistanceMeasurement.type,ut));let ze=ut;const ht=class ht extends he{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(ht,"type",ht.register("ESUeViewer",u.ESLocalPolygon.type,ht));let ge=ht;const vt=class vt extends ge{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(vt,"type",vt.register("ESUeViewer",u.ESDynamicWater.type,vt));let ke=vt;const gt=class gt 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(gt,"type",gt.register("ESUeViewer",u.ESEntityCluster.type,gt));let He=gt;const pt=class pt extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(pt,"type",pt.register("ESUeViewer",u.ESExcavate.type,pt));let Ge=pt;const ft=class ft extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(ft,"type",ft.register("ESUeViewer",u.ESFireParticleSystem.type,ft));let Je=ft;const wt=class wt extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=this.ad(a.reactJson(""));{const s=()=>{if(typeof e.url=="string")n.value=u.ESSceneObject.context.getStrFromEnv(e.url);else{const v=e.url;v.url=u.ESSceneObject.context.getStrFromEnv(v.url),n.value=v}};s(),this.ad(e.urlChanged.don(s))}const r=()=>{i.callUeFunc({f:"update",p:{id:e.id,url:n.value??u.ESForestTileset.defaults.url,treeTypes:e.treeTypes??u.ESForestTileset.defaults.treeTypes,xiaoBanWidget:e.xiaoBanWidget??u.ESForestTileset.defaults.xiaoBanWidgetDefault,youShiSZ:e.youShiSZ??u.ESForestTileset.defaults.youShiSZ,diLei:e.diLei??u.ESForestTileset.defaults.diLei,senLinLB:e.senLinLB??u.ESForestTileset.defaults.senLinLB,labelMaterial:e.labelMaterial??u.ESForestTileset.defaults.labelMaterial,heightOffset:e.heightOffset??u.ESForestTileset.defaults.heightOffset}})},o=this.dv(a.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(wt,"type",wt.register("ESUeViewer",u.ESForestTileset.type,wt));let Be=wt;const yt=class yt extends u.EngineObject{constructor(t,i){super(t,i);f(this,"_imageLabel",this.dv(new u.ESImageLabel(`${this.sceneObject.id}_ESImageLabel`)));f(this,"_hasClassDivAndPos",{});const n=i.viewer;if(!n){console.warn("viewer is undefined!");return}t.mainClass=this._imageLabel;const r=this._imageLabel;i.add(r),this.d(()=>i.delete(r));{const o=()=>{if(!n)return;if(!t.instanceClass)throw new Error("!sceneObject.instanceClass");const l=document.createElement("div"),y=this.dv(new t.instanceClass(l,t,i))._container;if(y.style.opacity=t.opacity.toString()??u.ESGeoDiv.defaults.opacity,y.style.position="fixed",y.style.zIndex="-1",y.style.top="0px",!document.body.contains(y)){document.body.appendChild(y);let d=y?y.querySelectorAll("*[class]"):[];for(let g=0;g<d.length;g++){const h=d[g];var w=h.getBoundingClientRect();this._hasClassDivAndPos[h.className]=[h.offsetLeft,h.offsetTop,h.offsetLeft+w.width,h.offsetTop+w.height]}}Gn(y,{backgroundColor:null,allowTaint:!0,useCORS:!0,width:y.offsetWidth,height:y.offsetHeight,scale:1}).then(d=>{document.body.contains(y)&&document.body.removeChild(y),r.url=d.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(l){console.error(l)}};s();const v=this.dv(a.createNextAnimateFrameEvent(t.instanceClassChanged,t.opacityChanged));this.d(v.don(s))}{const o=()=>{r.show=t.show};r.show=!1,this.ad(t.showChanged.don(o))}this.d(a.track([r,"anchor"],[t,"anchor"])),this.d(a.bind([r,"position"],[t,"position"])),this.d(a.bind([r,"rotation"],[t,"rotation"])),this.d(a.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(a.bind([r,"flyInParam"],[t,"flyInParam"])),this.d(a.bind([r,"allowPicking"],[t,"allowPicking"])),this.d(a.bind([r,"scale"],[t,"scale"])),this.d(a.track([r,"minVisibleDistance"],[t,"minVisibleDistance"])),this.d(a.track([r,"maxVisibleDistance"],[t,"maxVisibleDistance"])),this.ad(t.automaticLandingEvent.don(()=>{r.automaticLanding()})),this.d(r.pickedEvent.don(o=>{(t.allowPicking??!1)&&t.pickedEvent.emit(o)})),this.d(i.widgetEvent.don(o=>{if(o.objId!==this._imageLabel.id)return;const{type:s,add:v}=o;if(s==="leftClick"&&v){const l=(v==null?void 0:v.classNames)??[],y=Object.keys(this._hasClassDivAndPos);for(let w=0;w<y.length;w++){const d=y[w];let g=this._hasClassDivAndPos[d];v&&v.mouseRelativePos&&v.mouseRelativePos[0]>=g[0]&&v.mouseRelativePos[0]<=g[2]&&v.mouseRelativePos[1]>=g[1]&&v.mouseRelativePos[1]<=g[3]&&l.push(d)}v.classNames=l}t.widgetEvent.emit({type:s,add:v})})),this.d(t.calcFlyToParamEvent.don(()=>{K(n,r.id)})),this.d(t.calcFlyInParamEvent.don(()=>{const o=i.getCurrentCameraInfo();if(!o)return;const{position:s,rotation:v}=o;t.flyInParam={position:s,rotation:v,flyDuration:1}})),this.d(t.smoothMoveEvent.don((o,s)=>{ce(n,r.id,o,s)})),this.d(t.smoothMoveWithRotationEvent.don((o,s,v)=>{ae(n,r.id,o,s,v)})),this.d(t.smoothMoveOnGroundEvent.don((o,s,v,l)=>{le(n,r.id,o,s,l,v)})),this.d(t.smoothMoveWithRotationOnGroundEvent.don((o,s,v,l,y)=>{de(n,r.id,o,s,v,l,y)})),this.d(t.flyToEvent.don((o,s)=>{r.flyTo(o)})),this.d(t.flyInEvent.don(o=>{r.flyIn(o)}))}};f(yt,"type",yt.register("ESUeViewer",u.ESGeoDiv.type,yt));let Ke=yt;const mt=class mt 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(mt,"type",mt.register("ESUeViewer",u.ESGeoJson.type,mt));let qe=mt;const Ct=class Ct extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Ct,"type",Ct.register("ESUeViewer",u.ESGeoLineString.type,Ct));let pe=Ct;const Et=class Et extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Et,"type",Et.register("ESUeViewer",u.ESGeoRectangle.type,Et));let Xe=Et;const Ft=class Ft extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Ft,"type",Ft.register("ESUeViewer",u.ESGeoWater.type,Ft));let Ze=Ft;const k=class k extends S{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.setNodePositionEvent.don((n,r)=>{Vi(i,e.id,n,r)})),this.d(e.setNodeRotationEvent.don((n,r)=>{Qi(i,e.id,n,r)})),this.d(e.setNodeScaleEvent.don((n,r)=>{Yi(i,e.id,n,r)}))}};f(k,"forceUeUpdateProps",[...S.forceUeUpdateProps,"url"]),f(k,"propValFuncs",{...S.propValFuncs,url:e=>typeof e=="string"?u.ESSceneObject.context.getStrFromEnv(u.rpToap(e)):(e.url=u.ESSceneObject.context.getStrFromEnv(u.rpToap(e.url)),e),czmMaximumScale:null,czmMinimumPixelSize:null,czmNativeScale:null,czmColor:null}),f(k,"type",k.register("ESUeViewer",u.ESGltfModel.type,k));let Ve=k;const St=class St extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(St,"type",St.register("ESUeViewer",u.ESHeightMeasurement.type,St));let Qe=St;const It=class It extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=async(o,s,v,l)=>{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:v,Time:l}});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:v}=o;if(!v){console.error("StopAIMove: ueViewer.viewer is undefined");return}const l=await v.callUeFunc({f:"StopAIMove",p:{id:s}});return l.error&&console.error("StopAIMove:",l.error),l};this.d(e.stopAIMoveEvent.don(()=>{r(t,e.id)}))}};f(It,"type",It.register("ESUeViewer",u.ESHuman.type,It));let Ye=It;const H=class H extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}e.anchor=[.5,1]}};f(H,"type",H.register("ESUeViewer",u.ESImageLabel.type,H)),f(H,"forceUeUpdateProps",[...M.forceUeUpdateProps,"url"]),f(H,"propValFuncs",{...M.propValFuncs,url:e=>typeof e=="string"?u.ESSceneObject.context.getStrFromEnv(u.rpToap(e)):(e.url=u.ESSceneObject.context.getStrFromEnv(u.rpToap(e.url)),e)});let be=H;const Tt=class Tt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Tt,"type",Tt.register("ESUeViewer",u.ESLevelRuntimeModel.type,Tt));let xe=Tt;const Rt=class Rt extends he{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Rt,"type",Rt.register("ESUeViewer",u.ESLocalCircle.type,Rt));let Oe=Rt;const Dt=class Dt extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Dt,"type",Dt.register("ESUeViewer",u.ESLocalPolygonZ.type,Dt));let je=Dt;const Lt=class Lt extends he{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Lt,"type",Lt.register("ESUeViewer",u.ESLocalRectangle.type,Lt));let ti=Lt;const Pt=class Pt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Pt,"type",Pt.register("ESUeViewer",u.ESLocalSkyBox.type,Pt));let ei=Pt;const Ut=class Ut extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Ut,"type",Ut.register("ESUeViewer",u.ESLocationMeasurement.type,Ut));let ii=Ut;const Mt=class Mt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Mt,"type",Mt.register("ESUeViewer",u.ESPipeFence.type,Mt));let ni=Mt;const At=class At extends pe{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(At,"type",At.register("ESUeViewer",u.ESPipeline.type,At));let ri=At;const Wt=class Wt 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 v=typeof n=="number"?n.toString():n;qi(i,e.id,v,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,Zi(i,e.id,o)}))}};f(Wt,"type",Wt.register("ESUeViewer",u.ESPipeserTileset.type,Wt));let oi=Wt;const $t=class $t extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f($t,"type",$t.register("ESUeViewer",u.ESPit.type,$t));let si=$t;const _t=class _t extends M{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.ad(e.getInitialStyleEvent.don(async()=>{try{const n=await i.callUeFunc({f:"GetInitialStyle",p:{id:e.id}});n.error!=""&&console.error("getInitialStyleEvent:",n.error),e.initialStyle.value=structuredClone(n.re)}catch(n){console.error("getInitialStyleEvent:",n),e.initialStyle.value=void 0}}))}};f(_t,"type",_t.register("ESUeViewer",u.ESPoi2D.type,_t));let ai=_t;const Nt=class Nt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Nt,"type",Nt.register("ESUeViewer",u.ESPoi3D.type,Nt));let li=Nt;const G=class G extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(G,"type",G.register("ESUeViewer",u.ESPoiTileset.type,G)),f(G,"forceUeUpdateProps",[...P.forceUeUpdateProps,"url"]),f(G,"propValFuncs",{...P.propValFuncs,url:e=>typeof e=="string"?u.ESSceneObject.context.getStrFromEnv(e):(e.url=u.ESSceneObject.context.getStrFromEnv(e.url),e)});let di=G;const zt=class zt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(zt,"type",zt.register("ESUeViewer",u.ESPolygonFence.type,zt));let ci=zt;const kt=class kt extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(kt,"type",kt.register("ESUeViewer",u.ESPolygonFlattenedPlane.type,kt));let ui=kt;const Ht=class Ht extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Ht,"type",Ht.register("ESUeViewer",u.ESPolygonWithHole.type,Ht));let hi=Ht;const Gt=class Gt extends _{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(()=>{e.ids=[]}),this.d(e.highlightInner3DtilesetEvent.don(n=>{n.highlight=!0})),this.d(e.removeHighlightInner3DtilesetEvent.don(n=>{n.highlight=!1}));{const n=s=>{s=s.toLocaleLowerCase();let v=[255,255,255,1];if(s.startsWith("#")){if(s.length===4){let l=parseInt(s[1]+s[1],16),y=parseInt(s[2]+s[2],16),w=parseInt(s[3]+s[3],16);v=[l,y,w,1]}else if(s.length===7){let l=parseInt(s.substring(1,3),16),y=parseInt(s.substring(3,5),16),w=parseInt(s.substring(5,7),16);v=[l,y,w,1]}}else if(s.startsWith("rgba")){let l=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/);if(l){let y=parseInt(l[1]),w=parseInt(l[2]),d=parseInt(l[3]),g=parseFloat(l[4]);v=[y,w,d,g]}}else if(s.startsWith("rgb")){let l=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);if(l){let y=parseInt(l[1]),w=parseInt(l[2]),d=parseInt(l[3]);v=[y,w,d,1]}}else console.error("color类型只能为#rrggbb、#rgb、rgba(r,g,b,a)、rgb(r,g,b)");return[v[0]/255,v[1]/255,v[2]/255,v[3]]},r=()=>{const s=e.layerConfig;if(!s)return;const v=[];s.forEach(l=>{v.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})}),e.setFeatureStyle(v)};r();const o=this.dv(a.createNextAnimateFrameEvent(e.layerConfigChanged));this.d(o.don(()=>{r()}))}}};f(Gt,"type",Gt.register("ESUeViewer",u.ESRtsTileset.type,Gt));let vi=Gt;const Jt=class Jt extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(e.addTreesEvent.don(n=>{u.addTreesCallFunc(t,e.id,n)})),this.d(e.removeAllTreesEvent.don(()=>{u.removeAllTreesCallFunc(t,e.id)})),this.d(e.updateTreeParamsEvent.don(n=>{u.updateTreeParamsCallFunc(t,e.id,n)})),this.d(e.cutDownTreesEvent.don((n,r)=>{u.cutDownTreesCallFunc(t,e.id,n,r)})),this.d(e.growthSimulationEvent.don((n,r,o)=>{u.growthSimulationCallFunc(t,e.id,n,r,o)}))}};f(Jt,"type",Jt.register("ESUeViewer",u.ESSeparateFoliage.type,Jt));let gi=Jt;const Bt=class Bt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Bt,"type",Bt.register("ESUeViewer",u.ESSubmergingAnalysis.type,Bt));let pi=Bt;const Kt=class Kt extends U{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{i.callUeFunc({f:"Start",p:{id:e.id}})})),this.d(e.stopEvent.don(()=>{i.callUeFunc({f:"Stop",p:{id:e.id}})}))}};f(Kt,"type",Kt.register("ESUeViewer",u.ESSunshineAnalysis.type,Kt));let fi=Kt;const qt=class qt extends U{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(qt,"type",qt.register("ESUeViewer",u.ESSurfaceAreaMeasurement.type,qt));let wi=qt;const Xt=class Xt extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Xt,"type",Xt.register("ESUeViewer",u.ESTextLabel.type,Xt));let yi=Xt;const q=class q extends M{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(q,"type",q.register("ESUeViewer",u.ESUEWidget.type,q)),f(q,"propValFuncs",{...M.propValFuncs,info:e=>JSON.stringify(e??{})});let mi=q;const Hn=c=>{switch(c){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"未搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是场景原有的,而是新建的,无法绑定";case 4:return"搜索到ActorTag对应的Actor是地形或3DTileset,无法绑定";default:return"未知错误"}},ur=c=>{switch(c){case 0:return"创建成功";case 1:return"未找到对应的资源,无法创建";case 2:return"Id与场景中现有的ActorTag重复,创建后可能出现问题,创建失败";default:return"未知错误"}},Zt=class Zt extends u.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn(`${e.id} UeESUnrealActor viewer is undefined!`);return}this.d(()=>{ye(i,e.id)});const n=async()=>{l()||await i.callUeFunc({f:"update",p:{id:e.id,name:e.name,show:e.show,rotation:e.rotation,flyToParam:e.flyToParam??u.ESVisualObject.defaults.flyToParam,flyInParam:e.flyInParam??u.ESVisualObject.defaults.flyInParam,highlight:e.highlight,collision:e.collision,scale:e.scale,minVisibleDistance:e.minVisibleDistance,maxVisibleDistance:e.maxVisibleDistance}})},r=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.nameChanged,e.rotationChanged,e.flyToParamChanged,e.flyInParamChanged,e.highlightChanged,e.collisionChanged,e.scaleChanged,e.minVisibleDistanceChanged,e.maxVisibleDistanceChanged));this.d(r.don(n)),this.d(e.flushEvent.don(()=>r.flush()));let o,s;const v=async()=>{l()||(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}`))},l=()=>!o&&!s?(console.warn(`${e.id} 未绑定ActorTag或未创建ActorClass!`),!0):!1,y=async()=>{const{id:d}=e,g=await t.unBindActorByID(d);g&&g.error!==""&&console.warn(`${e.id} UeESUnrealActor UnBindActorByID: ${g.error}`),o=void 0;const h=await i.callUeFunc({f:"destroy",p:{id:d}});if(h&&h.error!==""){console.warn(`${e.id} UeESUnrealActor DestroyActorByID: ${h.error}`);return}s=void 0},w=this.dv(a.react({type:"ActorClass",actorClass:"default"}));{const d=this.dv(a.createNextAnimateFrameEvent(e.actorClassChanged,e.actorTagChanged)),g=async()=>{e.actorTag!==""?w.value={type:"ActorTag",actorTag:e.actorTag}:w.value={type:"ActorClass",actorClass:e.actorClass===""?"default":e.actorClass}};g(),this.d(d.don(g)),this.d(e.flushEvent.don(()=>d.flush()))}{const d=this.dv(a.createProcessingFromAsyncFunc(async h=>{if(await h.promise(y()),w.value.type==="ActorTag"){const{actorTag:m}=w.value;await h.promise(y());try{e.lastActorStatus="null";const C=await h.promise(t.bindActorByTag(e.id,m));if(!C)return;if(C.error!==""){console.warn(`${e.id} UeESUnrealActor BindActorByTag:${m},${C.error}`);return}if(C.re.type===0)e.lastActorStatus="bound",o=m;else if(C.re.type===1)e.lastActorStatus="bound",o=m,console.warn(`${e.id} UeESUnrealActor BindActorByTag:${m},${Hn(C.re.type)}`);else{o=void 0,console.warn(`${e.id} UeESUnrealActor BindActorByTag error:${m}, ${Hn(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 h.promise(t.createActorByClass(e.id,m));if(!C)return;if(C.error!==""){console.warn(`${e.id} UeESUnrealActor CreateActorByClass error :${m}, ${C.error}`);return}if(C.re.type===0)e.lastActorStatus="created",s=m;else{console.warn(`${e.id} UeESUnrealActor CreateActorByClass error type :${m},${ur(C.re.type)}`);return}}catch(C){console.warn(`${e.id} UeESUnrealActor CreateActorByClass error catch :${m}, ${JSON.stringify(C)}`);return}}await h.promise(n()),await h.promise(v())})),g=async()=>{d.restart()};g(),this.d(w.changed.don(g))}this.d(e.positionChanged.don(v)),this.d(e.callFunctionEvent.don(async(d,g)=>{if(l()){e.__callFunctionResultEvent.emit(void 0);return}const h=await Ce(i,e.id,d,g);e.__callFunctionResultEvent.emit(h)})),this.d(e.smoothMoveEvent.don((d,g)=>{l()||ce(i,e.id,d,g)})),this.d(e.smoothMoveWithRotationEvent.don((d,g,h)=>{l()||ae(i,e.id,d,g,h)})),this.d(e.smoothMoveOnGroundEvent.don((d,g,h,m)=>{l()||le(i,e.id,d,g,m,h)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((d,g,h,m,C)=>{l()||de(i,e.id,d,g,h,m,C)})),this.d(e.automaticLandingEvent.don(d=>{if(l())return;const g=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(h=>{h!==null&&(e.position=[...g,h],e.collision=d)})})),this.d(e.flyToEvent.don(async(d,g)=>{if(l())return;const h=await B(i,e.id,d);let m="over";h===void 0?m="error":h.endType===0?m="over":h.endType===1&&(m="cancelled"),e.flyOverEvent.emit(g,m,t)})),this.d(e.calcFlyToParamEvent.don(()=>{l()||K(i,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const d=await t.getCurrentCameraInfo();if(!d)return;const{position:g,rotation:h}=d;e.flyInParam={position:g,rotation:h,flyDuration:1}})),this.d(t.propChanged.don(d=>{l()||d.objId===e.id&&Object.keys(d.props).forEach(g=>{const h=d.props[g]===null?void 0:d.props[g];e[g]=h})}))}};f(Zt,"type",Zt.register("ESUeViewer",u.ESUnrealActor.type,Zt));let Ci=Zt;const Vt=class Vt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Vt,"type",Vt.register("ESUeViewer",u.ESVideoFusion.type,Vt));let Ei=Vt;const Qt=class Qt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Qt,"type",Qt.register("ESUeViewer",u.ESViewShed.type,Qt));let Fi=Qt;const Yt=class Yt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};f(Yt,"type",Yt.register("ESUeViewer",u.ESVisibilityAnalysis.type,Yt));let Si=Yt;const bt=class bt extends U{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{i.callUeFunc({f:"Start",p:{id:e.id}})})),this.d(e.clearEvent.don(()=>{i.callUeFunc({f:"Clear",p:{id:e.id}})}))}};f(bt,"type",bt.register("ESUeViewer",u.ESVolumeMeasurement.type,bt));let Ii=bt;const X=class X extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(X,"type",X.register("ESUeViewer",u.ESWidget.type,X)),f(X,"propValFuncs",{...M.propValFuncs,info:e=>JSON.stringify(e??{})});let Ti=X;const xt=class xt extends u.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}e.poi.actorTag=e.human.id,e.poi.positionOffset=[0,0,e.poiOffsetHeight-.8],this.d(e.poiOffsetHeightChanged.don(()=>{e.poi.positionOffset=[0,0,e.poiOffsetHeight-.8]})),this.d(()=>{e.poi.actorTag=""})}};f(xt,"type",xt.register("ESUeViewer",u.ESHumanPoi.type,xt));let Ri=xt;u.ESSceneObject.context.getStrFromEnv(u.ESNavigator.defaults.imgUrl);const Ot=class Ot extends u.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new u.ESCustomDiv);t.add(n),this.dispose(()=>t.delete(n)),this.dispose(a.track([n,"show"],[e,"show"])),n.instanceClass=class extends a.Destroyable{constructor(o,s,v){super(),this._subContainer=o;const l=document.createElement("div");this._subContainer.appendChild(l),this.dispose(()=>this._subContainer.removeChild(l));{const d=async()=>{const g=await t.getCurrentCameraInfo(),h=g==null?void 0:g.position,C=[...g==null?void 0:g.rotation];C[0]=360,t.flyIn(h,C)};l.addEventListener("click",d),l.style.cursor="pointer",this.dispose(()=>l.removeEventListener("click",d))}{const d=()=>{l.style.width=`${e.cssSize?e.cssSize:u.ESNavigator.defaults.cssSize}px`,l.style.height=`${e.cssSize?e.cssSize:u.ESNavigator.defaults.cssSize}px`};d(),e.dispose(e.cssSizeChanged.disposableOn(d))}l.style.position="fixed";{const d=()=>{l.style.top=`${e.cssPosition?e.cssPosition[0]:u.ESNavigator.defaults.cssPosition[0]}px`,l.style.right=`${e.cssPosition?e.cssPosition[1]:u.ESNavigator.defaults.cssPosition[1]}px`};d(),e.dispose(e.cssPositionChanged.disposableOn(d))}l.style.transition=" right 0.4s linear",l.style.cursor="pointer";const y=document.createElement("div");l.appendChild(y),this.dispose(()=>l.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 d=()=>w.src=e.imgUrl;d(),e.dispose(e.imgUrlChanged.disposableOn(d))}{const d=()=>{const C=-t.getCurrentCameraInfo().rotation[0];w.style.transform=`rotate(${C}deg)`};let g;const h=async()=>{d(),e.show?(l.style.display="block",g=setInterval(()=>{d()},1e3)):(l.style.display="none",clearInterval(g))};this.dispose(e.showChanged.disposableOn(h)),h(),this.dispose(()=>clearInterval(g))}w.style.transformOrigin="50% 50%"}}}};f(Ot,"type",Ot.register("ESUeViewer",u.ESNavigator.type,Ot));let Di=Ot;const J=class J 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(J,"type",J.register("ESUeViewer",u.ESPath.type,J)),f(J,"forceUeUpdateProps",[...D.forceUeUpdateProps]),f(J,"propValFuncs",{...D.propValFuncs,materialMode:null});let Li=J;async function hr(c){navigator.clipboard.writeText(c).then(function(){console.log("复制成功")},function(e){console.log("复制失败")})}const jt=class jt extends u.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new u.ESCustomDiv);t.add(n),this.dispose(()=>t.delete(n)),n.instanceClass=class extends a.Destroyable{constructor(o,s,v){if(super(),this._subContainer=o,!v||!(v instanceof W))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=`${u.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=`${u.ESViewerStatusBar.defaults.height}px`,l.style.zIndex="100",l.style.alignContent="center",l.style.justifyContent="space-between";const y=document.createElement("span");l.appendChild(y),this.dispose(()=>l.removeChild(y));const w=document.createElement("span");y.appendChild(w),this.dispose(()=>y.removeChild(w));const d=document.createElement("span");y.appendChild(d),d.addEventListener("dblclick",function(){let h=d.innerHTML;h.startsWith("鼠标位置")&&(h=h.slice(5)),hr(h)}),d.style.cursor="pointer",this.dispose(()=>y.removeChild(d));const g=document.createElement("span");l.appendChild(g),this.dispose(()=>l.removeChild(g));{const h=()=>{l.style.height=(e.height??u.ESViewerStatusBar.defaults.height)+"px",l.style.lineHeight=(e.height??u.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(h)),h()}{const h=()=>{l.style.fontSize=(e.fontSize??u.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(h)),h()}{const h=()=>{e.bgColor?l.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:l.style.background=`rgba(${u.ESViewerStatusBar.defaults.bgColor[0]},${u.ESViewerStatusBar.defaults.bgColor[1]},${u.ESViewerStatusBar.defaults.bgColor[2]},${u.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(h)),h()}v.getVersion().then(h=>{h&&(g.innerText=`Ue 版本 : ${h[0]} `)}).catch(h=>{console.log(h)});{const h=()=>{let E="",I="";E+=`帧率:${v.getFPS().toFixed(0)}FPS`,w.innerText=E;const F=t.getCurrentCameraInfo();E+=` 经度: ${F.position[0].toFixed(5)}° 纬度: ${F.position[1].toFixed(5)}° 高度: ${F.position[2].toFixed(2)}米 偏航角: ${F.rotation[0].toFixed(2)}° 俯仰角: ${F.rotation[1].toFixed(2)}° 翻滚角:${F.rotation[2].toFixed(2)}° `,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+="暂时无法获取鼠标位置...";d.innerText=I}}).catch(R=>{console.log(R)})};let m;const C=async()=>{h(),e.show?(l.style.display="flex",m=setInterval(()=>{h()},1e3)):(l.style.display="none",clearInterval(m))};this.dispose(e.showChanged.disposableOn(C)),C(),this.dispose(()=>clearInterval(m))}}}}};f(jt,"type",jt.register("ESUeViewer",u.ESViewerStatusBar.type,jt));let Pi=jt;const te=class te extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(te,"type",te.register("ESUeViewer",u.ESGaussianSplatting.type,te));let Ui=te;const ee=class ee extends _{constructor(t,i){super(t,i);f(this,"_es3DTileset",this.dv(new u.ES3DTileset(`${this.sceneObject.id}_ES3DTileset`)));if(!i.viewer){console.warn("viewer is undefined!");return}t.mainClass=this._es3DTileset;{const r=this._es3DTileset;i.add(r),this.dispose(()=>i.delete(r)),this.d(a.track([r,"allowPicking"],[t,"allowPicking"])),this.d(a.track([r,"collision"],[t,"collision"])),this.d(a.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(a.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(a.track([r,"url"],[t,"url"])),this.d(a.track([r,"actorTag"],[t,"actorTag"])),this.d(a.track([r,"materialMode"],[t,"materialMode"])),this.d(a.track([r,"highlight"],[t,"highlight"])),this.d(a.track([r,"maximumScreenSpaceError"],[t,"maximumScreenSpaceError"])),this.d(a.track([r,"highlightID"],[t,"highlightID"])),this.d(a.track([r,"highlightColor"],[t,"highlightColor"])),this.d(a.bind([r,"offset"],[t,"offset"])),this.d(a.bind([r,"rotation"],[t,"rotation"])),this.d(a.track([r,"czmImageBasedLightingFactor"],[t,"czmImageBasedLightingFactor"])),this.d(a.track([r,"czmLuminanceAtZenith"],[t,"czmLuminanceAtZenith"])),this.d(a.track([r,"czmMaximumMemoryUsage"],[t,"czmMaximumMemoryUsage"])),this.d(a.track([r,"czmClassificationType"],[t,"czmClassificationType"])),this.d(a.track([r,"czmStyleJson"],[t,"czmStyleJson"])),this.d(a.track([r,"czmBackFaceCulling"],[t,"czmBackFaceCulling"])),this.d(a.track([r,"czmDebugShowBoundingVolume"],[t,"czmDebugShowBoundingVolume"])),this.d(a.track([r,"czmDebugShowContentBoundingVolume"],[t,"czmDebugShowContentBoundingVolume"])),this.d(a.track([r,"colorBlendMode"],[t,"colorBlendMode"])),this.d(a.track([r,"cacheBytes"],[t,"cacheBytes"])),this.d(a.track([r,"clippingPlaneEnabled"],[t,"clippingPlaneEnabled"])),this.d(a.track([r,"unionClippingRegions"],[t,"unionClippingRegions"])),this.d(a.track([r,"clippingPlaneEdgeColor"],[t,"clippingPlaneEdgeColor"])),this.d(a.track([r,"clippingPlaneEdgeWidth"],[t,"clippingPlaneEdgeWidth"])),this.d(a.track([r,"materialParams"],[t,"materialParams"])),this.d(a.bind([r,"supportEdit"],[t,"supportEdit"])),this.d(a.bind([r,"clippingPlanesId"],[t,"clippingPlanesId"])),this.d(a.bind([r,"clippingPlaneIds"],[t,"clippingPlaneIds"])),this.d(a.bind([r,"flattenedPlaneId"],[t,"flattenedPlaneId"])),this.d(a.bind([r,"flattenedPlaneEnabled"],[t,"flattenedPlaneEnabled"])),this.d(a.bind([r,"clippingPlaneId"],[t,"clippingPlaneId"])),this.d(a.bind([r,"excavateId"],[t,"excavateId"]))}{const r=this._es3DTileset;this.d(t.refreshTilesetEvent.don(()=>{r.refreshTileset()})),this.d(t.highlightFeatureEvent.don((...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(ee,"type",ee.register("ESUeViewer",u.ESRtsFeatureEditing.type,ee));let Mi=ee;const ie=class ie extends _{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(ie,"type",ie.register("ESUeViewer",u.ESMsTileset.type,ie));let Ai=ie;const ne=class ne extends U{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{i.callUeFunc({f:"update",p:{id:e.id,height:e.height??u.ESGeoExtrudedPolygon.defaults.height,extrudedHeight:e.extrudedHeight??u.ESGeoExtrudedPolygon.defaults.extrudedHeight,perPositionHeight:e.perPositionHeight??u.ESGeoExtrudedPolygon.defaults.perPositionHeight}})},r=this.disposeVar(a.createNextAnimateFrameEvent(e.heightChanged,e.extrudedHeightChanged,e.perPositionHeightChanged));this.dispose(r.disposableOn(n)),this.dispose(e.createdEvent.disposableOn(n))}};f(ne,"type",ne.register("ESUeViewer",u.ESGeoExtrudedPolygon.type,ne));let Wi=ne;const re=class re extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(re,"type",re.register("ESUeViewer",u.ESStaticMesh.type,re));let $i=re;const oe=class oe 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(oe,"type",oe.register("ESUeViewer",u.ESSkylineAnalysis.type,oe));let _i=oe;p.copyright=void 0;try{const c="earthsdk3-ue",e="3.0.7",t="2025-06-17T01:46:57.000Z",i="北京西部世界科技有限公司",n="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="edf147b7826beaf136ce605d8be893b716cc4a69",s=((Date.now()-1750124817e3)/36e5).toFixed(1),v=`%c🌏 ${c}%c ${e}.${r.slice(0,8)}.${t} (距今${s}个小时)
|
|
2
2
|
%c${n?n+`
|
|
3
3
|
`:""}当前网站正在使用${c},此软件版权归${i}所有
|
|
4
|
-
`;
|
|
4
|
+
`;p.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","edf147b7826beaf136ce605d8be893b716cc4a69")},get info(){return v},get date(){return"2025-06-17T01:46:57.000Z"},get author(){return"suplyang"},get version(){return"3.0.7"},get name(){return"earthsdk3-ue"},get commitId(){return"edf147b7826beaf136ce605d8be893b716cc4a69"},print(l=!1){!l&&window._xe2_no_copy_print||console.info(this.info,`
|
|
5
5
|
font-size: 18px;
|
|
6
6
|
font-weight: 1000;
|
|
7
7
|
line-height: 1;
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
color: rgb(0, 120, 215);
|
|
19
19
|
padding-bottom: 2px;
|
|
20
20
|
padding-left: 35px;
|
|
21
|
-
`)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[c]=
|
|
21
|
+
`)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[c]=p.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&p.copyright.print()}catch{}p.ESUeViewer=W,p.HighlightFeatureAndFlyToCallFunc=qi,p.HighlightFeatureCallFunc=Ki,p.SetLayerColorCallFunc=Zi,p.SetLayerVisibleCallFunc=Xi,p.UeCloudViewerBase=Q,p.UeES3DTileset=ve,p.UeESAlarm=Ie,p.UeESApertureEffect=Te,p.UeESAreaMeasurement=Re,p.UeESBlastParticleSystem=De,p.UeESBoxClipping=Le,p.UeESCameraView=Pe,p.UeESCameraVisibleRange=Ue,p.UeESCar=Me,p.UeESClassification=Ae,p.UeESClippingPlane=We,p.UeESDataMesh=$e,p.UeESDatasmithRuntimeModel=_e,p.UeESDirectionMeasurement=Ne,p.UeESDistanceMeasurement=ze,p.UeESDynamicWater=ke,p.UeESEntityCluster=He,p.UeESExcavate=Ge,p.UeESFireParticleSystem=Je,p.UeESForestTileset=Be,p.UeESGaussianSplatting=Ui,p.UeESGeoDiv=Ke,p.UeESGeoExtrudedPolygon=Wi,p.UeESGeoJson=qe,p.UeESGeoLineString=pe,p.UeESGeoPolygon=U,p.UeESGeoRectangle=Xe,p.UeESGeoVector=D,p.UeESGeoWater=Ze,p.UeESGltfModel=Ve,p.UeESHeightMeasurement=Qe,p.UeESHuman=Ye,p.UeESHumanPoi=Ri,p.UeESImageLabel=be,p.UeESImageryLayer=Fe,p.UeESLabel=M,p.UeESLevelRuntimeModel=xe,p.UeESLocalCircle=Oe,p.UeESLocalPolygon=ge,p.UeESLocalPolygonZ=je,p.UeESLocalRectangle=ti,p.UeESLocalSkyBox=ei,p.UeESLocalVector=Ee,p.UeESLocalVector2D=he,p.UeESLocationMeasurement=ii,p.UeESMsTileset=Ai,p.UeESNavigator=Di,p.UeESObjectWithLocation=S,p.UeESPath=Li,p.UeESPipeFence=ni,p.UeESPipeline=ri,p.UeESPipeserTileset=oi,p.UeESPit=si,p.UeESPoi2D=ai,p.UeESPoi3D=li,p.UeESPoiTileset=di,p.UeESPolygonFence=ci,p.UeESPolygonFlattenedPlane=ui,p.UeESPolygonWithHole=hi,p.UeESRtsFeatureEditing=Mi,p.UeESRtsTileset=vi,p.UeESSceneObject=_,p.UeESSeparateFoliage=gi,p.UeESSkylineAnalysis=_i,p.UeESStaticMesh=$i,p.UeESSubmergingAnalysis=pi,p.UeESSunshineAnalysis=fi,p.UeESSurfaceAreaMeasurement=wi,p.UeESTerrainLayer=Se,p.UeESTextLabel=yi,p.UeESUEWidget=mi,p.UeESUnrealActor=Ci,p.UeESVideoFusion=Ei,p.UeESViewShed=Fi,p.UeESViewerStatusBar=Pi,p.UeESVisibilityAnalysis=Si,p.UeESVisualObject=P,p.UeESVolumeMeasurement=Ii,p.UeESWidget=Ti,p.bind3DTilesetByTagCallFunc=Cn,p.bindActorByTagCallFunc=pn,p.bindImageryByTagCallFunc=Sn,p.calcFlyToParamCallFunc=K,p.callFunctionCallFunc=Ce,p.captureCallFunc=nn,p.changeNavigationModeCallFunc=A,p.createActorByClassCallFunc=mn,p.destroyCallFunc=ye,p.flyInCallFunc=V,p.flyInDefaultCameraCallFunc=ki,p.flyToCallFunc=B,p.generateMemReportCallFunc=Bi,p.getAllSocketNamesByActorTagCallFunc=an,p.getBoundSphereCallFunc=dn,p.getBoundSphereWithChildrenCallFunc=cn,p.getCameraRelativeHeightCallFunc=Dn,p.getFillMaterialParamInfoCallFunc=hn,p.getGlobalPropertyCallFunc=vn,p.getHeightByLonLatCallFunc=tn,p.getHeightByLonLatsCallFunc=en,p.getIdByComponentNameAndHitItemCallFunc=Rn,p.getLonLatAltToScreenPositionCallFunc=on,p.getObjectByInfoCallFunc=gn,p.getStatusCallFunc=Mn,p.getStrokeMaterialParamInfoCallFunc=un,p.getTilesetMaterialIDListCallFunc=_n,p.getVersionCallFunc=ln,p.highlightActorByTagCallFunc=Pn,p.mountPakFiles=Ji,p.moveObjectsCallFunc=$n,p.partialCaptureCallFunc=rn,p.pickCallFunc=Oi,p.pickPositionCallFunc=ji,p.quitCallFunc=xi,p.refreshTilesetCallFunc=zi,p.resetWithCurrentCameraCallFunc=me,p.restoreOriginalSceneCallFunc=fn,p.saveStringToFileCallFunc=Ln,p.sendCustomMessageCallFunc=Un,p.setGlobalPropertyCallFunc=bi,p.setNodePositionCallFunc=Vi,p.setNodeRotationCallFunc=Qi,p.setNodeScaleCallFunc=Yi,p.smoothMoveCallFunc=ce,p.smoothMoveOnGroundCallFunc=le,p.smoothMoveWithRotationCallFunc=ae,p.smoothMoveWithRotationOnGroundCallFunc=de,p.startEditingCallFunc=An,p.startVoiceCallFunc=Hi,p.stopEditingCallFunc=Wn,p.stopVoiceCallFunc=Gi,p.uePositionToLonLatAltCallFunc=sn,p.unBind3DTilesetByIdCallFunc=Fn,p.unBind3DTilesetByTagCallFunc=En,p.unBindActorByIDCallFunc=wn,p.unBindActorByTagCallFunc=yn,p.unBindImageryByIdCallFunc=Tn,p.unBindImageryByTagCallFunc=In,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
|