earthsdk3 3.5.0-beta.16 → 3.5.0-beta.17

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.
@@ -1,7 +1,7 @@
1
- var EarthSDK3=function(y){"use strict";var fO=Object.defineProperty;var gO=(y,ys,La)=>ys in y?fO(y,ys,{enumerable:!0,configurable:!0,writable:!0,value:La}):y[ys]=La;var f=(y,ys,La)=>gO(y,typeof ys!="symbol"?ys+"":ys,La);var Ar;function ys(){const n=navigator.userAgent;let t="Unknown";/Windows/.test(n)?t="Windows":/Macintosh/.test(n)?t="MacOS":/Linux/.test(n)?t="Linux":/Android/.test(n)?t="Android":/iOS|iPhone|iPad|iPod/.test(n)&&(t="iOS");let e="Unknown";return/x64|x86_64|Win64|WOW64/.test(n)?e="x64":/x86|i686|Win32/.test(n)?e="x86":/arm64|aarch64/.test(n)?e="arm64":/arm/.test(n)&&(e="arm"),{os:t.toLocaleLowerCase(),arch:e.toLocaleLowerCase()}}const La=Date.now();function Gv(n){const{os:t,arch:e}=ys(),i={version:n.version,commitdate:n.date,commitId:n.commitId,runningTime:(Date.now()-La)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:t,arch:e},s={method:"GET",headers:new Headers,redirect:"follow"},o=window.encodeURIComponent(JSON.stringify(i));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(a=>a.text()).then(a=>console.log(a)).catch(a=>console.log("error",a))}y.copyright=void 0;try{const n="earthsdk3",t="3.5.0-beta.16",e="2025-10-22T09:16:13.000Z",i="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="cdf0459633f31b3c6dce81ced3cf33b7abab0ce4",a=((Date.now()-1761124573e3)/36e5).toFixed(1),h=`%c🌏 ${n}%c ${t}.${s.slice(0,8)}.${e} (距今${a}个小时)
1
+ var EarthSDK3=function(y){"use strict";var fO=Object.defineProperty;var gO=(y,ys,La)=>ys in y?fO(y,ys,{enumerable:!0,configurable:!0,writable:!0,value:La}):y[ys]=La;var f=(y,ys,La)=>gO(y,typeof ys!="symbol"?ys+"":ys,La);var Ar;function ys(){const n=navigator.userAgent;let t="Unknown";/Windows/.test(n)?t="Windows":/Macintosh/.test(n)?t="MacOS":/Linux/.test(n)?t="Linux":/Android/.test(n)?t="Android":/iOS|iPhone|iPad|iPod/.test(n)&&(t="iOS");let e="Unknown";return/x64|x86_64|Win64|WOW64/.test(n)?e="x64":/x86|i686|Win32/.test(n)?e="x86":/arm64|aarch64/.test(n)?e="arm64":/arm/.test(n)&&(e="arm"),{os:t.toLocaleLowerCase(),arch:e.toLocaleLowerCase()}}const La=Date.now();function Gv(n){const{os:t,arch:e}=ys(),i={version:n.version,commitdate:n.date,commitId:n.commitId,runningTime:(Date.now()-La)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:t,arch:e},s={method:"GET",headers:new Headers,redirect:"follow"},o=window.encodeURIComponent(JSON.stringify(i));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(a=>a.text()).then(a=>console.log(a)).catch(a=>console.log("error",a))}y.copyright=void 0;try{const n="earthsdk3",t="3.5.0-beta.17",e="2025-10-22T09:45:21.000Z",i="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="04850981037299047e1026988448786f390a045c",a=((Date.now()-1761126321e3)/36e5).toFixed(1),h=`%c🌏 ${n}%c ${t}.${s.slice(0,8)}.${e} (距今${a}个小时)
2
2
  %c${r?r+`
3
3
  `:""}当前网站正在使用${n},此软件版权归${i}所有
4
- `;y.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","cdf0459633f31b3c6dce81ced3cf33b7abab0ce4")},get info(){return h},get date(){return"2025-10-22T09:16:13.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.16"},get name(){return"earthsdk3"},get commitId(){return"cdf0459633f31b3c6dce81ced3cf33b7abab0ce4"},print(){console.info(this.info,`
4
+ `;y.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","04850981037299047e1026988448786f390a045c")},get info(){return h},get date(){return"2025-10-22T09:45:21.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.17"},get name(){return"earthsdk3"},get commitId(){return"04850981037299047e1026988448786f390a045c"},print(){console.info(this.info,`
5
5
  font-size: 18px;
6
6
  font-weight: 1000;
7
7
  line-height: 1;
@@ -487,7 +487,7 @@ timePosRots是一个内部包含三个元素的数组,第一个表示时间戳
487
487
  ${Y1}
488
488
  \`\`\`
489
489
 
490
- `,Vl=Date.now();new Date(Vl).toISOString(),new Date(Vl+864e5).toISOString();const zr=class zr extends ft{constructor(e){super(e);f(this,"_flyToEvent",this.disposeVar(new N));f(this,"_resetClockEvent",this.disposeVar(new N))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new gt([this,"data"],zr.defaults.data,CN,"数据",!0),new gt([this,"uri"],"路径","${earthsdk3-assets-script-dir}/assets/misc/simple.czml",void 0,!0),new rt([this,"clockEnabled"],"启用",!1),new F([this,"multiplier"],"倍速",zr.defaults.multiplier),new rt([this,"autoResetClock"],"自动设置时钟",!0),new qo([this,"startTime"],"开始时间",zr.defaults.startTime,!0),new qo([this,"stopTime"],"结束时间",zr.defaults.stopTime,!0),new qo([this,"currentTime"],"当前时间",zr.defaults.currentTime,!0),new kt([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep","SYSTEM_CLOCK_MULTIPLIER"),new kt([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange","UNBOUNDED"),new rt([this,"shouldAnimate"],"是否启用动画",!1)],general:[...e.general,new rt([this,"show"],"是否显示",!0),new rt([this,"collision"],"开启碰撞",!1),new rt([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new St(["number"],i=>this.flyTo(i),[1e3],"飞入"),new St([],()=>this.resetClock(),[],"重设时钟"),new eo([this,"loadFuncStr"],"loadFnStr",Y1,PN,!0)]}}};f(zr,"createDefaultProps",()=>({show:!0,uri:void 0,allowPicking:!1,data:de(SN),autoResetClock:!0,clockEnabled:!1,startTime:Vl,stopTime:Vl+864e5,currentTime:Vl,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...ft.createDefaultProps()})),f(zr,"type",zr.register("ESCzml",zr,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"}));let fv=zr;const pu=class pu extends ft{getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new Et([]),new rt([this,"show"],"是否显示"),new F([this,"cssSize"],"尺寸"),new ti([this,"cssPosition"],"位置"),new Lu([this,"imgUrl"],"图片地址")]}}};f(pu,"createDefaultProps",()=>({...ft.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:ft.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")})),f(pu,"type",pu.register("ESNavigator",pu,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"}));let gv=pu;const vs=class vs extends ft{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new Et([],"通用","通用"),new rt([this,"show"],"是否显示",vs.defaults.show),new F([this,"height"],"高度",vs.defaults.height,!0),new F([this,"fontSize"],"文字大小",vs.defaults.fontSize,!0),new Ut([this,"bgColor"],"背景颜色",vs.defaults.bgColor,!0)]}}};f(vs,"createDefaultProps",()=>({...ft.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:It([.2784313725490196,.2784313725490196,.2784313725490196,.8])})),f(vs,"type",vs.register("ESViewerStatusBar",vs,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let pv=vs;const ms=class ms extends ft{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new Et([],"通用","通用"),new rt([this,"show"],"是否显示",ms.defaults.show),new F([this,"height"],"高度",ms.defaults.height,!0),new F([this,"fontSize"],"文字大小",ms.defaults.fontSize,!0),new Ut([this,"bgColor"],"背景颜色",ms.defaults.bgColor,!0)]}}};f(ms,"createDefaultProps",()=>({...ft.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:It([.2784313725490196,.2784313725490196,.2784313725490196,.8])})),f(ms,"type",ms.register("ESViewerStatusBarScale",ms,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let vv=ms;const vu=class vu extends _t{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Mt([this,"url"],"路径","",!0),new F([this,"progress"],"进度",0,!1,!0)]}}};f(vu,"createDefaultProps",()=>({..._t.createDefaultProps(),url:"",progress:0})),f(vu,"type",vu.register("ESGaussianSplatting",vu,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"}));let mv=vu;const Oa=class Oa extends _t{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Mt([this,"mesh"],"mesh地址",Oa.defaults.mesh)]}}};f(Oa,"createDefaultProps",()=>({..._t.createDefaultProps(),mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"})),f(Oa,"type",Oa.register("ESStaticMesh",Oa,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"}));let _v=Oa;const mu=class mu extends jt{constructor(e){super(e);f(this,"_startEvent",this.dv(new N));f(this,"_clearEvent",this.dv(new N));f(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new pa),this.ad(this.components.disposableAdd(this._eSGeoExtrudedPolygon)),this.eSGeoExtrudedPolygon.perPositionHeight=!0,this.eSGeoExtrudedPolygon.extrudedHeight=0,this.stroked=!0,this.strokeWidth=2,this.strokeColor=[1,0,0,1],this.ad(Y([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(Y([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(Y([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(Y([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(Y([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(Y([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(Y([this.eSGeoExtrudedPolygon,"points"],[this,"points"])),this.ad(this.clearEvent.don(()=>{this.points=void 0,this.depths=void 0,this.windowPositions=void 0}))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get eSGeoExtrudedPolygon(){return this._eSGeoExtrudedPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new St([],()=>this.start(),[],"开始分析"),new St([],()=>this.clear(),[],"清除分析"),new gt([this,"windowPositions"],"屏幕坐标",[],void 0,!1,!0),new gt([this,"depths"],"深度值",[],void 0,!1,!0),new F([this,"radius"],"半径",1e4,!0)]}}};f(mu,"createDefaultProps",()=>({...jt.createDefaultProps(),windowPositions:op([]),depths:ye([]),radius:H(1e4)})),f(mu,"type",mu.register("ESSkylineAnalysis",mu,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"}));let yv=mu;const Hs=class Hs extends se{constructor(t){super(t)}getESProperties(){const t=super.getESProperties();return{...t,basic:[...t.basic,new gt([this,"data"],"数据",[],void 0,!0),new gt([this,"gradient"],"渐变",Hs.defaults.gradient,void 0,!0),new F([this,"radius"],"半径",Hs.defaults.radius,void 0,!0),new F([this,"blur"],"模糊",Hs.defaults.blur,!0),new rt([this,"is3D"],"is3D",!1,!0)]}}};f(Hs,"createDefaultProps",()=>({...se.createDefaultProps(),is3D:H(!1),data:ic([]),gradient:de({".5":"green",".7":"yellow",".95":"red"}),radius:H(10),blur:H(.85)})),f(Hs,"type",Hs.register("ESHeatMap",Hs,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"}));let Nd=Hs;const Da=class Da extends jt{constructor(e){super(e);f(this,"editingBindMode","scatter")}};f(Da,"createDefaultProps",()=>({...jt.createDefaultProps(),pointed:!0})),f(Da,"type",Da.register("ESGeoPoints",Da,{chsName:"地理点集合",tags:["ESObjects","_ES_Impl_Cesium"],description:"地图中的可视化地理点集合"})),f(Da,"supportEditingModes",[...jt.supportEditingModes,pt.ScatterAppend,pt.ScatterModify]);let zl=Da;const J1=async(n,t=[],e)=>{const i=[];for(const r of t){const{coordinates:s}=r.geometry;for(const o of s){const a=await Promise.all(o.map(async h=>{let u=h[2]??0;if(e)if(e.type==="absolute")u=e.height??u;else if(e.type==="relative"){const c=await n.getTerrainHeight([h[0],h[1]])??0;u=(e.height??u)+c}else e.type==="terrain"&&(u=await n.getTerrainHeight([h[0],h[1]])??0);return[h[0],h[1],u]}));i.push({...r,points:a})}}return i},$1=async(n,t=[],e)=>await Promise.all(t.map(async i=>{var h,u,c,l,d,g,p,_,w;const r=((h=i.geometry)==null?void 0:h.x)??((c=(u=i.geometry)==null?void 0:u.coordinates)==null?void 0:c[0]),s=((l=i.geometry)==null?void 0:l.y)??((g=(d=i.geometry)==null?void 0:d.coordinates)==null?void 0:g[1]);let a=((p=i.geometry)==null?void 0:p.z)??((w=(_=i.geometry)==null?void 0:_.coordinates)==null?void 0:w[2])??0;if(e)if(e.type==="absolute")a=e.height??a;else if(e.type==="relative"){const P=await n.getTerrainHeight([r,s])??0;a=(e.height??a)+P}else e.type==="terrain"&&(a=await n.getTerrainHeight([r,s])??0);return{...i,points:[r,s,a]}})),K1=async(n,t=[],e)=>{const i=[];return await Promise.all(t.map(async r=>{const{coordinates:s}=r.geometry;await Promise.all(s.map(async o=>{const a=await Promise.all(o.map(async h=>{let u=h[2]??0;if(e)if(e.type==="absolute")u=e.height??u;else if(e.type==="relative"){const c=await n.getTerrainHeight([h[0],h[1]])??0;u=(e.height??u)+c}else e.type==="terrain"&&(u=await n.getTerrainHeight([h[0],h[1]])??0);return[h[0],h[1],u]}));i.push({...r,points:a})}))})),i};function bN(n){const t=an(n),e=F_(t),i=mg(t,e/2);return[i.geometry.coordinates[0],i.geometry.coordinates[1],i.geometry.coordinates[2]||0]}function IN(n,t){const e=an(n),i=F_(e),r=Math.floor(i/t),s=[];if(s.push(n[0]),r<1)return[n[0]];for(let o=1;o<r;o+=1){const a=mg(e,i*(o/r));s.push([a.geometry.coordinates[0],a.geometry.coordinates[1],a.geometry.coordinates[2]||0])}return s}function xN(n){const t=[...n];JSON.stringify(n[0])!==JSON.stringify(n[n.length-1])&&t.push(n[0]);const e=he([t]),i=E_(e);return[i.geometry.coordinates[0],i.geometry.coordinates[1],i.geometry.coordinates[2]||0]}function Q1(n,t,e){const i=n.dv(new kh);for(const r in e)r!=="type"&&(i[r]=e[r]);i.position=t,n.d(n.components.disposableAdd(i))}function wv(n,t,e,i){let r=i.textTemplate||i.symbol.text||"";const s=/{{(.*?)}}/;for(;s.test(r);){const c=r.match(s);if(c){const l=c[1].trim(),d=e[`${l}`]||"-";r=r.replace(c[0],d)}}let o=i.symbol;const{minVisibleDistance:a,maxVisibleDistance:h}=i;a&&h&&(o={...o,minVisibleDistance:a,maxVisibleDistance:h});const u={...o,text:r};Q1(n,t,u)}function zh(n,t){const e={width:null,height:null,color:null,opacity:null,rotation:null};return t.forEach(i=>{i.type==="size"?i.axis==="width"?e.width=n[i.field]||null:i.axis==="height"&&(e.height=n[i.field]||null):i.type==="color"?e.color=n[i.field]||null:i.type==="opacity"?e.opacity=n[i.field]||null:i.type==="rotation"&&(e.rotation=n[i.field]||null)}),e}function Ev(n,t,e){const r={...t.symbol};if(e&&e.length>0){const s=zh(n,e);for(let o in s)r[o]!==void 0&&s[o]!==null&&(r[o]=s[o])}return r}function Sv(n,t,e){var u,c;const i=t,{uniqueValueInfos:r,field:s,fieldDelimiter:o,defaultSymbol:a}=i;let h={...a};if(Array.isArray(s)){const d=s.map(g=>n[g]??"").join(o);h=((u=r.find(g=>g.value==d))==null?void 0:u.symbol)||a}else h=((c=r.find(l=>l.value==n[s]))==null?void 0:c.symbol)||a;if(e&&e.length>0){const l=zh(n,e);for(let d in l)h[d]!==void 0&&l[d]!==null&&(h[d]=l[d])}return h}function Cv(n,t,e){const i=t,{classBreakInfos:r,field:s,defaultSymbol:o}=i;let a=o;const h=n[s];if(h===void 0||typeof h!="number")a=o;else{const u=r.find(c=>h<=c.maxValue&&h>=c.minValue);u?a=u.symbol:a=o}if(e&&e.length>0){const u=zh(n,e);for(let c in u)a[c]!==void 0&&u[c]!==null&&(a[c]=u[c])}return a}function MN(n,t){function e(u,c,l,d){const g=S=>S*Math.PI/180,p=S=>S*180/Math.PI,_=g(u),w=g(l),P=g(d-c),v=Math.sin(P)*Math.cos(w),E=Math.cos(_)*Math.sin(w)-Math.sin(_)*Math.cos(w)*Math.cos(P),m=Math.atan2(v,E);return(p(m)+360)%360}function i(u,c,l,d,g){const _=b=>b*Math.PI/180,w=b=>b*180/Math.PI,P=d/6371e3,v=_(g),E=_(u),m=_(c),S=Math.asin(Math.sin(E)*Math.cos(P)+Math.cos(E)*Math.sin(P)*Math.cos(v)),C=m+Math.atan2(Math.sin(v)*Math.sin(P)*Math.cos(E),Math.cos(P)-Math.sin(E)*Math.sin(S));return{lat:w(S),lng:w(C),alt:l}}function r(u){const c=[];u.length>1&&c.push(e(u[0].lat,u[0].lng,u[1].lat,u[1].lng));for(let l=1;l<u.length-1;l++){const d=e(u[l-1].lat,u[l-1].lng,u[l].lat,u[l].lng),g=e(u[l].lat,u[l].lng,u[l+1].lat,u[l+1].lng);let p=(d+g)/2;Math.abs(d-g)>180&&(p=(p+180)%360),c.push(p)}return u.length>1&&c.push(e(u[u.length-2].lat,u[u.length-2].lng,u[u.length-1].lat,u[u.length-1].lng)),u.length===1&&c.push(0),c}if(!n||n.length<2)throw new Error("至少需要两个点才能生成路径");if(t<=0)throw new Error("宽度必须大于0");const s=t/2,o=r(n),a=[],h=[];for(let u=0;u<n.length;u++){const c=(o[u]+90)%360,l=(o[u]+270)%360,d=n[u].alt!==void 0?n[u].alt:0;a.push(i(n[u].lat,n[u].lng,d,s,c)),h.push(i(n[u].lat,n[u].lng,d,s,l))}return a.concat(h.reverse())}function TN(n,t,e,i){function r(_){return _*(Math.PI/180)}const s=6378137,o=r(n),a=r(t),h=r(e),u=r(i),c=h-o,l=u-a,d=Math.sin(c/2)**2+Math.cos(o)*Math.cos(h)*Math.sin(l/2)**2,g=2*Math.atan2(Math.sqrt(d),Math.sqrt(1-d));return s*g}const Z1=(n,t,e)=>Array.isArray(t)?t.map(s=>n[s]??"").join(e):n[t]??"";function tw(n,t){const i={...t.symbol};return{points:n.map(r=>r.points),symbol:i}}function ew(n,t){const e=t,{uniqueValueInfos:i,field:r,fieldDelimiter:s,defaultSymbol:o}=e,a=[],h=i.reduce((c,l)=>{const d=l.value.toString();return c[d]={points:[],value:l.value,symbol:l.symbol},c},{});for(let c=0;c<n.length;c++){const l=n[c],d=Z1(l,r,s);if(d!==void 0&&d!==""){const g=h[d.toString()];g?g.points.push(l.points):a.push(l.points)}else a.push(l.points)}const u=[];for(let c in h){const{points:l,symbol:d}=h[c];l.length>0&&u.push({points:l,symbol:d})}return a.length>0&&u.push({points:a,symbol:o}),u}function iw(n,t){const e=t,{classBreakInfos:i,field:r,defaultSymbol:s}=e,o=[],a=i.map(u=>({...u,points:[]}));for(let u=0;u<n.length;u++){const c=n[u],l=c[r];if(l===void 0||typeof l!="number")o.push(c.points);else{const d=a.findIndex(g=>l<=g.maxValue&&l>=g.minValue);d!==-1?a[d].points.push(c.points):o.push(c.points)}}const h=[];return a.forEach(u=>{u.points.length>0&&h.push({points:u.points,symbol:u.symbol})}),o.length>0&&h.push({points:o,symbol:s}),h}function NN(n,t,e=[]){const r={...t.symbol},s=n.map(o=>{const a=zh(o,e);return{position:o.points,rotation:a.rotation||r.rotation||[0,0,0],scale:r.scale||[1,1,1]}});return{url:r.url,locations:s}}function ON(n,t,e=[]){const i=t,{uniqueValueInfos:r,field:s,fieldDelimiter:o}=i,a=i.defaultSymbol,h=[],u=r.reduce((l,d)=>{const g=d.value.toString();return l[g]={locations:[],value:d.value,symbol:d.symbol},l},{});for(let l=0;l<n.length;l++){const d=n[l],g=Z1(d,s,o);if(g){const p=u[g.toString()];if(p){const _=zh(d,e);p.locations.push({position:d.points,rotation:_.rotation||a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else h.push({position:d.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else h.push({position:d.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}const c=[];for(let l in u){const{locations:d,symbol:g}=u[l];d.length>0&&c.push({url:g.url,locations:d})}return h.length>0&&c.push({url:a.url,locations:h}),c}function DN(n,t,e=[]){const i=t,{classBreakInfos:r,field:s}=i,o=i.defaultSymbol,a=[],h=r.map(c=>({...c,locations:[]}));for(let c=0;c<n.length;c++){const l=n[c],d=l[s];if(d===void 0||typeof d!="number")a.push({position:l.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]});else{const g=h.findIndex(p=>d<=p.maxValue&&d>=p.minValue);if(g!==-1){const p=zh(l,e);h[g].locations.push({position:l.points,rotation:p.rotation||o.rotation||[0,0,0],scale:h[g].symbol.scale||[1,1,1]})}else a.push({position:l.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]})}}const u=[];return h.forEach(c=>{c.locations.length>0&&u.push({url:c.symbol.url,locations:c.locations})}),a.length>0&&u.push({url:o.url,locations:a}),u}class AN extends X{constructor(e,i,r,s){super();f(this,"labelingInfo");this.sceneObject=e;const o=i;if(s&&jr(o,a=>{this.renderLabel(a,s)}),r)if(r.type==="simple"){const{visualVariables:a}=r;if(r.symbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!");const h=tw(o,r);this._simplePointAllRender(h.points,h.symbol);return}if(r.symbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!");const h=tw(o,r);this._imageAllRender(h.points,h.symbol);return}if(r.symbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!");const{url:h,locations:u}=NN(o,r,a);this._modelAllRender(h,u);return}for(let h=0;h<o.length;h++){const u=Ev(o[h],r,a);this.render(o[h],u)}}else if(r.type==="unique-value"){const{visualVariables:a}=r;if(r.uniqueValueInfos.findIndex(l=>l.symbol.type!=="simple-point")===-1&&r.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),ew(o,r).forEach(({points:d,symbol:g})=>{this._simplePointAllRender(d,g)});return}if(r.uniqueValueInfos.findIndex(l=>l.symbol.type!=="ESImageLabel")===-1&&r.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),ew(o,r).forEach(({points:d,symbol:g})=>{this._imageAllRender(d,g)});return}if(r.uniqueValueInfos.findIndex(l=>l.symbol.type!=="ESGltfModel")===-1&&r.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),ON(o,r,a).forEach(({url:d,locations:g})=>{this._modelAllRender(d,g)});return}for(let l=0;l<o.length;l++){const d=Sv(o[l],r,a);this.render(o[l],d)}}else if(r.type==="class-breaks"){const{visualVariables:a}=r;if(r.classBreakInfos.findIndex(l=>l.symbol.type!=="simple-point")===-1&&r.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),iw(o,r).forEach(({points:d,symbol:g})=>{this._simplePointAllRender(d,g)});return}if(r.classBreakInfos.findIndex(l=>l.symbol.type!=="ESImageLabel")===-1&&r.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),iw(o,r).forEach(({points:d,symbol:g})=>{this._imageAllRender(d,g)});return}if(r.classBreakInfos.findIndex(l=>l.symbol.type!=="ESGltfModel")===-1&&r.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),DN(o,r,a).forEach(({url:d,locations:g})=>{this._modelAllRender(d,g)});return}for(let l=0;l<o.length;l++){const d=Cv(o[l],r,a);this.render(o[l],d)}}else if(r.type==="heatmap"){const{field:a,fieldValueMax:h,fieldValueMin:u}=r;console.time();const c=o.map(l=>{const{points:d}=l;if(a&&typeof a=="string"){let g=l[a];typeof g=="number"&&(typeof h=="number"&&g>h&&(g=h),typeof u=="number"&&g<u&&(g=u),d[2]=g)}return d});this.renderHeatmap(c,r)}else console.error("PointLayer: renderer type is not supported")}renderLabel(e,i){const{points:r}=e;wv(this.sceneObject,r,e,i)}renderHeatmap(e,i){const{is3D:r,radius:s,blur:o,gradient:a}=i,h=this.dv(new Nd);this.d(this.sceneObject.components.disposableAdd(h)),h.is3D=r,h.radius=s,h.blur=o,a&&(h.gradient={...a}),h.data=e}render(e,i){i.type==="simple-point"?this._simplePointRender(e,i):i.type==="ESImageLabel"?this._simpleImageRender(e,i):i.type==="ESGltfModel"?this._simpleModelRender(e,i):i.type==="ESTextLabel"?Q1(this.sceneObject,e.points,i):i.type==="ESParticleSystemPrimitive"?this._simpleParticleRender(e,i):console.error(" PointLayer: symbol type is not supported")}_simplePointRender(e,i){const{points:r}=e,{size:s,color:o,outlineColor:a,outlineWidth:h}=i,u=this.dv(new zl);this.d(this.sceneObject.components.disposableAdd(u)),u.pointed=!0,u.pointOutlineColor=a,u.pointOutlineWidth=h,u.pointSize=s,u.pointColor=o,u.allowPicking=(i==null?void 0:i.allowPicking)??!0,u.extras={selected:!1},u.points=[r]}_simplePointAllRender(e,i){const{size:r,color:s,outlineColor:o,outlineWidth:a}=i,h=this.dv(new zl);this.d(this.sceneObject.components.disposableAdd(h)),h.pointed=!0,h.pointOutlineColor=o,h.pointOutlineWidth=a,h.pointSize=r,h.pointColor=s,h.allowPicking=(i==null?void 0:i.allowPicking)??!0,h.points=[...e]}_simpleImageRender(e,i){const{points:r}=e,{rotation:s,offset:o,size:a,url:h,screenRender:u,anchor:c,renderMode:l,rotationType:d}=i,g=this.dv(new Pd),p=this.dv(new kh);this.d(this.sceneObject.components.disposableAdd(g)),this.d(this.sceneObject.components.disposableAdd(p)),g.url=h,g.renderMode=l??0,s&&(g.rotation=s),o&&(g.offset=o),g.size=a||[32,32],c&&(g.anchor=c),d&&(g.rotationType=d),g.screenRender=u??!0,g.allowPicking=(i==null?void 0:i.allowPicking)??!0,g.extras={selected:!1},g.position=[...r],g.sizeByContent=!1,p.allowPicking=(i==null?void 0:i.allowPicking)??!0;const _=a?Math.max(...a)+10:Math.max(...g.size)+10;p.sizeByContent=!1,p.screenRender=!0,p.size=[_,_],p.borderRadius=[_,_,_,_],p.padding=[_/2,_/2,_/2,_/2],p.borderWidth=_/10,p.offset=[0,_/10+5],p.text="",p.backgroundColor=[0,0,0,0],p.borderColor=[0,0,0,0]}_imageAllRender(e,i){const r={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:e}}]},s=this.dv(new kl);this.d(this.sceneObject.components.disposableAdd(s));const o=this.dv(new kh);this.d(this.sceneObject.components.disposableAdd(o)),s.textDefaultText="";const{offset:a,size:h,url:u,anchor:c}=i;s.imageUrl=u,c&&(s.imageAnchor=c),a&&(s.imageOffset=a),s.imageSize=h||[32,32],s.url=r,s.allowPicking=(i==null?void 0:i.allowPicking)??!0,s.extras={selected:!1},o.allowPicking=!0;const l=h?Math.max(...h)+10:Math.max(...s.imageSize)+10;o.sizeByContent=!1,o.size=[l,l],o.borderRadius=[l,l,l,l],o.padding=[l/2,l/2,l/2,l/2],o.borderWidth=l/10,o.offset=[0,l/10+5],o.text="",o.backgroundColor=[0,0,0,0],o.borderColor=[0,0,0,0]}_simpleModelRender(e,i){const{points:r}=e,{rotation:s,scale:o,url:a}=i,h=this.dv(new xo);this.d(this.sceneObject.components.disposableAdd(h)),h.url=a,s&&(h.rotation=s),o&&(h.scale=o),h.position=[...r]}_modelAllRender(e,i){const r=this.dv(new xo);this.d(this.sceneObject.components.disposableAdd(r)),r.url=e,r.instances=i}_simpleParticleRender(e,i){const{points:r}=e,s=this.dv(new bd);this.d(this.sceneObject.components.disposableAdd(s)),s.position=[...r],Object.keys(i).forEach(o=>{s[o]=i[o]})}}class RN extends X{constructor(t,e,i,r){super(),this.sceneObject=t;const s=e;if(r&&jr(s,o=>{this.renderLabel(o,r)}),i)if(i.type==="simple"){const{visualVariables:o}=i;jr(s,a=>{const h=Ev(a,i,o);this.render(a,h)})}else if(i.type==="unique-value"){const{visualVariables:o}=i;jr(s,a=>{const h=Sv(a,i,o);this.render(a,h)})}else if(i.type==="class-breaks"){const{visualVariables:o}=i;jr(s,a=>{const h=Cv(a,i,o);this.render(a,h)})}else console.error("PolyLineLayer: renderer type is not supported")}render(t,e){console.log("PolyLineLayer: render",t,e),e.type==="simple-line"?this._simpleLineRender(t,e):e.type==="ESPolygonFence"?this._esPolygonFenceRender(t,e):e.type==="ESPipeFence"?this._esPipeFenceRender(t,e):e.type==="ESPath"?this._esPathRender(t,e):e.type==="ESlineInterpolationModel"?this._eslineInterpolationModelRender(t,e):e.type==="ESlineWall"?this._eslineWallRender(t,e):console.error("PolyLineLayer: symbol type is not supported")}_simpleLineRender(t,e){const{points:i}=t;if(i.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new zs);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...i],r.stroked=!0,r.strokeColor=e.color,r.strokeWidth=e.width||1,r.allowPicking=(e==null?void 0:e.allowPicking)??!0,r.extras={selected:!1}}_esPolygonFenceRender(t,e){const{points:i}=t;if(i.length<3){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Td);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...i],r.height=e.height,r.materialMode=e.materialMode}_esPipeFenceRender(t,e){const{points:i}=t;if(i.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Md);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...i],r.height=e.height,r.width=e.width,r.materialMode=e.materialMode}_esPathRender(t,e){const{points:i}=t;if(i.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Vh),s=this.dv(new Bh);if(this.d(this.sceneObject.components.disposableAdd(r)),this.d(this.sceneObject.components.disposableAdd(s)),r.points=[...i],r.speed=e.speed,r.strokeColor=e.color,r.materialMode=e.materialMode,r.strokeWidth=e.width||1,e!=null&&e.runModel){const a=e==null?void 0:e.runSpeed,h=e==null?void 0:e.modelSymbol;let u;switch(e==null?void 0:e.runModel){case"ESHuman":u=this.dv(new ga);break;case"ESCar":u=this.dv(new Ed);break;case"ESGltfModel":u=this.dv(new xo)}if(this.d(this.sceneObject.components.disposableAdd(u)),h)for(let l in h)u[l]=h[l];const c=[0];for(var o=0;o<i.length-1;o+=1){const l=i[o],d=i[o+1],g=TN(l[1],l[0],d[1],d[0]);c.push(c[o]+Math.ceil(g/a)*1e3)}r.timeStamps=c,e!=null&&e.runSpeed&&(r.currentPositionChanged.don(l=>{r.currentPosition&&(u.position=r.currentPosition,r.currentRotation&&(u.rotation=r.currentRotation))}),s.startTime=0,s.stopTime=c[c.length-1],s.playing=!0,s.loop=(e==null?void 0:e.runLoop)??!0,s.currentTimeChanged.don(l=>{r.path.currentTime=l}))}}_eslineInterpolationModelRender(t,e){const{points:i}=t;if(i.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=(e==null?void 0:e.interpolationDistance)??0;if(!r)return;const s=IN(i,r/1e3),o=this.dv(new xo);this.d(this.sceneObject.components.disposableAdd(o)),o.url=e.url,o.instances=s.map(a=>({position:a,rotation:e.rotation,scale:e.scale}))}_eslineWallRender(t,e){const{points:i}=t;if(i.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=e.height??0,s=e.width??0,o=e.extrudedHeight??0,a=i.map(c=>({lng:(c==null?void 0:c[0])??0,lat:(c==null?void 0:c[1])??0,alt:(c==null?void 0:c[2])??0})),h=MN(a,s).map(c=>[(c==null?void 0:c.lng)??0,(c==null?void 0:c.lat)??0,(c==null?void 0:c.alt)??0]),u=this.dv(new pa);this.d(this.sceneObject.components.disposableAdd(u)),u.height=r,u.extrudedHeight=o,u.filled=e.filled??!0,u.fillColor=e.fillColor,u.allowPicking=(e==null?void 0:e.allowPicking)??!0,u.extras={selected:!1},u.points=h}renderLabel(t,e){const{points:i}=t,r=bN(i);wv(this.sceneObject,r,t,e)}}function nw(n,t){try{JSON.stringify(n[n.length-1])!==JSON.stringify(n[0])&&n.push(n[0]);const e=En(n.map(h=>ie(h))),i=he([n]);return bT(e,t,{gridType:"point",units:"meters"}).features.map(h=>h.geometry.coordinates)[0][0].filter(h=>hi(ie(h),i))}catch(e){return console.error(e),[]}}class LN extends X{constructor(t,e,i,r){super(),this.sceneObject=t;const s=e;if(r&&jr(s,o=>{this.renderLabel(o,r)}),i)if(i.type==="simple"){const{visualVariables:o}=i;jr(s,a=>{const h=Ev(a,i,o);this.render(a,h)})}else if(i.type==="unique-value"){const{visualVariables:o}=i;jr(s,a=>{const h=Sv(a,i,o);this.render(a,h)})}else if(i.type==="class-breaks"){const{visualVariables:o}=i;jr(s,a=>{const h=Cv(a,i,o);this.render(a,h)})}else console.error("PolyLineLayer: renderer type is not supported")}renderLabel(t,e){const{points:i}=t;console.log("PolygonLayer: renderLabel",i);const r=xN(i);wv(this.sceneObject,r,t,e)}render(t,e){e.type==="simple-fill"?this._simplePolygonRender(t,e):e.type==="ESGeoExtrudedPolygon"?this._esGeoExtrudedPolygonRender(t,e):e.type==="PolygonInterpolateESGltfModel"?this._polygonInterpolateESGltfModelRender(t,e):e.type==="PolygonInterpolateESImageLabel"?this._polygonInterpolateESImageLabelRender(t,e):console.error("PolyLineLayer: symbol type is not supported")}_simplePolygonRender(t,e){const{points:i}=t;if(i.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{color:r,outline:s,filled:o,ground:a}=e,{width:h,color:u,stroked:c}=s,l=this.dv(new le);this.d(this.sceneObject.components.disposableAdd(l)),l.stroked=c??!1,l.strokeColor=u??[1,1,1,1],l.strokeWidth=h??1,l.filled=o??!0,l.fillGround=a??!1,l.fillColor=r??[1,1,1,1],l.allowPicking=(e==null?void 0:e.allowPicking)??!0,l.extras={selected:!1},l.points=[...i]}_esGeoExtrudedPolygonRender(t,e){const{points:i}=t;if(i.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,extrudedHeight:s,color:o}=e,a=this.dv(new pa);this.d(this.sceneObject.components.disposableAdd(a)),a.height=r,a.extrudedHeight=s,a.filled=!0,a.fillColor=o,a.allowPicking=(e==null?void 0:e.allowPicking)??!0,a.extras={selected:!1},a.points=[...i]}_polygonInterpolateESGltfModelRender(t,e){const{points:i}=t;if(i.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,interpolateDistance:s,url:o,rotation:a,scale:h}=e,u=nw(i,s??10),c=this.dv(new xo);this.d(this.sceneObject.components.disposableAdd(c)),c.url=o,c.instances=u.map(l=>({position:[...l,r??0],rotation:a??[0,0,0],scale:h??[1,1,1]}))}_polygonInterpolateESImageLabelRender(t,e){const{points:i}=t;if(i.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,interpolateDistance:s,offset:o,size:a,url:h,anchor:u}=e,l={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:[...nw(i,s??10).map(g=>[...g,r??0])]}}]},d=this.dv(new kl);this.d(this.sceneObject.components.disposableAdd(d)),d.textDefaultText="",d.imageUrl=h,u&&(d.imageAnchor=u),o&&(d.imageOffset=o),a&&(d.imageSize=a),d.url=l}}class FN extends X{constructor(e,i){super();f(this,"_initEvent",this.dv(new N));const r=this,s=async()=>{try{const a=e.featureProps;if(!a)return;const{heightMode:h,features:u,layerType:c,url:l}=a;let d=[];if(!u&&l){let g=await fetch(l).then(p=>p.json());return g=(g==null?void 0:g.features)??g,c==="polylineVector"?d=await J1(i,g,h):c==="polygonVector"?d=await K1(i,g,h):c==="pointVector"&&(d=await $1(i,g,h)),d}else c==="polylineVector"?d=await J1(i,u,h):c==="polygonVector"?d=await K1(i,u,h):c==="pointVector"&&(d=await $1(i,u,h));return d}catch(a){console.error(a);return}},o=this.dv(je(this._initEvent,e.featurePropsChanged));r.dv(new ke(o,()=>{if(!e.featureProps)return;const a=e.featureProps;let h;return(async()=>{const{layerType:c,renderer:l,labelingInfo:d}=a,g=await s();!g||g.length===0||(c==="pointVector"?h=new AN(e,g,l,d):c==="polylineVector"?h=new RN(e,g,l,d):c==="polygonVector"&&(h=new LN(e,g,l,d)),console.log("polygonVectorLayer","createLayer",h))})().catch(console.error),{destroy:()=>{var c;(c=h==null?void 0:h.destroy)==null||c.call(h),h=void 0}}}));{const a=(h,u=1)=>{const c=E1(h);if(!c)return;const{center:l,radius:d}=c;i.flyTo({distance:d*4,heading:0,pitch:-90,flyDuration:u??1,hDelta:0,pDelta:0},l)};r.d(e.flyToEvent.don(async h=>{const{featureProps:u}=e;if(!u)return;const c=await s();if(!c)return;let l=[];u.layerType==="polylineVector"?l=c.map(d=>d.points).flat():u.layerType==="polygonVector"?l=c.map(d=>d.points).flat():u.layerType==="pointVector"&&(l=c.map(d=>d.points)),l.length!==0&&a(l,h)}))}}init(){this._initEvent.emit()}}const _u=class _u extends se{constructor(e){super(e);f(this,"featureLayerMap",new Map);const i=this;i.d(i.viewerAttached.don(r=>{if(console.log("ESFeatureLayer","viewerAttached",r.id),i.featureLayerMap.has(r.id))return;const s=new FN(i,r);s.init(),i.featureLayerMap.set(r.id,s)})),i.d(i.viewerDetached.don(r=>{var s;console.log("ESFeatureLayer","viewerDetached",r.id),i.featureLayerMap.has(r.id)&&((s=i.featureLayerMap.get(r.id))==null||s.destroy(),i.featureLayerMap.delete(r.id))})),i.d(()=>{for(const r of i.featureLayerMap.values())r.destroy();i.featureLayerMap.clear()}),i.d(Ks(i.showChanged,()=>{for(const r of i.components.values())Reflect.has(r,"show")&&(r.show=i.show)},{immediate:!0}))}};f(_u,"createDefaultProps",()=>({...se.createDefaultProps(),featureProps:de(void 0)})),f(_u,"type",_u.register("ESFeatureLayer",_u,{chsName:"矢量图层",tags:["ESObjects"],description:"ESFeatureLayer"}));let Pv=_u;const Xs=class Xs extends X{constructor(){super();f(this,"_loading",!1);f(this,"_loadedEvent",this.disposeVar(new N));f(this,"_loaded",!1);f(this,"_loadedPromiseResolve");f(this,"_loadedPromise",new Promise(e=>{this._loadedPromiseResolve=e}));f(this,"_processing",this.disposeVar(wn(async e=>{if(this._loading=!0,window.Hls)console.info("可能系统已经加载hlsjs,此处不再加载!");else{const i=ft.context.getStrFromEnv(Xs.path);await e.promise(cf(i))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})));this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return Xs._instance=Xs._instance||new Xs,Xs._instance}};f(Xs,"path","${xr-utils-script-dir}/xr-static/xr-utils/hlsjs/1.4.12/hls.min.js"),f(Xs,"_instance");let Od=Xs,kN=class extends X{constructor(e,i){super();f(this,"_element");this._complexImage=e,this._videoSrc=i;var r=document.createElement("video");r.src=this._videoSrc,r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.zIndex="-100",r.style.visibility="hidden";{const s=()=>{r.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{r.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{r.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}r.muted=!0,document.body.appendChild(r),this._element=r,this.dispose(()=>document.body.removeChild(r))}get element(){return this._element}};class GN extends X{constructor(e,i){super();f(this,"_videoDom");f(this,"_processing",this.disposeVar(wn(async e=>{const{videoSrc:i}=this,r=Od.instance();await e.promise(r.loadedPromise);const s=window.Hls,o=new s,a=this.element;await Vo(e,()=>new Promise((h,u)=>{a.xbsjHLS=o,o.attachMedia(a),o.on(s.Events.MEDIA_ATTACHED,()=>{o.loadSource(i),o.on(s.Events.MANIFEST_PARSED,(c,l)=>{a.play(),h()})}),o.on(s.Events.ERROR,(c,l)=>{const{type:d,details:g,fatal:p}=l;p&&(o.destroy(),u(g))})}))})));f(this,"_processingStartup",this._processing.start());this._complexImage=e,this._videoSrc=i,this._videoDom=this.disposeVar(new kN(this._complexImage,""))}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class rw extends X{constructor(e,i){super();f(this,"_videoDom");f(this,"_update",this.disposeVar(qa(()=>this.update())));f(this,"_updateStart",this._update.start());this._complexImage=e,this._imageUri=i,this._videoDom=this.disposeVar(new GN(this._complexImage,this._imageUri))}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:i,videoHeight:r}=this.videoElement;e.size=[i,r],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}const Ys=class Ys extends X{constructor(){super();f(this,"_loading",!1);f(this,"_loadedEvent",this.disposeVar(new N));f(this,"_loaded",!1);f(this,"_loadedPromiseResolve");f(this,"_loadedPromise",new Promise(e=>{this._loadedPromiseResolve=e}));f(this,"_processing",this.disposeVar(wn(async e=>{if(this._loading=!0,window.flvjs)console.info("可能系统已经加载flvjs,此处不再加载!");else{const i=ft.context.getStrFromEnv(Ys.path);await e.promise(cf(i))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})));this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return Ys._instance=Ys._instance||new Ys,Ys._instance}};f(Ys,"path","${xr-utils-script-dir}/xr-static/xr-utils/flvjs/1.6.2/flv.min.js"),f(Ys,"_instance");let Dd=Ys;class BN extends X{constructor(e,i){super();f(this,"_element");this._complexImage=e,this._videoSrc=i;var r=document.createElement("video");r.src=this._videoSrc,r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.zIndex="-100",r.style.visibility="hidden";{const s=()=>{r.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{r.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{r.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}r.muted=!0,document.body.appendChild(r),this._element=r,this.dispose(()=>document.body.removeChild(r))}get element(){return this._element}}class VN extends X{constructor(e,i){super();f(this,"_videoDom");f(this,"_processing",this.disposeVar(wn(async e=>{const{videoSrc:i}=this,r=Dd.instance();await e.promise(r.loadedPromise);const s=window.flvjs,o=this.element;await Vo(e,()=>new Promise((a,h)=>{if(!s.isSupported()){h("flvjs不支持!");return}var u=s.createPlayer({type:"flv",url:i});u.attachMediaElement(o),u.load(),u.play(),o.xbsjFlvPlayer=u}))})));this._complexImage=e,this._videoSrc=i,this._videoDom=this.disposeVar(new BN(this._complexImage,"")),this._processing.start()}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class sw extends X{constructor(e,i){super();f(this,"_videoDom");f(this,"_update",this.disposeVar(qa(()=>this.update())));f(this,"_updateStart",this._update.start());this._complexImage=e,this._imageUri=i,this._videoDom=this.disposeVar(new VN(e,this._imageUri))}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:i,videoHeight:r}=this.videoElement;e.size=[i,r],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}function ow(n){const t=n.substring(n.lastIndexOf(".")+1);return Ul.suffixTypes[t]}class Ul extends X{constructor(){super();f(this,"_enabled",this.disposeVar(H(!1)));f(this,"_uri",this.disposeVar(H("")));f(this,"_type",this.disposeVar(H(void 0)));f(this,"_size",this.disposeVar(ye(void 0)));f(this,"_pixelFormat",this.disposeVar(H("RGBA")));f(this,"_flipY",this.disposeVar(H(!0)));f(this,"_crossOriginReact",this.disposeVar(H("")));f(this,"_autoplayReact",this.disposeVar(H(!0)));f(this,"_loopReact",this.disposeVar(H(!0)));f(this,"_copyTextureEvent",this.disposeVar(new N));f(this,"_imageProcessingResettingEvent",this.disposeVar(je(this.enabledChanged,this.uriChanged,this.typeChanged)));f(this,"_imageProcessingResetting",this.disposeVar(new ke(this._imageProcessingResettingEvent,()=>{do{if(!this.enabled||!this.uri)break;let{type:e}=this;if(e||(e=ow(this.uri)),!e)break;if(e==="img")return new Am(this,this.uri);if(e==="video")return new Fm(this,this.uri);if(e==="gif")return new Hm(this,this.uri);if(e==="hls")return new rw(this,this.uri);if(e==="flv")return new sw(this,this.uri)}while(!1)})));f(this,"_createNativeTextureEvent",this.disposeVar(je(this.enabledChanged,this.sizeChanged,this.pixelFormatChanged,this.flipYChanged)))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get uri(){return this._uri.value}set uri(e){this._uri.value=e}get uriChanged(){return this._uri.changed}get type(){return this._type.value}set type(e){this._type.value=e}get typeChanged(){return this._type.changed}get size(){return this._size.value}set size(e){this._size.value=e}get sizeChanged(){return this._size.changed}get pixelFormat(){return this._pixelFormat.value}set pixelFormat(e){this._pixelFormat.value=e}get pixelFormatChanged(){return this._pixelFormat.changed}get flipY(){return this._flipY.value}set flipY(e){this._flipY.value=e}get flipYChanged(){return this._flipY.changed}get crossOrigin(){return this._crossOriginReact.value}set crossOrigin(e){this._crossOriginReact.value=e}get crossOriginChanged(){return this._crossOriginReact.changed}get autoplay(){return this._autoplayReact.value}set autoplay(e){this._autoplayReact.value=e}get autoplayChanged(){return this._autoplayReact.changed}get loop(){return this._loopReact.value}set loop(e){this._loopReact.value=e}get loopChanged(){return this._loopReact.changed}get copyTextureEvent(){return this._copyTextureEvent}copyTexture(e){this._createNativeTextureEvent.flush(),this._copyTextureEvent.emit(e)}get imageProcessingResetting(){return this._imageProcessingResetting}get createNativeTextureEvent(){return this._createNativeTextureEvent}copyFromCanvas(e){if(e.width<=0||e.height<=0){console.warn("canvas.width <= 0 || canvas.height <= 0");return}this.size=[e.width,e.height],this.pixelFormat="RGBA",this.copyTexture({source:e})}}f(Ul,"types",Lm),f(Ul,"czmPixelFormats",Rm),f(Ul,"suffixTypes",{png:"img",jpg:"img",svg:"img",webp:"img",gif:"gif",mp4:"video",mov:"video",webm:"video",flv:"flv",m3u8:"hls"});const zN=[0,0,0,0];class UN{constructor(){f(this,"_value",[]);f(this,"_valueStr","[]");f(this,"_valueChanged");this.value=[{ratio:0,rgba:[0,0,1,1]},{ratio:.2,rgba:[0,1,0,1]},{ratio:.8,rgba:[1,1,0,1]},{ratio:1,rgba:[1,0,0,1]}]}get valueChanged(){return this._valueChanged||(this._valueChanged=new N),this._valueChanged}set value(t){if(t.length===0){console.error("value.length === 0");return}let e;if(this._value.length===t.length){const r=[...t].sort((s,o)=>s.ratio-o.ratio);if(e=JSON.stringify(r),this._valueStr===e)return}e=e||JSON.stringify([...t].sort((r,s)=>r.ratio-s.ratio));const i=this._value;if(this._value=JSON.parse(e),this._value.length===0)throw console.error("this._colorStops.length === 0"),new Error("this._colorStops.length === 0");this._valueChanged&&this._valueChanged.emit(this._value,i)}get value(){return JSON.parse(JSON.stringify(this._value))}get valueStr(){return this._valueStr}get minRatio(){return this._value[0].ratio}get maxRatio(){return this._value[this._value.length-1].ratio}_getRatioIndex(t){if(t<this._value[0].ratio||t>this._value[this._value.length-1].ratio)throw console.error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio"),new Error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio");let e=this._value.length;for(let i=0;i<e-1;++i)if(t>=this._value[i].ratio&&t<=this._value[i+1].ratio)return i;throw console.error("shoud not be here!"),new Error("shoud not be here!")}getRatioColor(t,e){t=cc(t,this.minRatio,this.maxRatio);const i=this._getRatioIndex(t),r=this._value[i],s=this._value[i+1],o=(t-r.ratio)/(s.ratio-r.ratio);for(let a=0;a<4;++a)e[a]=r.rgba[a]*(1-o)+s.rgba[a]*o;if(e.some(Number.isNaN)){console.error("result NaN");return}return e}getColorsInUint8(t){if(t.length%4!==0)throw console.error("result.length % 4 !== 0"),new Error("result.length % 4 !== 0");const e=t.length/4,i=1/e;for(let r=0;r<e;++r){const s=zN;this.getRatioColor((r+.5)*i,s)||s.splice(0,4,0,0,0,0);for(let o=0;o<4;++o)t[r*4+o]=255*s[o]|0}return t}}class jN extends X{constructor(){super(...arguments);f(this,"registerEngines",{})}register(e,i,r){const s=this.registerEngines[e]||new Map;return s.has(i)&&console.warn(`register warn:${e}中${i}的实现类已经被注册,再次注册会覆盖。`),s.set(i,r),this.registerEngines[e]=s,i}getEngineObjConstructor(e,i){const r=this.registerEngines[i];if(!r)return;let s=e.constructor,o=e.typeName,a=r.get(o);if(a)return a;if(e.components.main)return;const h=o;for(;o!=="ESSceneObject"&&(s=s.getParentClass(),!!s);)if(o=s.type,a=r.get(o),a)return console.warn(`未找到${h}在${i}中对应的实现类! 使用父类${o}的实现类!`),a}createEngineObject(e,i){const r=this.getEngineObjConstructor(e,i.typeName);if(r){const s=new r(e,i);return s.createdEvent.emit(),s}else{const s=new va(e,i);return s.createdEvent.emit(),s}}}class qN extends X{constructor(){super(...arguments);f(this,"registerEngines",{})}register(e,i,r){const s=this.registerEngines[e]||new Map;s.has(i)&&console.warn(`register warn:${e}中${i}的实现类已经被注册,再次注册会覆盖。`),s.set(i,r),this.registerEngines[e]=s}getEngineObjConstructor(e,i){const s=(this.registerEngines[i]||new Map).get(e);if(s)return s;console.warn(`未找到${e}在${i}中对应的实现类!`)}createEngineObject(e,i){const r=this.getEngineObjConstructor(e.typeName,i.typeName);if(r){const s=new r(e,i);return s.createdEvent.emit(),s}else{const s=new va(e,i);return s.createdEvent.emit(),s}}}const lr=class lr extends X{constructor(e,i,r=!1){super();f(this,"_createdEvent",this.dv(new N));f(this,"_id",++lr._accumId);this._sceneObject=e,this._viewer=i;{if(r)return;const s=(o,a)=>{for(let h of o)this._viewer.delete(h);for(let h of a)h.parentID=this.sceneObject.id,this._viewer.add(h)};s([],this._sceneObject.components.values()),this.d(this._sceneObject.components.toChange.don(s)),this.d(()=>s(this._sceneObject.components.values(),[]))}}get createdEvent(){return this._createdEvent}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get id(){return this._id}};f(lr,"context",new jN),f(lr,"contextEditing",new qN),f(lr,"register",lr.context.register.bind(lr.context)),f(lr,"registerEditing",lr.contextEditing.register.bind(lr.contextEditing)),f(lr,"_accumId",-1);let va=lr;function aw(n){return typeof n=="string"?document.getElementById(n):n}function bv(n){if(!n)throw new Error("container is not defined");n.innerHTML="";const t=document.createElement("div");return t.style.cssText="width: 100%; height: 100%; margin: 0px; padding: 0px; border: none; overflow: hidden; position: relative; z-index: 0; background: rgba(0,0,0,0);",n.appendChild(t),t}class hw extends X{constructor(e,i){super();f(this,"_listeningSceneObjects",new Map);this._sceneObjectsMananger=e,this._createSceneObjectListeningFunc=i;const r=this._listeningSceneObjects,s=(o,a)=>{if(o)for(let h of o){const u=r.get(h);u&&(u.destroy(),r.delete(h))}if(a)for(let h of a){if(r.get(h)){console.warn(`listeningSceneObjects已存在某对象:${h.name}`,h);debugger}const c=this.createSceneObjectListeningFunc(h);c&&r.set(h,c)}};s(void 0,this._sceneObjectsMananger.sceneObjects),this.dispose(this._sceneObjectsMananger.sceneObjectsToChange.disposableOn(s)),this.dispose(()=>{for(let o of this._listeningSceneObjects.values())o.destroy();this._listeningSceneObjects.clear()})}get listeningSceneObjects(){return this._listeningSceneObjects}get createSceneObjectListeningFunc(){return this._createSceneObjectListeningFunc}}class WN extends X{constructor(t){super(),this._esObjectsManager=t;{const e=this._esObjectsManager;class i extends X{constructor(s){super(),this._esPath=s,this.dv(new ke(e.activeViewerChanged,()=>{const o=e.activeViewer;if(!o)return;class a extends X{constructor(u){if(super(),this._esPath=u,!o)throw new Error("!viewer");const c=()=>{const l=e.activeViewer;l&&(this._esPath.path.currentTime=l.simulationTime)};c(),this.d(o.simulationTimeChanged.don(c))}}return new a(this._esPath)}))}}this.dv(new hw(e.sceneObjectsManager,r=>{if(r instanceof Vh)return new i(r)}))}{const e=this._esObjectsManager;class i extends X{constructor(s){super();const o=()=>{const a=e.activeViewer;a&&(a.simulationTime=s.currentTime??0)};o(),this.d(s.currentTimeChanged.don(o))}}this.dv(new hw(e.sceneObjectsManager,r=>{if(r instanceof Bh)return new i(r)}))}}}class HN extends X{constructor(t){super(),t.forEach(e=>{this.d(e.path.currentPositionChanged.don(i=>{i&&e.sceneObjects.forEach(r=>{Reflect.has(r,"position")&&(r.position=[...i])})})),this.d(e.path.currentRotationChanged.don(i=>{i&&e.sceneObjects.forEach(r=>{Reflect.has(r,"rotation")&&(r.rotation=[...i])})}))})}}class XN extends X{constructor(e){super();f(this,"_player");f(this,"_channels",this.dv(It([])));this._objectManager=e,this._player=this._objectManager.player,this.dv(new ke(this.channelsChanged,()=>{if(this.channels.length===0)return;const i=[];for(let r=0;r<this.channels.length;r++){const s=this.channels[r],o=ft.getSceneObjById(s.pathId);if(!o||!(o instanceof Vh))continue;const h=s.sceneObjectIds.map(u=>ft.getSceneObjById(u)).filter(u=>u!==void 0);h.length!==0&&i.push({path:o,sceneObjects:h})}if(i.length!==0)return new HN(i)}))}get player(){return this._player}get channels(){return this._channels.value}get channelsChanged(){return this._channels.changed}set channels(e){this._channels.value=e}}function Ad(n){if(n.data){const{type:t,value:e}=n.data;if(t==="UITreeA"&&e instanceof Gi){const{sceneObject:i}=e;if(i)return i.id}}}function YN(n,t){const{property:e,customEventName:i,otherParams:r}=t,{dragstartDataMananger:s}=n;if(!(e instanceof Xa)){if(!(e instanceof t0)){if(e instanceof Mt){const[o,a]=ws(e.reactVar);if(i==="ondragover"){if(console.log("ondragover"),!r)throw new Error("!otherParams");const h=r[0];if(h.preventDefault(),!h.dataTransfer)return;Ad(s)?h.dataTransfer.dropEffect="move":h.dataTransfer.dropEffect="none"}else if(i==="ondrop"){if(!r)throw new Error("!otherParams");r[0].preventDefault();const u=Ad(s);u!==void 0&&a(u)}}else if(e instanceof Jm){const[o,a]=ws(e.reactVar);if(i==="ondragover"){if(console.log("ondragover"),!r)throw new Error("!otherParams");const h=r[0];if(h.preventDefault(),!h.dataTransfer)return;Ad(s)?h.dataTransfer.dropEffect="move":h.dataTransfer.dropEffect="none"}else if(i==="ondrop"){if(!r)throw new Error("!otherParams");const h=r[0].$event,u=r[0].strinsPropDom,c=r[0].index;h.preventDefault();const l=Ad(s);if(l!==void 0){u[c].firstChild.value=l;const d=new Event("input",{bubbles:!0,cancelable:!0});u[c].firstChild.dispatchEvent(d)}}}else if(e instanceof $m){const[o,a]=ws(e.reactVar)}}}}function uw(n,t,e,i){if(e)i.currentActiveEditing=[n,t];else if(i.currentActiveEditing){const[r,s]=i.currentActiveEditing;r===n&&s===t&&(e||(i.currentActiveEditing=void 0))}}const JN=["editing","positionEditing","locationEditing","pointEditing","rotationEditing"];class $N extends X{constructor(t,e){super(),this._sceneObject=t;const i=this._sceneObject;for(let r of JN){const s=r+"Changed",o=i[s];if(o){{const a=i[r];uw(i,r,a,e)}this.dispose(o.disposableOn(a=>uw(i,r,a,e)))}}}get sceneObject(){return this._sceneObject}}class KN extends X{constructor(){super();f(this,"_currentActiveEditing",this.disposeVar(ye(void 0)));f(this,"_currentActiveEditingLastChangedTime",0);this.dispose(this._currentActiveEditing.changed.disposableOn((e,i)=>{if(this._currentActiveEditingLastChangedTime=Date.now(),i){const[r,s]=i;r[s]===!0&&(r[s]=!1)}if(e){const[r,s]=e;r[s]=!0}})),ft.context.sceneObjCreatedEvent.don(e=>{e.dv(new $N(e,this))})}get currentActiveEditing(){return this._currentActiveEditing.value}set currentActiveEditing(e){this._currentActiveEditing.value=e}get currentActiveEditingChanged(){return this._currentActiveEditing.changed}get currentActiveEditingLastChangedTime(){return this._currentActiveEditingLastChangedTime}}class QN extends X{constructor(){super();f(this,"_sceneObjects",new Set);f(this,"_sceneObjectsToChange",this.dv(new N));this.d(()=>{const e=hf(this._sceneObjects);e!==0&&console.warn(`场景对象管理器销毁时仍然管理着${e}个场景对象!`)})}get sceneObjects(){return this._sceneObjects}get sceneObjectsToChange(){return this._sceneObjectsToChange}addSceneObject(e){return this._sceneObjects.has(e)?(console.warn(`创建失败:对象${e.typeName+":"+e.id}已经存在于场景对象管理器中!}`),!1):(this._sceneObjectsToChange.emit([],[e]),this._sceneObjects.add(e),!0)}deleteSceneObject(e){return this._sceneObjects.has(e)?(this._sceneObjectsToChange.emit([e],[]),this._sceneObjects.delete(e),!0):(console.warn(`删除失败:对象${e.typeName+":"+e.id}不存在于场景对象管理器中!}`),!1)}createSceneObject(e,i){const r=ft.context.createSceneObject(e,i);return r&&this.addSceneObject(r),r}createSceneObjectFromUrl(e,i){const r=ft.context.createSceneObjectFromUrl(e,i);return r&&this.addSceneObject(r),r}createSceneObjectFromClass(e,i){const r=ft.context.createSceneObjectFromClass(e,i);return r&&this.addSceneObject(r),r}createSceneObjectFromJson(e){const i=ft.context.createSceneObjectFromJson(e);return i&&this.addSceneObject(i),i}}class ZN extends X{constructor(e){super();f(this,"_enabled",this.dv(H(!1)));f(this,"_cursorPosition",H(void 0));f(this,"quickPickPosition",!0);let i=new X;const r=()=>{i&&(i.destroy(),i=void 0)};this.d(r);const s=()=>{if(r(),!e||!this._enabled.value)return;i=new X;const o=i.dv(H(void 0)),a=i.dv(je(o.changed));i.d(e.pointerMoveEvent.don(u=>{u.pointerEvent&&(o.value=xi(u.pointerEvent))}));const h=i.dv(wn(async u=>{if(o.value)if(this.quickPickPosition){const c=await u.promise(ja(e.quickPickPosition(o.value)));this._cursorPosition.value=c}else{const c=await u.promise(ja(e.pickPosition(o.value)));this._cursorPosition.value=c}}));i.d(a.don(()=>{h.restart()}))};s(),this.d(this._enabled.changed.don(s))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}class tO extends X{constructor(e){super();f(this,"cursorPositionInfo");this.viewer=e,this.cursorPositionInfo=this.dv(new ZN(this.viewer))}}class eO extends X{constructor(e){super();f(this,"viewer");const i=this.viewer=e;this.ad(new ke(i.rollerShutterChanged,()=>{const r=i.container;if(!r||!i.rollerShutter)return;const s=new X;this.viewer.splitPosition=.5;let o=this.getRollerShutterDIV();return r.appendChild(o),s.d(()=>{this.viewer.splitPosition=0,r.removeChild(o)}),s}))}getRollerShutterDIV(){let e=document.createElement("div");e.style.position="absolute",e.style.left="50%",e.style.top="0",e.style.backgroundColor="#d3d3d3",e.style.width="5px",e.style.height="100%",e.style.zIndex="9999";const i=r=>{if(!e.parentElement)return;r.preventDefault?r.preventDefault():r.returnValue=!1;const o=r.x/e.parentElement.offsetWidth;e.style.left=`${100*o}%`,this.viewer.splitPosition=o};return e.addEventListener("mouseenter",r=>{e.style.cursor="ew-resize"}),e.addEventListener("mouseleave",r=>{e.style.cursor="default"}),e.addEventListener("mousedown",r=>{e.style.cursor="ew-resize",document.addEventListener("mousemove",i)}),document.addEventListener("mouseup",r=>{e.style.cursor="default",document.removeEventListener("mousemove",i)}),e}}class iO extends X{constructor(e){super();f(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new eO(e))}}function lw(n,t){return n.length===t.length&&n.every((e,i)=>e===t[i])}class nO extends X{constructor(t){super(),this._viewer=t,this.d(Y([this._viewer,"currentTime"],[this._viewer,"simulationTime"]))}}class rO extends X{constructor(t,e){super(),this._viewer=t,this._activeViewer=e;const i=Or.createCommonProps(),r=[];Object.keys(i).forEach(h=>{const u=this._activeViewer[h+"Changed"];r.push(u)});const s=this.dv(je(...r)),o=()=>{this._viewer.status!=="Created"||this._activeViewer.status!=="Created"||Object.keys(i).forEach(h=>{this._viewer[h]=this._activeViewer[h]})};this.d(s.don(o));const a=this.dv(Tu());a.restart(void 0,async()=>{if(this._viewer.status!=="Created"||this._activeViewer.status!=="Created")return;const h=this._activeViewer.getCurrentCameraInfo(),u=this._viewer.getCurrentCameraInfo();if(!h)return;const{position:c,rotation:l}=h;u&&lw(c,u.position)&&lw(l,u.rotation)||this._viewer.flyIn(c,l,0)}),this.d(()=>a.cancel())}}const sO=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="40" height="40" style="shape-rendering: auto; display: block; background: rgba(255, 255, 255, 0);" xmlns:xlink="http://www.w3.org/1999/xlink"><g><circle stroke-linecap="round" fill="none" stroke-dasharray="50.26548245743669 50.26548245743669" stroke="#ffffff" stroke-width="8" r="32" cy="50" cx="50">
490
+ `,Vl=Date.now();new Date(Vl).toISOString(),new Date(Vl+864e5).toISOString();const zr=class zr extends ft{constructor(e){super(e);f(this,"_flyToEvent",this.disposeVar(new N));f(this,"_resetClockEvent",this.disposeVar(new N))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new gt([this,"data"],"数据",zr.defaults.data,CN,!0),new gt([this,"uri"],"路径","${earthsdk3-assets-script-dir}/assets/misc/simple.czml",void 0,!0),new rt([this,"clockEnabled"],"启用",!1),new F([this,"multiplier"],"倍速",zr.defaults.multiplier),new rt([this,"autoResetClock"],"自动设置时钟",!0),new qo([this,"startTime"],"开始时间",zr.defaults.startTime,!0),new qo([this,"stopTime"],"结束时间",zr.defaults.stopTime,!0),new qo([this,"currentTime"],"当前时间",zr.defaults.currentTime,!0),new kt([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep","SYSTEM_CLOCK_MULTIPLIER"),new kt([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange","UNBOUNDED"),new rt([this,"shouldAnimate"],"是否启用动画",!1)],general:[...e.general,new rt([this,"show"],"是否显示",!0),new rt([this,"collision"],"开启碰撞",!1),new rt([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new St(["number"],i=>this.flyTo(i),[1e3],"飞入"),new St([],()=>this.resetClock(),[],"重设时钟"),new eo([this,"loadFuncStr"],"loadFnStr",Y1,PN,!0)]}}};f(zr,"createDefaultProps",()=>({show:!0,uri:void 0,allowPicking:!1,data:de(SN),autoResetClock:!0,clockEnabled:!1,startTime:Vl,stopTime:Vl+864e5,currentTime:Vl,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...ft.createDefaultProps()})),f(zr,"type",zr.register("ESCzml",zr,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"}));let fv=zr;const pu=class pu extends ft{getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new Et([]),new rt([this,"show"],"是否显示"),new F([this,"cssSize"],"尺寸"),new ti([this,"cssPosition"],"位置"),new Lu([this,"imgUrl"],"图片地址")]}}};f(pu,"createDefaultProps",()=>({...ft.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:ft.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")})),f(pu,"type",pu.register("ESNavigator",pu,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"}));let gv=pu;const vs=class vs extends ft{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new Et([],"通用","通用"),new rt([this,"show"],"是否显示",vs.defaults.show),new F([this,"height"],"高度",vs.defaults.height,!0),new F([this,"fontSize"],"文字大小",vs.defaults.fontSize,!0),new Ut([this,"bgColor"],"背景颜色",vs.defaults.bgColor,!0)]}}};f(vs,"createDefaultProps",()=>({...ft.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:It([.2784313725490196,.2784313725490196,.2784313725490196,.8])})),f(vs,"type",vs.register("ESViewerStatusBar",vs,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let pv=vs;const ms=class ms extends ft{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new Et([],"通用","通用"),new rt([this,"show"],"是否显示",ms.defaults.show),new F([this,"height"],"高度",ms.defaults.height,!0),new F([this,"fontSize"],"文字大小",ms.defaults.fontSize,!0),new Ut([this,"bgColor"],"背景颜色",ms.defaults.bgColor,!0)]}}};f(ms,"createDefaultProps",()=>({...ft.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:It([.2784313725490196,.2784313725490196,.2784313725490196,.8])})),f(ms,"type",ms.register("ESViewerStatusBarScale",ms,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let vv=ms;const vu=class vu extends _t{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Mt([this,"url"],"路径","",!0),new F([this,"progress"],"进度",0,!1,!0)]}}};f(vu,"createDefaultProps",()=>({..._t.createDefaultProps(),url:"",progress:0})),f(vu,"type",vu.register("ESGaussianSplatting",vu,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"}));let mv=vu;const Oa=class Oa extends _t{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Mt([this,"mesh"],"mesh地址",Oa.defaults.mesh)]}}};f(Oa,"createDefaultProps",()=>({..._t.createDefaultProps(),mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"})),f(Oa,"type",Oa.register("ESStaticMesh",Oa,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"}));let _v=Oa;const mu=class mu extends jt{constructor(e){super(e);f(this,"_startEvent",this.dv(new N));f(this,"_clearEvent",this.dv(new N));f(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new pa),this.ad(this.components.disposableAdd(this._eSGeoExtrudedPolygon)),this.eSGeoExtrudedPolygon.perPositionHeight=!0,this.eSGeoExtrudedPolygon.extrudedHeight=0,this.stroked=!0,this.strokeWidth=2,this.strokeColor=[1,0,0,1],this.ad(Y([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(Y([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(Y([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(Y([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(Y([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(Y([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(Y([this.eSGeoExtrudedPolygon,"points"],[this,"points"])),this.ad(this.clearEvent.don(()=>{this.points=void 0,this.depths=void 0,this.windowPositions=void 0}))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get eSGeoExtrudedPolygon(){return this._eSGeoExtrudedPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new St([],()=>this.start(),[],"开始分析"),new St([],()=>this.clear(),[],"清除分析"),new gt([this,"windowPositions"],"屏幕坐标",[],void 0,!1,!0),new gt([this,"depths"],"深度值",[],void 0,!1,!0),new F([this,"radius"],"半径",1e4,!0)]}}};f(mu,"createDefaultProps",()=>({...jt.createDefaultProps(),windowPositions:op([]),depths:ye([]),radius:H(1e4)})),f(mu,"type",mu.register("ESSkylineAnalysis",mu,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"}));let yv=mu;const Hs=class Hs extends se{constructor(t){super(t)}getESProperties(){const t=super.getESProperties();return{...t,basic:[...t.basic,new gt([this,"data"],"数据",[],void 0,!0),new gt([this,"gradient"],"渐变",Hs.defaults.gradient,void 0,!0),new F([this,"radius"],"半径",Hs.defaults.radius,void 0,!0),new F([this,"blur"],"模糊",Hs.defaults.blur,!0),new rt([this,"is3D"],"is3D",!1,!0)]}}};f(Hs,"createDefaultProps",()=>({...se.createDefaultProps(),is3D:H(!1),data:ic([]),gradient:de({".5":"green",".7":"yellow",".95":"red"}),radius:H(10),blur:H(.85)})),f(Hs,"type",Hs.register("ESHeatMap",Hs,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"}));let Nd=Hs;const Da=class Da extends jt{constructor(e){super(e);f(this,"editingBindMode","scatter")}};f(Da,"createDefaultProps",()=>({...jt.createDefaultProps(),pointed:!0})),f(Da,"type",Da.register("ESGeoPoints",Da,{chsName:"地理点集合",tags:["ESObjects","_ES_Impl_Cesium"],description:"地图中的可视化地理点集合"})),f(Da,"supportEditingModes",[...jt.supportEditingModes,pt.ScatterAppend,pt.ScatterModify]);let zl=Da;const J1=async(n,t=[],e)=>{const i=[];for(const r of t){const{coordinates:s}=r.geometry;for(const o of s){const a=await Promise.all(o.map(async h=>{let u=h[2]??0;if(e)if(e.type==="absolute")u=e.height??u;else if(e.type==="relative"){const c=await n.getTerrainHeight([h[0],h[1]])??0;u=(e.height??u)+c}else e.type==="terrain"&&(u=await n.getTerrainHeight([h[0],h[1]])??0);return[h[0],h[1],u]}));i.push({...r,points:a})}}return i},$1=async(n,t=[],e)=>await Promise.all(t.map(async i=>{var h,u,c,l,d,g,p,_,w;const r=((h=i.geometry)==null?void 0:h.x)??((c=(u=i.geometry)==null?void 0:u.coordinates)==null?void 0:c[0]),s=((l=i.geometry)==null?void 0:l.y)??((g=(d=i.geometry)==null?void 0:d.coordinates)==null?void 0:g[1]);let a=((p=i.geometry)==null?void 0:p.z)??((w=(_=i.geometry)==null?void 0:_.coordinates)==null?void 0:w[2])??0;if(e)if(e.type==="absolute")a=e.height??a;else if(e.type==="relative"){const P=await n.getTerrainHeight([r,s])??0;a=(e.height??a)+P}else e.type==="terrain"&&(a=await n.getTerrainHeight([r,s])??0);return{...i,points:[r,s,a]}})),K1=async(n,t=[],e)=>{const i=[];return await Promise.all(t.map(async r=>{const{coordinates:s}=r.geometry;await Promise.all(s.map(async o=>{const a=await Promise.all(o.map(async h=>{let u=h[2]??0;if(e)if(e.type==="absolute")u=e.height??u;else if(e.type==="relative"){const c=await n.getTerrainHeight([h[0],h[1]])??0;u=(e.height??u)+c}else e.type==="terrain"&&(u=await n.getTerrainHeight([h[0],h[1]])??0);return[h[0],h[1],u]}));i.push({...r,points:a})}))})),i};function bN(n){const t=an(n),e=F_(t),i=mg(t,e/2);return[i.geometry.coordinates[0],i.geometry.coordinates[1],i.geometry.coordinates[2]||0]}function IN(n,t){const e=an(n),i=F_(e),r=Math.floor(i/t),s=[];if(s.push(n[0]),r<1)return[n[0]];for(let o=1;o<r;o+=1){const a=mg(e,i*(o/r));s.push([a.geometry.coordinates[0],a.geometry.coordinates[1],a.geometry.coordinates[2]||0])}return s}function xN(n){const t=[...n];JSON.stringify(n[0])!==JSON.stringify(n[n.length-1])&&t.push(n[0]);const e=he([t]),i=E_(e);return[i.geometry.coordinates[0],i.geometry.coordinates[1],i.geometry.coordinates[2]||0]}function Q1(n,t,e){const i=n.dv(new kh);for(const r in e)r!=="type"&&(i[r]=e[r]);i.position=t,n.d(n.components.disposableAdd(i))}function wv(n,t,e,i){let r=i.textTemplate||i.symbol.text||"";const s=/{{(.*?)}}/;for(;s.test(r);){const c=r.match(s);if(c){const l=c[1].trim(),d=e[`${l}`]||"-";r=r.replace(c[0],d)}}let o=i.symbol;const{minVisibleDistance:a,maxVisibleDistance:h}=i;a&&h&&(o={...o,minVisibleDistance:a,maxVisibleDistance:h});const u={...o,text:r};Q1(n,t,u)}function zh(n,t){const e={width:null,height:null,color:null,opacity:null,rotation:null};return t.forEach(i=>{i.type==="size"?i.axis==="width"?e.width=n[i.field]||null:i.axis==="height"&&(e.height=n[i.field]||null):i.type==="color"?e.color=n[i.field]||null:i.type==="opacity"?e.opacity=n[i.field]||null:i.type==="rotation"&&(e.rotation=n[i.field]||null)}),e}function Ev(n,t,e){const r={...t.symbol};if(e&&e.length>0){const s=zh(n,e);for(let o in s)r[o]!==void 0&&s[o]!==null&&(r[o]=s[o])}return r}function Sv(n,t,e){var u,c;const i=t,{uniqueValueInfos:r,field:s,fieldDelimiter:o,defaultSymbol:a}=i;let h={...a};if(Array.isArray(s)){const d=s.map(g=>n[g]??"").join(o);h=((u=r.find(g=>g.value==d))==null?void 0:u.symbol)||a}else h=((c=r.find(l=>l.value==n[s]))==null?void 0:c.symbol)||a;if(e&&e.length>0){const l=zh(n,e);for(let d in l)h[d]!==void 0&&l[d]!==null&&(h[d]=l[d])}return h}function Cv(n,t,e){const i=t,{classBreakInfos:r,field:s,defaultSymbol:o}=i;let a=o;const h=n[s];if(h===void 0||typeof h!="number")a=o;else{const u=r.find(c=>h<=c.maxValue&&h>=c.minValue);u?a=u.symbol:a=o}if(e&&e.length>0){const u=zh(n,e);for(let c in u)a[c]!==void 0&&u[c]!==null&&(a[c]=u[c])}return a}function MN(n,t){function e(u,c,l,d){const g=S=>S*Math.PI/180,p=S=>S*180/Math.PI,_=g(u),w=g(l),P=g(d-c),v=Math.sin(P)*Math.cos(w),E=Math.cos(_)*Math.sin(w)-Math.sin(_)*Math.cos(w)*Math.cos(P),m=Math.atan2(v,E);return(p(m)+360)%360}function i(u,c,l,d,g){const _=b=>b*Math.PI/180,w=b=>b*180/Math.PI,P=d/6371e3,v=_(g),E=_(u),m=_(c),S=Math.asin(Math.sin(E)*Math.cos(P)+Math.cos(E)*Math.sin(P)*Math.cos(v)),C=m+Math.atan2(Math.sin(v)*Math.sin(P)*Math.cos(E),Math.cos(P)-Math.sin(E)*Math.sin(S));return{lat:w(S),lng:w(C),alt:l}}function r(u){const c=[];u.length>1&&c.push(e(u[0].lat,u[0].lng,u[1].lat,u[1].lng));for(let l=1;l<u.length-1;l++){const d=e(u[l-1].lat,u[l-1].lng,u[l].lat,u[l].lng),g=e(u[l].lat,u[l].lng,u[l+1].lat,u[l+1].lng);let p=(d+g)/2;Math.abs(d-g)>180&&(p=(p+180)%360),c.push(p)}return u.length>1&&c.push(e(u[u.length-2].lat,u[u.length-2].lng,u[u.length-1].lat,u[u.length-1].lng)),u.length===1&&c.push(0),c}if(!n||n.length<2)throw new Error("至少需要两个点才能生成路径");if(t<=0)throw new Error("宽度必须大于0");const s=t/2,o=r(n),a=[],h=[];for(let u=0;u<n.length;u++){const c=(o[u]+90)%360,l=(o[u]+270)%360,d=n[u].alt!==void 0?n[u].alt:0;a.push(i(n[u].lat,n[u].lng,d,s,c)),h.push(i(n[u].lat,n[u].lng,d,s,l))}return a.concat(h.reverse())}function TN(n,t,e,i){function r(_){return _*(Math.PI/180)}const s=6378137,o=r(n),a=r(t),h=r(e),u=r(i),c=h-o,l=u-a,d=Math.sin(c/2)**2+Math.cos(o)*Math.cos(h)*Math.sin(l/2)**2,g=2*Math.atan2(Math.sqrt(d),Math.sqrt(1-d));return s*g}const Z1=(n,t,e)=>Array.isArray(t)?t.map(s=>n[s]??"").join(e):n[t]??"";function tw(n,t){const i={...t.symbol};return{points:n.map(r=>r.points),symbol:i}}function ew(n,t){const e=t,{uniqueValueInfos:i,field:r,fieldDelimiter:s,defaultSymbol:o}=e,a=[],h=i.reduce((c,l)=>{const d=l.value.toString();return c[d]={points:[],value:l.value,symbol:l.symbol},c},{});for(let c=0;c<n.length;c++){const l=n[c],d=Z1(l,r,s);if(d!==void 0&&d!==""){const g=h[d.toString()];g?g.points.push(l.points):a.push(l.points)}else a.push(l.points)}const u=[];for(let c in h){const{points:l,symbol:d}=h[c];l.length>0&&u.push({points:l,symbol:d})}return a.length>0&&u.push({points:a,symbol:o}),u}function iw(n,t){const e=t,{classBreakInfos:i,field:r,defaultSymbol:s}=e,o=[],a=i.map(u=>({...u,points:[]}));for(let u=0;u<n.length;u++){const c=n[u],l=c[r];if(l===void 0||typeof l!="number")o.push(c.points);else{const d=a.findIndex(g=>l<=g.maxValue&&l>=g.minValue);d!==-1?a[d].points.push(c.points):o.push(c.points)}}const h=[];return a.forEach(u=>{u.points.length>0&&h.push({points:u.points,symbol:u.symbol})}),o.length>0&&h.push({points:o,symbol:s}),h}function NN(n,t,e=[]){const r={...t.symbol},s=n.map(o=>{const a=zh(o,e);return{position:o.points,rotation:a.rotation||r.rotation||[0,0,0],scale:r.scale||[1,1,1]}});return{url:r.url,locations:s}}function ON(n,t,e=[]){const i=t,{uniqueValueInfos:r,field:s,fieldDelimiter:o}=i,a=i.defaultSymbol,h=[],u=r.reduce((l,d)=>{const g=d.value.toString();return l[g]={locations:[],value:d.value,symbol:d.symbol},l},{});for(let l=0;l<n.length;l++){const d=n[l],g=Z1(d,s,o);if(g){const p=u[g.toString()];if(p){const _=zh(d,e);p.locations.push({position:d.points,rotation:_.rotation||a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else h.push({position:d.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else h.push({position:d.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}const c=[];for(let l in u){const{locations:d,symbol:g}=u[l];d.length>0&&c.push({url:g.url,locations:d})}return h.length>0&&c.push({url:a.url,locations:h}),c}function DN(n,t,e=[]){const i=t,{classBreakInfos:r,field:s}=i,o=i.defaultSymbol,a=[],h=r.map(c=>({...c,locations:[]}));for(let c=0;c<n.length;c++){const l=n[c],d=l[s];if(d===void 0||typeof d!="number")a.push({position:l.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]});else{const g=h.findIndex(p=>d<=p.maxValue&&d>=p.minValue);if(g!==-1){const p=zh(l,e);h[g].locations.push({position:l.points,rotation:p.rotation||o.rotation||[0,0,0],scale:h[g].symbol.scale||[1,1,1]})}else a.push({position:l.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]})}}const u=[];return h.forEach(c=>{c.locations.length>0&&u.push({url:c.symbol.url,locations:c.locations})}),a.length>0&&u.push({url:o.url,locations:a}),u}class AN extends X{constructor(e,i,r,s){super();f(this,"labelingInfo");this.sceneObject=e;const o=i;if(s&&jr(o,a=>{this.renderLabel(a,s)}),r)if(r.type==="simple"){const{visualVariables:a}=r;if(r.symbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!");const h=tw(o,r);this._simplePointAllRender(h.points,h.symbol);return}if(r.symbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!");const h=tw(o,r);this._imageAllRender(h.points,h.symbol);return}if(r.symbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!");const{url:h,locations:u}=NN(o,r,a);this._modelAllRender(h,u);return}for(let h=0;h<o.length;h++){const u=Ev(o[h],r,a);this.render(o[h],u)}}else if(r.type==="unique-value"){const{visualVariables:a}=r;if(r.uniqueValueInfos.findIndex(l=>l.symbol.type!=="simple-point")===-1&&r.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),ew(o,r).forEach(({points:d,symbol:g})=>{this._simplePointAllRender(d,g)});return}if(r.uniqueValueInfos.findIndex(l=>l.symbol.type!=="ESImageLabel")===-1&&r.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),ew(o,r).forEach(({points:d,symbol:g})=>{this._imageAllRender(d,g)});return}if(r.uniqueValueInfos.findIndex(l=>l.symbol.type!=="ESGltfModel")===-1&&r.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),ON(o,r,a).forEach(({url:d,locations:g})=>{this._modelAllRender(d,g)});return}for(let l=0;l<o.length;l++){const d=Sv(o[l],r,a);this.render(o[l],d)}}else if(r.type==="class-breaks"){const{visualVariables:a}=r;if(r.classBreakInfos.findIndex(l=>l.symbol.type!=="simple-point")===-1&&r.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),iw(o,r).forEach(({points:d,symbol:g})=>{this._simplePointAllRender(d,g)});return}if(r.classBreakInfos.findIndex(l=>l.symbol.type!=="ESImageLabel")===-1&&r.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),iw(o,r).forEach(({points:d,symbol:g})=>{this._imageAllRender(d,g)});return}if(r.classBreakInfos.findIndex(l=>l.symbol.type!=="ESGltfModel")===-1&&r.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),DN(o,r,a).forEach(({url:d,locations:g})=>{this._modelAllRender(d,g)});return}for(let l=0;l<o.length;l++){const d=Cv(o[l],r,a);this.render(o[l],d)}}else if(r.type==="heatmap"){const{field:a,fieldValueMax:h,fieldValueMin:u}=r;console.time();const c=o.map(l=>{const{points:d}=l;if(a&&typeof a=="string"){let g=l[a];typeof g=="number"&&(typeof h=="number"&&g>h&&(g=h),typeof u=="number"&&g<u&&(g=u),d[2]=g)}return d});this.renderHeatmap(c,r)}else console.error("PointLayer: renderer type is not supported")}renderLabel(e,i){const{points:r}=e;wv(this.sceneObject,r,e,i)}renderHeatmap(e,i){const{is3D:r,radius:s,blur:o,gradient:a}=i,h=this.dv(new Nd);this.d(this.sceneObject.components.disposableAdd(h)),h.is3D=r,h.radius=s,h.blur=o,a&&(h.gradient={...a}),h.data=e}render(e,i){i.type==="simple-point"?this._simplePointRender(e,i):i.type==="ESImageLabel"?this._simpleImageRender(e,i):i.type==="ESGltfModel"?this._simpleModelRender(e,i):i.type==="ESTextLabel"?Q1(this.sceneObject,e.points,i):i.type==="ESParticleSystemPrimitive"?this._simpleParticleRender(e,i):console.error(" PointLayer: symbol type is not supported")}_simplePointRender(e,i){const{points:r}=e,{size:s,color:o,outlineColor:a,outlineWidth:h}=i,u=this.dv(new zl);this.d(this.sceneObject.components.disposableAdd(u)),u.pointed=!0,u.pointOutlineColor=a,u.pointOutlineWidth=h,u.pointSize=s,u.pointColor=o,u.allowPicking=(i==null?void 0:i.allowPicking)??!0,u.extras={selected:!1},u.points=[r]}_simplePointAllRender(e,i){const{size:r,color:s,outlineColor:o,outlineWidth:a}=i,h=this.dv(new zl);this.d(this.sceneObject.components.disposableAdd(h)),h.pointed=!0,h.pointOutlineColor=o,h.pointOutlineWidth=a,h.pointSize=r,h.pointColor=s,h.allowPicking=(i==null?void 0:i.allowPicking)??!0,h.points=[...e]}_simpleImageRender(e,i){const{points:r}=e,{rotation:s,offset:o,size:a,url:h,screenRender:u,anchor:c,renderMode:l,rotationType:d}=i,g=this.dv(new Pd),p=this.dv(new kh);this.d(this.sceneObject.components.disposableAdd(g)),this.d(this.sceneObject.components.disposableAdd(p)),g.url=h,g.renderMode=l??0,s&&(g.rotation=s),o&&(g.offset=o),g.size=a||[32,32],c&&(g.anchor=c),d&&(g.rotationType=d),g.screenRender=u??!0,g.allowPicking=(i==null?void 0:i.allowPicking)??!0,g.extras={selected:!1},g.position=[...r],g.sizeByContent=!1,p.allowPicking=(i==null?void 0:i.allowPicking)??!0;const _=a?Math.max(...a)+10:Math.max(...g.size)+10;p.sizeByContent=!1,p.screenRender=!0,p.size=[_,_],p.borderRadius=[_,_,_,_],p.padding=[_/2,_/2,_/2,_/2],p.borderWidth=_/10,p.offset=[0,_/10+5],p.text="",p.backgroundColor=[0,0,0,0],p.borderColor=[0,0,0,0]}_imageAllRender(e,i){const r={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:e}}]},s=this.dv(new kl);this.d(this.sceneObject.components.disposableAdd(s));const o=this.dv(new kh);this.d(this.sceneObject.components.disposableAdd(o)),s.textDefaultText="";const{offset:a,size:h,url:u,anchor:c}=i;s.imageUrl=u,c&&(s.imageAnchor=c),a&&(s.imageOffset=a),s.imageSize=h||[32,32],s.url=r,s.allowPicking=(i==null?void 0:i.allowPicking)??!0,s.extras={selected:!1},o.allowPicking=!0;const l=h?Math.max(...h)+10:Math.max(...s.imageSize)+10;o.sizeByContent=!1,o.size=[l,l],o.borderRadius=[l,l,l,l],o.padding=[l/2,l/2,l/2,l/2],o.borderWidth=l/10,o.offset=[0,l/10+5],o.text="",o.backgroundColor=[0,0,0,0],o.borderColor=[0,0,0,0]}_simpleModelRender(e,i){const{points:r}=e,{rotation:s,scale:o,url:a}=i,h=this.dv(new xo);this.d(this.sceneObject.components.disposableAdd(h)),h.url=a,s&&(h.rotation=s),o&&(h.scale=o),h.position=[...r]}_modelAllRender(e,i){const r=this.dv(new xo);this.d(this.sceneObject.components.disposableAdd(r)),r.url=e,r.instances=i}_simpleParticleRender(e,i){const{points:r}=e,s=this.dv(new bd);this.d(this.sceneObject.components.disposableAdd(s)),s.position=[...r],Object.keys(i).forEach(o=>{s[o]=i[o]})}}class RN extends X{constructor(t,e,i,r){super(),this.sceneObject=t;const s=e;if(r&&jr(s,o=>{this.renderLabel(o,r)}),i)if(i.type==="simple"){const{visualVariables:o}=i;jr(s,a=>{const h=Ev(a,i,o);this.render(a,h)})}else if(i.type==="unique-value"){const{visualVariables:o}=i;jr(s,a=>{const h=Sv(a,i,o);this.render(a,h)})}else if(i.type==="class-breaks"){const{visualVariables:o}=i;jr(s,a=>{const h=Cv(a,i,o);this.render(a,h)})}else console.error("PolyLineLayer: renderer type is not supported")}render(t,e){console.log("PolyLineLayer: render",t,e),e.type==="simple-line"?this._simpleLineRender(t,e):e.type==="ESPolygonFence"?this._esPolygonFenceRender(t,e):e.type==="ESPipeFence"?this._esPipeFenceRender(t,e):e.type==="ESPath"?this._esPathRender(t,e):e.type==="ESlineInterpolationModel"?this._eslineInterpolationModelRender(t,e):e.type==="ESlineWall"?this._eslineWallRender(t,e):console.error("PolyLineLayer: symbol type is not supported")}_simpleLineRender(t,e){const{points:i}=t;if(i.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new zs);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...i],r.stroked=!0,r.strokeColor=e.color,r.strokeWidth=e.width||1,r.allowPicking=(e==null?void 0:e.allowPicking)??!0,r.extras={selected:!1}}_esPolygonFenceRender(t,e){const{points:i}=t;if(i.length<3){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Td);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...i],r.height=e.height,r.materialMode=e.materialMode}_esPipeFenceRender(t,e){const{points:i}=t;if(i.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Md);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...i],r.height=e.height,r.width=e.width,r.materialMode=e.materialMode}_esPathRender(t,e){const{points:i}=t;if(i.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Vh),s=this.dv(new Bh);if(this.d(this.sceneObject.components.disposableAdd(r)),this.d(this.sceneObject.components.disposableAdd(s)),r.points=[...i],r.speed=e.speed,r.strokeColor=e.color,r.materialMode=e.materialMode,r.strokeWidth=e.width||1,e!=null&&e.runModel){const a=e==null?void 0:e.runSpeed,h=e==null?void 0:e.modelSymbol;let u;switch(e==null?void 0:e.runModel){case"ESHuman":u=this.dv(new ga);break;case"ESCar":u=this.dv(new Ed);break;case"ESGltfModel":u=this.dv(new xo)}if(this.d(this.sceneObject.components.disposableAdd(u)),h)for(let l in h)u[l]=h[l];const c=[0];for(var o=0;o<i.length-1;o+=1){const l=i[o],d=i[o+1],g=TN(l[1],l[0],d[1],d[0]);c.push(c[o]+Math.ceil(g/a)*1e3)}r.timeStamps=c,e!=null&&e.runSpeed&&(r.currentPositionChanged.don(l=>{r.currentPosition&&(u.position=r.currentPosition,r.currentRotation&&(u.rotation=r.currentRotation))}),s.startTime=0,s.stopTime=c[c.length-1],s.playing=!0,s.loop=(e==null?void 0:e.runLoop)??!0,s.currentTimeChanged.don(l=>{r.path.currentTime=l}))}}_eslineInterpolationModelRender(t,e){const{points:i}=t;if(i.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=(e==null?void 0:e.interpolationDistance)??0;if(!r)return;const s=IN(i,r/1e3),o=this.dv(new xo);this.d(this.sceneObject.components.disposableAdd(o)),o.url=e.url,o.instances=s.map(a=>({position:a,rotation:e.rotation,scale:e.scale}))}_eslineWallRender(t,e){const{points:i}=t;if(i.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=e.height??0,s=e.width??0,o=e.extrudedHeight??0,a=i.map(c=>({lng:(c==null?void 0:c[0])??0,lat:(c==null?void 0:c[1])??0,alt:(c==null?void 0:c[2])??0})),h=MN(a,s).map(c=>[(c==null?void 0:c.lng)??0,(c==null?void 0:c.lat)??0,(c==null?void 0:c.alt)??0]),u=this.dv(new pa);this.d(this.sceneObject.components.disposableAdd(u)),u.height=r,u.extrudedHeight=o,u.filled=e.filled??!0,u.fillColor=e.fillColor,u.allowPicking=(e==null?void 0:e.allowPicking)??!0,u.extras={selected:!1},u.points=h}renderLabel(t,e){const{points:i}=t,r=bN(i);wv(this.sceneObject,r,t,e)}}function nw(n,t){try{JSON.stringify(n[n.length-1])!==JSON.stringify(n[0])&&n.push(n[0]);const e=En(n.map(h=>ie(h))),i=he([n]);return bT(e,t,{gridType:"point",units:"meters"}).features.map(h=>h.geometry.coordinates)[0][0].filter(h=>hi(ie(h),i))}catch(e){return console.error(e),[]}}class LN extends X{constructor(t,e,i,r){super(),this.sceneObject=t;const s=e;if(r&&jr(s,o=>{this.renderLabel(o,r)}),i)if(i.type==="simple"){const{visualVariables:o}=i;jr(s,a=>{const h=Ev(a,i,o);this.render(a,h)})}else if(i.type==="unique-value"){const{visualVariables:o}=i;jr(s,a=>{const h=Sv(a,i,o);this.render(a,h)})}else if(i.type==="class-breaks"){const{visualVariables:o}=i;jr(s,a=>{const h=Cv(a,i,o);this.render(a,h)})}else console.error("PolyLineLayer: renderer type is not supported")}renderLabel(t,e){const{points:i}=t;console.log("PolygonLayer: renderLabel",i);const r=xN(i);wv(this.sceneObject,r,t,e)}render(t,e){e.type==="simple-fill"?this._simplePolygonRender(t,e):e.type==="ESGeoExtrudedPolygon"?this._esGeoExtrudedPolygonRender(t,e):e.type==="PolygonInterpolateESGltfModel"?this._polygonInterpolateESGltfModelRender(t,e):e.type==="PolygonInterpolateESImageLabel"?this._polygonInterpolateESImageLabelRender(t,e):console.error("PolyLineLayer: symbol type is not supported")}_simplePolygonRender(t,e){const{points:i}=t;if(i.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{color:r,outline:s,filled:o,ground:a}=e,{width:h,color:u,stroked:c}=s,l=this.dv(new le);this.d(this.sceneObject.components.disposableAdd(l)),l.stroked=c??!1,l.strokeColor=u??[1,1,1,1],l.strokeWidth=h??1,l.filled=o??!0,l.fillGround=a??!1,l.fillColor=r??[1,1,1,1],l.allowPicking=(e==null?void 0:e.allowPicking)??!0,l.extras={selected:!1},l.points=[...i]}_esGeoExtrudedPolygonRender(t,e){const{points:i}=t;if(i.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,extrudedHeight:s,color:o}=e,a=this.dv(new pa);this.d(this.sceneObject.components.disposableAdd(a)),a.height=r,a.extrudedHeight=s,a.filled=!0,a.fillColor=o,a.allowPicking=(e==null?void 0:e.allowPicking)??!0,a.extras={selected:!1},a.points=[...i]}_polygonInterpolateESGltfModelRender(t,e){const{points:i}=t;if(i.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,interpolateDistance:s,url:o,rotation:a,scale:h}=e,u=nw(i,s??10),c=this.dv(new xo);this.d(this.sceneObject.components.disposableAdd(c)),c.url=o,c.instances=u.map(l=>({position:[...l,r??0],rotation:a??[0,0,0],scale:h??[1,1,1]}))}_polygonInterpolateESImageLabelRender(t,e){const{points:i}=t;if(i.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,interpolateDistance:s,offset:o,size:a,url:h,anchor:u}=e,l={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:[...nw(i,s??10).map(g=>[...g,r??0])]}}]},d=this.dv(new kl);this.d(this.sceneObject.components.disposableAdd(d)),d.textDefaultText="",d.imageUrl=h,u&&(d.imageAnchor=u),o&&(d.imageOffset=o),a&&(d.imageSize=a),d.url=l}}class FN extends X{constructor(e,i){super();f(this,"_initEvent",this.dv(new N));const r=this,s=async()=>{try{const a=e.featureProps;if(!a)return;const{heightMode:h,features:u,layerType:c,url:l}=a;let d=[];if(!u&&l){let g=await fetch(l).then(p=>p.json());return g=(g==null?void 0:g.features)??g,c==="polylineVector"?d=await J1(i,g,h):c==="polygonVector"?d=await K1(i,g,h):c==="pointVector"&&(d=await $1(i,g,h)),d}else c==="polylineVector"?d=await J1(i,u,h):c==="polygonVector"?d=await K1(i,u,h):c==="pointVector"&&(d=await $1(i,u,h));return d}catch(a){console.error(a);return}},o=this.dv(je(this._initEvent,e.featurePropsChanged));r.dv(new ke(o,()=>{if(!e.featureProps)return;const a=e.featureProps;let h;return(async()=>{const{layerType:c,renderer:l,labelingInfo:d}=a,g=await s();!g||g.length===0||(c==="pointVector"?h=new AN(e,g,l,d):c==="polylineVector"?h=new RN(e,g,l,d):c==="polygonVector"&&(h=new LN(e,g,l,d)),console.log("polygonVectorLayer","createLayer",h))})().catch(console.error),{destroy:()=>{var c;(c=h==null?void 0:h.destroy)==null||c.call(h),h=void 0}}}));{const a=(h,u=1)=>{const c=E1(h);if(!c)return;const{center:l,radius:d}=c;i.flyTo({distance:d*4,heading:0,pitch:-90,flyDuration:u??1,hDelta:0,pDelta:0},l)};r.d(e.flyToEvent.don(async h=>{const{featureProps:u}=e;if(!u)return;const c=await s();if(!c)return;let l=[];u.layerType==="polylineVector"?l=c.map(d=>d.points).flat():u.layerType==="polygonVector"?l=c.map(d=>d.points).flat():u.layerType==="pointVector"&&(l=c.map(d=>d.points)),l.length!==0&&a(l,h)}))}}init(){this._initEvent.emit()}}const _u=class _u extends se{constructor(e){super(e);f(this,"featureLayerMap",new Map);const i=this;i.d(i.viewerAttached.don(r=>{if(console.log("ESFeatureLayer","viewerAttached",r.id),i.featureLayerMap.has(r.id))return;const s=new FN(i,r);s.init(),i.featureLayerMap.set(r.id,s)})),i.d(i.viewerDetached.don(r=>{var s;console.log("ESFeatureLayer","viewerDetached",r.id),i.featureLayerMap.has(r.id)&&((s=i.featureLayerMap.get(r.id))==null||s.destroy(),i.featureLayerMap.delete(r.id))})),i.d(()=>{for(const r of i.featureLayerMap.values())r.destroy();i.featureLayerMap.clear()}),i.d(Ks(i.showChanged,()=>{for(const r of i.components.values())Reflect.has(r,"show")&&(r.show=i.show)},{immediate:!0}))}};f(_u,"createDefaultProps",()=>({...se.createDefaultProps(),featureProps:de(void 0)})),f(_u,"type",_u.register("ESFeatureLayer",_u,{chsName:"矢量图层",tags:["ESObjects"],description:"ESFeatureLayer"}));let Pv=_u;const Xs=class Xs extends X{constructor(){super();f(this,"_loading",!1);f(this,"_loadedEvent",this.disposeVar(new N));f(this,"_loaded",!1);f(this,"_loadedPromiseResolve");f(this,"_loadedPromise",new Promise(e=>{this._loadedPromiseResolve=e}));f(this,"_processing",this.disposeVar(wn(async e=>{if(this._loading=!0,window.Hls)console.info("可能系统已经加载hlsjs,此处不再加载!");else{const i=ft.context.getStrFromEnv(Xs.path);await e.promise(cf(i))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})));this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return Xs._instance=Xs._instance||new Xs,Xs._instance}};f(Xs,"path","${xr-utils-script-dir}/xr-static/xr-utils/hlsjs/1.4.12/hls.min.js"),f(Xs,"_instance");let Od=Xs,kN=class extends X{constructor(e,i){super();f(this,"_element");this._complexImage=e,this._videoSrc=i;var r=document.createElement("video");r.src=this._videoSrc,r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.zIndex="-100",r.style.visibility="hidden";{const s=()=>{r.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{r.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{r.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}r.muted=!0,document.body.appendChild(r),this._element=r,this.dispose(()=>document.body.removeChild(r))}get element(){return this._element}};class GN extends X{constructor(e,i){super();f(this,"_videoDom");f(this,"_processing",this.disposeVar(wn(async e=>{const{videoSrc:i}=this,r=Od.instance();await e.promise(r.loadedPromise);const s=window.Hls,o=new s,a=this.element;await Vo(e,()=>new Promise((h,u)=>{a.xbsjHLS=o,o.attachMedia(a),o.on(s.Events.MEDIA_ATTACHED,()=>{o.loadSource(i),o.on(s.Events.MANIFEST_PARSED,(c,l)=>{a.play(),h()})}),o.on(s.Events.ERROR,(c,l)=>{const{type:d,details:g,fatal:p}=l;p&&(o.destroy(),u(g))})}))})));f(this,"_processingStartup",this._processing.start());this._complexImage=e,this._videoSrc=i,this._videoDom=this.disposeVar(new kN(this._complexImage,""))}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class rw extends X{constructor(e,i){super();f(this,"_videoDom");f(this,"_update",this.disposeVar(qa(()=>this.update())));f(this,"_updateStart",this._update.start());this._complexImage=e,this._imageUri=i,this._videoDom=this.disposeVar(new GN(this._complexImage,this._imageUri))}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:i,videoHeight:r}=this.videoElement;e.size=[i,r],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}const Ys=class Ys extends X{constructor(){super();f(this,"_loading",!1);f(this,"_loadedEvent",this.disposeVar(new N));f(this,"_loaded",!1);f(this,"_loadedPromiseResolve");f(this,"_loadedPromise",new Promise(e=>{this._loadedPromiseResolve=e}));f(this,"_processing",this.disposeVar(wn(async e=>{if(this._loading=!0,window.flvjs)console.info("可能系统已经加载flvjs,此处不再加载!");else{const i=ft.context.getStrFromEnv(Ys.path);await e.promise(cf(i))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})));this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return Ys._instance=Ys._instance||new Ys,Ys._instance}};f(Ys,"path","${xr-utils-script-dir}/xr-static/xr-utils/flvjs/1.6.2/flv.min.js"),f(Ys,"_instance");let Dd=Ys;class BN extends X{constructor(e,i){super();f(this,"_element");this._complexImage=e,this._videoSrc=i;var r=document.createElement("video");r.src=this._videoSrc,r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.zIndex="-100",r.style.visibility="hidden";{const s=()=>{r.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{r.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{r.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}r.muted=!0,document.body.appendChild(r),this._element=r,this.dispose(()=>document.body.removeChild(r))}get element(){return this._element}}class VN extends X{constructor(e,i){super();f(this,"_videoDom");f(this,"_processing",this.disposeVar(wn(async e=>{const{videoSrc:i}=this,r=Dd.instance();await e.promise(r.loadedPromise);const s=window.flvjs,o=this.element;await Vo(e,()=>new Promise((a,h)=>{if(!s.isSupported()){h("flvjs不支持!");return}var u=s.createPlayer({type:"flv",url:i});u.attachMediaElement(o),u.load(),u.play(),o.xbsjFlvPlayer=u}))})));this._complexImage=e,this._videoSrc=i,this._videoDom=this.disposeVar(new BN(this._complexImage,"")),this._processing.start()}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class sw extends X{constructor(e,i){super();f(this,"_videoDom");f(this,"_update",this.disposeVar(qa(()=>this.update())));f(this,"_updateStart",this._update.start());this._complexImage=e,this._imageUri=i,this._videoDom=this.disposeVar(new VN(e,this._imageUri))}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:i,videoHeight:r}=this.videoElement;e.size=[i,r],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}function ow(n){const t=n.substring(n.lastIndexOf(".")+1);return Ul.suffixTypes[t]}class Ul extends X{constructor(){super();f(this,"_enabled",this.disposeVar(H(!1)));f(this,"_uri",this.disposeVar(H("")));f(this,"_type",this.disposeVar(H(void 0)));f(this,"_size",this.disposeVar(ye(void 0)));f(this,"_pixelFormat",this.disposeVar(H("RGBA")));f(this,"_flipY",this.disposeVar(H(!0)));f(this,"_crossOriginReact",this.disposeVar(H("")));f(this,"_autoplayReact",this.disposeVar(H(!0)));f(this,"_loopReact",this.disposeVar(H(!0)));f(this,"_copyTextureEvent",this.disposeVar(new N));f(this,"_imageProcessingResettingEvent",this.disposeVar(je(this.enabledChanged,this.uriChanged,this.typeChanged)));f(this,"_imageProcessingResetting",this.disposeVar(new ke(this._imageProcessingResettingEvent,()=>{do{if(!this.enabled||!this.uri)break;let{type:e}=this;if(e||(e=ow(this.uri)),!e)break;if(e==="img")return new Am(this,this.uri);if(e==="video")return new Fm(this,this.uri);if(e==="gif")return new Hm(this,this.uri);if(e==="hls")return new rw(this,this.uri);if(e==="flv")return new sw(this,this.uri)}while(!1)})));f(this,"_createNativeTextureEvent",this.disposeVar(je(this.enabledChanged,this.sizeChanged,this.pixelFormatChanged,this.flipYChanged)))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get uri(){return this._uri.value}set uri(e){this._uri.value=e}get uriChanged(){return this._uri.changed}get type(){return this._type.value}set type(e){this._type.value=e}get typeChanged(){return this._type.changed}get size(){return this._size.value}set size(e){this._size.value=e}get sizeChanged(){return this._size.changed}get pixelFormat(){return this._pixelFormat.value}set pixelFormat(e){this._pixelFormat.value=e}get pixelFormatChanged(){return this._pixelFormat.changed}get flipY(){return this._flipY.value}set flipY(e){this._flipY.value=e}get flipYChanged(){return this._flipY.changed}get crossOrigin(){return this._crossOriginReact.value}set crossOrigin(e){this._crossOriginReact.value=e}get crossOriginChanged(){return this._crossOriginReact.changed}get autoplay(){return this._autoplayReact.value}set autoplay(e){this._autoplayReact.value=e}get autoplayChanged(){return this._autoplayReact.changed}get loop(){return this._loopReact.value}set loop(e){this._loopReact.value=e}get loopChanged(){return this._loopReact.changed}get copyTextureEvent(){return this._copyTextureEvent}copyTexture(e){this._createNativeTextureEvent.flush(),this._copyTextureEvent.emit(e)}get imageProcessingResetting(){return this._imageProcessingResetting}get createNativeTextureEvent(){return this._createNativeTextureEvent}copyFromCanvas(e){if(e.width<=0||e.height<=0){console.warn("canvas.width <= 0 || canvas.height <= 0");return}this.size=[e.width,e.height],this.pixelFormat="RGBA",this.copyTexture({source:e})}}f(Ul,"types",Lm),f(Ul,"czmPixelFormats",Rm),f(Ul,"suffixTypes",{png:"img",jpg:"img",svg:"img",webp:"img",gif:"gif",mp4:"video",mov:"video",webm:"video",flv:"flv",m3u8:"hls"});const zN=[0,0,0,0];class UN{constructor(){f(this,"_value",[]);f(this,"_valueStr","[]");f(this,"_valueChanged");this.value=[{ratio:0,rgba:[0,0,1,1]},{ratio:.2,rgba:[0,1,0,1]},{ratio:.8,rgba:[1,1,0,1]},{ratio:1,rgba:[1,0,0,1]}]}get valueChanged(){return this._valueChanged||(this._valueChanged=new N),this._valueChanged}set value(t){if(t.length===0){console.error("value.length === 0");return}let e;if(this._value.length===t.length){const r=[...t].sort((s,o)=>s.ratio-o.ratio);if(e=JSON.stringify(r),this._valueStr===e)return}e=e||JSON.stringify([...t].sort((r,s)=>r.ratio-s.ratio));const i=this._value;if(this._value=JSON.parse(e),this._value.length===0)throw console.error("this._colorStops.length === 0"),new Error("this._colorStops.length === 0");this._valueChanged&&this._valueChanged.emit(this._value,i)}get value(){return JSON.parse(JSON.stringify(this._value))}get valueStr(){return this._valueStr}get minRatio(){return this._value[0].ratio}get maxRatio(){return this._value[this._value.length-1].ratio}_getRatioIndex(t){if(t<this._value[0].ratio||t>this._value[this._value.length-1].ratio)throw console.error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio"),new Error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio");let e=this._value.length;for(let i=0;i<e-1;++i)if(t>=this._value[i].ratio&&t<=this._value[i+1].ratio)return i;throw console.error("shoud not be here!"),new Error("shoud not be here!")}getRatioColor(t,e){t=cc(t,this.minRatio,this.maxRatio);const i=this._getRatioIndex(t),r=this._value[i],s=this._value[i+1],o=(t-r.ratio)/(s.ratio-r.ratio);for(let a=0;a<4;++a)e[a]=r.rgba[a]*(1-o)+s.rgba[a]*o;if(e.some(Number.isNaN)){console.error("result NaN");return}return e}getColorsInUint8(t){if(t.length%4!==0)throw console.error("result.length % 4 !== 0"),new Error("result.length % 4 !== 0");const e=t.length/4,i=1/e;for(let r=0;r<e;++r){const s=zN;this.getRatioColor((r+.5)*i,s)||s.splice(0,4,0,0,0,0);for(let o=0;o<4;++o)t[r*4+o]=255*s[o]|0}return t}}class jN extends X{constructor(){super(...arguments);f(this,"registerEngines",{})}register(e,i,r){const s=this.registerEngines[e]||new Map;return s.has(i)&&console.warn(`register warn:${e}中${i}的实现类已经被注册,再次注册会覆盖。`),s.set(i,r),this.registerEngines[e]=s,i}getEngineObjConstructor(e,i){const r=this.registerEngines[i];if(!r)return;let s=e.constructor,o=e.typeName,a=r.get(o);if(a)return a;if(e.components.main)return;const h=o;for(;o!=="ESSceneObject"&&(s=s.getParentClass(),!!s);)if(o=s.type,a=r.get(o),a)return console.warn(`未找到${h}在${i}中对应的实现类! 使用父类${o}的实现类!`),a}createEngineObject(e,i){const r=this.getEngineObjConstructor(e,i.typeName);if(r){const s=new r(e,i);return s.createdEvent.emit(),s}else{const s=new va(e,i);return s.createdEvent.emit(),s}}}class qN extends X{constructor(){super(...arguments);f(this,"registerEngines",{})}register(e,i,r){const s=this.registerEngines[e]||new Map;s.has(i)&&console.warn(`register warn:${e}中${i}的实现类已经被注册,再次注册会覆盖。`),s.set(i,r),this.registerEngines[e]=s}getEngineObjConstructor(e,i){const s=(this.registerEngines[i]||new Map).get(e);if(s)return s;console.warn(`未找到${e}在${i}中对应的实现类!`)}createEngineObject(e,i){const r=this.getEngineObjConstructor(e.typeName,i.typeName);if(r){const s=new r(e,i);return s.createdEvent.emit(),s}else{const s=new va(e,i);return s.createdEvent.emit(),s}}}const lr=class lr extends X{constructor(e,i,r=!1){super();f(this,"_createdEvent",this.dv(new N));f(this,"_id",++lr._accumId);this._sceneObject=e,this._viewer=i;{if(r)return;const s=(o,a)=>{for(let h of o)this._viewer.delete(h);for(let h of a)h.parentID=this.sceneObject.id,this._viewer.add(h)};s([],this._sceneObject.components.values()),this.d(this._sceneObject.components.toChange.don(s)),this.d(()=>s(this._sceneObject.components.values(),[]))}}get createdEvent(){return this._createdEvent}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get id(){return this._id}};f(lr,"context",new jN),f(lr,"contextEditing",new qN),f(lr,"register",lr.context.register.bind(lr.context)),f(lr,"registerEditing",lr.contextEditing.register.bind(lr.contextEditing)),f(lr,"_accumId",-1);let va=lr;function aw(n){return typeof n=="string"?document.getElementById(n):n}function bv(n){if(!n)throw new Error("container is not defined");n.innerHTML="";const t=document.createElement("div");return t.style.cssText="width: 100%; height: 100%; margin: 0px; padding: 0px; border: none; overflow: hidden; position: relative; z-index: 0; background: rgba(0,0,0,0);",n.appendChild(t),t}class hw extends X{constructor(e,i){super();f(this,"_listeningSceneObjects",new Map);this._sceneObjectsMananger=e,this._createSceneObjectListeningFunc=i;const r=this._listeningSceneObjects,s=(o,a)=>{if(o)for(let h of o){const u=r.get(h);u&&(u.destroy(),r.delete(h))}if(a)for(let h of a){if(r.get(h)){console.warn(`listeningSceneObjects已存在某对象:${h.name}`,h);debugger}const c=this.createSceneObjectListeningFunc(h);c&&r.set(h,c)}};s(void 0,this._sceneObjectsMananger.sceneObjects),this.dispose(this._sceneObjectsMananger.sceneObjectsToChange.disposableOn(s)),this.dispose(()=>{for(let o of this._listeningSceneObjects.values())o.destroy();this._listeningSceneObjects.clear()})}get listeningSceneObjects(){return this._listeningSceneObjects}get createSceneObjectListeningFunc(){return this._createSceneObjectListeningFunc}}class WN extends X{constructor(t){super(),this._esObjectsManager=t;{const e=this._esObjectsManager;class i extends X{constructor(s){super(),this._esPath=s,this.dv(new ke(e.activeViewerChanged,()=>{const o=e.activeViewer;if(!o)return;class a extends X{constructor(u){if(super(),this._esPath=u,!o)throw new Error("!viewer");const c=()=>{const l=e.activeViewer;l&&(this._esPath.path.currentTime=l.simulationTime)};c(),this.d(o.simulationTimeChanged.don(c))}}return new a(this._esPath)}))}}this.dv(new hw(e.sceneObjectsManager,r=>{if(r instanceof Vh)return new i(r)}))}{const e=this._esObjectsManager;class i extends X{constructor(s){super();const o=()=>{const a=e.activeViewer;a&&(a.simulationTime=s.currentTime??0)};o(),this.d(s.currentTimeChanged.don(o))}}this.dv(new hw(e.sceneObjectsManager,r=>{if(r instanceof Bh)return new i(r)}))}}}class HN extends X{constructor(t){super(),t.forEach(e=>{this.d(e.path.currentPositionChanged.don(i=>{i&&e.sceneObjects.forEach(r=>{Reflect.has(r,"position")&&(r.position=[...i])})})),this.d(e.path.currentRotationChanged.don(i=>{i&&e.sceneObjects.forEach(r=>{Reflect.has(r,"rotation")&&(r.rotation=[...i])})}))})}}class XN extends X{constructor(e){super();f(this,"_player");f(this,"_channels",this.dv(It([])));this._objectManager=e,this._player=this._objectManager.player,this.dv(new ke(this.channelsChanged,()=>{if(this.channels.length===0)return;const i=[];for(let r=0;r<this.channels.length;r++){const s=this.channels[r],o=ft.getSceneObjById(s.pathId);if(!o||!(o instanceof Vh))continue;const h=s.sceneObjectIds.map(u=>ft.getSceneObjById(u)).filter(u=>u!==void 0);h.length!==0&&i.push({path:o,sceneObjects:h})}if(i.length!==0)return new HN(i)}))}get player(){return this._player}get channels(){return this._channels.value}get channelsChanged(){return this._channels.changed}set channels(e){this._channels.value=e}}function Ad(n){if(n.data){const{type:t,value:e}=n.data;if(t==="UITreeA"&&e instanceof Gi){const{sceneObject:i}=e;if(i)return i.id}}}function YN(n,t){const{property:e,customEventName:i,otherParams:r}=t,{dragstartDataMananger:s}=n;if(!(e instanceof Xa)){if(!(e instanceof t0)){if(e instanceof Mt){const[o,a]=ws(e.reactVar);if(i==="ondragover"){if(console.log("ondragover"),!r)throw new Error("!otherParams");const h=r[0];if(h.preventDefault(),!h.dataTransfer)return;Ad(s)?h.dataTransfer.dropEffect="move":h.dataTransfer.dropEffect="none"}else if(i==="ondrop"){if(!r)throw new Error("!otherParams");r[0].preventDefault();const u=Ad(s);u!==void 0&&a(u)}}else if(e instanceof Jm){const[o,a]=ws(e.reactVar);if(i==="ondragover"){if(console.log("ondragover"),!r)throw new Error("!otherParams");const h=r[0];if(h.preventDefault(),!h.dataTransfer)return;Ad(s)?h.dataTransfer.dropEffect="move":h.dataTransfer.dropEffect="none"}else if(i==="ondrop"){if(!r)throw new Error("!otherParams");const h=r[0].$event,u=r[0].strinsPropDom,c=r[0].index;h.preventDefault();const l=Ad(s);if(l!==void 0){u[c].firstChild.value=l;const d=new Event("input",{bubbles:!0,cancelable:!0});u[c].firstChild.dispatchEvent(d)}}}else if(e instanceof $m){const[o,a]=ws(e.reactVar)}}}}function uw(n,t,e,i){if(e)i.currentActiveEditing=[n,t];else if(i.currentActiveEditing){const[r,s]=i.currentActiveEditing;r===n&&s===t&&(e||(i.currentActiveEditing=void 0))}}const JN=["editing","positionEditing","locationEditing","pointEditing","rotationEditing"];class $N extends X{constructor(t,e){super(),this._sceneObject=t;const i=this._sceneObject;for(let r of JN){const s=r+"Changed",o=i[s];if(o){{const a=i[r];uw(i,r,a,e)}this.dispose(o.disposableOn(a=>uw(i,r,a,e)))}}}get sceneObject(){return this._sceneObject}}class KN extends X{constructor(){super();f(this,"_currentActiveEditing",this.disposeVar(ye(void 0)));f(this,"_currentActiveEditingLastChangedTime",0);this.dispose(this._currentActiveEditing.changed.disposableOn((e,i)=>{if(this._currentActiveEditingLastChangedTime=Date.now(),i){const[r,s]=i;r[s]===!0&&(r[s]=!1)}if(e){const[r,s]=e;r[s]=!0}})),ft.context.sceneObjCreatedEvent.don(e=>{e.dv(new $N(e,this))})}get currentActiveEditing(){return this._currentActiveEditing.value}set currentActiveEditing(e){this._currentActiveEditing.value=e}get currentActiveEditingChanged(){return this._currentActiveEditing.changed}get currentActiveEditingLastChangedTime(){return this._currentActiveEditingLastChangedTime}}class QN extends X{constructor(){super();f(this,"_sceneObjects",new Set);f(this,"_sceneObjectsToChange",this.dv(new N));this.d(()=>{const e=hf(this._sceneObjects);e!==0&&console.warn(`场景对象管理器销毁时仍然管理着${e}个场景对象!`)})}get sceneObjects(){return this._sceneObjects}get sceneObjectsToChange(){return this._sceneObjectsToChange}addSceneObject(e){return this._sceneObjects.has(e)?(console.warn(`创建失败:对象${e.typeName+":"+e.id}已经存在于场景对象管理器中!}`),!1):(this._sceneObjectsToChange.emit([],[e]),this._sceneObjects.add(e),!0)}deleteSceneObject(e){return this._sceneObjects.has(e)?(this._sceneObjectsToChange.emit([e],[]),this._sceneObjects.delete(e),!0):(console.warn(`删除失败:对象${e.typeName+":"+e.id}不存在于场景对象管理器中!}`),!1)}createSceneObject(e,i){const r=ft.context.createSceneObject(e,i);return r&&this.addSceneObject(r),r}createSceneObjectFromUrl(e,i){const r=ft.context.createSceneObjectFromUrl(e,i);return r&&this.addSceneObject(r),r}createSceneObjectFromClass(e,i){const r=ft.context.createSceneObjectFromClass(e,i);return r&&this.addSceneObject(r),r}createSceneObjectFromJson(e){const i=ft.context.createSceneObjectFromJson(e);return i&&this.addSceneObject(i),i}}class ZN extends X{constructor(e){super();f(this,"_enabled",this.dv(H(!1)));f(this,"_cursorPosition",H(void 0));f(this,"quickPickPosition",!0);let i=new X;const r=()=>{i&&(i.destroy(),i=void 0)};this.d(r);const s=()=>{if(r(),!e||!this._enabled.value)return;i=new X;const o=i.dv(H(void 0)),a=i.dv(je(o.changed));i.d(e.pointerMoveEvent.don(u=>{u.pointerEvent&&(o.value=xi(u.pointerEvent))}));const h=i.dv(wn(async u=>{if(o.value)if(this.quickPickPosition){const c=await u.promise(ja(e.quickPickPosition(o.value)));this._cursorPosition.value=c}else{const c=await u.promise(ja(e.pickPosition(o.value)));this._cursorPosition.value=c}}));i.d(a.don(()=>{h.restart()}))};s(),this.d(this._enabled.changed.don(s))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}class tO extends X{constructor(e){super();f(this,"cursorPositionInfo");this.viewer=e,this.cursorPositionInfo=this.dv(new ZN(this.viewer))}}class eO extends X{constructor(e){super();f(this,"viewer");const i=this.viewer=e;this.ad(new ke(i.rollerShutterChanged,()=>{const r=i.container;if(!r||!i.rollerShutter)return;const s=new X;this.viewer.splitPosition=.5;let o=this.getRollerShutterDIV();return r.appendChild(o),s.d(()=>{this.viewer.splitPosition=0,r.removeChild(o)}),s}))}getRollerShutterDIV(){let e=document.createElement("div");e.style.position="absolute",e.style.left="50%",e.style.top="0",e.style.backgroundColor="#d3d3d3",e.style.width="5px",e.style.height="100%",e.style.zIndex="9999";const i=r=>{if(!e.parentElement)return;r.preventDefault?r.preventDefault():r.returnValue=!1;const o=r.x/e.parentElement.offsetWidth;e.style.left=`${100*o}%`,this.viewer.splitPosition=o};return e.addEventListener("mouseenter",r=>{e.style.cursor="ew-resize"}),e.addEventListener("mouseleave",r=>{e.style.cursor="default"}),e.addEventListener("mousedown",r=>{e.style.cursor="ew-resize",document.addEventListener("mousemove",i)}),document.addEventListener("mouseup",r=>{e.style.cursor="default",document.removeEventListener("mousemove",i)}),e}}class iO extends X{constructor(e){super();f(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new eO(e))}}function lw(n,t){return n.length===t.length&&n.every((e,i)=>e===t[i])}class nO extends X{constructor(t){super(),this._viewer=t,this.d(Y([this._viewer,"currentTime"],[this._viewer,"simulationTime"]))}}class rO extends X{constructor(t,e){super(),this._viewer=t,this._activeViewer=e;const i=Or.createCommonProps(),r=[];Object.keys(i).forEach(h=>{const u=this._activeViewer[h+"Changed"];r.push(u)});const s=this.dv(je(...r)),o=()=>{this._viewer.status!=="Created"||this._activeViewer.status!=="Created"||Object.keys(i).forEach(h=>{this._viewer[h]=this._activeViewer[h]})};this.d(s.don(o));const a=this.dv(Tu());a.restart(void 0,async()=>{if(this._viewer.status!=="Created"||this._activeViewer.status!=="Created")return;const h=this._activeViewer.getCurrentCameraInfo(),u=this._viewer.getCurrentCameraInfo();if(!h)return;const{position:c,rotation:l}=h;u&&lw(c,u.position)&&lw(l,u.rotation)||this._viewer.flyIn(c,l,0)}),this.d(()=>a.cancel())}}const sO=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="40" height="40" style="shape-rendering: auto; display: block; background: rgba(255, 255, 255, 0);" xmlns:xlink="http://www.w3.org/1999/xlink"><g><circle stroke-linecap="round" fill="none" stroke-dasharray="50.26548245743669 50.26548245743669" stroke="#ffffff" stroke-width="8" r="32" cy="50" cx="50">
491
491
  <animateTransform values="0 50 50;360 50 50" keyTimes="0;1" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"></animateTransform>
492
492
  </circle><g></g></g></svg>
493
493
  `,oO='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',aO='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',Aa=class Aa extends X{constructor(t){super();const e=()=>{const i=this.dv(new Cd);this.d(Y([i,"show"],[t,"useDefaultStatusDiv"]));{const r=()=>{i.show=(t.useDefaultStatusDiv??!0)&&t.status!=="Created"};r(),this.d(t.useDefaultStatusDivChanged.don(r)),this.d(t.statusChanged.don(r)),i.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}t.add(i),this.d(()=>t.delete(i)),i.instanceClass=class extends X{constructor(o,a,h){super();f(this,"_div",document.createElement("div"));if(this._subContainer=o,!h)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const p=()=>{a.show?this._div.style.opacity="1":this._div.style.opacity="0"};p(),this.d(a.showChanged.don(p))}let u,c,l,d,g;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",u=document.createElement("div"),this._div.appendChild(u),u.style.width="auto",u.style.position="absolute",u.style.left="50%",u.style.top="50%",u.style.transform="translate(-50%,-50%)",u.style.background="rgba(120, 120, 0, 0.7)",u.style.color="white",u.style.fontSize="10px",u.style.background="none",u.style.display="flex",u.style.justifyContent="center",u.style.alignItems="center",c=document.createElement("div"),u.appendChild(c),c.style.pointerEvents="none",c.style.display="block",c.style.width="40px",c.innerHTML=Aa.defaultsSvg.loadingSvg,c.style.filter="drop-shadow(0px 0px 1px black)",l=document.createElement("div"),u.appendChild(l),l.style.pointerEvents="none",l.style.marginLeft="10px",l.style.display="flex",l.style.flexFlow="column",l.style.maxWidth="300px",d=document.createElement("div"),l.appendChild(d),d.style.fontSize="14px",d.style.fontWeight="800",d.style.marginBottom="5px",d.style.textShadow="0 0 2px black",g=document.createElement("div"),l.appendChild(g),g.style.fontWeight="400",g.style.textShadow="0 0 2px black";{const p=()=>{let w="Raw";h.status==="Raw"?w="初始状态":h.status==="Creating"?w="正在创建":h.status==="Created"?w="创建完成":h.status==="Error"?w="创建失败":h.status==="Reconnecting"&&(w="重新连接"),d.innerText=`${w}(${h.status})`,g.innerText=`${h.statusLog}`,(h.status==="Creating"||h.status==="Reconnecting")&&(c.innerHTML=Aa.defaultsSvg.loadingSvg),h.status==="Created"&&(c.innerHTML=Aa.defaultsSvg.successSvg),h.status==="Error"&&(c.innerHTML=Aa.defaultsSvg.warnSvg)};p();const _=this.dv(je(h.statusLogChanged,h.statusChanged));this.d(_.don(p))}}update(){const o=255*Math.random()|0,a=255*Math.random()|0,h=255*Math.random()|0;this._div.style.background=`rgba(${o}, ${a}, ${h}, 0.8)`}}};this.d(t.containerChanged.don(()=>{e()}))}};f(Aa,"defaultsSvg",{loadingSvg:sO,successSvg:oO,warnSvg:aO});let Iv=Aa;class hO extends X{constructor(t,e,i){super(),this._subContainer=t,this._overlayContainer=e,this._viewer=i;const r=this._subContainer,s=this._overlayContainer,o=this._viewer,a=()=>{const c=o.zIndex??"";r.style.zIndex=c,s.style.zIndex=c};a(),this.d(o.zIndexChanged.don(a));const h=()=>{r.style.display=o.show??!0?"block":"none"};h(),this.d(o.showChanged.don(h));const u=()=>{r.style.opacity=`${o.opacity??1}`};u(),this.d(o.opacityChanged.don(u))}}function Rd(n){let t=yn(n,"_relativeContainer");return t||(t=document.createElement("div"),t.style.position="relative",t.style.width="100%",t.style.height="100%",t.style.padding="0",t.style.margin="0",n.appendChild(t),Ur(n,"_relativeContainer",t)),t}class uO extends X{constructor(e,i){super();f(this,"_subContainer",document.createElement("div"));f(this,"_overlayContainer",document.createElement("div"));f(this,"_containerStyleController");this._container=e,this._viewer=i,this._containerStyleController=this.dv(new hO(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:r,overlayContainer:s}=this;r.tabIndex=-1,r.style.outline="none",r.style.width="100%",r.style.height="100%",r.onpointerdown=()=>r.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),r.setAttribute("earthsdk3","earthsdk3-subContainer"),Rd(this._container).appendChild(r),this.d(()=>Rd(this._container).removeChild(r)),Rd(this._container).appendChild(s),this.d(()=>Rd(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class lO extends X{constructor(){super(...arguments);f(this,"registerObjsMap",new Map)}register(e,i){return this.registerObjsMap.has(e)&&console.warn(`register warn:${e}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(e,i),e}getViewerConstructor(e){const i=this.registerObjsMap.get(e);if(!i){console.warn(`未找到${e}类!`);return}return i}createViewer(e){const i=e.type;console.log(e);const r=this.getViewerConstructor(i);if(!r)throw new Error(`没有找到类型为${i}的Viewer构造器!`);return new r(e)}}class cw extends X{constructor(t,e,i=!1,r=!1){if(super(),this._viewer=t,!e)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(be.create(e,"pointerdown")),o=this.dv(be.create(e,"pointermove")),a=this.dv(be.create(e,"pointerup")),h=this.dv(be.create(e,"pointerout")),u=this.dv(be.create(e,"pointerover")),c=this.dv(new Cf),l=this.dv(new am),d=()=>{const m=this._viewer.hoverTime*1e3;l.delayTime=m};this.d(this._viewer.hoverTimeChanged.don(()=>{d()})),this.d(s.don(m=>c.pointerDown(m))),this.d(o.don(m=>c.pointerMove(m))),this.d(a.don(m=>c.pointerUp(m))),this.d(h.don(m=>c.pointerOut(m))),this.d(s.don(m=>l.pointerDown(m))),this.d(o.don(m=>l.pointerMove(m))),this.d(a.don(m=>l.pointerUp(m))),this.d(h.don(m=>l.pointerOut(m)));const{x:g,y:p}=e.getBoundingClientRect(),_=r?g:0,w=r?p:0;this.d(l.hoverEvent.don(m=>{const[S,C]=Va(m,i);this._viewer.hoverEvent.emit({screenPosition:[S+_,C+w],pointerEvent:m})})),this.d(c.clickEvent.don(m=>{const[S,C]=Va(m,i);this._viewer.clickEvent.emit({screenPosition:[S+_,C+w],pointerEvent:m})})),this.d(c.dbclickEvent.don(m=>{const[S,C]=Va(m,i);m.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[S+_,C+w],pointerEvent:m})})),this.d(s.don(m=>{const[S,C]=Va(m,i);m.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[S+_,C+w],pointerEvent:m})})),this.d(a.don(m=>{const[S,C]=Va(m,i);m.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[S+_,C+w],pointerEvent:m})})),this.d(o.don(m=>{const[S,C]=xi(m,i);this._viewer.pointerMoveEvent.emit({screenPosition:[S+_,C+w],pointerEvent:m})})),this.d(u.don(m=>{const[S,C]=xi(m,i);this._viewer.pointerOverEvent.emit({screenPosition:[S+_,C+w],pointerEvent:m})})),this.d(h.don(m=>{const[S,C]=xi(m,i);this._viewer.pointerOutEvent.emit({screenPosition:[S+_,C+w],pointerEvent:m})}));const P=this.dv(be.create(e,"keydown"));this.d(P.don(m=>this._viewer.keyDownEvent.emit(m)));const v=this.dv(be.create(e,"keyup"));this.d(v.don(m=>this._viewer.keyUpEvent.emit(m)));const E=this.dv(be.create(e,"wheel"));this.d(E.don(m=>this._viewer.wheelEvent.emit(m)))}}const Js=class Js extends X{constructor(e){super();f(this,"_forceRecreateEvent",this.dv(new N));f(this,"_container",this.dv(H(void 0)));f(this,"_containerSize",this.dv(H(void 0)));f(this,"_editingEvent",this.disposeVar(new N));f(this,"_esViewerExtensions",this.dv(new tO(this)));f(this,"_status",this.dv(H("Raw")));f(this,"_statusLog",this.dv(H("")));f(this,"_statusContainer",this.dv(new Iv(this)));f(this,"_useCustomInteraction",this.dv(H(!0)));f(this,"_resetInteractionEvent",this.dv(je(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));f(this,"_interactionResetting",this.dv(new ke(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new cw(this,this.container)})));f(this,"_viewerChanged",this.dv(new N));f(this,"_cameraChanged",this.dv(new N));f(this,"_containerResetEvent",this.dv(je(this.containerChanged,this._forceRecreateEvent)));f(this,"_containerResetting",this.dv(new ke(this._containerResetEvent,()=>{if(this.container)return new uO(this.container,this)})));f(this,"_sceneObjectsMap",new Map);f(this,"_id");f(this,"_typeName");f(this,"_updateFuncReact",this.dv(H(void 0)));f(this,"_toDestroyFuncReact",this.dv(H(void 0)));f(this,"_statusInfo",Js.defaults.statusInfo);f(this,"_navigationMode",this.dv(H("Map")));f(this,"_syncViewer",this.dv(H(void 0)));f(this,"_syncEventDon",this.dv(new ke(this.syncViewerChanged,()=>{const e=this.syncViewer;if(e)return new rO(this,e)})));f(this,"_timeSyncdon",this.dv(new ke(this.timeSyncChanged,()=>{if(this.timeSync)return new nO(this)})));f(this,"_hoverEvent",this.dv(new N));f(this,"_pointerOverEvent",this.dv(new N));f(this,"_pointerMoveEvent",this.dv(new N));f(this,"_pointerDownEvent",this.dv(new N));f(this,"_pointerUpEvent",this.dv(new N));f(this,"_pointerOutEvent",this.dv(new N));f(this,"_clickEvent",this.dv(new N));f(this,"_dblclickEvent",this.dv(new N));f(this,"_keyDownEvent",this.dv(new N));f(this,"_keyUpEvent",this.dv(new N));f(this,"_wheelEvent",this.dv(new N));f(this,"_actived",this.dv(H(!1)));this._id=e.id??Ga();const i=aw(e.container);if(i)this._container.value=bv(i),this._typeName=e.type,this._initName();else throw new Error("container is not defined");{const r=()=>{i&&(this.show??!0?i.style.display="block":i.style.display="none")};r(),this.d(this.showChanged.don(r))}{const r=this._sceneObjectsMap,s=()=>{for(let[a,h]of r.entries())if(!h&&a){const u=va.context.createEngineObject(a,this);u&&r.set(a,u)}},o=()=>{for(let[a,h]of r.entries())h&&!h.isDestroyed()&&h.destroy(),r.set(a,void 0)};this.d(o),this.d(this.viewerChanged.don(a=>{o(),a&&s()}))}{const r=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};r(),this.d(this.execOnceFuncStrChanged.don(r))}{const r=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(o){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};r(),this.d(this.updateFuncStrChanged.don(r));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||Tu(),s.restart(void 0,o=>{this.updateFunc&&this.updateFunc(this,o)}))}))}{const r=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};r(),this.d(this.toDestroyFuncStrChanged.don(r)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new iO(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(e){this._container.value=e}set containerOrId(e){if(typeof e=="string"){const i=document.getElementById(e);i&&i instanceof HTMLDivElement?this._container.value=bv(i):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else e instanceof HTMLDivElement?this._container.value=bv(e):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(e){this._containerSize.value=e}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get esViewerExtensions(){return this._esViewerExtensions}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(e){this._status.value=e}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(e){this._statusLog.value=e}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(e){this._useCustomInteraction.value=e}get viewerChanged(){return this._viewerChanged}get cameraChanged(){return this._cameraChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(e){return this.sceneObjectsMap.get(e)}add(...e){for(let i of e)if(!this.has(i)){ft.context.addSceneObject(i);const r=va.context.createEngineObject(i,this);r&&this._sceneObjectsMap.set(i,r),i.viewerAttached.emit(this)}}delete(...e){for(let i of e)if(this.has(i)){const r=this._sceneObjectsMap.get(i);r&&r.destroy(),ft.context.deleteSceneObject(i),this._sceneObjectsMap.delete(i),i.viewerDetached.emit(this)}}disposableAdd(...e){return this.add(...e),()=>this.delete(...e)}disAdd(...e){return this.disposableAdd(...e)}has(e){return this._sceneObjectsMap.has(e)}clearAllSceneObjects(){for(let e of this.sceneObjects)this.delete(e)}get id(){return this._id}set id(e){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return Js.createDefaultProps()}_getJson(e=!0){const i={id:this.id,type:this.typeName};for(let r of Object.keys(this.defaultProps))if(e){let s,o=this.defaultProps[r];o instanceof oi?s=o.equals(this[r]):s=o===this[r],s||(i[r]=this[r])}else i[r]=this[r];return i}_setJson(e,i,r){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const s=i||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in e)this[a]=e[a]===null?void 0:e[a];else if(!(r??!1)){let h=this.defaultProps[a];h instanceof oi&&(h=h.value),this[a]=h}}get json(){return this._getJson()}set json(e){this._setJson(e,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(e){this._syncViewer.value=e}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(e){e&&e.syncViewer&&(e.syncViewer=void 0),e===this?this._syncViewer.value=void 0:this._syncViewer.value=e}setCurrentTime(e){try{this.currentTime=typeof e=="string"?Date.parse(e):e}catch(i){console.warn(`时间格式不正确! value: ${e} error: ${i}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}get actived(){return this._actived.value}set actived(e){this._actived.value=e}get activedChanged(){return this._actived.changed}getESProperties(){return{defaultMenu:"general",basic:[],general:[],dataSource:[],location:[],coordinate:[],style:[],more:[]}}getProperties(e){const i={...this.getESProperties()},r=[];return i.general.length>0&&r.push(new Et(i.general,"general")),Object.keys(i).forEach(s=>{s!=="defaultMenu"&&s!=="general"&&i[s].length>0&&r.push(new Et(i[s],s))}),r}};f(Js,"context",new lO),f(Js,"register",Js.context.register.bind(Js.context)),f(Js,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0,cameraMovableRegion:[0,0,0,0,0,0],depthTestAgainstTerrain:!0,terrainOpacity:1});let Or=Js;(n=>{n.createBaseProps=()=>({name:"未命名场景对象",extras:Rt(void 0),devTags:ye(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),n.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:256,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:ye(void 0),editingAuxiliaryPointColor:ye(void 0),editingLineWidth:void 0,editingLineColor:ye(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:n.defaults.terrainShader,splitPosition:H(void 0),rollerShutter:!1,cameraMovableRegion:ye(void 0),depthTestAgainstTerrain:!0,terrainOpacity:1}),n.createDefaultProps=()=>({...(0,n.createBaseProps)(),...(0,n.createCommonProps)()})})(Or||(Or={})),Es(Or.prototype,Or.createDefaultProps);function dw(n,t){const e=n._lastCameraInfo;if(e){const i=t.viewerChanged.don(r=>{if(!r||!e)return;const{position:s,rotation:o}=e;t.flyIn(s,o,0),n._lastCameraInfo=void 0,i()})}}const cO=n=>{const t=Or.createCommonProps(),e={};try{Object.keys(t).forEach(i=>{e[i]=n[i]})}catch(i){console.warn(i)}return e},fw=(n,t)=>{const e=Or.createCommonProps();try{Object.keys(e).forEach(i=>{n[i]=t[i]})}catch(i){console.warn(i)}};class dO extends X{constructor(e){super();f(this,"_viewersChanged",this.disposeVar(new N));f(this,"_viewers",new Set);f(this,"_viewersToChange",this.dv(new N));this._sceneObjectsManager=e,this.d(()=>{for(const i of this._viewers)this.destroyViewer(i);this._viewers.clear()}),this.viewers.forEach(i=>{const r=this._sceneObjectsManager.sceneObjects;i.add(...r)}),this.d(()=>{const i=this._sceneObjectsManager.sceneObjects;this.viewers.forEach(r=>{r.delete(...i)})}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don((i,r)=>{this.viewers.forEach(s=>{r.forEach(o=>{Ps(s.devTags,o.devTags)&&(s.has(o)?console.warn(`${s.typeName}中已存${o.typeName},检查逻辑是否有问题!`):s.add(o))}),i.forEach(o=>{Ps(s.devTags,o.devTags)&&(s.has(o)?s.delete(o):console.warn(`${s.typeName}中不存在${o.typeName},检查逻辑是否有问题!`))})}),r.length>0&&r.forEach(s=>{s.d(s.devTagsChanged.don(()=>{this.viewers.forEach(o=>{o.has(s)&&o.delete(s),console.log("sceneObjectsToChange",o.devTags,s.devTags,Ps(o.devTags,s.devTags)),Ps(o.devTags,s.devTags)&&(o.has(s)?console.warn(`${o.typeName}中已存${s.typeName},检查逻辑是否有问题!`):o.add(s))})}))})})),this.d(this.viewersChanged.don((i,r)=>{const s=this._sceneObjectsManager.sceneObjects;r.forEach(o=>{for(let a of s)Ps(o.devTags,a.devTags)&&(o.has(a)?console.warn(`${o.typeName}中已存${a.typeName},检查逻辑是否有问题!`):o.add(a))}),i.forEach(o=>{for(let a of s)Ps(o.devTags,a.devTags)&&(o.has(a)?o.delete(a):console.warn(`${o.typeName}中不存在${a.typeName},检查逻辑是否有问题!`))}),r.length>0&&r.forEach(o=>{o.d(o.devTagsChanged.don(()=>{o.clearAllSceneObjects();const a=this._sceneObjectsManager.sceneObjects;for(let h of a)console.log("viewersChanged",o.devTags,h.devTags,Ps(o.devTags,h.devTags)),Ps(o.devTags,h.devTags)&&(o.has(h)?console.warn(`${o.typeName}中已存${h.typeName},检查逻辑是否有问题!`):o.add(h))}))})}))}get viewersChanged(){return this._viewersChanged}get viewers(){return this._viewers}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(e){const i=Or.context.createViewer(e);return this._viewers.add(i),this._viewersChanged.emit([],[i]),i}destroyViewer(e){return e.isDestroyed()?!0:(this._viewers.delete(e),this._viewersChanged.emit([e],[]),e.destroy(),e.isDestroyed())}}class Ld extends X{constructor(...e){super();f(this,"_drgm",this.dv(new r0));f(this,"_sobjm",this.dv(new QN));f(this,"_vrm",this.dv(new dO(this._sobjm)));f(this,"_sceneObjectEditingManager",this.disposeVar(new KN));f(this,"_activeViewer",this.dv(H(void 0)));f(this,"_syncOtherViewersToActived",this.dv(H(!1)));f(this,"_cmrvm",this.createSceneObjectFromClass(wd));f(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));f(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});f(this,"_sceneTree",this.dv(new Rl("default",this.dragstartDataMananger,24,this)));f(this,"_propUiTreeManager",this.dv(new Lh(24)));f(this,"_sceneTreeMap",new Map);f(this,"_viewerCreatedEvent",this.dv(new N));f(this,"_lastCameraInfo");f(this,"_lastActiveViewerJson");f(this,"_syncEventDonFunc",this.d(Ks([this.activeViewerChanged,this.syncOtherViewersToActivedChanged],()=>{const e=this.syncOtherViewersToActived;this.viewers.forEach(i=>{e?i.syncOtherViewer(this.activeViewer):i.syncOtherViewer(void 0)})})));f(this,"_player",this.createSceneObjectFromClass(Bh));f(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));f(this,"_esPlyarAndPathTime",this.dv(new WN(this)));f(this,"_pathAnimationManager",this.dv(new XN(this)))}static get envs(){return ft.context.environmentVariables}getSceneObjectById(e){return ft.getSceneObjectById(e)}getSceneObject(e){return ft.getSceneObject(e)}get $refs(){return ft.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(e){this._activeViewer.value=e,this.viewers.values().forEach(i=>i.actived=i===e)}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(e){this._syncOtherViewersToActived.value=e}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get json(){var l;const e=this._asset.createdTime||new Date().toISOString(),i=new Date().toISOString(),r=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:e,modifiedTime:i,name:r},a=this.sceneTree.json,h=this._cmrvm.views,u=[...this._vrm.viewers].map(d=>d.json),c=(l=this.activeViewer)==null?void 0:l.getCurrentCameraInfo();return{asset:o,viewers:u,sceneTree:a,viewCollection:h,lastView:c}}set json(e){try{if(!e.asset)return;if(!e.asset.type||e.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=e.asset&&e.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=e.asset&&e.asset.modifiedTime||"",this._asset.name=e.asset&&e.asset.name||"未命名项目",this._asset.version=e.asset&&e.asset.version||"0.1.0",e.sceneTree&&(this.sceneTree.json=e.sceneTree),e.viewCollection&&(this._cmrvm.views=e.viewCollection),!e.viewers||!Array.isArray(e.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this._vrm.viewers.size===0||e.viewers.length===0){console.warn("viewers is empty !");return}this._vrm.viewers.forEach(i=>{const r=e.viewers.find(s=>s.id===i.id);r&&(i.json=r)})}catch(i){console.error(`ESObjectsManager解析json数据时发生错误! error: ${i}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}get propUiTreeManager(){return this._propUiTreeManager}propTreeCallback(e){return YN(this,e)}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(e="default"){if(e==="default")return this._sceneTree;if(!this._sceneTreeMap.has(e)){console.warn(`id为${e}的SceneTree不存在!`);return}return this._sceneTreeMap.get(e)}createSceneTree(e,i=24){if(this._sceneTreeMap.has(e)||e==="default")console.warn(`id为${e}的SceneTree已存在!`);else{const r=this.dv(new Rl(e,this.dragstartDataMananger,i,this));this._sceneTreeMap.set(e,r)}return this.getSceneTree(e)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(e){const i=this._vrm.createViewer(e);this.activeViewer||(this.activeViewer=i);const r=this.d(i.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(i),r())}));return i}destroyViewer(e){return this._activeViewer.value===e&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(e)}switchViewer(e,i=!0,r=!0,s=!0){var u;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&i&&(this._lastCameraInfo=(u=this.activeViewer)==null?void 0:u.getCurrentCameraInfo()),!this._lastActiveViewerJson&&r&&(this._lastActiveViewerJson=this.activeViewer?cO(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const o=e.id,a=o?[...this.getViewers()].find(c=>c.id===o):[...this.getViewers()].find(c=>c.typeName===e.type);if(a)if(o&&a.typeName!==e.type)console.warn(`id为${o}的viewer的typeName和option.type${e.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(a);else return console.log("ESViewer exists, will be used"),i&&dw(this,a),r&&this._lastActiveViewerJson&&(fw(a,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),a.container===aw(e.container)?(a.containerOrId=e.container,a.forceRecreate()):a.containerOrId=e.container,this.activeViewer=a,a;console.log("No ESViewer exists, will be created");const h=this.createViewer(e);return console.log(e),console.log(this),i&&dw(this,h),r&&this._lastActiveViewerJson&&(fw(h,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=h,h}switchToCesiumViewer(...e){if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)){const{container:i,viewSync:r,attributeSync:s,destroy:o,id:a}=e[0];return this.switchViewer({type:"ESCesiumViewer",container:i,id:a},r??!0,s??!0,o??!0)}else if(typeof e[0]=="string"||e[0]instanceof HTMLDivElement){const i={container:e[0],viewSync:e[1]??!0,attributeSync:e[2]??!0,destroy:e[3]??!0,id:e[4]},{container:r,viewSync:s,attributeSync:o,destroy:a,id:h}=i;return this.switchViewer({type:"ESCesiumViewer",container:r,id:h},s,o,a)}}switchToUEViewer(...e){let i,r={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("uri")){const{container:h,uri:u,app:c,token:l,viewSync:d,attributeSync:g,destroy:p,id:_}=e[0];i={type:"ESUeViewer",container:h,id:_,options:{uri:u,app:c,token:l}},r={viewSync:d??!0,attributeSync:g??!0,destroy:p??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("ws")){const{container:h,ws:u,esmsg:c,viewSync:l,attributeSync:d,id:g,destroy:p}=e[0];i={type:"ESUeViewer",container:h,id:g,options:{ws:u,esmsg:c}},r={viewSync:l??!0,attributeSync:d??!0,destroy:p??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("project")){const{container:h,project:u,baseUrl:c,viewSync:l,attributeSync:d,id:g,destroy:p}=e[0];i={type:"ESUeViewer",container:h,id:g,options:{project:u,baseUrl:c}},r={viewSync:l??!0,attributeSync:d??!0,destroy:p??!0}}else(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?(i={type:"ESUeViewer",container:e[0],id:e[6],options:{ws:e[1],esmsg:e[2]??void 0}},r={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}):typeof e[1]=="string"&&e[1].startsWith("http")?(i={type:"ESUeViewer",container:e[0],id:e[7],options:{uri:e[1],app:e[2],token:e[3]??void 0}},r={viewSync:e[4]??!0,attributeSync:e[5]??!0,destroy:e[6]??!0}):(i={type:"ESUeViewer",container:e[0],id:e[6],options:{project:e[1],baseUrl:e[2]??void 0}},r={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}));if(!i)throw new Error("参数错误");const{viewSync:s,attributeSync:o,destroy:a}=r;return this.switchViewer(i,s,o,a)}createCesiumViewer(...e){let i;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?i={...e[0],type:"ESCesiumViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(i={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESCesiumViewer"}),!i)throw new Error("参数错误");return this.createViewer(i)}createOpenLayersViewer(...e){let i;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?i={...e[0],type:"ESOlViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(i={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESOlViewer"}),!i)throw new Error("参数错误");return this.createViewer(i)}createUeViewer(...e){let i;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?i={...e[0],type:"ESUeViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?i={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{ws:e[1],esmsg:e[2]??void 0}}:typeof e[1]=="string"&&e[1].startsWith("http")?i={type:"ESUeViewer",container:e[0],id:e[4]??void 0,options:{uri:e[1],app:e[2],token:e[3]??void 0}}:i={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{project:e[1],baseUrl:e[2]??void 0}}),!i)throw new Error("参数错误");return this.createViewer(i)}createSceneObject(e,i){return this._sobjm.createSceneObject(e,i)}createSceneObjectFromUrl(e,i){return this._sobjm.createSceneObjectFromUrl(e,i)}createSceneObjectFromClass(e,i){return this._sobjm.createSceneObjectFromClass(e,i)}createSceneObjectFromJson(e){return this._sobjm.createSceneObjectFromJson(e)}destroySceneObject(e){const i=this._sobjm.deleteSceneObject(e);return e.destroy(),i}destroyAllSceneObjects(){const e=[...this._sobjm.sceneObjects];for(let i of e)i!=this._player&&i!=this._cmrvm&&this.destroySceneObject(i)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}return f(Ld,"getSceneObjById",ft.context.getSceneObjectById.bind(ft.context)),f(Ld,"getEnv",ft.context.getEnv.bind(ft.context)),f(Ld,"setEnv",ft.context.setEnv.bind(ft.context)),y.BasePropTreeItem=np,y.Boolean2Property=fS,y.Boolean2sProperty=vS,y.Boolean3Property=gS,y.Boolean3sProperty=mS,y.Boolean4Property=pS,y.Boolean4sProperty=_S,y.BooleanProperty=rt,y.BooleansProperty=sS,y.BorderedPosFloatDiv=Sm,y.BoxPicker=vf,y.CancelError=dr,y.CancelsManager=yf,y.CanvasImagePoi=ME,y.CanvasPoi=Pf,y.CanvasPointPoi=TE,y.CanvasPrimitive=hm,y.CanvasPrimitivesContext=NE,y.ColorProperty=Ut,y.ColorRgbProperty=ES,y.ColorStops=UN,y.ComplexImage=Ul,y.CursorFloatDiv=LE,y.CursorInfo=FE,y.DashPatternProperty=SS,y.DateProperty=qo,y.DatesProperty=i0,y.Debouncing=sE,y.DebouncingDeprecated=ff,y.DebouncingWithStartValues=oE,y.Destroyable=X,y.DivBoxPicker=iE,y.DivPoi=ym,y.DivPointerClick=IE,y.DomElementEvent=be,y.DoublyLinkedList=qv,y.DragStartDataManager=r0,y.ES3DTileset=rr,y.ESAlarm=cp,y.ESApertureEffect=dp,y.ESAreaMeasurement=fp,y.ESBlastParticleSystem=gp,y.ESBoxClipping=pp,y.ESCameraView=_d,y.ESCameraViewCollection=wd,y.ESCameraVisibleRange=vp,y.ESCar=Ed,y.ESCityBasePoint=dv,y.ESClassification=Sd,y.ESClippingPlane=mp,y.ESCustomDiv=Cd,y.ESCzml=fv,y.ESDataMesh=_p,y.ESDatasmithRuntimeModel=Yp,y.ESDirectionMeasurement=Bp,y.ESDistanceMeasurement=yp,y.ESDynamicWater=Jp,y.ESEntityCluster=lv,y.ESExcavate=Ll,y.ESFeatureLayer=Pv,y.ESFireParticleSystem=wp,y.ESForestTileset=Ep,y.ESGaussianSplatting=mv,y.ESGeoDiv=Sp,y.ESGeoDivTextPoi=cv,y.ESGeoExtrudedPolygon=pa,y.ESGeoJson=kl,y.ESGeoLineString=zs,y.ESGeoPoints=zl,y.ESGeoPolygon=le,y.ESGeoRectangle=Cp,y.ESGeoVector=jt,y.ESGeoWater=$p,y.ESGltfModel=xo,y.ESHeatMap=Nd,y.ESHeightLimitAnalysis=uv,y.ESHeightMeasurement=Vp,y.ESHole=iv,y.ESHuman=ga,y.ESHumanPoi=ev,y.ESImageLabel=Pd,y.ESImageryLayer=bp,y.ESJEditingMode=pt,y.ESJLonLatFormat=n0,y.ESJPickedResult=NS,y.ESLabel=An,y.ESLevelRuntimeModel=Kp,y.ESLocalCircle=zp,y.ESLocalPolygon=Gl,y.ESLocalPolygonZ=Up,y.ESLocalRectangle=jp,y.ESLocalSkyBox=Ip,y.ESLocalVector=Fh,y.ESLocalVector2D=Vs,y.ESLocationMeasurement=xp,y.ESMsTileset=ov,y.ESNavigator=gv,y.ESObjectWithLocation=_t,y.ESObjectsManager=Ld,y.ESParticleSystemPrimitive=bd,y.ESPath=Vh,y.ESPathImpl=Mo,y.ESPipeFence=Md,y.ESPipeline=Qp,y.ESPipeserTileset=qp,y.ESPit=Gh,y.ESPlayer=Bh,y.ESPoi2D=Fl,y.ESPoi3D=Mp,y.ESPoiTileset=av,y.ESPolygonFence=Td,y.ESPolygonFlattenedPlane=Tp,y.ESPolygonWithHole=Hp,y.ESRectangle=Wp,y.ESRtsFeatureEditing=sv,y.ESRtsTileset=rv,y.ESScale=hv,y.ESSceneObject=ft,y.ESSceneObjectWithId=u0,y.ESSeparateFoliage=Np,y.ESSkylineAnalysis=yv,y.ESStaticMesh=_v,y.ESSubmergingAnalysis=Op,y.ESSunshineAnalysis=Dp,y.ESSurfaceAreaMeasurement=Xp,y.ESTerrainLayer=Ap,y.ESTestObject=lp,y.ESTextLabel=kh,y.ESUEWidget=Rp,y.ESUnrealActor=Lp,y.ESVideoFusion=Fp,y.ESViewShed=kp,y.ESViewer=Or,y.ESViewerStatusBar=pv,y.ESViewerStatusBarScale=vv,y.ESVisibilityAnalysis=Zp,y.ESVisualObject=se,y.ESVolumeMeasurement=tv,y.ESWidget=Gp,y.EngineObject=va,y.EnumProperty=kt,y.EnumStringsProperty=CS,y.EvalStringProperty=eo,y.Event=N,y.EventListenerHandler=Zd,y.Fetching=Kw,y.FloatDiv=xf,y.FlvJsLoading=Dd,y.FlvProcessing=sw,y.FunctionProperty=St,y.Gif=Wm,y.GifPlayer=qm,y.GifProcessing=Hm,y.GroupPropTreeItem=sp,y.GroupProperty=Et,y.HasOwner=jw,y.HlsJsLoading=Od,y.HlsProcessing=rw,y.IFrameBorderedPosFloatDiv=AE,y.ImageProcessing=Am,y.IntervalDeprecated=pf,y.JsonProperty=gt,y.LeafPropTreeItem=rp,y.ListenerPipe=Qd,y.LocalFileServer=Om,y.LocalRootDir=Nm,y.LongStringProperty=Ff,y.MaximumScreenSpaceErrorProperty=nS,y.MinmaxProperty=PS,y.NearFarScalerProperty=bS,y.NextAnimateFrameEvent=ac,y.NextAnimateFrameWeakEvent=Hv,y.NextMicroTaskEvent=sf,y.NextMicroTaskWeakEvent=Rw,y.NonreactiveJsonStringProperty=Zm,y.Number2Property=ti,y.Number2sProperty=Km,y.Number3Property=Mi,y.Number3sProperty=Lf,y.Number4Property=fr,y.Number4WithUndefinedProperty=cS,y.Number4sProperty=dS,y.NumberProperty=F,y.NumberRangeProperty=IS,y.NumberSliderProperty=ai,y.NumbersProperty=rS,y.ObjPool=tc,y.ObjResetting=BE,y.ObjResettingWithEvent=ke,y.ObservableArray=xu,y.ObservableSet=vc,y.ParamsProperty=Qm,y.PickColorMananger=mm,y.PickedInfo=TS,y.Player=gr,y.PlayerProperty=mc,y.PointerClick=Cf,y.PointerClickDeprecated=im,y.PointerHover=am,y.PointerHoverDeprecated=xE,y.PosFloatDiv=Nf,y.PositionProperty=Xa,y.PositionsProperty=t0,y.PositionsSetPropety=MS,y.Processing=Ze,y.PropTree=C1,y.PropUiTreeManager=Lh,y.Property=to,y.ReactVarProperty=Vt,y.ReactiveVariable=oi,y.RotationProperty=kf,y.SceneObjectFromId=Vf,y.SceneTree=Rl,y.SceneTreeContextMenu=T1,y.SceneTreeItem=Gi,y.SceneTreeItemDragDrop=M1,y.SmartListenerHandler=Eu,y.SmartListenerPipe=Pw,y.SmoothMoveController=XT,y.String2Property=oS,y.String2sProperty=$m,y.String3Property=aS,y.String3sProperty=uS,y.String4Property=hS,y.String4sProperty=lS,y.StringNumberProperty=yS,y.StringNumbersProperty=wS,y.StringProperty=Mt,y.StringsProperty=Jm,y.Throttling=PE,y.ThrottlingWithStartValues=bE,y.TimingDeprecated=tm,y.ToolTipDiv=RE,y.Transition=Ou,y.TransitionDeprecated=tE,y.Tree=Ha,y.TreeItem=Wa,y.TreeItemDragDrop=s0,y.UiTree=Im,y.UiTreeObject=bm,y.UriProperty=Lu,y.VideoProcessing=Fm,y.ViewPlayerProperty=e0,y.ViewerCustomInteraction=cw,y.Watcher=Fu,y.WatcherTools=l0,y.WithUndefinedProperty=Rf,y.XrPlayer=gc,y.Xyzw2Ns=lc,y.addTreesCallFunc=R1,y.animateFrame=sc,y.ary2Ns=$w,y.asyncFuncToCancelablePromise=lE,y.bind=mt,y.bindCustomEditing=h0,y.bindu=Dw,y.booleanPointInPolygon=IT,y.canMoveToTreeItem=Ru,y.canMoveToTreeItems=Cm,y.cancelFuncToCancelablePromise=uE,y.cancelPromise=mf,y.cancelableFetch=Ef,y.cancelableFetchDeprecated=Zv,y.cancelableFetchWithProgress=dE,y.cartesianDistance=S1,y.clamp=cc,y.clamp0_360=Ya,y.clampN180_180=a0,y.complexImageTypes=Lm,y.createAnimateFrame=Tu,y.createAnimateFrameWithStartValues=qa,y.createBottomTriangleElement=Em,y.createCancelablePromise=ja,y.createCloseDiv=wm,y.createEventsCallFunc=Ks,y.createFetching=fE,y.createFetchingWithStartValues=gE,y.createGuid=Ga,y.createInterval=yE,y.createIntervalWithStartValues=wE,y.createNextAnimateFrame=pE,y.createNextAnimateFrameEvent=je,y.createNextAnimateFrameEventCallFunc=Fw,y.createNextAnimateFrameWeakEvent=kw,y.createNextAnimateFrameWithStartValues=vE,y.createNextMicroTask=mE,y.createNextMicroTaskEvent=Aw,y.createNextMicroTaskWeakEvent=Lw,y.createNextMicroTaskWithStartValues=_E,y.createNumbers=uc,y.createProcessingFromAsyncFunc=wn,y.createProcessingFromAsyncFuncWithStartValues=cE,y.createProcessingFromPromiseCreateFunc=fc,y.createProcessingFromPromiseCreateFuncWithStartValues=wf,y.createPropTreeFromSceneObject=P1,y.createSleeping=EE,y.createSleepingWithStartValues=SE,y.createStartFuncFromAsyncFunc=Mu,y.createTimeout=rm,y.createTimeoutWithStartValues=sm,y.cutDownTreesCallFunc=k1,y.czmPixelFormats=Rm,y.debounce=rc,y.defaultGetLocalFilePath=VE,y.defaultInitSceneObjectOnCreatingFunc=DS,y.defaultLight122FromEnvironmentMapManager=up,y.defaultLocalFileServer=Dm,y.defaultStartUpdateFunc=hc,y.defaultUpdateSceneObjectOnPickingFunc=OS,y.defineReactiveProp=gf,y.destroyObject=Vv,y.downloadLink=zw,y.drawPoint=Uo,y.drawRoundRectPath=um,y.drawText=lm,y.drawTextBlock=bf,y.equalsN3=ap,y.every=af,y.extendClassProps=Es,y.fetchArrayBuffer=Ww,y.fetchImage=$v,y.forEach=jr,y.forEachWithBreak=of,y.geoAlong=xT,y.geoArea=tp,y.geoBuffer=m1,y.geoCenterOfMass=MT,y.geoDestination=f1,y.geoDifference=_1,y.geoDistance=md,y.geoHeading=Dl,y.geoIntersect=p1,y.geoLineIntersect=TT,y.geoNearestPointOnLine=OT,y.geoPointToLineDistance=DT,y.geoPolygonFromCircle=y1,y.geoPolygonOverlap=ep,y.geoRhumbDestination=AT,y.geoRhumbDistance=g1,y.geoRhumbHeading=RT,y.geoUnion=v1,y.getColorHexStr=Au,y.getCompleteReactParams=nc,y.getDefaultValue=FS,y.getDistancesFromPositions=Al,y.getDomEventCurrentTargetPos=xi,y.getDrawRect=zo,y.getEventFromPromise=rE,y.getEventPosInCurrentTarget=Va,y.getExtProp=yn,y.getFileArrayBuffer=Tm,y.getFileJson=Mm,y.getFileText=Of,y.getFloatDivPool=Tf,y.getGeoBoundingSphereFromPositions=E1,y.getIterator=Cu,y.getMidpoint=NT,y.getMinMaxCorner=w1,y.getMinMaxPosition=qw,y.getPromiseCancel=za,y.getPromiseFromEvent=nE,y.getPromiseFromProcessing=Sf,y.getReactFuncs=ws,y.getSceneObjectTreeItem=AS,y.getSubEntriesFromDir=xm,y.getTypeFromImageUri=ow,y.getValueFromProps=Xv,y.getXyzFromPostion=ip,y.growthSimulationCallFunc=G1,y.hasSameTags=o0,y.hasSameViewerTags=Ps,y.imageToCanvas=cm,y.inOrderRunning=kS,y.interval=nf,y.isJSON=Gf,y.isPromiseCancelable=Ua,y.isXML=LS,y.lbhToWebMerc=z2,y.lbhToXyz=Yr,y.length=hf,y.lerpAngle=yc,y.lerpRotation=Bf,y.loadGifFrames=Um,y.loadJs=cf,y.map=b1,y.max=Ss,y.min=Qs,y.moveToTreeItem=pc,y.moveToTreeItems=Pm,y.nextAnimateFrame=Ba,y.nextMicroTask=Su,y.objsIterator=Bo,y.oneTimeWarning=Fa,y.optionsStr=iN,y.pairToPromise=_f,y.pluckProperty=uf,y.react=H,y.reactArray=It,y.reactArrayCollection=xw,y.reactArrayCollectionWithUndefined=tf,y.reactArrayWithUndefined=ye,y.reactDeepArray=ec,y.reactDeepArrayWithUndefined=$s,y.reactJson=Rt,y.reactJsonCollection=Mw,y.reactJsonCollectionWithUndefined=Tw,y.reactJsonWithUndefined=de,y.reactPlainObject=bw,y.reactPlainObjectWithUndefined=Iw,y.reactPosition2Ds=op,y.reactPosition2DsSet=Nw,y.reactPositions=ic,y.reactPositionsSet=Wv,y.reduce=Iu,y.registerCreatedEventUpdate=LT,y.registerEventCtor=zv,y.registerEventUpdate=FT,y.removeAllTreesCallFunc=L1,y.requestAnimationFrameTimeStampTest=Uw,y.rpToap=RS,y.saveOnBrowser=Vw,y.setCanvasUniformColor=dm,y.setExtProp=Ur,y.setPromiseCancel=Zs,y.setSceneObjectTreeItem=_c,y.setValueFromProps=Bw,y.sleep=Nu,y.sleepDeprecated=Qw,y.step=Vo,y.stepProcessing=CE,y.throttle=lf,y.timeout=rf,y.track=Y,y.uint32ToUint8s=pm,y.uint8ToHexStr=Du,y.uint8sToUint32=vm,y.updateTreeParamsCallFunc=F1,y.webMercToLbh=U2,y.xyz2N2=Hw,y.xyz2N3=Xw,y.xyzToLbh=r_,y.xyzw2N4=Yw,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),y}({});
package/dist/earthsdk3.js CHANGED
@@ -39,7 +39,7 @@ function ld(r) {
39
39
  }
40
40
  let Qa;
41
41
  try {
42
- const r = "earthsdk3", e = "3.5.0-beta.16", t = "2025-10-22T09:16:13.000Z", n = "北京西部世界科技有限公司", i = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", s = "cdf0459633f31b3c6dce81ced3cf33b7abab0ce4", a = ((Date.now() - 1761124573e3) / 36e5).toFixed(1), u = `%c🌏 ${r}%c ${e}.${s.slice(0, 8)}.${t} (距今${a}个小时)
42
+ const r = "earthsdk3", e = "3.5.0-beta.17", t = "2025-10-22T09:45:21.000Z", n = "北京西部世界科技有限公司", i = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", s = "04850981037299047e1026988448786f390a045c", a = ((Date.now() - 1761126321e3) / 36e5).toFixed(1), u = `%c🌏 ${r}%c ${e}.${s.slice(0, 8)}.${t} (距今${a}个小时)
43
43
  %c${i ? i + `
44
44
  ` : ""}当前网站正在使用${r},此软件版权归${n}所有
45
45
  `;
@@ -53,7 +53,7 @@ try {
53
53
  },
54
54
  // @ts-ignore
55
55
  get gituri() {
56
- return GITURI_ && GITURI_.replace("${commitId}", "cdf0459633f31b3c6dce81ced3cf33b7abab0ce4");
56
+ return GITURI_ && GITURI_.replace("${commitId}", "04850981037299047e1026988448786f390a045c");
57
57
  },
58
58
  // @ts-ignore
59
59
  get info() {
@@ -61,7 +61,7 @@ try {
61
61
  },
62
62
  // @ts-ignore
63
63
  get date() {
64
- return "2025-10-22T09:16:13.000Z";
64
+ return "2025-10-22T09:45:21.000Z";
65
65
  },
66
66
  // @ts-ignore
67
67
  get author() {
@@ -69,7 +69,7 @@ try {
69
69
  },
70
70
  // @ts-ignore
71
71
  get version() {
72
- return "3.5.0-beta.16";
72
+ return "3.5.0-beta.17";
73
73
  },
74
74
  // @ts-ignore
75
75
  get name() {
@@ -77,7 +77,7 @@ try {
77
77
  },
78
78
  // @ts-ignore
79
79
  get commitId() {
80
- return "cdf0459633f31b3c6dce81ced3cf33b7abab0ce4";
80
+ return "04850981037299047e1026988448786f390a045c";
81
81
  },
82
82
  /**
83
83
  * 打印版权信息到控制台
@@ -38433,7 +38433,7 @@ const kr = class kr extends et {
38433
38433
  defaultMenu: "basic",
38434
38434
  basic: [
38435
38435
  ...t.basic,
38436
- new nt([this, "data"], kr.defaults.data, zE, "数据", !0),
38436
+ new nt([this, "data"], "数据", kr.defaults.data, zE, !0),
38437
38437
  new nt([this, "uri"], "路径", "${earthsdk3-assets-script-dir}/assets/misc/simple.czml", void 0, !0),
38438
38438
  new X([this, "clockEnabled"], "启用", !1),
38439
38439
  new M([this, "multiplier"], "倍速", kr.defaults.multiplier),
@@ -1,7 +1,7 @@
1
- (function(g,Gn){typeof exports=="object"&&typeof module<"u"?Gn(exports,require("js-binary-schema-parser"),require("proj4"),require("@turf/turf")):typeof define=="function"&&define.amd?define(["exports","js-binary-schema-parser","proj4","@turf/turf"],Gn):(g=typeof globalThis<"u"?globalThis:g||self,Gn(g.EarthSDK3={},g.jsBinarySchemaParser,g.proj4,g.turf))})(this,function(g,Gn,Js,jy){"use strict";var Tb=Object.defineProperty;var Nb=(g,Gn,Js)=>Gn in g?Tb(g,Gn,{enumerable:!0,configurable:!0,writable:!0,value:Js}):g[Gn]=Js;var d=(g,Gn,Js)=>Nb(g,typeof Gn!="symbol"?Gn+"":Gn,Js);var ei;function zy(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const Ke=zy(jy);function Uy(){const r=navigator.userAgent;let e="Unknown";/Windows/.test(r)?e="Windows":/Macintosh/.test(r)?e="MacOS":/Linux/.test(r)?e="Linux":/Android/.test(r)?e="Android":/iOS|iPhone|iPad|iPod/.test(r)&&(e="iOS");let t="Unknown";return/x64|x86_64|Win64|WOW64/.test(r)?t="x64":/x86|i686|Win32/.test(r)?t="x86":/arm64|aarch64/.test(r)?t="arm64":/arm/.test(r)&&(t="arm"),{os:e.toLocaleLowerCase(),arch:t.toLocaleLowerCase()}}const Gy=Date.now();function lp(r){const{os:e,arch:t}=Uy(),n={version:r.version,commitdate:r.date,commitId:r.commitId,runningTime:(Date.now()-Gy)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:e,arch:t},s={method:"GET",headers:new Headers,redirect:"follow"},o=window.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(a=>a.text()).then(a=>console.log(a)).catch(a=>console.log("error",a))}g.copyright=void 0;try{const r="earthsdk3",e="3.5.0-beta.16",t="2025-10-22T09:16:13.000Z",n="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="cdf0459633f31b3c6dce81ced3cf33b7abab0ce4",a=((Date.now()-1761124573e3)/36e5).toFixed(1),u=`%c🌏 ${r}%c ${e}.${s.slice(0,8)}.${t} (距今${a}个小时)
1
+ (function(g,Gn){typeof exports=="object"&&typeof module<"u"?Gn(exports,require("js-binary-schema-parser"),require("proj4"),require("@turf/turf")):typeof define=="function"&&define.amd?define(["exports","js-binary-schema-parser","proj4","@turf/turf"],Gn):(g=typeof globalThis<"u"?globalThis:g||self,Gn(g.EarthSDK3={},g.jsBinarySchemaParser,g.proj4,g.turf))})(this,function(g,Gn,Js,jy){"use strict";var Tb=Object.defineProperty;var Nb=(g,Gn,Js)=>Gn in g?Tb(g,Gn,{enumerable:!0,configurable:!0,writable:!0,value:Js}):g[Gn]=Js;var d=(g,Gn,Js)=>Nb(g,typeof Gn!="symbol"?Gn+"":Gn,Js);var ei;function zy(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const Ke=zy(jy);function Uy(){const r=navigator.userAgent;let e="Unknown";/Windows/.test(r)?e="Windows":/Macintosh/.test(r)?e="MacOS":/Linux/.test(r)?e="Linux":/Android/.test(r)?e="Android":/iOS|iPhone|iPad|iPod/.test(r)&&(e="iOS");let t="Unknown";return/x64|x86_64|Win64|WOW64/.test(r)?t="x64":/x86|i686|Win32/.test(r)?t="x86":/arm64|aarch64/.test(r)?t="arm64":/arm/.test(r)&&(t="arm"),{os:e.toLocaleLowerCase(),arch:t.toLocaleLowerCase()}}const Gy=Date.now();function lp(r){const{os:e,arch:t}=Uy(),n={version:r.version,commitdate:r.date,commitId:r.commitId,runningTime:(Date.now()-Gy)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:e,arch:t},s={method:"GET",headers:new Headers,redirect:"follow"},o=window.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(a=>a.text()).then(a=>console.log(a)).catch(a=>console.log("error",a))}g.copyright=void 0;try{const r="earthsdk3",e="3.5.0-beta.17",t="2025-10-22T09:45:21.000Z",n="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="04850981037299047e1026988448786f390a045c",a=((Date.now()-1761126321e3)/36e5).toFixed(1),u=`%c🌏 ${r}%c ${e}.${s.slice(0,8)}.${t} (距今${a}个小时)
2
2
  %c${i?i+`
3
3
  `:""}当前网站正在使用${r},此软件版权归${n}所有
4
- `;g.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","cdf0459633f31b3c6dce81ced3cf33b7abab0ce4")},get info(){return u},get date(){return"2025-10-22T09:16:13.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.16"},get name(){return"earthsdk3"},get commitId(){return"cdf0459633f31b3c6dce81ced3cf33b7abab0ce4"},print(){console.info(this.info,`
4
+ `;g.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","04850981037299047e1026988448786f390a045c")},get info(){return u},get date(){return"2025-10-22T09:45:21.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.17"},get name(){return"earthsdk3"},get commitId(){return"04850981037299047e1026988448786f390a045c"},print(){console.info(this.info,`
5
5
  font-size: 18px;
6
6
  font-weight: 1000;
7
7
  line-height: 1;
@@ -484,7 +484,7 @@ timePosRots是一个内部包含三个元素的数组,第一个表示时间戳
484
484
  ${yy}
485
485
  \`\`\`
486
486
 
487
- `,ml=Date.now();new Date(ml).toISOString(),new Date(ml+24*60*60*1e3).toISOString();const li=class li extends et{constructor(t){super(t);d(this,"_flyToEvent",this.disposeVar(new N));d(this,"_resetClockEvent",this.disposeVar(new N))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new nt([this,"data"],li.defaults.data,LS,"数据",!0),new nt([this,"uri"],"路径","${earthsdk3-assets-script-dir}/assets/misc/simple.czml",void 0,!0),new Y([this,"clockEnabled"],"启用",!1),new R([this,"multiplier"],"倍速",li.defaults.multiplier),new Y([this,"autoResetClock"],"自动设置时钟",!0),new no([this,"startTime"],"开始时间",li.defaults.startTime,!0),new no([this,"stopTime"],"结束时间",li.defaults.stopTime,!0),new no([this,"currentTime"],"当前时间",li.defaults.currentTime,!0),new St([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep","SYSTEM_CLOCK_MULTIPLIER"),new St([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange","UNBOUNDED"),new Y([this,"shouldAnimate"],"是否启用动画",!1)],general:[...t.general,new Y([this,"show"],"是否显示",!0),new Y([this,"collision"],"开启碰撞",!1),new Y([this,"allowPicking"],"允许拾取",!1)],more:[...t.more,new lt(["number"],n=>this.flyTo(n),[1e3],"飞入"),new lt([],()=>this.resetClock(),[],"重设时钟"),new ys([this,"loadFuncStr"],"loadFnStr",yy,AS,!0)]}}};d(li,"createDefaultProps",()=>({show:!0,uri:void 0,allowPicking:!1,data:Yt(RS),autoResetClock:!0,clockEnabled:!1,startTime:ml,stopTime:ml+24*60*60*1e3,currentTime:ml,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...et.createDefaultProps()})),d(li,"type",li.register("ESCzml",li,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"}));let Yf=li;const fu=class fu extends et{getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([]),new Y([this,"show"],"是否显示"),new R([this,"cssSize"],"尺寸"),new Ae([this,"cssPosition"],"位置"),new Du([this,"imgUrl"],"图片地址")]}}};d(fu,"createDefaultProps",()=>({...et.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:et.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")})),d(fu,"type",fu.register("ESNavigator",fu,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"}));let Jf=fu;const Ai=class Ai extends et{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([],"通用","通用"),new Y([this,"show"],"是否显示",Ai.defaults.show),new R([this,"height"],"高度",Ai.defaults.height,!0),new R([this,"fontSize"],"文字大小",Ai.defaults.fontSize,!0),new Ot([this,"bgColor"],"背景颜色",Ai.defaults.bgColor,!0)]}}};d(Ai,"createDefaultProps",()=>({...et.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:dt([71/255,71/255,71/255,.8])})),d(Ai,"type",Ai.register("ESViewerStatusBar",Ai,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let Zf=Ai;const Fi=class Fi extends et{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([],"通用","通用"),new Y([this,"show"],"是否显示",Fi.defaults.show),new R([this,"height"],"高度",Fi.defaults.height,!0),new R([this,"fontSize"],"文字大小",Fi.defaults.fontSize,!0),new Ot([this,"bgColor"],"背景颜色",Fi.defaults.bgColor,!0)]}}};d(Fi,"createDefaultProps",()=>({...et.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:dt([71/255,71/255,71/255,.8])})),d(Fi,"type",Fi.register("ESViewerStatusBarScale",Fi,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let Kf=Fi;const pu=class pu extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new pt([this,"url"],"路径","",!0),new R([this,"progress"],"进度",0,!1,!0)]}}};d(pu,"createDefaultProps",()=>({...st.createDefaultProps(),url:"",progress:0})),d(pu,"type",pu.register("ESGaussianSplatting",pu,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"}));let Qf=pu;const jo=class jo extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new pt([this,"mesh"],"mesh地址",jo.defaults.mesh)]}}};d(jo,"createDefaultProps",()=>({...st.createDefaultProps(),mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"})),d(jo,"type",jo.register("ESStaticMesh",jo,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"}));let $f=jo;const gu=class gu extends Dt{constructor(t){super(t);d(this,"_startEvent",this.dv(new N));d(this,"_clearEvent",this.dv(new N));d(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new bo),this.ad(this.components.disposableAdd(this._eSGeoExtrudedPolygon)),this.eSGeoExtrudedPolygon.perPositionHeight=!0,this.eSGeoExtrudedPolygon.extrudedHeight=0,this.stroked=!0,this.strokeWidth=2,this.strokeColor=[1,0,0,1],this.ad(z([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(z([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(z([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(z([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(z([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(z([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(z([this.eSGeoExtrudedPolygon,"points"],[this,"points"])),this.ad(this.clearEvent.don(()=>{this.points=void 0,this.depths=void 0,this.windowPositions=void 0}))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get eSGeoExtrudedPolygon(){return this._eSGeoExtrudedPolygon}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new lt([],()=>this.start(),[],"开始分析"),new lt([],()=>this.clear(),[],"清除分析"),new nt([this,"windowPositions"],"屏幕坐标",[],void 0,!1,!0),new nt([this,"depths"],"深度值",[],void 0,!1,!0),new R([this,"radius"],"半径",1e4,!0)]}}};d(gu,"createDefaultProps",()=>({...Dt.createDefaultProps(),windowPositions:jd([]),depths:ne([]),radius:V(1e4)})),d(gu,"type",gu.register("ESSkylineAnalysis",gu,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"}));let tp=gu;const ls=class ls extends Wt{constructor(e){super(e)}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new nt([this,"data"],"数据",[],void 0,!0),new nt([this,"gradient"],"渐变",ls.defaults.gradient,void 0,!0),new R([this,"radius"],"半径",ls.defaults.radius,void 0,!0),new R([this,"blur"],"模糊",ls.defaults.blur,!0),new Y([this,"is3D"],"is3D",!1,!0)]}}};d(ls,"createDefaultProps",()=>({...Wt.createDefaultProps(),is3D:V(!1),data:Il([]),gradient:Yt({".5":"green",".7":"yellow",".95":"red"}),radius:V(10),blur:V(.85)})),d(ls,"type",ls.register("ESHeatMap",ls,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"}));let Gc=ls;const zo=class zo extends Dt{constructor(t){super(t);d(this,"editingBindMode","scatter")}};d(zo,"createDefaultProps",()=>({...Dt.createDefaultProps(),pointed:!0})),d(zo,"type",zo.register("ESGeoPoints",zo,{chsName:"地理点集合",tags:["ESObjects","_ES_Impl_Cesium"],description:"地图中的可视化地理点集合"})),d(zo,"supportEditingModes",[...Dt.supportEditingModes,rt.ScatterAppend,rt.ScatterModify]);let vl=zo;const _y=async(r,e=[],t)=>{const n=[];for(const i of e){const{coordinates:s}=i.geometry;for(const o of s){const a=await Promise.all(o.map(async u=>{let l=u[2]??0;if(t)if(t.type==="absolute")l=t.height??l;else if(t.type==="relative"){const c=await r.getTerrainHeight([u[0],u[1]])??0;l=(t.height??l)+c}else t.type==="terrain"&&(l=await r.getTerrainHeight([u[0],u[1]])??0);return[u[0],u[1],l]}));n.push({...i,points:a})}}return n},wy=async(r,e=[],t)=>await Promise.all(e.map(async n=>{var u,l,c,h,f,p,v,C,S;const i=((u=n.geometry)==null?void 0:u.x)??((c=(l=n.geometry)==null?void 0:l.coordinates)==null?void 0:c[0]),s=((h=n.geometry)==null?void 0:h.y)??((p=(f=n.geometry)==null?void 0:f.coordinates)==null?void 0:p[1]);let a=((v=n.geometry)==null?void 0:v.z)??((S=(C=n.geometry)==null?void 0:C.coordinates)==null?void 0:S[2])??0;if(t)if(t.type==="absolute")a=t.height??a;else if(t.type==="relative"){const P=await r.getTerrainHeight([i,s])??0;a=(t.height??a)+P}else t.type==="terrain"&&(a=await r.getTerrainHeight([i,s])??0);return{...n,points:[i,s,a]}})),Ey=async(r,e=[],t)=>{const n=[];return await Promise.all(e.map(async i=>{const{coordinates:s}=i.geometry;await Promise.all(s.map(async o=>{const a=await Promise.all(o.map(async u=>{let l=u[2]??0;if(t)if(t.type==="absolute")l=t.height??l;else if(t.type==="relative"){const c=await r.getTerrainHeight([u[0],u[1]])??0;l=(t.height??l)+c}else t.type==="terrain"&&(l=await r.getTerrainHeight([u[0],u[1]])??0);return[u[0],u[1],l]}));n.push({...i,points:a})}))})),n};function FS(r){const e=Ke.lineString(r),t=Ke.length(e),n=Ke.along(e,t/2);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function kS(r,e){const t=Ke.lineString(r),n=Ke.length(t),i=Math.floor(n/e),s=[];if(s.push(r[0]),i<1)return[r[0]];for(let o=1;o<i;o+=1){const a=Ke.along(t,n*(o/i));s.push([a.geometry.coordinates[0],a.geometry.coordinates[1],a.geometry.coordinates[2]||0])}return s}function VS(r){const e=[...r];JSON.stringify(r[0])!==JSON.stringify(r[r.length-1])&&e.push(r[0]);const t=Ke.polygon([e]),n=Ke.center(t);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function Cy(r,e,t){const n=r.dv(new Aa);for(const i in t)i!=="type"&&(n[i]=t[i]);n.position=e,r.d(r.components.disposableAdd(n))}function ep(r,e,t,n){let i=n.textTemplate||n.symbol.text||"";const s=/{{(.*?)}}/;for(;s.test(i);){const c=i.match(s);if(c){const h=c[1].trim(),f=t[`${h}`]||"-";i=i.replace(c[0],f)}}let o=n.symbol;const{minVisibleDistance:a,maxVisibleDistance:u}=n;a&&u&&(o={...o,minVisibleDistance:a,maxVisibleDistance:u});const l={...o,text:i};Cy(r,e,l)}function Ba(r,e){const t={width:null,height:null,color:null,opacity:null,rotation:null};return e.forEach(n=>{n.type==="size"?n.axis==="width"?t.width=r[n.field]||null:n.axis==="height"&&(t.height=r[n.field]||null):n.type==="color"?t.color=r[n.field]||null:n.type==="opacity"?t.opacity=r[n.field]||null:n.type==="rotation"&&(t.rotation=r[n.field]||null)}),t}function np(r,e,t){const i={...e.symbol};if(t&&t.length>0){const s=Ba(r,t);for(let o in s)i[o]!==void 0&&s[o]!==null&&(i[o]=s[o])}return i}function rp(r,e,t){var l,c;const n=e,{uniqueValueInfos:i,field:s,fieldDelimiter:o,defaultSymbol:a}=n;let u={...a};if(Array.isArray(s)){const f=s.map(p=>r[p]??"").join(o);u=((l=i.find(p=>p.value==f))==null?void 0:l.symbol)||a}else u=((c=i.find(h=>h.value==r[s]))==null?void 0:c.symbol)||a;if(t&&t.length>0){const h=Ba(r,t);for(let f in h)u[f]!==void 0&&h[f]!==null&&(u[f]=h[f])}return u}function ip(r,e,t){const n=e,{classBreakInfos:i,field:s,defaultSymbol:o}=n;let a=o;const u=r[s];if(u===void 0||typeof u!="number")a=o;else{const l=i.find(c=>u<=c.maxValue&&u>=c.minValue);l?a=l.symbol:a=o}if(t&&t.length>0){const l=Ba(r,t);for(let c in l)a[c]!==void 0&&l[c]!==null&&(a[c]=l[c])}return a}function BS(r,e){function t(l,c,h,f){const p=w=>w*Math.PI/180,v=w=>w*180/Math.PI,C=p(l),S=p(h),P=p(f-c),y=Math.sin(P)*Math.cos(S),_=Math.cos(C)*Math.sin(S)-Math.sin(C)*Math.cos(S)*Math.cos(P),m=Math.atan2(y,_);return(v(m)+360)%360}function n(l,c,h,f,p){const C=b=>b*Math.PI/180,S=b=>b*180/Math.PI,P=f/6371e3,y=C(p),_=C(l),m=C(c),w=Math.asin(Math.sin(_)*Math.cos(P)+Math.cos(_)*Math.sin(P)*Math.cos(y)),E=m+Math.atan2(Math.sin(y)*Math.sin(P)*Math.cos(_),Math.cos(P)-Math.sin(_)*Math.sin(w));return{lat:S(w),lng:S(E),alt:h}}function i(l){const c=[];l.length>1&&c.push(t(l[0].lat,l[0].lng,l[1].lat,l[1].lng));for(let h=1;h<l.length-1;h++){const f=t(l[h-1].lat,l[h-1].lng,l[h].lat,l[h].lng),p=t(l[h].lat,l[h].lng,l[h+1].lat,l[h+1].lng);let v=(f+p)/2;Math.abs(f-p)>180&&(v=(v+180)%360),c.push(v)}return l.length>1&&c.push(t(l[l.length-2].lat,l[l.length-2].lng,l[l.length-1].lat,l[l.length-1].lng)),l.length===1&&c.push(0),c}if(!r||r.length<2)throw new Error("至少需要两个点才能生成路径");if(e<=0)throw new Error("宽度必须大于0");const s=e/2,o=i(r),a=[],u=[];for(let l=0;l<r.length;l++){const c=(o[l]+90)%360,h=(o[l]+270)%360,f=r[l].alt!==void 0?r[l].alt:0;a.push(n(r[l].lat,r[l].lng,f,s,c)),u.push(n(r[l].lat,r[l].lng,f,s,h))}return a.concat(u.reverse())}function jS(r,e,t,n){function i(C){return C*(Math.PI/180)}const s=6378137,o=i(r),a=i(e),u=i(t),l=i(n),c=u-o,h=l-a,f=Math.sin(c/2)**2+Math.cos(o)*Math.cos(u)*Math.sin(h/2)**2,p=2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f));return s*p}const Sy=(r,e,t)=>Array.isArray(e)?e.map(s=>r[s]??"").join(t):r[e]??"";function by(r,e){const n={...e.symbol};return{points:r.map(i=>i.points),symbol:n}}function Py(r,e){const t=e,{uniqueValueInfos:n,field:i,fieldDelimiter:s,defaultSymbol:o}=t,a=[],u=n.reduce((c,h)=>{const f=h.value.toString();return c[f]={points:[],value:h.value,symbol:h.symbol},c},{});for(let c=0;c<r.length;c++){const h=r[c],f=Sy(h,i,s);if(f!==void 0&&f!==""){const p=u[f.toString()];p?p.points.push(h.points):a.push(h.points)}else a.push(h.points)}const l=[];for(let c in u){const{points:h,symbol:f}=u[c];h.length>0&&l.push({points:h,symbol:f})}return a.length>0&&l.push({points:a,symbol:o}),l}function Iy(r,e){const t=e,{classBreakInfos:n,field:i,defaultSymbol:s}=t,o=[],a=n.map(l=>({...l,points:[]}));for(let l=0;l<r.length;l++){const c=r[l],h=c[i];if(h===void 0||typeof h!="number")o.push(c.points);else{const f=a.findIndex(p=>h<=p.maxValue&&h>=p.minValue);f!==-1?a[f].points.push(c.points):o.push(c.points)}}const u=[];return a.forEach(l=>{l.points.length>0&&u.push({points:l.points,symbol:l.symbol})}),o.length>0&&u.push({points:o,symbol:s}),u}function zS(r,e,t=[]){const i={...e.symbol},s=r.map(o=>{const a=Ba(o,t);return{position:o.points,rotation:a.rotation||i.rotation||[0,0,0],scale:i.scale||[1,1,1]}});return{url:i.url,locations:s}}function US(r,e,t=[]){const n=e,{uniqueValueInfos:i,field:s,fieldDelimiter:o}=n,a=n.defaultSymbol,u=[],l=i.reduce((h,f)=>{const p=f.value.toString();return h[p]={locations:[],value:f.value,symbol:f.symbol},h},{});for(let h=0;h<r.length;h++){const f=r[h],p=Sy(f,s,o);if(p){const v=l[p.toString()];if(v){const C=Ba(f,t);v.locations.push({position:f.points,rotation:C.rotation||a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else u.push({position:f.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else u.push({position:f.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}const c=[];for(let h in l){const{locations:f,symbol:p}=l[h];f.length>0&&c.push({url:p.url,locations:f})}return u.length>0&&c.push({url:a.url,locations:u}),c}function GS(r,e,t=[]){const n=e,{classBreakInfos:i,field:s}=n,o=n.defaultSymbol,a=[],u=i.map(c=>({...c,locations:[]}));for(let c=0;c<r.length;c++){const h=r[c],f=h[s];if(f===void 0||typeof f!="number")a.push({position:h.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]});else{const p=u.findIndex(v=>f<=v.maxValue&&f>=v.minValue);if(p!==-1){const v=Ba(h,t);u[p].locations.push({position:h.points,rotation:v.rotation||o.rotation||[0,0,0],scale:u[p].symbol.scale||[1,1,1]})}else a.push({position:h.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]})}}const l=[];return u.forEach(c=>{c.locations.length>0&&l.push({url:c.symbol.url,locations:c.locations})}),a.length>0&&l.push({url:o.url,locations:a}),l}class WS extends B{constructor(t,n,i,s){super();d(this,"labelingInfo");this.sceneObject=t;const o=n;if(s&&hi(o,a=>{this.renderLabel(a,s)}),i)if(i.type==="simple"){const{visualVariables:a}=i;if(i.symbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!");const u=by(o,i);this._simplePointAllRender(u.points,u.symbol);return}if(i.symbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!");const u=by(o,i);this._imageAllRender(u.points,u.symbol);return}if(i.symbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!");const{url:u,locations:l}=zS(o,i,a);this._modelAllRender(u,l);return}for(let u=0;u<o.length;u++){const l=np(o[u],i,a);this.render(o[u],l)}}else if(i.type==="unique-value"){const{visualVariables:a}=i;if(i.uniqueValueInfos.findIndex(h=>h.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),Py(o,i).forEach(({points:f,symbol:p})=>{this._simplePointAllRender(f,p)});return}if(i.uniqueValueInfos.findIndex(h=>h.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),Py(o,i).forEach(({points:f,symbol:p})=>{this._imageAllRender(f,p)});return}if(i.uniqueValueInfos.findIndex(h=>h.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),US(o,i,a).forEach(({url:f,locations:p})=>{this._modelAllRender(f,p)});return}for(let h=0;h<o.length;h++){const f=rp(o[h],i,a);this.render(o[h],f)}}else if(i.type==="class-breaks"){const{visualVariables:a}=i;if(i.classBreakInfos.findIndex(h=>h.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),Iy(o,i).forEach(({points:f,symbol:p})=>{this._simplePointAllRender(f,p)});return}if(i.classBreakInfos.findIndex(h=>h.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),Iy(o,i).forEach(({points:f,symbol:p})=>{this._imageAllRender(f,p)});return}if(i.classBreakInfos.findIndex(h=>h.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),GS(o,i,a).forEach(({url:f,locations:p})=>{this._modelAllRender(f,p)});return}for(let h=0;h<o.length;h++){const f=ip(o[h],i,a);this.render(o[h],f)}}else if(i.type==="heatmap"){const{field:a,fieldValueMax:u,fieldValueMin:l}=i;console.time();const c=o.map(h=>{const{points:f}=h;if(a&&typeof a=="string"){let p=h[a];typeof p=="number"&&(typeof u=="number"&&p>u&&(p=u),typeof l=="number"&&p<l&&(p=l),f[2]=p)}return f});this.renderHeatmap(c,i)}else console.error("PointLayer: renderer type is not supported")}renderLabel(t,n){const{points:i}=t;ep(this.sceneObject,i,t,n)}renderHeatmap(t,n){const{is3D:i,radius:s,blur:o,gradient:a}=n,u=this.dv(new Gc);this.d(this.sceneObject.components.disposableAdd(u)),u.is3D=i,u.radius=s,u.blur=o,a&&(u.gradient={...a}),u.data=t}render(t,n){n.type==="simple-point"?this._simplePointRender(t,n):n.type==="ESImageLabel"?this._simpleImageRender(t,n):n.type==="ESGltfModel"?this._simpleModelRender(t,n):n.type==="ESTextLabel"?Cy(this.sceneObject,t.points,n):n.type==="ESParticleSystemPrimitive"?this._simpleParticleRender(t,n):console.error(" PointLayer: symbol type is not supported")}_simplePointRender(t,n){const{points:i}=t,{size:s,color:o,outlineColor:a,outlineWidth:u}=n,l=this.dv(new vl);this.d(this.sceneObject.components.disposableAdd(l)),l.pointed=!0,l.pointOutlineColor=a,l.pointOutlineWidth=u,l.pointSize=s,l.pointColor=o,l.allowPicking=(n==null?void 0:n.allowPicking)??!0,l.extras={selected:!1},l.points=[i]}_simplePointAllRender(t,n){const{size:i,color:s,outlineColor:o,outlineWidth:a}=n,u=this.dv(new vl);this.d(this.sceneObject.components.disposableAdd(u)),u.pointed=!0,u.pointOutlineColor=o,u.pointOutlineWidth=a,u.pointSize=i,u.pointColor=s,u.allowPicking=(n==null?void 0:n.allowPicking)??!0,u.points=[...t]}_simpleImageRender(t,n){const{points:i}=t,{rotation:s,offset:o,size:a,url:u,screenRender:l,anchor:c,renderMode:h,rotationType:f}=n,p=this.dv(new kc),v=this.dv(new Aa);this.d(this.sceneObject.components.disposableAdd(p)),this.d(this.sceneObject.components.disposableAdd(v)),p.url=u,p.renderMode=h??0,s&&(p.rotation=s),o&&(p.offset=o),p.size=a||[32,32],c&&(p.anchor=c),f&&(p.rotationType=f),p.screenRender=l??!0,p.allowPicking=(n==null?void 0:n.allowPicking)??!0,p.extras={selected:!1},p.position=[...i],p.sizeByContent=!1,v.allowPicking=(n==null?void 0:n.allowPicking)??!0;const C=a?Math.max(...a)+10:Math.max(...p.size)+10;v.sizeByContent=!1,v.screenRender=!0,v.size=[C,C],v.borderRadius=[C,C,C,C],v.padding=[C/2,C/2,C/2,C/2],v.borderWidth=C/10,v.offset=[0,C/10+5],v.text="",v.backgroundColor=[0,0,0,0],v.borderColor=[0,0,0,0]}_imageAllRender(t,n){const i={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:t}}]},s=this.dv(new fl);this.d(this.sceneObject.components.disposableAdd(s));const o=this.dv(new Aa);this.d(this.sceneObject.components.disposableAdd(o)),s.textDefaultText="";const{offset:a,size:u,url:l,anchor:c}=n;s.imageUrl=l,c&&(s.imageAnchor=c),a&&(s.imageOffset=a),s.imageSize=u||[32,32],s.url=i,s.allowPicking=(n==null?void 0:n.allowPicking)??!0,s.extras={selected:!1},o.allowPicking=!0;const h=u?Math.max(...u)+10:Math.max(...s.imageSize)+10;o.sizeByContent=!1,o.size=[h,h],o.borderRadius=[h,h,h,h],o.padding=[h/2,h/2,h/2,h/2],o.borderWidth=h/10,o.offset=[0,h/10+5],o.text="",o.backgroundColor=[0,0,0,0],o.borderColor=[0,0,0,0]}_simpleModelRender(t,n){const{points:i}=t,{rotation:s,scale:o,url:a}=n,u=this.dv(new Vs);this.d(this.sceneObject.components.disposableAdd(u)),u.url=a,s&&(u.rotation=s),o&&(u.scale=o),u.position=[...i]}_modelAllRender(t,n){const i=this.dv(new Vs);this.d(this.sceneObject.components.disposableAdd(i)),i.url=t,i.instances=n}_simpleParticleRender(t,n){const{points:i}=t,s=this.dv(new Vc);this.d(this.sceneObject.components.disposableAdd(s)),s.position=[...i],Object.keys(n).forEach(o=>{s[o]=n[o]})}}class qS extends B{constructor(e,t,n,i){super(),this.sceneObject=e;const s=t;if(i&&hi(s,o=>{this.renderLabel(o,i)}),n)if(n.type==="simple"){const{visualVariables:o}=n;hi(s,a=>{const u=np(a,n,o);this.render(a,u)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;hi(s,a=>{const u=rp(a,n,o);this.render(a,u)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;hi(s,a=>{const u=ip(a,n,o);this.render(a,u)})}else console.error("PolyLineLayer: renderer type is not supported")}render(e,t){console.log("PolyLineLayer: render",e,t),t.type==="simple-line"?this._simpleLineRender(e,t):t.type==="ESPolygonFence"?this._esPolygonFenceRender(e,t):t.type==="ESPipeFence"?this._esPipeFenceRender(e,t):t.type==="ESPath"?this._esPathRender(e,t):t.type==="ESlineInterpolationModel"?this._eslineInterpolationModelRender(e,t):t.type==="ESlineWall"?this._eslineWallRender(e,t):console.error("PolyLineLayer: symbol type is not supported")}_simpleLineRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new is);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...n],i.stroked=!0,i.strokeColor=t.color,i.strokeWidth=t.width||1,i.allowPicking=(t==null?void 0:t.allowPicking)??!0,i.extras={selected:!1}}_esPolygonFenceRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new Uc);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...n],i.height=t.height,i.materialMode=t.materialMode}_esPipeFenceRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new zc);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...n],i.height=t.height,i.width=t.width,i.materialMode=t.materialMode}_esPathRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new Va),s=this.dv(new ka);if(this.d(this.sceneObject.components.disposableAdd(i)),this.d(this.sceneObject.components.disposableAdd(s)),i.points=[...n],i.speed=t.speed,i.strokeColor=t.color,i.materialMode=t.materialMode,i.strokeWidth=t.width||1,t!=null&&t.runModel){const a=t==null?void 0:t.runSpeed,u=t==null?void 0:t.modelSymbol;let l;switch(t==null?void 0:t.runModel){case"ESHuman":l=this.dv(new So);break;case"ESCar":l=this.dv(new Lc);break;case"ESGltfModel":l=this.dv(new Vs)}if(this.d(this.sceneObject.components.disposableAdd(l)),u)for(let h in u)l[h]=u[h];const c=[0];for(var o=0;o<n.length-1;o+=1){const h=n[o],f=n[o+1],p=jS(h[1],h[0],f[1],f[0]);c.push(c[o]+Math.ceil(p/a)*1e3)}i.timeStamps=c,t!=null&&t.runSpeed&&(i.currentPositionChanged.don(h=>{i.currentPosition&&(l.position=i.currentPosition,i.currentRotation&&(l.rotation=i.currentRotation))}),s.startTime=0,s.stopTime=c[c.length-1],s.playing=!0,s.loop=(t==null?void 0:t.runLoop)??!0,s.currentTimeChanged.don(h=>{i.path.currentTime=h}))}}_eslineInterpolationModelRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=(t==null?void 0:t.interpolationDistance)??0;if(!i)return;const s=kS(n,i/1e3),o=this.dv(new Vs);this.d(this.sceneObject.components.disposableAdd(o)),o.url=t.url,o.instances=s.map(a=>({position:a,rotation:t.rotation,scale:t.scale}))}_eslineWallRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=t.height??0,s=t.width??0,o=t.extrudedHeight??0,a=n.map(c=>({lng:(c==null?void 0:c[0])??0,lat:(c==null?void 0:c[1])??0,alt:(c==null?void 0:c[2])??0})),u=BS(a,s).map(c=>[(c==null?void 0:c.lng)??0,(c==null?void 0:c.lat)??0,(c==null?void 0:c.alt)??0]),l=this.dv(new bo);this.d(this.sceneObject.components.disposableAdd(l)),l.height=i,l.extrudedHeight=o,l.filled=t.filled??!0,l.fillColor=t.fillColor,l.allowPicking=(t==null?void 0:t.allowPicking)??!0,l.extras={selected:!1},l.points=u}renderLabel(e,t){const{points:n}=e,i=FS(n);ep(this.sceneObject,i,e,t)}}function xy(r,e){try{JSON.stringify(r[r.length-1])!==JSON.stringify(r[0])&&r.push(r[0]);const t=Ke.featureCollection(r.map(u=>Ke.point(u))),n=Ke.polygon([r]),i={gridType:"point",units:"meters"};return Ke.interpolate(t,e,i).features.map(u=>u.geometry.coordinates)[0][0].filter(u=>Ke.booleanPointInPolygon(Ke.point(u),n))}catch(t){return console.error(t),[]}}class HS extends B{constructor(e,t,n,i){super(),this.sceneObject=e;const s=t;if(i&&hi(s,o=>{this.renderLabel(o,i)}),n)if(n.type==="simple"){const{visualVariables:o}=n;hi(s,a=>{const u=np(a,n,o);this.render(a,u)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;hi(s,a=>{const u=rp(a,n,o);this.render(a,u)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;hi(s,a=>{const u=ip(a,n,o);this.render(a,u)})}else console.error("PolyLineLayer: renderer type is not supported")}renderLabel(e,t){const{points:n}=e;console.log("PolygonLayer: renderLabel",n);const i=VS(n);ep(this.sceneObject,i,e,t)}render(e,t){t.type==="simple-fill"?this._simplePolygonRender(e,t):t.type==="ESGeoExtrudedPolygon"?this._esGeoExtrudedPolygonRender(e,t):t.type==="PolygonInterpolateESGltfModel"?this._polygonInterpolateESGltfModelRender(e,t):t.type==="PolygonInterpolateESImageLabel"?this._polygonInterpolateESImageLabelRender(e,t):console.error("PolyLineLayer: symbol type is not supported")}_simplePolygonRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{color:i,outline:s,filled:o,ground:a}=t,{width:u,color:l,stroked:c}=s,h=this.dv(new Ht);this.d(this.sceneObject.components.disposableAdd(h)),h.stroked=c??!1,h.strokeColor=l??[1,1,1,1],h.strokeWidth=u??1,h.filled=o??!0,h.fillGround=a??!1,h.fillColor=i??[1,1,1,1],h.allowPicking=(t==null?void 0:t.allowPicking)??!0,h.extras={selected:!1},h.points=[...n]}_esGeoExtrudedPolygonRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,extrudedHeight:s,color:o}=t,a=this.dv(new bo);this.d(this.sceneObject.components.disposableAdd(a)),a.height=i,a.extrudedHeight=s,a.filled=!0,a.fillColor=o,a.allowPicking=(t==null?void 0:t.allowPicking)??!0,a.extras={selected:!1},a.points=[...n]}_polygonInterpolateESGltfModelRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,interpolateDistance:s,url:o,rotation:a,scale:u}=t,l=xy(n,s??10),c=this.dv(new Vs);this.d(this.sceneObject.components.disposableAdd(c)),c.url=o,c.instances=l.map(h=>({position:[...h,i??0],rotation:a??[0,0,0],scale:u??[1,1,1]}))}_polygonInterpolateESImageLabelRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,interpolateDistance:s,offset:o,size:a,url:u,anchor:l}=t,h={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:[...xy(n,s??10).map(p=>[...p,i??0])]}}]},f=this.dv(new fl);this.d(this.sceneObject.components.disposableAdd(f)),f.textDefaultText="",f.imageUrl=u,l&&(f.imageAnchor=l),o&&(f.imageOffset=o),a&&(f.imageSize=a),f.url=h}}class XS extends B{constructor(t,n){super();d(this,"_initEvent",this.dv(new N));const i=this,s=async()=>{try{const a=t.featureProps;if(!a)return;const{heightMode:u,features:l,layerType:c,url:h}=a;let f=[];if(!l&&h){let p=await fetch(h).then(v=>v.json());return p=(p==null?void 0:p.features)??p,c==="polylineVector"?f=await _y(n,p,u):c==="polygonVector"?f=await Ey(n,p,u):c==="pointVector"&&(f=await wy(n,p,u)),f}else c==="polylineVector"?f=await _y(n,l,u):c==="polygonVector"?f=await Ey(n,l,u):c==="pointVector"&&(f=await wy(n,l,u));return f}catch(a){console.error(a);return}},o=this.dv(Pe(this._initEvent,t.featurePropsChanged));i.dv(new we(o,()=>{if(!t.featureProps)return;const a=t.featureProps;let u;return(async()=>{const{layerType:c,renderer:h,labelingInfo:f}=a,p=await s();!p||p.length===0||(c==="pointVector"?u=new WS(t,p,h,f):c==="polylineVector"?u=new qS(t,p,h,f):c==="polygonVector"&&(u=new HS(t,p,h,f)),console.log("polygonVectorLayer","createLayer",u))})().catch(console.error),{destroy:()=>{var c;(c=u==null?void 0:u.destroy)==null||c.call(u),u=void 0}}}));{const a=(u,l=1)=>{const c=qv(u);if(!c)return;const{center:h,radius:f}=c;n.flyTo({distance:f*4,heading:0,pitch:-90,flyDuration:l??1,hDelta:0,pDelta:0},h)};i.d(t.flyToEvent.don(async u=>{const{featureProps:l}=t;if(!l)return;const c=await s();if(!c)return;let h=[];l.layerType==="polylineVector"?h=c.map(f=>f.points).flat():l.layerType==="polygonVector"?h=c.map(f=>f.points).flat():l.layerType==="pointVector"&&(h=c.map(f=>f.points)),h.length!==0&&a(h,u)}))}}init(){this._initEvent.emit()}}const mu=class mu extends Wt{constructor(t){super(t);d(this,"featureLayerMap",new Map);const n=this;n.d(n.viewerAttached.don(i=>{if(console.log("ESFeatureLayer","viewerAttached",i.id),n.featureLayerMap.has(i.id))return;const s=new XS(n,i);s.init(),n.featureLayerMap.set(i.id,s)})),n.d(n.viewerDetached.don(i=>{var s;console.log("ESFeatureLayer","viewerDetached",i.id),n.featureLayerMap.has(i.id)&&((s=n.featureLayerMap.get(i.id))==null||s.destroy(),n.featureLayerMap.delete(i.id))})),n.d(()=>{for(const i of n.featureLayerMap.values())i.destroy();n.featureLayerMap.clear()}),n.d(ps(n.showChanged,()=>{for(const i of n.components.values())Reflect.has(i,"show")&&(i.show=n.show)},{immediate:!0}))}};d(mu,"createDefaultProps",()=>({...Wt.createDefaultProps(),featureProps:Yt(void 0)})),d(mu,"type",mu.register("ESFeatureLayer",mu,{chsName:"矢量图层",tags:["ESObjects"],description:"ESFeatureLayer"}));let sp=mu;const cs=class cs extends B{constructor(){super();d(this,"_loading",!1);d(this,"_loadedEvent",this.disposeVar(new N));d(this,"_loaded",!1);d(this,"_loadedPromiseResolve");d(this,"_loadedPromise",new Promise(t=>{this._loadedPromiseResolve=t}));d(this,"_processing",this.disposeVar(qn(async t=>{if(this._loading=!0,window.Hls)console.info("可能系统已经加载hlsjs,此处不再加载!");else{const n=et.context.getStrFromEnv(cs.path);await t.promise(fh(n))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})));this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return cs._instance=cs._instance||new cs,cs._instance}};d(cs,"path","${xr-utils-script-dir}/xr-static/xr-utils/hlsjs/1.4.12/hls.min.js"),d(cs,"_instance");let Wc=cs,YS=class extends B{constructor(t,n){super();d(this,"_element");this._complexImage=t,this._videoSrc=n;var i=document.createElement("video");i.src=this._videoSrc,i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.zIndex="-100",i.style.visibility="hidden";{const s=()=>{i.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{i.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{i.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}i.muted=!0,document.body.appendChild(i),this._element=i,this.dispose(()=>document.body.removeChild(i))}get element(){return this._element}};class JS extends B{constructor(t,n){super();d(this,"_videoDom");d(this,"_processing",this.disposeVar(qn(async t=>{const{videoSrc:n}=this,i=Wc.instance();await t.promise(i.loadedPromise);const s=window.Hls,o=new s,a=this.element;await Qs(t,()=>new Promise((u,l)=>{a.xbsjHLS=o,o.attachMedia(a),o.on(s.Events.MEDIA_ATTACHED,()=>{o.loadSource(n),o.on(s.Events.MANIFEST_PARSED,(c,h)=>{a.play(),u()})}),o.on(s.Events.ERROR,(c,h)=>{const{type:f,details:p,fatal:v}=h;v&&(o.destroy(),l(p))})}))})));d(this,"_processingStartup",this._processing.start());this._complexImage=t,this._videoSrc=n,this._videoDom=this.disposeVar(new YS(this._complexImage,""))}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class Ty extends B{constructor(t,n){super();d(this,"_videoDom");d(this,"_update",this.disposeVar(Ko(()=>this.update())));d(this,"_updateStart",this._update.start());this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new JS(this._complexImage,this._imageUri))}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const t=this._complexImage,{videoWidth:n,videoHeight:i}=this.videoElement;t.size=[n,i],t.pixelFormat="RGBA",t.copyTexture({source:this.videoElement})}}const hs=class hs extends B{constructor(){super();d(this,"_loading",!1);d(this,"_loadedEvent",this.disposeVar(new N));d(this,"_loaded",!1);d(this,"_loadedPromiseResolve");d(this,"_loadedPromise",new Promise(t=>{this._loadedPromiseResolve=t}));d(this,"_processing",this.disposeVar(qn(async t=>{if(this._loading=!0,window.flvjs)console.info("可能系统已经加载flvjs,此处不再加载!");else{const n=et.context.getStrFromEnv(hs.path);await t.promise(fh(n))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})));this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return hs._instance=hs._instance||new hs,hs._instance}};d(hs,"path","${xr-utils-script-dir}/xr-static/xr-utils/flvjs/1.6.2/flv.min.js"),d(hs,"_instance");let qc=hs;class ZS extends B{constructor(t,n){super();d(this,"_element");this._complexImage=t,this._videoSrc=n;var i=document.createElement("video");i.src=this._videoSrc,i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.zIndex="-100",i.style.visibility="hidden";{const s=()=>{i.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{i.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{i.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}i.muted=!0,document.body.appendChild(i),this._element=i,this.dispose(()=>document.body.removeChild(i))}get element(){return this._element}}class KS extends B{constructor(t,n){super();d(this,"_videoDom");d(this,"_processing",this.disposeVar(qn(async t=>{const{videoSrc:n}=this,i=qc.instance();await t.promise(i.loadedPromise);const s=window.flvjs,o=this.element;await Qs(t,()=>new Promise((a,u)=>{if(!s.isSupported()){u("flvjs不支持!");return}var l=s.createPlayer({type:"flv",url:n});l.attachMediaElement(o),l.load(),l.play(),o.xbsjFlvPlayer=l}))})));this._complexImage=t,this._videoSrc=n,this._videoDom=this.disposeVar(new ZS(this._complexImage,"")),this._processing.start()}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class Ny extends B{constructor(t,n){super();d(this,"_videoDom");d(this,"_update",this.disposeVar(Ko(()=>this.update())));d(this,"_updateStart",this._update.start());this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new KS(t,this._imageUri))}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const t=this._complexImage,{videoWidth:n,videoHeight:i}=this.videoElement;t.size=[n,i],t.pixelFormat="RGBA",t.copyTexture({source:this.videoElement})}}function Oy(r){const e=r.substring(r.lastIndexOf(".")+1);return yl.suffixTypes[e]}class yl extends B{constructor(){super();d(this,"_enabled",this.disposeVar(V(!1)));d(this,"_uri",this.disposeVar(V("")));d(this,"_type",this.disposeVar(V(void 0)));d(this,"_size",this.disposeVar(ne(void 0)));d(this,"_pixelFormat",this.disposeVar(V("RGBA")));d(this,"_flipY",this.disposeVar(V(!0)));d(this,"_crossOriginReact",this.disposeVar(V("")));d(this,"_autoplayReact",this.disposeVar(V(!0)));d(this,"_loopReact",this.disposeVar(V(!0)));d(this,"_copyTextureEvent",this.disposeVar(new N));d(this,"_imageProcessingResettingEvent",this.disposeVar(Pe(this.enabledChanged,this.uriChanged,this.typeChanged)));d(this,"_imageProcessingResetting",this.disposeVar(new we(this._imageProcessingResettingEvent,()=>{do{if(!this.enabled||!this.uri)break;let{type:t}=this;if(t||(t=Oy(this.uri)),!t)break;if(t==="img")return new ig(this,this.uri);if(t==="video")return new ag(this,this.uri);if(t==="gif")return new mg(this,this.uri);if(t==="hls")return new Ty(this,this.uri);if(t==="flv")return new Ny(this,this.uri)}while(!1)})));d(this,"_createNativeTextureEvent",this.disposeVar(Pe(this.enabledChanged,this.sizeChanged,this.pixelFormatChanged,this.flipYChanged)))}get enabled(){return this._enabled.value}set enabled(t){this._enabled.value=t}get enabledChanged(){return this._enabled.changed}get uri(){return this._uri.value}set uri(t){this._uri.value=t}get uriChanged(){return this._uri.changed}get type(){return this._type.value}set type(t){this._type.value=t}get typeChanged(){return this._type.changed}get size(){return this._size.value}set size(t){this._size.value=t}get sizeChanged(){return this._size.changed}get pixelFormat(){return this._pixelFormat.value}set pixelFormat(t){this._pixelFormat.value=t}get pixelFormatChanged(){return this._pixelFormat.changed}get flipY(){return this._flipY.value}set flipY(t){this._flipY.value=t}get flipYChanged(){return this._flipY.changed}get crossOrigin(){return this._crossOriginReact.value}set crossOrigin(t){this._crossOriginReact.value=t}get crossOriginChanged(){return this._crossOriginReact.changed}get autoplay(){return this._autoplayReact.value}set autoplay(t){this._autoplayReact.value=t}get autoplayChanged(){return this._autoplayReact.changed}get loop(){return this._loopReact.value}set loop(t){this._loopReact.value=t}get loopChanged(){return this._loopReact.changed}get copyTextureEvent(){return this._copyTextureEvent}copyTexture(t){this._createNativeTextureEvent.flush(),this._copyTextureEvent.emit(t)}get imageProcessingResetting(){return this._imageProcessingResetting}get createNativeTextureEvent(){return this._createNativeTextureEvent}copyFromCanvas(t){if(t.width<=0||t.height<=0){console.warn("canvas.width <= 0 || canvas.height <= 0");return}this.size=[t.width,t.height],this.pixelFormat="RGBA",this.copyTexture({source:t})}}d(yl,"types",og),d(yl,"czmPixelFormats",sg),d(yl,"suffixTypes",{png:"img",jpg:"img",svg:"img",webp:"img",gif:"gif",mp4:"video",mov:"video",webm:"video",flv:"flv",m3u8:"hls"});const QS=[0,0,0,0];class $S{constructor(){d(this,"_value",[]);d(this,"_valueStr","[]");d(this,"_valueChanged");this.value=[{ratio:0,rgba:[0,0,1,1]},{ratio:.2,rgba:[0,1,0,1]},{ratio:.8,rgba:[1,1,0,1]},{ratio:1,rgba:[1,0,0,1]}]}get valueChanged(){return this._valueChanged||(this._valueChanged=new N),this._valueChanged}set value(e){if(e.length===0){console.error("value.length === 0");return}let t;if(this._value.length===e.length){const i=[...e].sort((s,o)=>s.ratio-o.ratio);if(t=JSON.stringify(i),this._valueStr===t)return}t=t||JSON.stringify([...e].sort((i,s)=>i.ratio-s.ratio));const n=this._value;if(this._value=JSON.parse(t),this._value.length===0)throw console.error("this._colorStops.length === 0"),new Error("this._colorStops.length === 0");this._valueChanged&&this._valueChanged.emit(this._value,n)}get value(){return JSON.parse(JSON.stringify(this._value))}get valueStr(){return this._valueStr}get minRatio(){return this._value[0].ratio}get maxRatio(){return this._value[this._value.length-1].ratio}_getRatioIndex(e){if(e<this._value[0].ratio||e>this._value[this._value.length-1].ratio)throw console.error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio"),new Error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio");let t=this._value.length;for(let n=0;n<t-1;++n)if(e>=this._value[n].ratio&&e<=this._value[n+1].ratio)return n;throw console.error("shoud not be here!"),new Error("shoud not be here!")}getRatioColor(e,t){e=Al(e,this.minRatio,this.maxRatio);const n=this._getRatioIndex(e),i=this._value[n],s=this._value[n+1],o=(e-i.ratio)/(s.ratio-i.ratio);for(let a=0;a<4;++a)t[a]=i.rgba[a]*(1-o)+s.rgba[a]*o;if(t.some(Number.isNaN)){console.error("result NaN");return}return t}getColorsInUint8(e){if(e.length%4!==0)throw console.error("result.length % 4 !== 0"),new Error("result.length % 4 !== 0");const t=e.length/4,n=1/t;for(let i=0;i<t;++i){const s=QS;this.getRatioColor((i+.5)*n,s)||s.splice(0,4,0,0,0,0);for(let o=0;o<4;++o)e[i*4+o]=255*s[o]|0}return e}}class tb extends B{constructor(){super(...arguments);d(this,"registerEngines",{})}register(t,n,i){const s=this.registerEngines[t]||new Map;return s.has(n)&&console.warn(`register warn:${t}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,i),this.registerEngines[t]=s,n}getEngineObjConstructor(t,n){const i=this.registerEngines[n];if(!i)return;let s=t.constructor,o=t.typeName,a=i.get(o);if(a)return a;if(t.components.main)return;const u=o;for(;o!=="ESSceneObject"&&(s=s.getParentClass(),!!s);)if(o=s.type,a=i.get(o),a)return console.warn(`未找到${u}在${n}中对应的实现类! 使用父类${o}的实现类!`),a}createEngineObject(t,n){const i=this.getEngineObjConstructor(t,n.typeName);if(i){const s=new i(t,n);return s.createdEvent.emit(),s}else{const s=new Po(t,n);return s.createdEvent.emit(),s}}}class eb extends B{constructor(){super(...arguments);d(this,"registerEngines",{})}register(t,n,i){const s=this.registerEngines[t]||new Map;s.has(n)&&console.warn(`register warn:${t}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,i),this.registerEngines[t]=s}getEngineObjConstructor(t,n){const s=(this.registerEngines[n]||new Map).get(t);if(s)return s;console.warn(`未找到${t}在${n}中对应的实现类!`)}createEngineObject(t,n){const i=this.getEngineObjConstructor(t.typeName,n.typeName);if(i){const s=new i(t,n);return s.createdEvent.emit(),s}else{const s=new Po(t,n);return s.createdEvent.emit(),s}}}const Dr=class Dr extends B{constructor(t,n,i=!1){super();d(this,"_createdEvent",this.dv(new N));d(this,"_id",++Dr._accumId);this._sceneObject=t,this._viewer=n;{if(i)return;const s=(o,a)=>{for(let u of o)this._viewer.delete(u);for(let u of a)u.parentID=this.sceneObject.id,this._viewer.add(u)};s([],this._sceneObject.components.values()),this.d(this._sceneObject.components.toChange.don(s)),this.d(()=>s(this._sceneObject.components.values(),[]))}}get createdEvent(){return this._createdEvent}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get id(){return this._id}};d(Dr,"context",new tb),d(Dr,"contextEditing",new eb),d(Dr,"register",Dr.context.register.bind(Dr.context)),d(Dr,"registerEditing",Dr.contextEditing.register.bind(Dr.contextEditing)),d(Dr,"_accumId",-1);let Po=Dr;function Dy(r){return typeof r=="string"?document.getElementById(r):r}function op(r){if(!r)throw new Error("container is not defined");r.innerHTML="";const e=document.createElement("div");return e.style.cssText="width: 100%; height: 100%; margin: 0px; padding: 0px; border: none; overflow: hidden; position: relative; z-index: 0; background: rgba(0,0,0,0);",r.appendChild(e),e}class My extends B{constructor(t,n){super();d(this,"_listeningSceneObjects",new Map);this._sceneObjectsMananger=t,this._createSceneObjectListeningFunc=n;const i=this._listeningSceneObjects,s=(o,a)=>{if(o)for(let u of o){const l=i.get(u);l&&(l.destroy(),i.delete(u))}if(a)for(let u of a){if(i.get(u)){console.warn(`listeningSceneObjects已存在某对象:${u.name}`,u);debugger}const c=this.createSceneObjectListeningFunc(u);c&&i.set(u,c)}};s(void 0,this._sceneObjectsMananger.sceneObjects),this.dispose(this._sceneObjectsMananger.sceneObjectsToChange.disposableOn(s)),this.dispose(()=>{for(let o of this._listeningSceneObjects.values())o.destroy();this._listeningSceneObjects.clear()})}get listeningSceneObjects(){return this._listeningSceneObjects}get createSceneObjectListeningFunc(){return this._createSceneObjectListeningFunc}}class nb extends B{constructor(e){super(),this._esObjectsManager=e;{const t=this._esObjectsManager;class n extends B{constructor(s){super(),this._esPath=s,this.dv(new we(t.activeViewerChanged,()=>{const o=t.activeViewer;if(!o)return;class a extends B{constructor(l){if(super(),this._esPath=l,!o)throw new Error("!viewer");const c=()=>{const h=t.activeViewer;h&&(this._esPath.path.currentTime=h.simulationTime)};c(),this.d(o.simulationTimeChanged.don(c))}}return new a(this._esPath)}))}}this.dv(new My(t.sceneObjectsManager,i=>{if(i instanceof Va)return new n(i)}))}{const t=this._esObjectsManager;class n extends B{constructor(s){super();const o=()=>{const a=t.activeViewer;a&&(a.simulationTime=s.currentTime??0)};o(),this.d(s.currentTimeChanged.don(o))}}this.dv(new My(t.sceneObjectsManager,i=>{if(i instanceof ka)return new n(i)}))}}}class rb extends B{constructor(e){super(),e.forEach(t=>{this.d(t.path.currentPositionChanged.don(n=>{n&&t.sceneObjects.forEach(i=>{Reflect.has(i,"position")&&(i.position=[...n])})})),this.d(t.path.currentRotationChanged.don(n=>{n&&t.sceneObjects.forEach(i=>{Reflect.has(i,"rotation")&&(i.rotation=[...n])})}))})}}class ib extends B{constructor(t){super();d(this,"_player");d(this,"_channels",this.dv(dt([])));this._objectManager=t,this._player=this._objectManager.player,this.dv(new we(this.channelsChanged,()=>{if(this.channels.length===0)return;const n=[];for(let i=0;i<this.channels.length;i++){const s=this.channels[i],o=et.getSceneObjById(s.pathId);if(!o||!(o instanceof Va))continue;const u=s.sceneObjectIds.map(l=>et.getSceneObjById(l)).filter(l=>l!==void 0);u.length!==0&&n.push({path:o,sceneObjects:u})}if(n.length!==0)return new rb(n)}))}get player(){return this._player}get channels(){return this._channels.value}get channelsChanged(){return this._channels.changed}set channels(t){this._channels.value=t}}function Hc(r){if(r.data){const{type:e,value:t}=r.data;if(e==="UITreeA"&&t instanceof mn){const{sceneObject:n}=t;if(n)return n.id}}}function sb(r,e){const{property:t,customEventName:n,otherParams:i}=e,{dragstartDataMananger:s}=r;if(!(t instanceof ta)){if(!(t instanceof bg)){if(t instanceof pt){const[o,a]=ki(t.reactVar);if(n==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const u=i[0];if(u.preventDefault(),!u.dataTransfer)return;Hc(s)?u.dataTransfer.dropEffect="move":u.dataTransfer.dropEffect="none"}else if(n==="ondrop"){if(!i)throw new Error("!otherParams");i[0].preventDefault();const l=Hc(s);l!==void 0&&a(l)}}else if(t instanceof _g){const[o,a]=ki(t.reactVar);if(n==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const u=i[0];if(u.preventDefault(),!u.dataTransfer)return;Hc(s)?u.dataTransfer.dropEffect="move":u.dataTransfer.dropEffect="none"}else if(n==="ondrop"){if(!i)throw new Error("!otherParams");const u=i[0].$event,l=i[0].strinsPropDom,c=i[0].index;u.preventDefault();const h=Hc(s);if(h!==void 0){l[c].firstChild.value=h;const f=new Event("input",{bubbles:!0,cancelable:!0});l[c].firstChild.dispatchEvent(f)}}}else if(t instanceof wg){const[o,a]=ki(t.reactVar)}}}}function Ry(r,e,t,n){if(t)n.currentActiveEditing=[r,e];else if(n.currentActiveEditing){const[i,s]=n.currentActiveEditing;i===r&&s===e&&(t||(n.currentActiveEditing=void 0))}}const ob=["editing","positionEditing","locationEditing","pointEditing","rotationEditing"];class ab extends B{constructor(e,t){super(),this._sceneObject=e;const n=this._sceneObject;for(let i of ob){const s=i+"Changed",o=n[s];if(o){{const a=n[i];Ry(n,i,a,t)}this.dispose(o.disposableOn(a=>Ry(n,i,a,t)))}}}get sceneObject(){return this._sceneObject}}class ub extends B{constructor(){super();d(this,"_currentActiveEditing",this.disposeVar(ne(void 0)));d(this,"_currentActiveEditingLastChangedTime",0);this.dispose(this._currentActiveEditing.changed.disposableOn((t,n)=>{if(this._currentActiveEditingLastChangedTime=Date.now(),n){const[i,s]=n;i[s]===!0&&(i[s]=!1)}if(t){const[i,s]=t;i[s]=!0}})),et.context.sceneObjCreatedEvent.don(t=>{t.dv(new ab(t,this))})}get currentActiveEditing(){return this._currentActiveEditing.value}set currentActiveEditing(t){this._currentActiveEditing.value=t}get currentActiveEditingChanged(){return this._currentActiveEditing.changed}get currentActiveEditingLastChangedTime(){return this._currentActiveEditingLastChangedTime}}class lb extends B{constructor(){super();d(this,"_sceneObjects",new Set);d(this,"_sceneObjectsToChange",this.dv(new N));this.d(()=>{const t=ch(this._sceneObjects);t!==0&&console.warn(`场景对象管理器销毁时仍然管理着${t}个场景对象!`)})}get sceneObjects(){return this._sceneObjects}get sceneObjectsToChange(){return this._sceneObjectsToChange}addSceneObject(t){return this._sceneObjects.has(t)?(console.warn(`创建失败:对象${t.typeName+":"+t.id}已经存在于场景对象管理器中!}`),!1):(this._sceneObjectsToChange.emit([],[t]),this._sceneObjects.add(t),!0)}deleteSceneObject(t){return this._sceneObjects.has(t)?(this._sceneObjectsToChange.emit([t],[]),this._sceneObjects.delete(t),!0):(console.warn(`删除失败:对象${t.typeName+":"+t.id}不存在于场景对象管理器中!}`),!1)}createSceneObject(t,n){const i=et.context.createSceneObject(t,n);return i&&this.addSceneObject(i),i}createSceneObjectFromUrl(t,n){const i=et.context.createSceneObjectFromUrl(t,n);return i&&this.addSceneObject(i),i}createSceneObjectFromClass(t,n){const i=et.context.createSceneObjectFromClass(t,n);return i&&this.addSceneObject(i),i}createSceneObjectFromJson(t){const n=et.context.createSceneObjectFromJson(t);return n&&this.addSceneObject(n),n}}class cb extends B{constructor(t){super();d(this,"_enabled",this.dv(V(!1)));d(this,"_cursorPosition",V(void 0));d(this,"quickPickPosition",!0);let n=new B;const i=()=>{n&&(n.destroy(),n=void 0)};this.d(i);const s=()=>{if(i(),!t||!this._enabled.value)return;n=new B;const o=n.dv(V(void 0)),a=n.dv(Pe(o.changed));n.d(t.pointerMoveEvent.don(l=>{l.pointerEvent&&(o.value=an(l.pointerEvent))}));const u=n.dv(qn(async l=>{if(o.value)if(this.quickPickPosition){const c=await l.promise(Zo(t.quickPickPosition(o.value)));this._cursorPosition.value=c}else{const c=await l.promise(Zo(t.pickPosition(o.value)));this._cursorPosition.value=c}}));n.d(a.don(()=>{u.restart()}))};s(),this.d(this._enabled.changed.don(s))}get enabled(){return this._enabled.value}set enabled(t){this._enabled.value=t}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}class hb extends B{constructor(t){super();d(this,"cursorPositionInfo");this.viewer=t,this.cursorPositionInfo=this.dv(new cb(this.viewer))}}class db extends B{constructor(t){super();d(this,"viewer");const n=this.viewer=t;this.ad(new we(n.rollerShutterChanged,()=>{const i=n.container;if(!i||!n.rollerShutter)return;const s=new B;this.viewer.splitPosition=.5;let o=this.getRollerShutterDIV();return i.appendChild(o),s.d(()=>{this.viewer.splitPosition=0,i.removeChild(o)}),s}))}getRollerShutterDIV(){let t=document.createElement("div");t.style.position="absolute",t.style.left="50%",t.style.top="0",t.style.backgroundColor="#d3d3d3",t.style.width="5px",t.style.height="100%",t.style.zIndex="9999";const n=i=>{if(!t.parentElement)return;i.preventDefault?i.preventDefault():i.returnValue=!1;const o=i.x/t.parentElement.offsetWidth;t.style.left=`${100*o}%`,this.viewer.splitPosition=o};return t.addEventListener("mouseenter",i=>{t.style.cursor="ew-resize"}),t.addEventListener("mouseleave",i=>{t.style.cursor="default"}),t.addEventListener("mousedown",i=>{t.style.cursor="ew-resize",document.addEventListener("mousemove",n)}),document.addEventListener("mouseup",i=>{t.style.cursor="default",document.removeEventListener("mousemove",n)}),t}}class fb extends B{constructor(t){super();d(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new db(t))}}function Ly(r,e){return r.length===e.length&&r.every((t,n)=>t===e[n])}class pb extends B{constructor(e){super(),this._viewer=e,this.d(z([this._viewer,"currentTime"],[this._viewer,"simulationTime"]))}}class gb extends B{constructor(e,t){super(),this._viewer=e,this._activeViewer=t;const n=$r.createCommonProps(),i=[];Object.keys(n).forEach(u=>{const l=this._activeViewer[u+"Changed"];i.push(l)});const s=this.dv(Pe(...i)),o=()=>{this._viewer.status!=="Created"||this._activeViewer.status!=="Created"||Object.keys(n).forEach(u=>{this._viewer[u]=this._activeViewer[u]})};this.d(s.don(o));const a=this.dv(Pu());a.restart(void 0,async()=>{if(this._viewer.status!=="Created"||this._activeViewer.status!=="Created")return;const u=this._activeViewer.getCurrentCameraInfo(),l=this._viewer.getCurrentCameraInfo();if(!u)return;const{position:c,rotation:h}=u;l&&Ly(c,l.position)&&Ly(h,l.rotation)||this._viewer.flyIn(c,h,0)}),this.d(()=>a.cancel())}}const mb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="40" height="40" style="shape-rendering: auto; display: block; background: rgba(255, 255, 255, 0);" xmlns:xlink="http://www.w3.org/1999/xlink"><g><circle stroke-linecap="round" fill="none" stroke-dasharray="50.26548245743669 50.26548245743669" stroke="#ffffff" stroke-width="8" r="32" cy="50" cx="50">
487
+ `,ml=Date.now();new Date(ml).toISOString(),new Date(ml+24*60*60*1e3).toISOString();const li=class li extends et{constructor(t){super(t);d(this,"_flyToEvent",this.disposeVar(new N));d(this,"_resetClockEvent",this.disposeVar(new N))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new nt([this,"data"],"数据",li.defaults.data,LS,!0),new nt([this,"uri"],"路径","${earthsdk3-assets-script-dir}/assets/misc/simple.czml",void 0,!0),new Y([this,"clockEnabled"],"启用",!1),new R([this,"multiplier"],"倍速",li.defaults.multiplier),new Y([this,"autoResetClock"],"自动设置时钟",!0),new no([this,"startTime"],"开始时间",li.defaults.startTime,!0),new no([this,"stopTime"],"结束时间",li.defaults.stopTime,!0),new no([this,"currentTime"],"当前时间",li.defaults.currentTime,!0),new St([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep","SYSTEM_CLOCK_MULTIPLIER"),new St([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange","UNBOUNDED"),new Y([this,"shouldAnimate"],"是否启用动画",!1)],general:[...t.general,new Y([this,"show"],"是否显示",!0),new Y([this,"collision"],"开启碰撞",!1),new Y([this,"allowPicking"],"允许拾取",!1)],more:[...t.more,new lt(["number"],n=>this.flyTo(n),[1e3],"飞入"),new lt([],()=>this.resetClock(),[],"重设时钟"),new ys([this,"loadFuncStr"],"loadFnStr",yy,AS,!0)]}}};d(li,"createDefaultProps",()=>({show:!0,uri:void 0,allowPicking:!1,data:Yt(RS),autoResetClock:!0,clockEnabled:!1,startTime:ml,stopTime:ml+24*60*60*1e3,currentTime:ml,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...et.createDefaultProps()})),d(li,"type",li.register("ESCzml",li,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"}));let Yf=li;const fu=class fu extends et{getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([]),new Y([this,"show"],"是否显示"),new R([this,"cssSize"],"尺寸"),new Ae([this,"cssPosition"],"位置"),new Du([this,"imgUrl"],"图片地址")]}}};d(fu,"createDefaultProps",()=>({...et.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:et.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")})),d(fu,"type",fu.register("ESNavigator",fu,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"}));let Jf=fu;const Ai=class Ai extends et{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([],"通用","通用"),new Y([this,"show"],"是否显示",Ai.defaults.show),new R([this,"height"],"高度",Ai.defaults.height,!0),new R([this,"fontSize"],"文字大小",Ai.defaults.fontSize,!0),new Ot([this,"bgColor"],"背景颜色",Ai.defaults.bgColor,!0)]}}};d(Ai,"createDefaultProps",()=>({...et.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:dt([71/255,71/255,71/255,.8])})),d(Ai,"type",Ai.register("ESViewerStatusBar",Ai,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let Zf=Ai;const Fi=class Fi extends et{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([],"通用","通用"),new Y([this,"show"],"是否显示",Fi.defaults.show),new R([this,"height"],"高度",Fi.defaults.height,!0),new R([this,"fontSize"],"文字大小",Fi.defaults.fontSize,!0),new Ot([this,"bgColor"],"背景颜色",Fi.defaults.bgColor,!0)]}}};d(Fi,"createDefaultProps",()=>({...et.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:dt([71/255,71/255,71/255,.8])})),d(Fi,"type",Fi.register("ESViewerStatusBarScale",Fi,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let Kf=Fi;const pu=class pu extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new pt([this,"url"],"路径","",!0),new R([this,"progress"],"进度",0,!1,!0)]}}};d(pu,"createDefaultProps",()=>({...st.createDefaultProps(),url:"",progress:0})),d(pu,"type",pu.register("ESGaussianSplatting",pu,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"}));let Qf=pu;const jo=class jo extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new pt([this,"mesh"],"mesh地址",jo.defaults.mesh)]}}};d(jo,"createDefaultProps",()=>({...st.createDefaultProps(),mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"})),d(jo,"type",jo.register("ESStaticMesh",jo,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"}));let $f=jo;const gu=class gu extends Dt{constructor(t){super(t);d(this,"_startEvent",this.dv(new N));d(this,"_clearEvent",this.dv(new N));d(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new bo),this.ad(this.components.disposableAdd(this._eSGeoExtrudedPolygon)),this.eSGeoExtrudedPolygon.perPositionHeight=!0,this.eSGeoExtrudedPolygon.extrudedHeight=0,this.stroked=!0,this.strokeWidth=2,this.strokeColor=[1,0,0,1],this.ad(z([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(z([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(z([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(z([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(z([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(z([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(z([this.eSGeoExtrudedPolygon,"points"],[this,"points"])),this.ad(this.clearEvent.don(()=>{this.points=void 0,this.depths=void 0,this.windowPositions=void 0}))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get eSGeoExtrudedPolygon(){return this._eSGeoExtrudedPolygon}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new lt([],()=>this.start(),[],"开始分析"),new lt([],()=>this.clear(),[],"清除分析"),new nt([this,"windowPositions"],"屏幕坐标",[],void 0,!1,!0),new nt([this,"depths"],"深度值",[],void 0,!1,!0),new R([this,"radius"],"半径",1e4,!0)]}}};d(gu,"createDefaultProps",()=>({...Dt.createDefaultProps(),windowPositions:jd([]),depths:ne([]),radius:V(1e4)})),d(gu,"type",gu.register("ESSkylineAnalysis",gu,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"}));let tp=gu;const ls=class ls extends Wt{constructor(e){super(e)}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new nt([this,"data"],"数据",[],void 0,!0),new nt([this,"gradient"],"渐变",ls.defaults.gradient,void 0,!0),new R([this,"radius"],"半径",ls.defaults.radius,void 0,!0),new R([this,"blur"],"模糊",ls.defaults.blur,!0),new Y([this,"is3D"],"is3D",!1,!0)]}}};d(ls,"createDefaultProps",()=>({...Wt.createDefaultProps(),is3D:V(!1),data:Il([]),gradient:Yt({".5":"green",".7":"yellow",".95":"red"}),radius:V(10),blur:V(.85)})),d(ls,"type",ls.register("ESHeatMap",ls,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"}));let Gc=ls;const zo=class zo extends Dt{constructor(t){super(t);d(this,"editingBindMode","scatter")}};d(zo,"createDefaultProps",()=>({...Dt.createDefaultProps(),pointed:!0})),d(zo,"type",zo.register("ESGeoPoints",zo,{chsName:"地理点集合",tags:["ESObjects","_ES_Impl_Cesium"],description:"地图中的可视化地理点集合"})),d(zo,"supportEditingModes",[...Dt.supportEditingModes,rt.ScatterAppend,rt.ScatterModify]);let vl=zo;const _y=async(r,e=[],t)=>{const n=[];for(const i of e){const{coordinates:s}=i.geometry;for(const o of s){const a=await Promise.all(o.map(async u=>{let l=u[2]??0;if(t)if(t.type==="absolute")l=t.height??l;else if(t.type==="relative"){const c=await r.getTerrainHeight([u[0],u[1]])??0;l=(t.height??l)+c}else t.type==="terrain"&&(l=await r.getTerrainHeight([u[0],u[1]])??0);return[u[0],u[1],l]}));n.push({...i,points:a})}}return n},wy=async(r,e=[],t)=>await Promise.all(e.map(async n=>{var u,l,c,h,f,p,v,C,S;const i=((u=n.geometry)==null?void 0:u.x)??((c=(l=n.geometry)==null?void 0:l.coordinates)==null?void 0:c[0]),s=((h=n.geometry)==null?void 0:h.y)??((p=(f=n.geometry)==null?void 0:f.coordinates)==null?void 0:p[1]);let a=((v=n.geometry)==null?void 0:v.z)??((S=(C=n.geometry)==null?void 0:C.coordinates)==null?void 0:S[2])??0;if(t)if(t.type==="absolute")a=t.height??a;else if(t.type==="relative"){const P=await r.getTerrainHeight([i,s])??0;a=(t.height??a)+P}else t.type==="terrain"&&(a=await r.getTerrainHeight([i,s])??0);return{...n,points:[i,s,a]}})),Ey=async(r,e=[],t)=>{const n=[];return await Promise.all(e.map(async i=>{const{coordinates:s}=i.geometry;await Promise.all(s.map(async o=>{const a=await Promise.all(o.map(async u=>{let l=u[2]??0;if(t)if(t.type==="absolute")l=t.height??l;else if(t.type==="relative"){const c=await r.getTerrainHeight([u[0],u[1]])??0;l=(t.height??l)+c}else t.type==="terrain"&&(l=await r.getTerrainHeight([u[0],u[1]])??0);return[u[0],u[1],l]}));n.push({...i,points:a})}))})),n};function FS(r){const e=Ke.lineString(r),t=Ke.length(e),n=Ke.along(e,t/2);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function kS(r,e){const t=Ke.lineString(r),n=Ke.length(t),i=Math.floor(n/e),s=[];if(s.push(r[0]),i<1)return[r[0]];for(let o=1;o<i;o+=1){const a=Ke.along(t,n*(o/i));s.push([a.geometry.coordinates[0],a.geometry.coordinates[1],a.geometry.coordinates[2]||0])}return s}function VS(r){const e=[...r];JSON.stringify(r[0])!==JSON.stringify(r[r.length-1])&&e.push(r[0]);const t=Ke.polygon([e]),n=Ke.center(t);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function Cy(r,e,t){const n=r.dv(new Aa);for(const i in t)i!=="type"&&(n[i]=t[i]);n.position=e,r.d(r.components.disposableAdd(n))}function ep(r,e,t,n){let i=n.textTemplate||n.symbol.text||"";const s=/{{(.*?)}}/;for(;s.test(i);){const c=i.match(s);if(c){const h=c[1].trim(),f=t[`${h}`]||"-";i=i.replace(c[0],f)}}let o=n.symbol;const{minVisibleDistance:a,maxVisibleDistance:u}=n;a&&u&&(o={...o,minVisibleDistance:a,maxVisibleDistance:u});const l={...o,text:i};Cy(r,e,l)}function Ba(r,e){const t={width:null,height:null,color:null,opacity:null,rotation:null};return e.forEach(n=>{n.type==="size"?n.axis==="width"?t.width=r[n.field]||null:n.axis==="height"&&(t.height=r[n.field]||null):n.type==="color"?t.color=r[n.field]||null:n.type==="opacity"?t.opacity=r[n.field]||null:n.type==="rotation"&&(t.rotation=r[n.field]||null)}),t}function np(r,e,t){const i={...e.symbol};if(t&&t.length>0){const s=Ba(r,t);for(let o in s)i[o]!==void 0&&s[o]!==null&&(i[o]=s[o])}return i}function rp(r,e,t){var l,c;const n=e,{uniqueValueInfos:i,field:s,fieldDelimiter:o,defaultSymbol:a}=n;let u={...a};if(Array.isArray(s)){const f=s.map(p=>r[p]??"").join(o);u=((l=i.find(p=>p.value==f))==null?void 0:l.symbol)||a}else u=((c=i.find(h=>h.value==r[s]))==null?void 0:c.symbol)||a;if(t&&t.length>0){const h=Ba(r,t);for(let f in h)u[f]!==void 0&&h[f]!==null&&(u[f]=h[f])}return u}function ip(r,e,t){const n=e,{classBreakInfos:i,field:s,defaultSymbol:o}=n;let a=o;const u=r[s];if(u===void 0||typeof u!="number")a=o;else{const l=i.find(c=>u<=c.maxValue&&u>=c.minValue);l?a=l.symbol:a=o}if(t&&t.length>0){const l=Ba(r,t);for(let c in l)a[c]!==void 0&&l[c]!==null&&(a[c]=l[c])}return a}function BS(r,e){function t(l,c,h,f){const p=w=>w*Math.PI/180,v=w=>w*180/Math.PI,C=p(l),S=p(h),P=p(f-c),y=Math.sin(P)*Math.cos(S),_=Math.cos(C)*Math.sin(S)-Math.sin(C)*Math.cos(S)*Math.cos(P),m=Math.atan2(y,_);return(v(m)+360)%360}function n(l,c,h,f,p){const C=b=>b*Math.PI/180,S=b=>b*180/Math.PI,P=f/6371e3,y=C(p),_=C(l),m=C(c),w=Math.asin(Math.sin(_)*Math.cos(P)+Math.cos(_)*Math.sin(P)*Math.cos(y)),E=m+Math.atan2(Math.sin(y)*Math.sin(P)*Math.cos(_),Math.cos(P)-Math.sin(_)*Math.sin(w));return{lat:S(w),lng:S(E),alt:h}}function i(l){const c=[];l.length>1&&c.push(t(l[0].lat,l[0].lng,l[1].lat,l[1].lng));for(let h=1;h<l.length-1;h++){const f=t(l[h-1].lat,l[h-1].lng,l[h].lat,l[h].lng),p=t(l[h].lat,l[h].lng,l[h+1].lat,l[h+1].lng);let v=(f+p)/2;Math.abs(f-p)>180&&(v=(v+180)%360),c.push(v)}return l.length>1&&c.push(t(l[l.length-2].lat,l[l.length-2].lng,l[l.length-1].lat,l[l.length-1].lng)),l.length===1&&c.push(0),c}if(!r||r.length<2)throw new Error("至少需要两个点才能生成路径");if(e<=0)throw new Error("宽度必须大于0");const s=e/2,o=i(r),a=[],u=[];for(let l=0;l<r.length;l++){const c=(o[l]+90)%360,h=(o[l]+270)%360,f=r[l].alt!==void 0?r[l].alt:0;a.push(n(r[l].lat,r[l].lng,f,s,c)),u.push(n(r[l].lat,r[l].lng,f,s,h))}return a.concat(u.reverse())}function jS(r,e,t,n){function i(C){return C*(Math.PI/180)}const s=6378137,o=i(r),a=i(e),u=i(t),l=i(n),c=u-o,h=l-a,f=Math.sin(c/2)**2+Math.cos(o)*Math.cos(u)*Math.sin(h/2)**2,p=2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f));return s*p}const Sy=(r,e,t)=>Array.isArray(e)?e.map(s=>r[s]??"").join(t):r[e]??"";function by(r,e){const n={...e.symbol};return{points:r.map(i=>i.points),symbol:n}}function Py(r,e){const t=e,{uniqueValueInfos:n,field:i,fieldDelimiter:s,defaultSymbol:o}=t,a=[],u=n.reduce((c,h)=>{const f=h.value.toString();return c[f]={points:[],value:h.value,symbol:h.symbol},c},{});for(let c=0;c<r.length;c++){const h=r[c],f=Sy(h,i,s);if(f!==void 0&&f!==""){const p=u[f.toString()];p?p.points.push(h.points):a.push(h.points)}else a.push(h.points)}const l=[];for(let c in u){const{points:h,symbol:f}=u[c];h.length>0&&l.push({points:h,symbol:f})}return a.length>0&&l.push({points:a,symbol:o}),l}function Iy(r,e){const t=e,{classBreakInfos:n,field:i,defaultSymbol:s}=t,o=[],a=n.map(l=>({...l,points:[]}));for(let l=0;l<r.length;l++){const c=r[l],h=c[i];if(h===void 0||typeof h!="number")o.push(c.points);else{const f=a.findIndex(p=>h<=p.maxValue&&h>=p.minValue);f!==-1?a[f].points.push(c.points):o.push(c.points)}}const u=[];return a.forEach(l=>{l.points.length>0&&u.push({points:l.points,symbol:l.symbol})}),o.length>0&&u.push({points:o,symbol:s}),u}function zS(r,e,t=[]){const i={...e.symbol},s=r.map(o=>{const a=Ba(o,t);return{position:o.points,rotation:a.rotation||i.rotation||[0,0,0],scale:i.scale||[1,1,1]}});return{url:i.url,locations:s}}function US(r,e,t=[]){const n=e,{uniqueValueInfos:i,field:s,fieldDelimiter:o}=n,a=n.defaultSymbol,u=[],l=i.reduce((h,f)=>{const p=f.value.toString();return h[p]={locations:[],value:f.value,symbol:f.symbol},h},{});for(let h=0;h<r.length;h++){const f=r[h],p=Sy(f,s,o);if(p){const v=l[p.toString()];if(v){const C=Ba(f,t);v.locations.push({position:f.points,rotation:C.rotation||a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else u.push({position:f.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else u.push({position:f.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}const c=[];for(let h in l){const{locations:f,symbol:p}=l[h];f.length>0&&c.push({url:p.url,locations:f})}return u.length>0&&c.push({url:a.url,locations:u}),c}function GS(r,e,t=[]){const n=e,{classBreakInfos:i,field:s}=n,o=n.defaultSymbol,a=[],u=i.map(c=>({...c,locations:[]}));for(let c=0;c<r.length;c++){const h=r[c],f=h[s];if(f===void 0||typeof f!="number")a.push({position:h.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]});else{const p=u.findIndex(v=>f<=v.maxValue&&f>=v.minValue);if(p!==-1){const v=Ba(h,t);u[p].locations.push({position:h.points,rotation:v.rotation||o.rotation||[0,0,0],scale:u[p].symbol.scale||[1,1,1]})}else a.push({position:h.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]})}}const l=[];return u.forEach(c=>{c.locations.length>0&&l.push({url:c.symbol.url,locations:c.locations})}),a.length>0&&l.push({url:o.url,locations:a}),l}class WS extends B{constructor(t,n,i,s){super();d(this,"labelingInfo");this.sceneObject=t;const o=n;if(s&&hi(o,a=>{this.renderLabel(a,s)}),i)if(i.type==="simple"){const{visualVariables:a}=i;if(i.symbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!");const u=by(o,i);this._simplePointAllRender(u.points,u.symbol);return}if(i.symbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!");const u=by(o,i);this._imageAllRender(u.points,u.symbol);return}if(i.symbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!");const{url:u,locations:l}=zS(o,i,a);this._modelAllRender(u,l);return}for(let u=0;u<o.length;u++){const l=np(o[u],i,a);this.render(o[u],l)}}else if(i.type==="unique-value"){const{visualVariables:a}=i;if(i.uniqueValueInfos.findIndex(h=>h.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),Py(o,i).forEach(({points:f,symbol:p})=>{this._simplePointAllRender(f,p)});return}if(i.uniqueValueInfos.findIndex(h=>h.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),Py(o,i).forEach(({points:f,symbol:p})=>{this._imageAllRender(f,p)});return}if(i.uniqueValueInfos.findIndex(h=>h.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),US(o,i,a).forEach(({url:f,locations:p})=>{this._modelAllRender(f,p)});return}for(let h=0;h<o.length;h++){const f=rp(o[h],i,a);this.render(o[h],f)}}else if(i.type==="class-breaks"){const{visualVariables:a}=i;if(i.classBreakInfos.findIndex(h=>h.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),Iy(o,i).forEach(({points:f,symbol:p})=>{this._simplePointAllRender(f,p)});return}if(i.classBreakInfos.findIndex(h=>h.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),Iy(o,i).forEach(({points:f,symbol:p})=>{this._imageAllRender(f,p)});return}if(i.classBreakInfos.findIndex(h=>h.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),GS(o,i,a).forEach(({url:f,locations:p})=>{this._modelAllRender(f,p)});return}for(let h=0;h<o.length;h++){const f=ip(o[h],i,a);this.render(o[h],f)}}else if(i.type==="heatmap"){const{field:a,fieldValueMax:u,fieldValueMin:l}=i;console.time();const c=o.map(h=>{const{points:f}=h;if(a&&typeof a=="string"){let p=h[a];typeof p=="number"&&(typeof u=="number"&&p>u&&(p=u),typeof l=="number"&&p<l&&(p=l),f[2]=p)}return f});this.renderHeatmap(c,i)}else console.error("PointLayer: renderer type is not supported")}renderLabel(t,n){const{points:i}=t;ep(this.sceneObject,i,t,n)}renderHeatmap(t,n){const{is3D:i,radius:s,blur:o,gradient:a}=n,u=this.dv(new Gc);this.d(this.sceneObject.components.disposableAdd(u)),u.is3D=i,u.radius=s,u.blur=o,a&&(u.gradient={...a}),u.data=t}render(t,n){n.type==="simple-point"?this._simplePointRender(t,n):n.type==="ESImageLabel"?this._simpleImageRender(t,n):n.type==="ESGltfModel"?this._simpleModelRender(t,n):n.type==="ESTextLabel"?Cy(this.sceneObject,t.points,n):n.type==="ESParticleSystemPrimitive"?this._simpleParticleRender(t,n):console.error(" PointLayer: symbol type is not supported")}_simplePointRender(t,n){const{points:i}=t,{size:s,color:o,outlineColor:a,outlineWidth:u}=n,l=this.dv(new vl);this.d(this.sceneObject.components.disposableAdd(l)),l.pointed=!0,l.pointOutlineColor=a,l.pointOutlineWidth=u,l.pointSize=s,l.pointColor=o,l.allowPicking=(n==null?void 0:n.allowPicking)??!0,l.extras={selected:!1},l.points=[i]}_simplePointAllRender(t,n){const{size:i,color:s,outlineColor:o,outlineWidth:a}=n,u=this.dv(new vl);this.d(this.sceneObject.components.disposableAdd(u)),u.pointed=!0,u.pointOutlineColor=o,u.pointOutlineWidth=a,u.pointSize=i,u.pointColor=s,u.allowPicking=(n==null?void 0:n.allowPicking)??!0,u.points=[...t]}_simpleImageRender(t,n){const{points:i}=t,{rotation:s,offset:o,size:a,url:u,screenRender:l,anchor:c,renderMode:h,rotationType:f}=n,p=this.dv(new kc),v=this.dv(new Aa);this.d(this.sceneObject.components.disposableAdd(p)),this.d(this.sceneObject.components.disposableAdd(v)),p.url=u,p.renderMode=h??0,s&&(p.rotation=s),o&&(p.offset=o),p.size=a||[32,32],c&&(p.anchor=c),f&&(p.rotationType=f),p.screenRender=l??!0,p.allowPicking=(n==null?void 0:n.allowPicking)??!0,p.extras={selected:!1},p.position=[...i],p.sizeByContent=!1,v.allowPicking=(n==null?void 0:n.allowPicking)??!0;const C=a?Math.max(...a)+10:Math.max(...p.size)+10;v.sizeByContent=!1,v.screenRender=!0,v.size=[C,C],v.borderRadius=[C,C,C,C],v.padding=[C/2,C/2,C/2,C/2],v.borderWidth=C/10,v.offset=[0,C/10+5],v.text="",v.backgroundColor=[0,0,0,0],v.borderColor=[0,0,0,0]}_imageAllRender(t,n){const i={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:t}}]},s=this.dv(new fl);this.d(this.sceneObject.components.disposableAdd(s));const o=this.dv(new Aa);this.d(this.sceneObject.components.disposableAdd(o)),s.textDefaultText="";const{offset:a,size:u,url:l,anchor:c}=n;s.imageUrl=l,c&&(s.imageAnchor=c),a&&(s.imageOffset=a),s.imageSize=u||[32,32],s.url=i,s.allowPicking=(n==null?void 0:n.allowPicking)??!0,s.extras={selected:!1},o.allowPicking=!0;const h=u?Math.max(...u)+10:Math.max(...s.imageSize)+10;o.sizeByContent=!1,o.size=[h,h],o.borderRadius=[h,h,h,h],o.padding=[h/2,h/2,h/2,h/2],o.borderWidth=h/10,o.offset=[0,h/10+5],o.text="",o.backgroundColor=[0,0,0,0],o.borderColor=[0,0,0,0]}_simpleModelRender(t,n){const{points:i}=t,{rotation:s,scale:o,url:a}=n,u=this.dv(new Vs);this.d(this.sceneObject.components.disposableAdd(u)),u.url=a,s&&(u.rotation=s),o&&(u.scale=o),u.position=[...i]}_modelAllRender(t,n){const i=this.dv(new Vs);this.d(this.sceneObject.components.disposableAdd(i)),i.url=t,i.instances=n}_simpleParticleRender(t,n){const{points:i}=t,s=this.dv(new Vc);this.d(this.sceneObject.components.disposableAdd(s)),s.position=[...i],Object.keys(n).forEach(o=>{s[o]=n[o]})}}class qS extends B{constructor(e,t,n,i){super(),this.sceneObject=e;const s=t;if(i&&hi(s,o=>{this.renderLabel(o,i)}),n)if(n.type==="simple"){const{visualVariables:o}=n;hi(s,a=>{const u=np(a,n,o);this.render(a,u)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;hi(s,a=>{const u=rp(a,n,o);this.render(a,u)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;hi(s,a=>{const u=ip(a,n,o);this.render(a,u)})}else console.error("PolyLineLayer: renderer type is not supported")}render(e,t){console.log("PolyLineLayer: render",e,t),t.type==="simple-line"?this._simpleLineRender(e,t):t.type==="ESPolygonFence"?this._esPolygonFenceRender(e,t):t.type==="ESPipeFence"?this._esPipeFenceRender(e,t):t.type==="ESPath"?this._esPathRender(e,t):t.type==="ESlineInterpolationModel"?this._eslineInterpolationModelRender(e,t):t.type==="ESlineWall"?this._eslineWallRender(e,t):console.error("PolyLineLayer: symbol type is not supported")}_simpleLineRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new is);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...n],i.stroked=!0,i.strokeColor=t.color,i.strokeWidth=t.width||1,i.allowPicking=(t==null?void 0:t.allowPicking)??!0,i.extras={selected:!1}}_esPolygonFenceRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new Uc);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...n],i.height=t.height,i.materialMode=t.materialMode}_esPipeFenceRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new zc);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...n],i.height=t.height,i.width=t.width,i.materialMode=t.materialMode}_esPathRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new Va),s=this.dv(new ka);if(this.d(this.sceneObject.components.disposableAdd(i)),this.d(this.sceneObject.components.disposableAdd(s)),i.points=[...n],i.speed=t.speed,i.strokeColor=t.color,i.materialMode=t.materialMode,i.strokeWidth=t.width||1,t!=null&&t.runModel){const a=t==null?void 0:t.runSpeed,u=t==null?void 0:t.modelSymbol;let l;switch(t==null?void 0:t.runModel){case"ESHuman":l=this.dv(new So);break;case"ESCar":l=this.dv(new Lc);break;case"ESGltfModel":l=this.dv(new Vs)}if(this.d(this.sceneObject.components.disposableAdd(l)),u)for(let h in u)l[h]=u[h];const c=[0];for(var o=0;o<n.length-1;o+=1){const h=n[o],f=n[o+1],p=jS(h[1],h[0],f[1],f[0]);c.push(c[o]+Math.ceil(p/a)*1e3)}i.timeStamps=c,t!=null&&t.runSpeed&&(i.currentPositionChanged.don(h=>{i.currentPosition&&(l.position=i.currentPosition,i.currentRotation&&(l.rotation=i.currentRotation))}),s.startTime=0,s.stopTime=c[c.length-1],s.playing=!0,s.loop=(t==null?void 0:t.runLoop)??!0,s.currentTimeChanged.don(h=>{i.path.currentTime=h}))}}_eslineInterpolationModelRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=(t==null?void 0:t.interpolationDistance)??0;if(!i)return;const s=kS(n,i/1e3),o=this.dv(new Vs);this.d(this.sceneObject.components.disposableAdd(o)),o.url=t.url,o.instances=s.map(a=>({position:a,rotation:t.rotation,scale:t.scale}))}_eslineWallRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=t.height??0,s=t.width??0,o=t.extrudedHeight??0,a=n.map(c=>({lng:(c==null?void 0:c[0])??0,lat:(c==null?void 0:c[1])??0,alt:(c==null?void 0:c[2])??0})),u=BS(a,s).map(c=>[(c==null?void 0:c.lng)??0,(c==null?void 0:c.lat)??0,(c==null?void 0:c.alt)??0]),l=this.dv(new bo);this.d(this.sceneObject.components.disposableAdd(l)),l.height=i,l.extrudedHeight=o,l.filled=t.filled??!0,l.fillColor=t.fillColor,l.allowPicking=(t==null?void 0:t.allowPicking)??!0,l.extras={selected:!1},l.points=u}renderLabel(e,t){const{points:n}=e,i=FS(n);ep(this.sceneObject,i,e,t)}}function xy(r,e){try{JSON.stringify(r[r.length-1])!==JSON.stringify(r[0])&&r.push(r[0]);const t=Ke.featureCollection(r.map(u=>Ke.point(u))),n=Ke.polygon([r]),i={gridType:"point",units:"meters"};return Ke.interpolate(t,e,i).features.map(u=>u.geometry.coordinates)[0][0].filter(u=>Ke.booleanPointInPolygon(Ke.point(u),n))}catch(t){return console.error(t),[]}}class HS extends B{constructor(e,t,n,i){super(),this.sceneObject=e;const s=t;if(i&&hi(s,o=>{this.renderLabel(o,i)}),n)if(n.type==="simple"){const{visualVariables:o}=n;hi(s,a=>{const u=np(a,n,o);this.render(a,u)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;hi(s,a=>{const u=rp(a,n,o);this.render(a,u)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;hi(s,a=>{const u=ip(a,n,o);this.render(a,u)})}else console.error("PolyLineLayer: renderer type is not supported")}renderLabel(e,t){const{points:n}=e;console.log("PolygonLayer: renderLabel",n);const i=VS(n);ep(this.sceneObject,i,e,t)}render(e,t){t.type==="simple-fill"?this._simplePolygonRender(e,t):t.type==="ESGeoExtrudedPolygon"?this._esGeoExtrudedPolygonRender(e,t):t.type==="PolygonInterpolateESGltfModel"?this._polygonInterpolateESGltfModelRender(e,t):t.type==="PolygonInterpolateESImageLabel"?this._polygonInterpolateESImageLabelRender(e,t):console.error("PolyLineLayer: symbol type is not supported")}_simplePolygonRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{color:i,outline:s,filled:o,ground:a}=t,{width:u,color:l,stroked:c}=s,h=this.dv(new Ht);this.d(this.sceneObject.components.disposableAdd(h)),h.stroked=c??!1,h.strokeColor=l??[1,1,1,1],h.strokeWidth=u??1,h.filled=o??!0,h.fillGround=a??!1,h.fillColor=i??[1,1,1,1],h.allowPicking=(t==null?void 0:t.allowPicking)??!0,h.extras={selected:!1},h.points=[...n]}_esGeoExtrudedPolygonRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,extrudedHeight:s,color:o}=t,a=this.dv(new bo);this.d(this.sceneObject.components.disposableAdd(a)),a.height=i,a.extrudedHeight=s,a.filled=!0,a.fillColor=o,a.allowPicking=(t==null?void 0:t.allowPicking)??!0,a.extras={selected:!1},a.points=[...n]}_polygonInterpolateESGltfModelRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,interpolateDistance:s,url:o,rotation:a,scale:u}=t,l=xy(n,s??10),c=this.dv(new Vs);this.d(this.sceneObject.components.disposableAdd(c)),c.url=o,c.instances=l.map(h=>({position:[...h,i??0],rotation:a??[0,0,0],scale:u??[1,1,1]}))}_polygonInterpolateESImageLabelRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,interpolateDistance:s,offset:o,size:a,url:u,anchor:l}=t,h={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:[...xy(n,s??10).map(p=>[...p,i??0])]}}]},f=this.dv(new fl);this.d(this.sceneObject.components.disposableAdd(f)),f.textDefaultText="",f.imageUrl=u,l&&(f.imageAnchor=l),o&&(f.imageOffset=o),a&&(f.imageSize=a),f.url=h}}class XS extends B{constructor(t,n){super();d(this,"_initEvent",this.dv(new N));const i=this,s=async()=>{try{const a=t.featureProps;if(!a)return;const{heightMode:u,features:l,layerType:c,url:h}=a;let f=[];if(!l&&h){let p=await fetch(h).then(v=>v.json());return p=(p==null?void 0:p.features)??p,c==="polylineVector"?f=await _y(n,p,u):c==="polygonVector"?f=await Ey(n,p,u):c==="pointVector"&&(f=await wy(n,p,u)),f}else c==="polylineVector"?f=await _y(n,l,u):c==="polygonVector"?f=await Ey(n,l,u):c==="pointVector"&&(f=await wy(n,l,u));return f}catch(a){console.error(a);return}},o=this.dv(Pe(this._initEvent,t.featurePropsChanged));i.dv(new we(o,()=>{if(!t.featureProps)return;const a=t.featureProps;let u;return(async()=>{const{layerType:c,renderer:h,labelingInfo:f}=a,p=await s();!p||p.length===0||(c==="pointVector"?u=new WS(t,p,h,f):c==="polylineVector"?u=new qS(t,p,h,f):c==="polygonVector"&&(u=new HS(t,p,h,f)),console.log("polygonVectorLayer","createLayer",u))})().catch(console.error),{destroy:()=>{var c;(c=u==null?void 0:u.destroy)==null||c.call(u),u=void 0}}}));{const a=(u,l=1)=>{const c=qv(u);if(!c)return;const{center:h,radius:f}=c;n.flyTo({distance:f*4,heading:0,pitch:-90,flyDuration:l??1,hDelta:0,pDelta:0},h)};i.d(t.flyToEvent.don(async u=>{const{featureProps:l}=t;if(!l)return;const c=await s();if(!c)return;let h=[];l.layerType==="polylineVector"?h=c.map(f=>f.points).flat():l.layerType==="polygonVector"?h=c.map(f=>f.points).flat():l.layerType==="pointVector"&&(h=c.map(f=>f.points)),h.length!==0&&a(h,u)}))}}init(){this._initEvent.emit()}}const mu=class mu extends Wt{constructor(t){super(t);d(this,"featureLayerMap",new Map);const n=this;n.d(n.viewerAttached.don(i=>{if(console.log("ESFeatureLayer","viewerAttached",i.id),n.featureLayerMap.has(i.id))return;const s=new XS(n,i);s.init(),n.featureLayerMap.set(i.id,s)})),n.d(n.viewerDetached.don(i=>{var s;console.log("ESFeatureLayer","viewerDetached",i.id),n.featureLayerMap.has(i.id)&&((s=n.featureLayerMap.get(i.id))==null||s.destroy(),n.featureLayerMap.delete(i.id))})),n.d(()=>{for(const i of n.featureLayerMap.values())i.destroy();n.featureLayerMap.clear()}),n.d(ps(n.showChanged,()=>{for(const i of n.components.values())Reflect.has(i,"show")&&(i.show=n.show)},{immediate:!0}))}};d(mu,"createDefaultProps",()=>({...Wt.createDefaultProps(),featureProps:Yt(void 0)})),d(mu,"type",mu.register("ESFeatureLayer",mu,{chsName:"矢量图层",tags:["ESObjects"],description:"ESFeatureLayer"}));let sp=mu;const cs=class cs extends B{constructor(){super();d(this,"_loading",!1);d(this,"_loadedEvent",this.disposeVar(new N));d(this,"_loaded",!1);d(this,"_loadedPromiseResolve");d(this,"_loadedPromise",new Promise(t=>{this._loadedPromiseResolve=t}));d(this,"_processing",this.disposeVar(qn(async t=>{if(this._loading=!0,window.Hls)console.info("可能系统已经加载hlsjs,此处不再加载!");else{const n=et.context.getStrFromEnv(cs.path);await t.promise(fh(n))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})));this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return cs._instance=cs._instance||new cs,cs._instance}};d(cs,"path","${xr-utils-script-dir}/xr-static/xr-utils/hlsjs/1.4.12/hls.min.js"),d(cs,"_instance");let Wc=cs,YS=class extends B{constructor(t,n){super();d(this,"_element");this._complexImage=t,this._videoSrc=n;var i=document.createElement("video");i.src=this._videoSrc,i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.zIndex="-100",i.style.visibility="hidden";{const s=()=>{i.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{i.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{i.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}i.muted=!0,document.body.appendChild(i),this._element=i,this.dispose(()=>document.body.removeChild(i))}get element(){return this._element}};class JS extends B{constructor(t,n){super();d(this,"_videoDom");d(this,"_processing",this.disposeVar(qn(async t=>{const{videoSrc:n}=this,i=Wc.instance();await t.promise(i.loadedPromise);const s=window.Hls,o=new s,a=this.element;await Qs(t,()=>new Promise((u,l)=>{a.xbsjHLS=o,o.attachMedia(a),o.on(s.Events.MEDIA_ATTACHED,()=>{o.loadSource(n),o.on(s.Events.MANIFEST_PARSED,(c,h)=>{a.play(),u()})}),o.on(s.Events.ERROR,(c,h)=>{const{type:f,details:p,fatal:v}=h;v&&(o.destroy(),l(p))})}))})));d(this,"_processingStartup",this._processing.start());this._complexImage=t,this._videoSrc=n,this._videoDom=this.disposeVar(new YS(this._complexImage,""))}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class Ty extends B{constructor(t,n){super();d(this,"_videoDom");d(this,"_update",this.disposeVar(Ko(()=>this.update())));d(this,"_updateStart",this._update.start());this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new JS(this._complexImage,this._imageUri))}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const t=this._complexImage,{videoWidth:n,videoHeight:i}=this.videoElement;t.size=[n,i],t.pixelFormat="RGBA",t.copyTexture({source:this.videoElement})}}const hs=class hs extends B{constructor(){super();d(this,"_loading",!1);d(this,"_loadedEvent",this.disposeVar(new N));d(this,"_loaded",!1);d(this,"_loadedPromiseResolve");d(this,"_loadedPromise",new Promise(t=>{this._loadedPromiseResolve=t}));d(this,"_processing",this.disposeVar(qn(async t=>{if(this._loading=!0,window.flvjs)console.info("可能系统已经加载flvjs,此处不再加载!");else{const n=et.context.getStrFromEnv(hs.path);await t.promise(fh(n))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})));this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return hs._instance=hs._instance||new hs,hs._instance}};d(hs,"path","${xr-utils-script-dir}/xr-static/xr-utils/flvjs/1.6.2/flv.min.js"),d(hs,"_instance");let qc=hs;class ZS extends B{constructor(t,n){super();d(this,"_element");this._complexImage=t,this._videoSrc=n;var i=document.createElement("video");i.src=this._videoSrc,i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.zIndex="-100",i.style.visibility="hidden";{const s=()=>{i.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{i.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{i.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}i.muted=!0,document.body.appendChild(i),this._element=i,this.dispose(()=>document.body.removeChild(i))}get element(){return this._element}}class KS extends B{constructor(t,n){super();d(this,"_videoDom");d(this,"_processing",this.disposeVar(qn(async t=>{const{videoSrc:n}=this,i=qc.instance();await t.promise(i.loadedPromise);const s=window.flvjs,o=this.element;await Qs(t,()=>new Promise((a,u)=>{if(!s.isSupported()){u("flvjs不支持!");return}var l=s.createPlayer({type:"flv",url:n});l.attachMediaElement(o),l.load(),l.play(),o.xbsjFlvPlayer=l}))})));this._complexImage=t,this._videoSrc=n,this._videoDom=this.disposeVar(new ZS(this._complexImage,"")),this._processing.start()}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class Ny extends B{constructor(t,n){super();d(this,"_videoDom");d(this,"_update",this.disposeVar(Ko(()=>this.update())));d(this,"_updateStart",this._update.start());this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new KS(t,this._imageUri))}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const t=this._complexImage,{videoWidth:n,videoHeight:i}=this.videoElement;t.size=[n,i],t.pixelFormat="RGBA",t.copyTexture({source:this.videoElement})}}function Oy(r){const e=r.substring(r.lastIndexOf(".")+1);return yl.suffixTypes[e]}class yl extends B{constructor(){super();d(this,"_enabled",this.disposeVar(V(!1)));d(this,"_uri",this.disposeVar(V("")));d(this,"_type",this.disposeVar(V(void 0)));d(this,"_size",this.disposeVar(ne(void 0)));d(this,"_pixelFormat",this.disposeVar(V("RGBA")));d(this,"_flipY",this.disposeVar(V(!0)));d(this,"_crossOriginReact",this.disposeVar(V("")));d(this,"_autoplayReact",this.disposeVar(V(!0)));d(this,"_loopReact",this.disposeVar(V(!0)));d(this,"_copyTextureEvent",this.disposeVar(new N));d(this,"_imageProcessingResettingEvent",this.disposeVar(Pe(this.enabledChanged,this.uriChanged,this.typeChanged)));d(this,"_imageProcessingResetting",this.disposeVar(new we(this._imageProcessingResettingEvent,()=>{do{if(!this.enabled||!this.uri)break;let{type:t}=this;if(t||(t=Oy(this.uri)),!t)break;if(t==="img")return new ig(this,this.uri);if(t==="video")return new ag(this,this.uri);if(t==="gif")return new mg(this,this.uri);if(t==="hls")return new Ty(this,this.uri);if(t==="flv")return new Ny(this,this.uri)}while(!1)})));d(this,"_createNativeTextureEvent",this.disposeVar(Pe(this.enabledChanged,this.sizeChanged,this.pixelFormatChanged,this.flipYChanged)))}get enabled(){return this._enabled.value}set enabled(t){this._enabled.value=t}get enabledChanged(){return this._enabled.changed}get uri(){return this._uri.value}set uri(t){this._uri.value=t}get uriChanged(){return this._uri.changed}get type(){return this._type.value}set type(t){this._type.value=t}get typeChanged(){return this._type.changed}get size(){return this._size.value}set size(t){this._size.value=t}get sizeChanged(){return this._size.changed}get pixelFormat(){return this._pixelFormat.value}set pixelFormat(t){this._pixelFormat.value=t}get pixelFormatChanged(){return this._pixelFormat.changed}get flipY(){return this._flipY.value}set flipY(t){this._flipY.value=t}get flipYChanged(){return this._flipY.changed}get crossOrigin(){return this._crossOriginReact.value}set crossOrigin(t){this._crossOriginReact.value=t}get crossOriginChanged(){return this._crossOriginReact.changed}get autoplay(){return this._autoplayReact.value}set autoplay(t){this._autoplayReact.value=t}get autoplayChanged(){return this._autoplayReact.changed}get loop(){return this._loopReact.value}set loop(t){this._loopReact.value=t}get loopChanged(){return this._loopReact.changed}get copyTextureEvent(){return this._copyTextureEvent}copyTexture(t){this._createNativeTextureEvent.flush(),this._copyTextureEvent.emit(t)}get imageProcessingResetting(){return this._imageProcessingResetting}get createNativeTextureEvent(){return this._createNativeTextureEvent}copyFromCanvas(t){if(t.width<=0||t.height<=0){console.warn("canvas.width <= 0 || canvas.height <= 0");return}this.size=[t.width,t.height],this.pixelFormat="RGBA",this.copyTexture({source:t})}}d(yl,"types",og),d(yl,"czmPixelFormats",sg),d(yl,"suffixTypes",{png:"img",jpg:"img",svg:"img",webp:"img",gif:"gif",mp4:"video",mov:"video",webm:"video",flv:"flv",m3u8:"hls"});const QS=[0,0,0,0];class $S{constructor(){d(this,"_value",[]);d(this,"_valueStr","[]");d(this,"_valueChanged");this.value=[{ratio:0,rgba:[0,0,1,1]},{ratio:.2,rgba:[0,1,0,1]},{ratio:.8,rgba:[1,1,0,1]},{ratio:1,rgba:[1,0,0,1]}]}get valueChanged(){return this._valueChanged||(this._valueChanged=new N),this._valueChanged}set value(e){if(e.length===0){console.error("value.length === 0");return}let t;if(this._value.length===e.length){const i=[...e].sort((s,o)=>s.ratio-o.ratio);if(t=JSON.stringify(i),this._valueStr===t)return}t=t||JSON.stringify([...e].sort((i,s)=>i.ratio-s.ratio));const n=this._value;if(this._value=JSON.parse(t),this._value.length===0)throw console.error("this._colorStops.length === 0"),new Error("this._colorStops.length === 0");this._valueChanged&&this._valueChanged.emit(this._value,n)}get value(){return JSON.parse(JSON.stringify(this._value))}get valueStr(){return this._valueStr}get minRatio(){return this._value[0].ratio}get maxRatio(){return this._value[this._value.length-1].ratio}_getRatioIndex(e){if(e<this._value[0].ratio||e>this._value[this._value.length-1].ratio)throw console.error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio"),new Error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio");let t=this._value.length;for(let n=0;n<t-1;++n)if(e>=this._value[n].ratio&&e<=this._value[n+1].ratio)return n;throw console.error("shoud not be here!"),new Error("shoud not be here!")}getRatioColor(e,t){e=Al(e,this.minRatio,this.maxRatio);const n=this._getRatioIndex(e),i=this._value[n],s=this._value[n+1],o=(e-i.ratio)/(s.ratio-i.ratio);for(let a=0;a<4;++a)t[a]=i.rgba[a]*(1-o)+s.rgba[a]*o;if(t.some(Number.isNaN)){console.error("result NaN");return}return t}getColorsInUint8(e){if(e.length%4!==0)throw console.error("result.length % 4 !== 0"),new Error("result.length % 4 !== 0");const t=e.length/4,n=1/t;for(let i=0;i<t;++i){const s=QS;this.getRatioColor((i+.5)*n,s)||s.splice(0,4,0,0,0,0);for(let o=0;o<4;++o)e[i*4+o]=255*s[o]|0}return e}}class tb extends B{constructor(){super(...arguments);d(this,"registerEngines",{})}register(t,n,i){const s=this.registerEngines[t]||new Map;return s.has(n)&&console.warn(`register warn:${t}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,i),this.registerEngines[t]=s,n}getEngineObjConstructor(t,n){const i=this.registerEngines[n];if(!i)return;let s=t.constructor,o=t.typeName,a=i.get(o);if(a)return a;if(t.components.main)return;const u=o;for(;o!=="ESSceneObject"&&(s=s.getParentClass(),!!s);)if(o=s.type,a=i.get(o),a)return console.warn(`未找到${u}在${n}中对应的实现类! 使用父类${o}的实现类!`),a}createEngineObject(t,n){const i=this.getEngineObjConstructor(t,n.typeName);if(i){const s=new i(t,n);return s.createdEvent.emit(),s}else{const s=new Po(t,n);return s.createdEvent.emit(),s}}}class eb extends B{constructor(){super(...arguments);d(this,"registerEngines",{})}register(t,n,i){const s=this.registerEngines[t]||new Map;s.has(n)&&console.warn(`register warn:${t}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,i),this.registerEngines[t]=s}getEngineObjConstructor(t,n){const s=(this.registerEngines[n]||new Map).get(t);if(s)return s;console.warn(`未找到${t}在${n}中对应的实现类!`)}createEngineObject(t,n){const i=this.getEngineObjConstructor(t.typeName,n.typeName);if(i){const s=new i(t,n);return s.createdEvent.emit(),s}else{const s=new Po(t,n);return s.createdEvent.emit(),s}}}const Dr=class Dr extends B{constructor(t,n,i=!1){super();d(this,"_createdEvent",this.dv(new N));d(this,"_id",++Dr._accumId);this._sceneObject=t,this._viewer=n;{if(i)return;const s=(o,a)=>{for(let u of o)this._viewer.delete(u);for(let u of a)u.parentID=this.sceneObject.id,this._viewer.add(u)};s([],this._sceneObject.components.values()),this.d(this._sceneObject.components.toChange.don(s)),this.d(()=>s(this._sceneObject.components.values(),[]))}}get createdEvent(){return this._createdEvent}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get id(){return this._id}};d(Dr,"context",new tb),d(Dr,"contextEditing",new eb),d(Dr,"register",Dr.context.register.bind(Dr.context)),d(Dr,"registerEditing",Dr.contextEditing.register.bind(Dr.contextEditing)),d(Dr,"_accumId",-1);let Po=Dr;function Dy(r){return typeof r=="string"?document.getElementById(r):r}function op(r){if(!r)throw new Error("container is not defined");r.innerHTML="";const e=document.createElement("div");return e.style.cssText="width: 100%; height: 100%; margin: 0px; padding: 0px; border: none; overflow: hidden; position: relative; z-index: 0; background: rgba(0,0,0,0);",r.appendChild(e),e}class My extends B{constructor(t,n){super();d(this,"_listeningSceneObjects",new Map);this._sceneObjectsMananger=t,this._createSceneObjectListeningFunc=n;const i=this._listeningSceneObjects,s=(o,a)=>{if(o)for(let u of o){const l=i.get(u);l&&(l.destroy(),i.delete(u))}if(a)for(let u of a){if(i.get(u)){console.warn(`listeningSceneObjects已存在某对象:${u.name}`,u);debugger}const c=this.createSceneObjectListeningFunc(u);c&&i.set(u,c)}};s(void 0,this._sceneObjectsMananger.sceneObjects),this.dispose(this._sceneObjectsMananger.sceneObjectsToChange.disposableOn(s)),this.dispose(()=>{for(let o of this._listeningSceneObjects.values())o.destroy();this._listeningSceneObjects.clear()})}get listeningSceneObjects(){return this._listeningSceneObjects}get createSceneObjectListeningFunc(){return this._createSceneObjectListeningFunc}}class nb extends B{constructor(e){super(),this._esObjectsManager=e;{const t=this._esObjectsManager;class n extends B{constructor(s){super(),this._esPath=s,this.dv(new we(t.activeViewerChanged,()=>{const o=t.activeViewer;if(!o)return;class a extends B{constructor(l){if(super(),this._esPath=l,!o)throw new Error("!viewer");const c=()=>{const h=t.activeViewer;h&&(this._esPath.path.currentTime=h.simulationTime)};c(),this.d(o.simulationTimeChanged.don(c))}}return new a(this._esPath)}))}}this.dv(new My(t.sceneObjectsManager,i=>{if(i instanceof Va)return new n(i)}))}{const t=this._esObjectsManager;class n extends B{constructor(s){super();const o=()=>{const a=t.activeViewer;a&&(a.simulationTime=s.currentTime??0)};o(),this.d(s.currentTimeChanged.don(o))}}this.dv(new My(t.sceneObjectsManager,i=>{if(i instanceof ka)return new n(i)}))}}}class rb extends B{constructor(e){super(),e.forEach(t=>{this.d(t.path.currentPositionChanged.don(n=>{n&&t.sceneObjects.forEach(i=>{Reflect.has(i,"position")&&(i.position=[...n])})})),this.d(t.path.currentRotationChanged.don(n=>{n&&t.sceneObjects.forEach(i=>{Reflect.has(i,"rotation")&&(i.rotation=[...n])})}))})}}class ib extends B{constructor(t){super();d(this,"_player");d(this,"_channels",this.dv(dt([])));this._objectManager=t,this._player=this._objectManager.player,this.dv(new we(this.channelsChanged,()=>{if(this.channels.length===0)return;const n=[];for(let i=0;i<this.channels.length;i++){const s=this.channels[i],o=et.getSceneObjById(s.pathId);if(!o||!(o instanceof Va))continue;const u=s.sceneObjectIds.map(l=>et.getSceneObjById(l)).filter(l=>l!==void 0);u.length!==0&&n.push({path:o,sceneObjects:u})}if(n.length!==0)return new rb(n)}))}get player(){return this._player}get channels(){return this._channels.value}get channelsChanged(){return this._channels.changed}set channels(t){this._channels.value=t}}function Hc(r){if(r.data){const{type:e,value:t}=r.data;if(e==="UITreeA"&&t instanceof mn){const{sceneObject:n}=t;if(n)return n.id}}}function sb(r,e){const{property:t,customEventName:n,otherParams:i}=e,{dragstartDataMananger:s}=r;if(!(t instanceof ta)){if(!(t instanceof bg)){if(t instanceof pt){const[o,a]=ki(t.reactVar);if(n==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const u=i[0];if(u.preventDefault(),!u.dataTransfer)return;Hc(s)?u.dataTransfer.dropEffect="move":u.dataTransfer.dropEffect="none"}else if(n==="ondrop"){if(!i)throw new Error("!otherParams");i[0].preventDefault();const l=Hc(s);l!==void 0&&a(l)}}else if(t instanceof _g){const[o,a]=ki(t.reactVar);if(n==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const u=i[0];if(u.preventDefault(),!u.dataTransfer)return;Hc(s)?u.dataTransfer.dropEffect="move":u.dataTransfer.dropEffect="none"}else if(n==="ondrop"){if(!i)throw new Error("!otherParams");const u=i[0].$event,l=i[0].strinsPropDom,c=i[0].index;u.preventDefault();const h=Hc(s);if(h!==void 0){l[c].firstChild.value=h;const f=new Event("input",{bubbles:!0,cancelable:!0});l[c].firstChild.dispatchEvent(f)}}}else if(t instanceof wg){const[o,a]=ki(t.reactVar)}}}}function Ry(r,e,t,n){if(t)n.currentActiveEditing=[r,e];else if(n.currentActiveEditing){const[i,s]=n.currentActiveEditing;i===r&&s===e&&(t||(n.currentActiveEditing=void 0))}}const ob=["editing","positionEditing","locationEditing","pointEditing","rotationEditing"];class ab extends B{constructor(e,t){super(),this._sceneObject=e;const n=this._sceneObject;for(let i of ob){const s=i+"Changed",o=n[s];if(o){{const a=n[i];Ry(n,i,a,t)}this.dispose(o.disposableOn(a=>Ry(n,i,a,t)))}}}get sceneObject(){return this._sceneObject}}class ub extends B{constructor(){super();d(this,"_currentActiveEditing",this.disposeVar(ne(void 0)));d(this,"_currentActiveEditingLastChangedTime",0);this.dispose(this._currentActiveEditing.changed.disposableOn((t,n)=>{if(this._currentActiveEditingLastChangedTime=Date.now(),n){const[i,s]=n;i[s]===!0&&(i[s]=!1)}if(t){const[i,s]=t;i[s]=!0}})),et.context.sceneObjCreatedEvent.don(t=>{t.dv(new ab(t,this))})}get currentActiveEditing(){return this._currentActiveEditing.value}set currentActiveEditing(t){this._currentActiveEditing.value=t}get currentActiveEditingChanged(){return this._currentActiveEditing.changed}get currentActiveEditingLastChangedTime(){return this._currentActiveEditingLastChangedTime}}class lb extends B{constructor(){super();d(this,"_sceneObjects",new Set);d(this,"_sceneObjectsToChange",this.dv(new N));this.d(()=>{const t=ch(this._sceneObjects);t!==0&&console.warn(`场景对象管理器销毁时仍然管理着${t}个场景对象!`)})}get sceneObjects(){return this._sceneObjects}get sceneObjectsToChange(){return this._sceneObjectsToChange}addSceneObject(t){return this._sceneObjects.has(t)?(console.warn(`创建失败:对象${t.typeName+":"+t.id}已经存在于场景对象管理器中!}`),!1):(this._sceneObjectsToChange.emit([],[t]),this._sceneObjects.add(t),!0)}deleteSceneObject(t){return this._sceneObjects.has(t)?(this._sceneObjectsToChange.emit([t],[]),this._sceneObjects.delete(t),!0):(console.warn(`删除失败:对象${t.typeName+":"+t.id}不存在于场景对象管理器中!}`),!1)}createSceneObject(t,n){const i=et.context.createSceneObject(t,n);return i&&this.addSceneObject(i),i}createSceneObjectFromUrl(t,n){const i=et.context.createSceneObjectFromUrl(t,n);return i&&this.addSceneObject(i),i}createSceneObjectFromClass(t,n){const i=et.context.createSceneObjectFromClass(t,n);return i&&this.addSceneObject(i),i}createSceneObjectFromJson(t){const n=et.context.createSceneObjectFromJson(t);return n&&this.addSceneObject(n),n}}class cb extends B{constructor(t){super();d(this,"_enabled",this.dv(V(!1)));d(this,"_cursorPosition",V(void 0));d(this,"quickPickPosition",!0);let n=new B;const i=()=>{n&&(n.destroy(),n=void 0)};this.d(i);const s=()=>{if(i(),!t||!this._enabled.value)return;n=new B;const o=n.dv(V(void 0)),a=n.dv(Pe(o.changed));n.d(t.pointerMoveEvent.don(l=>{l.pointerEvent&&(o.value=an(l.pointerEvent))}));const u=n.dv(qn(async l=>{if(o.value)if(this.quickPickPosition){const c=await l.promise(Zo(t.quickPickPosition(o.value)));this._cursorPosition.value=c}else{const c=await l.promise(Zo(t.pickPosition(o.value)));this._cursorPosition.value=c}}));n.d(a.don(()=>{u.restart()}))};s(),this.d(this._enabled.changed.don(s))}get enabled(){return this._enabled.value}set enabled(t){this._enabled.value=t}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}class hb extends B{constructor(t){super();d(this,"cursorPositionInfo");this.viewer=t,this.cursorPositionInfo=this.dv(new cb(this.viewer))}}class db extends B{constructor(t){super();d(this,"viewer");const n=this.viewer=t;this.ad(new we(n.rollerShutterChanged,()=>{const i=n.container;if(!i||!n.rollerShutter)return;const s=new B;this.viewer.splitPosition=.5;let o=this.getRollerShutterDIV();return i.appendChild(o),s.d(()=>{this.viewer.splitPosition=0,i.removeChild(o)}),s}))}getRollerShutterDIV(){let t=document.createElement("div");t.style.position="absolute",t.style.left="50%",t.style.top="0",t.style.backgroundColor="#d3d3d3",t.style.width="5px",t.style.height="100%",t.style.zIndex="9999";const n=i=>{if(!t.parentElement)return;i.preventDefault?i.preventDefault():i.returnValue=!1;const o=i.x/t.parentElement.offsetWidth;t.style.left=`${100*o}%`,this.viewer.splitPosition=o};return t.addEventListener("mouseenter",i=>{t.style.cursor="ew-resize"}),t.addEventListener("mouseleave",i=>{t.style.cursor="default"}),t.addEventListener("mousedown",i=>{t.style.cursor="ew-resize",document.addEventListener("mousemove",n)}),document.addEventListener("mouseup",i=>{t.style.cursor="default",document.removeEventListener("mousemove",n)}),t}}class fb extends B{constructor(t){super();d(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new db(t))}}function Ly(r,e){return r.length===e.length&&r.every((t,n)=>t===e[n])}class pb extends B{constructor(e){super(),this._viewer=e,this.d(z([this._viewer,"currentTime"],[this._viewer,"simulationTime"]))}}class gb extends B{constructor(e,t){super(),this._viewer=e,this._activeViewer=t;const n=$r.createCommonProps(),i=[];Object.keys(n).forEach(u=>{const l=this._activeViewer[u+"Changed"];i.push(l)});const s=this.dv(Pe(...i)),o=()=>{this._viewer.status!=="Created"||this._activeViewer.status!=="Created"||Object.keys(n).forEach(u=>{this._viewer[u]=this._activeViewer[u]})};this.d(s.don(o));const a=this.dv(Pu());a.restart(void 0,async()=>{if(this._viewer.status!=="Created"||this._activeViewer.status!=="Created")return;const u=this._activeViewer.getCurrentCameraInfo(),l=this._viewer.getCurrentCameraInfo();if(!u)return;const{position:c,rotation:h}=u;l&&Ly(c,l.position)&&Ly(h,l.rotation)||this._viewer.flyIn(c,h,0)}),this.d(()=>a.cancel())}}const mb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="40" height="40" style="shape-rendering: auto; display: block; background: rgba(255, 255, 255, 0);" xmlns:xlink="http://www.w3.org/1999/xlink"><g><circle stroke-linecap="round" fill="none" stroke-dasharray="50.26548245743669 50.26548245743669" stroke="#ffffff" stroke-width="8" r="32" cy="50" cx="50">
488
488
  <animateTransform values="0 50 50;360 50 50" keyTimes="0;1" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"></animateTransform>
489
489
  </circle><g></g></g></svg>
490
490
  `,vb='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',yb='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',Uo=class Uo extends B{constructor(e){super();const t=()=>{const n=this.dv(new Fc);this.d(z([n,"show"],[e,"useDefaultStatusDiv"]));{const i=()=>{n.show=(e.useDefaultStatusDiv??!0)&&e.status!=="Created"};i(),this.d(e.useDefaultStatusDivChanged.don(i)),this.d(e.statusChanged.don(i)),n.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}e.add(n),this.d(()=>e.delete(n)),n.instanceClass=class extends B{constructor(o,a,u){super();d(this,"_div",document.createElement("div"));if(this._subContainer=o,!u)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const v=()=>{a.show?this._div.style.opacity="1":this._div.style.opacity="0"};v(),this.d(a.showChanged.don(v))}let l,c,h,f,p;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",l=document.createElement("div"),this._div.appendChild(l),l.style.width="auto",l.style.position="absolute",l.style.left="50%",l.style.top="50%",l.style.transform="translate(-50%,-50%)",l.style.background="rgba(120, 120, 0, 0.7)",l.style.color="white",l.style.fontSize="10px",l.style.background="none",l.style.display="flex",l.style.justifyContent="center",l.style.alignItems="center",c=document.createElement("div"),l.appendChild(c),c.style.pointerEvents="none",c.style.display="block",c.style.width="40px",c.innerHTML=Uo.defaultsSvg.loadingSvg,c.style.filter="drop-shadow(0px 0px 1px black)",h=document.createElement("div"),l.appendChild(h),h.style.pointerEvents="none",h.style.marginLeft="10px",h.style.display="flex",h.style.flexFlow="column",h.style.maxWidth="300px",f=document.createElement("div"),h.appendChild(f),f.style.fontSize="14px",f.style.fontWeight="800",f.style.marginBottom="5px",f.style.textShadow="0 0 2px black",p=document.createElement("div"),h.appendChild(p),p.style.fontWeight="400",p.style.textShadow="0 0 2px black";{const v=()=>{let S="Raw";u.status==="Raw"?S="初始状态":u.status==="Creating"?S="正在创建":u.status==="Created"?S="创建完成":u.status==="Error"?S="创建失败":u.status==="Reconnecting"&&(S="重新连接"),f.innerText=`${S}(${u.status})`,p.innerText=`${u.statusLog}`,(u.status==="Creating"||u.status==="Reconnecting")&&(c.innerHTML=Uo.defaultsSvg.loadingSvg),u.status==="Created"&&(c.innerHTML=Uo.defaultsSvg.successSvg),u.status==="Error"&&(c.innerHTML=Uo.defaultsSvg.warnSvg)};v();const C=this.dv(Pe(u.statusLogChanged,u.statusChanged));this.d(C.don(v))}}update(){const o=255*Math.random()|0,a=255*Math.random()|0,u=255*Math.random()|0;this._div.style.background=`rgba(${o}, ${a}, ${u}, 0.8)`}}};this.d(e.containerChanged.don(()=>{t()}))}};d(Uo,"defaultsSvg",{loadingSvg:mb,successSvg:vb,warnSvg:yb});let ap=Uo;class _b extends B{constructor(e,t,n){super(),this._subContainer=e,this._overlayContainer=t,this._viewer=n;const i=this._subContainer,s=this._overlayContainer,o=this._viewer,a=()=>{const c=o.zIndex??"";i.style.zIndex=c,s.style.zIndex=c};a(),this.d(o.zIndexChanged.don(a));const u=()=>{i.style.display=o.show??!0?"block":"none"};u(),this.d(o.showChanged.don(u));const l=()=>{i.style.opacity=`${o.opacity??1}`};l(),this.d(o.opacityChanged.don(l))}}function Xc(r){let e=Wn(r,"_relativeContainer");return e||(e=document.createElement("div"),e.style.position="relative",e.style.width="100%",e.style.height="100%",e.style.padding="0",e.style.margin="0",r.appendChild(e),ci(r,"_relativeContainer",e)),e}class wb extends B{constructor(t,n){super();d(this,"_subContainer",document.createElement("div"));d(this,"_overlayContainer",document.createElement("div"));d(this,"_containerStyleController");this._container=t,this._viewer=n,this._containerStyleController=this.dv(new _b(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:i,overlayContainer:s}=this;i.tabIndex=-1,i.style.outline="none",i.style.width="100%",i.style.height="100%",i.onpointerdown=()=>i.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),i.setAttribute("earthsdk3","earthsdk3-subContainer"),Xc(this._container).appendChild(i),this.d(()=>Xc(this._container).removeChild(i)),Xc(this._container).appendChild(s),this.d(()=>Xc(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class Eb extends B{constructor(){super(...arguments);d(this,"registerObjsMap",new Map)}register(t,n){return this.registerObjsMap.has(t)&&console.warn(`register warn:${t}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(t,n),t}getViewerConstructor(t){const n=this.registerObjsMap.get(t);if(!n){console.warn(`未找到${t}类!`);return}return n}createViewer(t){const n=t.type;console.log(t);const i=this.getViewerConstructor(n);if(!i)throw new Error(`没有找到类型为${n}的Viewer构造器!`);return new i(t)}}class Ay extends B{constructor(e,t,n=!1,i=!1){if(super(),this._viewer=e,!t)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(ae.create(t,"pointerdown")),o=this.dv(ae.create(t,"pointermove")),a=this.dv(ae.create(t,"pointerup")),u=this.dv(ae.create(t,"pointerout")),l=this.dv(ae.create(t,"pointerover")),c=this.dv(new Ph),h=this.dv(new Mp),f=()=>{const m=this._viewer.hoverTime*1e3;h.delayTime=m};this.d(this._viewer.hoverTimeChanged.don(()=>{f()})),this.d(s.don(m=>c.pointerDown(m))),this.d(o.don(m=>c.pointerMove(m))),this.d(a.don(m=>c.pointerUp(m))),this.d(u.don(m=>c.pointerOut(m))),this.d(s.don(m=>h.pointerDown(m))),this.d(o.don(m=>h.pointerMove(m))),this.d(a.don(m=>h.pointerUp(m))),this.d(u.don(m=>h.pointerOut(m)));const{x:p,y:v}=t.getBoundingClientRect(),C=i?p:0,S=i?v:0;this.d(h.hoverEvent.don(m=>{const[w,E]=Xo(m,n);this._viewer.hoverEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(c.clickEvent.don(m=>{const[w,E]=Xo(m,n);this._viewer.clickEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(c.dbclickEvent.don(m=>{const[w,E]=Xo(m,n);m.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(s.don(m=>{const[w,E]=Xo(m,n);m.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(a.don(m=>{const[w,E]=Xo(m,n);m.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(o.don(m=>{const[w,E]=an(m,n);this._viewer.pointerMoveEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(l.don(m=>{const[w,E]=an(m,n);this._viewer.pointerOverEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(u.don(m=>{const[w,E]=an(m,n);this._viewer.pointerOutEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})}));const P=this.dv(ae.create(t,"keydown"));this.d(P.don(m=>this._viewer.keyDownEvent.emit(m)));const y=this.dv(ae.create(t,"keyup"));this.d(y.don(m=>this._viewer.keyUpEvent.emit(m)));const _=this.dv(ae.create(t,"wheel"));this.d(_.don(m=>this._viewer.wheelEvent.emit(m)))}}const ds=class ds extends B{constructor(t){super();d(this,"_forceRecreateEvent",this.dv(new N));d(this,"_container",this.dv(V(void 0)));d(this,"_containerSize",this.dv(V(void 0)));d(this,"_editingEvent",this.disposeVar(new N));d(this,"_esViewerExtensions",this.dv(new hb(this)));d(this,"_status",this.dv(V("Raw")));d(this,"_statusLog",this.dv(V("")));d(this,"_statusContainer",this.dv(new ap(this)));d(this,"_useCustomInteraction",this.dv(V(!0)));d(this,"_resetInteractionEvent",this.dv(Pe(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));d(this,"_interactionResetting",this.dv(new we(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new Ay(this,this.container)})));d(this,"_viewerChanged",this.dv(new N));d(this,"_cameraChanged",this.dv(new N));d(this,"_containerResetEvent",this.dv(Pe(this.containerChanged,this._forceRecreateEvent)));d(this,"_containerResetting",this.dv(new we(this._containerResetEvent,()=>{if(this.container)return new wb(this.container,this)})));d(this,"_sceneObjectsMap",new Map);d(this,"_id");d(this,"_typeName");d(this,"_updateFuncReact",this.dv(V(void 0)));d(this,"_toDestroyFuncReact",this.dv(V(void 0)));d(this,"_statusInfo",ds.defaults.statusInfo);d(this,"_navigationMode",this.dv(V("Map")));d(this,"_syncViewer",this.dv(V(void 0)));d(this,"_syncEventDon",this.dv(new we(this.syncViewerChanged,()=>{const t=this.syncViewer;if(t)return new gb(this,t)})));d(this,"_timeSyncdon",this.dv(new we(this.timeSyncChanged,()=>{if(this.timeSync)return new pb(this)})));d(this,"_hoverEvent",this.dv(new N));d(this,"_pointerOverEvent",this.dv(new N));d(this,"_pointerMoveEvent",this.dv(new N));d(this,"_pointerDownEvent",this.dv(new N));d(this,"_pointerUpEvent",this.dv(new N));d(this,"_pointerOutEvent",this.dv(new N));d(this,"_clickEvent",this.dv(new N));d(this,"_dblclickEvent",this.dv(new N));d(this,"_keyDownEvent",this.dv(new N));d(this,"_keyUpEvent",this.dv(new N));d(this,"_wheelEvent",this.dv(new N));d(this,"_actived",this.dv(V(!1)));this._id=t.id??qo();const n=Dy(t.container);if(n)this._container.value=op(n),this._typeName=t.type,this._initName();else throw new Error("container is not defined");{const i=()=>{n&&(this.show??!0?n.style.display="block":n.style.display="none")};i(),this.d(this.showChanged.don(i))}{const i=this._sceneObjectsMap,s=()=>{for(let[a,u]of i.entries())if(!u&&a){const l=Po.context.createEngineObject(a,this);l&&i.set(a,l)}},o=()=>{for(let[a,u]of i.entries())u&&!u.isDestroyed()&&u.destroy(),i.set(a,void 0)};this.d(o),this.d(this.viewerChanged.don(a=>{o(),a&&s()}))}{const i=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};i(),this.d(this.execOnceFuncStrChanged.don(i))}{const i=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(o){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};i(),this.d(this.updateFuncStrChanged.don(i));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||Pu(),s.restart(void 0,o=>{this.updateFunc&&this.updateFunc(this,o)}))}))}{const i=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};i(),this.d(this.toDestroyFuncStrChanged.don(i)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new fb(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(t){this._container.value=t}set containerOrId(t){if(typeof t=="string"){const n=document.getElementById(t);n&&n instanceof HTMLDivElement?this._container.value=op(n):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else t instanceof HTMLDivElement?this._container.value=op(t):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(t){this._containerSize.value=t}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get esViewerExtensions(){return this._esViewerExtensions}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(t){this._status.value=t}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(t){this._statusLog.value=t}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(t){this._useCustomInteraction.value=t}get viewerChanged(){return this._viewerChanged}get cameraChanged(){return this._cameraChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(t){return this.sceneObjectsMap.get(t)}add(...t){for(let n of t)if(!this.has(n)){et.context.addSceneObject(n);const i=Po.context.createEngineObject(n,this);i&&this._sceneObjectsMap.set(n,i),n.viewerAttached.emit(this)}}delete(...t){for(let n of t)if(this.has(n)){const i=this._sceneObjectsMap.get(n);i&&i.destroy(),et.context.deleteSceneObject(n),this._sceneObjectsMap.delete(n),n.viewerDetached.emit(this)}}disposableAdd(...t){return this.add(...t),()=>this.delete(...t)}disAdd(...t){return this.disposableAdd(...t)}has(t){return this._sceneObjectsMap.has(t)}clearAllSceneObjects(){for(let t of this.sceneObjects)this.delete(t)}get id(){return this._id}set id(t){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return ds.createDefaultProps()}_getJson(t=!0){const n={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(t){let s,o=this.defaultProps[i];o instanceof je?s=o.equals(this[i]):s=o===this[i],s||(n[i]=this[i])}else n[i]=this[i];return n}_setJson(t,n,i){if(!(t instanceof Object)||t.type&&t.type!==this.typeName){console.error(`value.type && value.type${t.type} !== this.typeName${this.typeName}`);return}t.id&&t.id!==this.id&&console.warn(`value.id === undefined || value.id${t.id} !== this.id(${this.id})`);const s=n||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in t)this[a]=t[a]===null?void 0:t[a];else if(!(i??!1)){let u=this.defaultProps[a];u instanceof je&&(u=u.value),this[a]=u}}get json(){return this._getJson()}set json(t){this._setJson(t,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(t){this._updateFuncReact.value=t}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(t){this._toDestroyFuncReact.value=t}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(t){this._syncViewer.value=t}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(t){t&&t.syncViewer&&(t.syncViewer=void 0),t===this?this._syncViewer.value=void 0:this._syncViewer.value=t}setCurrentTime(t){try{this.currentTime=typeof t=="string"?Date.parse(t):t}catch(n){console.warn(`时间格式不正确! value: ${t} error: ${n}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}get actived(){return this._actived.value}set actived(t){this._actived.value=t}get activedChanged(){return this._actived.changed}getESProperties(){return{defaultMenu:"general",basic:[],general:[],dataSource:[],location:[],coordinate:[],style:[],more:[]}}getProperties(t){const n={...this.getESProperties()},i=[];return n.general.length>0&&i.push(new ut(n.general,"general")),Object.keys(n).forEach(s=>{s!=="defaultMenu"&&s!=="general"&&n[s].length>0&&i.push(new ut(n[s],s))}),i}};d(ds,"context",new Eb),d(ds,"register",ds.context.register.bind(ds.context)),d(ds,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0,cameraMovableRegion:[0,0,0,0,0,0],depthTestAgainstTerrain:!0,terrainOpacity:1});let $r=ds;(r=>{r.createBaseProps=()=>({name:"未命名场景对象",extras:_t(void 0),devTags:ne(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),r.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:256,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:ne(void 0),editingAuxiliaryPointColor:ne(void 0),editingLineWidth:void 0,editingLineColor:ne(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:r.defaults.terrainShader,splitPosition:V(void 0),rollerShutter:!1,cameraMovableRegion:ne(void 0),depthTestAgainstTerrain:!0,terrainOpacity:1}),r.createDefaultProps=()=>({...(0,r.createBaseProps)(),...(0,r.createCommonProps)()})})($r||($r={})),Vi($r.prototype,$r.createDefaultProps);function Fy(r,e){const t=r._lastCameraInfo;if(t){const n=e.viewerChanged.don(i=>{if(!i||!t)return;const{position:s,rotation:o}=t;e.flyIn(s,o,0),r._lastCameraInfo=void 0,n()})}}const Cb=r=>{const e=$r.createCommonProps(),t={};try{Object.keys(e).forEach(n=>{t[n]=r[n]})}catch(n){console.warn(n)}return t},ky=(r,e)=>{const t=$r.createCommonProps();try{Object.keys(t).forEach(n=>{r[n]=e[n]})}catch(n){console.warn(n)}};class Sb extends B{constructor(t){super();d(this,"_viewersChanged",this.disposeVar(new N));d(this,"_viewers",new Set);d(this,"_viewersToChange",this.dv(new N));this._sceneObjectsManager=t,this.d(()=>{for(const n of this._viewers)this.destroyViewer(n);this._viewers.clear()}),this.viewers.forEach(n=>{const i=this._sceneObjectsManager.sceneObjects;n.add(...i)}),this.d(()=>{const n=this._sceneObjectsManager.sceneObjects;this.viewers.forEach(i=>{i.delete(...n)})}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don((n,i)=>{this.viewers.forEach(s=>{i.forEach(o=>{zi(s.devTags,o.devTags)&&(s.has(o)?console.warn(`${s.typeName}中已存${o.typeName},检查逻辑是否有问题!`):s.add(o))}),n.forEach(o=>{zi(s.devTags,o.devTags)&&(s.has(o)?s.delete(o):console.warn(`${s.typeName}中不存在${o.typeName},检查逻辑是否有问题!`))})}),i.length>0&&i.forEach(s=>{s.d(s.devTagsChanged.don(()=>{this.viewers.forEach(o=>{o.has(s)&&o.delete(s),console.log("sceneObjectsToChange",o.devTags,s.devTags,zi(o.devTags,s.devTags)),zi(o.devTags,s.devTags)&&(o.has(s)?console.warn(`${o.typeName}中已存${s.typeName},检查逻辑是否有问题!`):o.add(s))})}))})})),this.d(this.viewersChanged.don((n,i)=>{const s=this._sceneObjectsManager.sceneObjects;i.forEach(o=>{for(let a of s)zi(o.devTags,a.devTags)&&(o.has(a)?console.warn(`${o.typeName}中已存${a.typeName},检查逻辑是否有问题!`):o.add(a))}),n.forEach(o=>{for(let a of s)zi(o.devTags,a.devTags)&&(o.has(a)?o.delete(a):console.warn(`${o.typeName}中不存在${a.typeName},检查逻辑是否有问题!`))}),i.length>0&&i.forEach(o=>{o.d(o.devTagsChanged.don(()=>{o.clearAllSceneObjects();const a=this._sceneObjectsManager.sceneObjects;for(let u of a)console.log("viewersChanged",o.devTags,u.devTags,zi(o.devTags,u.devTags)),zi(o.devTags,u.devTags)&&(o.has(u)?console.warn(`${o.typeName}中已存${u.typeName},检查逻辑是否有问题!`):o.add(u))}))})}))}get viewersChanged(){return this._viewersChanged}get viewers(){return this._viewers}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(t){const n=$r.context.createViewer(t);return this._viewers.add(n),this._viewersChanged.emit([],[n]),n}destroyViewer(t){return t.isDestroyed()?!0:(this._viewers.delete(t),this._viewersChanged.emit([t],[]),t.destroy(),t.isDestroyed())}}class Yc extends B{constructor(...t){super();d(this,"_drgm",this.dv(new Tg));d(this,"_sobjm",this.dv(new lb));d(this,"_vrm",this.dv(new Sb(this._sobjm)));d(this,"_sceneObjectEditingManager",this.disposeVar(new ub));d(this,"_activeViewer",this.dv(V(void 0)));d(this,"_syncOtherViewersToActived",this.dv(V(!1)));d(this,"_cmrvm",this.createSceneObjectFromClass(Rc));d(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));d(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});d(this,"_sceneTree",this.dv(new cl("default",this.dragstartDataMananger,24,this)));d(this,"_propUiTreeManager",this.dv(new Ra(24)));d(this,"_sceneTreeMap",new Map);d(this,"_viewerCreatedEvent",this.dv(new N));d(this,"_lastCameraInfo");d(this,"_lastActiveViewerJson");d(this,"_syncEventDonFunc",this.d(ps([this.activeViewerChanged,this.syncOtherViewersToActivedChanged],()=>{const t=this.syncOtherViewersToActived;this.viewers.forEach(n=>{t?n.syncOtherViewer(this.activeViewer):n.syncOtherViewer(void 0)})})));d(this,"_player",this.createSceneObjectFromClass(ka));d(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));d(this,"_esPlyarAndPathTime",this.dv(new nb(this)));d(this,"_pathAnimationManager",this.dv(new ib(this)))}static get envs(){return et.context.environmentVariables}getSceneObjectById(t){return et.getSceneObjectById(t)}getSceneObject(t){return et.getSceneObject(t)}get $refs(){return et.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(t){this._activeViewer.value=t,this.viewers.values().forEach(n=>n.actived=n===t)}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(t){this._syncOtherViewersToActived.value=t}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get json(){var h;const t=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),i=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:t,modifiedTime:n,name:i},a=this.sceneTree.json,u=this._cmrvm.views,l=[...this._vrm.viewers].map(f=>f.json),c=(h=this.activeViewer)==null?void 0:h.getCurrentCameraInfo();return{asset:o,viewers:l,sceneTree:a,viewCollection:u,lastView:c}}set json(t){try{if(!t.asset)return;if(!t.asset.type||t.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=t.asset&&t.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=t.asset&&t.asset.modifiedTime||"",this._asset.name=t.asset&&t.asset.name||"未命名项目",this._asset.version=t.asset&&t.asset.version||"0.1.0",t.sceneTree&&(this.sceneTree.json=t.sceneTree),t.viewCollection&&(this._cmrvm.views=t.viewCollection),!t.viewers||!Array.isArray(t.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this._vrm.viewers.size===0||t.viewers.length===0){console.warn("viewers is empty !");return}this._vrm.viewers.forEach(n=>{const i=t.viewers.find(s=>s.id===n.id);i&&(n.json=i)})}catch(n){console.error(`ESObjectsManager解析json数据时发生错误! error: ${n}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}get propUiTreeManager(){return this._propUiTreeManager}propTreeCallback(t){return sb(this,t)}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(t="default"){if(t==="default")return this._sceneTree;if(!this._sceneTreeMap.has(t)){console.warn(`id为${t}的SceneTree不存在!`);return}return this._sceneTreeMap.get(t)}createSceneTree(t,n=24){if(this._sceneTreeMap.has(t)||t==="default")console.warn(`id为${t}的SceneTree已存在!`);else{const i=this.dv(new cl(t,this.dragstartDataMananger,n,this));this._sceneTreeMap.set(t,i)}return this.getSceneTree(t)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(t){const n=this._vrm.createViewer(t);this.activeViewer||(this.activeViewer=n);const i=this.d(n.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(n),i())}));return n}destroyViewer(t){return this._activeViewer.value===t&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(t)}switchViewer(t,n=!0,i=!0,s=!0){var l;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&n&&(this._lastCameraInfo=(l=this.activeViewer)==null?void 0:l.getCurrentCameraInfo()),!this._lastActiveViewerJson&&i&&(this._lastActiveViewerJson=this.activeViewer?Cb(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const o=t.id,a=o?[...this.getViewers()].find(c=>c.id===o):[...this.getViewers()].find(c=>c.typeName===t.type);if(a)if(o&&a.typeName!==t.type)console.warn(`id为${o}的viewer的typeName和option.type${t.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(a);else return console.log("ESViewer exists, will be used"),n&&Fy(this,a),i&&this._lastActiveViewerJson&&(ky(a,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),a.container===Dy(t.container)?(a.containerOrId=t.container,a.forceRecreate()):a.containerOrId=t.container,this.activeViewer=a,a;console.log("No ESViewer exists, will be created");const u=this.createViewer(t);return console.log(t),console.log(this),n&&Fy(this,u),i&&this._lastActiveViewerJson&&(ky(u,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=u,u}switchToCesiumViewer(...t){if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)){const{container:n,viewSync:i,attributeSync:s,destroy:o,id:a}=t[0];return this.switchViewer({type:"ESCesiumViewer",container:n,id:a},i??!0,s??!0,o??!0)}else if(typeof t[0]=="string"||t[0]instanceof HTMLDivElement){const n={container:t[0],viewSync:t[1]??!0,attributeSync:t[2]??!0,destroy:t[3]??!0,id:t[4]},{container:i,viewSync:s,attributeSync:o,destroy:a,id:u}=n;return this.switchViewer({type:"ESCesiumViewer",container:i,id:u},s,o,a)}}switchToUEViewer(...t){let n,i={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("uri")){const{container:u,uri:l,app:c,token:h,viewSync:f,attributeSync:p,destroy:v,id:C}=t[0];n={type:"ESUeViewer",container:u,id:C,options:{uri:l,app:c,token:h}},i={viewSync:f??!0,attributeSync:p??!0,destroy:v??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("ws")){const{container:u,ws:l,esmsg:c,viewSync:h,attributeSync:f,id:p,destroy:v}=t[0];n={type:"ESUeViewer",container:u,id:p,options:{ws:l,esmsg:c}},i={viewSync:h??!0,attributeSync:f??!0,destroy:v??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("project")){const{container:u,project:l,baseUrl:c,viewSync:h,attributeSync:f,id:p,destroy:v}=t[0];n={type:"ESUeViewer",container:u,id:p,options:{project:l,baseUrl:c}},i={viewSync:h??!0,attributeSync:f??!0,destroy:v??!0}}else(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?(n={type:"ESUeViewer",container:t[0],id:t[6],options:{ws:t[1],esmsg:t[2]??void 0}},i={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}):typeof t[1]=="string"&&t[1].startsWith("http")?(n={type:"ESUeViewer",container:t[0],id:t[7],options:{uri:t[1],app:t[2],token:t[3]??void 0}},i={viewSync:t[4]??!0,attributeSync:t[5]??!0,destroy:t[6]??!0}):(n={type:"ESUeViewer",container:t[0],id:t[6],options:{project:t[1],baseUrl:t[2]??void 0}},i={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}));if(!n)throw new Error("参数错误");const{viewSync:s,attributeSync:o,destroy:a}=i;return this.switchViewer(n,s,o,a)}createCesiumViewer(...t){let n;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?n={...t[0],type:"ESCesiumViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(n={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESCesiumViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createOpenLayersViewer(...t){let n;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?n={...t[0],type:"ESOlViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(n={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESOlViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createUeViewer(...t){let n;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?n={...t[0],type:"ESUeViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?n={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{ws:t[1],esmsg:t[2]??void 0}}:typeof t[1]=="string"&&t[1].startsWith("http")?n={type:"ESUeViewer",container:t[0],id:t[4]??void 0,options:{uri:t[1],app:t[2],token:t[3]??void 0}}:n={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{project:t[1],baseUrl:t[2]??void 0}}),!n)throw new Error("参数错误");return this.createViewer(n)}createSceneObject(t,n){return this._sobjm.createSceneObject(t,n)}createSceneObjectFromUrl(t,n){return this._sobjm.createSceneObjectFromUrl(t,n)}createSceneObjectFromClass(t,n){return this._sobjm.createSceneObjectFromClass(t,n)}createSceneObjectFromJson(t){return this._sobjm.createSceneObjectFromJson(t)}destroySceneObject(t){const n=this._sobjm.deleteSceneObject(t);return t.destroy(),n}destroyAllSceneObjects(){const t=[...this._sobjm.sceneObjects];for(let n of t)n!=this._player&&n!=this._cmrvm&&this.destroySceneObject(n)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}d(Yc,"getSceneObjById",et.context.getSceneObjectById.bind(et.context)),d(Yc,"getEnv",et.context.getEnv.bind(et.context)),d(Yc,"setEnv",et.context.setEnv.bind(et.context)),g.BasePropTreeItem=kd,g.Boolean2Property=B0,g.Boolean2sProperty=U0,g.Boolean3Property=j0,g.Boolean3sProperty=G0,g.Boolean4Property=z0,g.Boolean4sProperty=W0,g.BooleanProperty=Y,g.BooleansProperty=D0,g.BorderedPosFloatDiv=Xp,g.BoxPicker=yh,g.CancelError=Mr,g.CancelsManager=Eh,g.CanvasImagePoi=t0,g.CanvasPoi=Ih,g.CanvasPointPoi=e0,g.CanvasPrimitive=Rp,g.CanvasPrimitivesContext=n0,g.ColorProperty=Ot,g.ColorRgbProperty=X0,g.ColorStops=$S,g.ComplexImage=yl,g.CursorFloatDiv=a0,g.CursorInfo=u0,g.DashPatternProperty=Y0,g.DateProperty=no,g.DatesProperty=Ig,g.Debouncing=D_,g.DebouncingDeprecated=gh,g.DebouncingWithStartValues=M_,g.Destroyable=B,g.DivBoxPicker=T_,g.DivPoi=Wp,g.DivPointerClick=Q_,g.DomElementEvent=ae,g.DoublyLinkedList=gp,g.DragStartDataManager=Tg,g.ES3DTileset=Pr,g.ESAlarm=qd,g.ESApertureEffect=Hd,g.ESAreaMeasurement=Xd,g.ESBlastParticleSystem=Yd,g.ESBoxClipping=Jd,g.ESCameraView=Dc,g.ESCameraViewCollection=Rc,g.ESCameraVisibleRange=Zd,g.ESCar=Lc,g.ESCityBasePoint=Xf,g.ESClassification=Ac,g.ESClippingPlane=Kd,g.ESCustomDiv=Fc,g.ESCzml=Yf,g.ESDataMesh=Qd,g.ESDatasmithRuntimeModel=Nf,g.ESDirectionMeasurement=wf,g.ESDistanceMeasurement=$d,g.ESDynamicWater=Of,g.ESEntityCluster=qf,g.ESExcavate=hl,g.ESFeatureLayer=sp,g.ESFireParticleSystem=tf,g.ESForestTileset=ef,g.ESGaussianSplatting=Qf,g.ESGeoDiv=nf,g.ESGeoDivTextPoi=Hf,g.ESGeoExtrudedPolygon=bo,g.ESGeoJson=fl,g.ESGeoLineString=is,g.ESGeoPoints=vl,g.ESGeoPolygon=Ht,g.ESGeoRectangle=rf,g.ESGeoVector=Dt,g.ESGeoWater=Df,g.ESGltfModel=Vs,g.ESHeatMap=Gc,g.ESHeightLimitAnalysis=Wf,g.ESHeightMeasurement=Ef,g.ESHole=kf,g.ESHuman=So,g.ESHumanPoi=Ff,g.ESImageLabel=kc,g.ESImageryLayer=of,g.ESJEditingMode=rt,g.ESJLonLatFormat=xg,g.ESJPickedResult=nw,g.ESLabel=ir,g.ESLevelRuntimeModel=Mf,g.ESLocalCircle=Cf,g.ESLocalPolygon=pl,g.ESLocalPolygonZ=Sf,g.ESLocalRectangle=bf,g.ESLocalSkyBox=af,g.ESLocalVector=La,g.ESLocalVector2D=rs,g.ESLocationMeasurement=uf,g.ESMsTileset=zf,g.ESNavigator=Jf,g.ESObjectWithLocation=st,g.ESObjectsManager=Yc,g.ESParticleSystemPrimitive=Vc,g.ESPath=Va,g.ESPathImpl=Bs,g.ESPipeFence=zc,g.ESPipeline=Rf,g.ESPipeserTileset=Pf,g.ESPit=Fa,g.ESPlayer=ka,g.ESPoi2D=dl,g.ESPoi3D=lf,g.ESPoiTileset=Uf,g.ESPolygonFence=Uc,g.ESPolygonFlattenedPlane=cf,g.ESPolygonWithHole=xf,g.ESRectangle=If,g.ESRtsFeatureEditing=jf,g.ESRtsTileset=Bf,g.ESScale=Gf,g.ESSceneObject=et,g.ESSceneObjectWithId=Rg,g.ESSeparateFoliage=hf,g.ESSkylineAnalysis=tp,g.ESStaticMesh=$f,g.ESSubmergingAnalysis=df,g.ESSunshineAnalysis=ff,g.ESSurfaceAreaMeasurement=Tf,g.ESTerrainLayer=pf,g.ESTestObject=Wd,g.ESTextLabel=Aa,g.ESUEWidget=gf,g.ESUnrealActor=mf,g.ESVideoFusion=vf,g.ESViewShed=yf,g.ESViewer=$r,g.ESViewerStatusBar=Zf,g.ESViewerStatusBarScale=Kf,g.ESVisibilityAnalysis=Lf,g.ESVisualObject=Wt,g.ESVolumeMeasurement=Af,g.ESWidget=_f,g.EngineObject=Po,g.EnumProperty=St,g.EnumStringsProperty=J0,g.EvalStringProperty=ys,g.Event=N,g.EventListenerHandler=nh,g.Fetching=S_,g.FloatDiv=Nh,g.FlvJsLoading=qc,g.FlvProcessing=Ny,g.FunctionProperty=lt,g.Gif=gg,g.GifPlayer=pg,g.GifProcessing=mg,g.GroupPropTreeItem=Bd,g.GroupProperty=ut,g.HasOwner=g_,g.HlsJsLoading=Wc,g.HlsProcessing=Ty,g.IFrameBorderedPosFloatDiv=s0,g.ImageProcessing=ig,g.IntervalDeprecated=vh,g.JsonProperty=nt,g.LeafPropTreeItem=Vd,g.ListenerPipe=eh,g.LocalFileServer=ng,g.LocalRootDir=eg,g.LongStringProperty=Vh,g.MaximumScreenSpaceErrorProperty=N0,g.MinmaxProperty=Z0,g.NearFarScalerProperty=K0,g.NextAnimateFrameEvent=Dl,g.NextAnimateFrameWeakEvent=vp,g.NextMicroTaskEvent=ah,g.NextMicroTaskWeakEvent=o_,g.NonreactiveJsonStringProperty=Sg,g.Number2Property=Ae,g.Number2sProperty=Eg,g.Number3Property=un,g.Number3sProperty=kh,g.Number4Property=Rr,g.Number4WithUndefinedProperty=k0,g.Number4sProperty=V0,g.NumberProperty=R,g.NumberRangeProperty=Q0,g.NumberSliderProperty=ze,g.NumbersProperty=O0,g.ObjPool=bl,g.ObjResetting=h0,g.ObjResettingWithEvent=we,g.ObservableArray=Su,g.ObservableSet=jl,g.ParamsProperty=Cg,g.PickColorMananger=Up,g.PickedInfo=ew,g.Player=Lr,g.PlayerProperty=zl,g.PointerClick=Ph,g.PointerClickDeprecated=xp,g.PointerHover=Mp,g.PointerHoverDeprecated=$_,g.PosFloatDiv=Mh,g.PositionProperty=ta,g.PositionsProperty=bg,g.PositionsSetPropety=tw,g.Processing=Le,g.PropTree=Xv,g.PropUiTreeManager=Ra,g.Property=vs,g.ReactVarProperty=It,g.ReactiveVariable=je,g.RotationProperty=Bh,g.SceneObjectFromId=Uh,g.SceneTree=cl,g.SceneTreeContextMenu=$v,g.SceneTreeItem=mn,g.SceneTreeItemDragDrop=Qv,g.SmartListenerHandler=vu,g.SmartListenerPipe=Zy,g.SmoothMoveController=iS,g.String2Property=M0,g.String2sProperty=wg,g.String3Property=R0,g.String3sProperty=A0,g.String4Property=L0,g.String4sProperty=F0,g.StringNumberProperty=q0,g.StringNumbersProperty=H0,g.StringProperty=pt,g.StringsProperty=_g,g.Throttling=Z_,g.ThrottlingWithStartValues=K_,g.TimingDeprecated=Pp,g.ToolTipDiv=o0,g.Transition=xu,g.TransitionDeprecated=I_,g.Tree=$o,g.TreeItem=Qo,g.TreeItemDragDrop=Ng,g.UiTree=Kp,g.UiTreeObject=Zp,g.UriProperty=Du,g.VideoProcessing=ag,g.ViewPlayerProperty=Pg,g.ViewerCustomInteraction=Ay,g.Watcher=Mu,g.WatcherTools=Lg,g.WithUndefinedProperty=Fh,g.XrPlayer=Vl,g.Xyzw2Ns=Ll,g.addTreesCallFunc=iy,g.animateFrame=Nl,g.ary2Ns=C_,g.asyncFuncToCancelablePromise=F_,g.bind=it,g.bindCustomEditing=Mg,g.bindu=i_,g.booleanPointInPolygon=vw,g.canMoveToTreeItem=Ou,g.canMoveToTreeItems=Yp,g.cancelFuncToCancelablePromise=A_,g.cancelPromise=_h,g.cancelableFetch=Sh,g.cancelableFetchDeprecated=bp,g.cancelableFetchWithProgress=V_,g.cartesianDistance=Hv,g.clamp=Al,g.clamp0_360=ea,g.clampN180_180=Dg,g.complexImageTypes=og,g.createAnimateFrame=Pu,g.createAnimateFrameWithStartValues=Ko,g.createBottomTriangleElement=Hp,g.createCancelablePromise=Zo,g.createCloseDiv=qp,g.createEventsCallFunc=ps,g.createFetching=B_,g.createFetchingWithStartValues=j_,g.createGuid=qo,g.createInterval=q_,g.createIntervalWithStartValues=H_,g.createNextAnimateFrame=z_,g.createNextAnimateFrameEvent=Pe,g.createNextAnimateFrameEventCallFunc=u_,g.createNextAnimateFrameWeakEvent=l_,g.createNextAnimateFrameWithStartValues=U_,g.createNextMicroTask=G_,g.createNextMicroTaskEvent=s_,g.createNextMicroTaskWeakEvent=a_,g.createNextMicroTaskWithStartValues=W_,g.createNumbers=Rl,g.createProcessingFromAsyncFunc=qn,g.createProcessingFromAsyncFuncWithStartValues=k_,g.createProcessingFromPromiseCreateFunc=kl,g.createProcessingFromPromiseCreateFuncWithStartValues=Ch,g.createPropTreeFromSceneObject=Yv,g.createSleeping=X_,g.createSleepingWithStartValues=Y_,g.createStartFuncFromAsyncFunc=bu,g.createTimeout=Np,g.createTimeoutWithStartValues=Op,g.cutDownTreesCallFunc=ay,g.czmPixelFormats=sg,g.debounce=Tl,g.defaultGetLocalFilePath=d0,g.defaultInitSceneObjectOnCreatingFunc=iw,g.defaultLight122FromEnvironmentMapManager=Gd,g.defaultLocalFileServer=rg,g.defaultStartUpdateFunc=Ml,g.defaultUpdateSceneObjectOnPickingFunc=rw,g.defineReactiveProp=mh,g.destroyObject=hp,g.downloadLink=f_,g.drawPoint=to,g.drawRoundRectPath=Lp,g.drawText=Ap,g.drawTextBlock=xh,g.equalsN3=zd,g.every=lh,g.extendClassProps=Vi,g.fetchArrayBuffer=v_,g.fetchImage=Ep,g.forEach=hi,g.forEachWithBreak=uh,g.geoAlong=Ew,g.geoArea=Jh,g.geoBuffer=zv,g.geoCenterOfMass=Bw,g.geoDestination=$g,g.geoDifference=Uv,g.geoDistance=Jl,g.geoHeading=Fu,g.geoIntersect=Bv,g.geoLineIntersect=Xw,g.geoNearestPointOnLine=Kw,g.geoPointToLineDistance=eE,g.geoPolygonFromCircle=Gv,g.geoPolygonOverlap=Ad,g.geoRhumbDestination=iE,g.geoRhumbDistance=hm,g.geoRhumbHeading=oE,g.geoUnion=jv,g.getColorHexStr=Nu,g.getCompleteReactParams=xl,g.getDefaultValue=uw,g.getDistancesFromPositions=ll,g.getDomEventCurrentTargetPos=an,g.getDrawRect=$s,g.getEventFromPromise=O_,g.getEventPosInCurrentTarget=Xo,g.getExtProp=Wn,g.getFileArrayBuffer=tg,g.getFileJson=$p,g.getFileText=Rh,g.getFloatDivPool=Dh,g.getGeoBoundingSphereFromPositions=qv,g.getIterator=_u,g.getMidpoint=Jw,g.getMinMaxCorner=Wv,g.getMinMaxPosition=m_,g.getPromiseCancel=Yo,g.getPromiseFromEvent=N_,g.getPromiseFromProcessing=bh,g.getReactFuncs=ki,g.getSceneObjectTreeItem=sw,g.getSubEntriesFromDir=Qp,g.getTypeFromImageUri=Oy,g.getValueFromProps=yp,g.getXyzFromPostion=Fd,g.growthSimulationCallFunc=uy,g.hasSameTags=Og,g.hasSameViewerTags=zi,g.imageToCanvas=Fp,g.inOrderRunning=lw,g.interval=sh,g.isJSON=jh,g.isPromiseCancelable=Jo,g.isXML=aw,g.lbhToWebMerc=gw,g.lbhToXyz=fi,g.length=ch,g.lerpAngle=Gl,g.lerpRotation=zh,g.loadGifFrames=dg,g.loadJs=fh,g.map=Jv,g.max=Bi,g.min=gs,g.moveToTreeItem=Bl,g.moveToTreeItems=Jp,g.nextAnimateFrame=Ho,g.nextMicroTask=yu,g.objsIterator=Ks,g.oneTimeWarning=Go,g.optionsStr=fS,g.pairToPromise=wh,g.pluckProperty=hh,g.react=V,g.reactArray=dt,g.reactArrayCollection=$y,g.reactArrayCollectionWithUndefined=rh,g.reactArrayWithUndefined=ne,g.reactDeepArray=Pl,g.reactDeepArrayWithUndefined=fs,g.reactJson=_t,g.reactJsonCollection=t_,g.reactJsonCollectionWithUndefined=e_,g.reactJsonWithUndefined=Yt,g.reactPlainObject=Ky,g.reactPlainObjectWithUndefined=Qy,g.reactPosition2Ds=jd,g.reactPosition2DsSet=n_,g.reactPositions=Il,g.reactPositionsSet=mp,g.reduce=Cu,g.registerCreatedEventUpdate=HC,g.registerEventCtor=dp,g.registerEventUpdate=XC,g.removeAllTreesCallFunc=sy,g.requestAnimationFrameTimeStampTest=p_,g.rpToap=ow,g.saveOnBrowser=d_,g.setCanvasUniformColor=kp,g.setExtProp=ci,g.setPromiseCancel=ms,g.setSceneObjectTreeItem=Ul,g.setValueFromProps=h_,g.sleep=Iu,g.sleepDeprecated=b_,g.step=Qs,g.stepProcessing=J_,g.throttle=dh,g.timeout=oh,g.track=z,g.uint32ToUint8s=jp,g.uint8ToHexStr=Tu,g.uint8sToUint32=zp,g.updateTreeParamsCallFunc=oy,g.webMercToLbh=mw,g.xyz2N2=y_,g.xyz2N3=__,g.xyzToLbh=Fg,g.xyzw2N4=w_,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "earthsdk3",
3
- "version": "3.5.0-beta.16",
3
+ "version": "3.5.0-beta.17",
4
4
  "description": "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",
5
5
  "type": "module",
6
6
  "main": "./dist/earthsdk3.umd.cjs",