earthsdk3 3.11.0-beta.24 → 3.11.0-beta.25

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(w){"use strict";var SA=Object.defineProperty;var bA=(w,Qs,Dl)=>Qs in w?SA(w,Qs,{enumerable:!0,configurable:!0,writable:!0,value:Dl}):w[Qs]=Dl;var f=(w,Qs,Dl)=>bA(w,typeof Qs!="symbol"?Qs+"":Qs,Dl);function Qs(){var n;const i=((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)??"unknown";let t="Unknown";/Windows/.test(i)?t="Windows":/Macintosh/.test(i)?t="MacOS":/Linux/.test(i)?t="Linux":/Android/.test(i)?t="Android":/iOS|iPhone|iPad|iPod/.test(i)&&(t="iOS");let e="Unknown";return/x64|x86_64|Win64|WOW64/.test(i)?e="x64":/x86|i686|Win32/.test(i)?e="x86":/arm64|aarch64/.test(i)?e="arm64":/arm/.test(i)&&(e="arm"),{os:t.toLocaleLowerCase(),arch:e.toLocaleLowerCase()}}const Dl=Date.now();function p0(i){var a;const{os:t,arch:e}=Qs(),n={version:i.version,commitdate:i.date,commitId:i.commitId,runningTime:(Date.now()-Dl)/1e3/60|0,date:new Date().toLocaleString(),href:((a=window==null?void 0:window.location)==null?void 0:a.href)??"unknown",os:t,arch:e},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(l=>l.text()).then(l=>console.log(l)).catch(l=>console.log("error",l))}w.copyright=void 0;try{const i="earthsdk3",t="3.11.0-beta.24",e="2026-10-12T03:35:39.000Z",n="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="8b50b1ea0534d1a7ba6f407cb2232148e22d52d2",a=((Date.now()-1791776139e3)/36e5).toFixed(1),l=`%c🌏 ${i}%c ${t}.${s.slice(0,8)}.${e} (距今${a}个小时)
1
+ var EarthSDK3=(function(w){"use strict";var SA=Object.defineProperty;var bA=(w,Qs,Dl)=>Qs in w?SA(w,Qs,{enumerable:!0,configurable:!0,writable:!0,value:Dl}):w[Qs]=Dl;var f=(w,Qs,Dl)=>bA(w,typeof Qs!="symbol"?Qs+"":Qs,Dl);function Qs(){var n;const i=((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)??"unknown";let t="Unknown";/Windows/.test(i)?t="Windows":/Macintosh/.test(i)?t="MacOS":/Linux/.test(i)?t="Linux":/Android/.test(i)?t="Android":/iOS|iPhone|iPad|iPod/.test(i)&&(t="iOS");let e="Unknown";return/x64|x86_64|Win64|WOW64/.test(i)?e="x64":/x86|i686|Win32/.test(i)?e="x86":/arm64|aarch64/.test(i)?e="arm64":/arm/.test(i)&&(e="arm"),{os:t.toLocaleLowerCase(),arch:e.toLocaleLowerCase()}}const Dl=Date.now();function p0(i){var a;const{os:t,arch:e}=Qs(),n={version:i.version,commitdate:i.date,commitId:i.commitId,runningTime:(Date.now()-Dl)/1e3/60|0,date:new Date().toLocaleString(),href:((a=window==null?void 0:window.location)==null?void 0:a.href)??"unknown",os:t,arch:e},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(l=>l.text()).then(l=>console.log(l)).catch(l=>console.log("error",l))}w.copyright=void 0;try{const i="earthsdk3",t="3.11.0-beta.25",e="2026-10-13T04:38:46.000Z",n="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="5cbf78bb14dd689889ab418416a73d10082d2b19",a=((Date.now()-1791866326e3)/36e5).toFixed(1),l=`%c🌏 ${i}%c ${t}.${s.slice(0,8)}.${e} (距今${a}个小时)
2
2
  %c${r?r+`
3
3
  `:""}当前网站正在使用${i},此软件版权归${n}所有
4
- `;w.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","8b50b1ea0534d1a7ba6f407cb2232148e22d52d2")},get info(){return l},get date(){return"2026-10-12T03:35:39.000Z"},get author(){return"suplyang"},get version(){return"3.11.0-beta.24"},get name(){return"earthsdk3"},get commitId(){return"8b50b1ea0534d1a7ba6f407cb2232148e22d52d2"},print(){console.info(this.info,`
4
+ `;w.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","5cbf78bb14dd689889ab418416a73d10082d2b19")},get info(){return l},get date(){return"2026-10-13T04:38:46.000Z"},get author(){return"suplyang"},get version(){return"3.11.0-beta.25"},get name(){return"earthsdk3"},get commitId(){return"5cbf78bb14dd689889ab418416a73d10082d2b19"},print(){console.info(this.info,`
5
5
  font-size: 18px;
6
6
  font-weight: 1000;
7
7
  line-height: 1;
@@ -465,7 +465,7 @@ timePosRots是一个内部包含三个元素的数组,第一个表示时间戳
465
465
  ${FE}
466
466
  \`\`\`
467
467
 
468
- `,kv=Date.now(),$s=class $s extends mt{constructor(e){super(e);f(this,"_flyToEvent",this.disposeVar(new D));f(this,"_resetClockEvent",this.disposeVar(new D));this.ad(lt([this,"uri"],[this,"url"]))}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 wt([this,"url"],"路径","${earthsdk3-assets-script-dir}/assets/misc/simple.czml",void 0,!0),new W([this,"clockEnabled"],"启用",!1),new O([this,"multiplier"],"倍速",$s.defaults.multiplier),new W([this,"autoResetClock"],"自动设置时钟",!0),new ys([this,"startTime"],"开始时间",$s.defaults.startTime,!0),new ys([this,"stopTime"],"结束时间",$s.defaults.stopTime,!0),new ys([this,"currentTime"],"当前时间",$s.defaults.currentTime,!0),new ht([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep","SYSTEM_CLOCK_MULTIPLIER"),new ht([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange","UNBOUNDED"),new W([this,"shouldAnimate"],"是否启用动画",!1)],general:[...e.general,new W([this,"show"],"是否显示",!0),new W([this,"collision"],"开启碰撞",!1),new W([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new vt("飞入",n=>this.flyTo(n),[1e3],"flyTo"),new vt("重置时钟",()=>this.resetClock(),[],"resetClock"),new io([this,"loadFuncStr"],"loadFnStr",FE,jD,!0)]}}};f($s,"createDefaultProps",()=>({show:!0,uri:void 0,url:void 0,allowPicking:!1,autoResetClock:!0,clockEnabled:!1,startTime:kv,stopTime:kv+864e5,currentTime:kv,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...mt.createDefaultProps()})),f($s,"type",$s.register("ESCzml",$s,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"}));let Gv=$s;const gh=class gh extends mt{getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new _t,new W([this,"show"],"是否显示"),new O([this,"cssSize"],"尺寸"),new Ke([this,"cssPosition"],"位置"),new pt([this,"imgUrl"],"图片地址")]}}};f(gh,"createDefaultProps",()=>({...mt.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:mt.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")})),f(gh,"type",gh.register("ESNavigator",gh,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"}));let jv=gh;const Ys=class Ys extends mt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new _t("通用"),new W([this,"show"],"是否显示",Ys.defaults.show),new O([this,"height"],"高度",Ys.defaults.height,!0),new O([this,"fontSize"],"文字大小",Ys.defaults.fontSize,!0),new Rt([this,"bgColor"],"背景颜色",Ys.defaults.bgColor,!0)]}}};f(Ys,"createDefaultProps",()=>({...mt.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:ot([.2784313725490196,.2784313725490196,.2784313725490196,.8])})),f(Ys,"type",Ys.register("ESViewerStatusBar",Ys,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let Vv=Ys;const Js=class Js extends mt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new _t("通用"),new W([this,"show"],"是否显示",Js.defaults.show),new O([this,"height"],"高度",Js.defaults.height,!0),new O([this,"fontSize"],"文字大小",Js.defaults.fontSize,!0),new Rt([this,"bgColor"],"背景颜色",Js.defaults.bgColor,!0)]}}};f(Js,"createDefaultProps",()=>({...mt.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:ot([.2784313725490196,.2784313725490196,.2784313725490196,.8])})),f(Js,"type",Js.register("ESViewerStatusBarScale",Js,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let zv=Js;const ph=class ph extends dt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new pt([this,"url"],"路径","",!0),new O([this,"progress"],"进度",0,!1,!0)]}}};f(ph,"createDefaultProps",()=>({...dt.createDefaultProps(),url:"",progress:0})),f(ph,"type",ph.register("ESGaussianSplatting",ph,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"}));let Bv=ph;class VD extends B{constructor(t,e){if(super(),!e)return;const n=this.ad(new Jt);n.stroked=!0,this.ad(t.components.disposableAdd(n)),this.ad(lt([n,"points"],[t,"areaLiftingPoints"])),this.ad(n.editingChanged.don(()=>{n.editing||!this.isDestroyed()&&this.destroy()})),n.editing=!0}}var kE=(i=>(i[i.None=0]="None",i[i.Up=1]="Up",i[i.Down=2]="Down",i))(kE||{}),GE=(i=>(i[i.CLICK=0]="CLICK",i[i.MOVE=1]="MOVE",i))(GE||{}),jE=(i=>(i[i.Smooth=0]="Smooth",i[i.Linear=1]="Linear",i[i.Spherical=2]="Spherical",i[i.Tip=3]="Tip",i[i.Hard=4]="Hard",i))(jE||{});const vi=class vi extends dt{constructor(e){super(e);f(this,"_startEvent",this.disposeVar(new D));f(this,"_configs",this.disposeVar(oe(void 0)));f(this,"_heights",this.disposeVar(z({})));f(this,"_heightsEvent",this.ad(new D));f(this,"_areaLiftingUpdateEvent",this.disposeVar(new D));const n=this.ad(Ve(this.modeChanged,this.startEvent));this.ad(new qe(n,()=>{var r;if(this.areaLiftingPoints=void 0,this.mode=="areaLifting")return new VD(this,this.activeViewer);(r=this.activeViewer)==null||r.startEditing(this,nt.BrushErase)}))}updateEditing(){var e;Nf(this.position,[0,0,0])||(this.position=[0,0,0]),(e=this.activeViewer)==null||e.startEditing(this,nt.Place,{callSource:"inner"})}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get configs(){return this._configs.value}set configs(e){this._configs.value=e}get configsChanged(){return this._configs.changed}getConfig(...e){var n,r;if(typeof e[0]=="number")return(n=this.configs)==null?void 0:n.find(s=>s.x===e[0]&&s.y===e[1]);if(typeof e[0]=="string")return(r=this.configs)==null?void 0:r.find(s=>s.url===e[0])}get heights(){return this._heights.value}set heights(e){this._heights.value=e}get heightsChanged(){return this._heights.changed}get heightsEvent(){return this._heightsEvent}getHeights(){return new Promise((e,n)=>{const r=new B;r.ad(this._heightsEvent.don(o=>{o!=="start"&&(!r.isDestroyed()&&r.destroy(),e(o))})),this._heightsEvent.emit("start");const s=setTimeout(()=>{r.isDestroyed()||(r.destroy(),e(void 0))},2e3);r.ad(()=>clearTimeout(s))})}get areaLiftingUpdateEvent(){return this._areaLiftingUpdateEvent}areaLiftingUpdate(){this._areaLiftingUpdateEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new vt("开始编辑",()=>{this.start()},[],"start"),new ht([this,"mode"],vi.modes,"编辑模式",vi.defaults.mode)],basic:[...e.basic,new wt([this,"url"],"URL"),new wt([this,"tileInfo"],"瓦片信息配置"),new O([this,"maxHeight"],"最大高度"),new O([this,"minHeight"],"最小高度"),new O([this,"offset"],"偏移"),new W([this,"autoLoadHeights"],"自动加载高度"),new _t("刷写设置"),new O([this,"brushEraseRadius"],"编辑半径"),new Ke([this,"brushEraseRadiusRange"],"编辑半径范围",void 0,!0,!0),new ht([this,"brushEraseMode"],Object.entries(["CTRL","SHIFT","NONE"]),"刷写模式"),new ht([this,"brushErasePickReference"],vi.brushErasePickReferences,"选择参考"),new _s([this,"brushErasePosition"],"刷写位置"),new _s([this,"brushEraseStartPosition"],"刷写起始位置"),new ht([this,"brushEraseFalloff"],vi.brushEarseFalloffs,"刷写衰减函数"),new ht([this,"brushEraseRayDirection"],[["Up","Up"],["Down","Down"]],"刷写射线方向"),new _t("平整设置"),new ht([this,"flattenMode"],vi.flattenModes,"平整模式",0),new ht([this,"flattenPick"],vi.flattenPicks,"平整选择",0),new O([this,"flattenOffset"],"平整偏移",-.01),new _t("区域升降设置"),new Ne([this,"areaLiftingPoints"],"区域升降位置",[]),new O([this,"areaLiftingOffset"],"区域升降偏移",1),new vt("区域升降更新",()=>{this.areaLiftingUpdate()},[],"areaLiftingUpdate"),new _t("围栏设置"),new Ne([this,"fencePoints"],"围栏位置",[])]}}};f(vi,"createDefaultProps",()=>({...dt.createDefaultProps(),allowPicking:!0,url:"",maxHeight:0,minHeight:0,offset:.01,tileInfo:bt({tileCountX:65,tileCountY:65,tileMaximumLevel:15,tilesPerAxis:5,format:"heights"}),mode:z("sculpt"),autoLoadHeights:!1,brushEraseRadius:100,brushEraseRadiusRange:ot([0,100]),brushErasePosition:ot([0,0,0]),brushEraseStartPosition:ot([0,0,0]),brushEraseMode:z("NONE"),brushErasePickReference:z("NONE"),brushEraseRayDirection:z("Down"),brushEraseFalloff:z(4),flattenMode:z(0),flattenPick:z(1),flattenOffset:-.01,areaLiftingPoints:Pa(void 0),areaLiftingOffset:1,fencePoints:Pa(void 0),fenceMode:z("in")})),f(vi,"modes",[["雕刻","sculpt"],["抹除","erase"],["平滑","smooth"],["平整","flatten"],["区域升降","areaLifting"]]),f(vi,"brushErasePickReferences",[["无限制","NONE"],["地形图层","ESTerrainLayerEditing"],["3DTiles","ES3DTileset"]]),f(vi,"flattenModes",[["None",0],["Up",1],["Down",2]]),f(vi,"flattenPicks",[["CLICK",0],["MOVE",1]]),f(vi,"brushEarseFalloffs",[["平滑",0],["线性",1],["硬边",4],["球形",2],["尖顶",3]]),f(vi,"invalidValue",-1e4),f(vi,"type",vi.register("ESTerrainLayerEditing",vi,{chsName:"地形图层编辑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于对地形数据进行编辑"})),f(vi,"supportEditingModes",[...dt.supportEditingModes,nt.Place,nt.BrushErase]);let Vc=vi;const nr=class nr extends Dt{constructor(e){super(e);f(this,"editingBindMode","doublePoints");f(this,"_startEvent",this.disposeVar(new D));f(this,"_replayEvent",this.disposeVar(new D));this.ad(this.startEvent.don(()=>{var n;(n=this.activeViewer)==null||n.startEditing(this,nt.BrushErase)}))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get replayEvent(){return this._replayEvent}replay(){this._replayEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new vt("开始编辑",()=>this.start(),[]),new vt("重播",()=>this.replay(),[]),new W([this,"showImage"],"显示影像",nr.defaults.showImage),new O([this,"flowSpeed"],"流动速度",nr.defaults.flowSpeed),new O([this,"gravity"],"重力加速度",nr.defaults.gravity),new O([this,"strength"],"泥石流强度",nr.defaults.strength),new O([this,"resistance"],"泥石流阻力(越大越快平息)",nr.defaults.resistance),new O([this,"terrainOffset"],"地形高度偏移",nr.defaults.terrainOffset),new Ne([this,"slidePoints"],"滑坡点数组",Dt.defaults.slidePoints,void 0),new _t("刷写设置"),new O([this,"brushEraseRadius"],"编辑半径"),new Ke([this,"brushEraseRadiusRange"],"编辑半径范围",void 0,!0,!0),new ht([this,"brushEraseMode"],Object.entries(["CTRL","SHIFT","NONE"]),"刷写模式"),new ht([this,"brushErasePickReference"],Vc.brushErasePickReferences,"选择参考"),new _s([this,"brushErasePosition"],"刷写位置"),new _s([this,"brushEraseStartPosition"],"刷写起始位置"),new ht([this,"brushEraseFalloff"],Vc.brushEarseFalloffs,"刷写衰减函数"),new ht([this,"brushEraseRayDirection"],[["Up","Up"],["Down","Down"]],"刷写射线方向")]}}};f(nr,"createDefaultProps",()=>({...Dt.createDefaultProps(),brushEraseRadius:100,brushEraseRadiusRange:ot([0,1e3]),brushErasePosition:ot([0,0,0]),brushEraseStartPosition:ot([0,0,0]),brushEraseMode:z("NONE"),brushErasePickReference:z("NONE"),brushEraseRayDirection:z("Down"),terrainOffset:5,flowSpeed:1,gravity:9.8,slidePoints:ot([]),strength:1,showImage:!0,resistance:.98,stroked:!0,strokeStyle:bt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!0})})),f(nr,"type",nr.register("ESLandSlide",nr,{chsName:"滑坡泥石流分析",tags:["ESObjects","_ES_Impl_Cesium"],description:"滑坡泥石流分析对象"})),f(nr,"supportEditingModes",[...Dt.supportEditingModes,nt.DoublePoints,nt.DoublePointsAppend,nt.DoublePointsModify,nt.BrushErase]);let Uv=nr;const Il=class Il extends dt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new pt([this,"mesh"],"mesh地址",Il.defaults.mesh)]}}};f(Il,"createDefaultProps",()=>({...dt.createDefaultProps(),mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"})),f(Il,"type",Il.register("ESStaticMesh",Il,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"}));let qv=Il;const mh=class mh extends Dt{constructor(e){super(e);f(this,"_startEvent",this.dv(new D));f(this,"_clearEvent",this.dv(new D));f(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new nl),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(F([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(F([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(F([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(F([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(F([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(F([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(F([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 vt("开始分析",()=>this.start(),[],"start"),new vt("清除分析",()=>this.clear(),[],"clear"),new Ne([this,"windowPositions"],"屏幕坐标",[],void 0,!1,!0),new Ne([this,"depths"],"深度值",[],void 0,!1,!0),new O([this,"radius"],"半径",1e4,!0)]}}};f(mh,"createDefaultProps",()=>({...Dt.createDefaultProps(),windowPositions:xm([]),depths:oe([]),radius:z(1e4)})),f(mh,"type",mh.register("ESSkylineAnalysis",mh,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"}));let Wv=mh;const Mo=class Mo extends Xt{constructor(t){super(t)}getESProperties(){const t=super.getESProperties();return{...t,basic:[...t.basic,new Ne([this,"data"],"数据",[],void 0,!0),new wt([this,"gradient"],"渐变",Mo.defaults.gradient,void 0,!0),new O([this,"radius"],"半径",Mo.defaults.radius,void 0,!0),new O([this,"blur"],"模糊",Mo.defaults.blur,!0),new W([this,"is3D"],"is3D",!1,!0)]}}};f(Mo,"createDefaultProps",()=>({...Xt.createDefaultProps(),is3D:z(!1),data:Pa([]),gradient:fe({".5":"green",".7":"yellow",".95":"red"}),radius:z(10),blur:z(.85)})),f(Mo,"type",Mo.register("ESHeatMap",Mo,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"}));let Jf=Mo;const Ml=class Ml extends Dt{constructor(e){super(e);f(this,"editingBindMode","scatter")}};f(Ml,"createDefaultProps",()=>({...Dt.createDefaultProps(),pointed:!0})),f(Ml,"type",Ml.register("ESGeoPoints",Ml,{chsName:"地理点集合",tags:["ESObjects","_ES_Impl_Cesium"],description:"地图中的可视化地理点集合"})),f(Ml,"supportEditingModes",[...Dt.supportEditingModes,nt.ScatterAppend,nt.ScatterModify]);let zc=Ml;const VE=async(i,t=[],e)=>{const n=[];for(const r of t){const{coordinates:s}=r.geometry;for(const o of s){const a=await Promise.all(o.map(async l=>{let u=l[2]??0;if(e)if(e.type==="absolute")u=e.height??u;else if(e.type==="relative"){const h=await i.getTerrainHeight([l[0],l[1]])??0;u=(e.height??u)+h}else e.type==="terrain"&&(u=await i.getTerrainHeight([l[0],l[1]])??0);return[l[0],l[1],u]}));n.push({...r,points:a})}}return n},zE=async(i,t=[],e)=>await Promise.all(t.map(async n=>{var l,u,h,c,d,g,p,E,b;const r=((l=n.geometry)==null?void 0:l.x)??((h=(u=n.geometry)==null?void 0:u.coordinates)==null?void 0:h[0]),s=((c=n.geometry)==null?void 0:c.y)??((g=(d=n.geometry)==null?void 0:d.coordinates)==null?void 0:g[1]);let a=((p=n.geometry)==null?void 0:p.z)??((b=(E=n.geometry)==null?void 0:E.coordinates)==null?void 0:b[2])??0;if(e)if(e.type==="absolute")a=e.height??a;else if(e.type==="relative"){const P=await i.getTerrainHeight([r,s])??0;a=(e.height??a)+P}else e.type==="terrain"&&(a=await i.getTerrainHeight([r,s])??0);return{...n,points:[r,s,a]}})),BE=async(i,t=[],e)=>{const n=[];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 l=>{let u=l[2]??0;if(e)if(e.type==="absolute")u=e.height??u;else if(e.type==="relative"){const h=await i.getTerrainHeight([l[0],l[1]])??0;u=(e.height??u)+h}else e.type==="terrain"&&(u=await i.getTerrainHeight([l[0],l[1]])??0);return[l[0],l[1],u]}));n.push({...r,points:a})}))})),n};function zD(i){const t=yi(i),e=cw(t),n=jp(t,e/2);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function BD(i,t){const e=yi(i),n=cw(e),r=Math.floor(n/t),s=[];if(s.push(i[0]),r<1)return[i[0]];for(let o=1;o<r;o+=1){const a=jp(e,n*(o/r));s.push([a.geometry.coordinates[0],a.geometry.coordinates[1],a.geometry.coordinates[2]||0])}return s}function UD(i){const t=[...i];JSON.stringify(i[0])!==JSON.stringify(i[i.length-1])&&t.push(i[0]);const e=ue([t]),n=Y_(e);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function UE(i,t,e){const n=i.dv(new Ou);for(const r in e)r!=="type"&&(n[r]=e[r]);n.position=t,i.d(i.components.disposableAdd(n))}function Hv(i,t,e,n){let r=n.textTemplate||n.symbol.text||"";const s=/{{(.*?)}}/;for(;s.test(r);){const h=r.match(s);if(h){const c=h[1].trim(),d=e[`${c}`]||"-";r=r.replace(h[0],d)}}let o=n.symbol;const{minVisibleDistance:a,maxVisibleDistance:l}=n;a&&l&&(o={...o,minVisibleDistance:a,maxVisibleDistance:l});const u={...o,text:r};UE(i,t,u)}function Lu(i,t){const e={width:null,height:null,color:null,opacity:null,rotation:null};return t.forEach(n=>{n.type==="size"?n.axis==="width"?e.width=i[n.field]||null:n.axis==="height"&&(e.height=i[n.field]||null):n.type==="color"?e.color=i[n.field]||null:n.type==="opacity"?e.opacity=i[n.field]||null:n.type==="rotation"&&(e.rotation=i[n.field]||null)}),e}function Xv(i,t,e){const r={...t.symbol};if(e&&e.length>0){const s=Lu(i,e);for(let o in s)r[o]!==void 0&&s[o]!==null&&(r[o]=s[o])}return r}function $v(i,t,e){var u,h;const n=t,{uniqueValueInfos:r,field:s,fieldDelimiter:o,defaultSymbol:a}=n;let l={...a};if(Array.isArray(s)){const d=s.map(g=>i[g]??"").join(o);l=((u=r.find(g=>g.value==d))==null?void 0:u.symbol)||a}else l=((h=r.find(c=>c.value==i[s]))==null?void 0:h.symbol)||a;if(e&&e.length>0){const c=Lu(i,e);for(let d in c)l[d]!==void 0&&c[d]!==null&&(l[d]=c[d])}return l}function Yv(i,t,e){const n=t,{classBreakInfos:r,field:s,defaultSymbol:o}=n;let a=o;const l=i[s];if(l===void 0||typeof l!="number")a=o;else{const u=r.find(h=>l<=h.maxValue&&l>=h.minValue);u?a=u.symbol:a=o}if(e&&e.length>0){const u=Lu(i,e);for(let h in u)a[h]!==void 0&&u[h]!==null&&(a[h]=u[h])}return a}function qD(i,t){function e(u,h,c,d){const g=y=>y*Math.PI/180,p=y=>y*180/Math.PI,E=g(u),b=g(c),P=g(d-h),v=Math.sin(P)*Math.cos(b),_=Math.cos(E)*Math.sin(b)-Math.sin(E)*Math.cos(b)*Math.cos(P),m=Math.atan2(v,_);return(p(m)+360)%360}function n(u,h,c,d,g){const E=C=>C*Math.PI/180,b=C=>C*180/Math.PI,P=d/6371e3,v=E(g),_=E(u),m=E(h),y=Math.asin(Math.sin(_)*Math.cos(P)+Math.cos(_)*Math.sin(P)*Math.cos(v)),S=m+Math.atan2(Math.sin(v)*Math.sin(P)*Math.cos(_),Math.cos(P)-Math.sin(_)*Math.sin(y));return{lat:b(y),lng:b(S),alt:c}}function r(u){const h=[];u.length>1&&h.push(e(u[0].lat,u[0].lng,u[1].lat,u[1].lng));for(let c=1;c<u.length-1;c++){const d=e(u[c-1].lat,u[c-1].lng,u[c].lat,u[c].lng),g=e(u[c].lat,u[c].lng,u[c+1].lat,u[c+1].lng);let p=(d+g)/2;Math.abs(d-g)>180&&(p=(p+180)%360),h.push(p)}return u.length>1&&h.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&&h.push(0),h}if(!i||i.length<2)throw new Error("至少需要两个点才能生成路径");if(t<=0)throw new Error("宽度必须大于0");const s=t/2,o=r(i),a=[],l=[];for(let u=0;u<i.length;u++){const h=(o[u]+90)%360,c=(o[u]+270)%360,d=i[u].alt!==void 0?i[u].alt:0;a.push(n(i[u].lat,i[u].lng,d,s,h)),l.push(n(i[u].lat,i[u].lng,d,s,c))}return a.concat(l.reverse())}function WD(i,t,e,n){function r(E){return E*(Math.PI/180)}const s=6378137,o=r(i),a=r(t),l=r(e),u=r(n),h=l-o,c=u-a,d=Math.sin(h/2)**2+Math.cos(o)*Math.cos(l)*Math.sin(c/2)**2,g=2*Math.atan2(Math.sqrt(d),Math.sqrt(1-d));return s*g}const qE=(i,t,e)=>Array.isArray(t)?t.map(s=>i[s]??"").join(e):i[t]??"";function WE(i,t){const n={...t.symbol};return{points:i.map(r=>r.points),symbol:n}}function HE(i,t){const e=t,{uniqueValueInfos:n,field:r,fieldDelimiter:s,defaultSymbol:o}=e,a=[],l=n.reduce((h,c)=>{const d=c.value.toString();return h[d]={points:[],value:c.value,symbol:c.symbol},h},{});for(let h=0;h<i.length;h++){const c=i[h],d=qE(c,r,s);if(d!==void 0&&d!==""){const g=l[d.toString()];g?g.points.push(c.points):a.push(c.points)}else a.push(c.points)}const u=[];for(let h in l){const{points:c,symbol:d}=l[h];c.length>0&&u.push({points:c,symbol:d})}return a.length>0&&u.push({points:a,symbol:o}),u}function XE(i,t){const e=t,{classBreakInfos:n,field:r,defaultSymbol:s}=e,o=[],a=n.map(u=>({...u,points:[]}));for(let u=0;u<i.length;u++){const h=i[u],c=h[r];if(c===void 0||typeof c!="number")o.push(h.points);else{const d=a.findIndex(g=>c<=g.maxValue&&c>=g.minValue);d!==-1?a[d].points.push(h.points):o.push(h.points)}}const l=[];return a.forEach(u=>{u.points.length>0&&l.push({points:u.points,symbol:u.symbol})}),o.length>0&&l.push({points:o,symbol:s}),l}function HD(i,t,e=[]){const r={...t.symbol},s=i.map(o=>{const a=Lu(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 XD(i,t,e=[]){const n=t,{uniqueValueInfos:r,field:s,fieldDelimiter:o}=n,a=n.defaultSymbol,l=[],u=r.reduce((c,d)=>{const g=d.value.toString();return c[g]={locations:[],value:d.value,symbol:d.symbol},c},{});for(let c=0;c<i.length;c++){const d=i[c],g=qE(d,s,o);if(g){const p=u[g.toString()];if(p){const E=Lu(d,e);p.locations.push({position:d.points,rotation:E.rotation||a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else l.push({position:d.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else l.push({position:d.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}const h=[];for(let c in u){const{locations:d,symbol:g}=u[c];d.length>0&&h.push({url:g.url,locations:d})}return l.length>0&&h.push({url:a.url,locations:l}),h}function $D(i,t,e=[]){const n=t,{classBreakInfos:r,field:s}=n,o=n.defaultSymbol,a=[],l=r.map(h=>({...h,locations:[]}));for(let h=0;h<i.length;h++){const c=i[h],d=c[s];if(d===void 0||typeof d!="number")a.push({position:c.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]});else{const g=l.findIndex(p=>d<=p.maxValue&&d>=p.minValue);if(g!==-1){const p=Lu(c,e);l[g].locations.push({position:c.points,rotation:p.rotation||o.rotation||[0,0,0],scale:l[g].symbol.scale||[1,1,1]})}else a.push({position:c.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]})}}const u=[];return l.forEach(h=>{h.locations.length>0&&u.push({url:h.symbol.url,locations:h.locations})}),a.length>0&&u.push({url:o.url,locations:a}),u}class YD extends B{constructor(e,n,r,s){super();f(this,"labelingInfo");this.sceneObject=e;const o=n;if(s&&ms(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 l=WE(o,r);this._simplePointAllRender(l.points,l.symbol);return}if(r.symbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!");const l=WE(o,r);this._imageAllRender(l.points,l.symbol);return}if(r.symbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!");const{url:l,locations:u}=HD(o,r,a);this._modelAllRender(l,u);return}for(let l=0;l<o.length;l++){const u=Xv(o[l],r,a);this.render(o[l],u)}}else if(r.type==="unique-value"){const{visualVariables:a}=r;if(r.uniqueValueInfos.findIndex(c=>c.symbol.type!=="simple-point")===-1&&r.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),HE(o,r).forEach(({points:d,symbol:g})=>{this._simplePointAllRender(d,g)});return}if(r.uniqueValueInfos.findIndex(c=>c.symbol.type!=="ESImageLabel")===-1&&r.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),HE(o,r).forEach(({points:d,symbol:g})=>{this._imageAllRender(d,g)});return}if(r.uniqueValueInfos.findIndex(c=>c.symbol.type!=="ESGltfModel")===-1&&r.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),XD(o,r,a).forEach(({url:d,locations:g})=>{this._modelAllRender(d,g)});return}for(let c=0;c<o.length;c++){const d=$v(o[c],r,a);this.render(o[c],d)}}else if(r.type==="class-breaks"){const{visualVariables:a}=r;if(r.classBreakInfos.findIndex(c=>c.symbol.type!=="simple-point")===-1&&r.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),XE(o,r).forEach(({points:d,symbol:g})=>{this._simplePointAllRender(d,g)});return}if(r.classBreakInfos.findIndex(c=>c.symbol.type!=="ESImageLabel")===-1&&r.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),XE(o,r).forEach(({points:d,symbol:g})=>{this._imageAllRender(d,g)});return}if(r.classBreakInfos.findIndex(c=>c.symbol.type!=="ESGltfModel")===-1&&r.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),$D(o,r,a).forEach(({url:d,locations:g})=>{this._modelAllRender(d,g)});return}for(let c=0;c<o.length;c++){const d=Yv(o[c],r,a);this.render(o[c],d)}}else if(r.type==="heatmap"){const{field:a,fieldValueMax:l,fieldValueMin:u}=r;console.time();const h=o.map(c=>{const{points:d}=c;if(a&&typeof a=="string"){let g=c[a];typeof g=="number"&&(typeof l=="number"&&g>l&&(g=l),typeof u=="number"&&g<u&&(g=u),d[2]=g)}return d});this.renderHeatmap(h,r)}else console.error("PointLayer: renderer type is not supported")}renderLabel(e,n){const{points:r}=e;Hv(this.sceneObject,r,e,n)}renderHeatmap(e,n){const{is3D:r,radius:s,blur:o,gradient:a}=n,l=this.dv(new Jf);this.d(this.sceneObject.components.disposableAdd(l)),l.is3D=r,l.radius=s,l.blur=o,a&&(l.gradient={...a}),l.data=e}render(e,n){n.type==="simple-point"?this._simplePointRender(e,n):n.type==="ESImageLabel"?this._simpleImageRender(e,n):n.type==="ESGltfModel"?this._simpleModelRender(e,n):n.type==="ESTextLabel"?UE(this.sceneObject,e.points,n):n.type==="ESParticleSystemPrimitive"?this._simpleParticleRender(e,n):console.error(" PointLayer: symbol type is not supported")}_simplePointRender(e,n){const{points:r}=e,{size:s,color:o,outlineColor:a,outlineWidth:l}=n,u=this.dv(new zc);this.d(this.sceneObject.components.disposableAdd(u)),u.pointed=!0,u.pointOutlineColor=a,u.pointOutlineWidth=l,u.pointSize=s,u.pointColor=o,u.allowPicking=(n==null?void 0:n.allowPicking)??!0,u.extras={selected:!1},u.points=[r]}_simplePointAllRender(e,n){const{size:r,color:s,outlineColor:o,outlineWidth:a}=n,l=this.dv(new zc);this.d(this.sceneObject.components.disposableAdd(l)),l.pointed=!0,l.pointOutlineColor=o,l.pointOutlineWidth=a,l.pointSize=r,l.pointColor=s,l.allowPicking=(n==null?void 0:n.allowPicking)??!0,l.points=[...e]}_simpleImageRender(e,n){const{points:r}=e,{rotation:s,offset:o,size:a,url:l,screenRender:u,anchor:h,renderMode:c,rotationType:d}=n,g=this.dv(new Vf),p=this.dv(new Ou);this.d(this.sceneObject.components.disposableAdd(g)),this.d(this.sceneObject.components.disposableAdd(p)),g.url=l,g.renderMode=c??0,s&&(g.rotation=s),o&&(g.offset=o),g.size=a||[32,32],h&&(g.anchor=h),d&&(g.rotationType=d),g.screenRender=u??!0,g.allowPicking=(n==null?void 0:n.allowPicking)??!0,g.extras={selected:!1},g.position=[...r],g.sizeByContent=!1,p.allowPicking=(n==null?void 0:n.allowPicking)??!0;const E=a?Math.max(...a)+10:Math.max(...g.size)+10;p.sizeByContent=!1,p.screenRender=!0,p.size=[E,E],p.borderRadius=[E,E,E,E],p.padding=[E/2,E/2,E/2,E/2],p.borderWidth=E/10,p.offset=[0,E/10+5],p.text="",p.backgroundColor=[0,0,0,0],p.borderColor=[0,0,0,0]}_imageAllRender(e,n){const r={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:e}}]},s=this.dv(new kc);this.d(this.sceneObject.components.disposableAdd(s));const o=this.dv(new Ou);this.d(this.sceneObject.components.disposableAdd(o)),s.textDefaultText="";const{offset:a,size:l,url:u,anchor:h}=n;s.imageUrl=u,h&&(s.imageAnchor=h),a&&(s.imageOffset=a),s.imageSize=l||[32,32],s.url=r,s.allowPicking=(n==null?void 0:n.allowPicking)??!0,s.extras={selected:!1},o.allowPicking=!0;const c=l?Math.max(...l)+10:Math.max(...s.imageSize)+10;o.sizeByContent=!1,o.size=[c,c],o.borderRadius=[c,c,c,c],o.padding=[c/2,c/2,c/2,c/2],o.borderWidth=c/10,o.offset=[0,c/10+5],o.text="",o.backgroundColor=[0,0,0,0],o.borderColor=[0,0,0,0]}_simpleModelRender(e,n){const{points:r}=e,{rotation:s,scale:o,url:a}=n,l=this.dv(new Fs);this.d(this.sceneObject.components.disposableAdd(l)),l.url=a,s&&(l.rotation=s),o&&(l.scale=o),l.position=[...r]}_modelAllRender(e,n){const r=this.dv(new Fs);this.d(this.sceneObject.components.disposableAdd(r)),r.url=e,r.instances=n}_simpleParticleRender(e,n){const{points:r}=e,s=this.dv(new zf);this.d(this.sceneObject.components.disposableAdd(s)),s.position=[...r],Object.keys(n).forEach(o=>{s[o]=n[o]})}}class JD extends B{constructor(t,e,n,r){super(),this.sceneObject=t;const s=e;if(r&&ms(s,o=>{this.renderLabel(o,r)}),n)if(n.type==="simple"){const{visualVariables:o}=n;ms(s,a=>{const l=Xv(a,n,o);this.render(a,l)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;ms(s,a=>{const l=$v(a,n,o);this.render(a,l)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;ms(s,a=>{const l=Yv(a,n,o);this.render(a,l)})}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:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Fi);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...n],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:n}=t;if(n.length<3){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Wf);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...n],r.height=e.height,r.materialMode=e.materialMode}_esPipeFenceRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new qf);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...n],r.height=e.height,r.width=e.width,r.materialMode=e.materialMode}_esPathRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Au),s=this.dv(new Ru);if(this.d(this.sceneObject.components.disposableAdd(r)),this.d(this.sceneObject.components.disposableAdd(s)),r.points=[...n],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,l=e==null?void 0:e.modelSymbol;let u;switch(e==null?void 0:e.runModel){case"ESHuman":u=this.dv(new Zn);break;case"ESCar":u=this.dv(new Ff);break;case"ESGltfModel":u=this.dv(new Fs)}if(this.d(this.sceneObject.components.disposableAdd(u)),l)for(let c in l)u[c]=l[c];const h=[0];for(var o=0;o<n.length-1;o+=1){const c=n[o],d=n[o+1],g=WD(c[1],c[0],d[1],d[0]);h.push(h[o]+Math.ceil(g/a)*1e3)}r.timeStamps=h,e!=null&&e.runSpeed&&(r.currentPositionChanged.don(c=>{r.currentPosition&&(u.position=r.currentPosition,r.currentRotation&&(u.rotation=r.currentRotation))}),s.startTime=0,s.stopTime=h[h.length-1],s.playing=!0,s.loop=(e==null?void 0:e.runLoop)??!0,s.currentTimeChanged.don(c=>{r.path.currentTime=c}))}}_eslineInterpolationModelRender(t,e){const{points:n}=t;if(n.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=BD(n,r/1e3),o=this.dv(new Fs);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:n}=t;if(n.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=n.map(h=>({lng:(h==null?void 0:h[0])??0,lat:(h==null?void 0:h[1])??0,alt:(h==null?void 0:h[2])??0})),l=qD(a,s).map(h=>[(h==null?void 0:h.lng)??0,(h==null?void 0:h.lat)??0,(h==null?void 0:h.alt)??0]),u=this.dv(new nl);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=l}renderLabel(t,e){const{points:n}=t,r=zD(n);Hv(this.sceneObject,r,t,e)}}function $E(i,t){try{JSON.stringify(i[i.length-1])!==JSON.stringify(i[0])&&i.push(i[0]);const e=Fn(i.map(l=>Kt(l))),n=ue([i]);return OO(e,t,{gridType:"point",units:"meters"}).features.map(l=>l.geometry.coordinates)[0][0].filter(l=>_i(Kt(l),n))}catch(e){return console.error(e),[]}}class ZD extends B{constructor(t,e,n,r){super(),this.sceneObject=t;const s=e;if(r&&ms(s,o=>{this.renderLabel(o,r)}),n)if(n.type==="simple"){const{visualVariables:o}=n;ms(s,a=>{const l=Xv(a,n,o);this.render(a,l)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;ms(s,a=>{const l=$v(a,n,o);this.render(a,l)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;ms(s,a=>{const l=Yv(a,n,o);this.render(a,l)})}else console.error("PolyLineLayer: renderer type is not supported")}renderLabel(t,e){const{points:n}=t;console.log("PolygonLayer: renderLabel",n);const r=UD(n);Hv(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:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{color:r,outline:s,filled:o,ground:a}=e,{width:l,color:u,stroked:h}=s,c=this.dv(new Jt);this.d(this.sceneObject.components.disposableAdd(c)),c.stroked=h??!1,c.strokeColor=u??[1,1,1,1],c.strokeWidth=l??1,c.filled=o??!0,c.fillGround=a??!1,c.fillColor=r??[1,1,1,1],c.allowPicking=(e==null?void 0:e.allowPicking)??!0,c.extras={selected:!1},c.points=[...n]}_esGeoExtrudedPolygonRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,extrudedHeight:s,color:o}=e,a=this.dv(new nl);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=[...n]}_polygonInterpolateESGltfModelRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,interpolateDistance:s,url:o,rotation:a,scale:l}=e,u=$E(n,s??10),h=this.dv(new Fs);this.d(this.sceneObject.components.disposableAdd(h)),h.url=o,h.instances=u.map(c=>({position:[...c,r??0],rotation:a??[0,0,0],scale:l??[1,1,1]}))}_polygonInterpolateESImageLabelRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,interpolateDistance:s,offset:o,size:a,url:l,anchor:u}=e,c={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:[...$E(n,s??10).map(g=>[...g,r??0])]}}]},d=this.dv(new kc);this.d(this.sceneObject.components.disposableAdd(d)),d.textDefaultText="",d.imageUrl=l,u&&(d.imageAnchor=u),o&&(d.imageOffset=o),a&&(d.imageSize=a),d.url=c}}class KD extends B{constructor(e,n){super();f(this,"_initEvent",this.dv(new D));const r=this,s=async()=>{try{const a=e.featureProps;if(!a)return;const{heightMode:l,features:u,layerType:h,url:c}=a;let d=[];if(!u&&c){let g=await fetch(c).then(p=>p.json());return g=(g==null?void 0:g.features)??g,h==="polylineVector"?d=await VE(n,g,l):h==="polygonVector"?d=await BE(n,g,l):h==="pointVector"&&(d=await zE(n,g,l)),d}else h==="polylineVector"?d=await VE(n,u,l):h==="polygonVector"?d=await BE(n,u,l):h==="pointVector"&&(d=await zE(n,u,l));return d}catch(a){console.error(a);return}},o=this.dv(Ve(this._initEvent,e.featurePropsChanged));r.dv(new qe(o,()=>{if(!e.featureProps)return;const a=e.featureProps;let l;return(async()=>{const{layerType:h,renderer:c,labelingInfo:d}=a,g=await s();!g||g.length===0||(h==="pointVector"?l=new YD(e,g,c,d):h==="polylineVector"?l=new JD(e,g,c,d):h==="polygonVector"&&(l=new ZD(e,g,c,d)),console.log("polygonVectorLayer","createLayer",l))})().catch(console.error),{destroy:()=>{var h;(h=l==null?void 0:l.destroy)==null||h.call(l),l=void 0}}}));{const a=(l,u=1)=>{const h=$1(l);if(!h)return;const{center:c,radius:d}=h;n.flyTo({distance:d*4,heading:0,pitch:-90,flyDuration:u??1,hDelta:0,pDelta:0},c)};r.d(e.flyToEvent.don(async l=>{const{featureProps:u}=e;if(!u)return;const h=await s();if(!h)return;let c=[];u.layerType==="polylineVector"?c=h.map(d=>d.points).flat():u.layerType==="polygonVector"?c=h.map(d=>d.points).flat():u.layerType==="pointVector"&&(c=h.map(d=>d.points)),c.length!==0&&a(c,l)}))}}init(){this._initEvent.emit()}}const vh=class vh extends Xt{constructor(e){super(e);f(this,"featureLayerMap",new Map);const n=this;n.d(n.viewerAttached.don(r=>{if(console.log("ESFeatureLayer","viewerAttached",r.id),n.featureLayerMap.has(r.id))return;const s=new KD(n,r);s.init(),n.featureLayerMap.set(r.id,s)})),n.d(n.viewerDetached.don(r=>{var s;console.log("ESFeatureLayer","viewerDetached",r.id),n.featureLayerMap.has(r.id)&&((s=n.featureLayerMap.get(r.id))==null||s.destroy(),n.featureLayerMap.delete(r.id))})),n.d(()=>{for(const r of n.featureLayerMap.values())r.destroy();n.featureLayerMap.clear()}),n.d(Ze(n.showChanged,()=>{for(const r of n.components.values())Reflect.has(r,"show")&&(r.show=n.show)},{immediate:!0}))}};f(vh,"createDefaultProps",()=>({...Xt.createDefaultProps(),featureProps:fe(void 0)})),f(vh,"type",vh.register("ESFeatureLayer",vh,{chsName:"矢量图层",tags:["ESObjects"],description:"ESFeatureLayer"}));let Jv=vh;const QD=[["256",256],["512",512],["1024",1024]],t4=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],Rn=class Rn extends Xt{constructor(e){super(e);f(this,"_pickFeaturesEvent",this.dv(new D));this.ad(lt([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(lt([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new pt([this,"accessToken"],"令牌",Rn.defaults.accessToken),new rr([this,"rectangle"],"矩形范围",Rn.defaults.rectangle),new wt([this,"url"],"服务地址",Rn.defaults.url),new wt([this,"style"],"样式配置",Rn.defaults.style),new O([this,"zIndex"],"层级序号",Rn.defaults.zIndex),new ht([this,"tileSize"],QD,"瓦片大小",256),new Qe([this,"maximumLevel"],1,[1,24],"最大层级",Rn.defaults.maximumLevel),new Qe([this,"minimumLevel"],1,[0,24],"最小层级",Rn.defaults.minimumLevel),new ht([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像切片规则",Rn.defaults.scheme),new ht([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考"),new pt([this,"targetID"],"targetID")],more:[...e.more,new _t("通用"),new ht([this,"splitDirection"],t4,"splitDirection","NONE"),new _t("czm"),new O([this,"czmAlpha"],"透明度"),new O([this,"czmBrightness"],"亮度"),new O([this,"czmContrast"],"对比度"),new O([this,"czmHue"],"色相"),new O([this,"czmSaturation"],"饱和度"),new O([this,"czmGamma"],"伽马值")]}}};f(Rn,"createDefaultProps",()=>({...Xt.createDefaultProps(),rectangle:fe([-180,-90,180,90]),url:bt(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:oe([]),scheme:z("xyz"),czmSplitDirection:"NONE",heightReference:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",targetID:"",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),f(Rn,"type",Rn.register("ESMVTLayer",Rn,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"用于加载矢量瓦片图层。"}));let Zv=Rn;const Zs=class Zs extends dt{constructor(t){super(t)}getESProperties(){return{...{...super.getESProperties()},basic:[new O([this,"radius"],"半径",Zs.defaults.radius),new O([this,"height"],"高度",Zs.defaults.height),new Rt([this,"color"],"颜色",Zs.defaults.color),new wt([this,"materialParams"],"材质参数",Zs.defaults.materialParams)]}}};f(Zs,"createDefaultProps",()=>({...dt.createDefaultProps(),radius:2,height:10,color:ot([.204,.596,.859,1]),materialParams:bt({ringSpeed:1,ringColor:[1,1,1,1],ringWidth:.03,sides:10,ringRatio:1,ringRepeat:1,ringBottomMove:!1})})),f(Zs,"type",Zs.register("ESCylinder",Zs,{chsName:"圆柱",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"圆柱体"}));let rl=Zs;const gs=class gs extends Lc{constructor(t){super(t)}getESProperties(){const t=super.getESProperties();return{...t,dataSource:[...t.dataSource,new ht([this,"videoStreamType"],gs.videoStreamTypes,"数据源类型",gs.defaults.videoStreamType),new W([this,"looping"],"循环播放",gs.defaults.looping),new W([this,"play"],"播放状态",gs.defaults.play)]}}};f(gs,"createDefaultProps",()=>({...Lc.createDefaultProps(),videoStreamType:"video",looping:!0,play:!0})),f(gs,"type",gs.register("ESMediaLayer",gs,{chsName:"媒体图层",tags:["ESObjects","_ES_Impl_Cesium"],description:"用于添加数据源为图片或者视频的图层"})),f(gs,"videoStreamTypes",[["video","video"],["hls","hls"],["flv","flv"],["img","img"]]);let Kv=gs;const Ks=class Ks extends Xt{constructor(e){super(e);f(this,"_getRepairPolygonEvent",this.disposeVar(new D));f(this,"_getIndicesEvent",this.disposeVar(new D));f(this,"_startEvent",this.disposeVar(new D))}getESProperties(){return{...{...super.getESProperties()},defaultMenu:"general",basic:[new wt([this,"urls"],"URL",Ks.defaults.urls),new ht([this,"mode"],Ks.modes,"模式",Ks.defaults.mode),new vt("开始编辑",()=>this.start(),[])]}}get getRepairPolygonEvent(){return this._getRepairPolygonEvent}getRepairPolygon(){return new Promise((e,n)=>{const r=new B;r.ad(this._getRepairPolygonEvent.don(o=>{o!="get"&&e(o)})),this.getRepairPolygonEvent.emit("get");const s=setTimeout(()=>{r.isDestroyed()||(r.destroy(),e(void 0))},2e3);r.ad(()=>clearTimeout(s))})}get getIndicesEvent(){return this._getIndicesEvent}getIndices(){return new Promise((e,n)=>{const r=new B;r.ad(this._getIndicesEvent.don(o=>{o!="get"&&e(o)})),this.getIndicesEvent.emit("get");const s=setTimeout(()=>{r.isDestroyed()||(r.destroy(),e(void 0))},2e3);r.ad(()=>clearTimeout(s))})}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}};f(Ks,"createDefaultProps",()=>({...Xt.createDefaultProps(),urls:oe([]),mode:"repair",allowPicking:!0})),f(Ks,"type",Ks.register("ESGltfModelEditing",Ks,{chsName:"GLTF模型编辑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载GLTF模型的 ES 对象"})),f(Ks,"modes",[["删除","delete"],["修复","repair"]]);let Qv=Ks;const Sa=class Sa extends Zn{constructor(e){super(e);f(this,"humans",[]);f(this,"humansOffset",new Map);this.ad(this.clear.bind(this)),this.updateHumans();const n=this.ad(Ve(this.instancesCountChanged,this.radiusChanged));this.ad(n.don(this.updateHumans.bind(this)))}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new O([this,"instancesCount"],"实例数量",1,Sa.defaults.instancesCount),new O([this,"radius"],"半径",1,Sa.defaults.radius)]}}updateHumans(){for(this.clear();this.humans.length+1<this.instancesCount;){const e=new Zn;this.humansOffset.set(e.id,[Math.random()*this.radius,Math.random()*this.radius,0]),this.humans.push(e),this.components.add(e),e.d(F([e,"show"],[this,"show"])),e.d(F([e,"allowPicking"],[this,"allowPicking"])),e.d(F([e,"scale"],[this,"scale"])),e.d(F([e,"collision"],[this,"collision"])),e.d(lt([e,"flyInParam"],[this,"flyInParam"])),e.d(lt([e,"flyToParam"],[this,"flyToParam"])),e.d(F([e,"animation"],[this,"animation"])),e.d(F([e,"mode"],[this,"mode"])),e.d(F([e,"minVisibleDistance"],[this,"minVisibleDistance"])),e.d(F([e,"maxVisibleDistance"],[this,"maxVisibleDistance"])),e.d(Ze([this.positionChanged],()=>{const n=bm(this.position,this.humansOffset.get(e.id)??[0,0,0]);n&&(e.position=n)},{immediate:!0})),e.d(lt([e,"rotation"],[this,"rotation"])),e.d(this.flyInEvent.don(n=>{e.flyIn(n)})),e.d(this.flyToEvent.don(n=>{e.flyTo(n)})),e.d(this.calcFlyToParamEvent.don(()=>{e.calcFlyToParam()})),e.d(this.calcFlyInParamEvent.don(()=>{e.calcFlyInParam()})),e.d(this.smoothMoveEvent.don((n,r)=>{e.smoothMove(n,r)})),e.d(this.smoothMoveWithRotationEvent.don((n,r,s)=>{e.smoothMoveWithRotation(n,r,s)})),e.d(this.smoothMoveOnGroundEvent.don((n,r,s,o)=>{e.smoothMoveOnGround(n,r,s,o)})),e.d(this.smoothMoveWithRotationOnGroundEvent.don((n,r,s,o,a)=>{e.smoothMoveWithRotationOnGround(n,r,s,o,a)})),e.d(this.automaticLandingEvent.don(()=>{e.automaticLanding()})),e.d(e.readyEvent.don(n=>{this.readyEvent.emit(n)}))}}clear(){this.humans.forEach(e=>{this.components.delete(e)}),this.humans=[],this.humansOffset.clear()}};f(Sa,"createDefaultProps",()=>({...Zn.createDefaultProps(),instancesCount:1,radius:1})),f(Sa,"type",Sa.register("ESHumans",Sa,{chsName:"人员(批量)",tags:["ESObjects"],description:"批量创建ESHumans对象"}));let t0=Sa;const Tl=class Tl extends Fi{constructor(e){super(e);f(this,"_line",this.ad(new Fi));f(this,"_arrowPolygon",this.ad(new Jt));this.ad(this.components.disposableAdd(this.line,!0)),this.line.show=!1,this.ad(this.components.disposableAdd(this.arrowPolygon));const{line:n,arrowPolygon:r}=this;this.ad(lt([n,"points"],[this,"points"])),this.ad(Ze([this.pointsChanged,this.modeChanged],()=>{this.updateArrowPolygon()},{immediate:!0})),this.ad(F([r,"show"],[this,"show"])),this.ad(F([r,"collision"],[this,"collision"])),this.ad(F([r,"allowPicking"],[this,"allowPicking"])),this.ad(F([r,"filled"],[this,"filled"])),this.ad(F([r,"fillGround"],[this,"fillGround"])),this.ad(F([r,"fillColor"],[this,"fillColor"])),this.ad(F([r,"fillMaterial"],[this,"fillMaterial"])),this.ad(F([r,"fillMaterialParams"],[this,"fillMaterialParams"])),this.ad(F([r,"stroked"],[this,"stroked"])),this.ad(F([r,"strokeGround"],[this,"strokeGround"])),this.ad(F([r,"strokeColor"],[this,"strokeColor"])),this.ad(F([r,"strokeMaterial"],[this,"strokeMaterial"])),this.ad(F([r,"strokeMaterialParams"],[this,"strokeMaterialParams"])),this.ad(F([r,"strokeWidth"],[this,"strokeWidth"])),this.ad(F([r,"strokeWidthType"],[this,"strokeWidthType"])),this.ad(F([r,"classificationType"],[this,"classificationType"]))}get line(){return this._line}get arrowPolygon(){return this._arrowPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,style:[...e.style,new ht([this,"mode"],ep,"箭头模式",Tl.defaults.mode)]}}updateArrowPolygon(){const e=this.points;if(!e||e.length<3){this._arrowPolygon.points=[];return}let n=Tm(e,this.mode,!0);n&&n.length>=3?this._arrowPolygon.points=[...n,n[0]]:this._arrowPolygon.points=[]}};f(Tl,"createDefaultProps",()=>({...Fi.createDefaultProps(),mode:"straightArrow",stroked:!1,filled:!0,fillStyle:bt({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),f(Tl,"type",Tl.register("ESAttackArrow",Tl,{chsName:"进攻箭头",tags:["ESObjects","_ES_Impl_Cesium"],description:"进攻箭头,军事标绘箭头类,支持直箭头和燕尾箭头"}));let e0=Tl;const Nl=class Nl extends Fs{constructor(e){super(e);f(this,"esCylinder",this.dv(new rl));const n=this.esCylinder;n.color=[1,1,1,0],this.ad(this.components.disposableAdd(this.esCylinder)),this.ad(F([n,"show"],[this,"show"])),this.ad(F([n,"collision"],[this,"collision"])),this.ad(F([n,"allowPicking"],[this,"allowPicking"])),this.ad(F([n,"position"],[this,"position"])),this.ad(F([n,"radius"],[this,"esCylinderRadius"])),this.ad(F([n,"height"],[this,"esCylinderHeight"])),this.ad(F([n,"materialParams"],[this,"esCylinderMaterialParams"])),this.ad(Ze(this.esCylinderRotationChanged,()=>{const r=this.esCylinderRotation;n.rotation=[r[0],r[1]-180,r[2]]},{immediate:!0}))}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new Ah([this,"esCylinderRotation"],"波动方向",Nl.defaults.esCylinderRotation),new O([this,"esCylinderRadius"],"半径",rl.defaults.esCylinderRadius),new O([this,"esCylinderHeight"],"高度",rl.defaults.esCylinderHeight),new wt([this,"esCylinderMaterialParams"],"材质参数",rl.defaults.esCylinderMaterialParams)]}}};f(Nl,"createDefaultProps",()=>({...Fs.createDefaultProps(),url:"${earthsdk3-assets-script-dir}/assets/glb/CesiumDrone.glb",esCylinderRotation:ot([0,0,0]),esCylinderRadius:2,esCylinderHeight:10,esCylinderMaterialParams:bt({ringSpeed:1,ringColor:[1,1,0,1],ringWidth:.03,sides:10,ringRatio:1,ringRepeat:10,ringBottomMove:!0})})),f(Nl,"type",Nl.register("ESSignalInterference",Nl,{chsName:"信号干扰",tags:["ESObjects"],description:"信号干扰"}));let i0=Nl;const To=class To extends B{constructor(){super();f(this,"_loading",!1);f(this,"_loadedEvent",this.disposeVar(new D));f(this,"_loaded",!1);f(this,"_loadedPromiseResolve");f(this,"_loadedPromise",new Promise(e=>{this._loadedPromiseResolve=e}));f(this,"_processing");this._processing=this.disposeVar(Ln(async e=>{if(this._loading=!0,window.Hls)console.info("可能系统已经加载hlsjs,此处不再加载!");else{const n=mt.context.getStrFromEnv(To.path);await e.promise(Mg(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 To._instance=To._instance||new To,To._instance}};f(To,"path","${xr-utils-script-dir}/xr-static/xr-utils/hlsjs/1.4.12/hls.min.js"),f(To,"_instance");let Zf=To,e4=class extends B{constructor(e,n){super();f(this,"_element");this._complexImage=e,this._videoSrc=n;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 i4 extends B{constructor(e,n){super();f(this,"_videoDom");f(this,"_processing");this._complexImage=e,this._videoSrc=n,this._videoDom=this.disposeVar(new e4(this._complexImage,"")),this._processing=this.disposeVar(Ln(async r=>{const{videoSrc:s}=this,o=Zf.instance();await r.promise(o.loadedPromise);const a=window.Hls,l=new a,u=this.element;await Ia(r,()=>new Promise((h,c)=>{u.xbsjHLS=l,l.attachMedia(u),l.on(a.Events.MEDIA_ATTACHED,()=>{l.loadSource(s),l.on(a.Events.MANIFEST_PARSED,(d,g)=>{u.play(),h()})}),l.on(a.Events.ERROR,(d,g)=>{const{type:p,details:E,fatal:b}=g;b&&(l.destroy(),c(E))})}))})),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 YE extends B{constructor(e,n){super();f(this,"_videoDom");f(this,"_update");this._complexImage=e,this._imageUri=n,this._videoDom=this.disposeVar(new i4(this._complexImage,this._imageUri)),this._update=this.disposeVar(zl(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:n,videoHeight:r}=this.videoElement;e.size=[n,r],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}const No=class No extends B{constructor(){super();f(this,"_loading",!1);f(this,"_loadedEvent",this.disposeVar(new D));f(this,"_loaded",!1);f(this,"_loadedPromiseResolve");f(this,"_loadedPromise",new Promise(e=>{this._loadedPromiseResolve=e}));f(this,"_processing");this._processing=this.disposeVar(Ln(async e=>{if(this._loading=!0,window.flvjs)console.info("可能系统已经加载flvjs,此处不再加载!");else{const n=mt.context.getStrFromEnv(No.path);await e.promise(Mg(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 No._instance=No._instance||new No,No._instance}};f(No,"path","${xr-utils-script-dir}/xr-static/xr-utils/flvjs/1.6.2/flv.min.js"),f(No,"_instance");let Kf=No;class n4 extends B{constructor(e,n){super();f(this,"_element");this._complexImage=e,this._videoSrc=n;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 r4 extends B{constructor(e,n){super();f(this,"_videoDom");f(this,"_processing");this._complexImage=e,this._videoSrc=n,this._videoDom=this.disposeVar(new n4(this._complexImage,"")),this._processing=this.disposeVar(Ln(async r=>{const{videoSrc:s}=this,o=Kf.instance();await r.promise(o.loadedPromise);const a=window.flvjs,l=this.element;await Ia(r,()=>new Promise((u,h)=>{if(!a.isSupported()){h("flvjs不支持!");return}var c=a.createPlayer({type:"flv",url:s});c.attachMediaElement(l),c.load(),c.play(),l.xbsjFlvPlayer=c}))})),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 JE extends B{constructor(e,n){super();f(this,"_videoDom");f(this,"_update");this._complexImage=e,this._imageUri=n,this._videoDom=this.disposeVar(new r4(e,this._imageUri)),this._update=this.disposeVar(zl(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:n,videoHeight:r}=this.videoElement;e.size=[n,r],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}function ZE(i){const t=i.substring(i.lastIndexOf(".")+1);return Bc.suffixTypes[t]}class Bc extends B{constructor(){super();f(this,"_enabled",this.disposeVar(z(!1)));f(this,"_uri",this.disposeVar(z("")));f(this,"_type",this.disposeVar(z(void 0)));f(this,"_size",this.disposeVar(oe(void 0)));f(this,"_pixelFormat",this.disposeVar(z("RGBA")));f(this,"_flipY",this.disposeVar(z(!0)));f(this,"_crossOriginReact",this.disposeVar(z("")));f(this,"_autoplayReact",this.disposeVar(z(!0)));f(this,"_loopReact",this.disposeVar(z(!0)));f(this,"_copyTextureEvent",this.disposeVar(new D));f(this,"_imageProcessingResettingEvent",this.disposeVar(Ve(this.enabledChanged,this.uriChanged,this.typeChanged)));f(this,"_imageProcessingResetting",this.disposeVar(new qe(this._imageProcessingResettingEvent,()=>{if(!this.enabled||!this.uri)return;let{type:e}=this;if(e||(e=ZE(this.uri)),!!e){if(e==="img")return new uy(this,this.uri);if(e==="video")return new dy(this,this.uri);if(e==="gif")return new Sy(this,this.uri);if(e==="hls")return new YE(this,this.uri);if(e==="flv")return new JE(this,this.uri)}})));f(this,"_createNativeTextureEvent",this.disposeVar(Ve(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(Bc,"types",cy),f(Bc,"czmPixelFormats",hy),f(Bc,"suffixTypes",{png:"img",jpg:"img",svg:"img",webp:"img",gif:"gif",mp4:"video",mov:"video",webm:"video",flv:"flv",m3u8:"hls"});const s4=[0,0,0,0];class o4{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 D),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 n=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,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(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 n=0;n<e-1;++n)if(t>=this._value[n].ratio&&t<=this._value[n+1].ratio)return n;throw console.error("shoud not be here!"),new Error("shoud not be here!")}getRatioColor(t,e){t=vd(t,this.minRatio,this.maxRatio);const n=this._getRatioIndex(t),r=this._value[n],s=this._value[n+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,n=1/e;for(let r=0;r<e;++r){const s=s4;this.getRatioColor((r+.5)*n,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 a4 extends B{constructor(){super(...arguments);f(this,"registerEngines",{})}register(e,n,r){const s=this.registerEngines[e]||new Map;return s.has(n)&&console.warn(`register warn:${e}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,r),this.registerEngines[e]=s,n}getEngineObjConstructor(e,n){const r=this.registerEngines[n];if(!r)return;let s=e.constructor,o=e.typeName,a=r.get(o);if(a)return a;if(e.components.main)return;const l=o;for(;o!=="ESSceneObject"&&(s=s.getParentClass(),!!s);)if(o=s.type,a=r.get(o),a)return console.warn(`未找到${l}在${n}中对应的实现类! 使用父类${o}的实现类!`),a}createEngineObject(e,n){const r=this.getEngineObjConstructor(e,n.typeName);if(r){const s=new r(e,n);return s.createdEvent.emit(),s}else{const s=new sl(e,n);return s.createdEvent.emit(),s}}}class l4 extends B{constructor(){super(...arguments);f(this,"registerEngines",{})}register(e,n,r){const s=this.registerEngines[e]||new Map;s.has(n)&&console.warn(`register warn:${e}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,r),this.registerEngines[e]=s}getEngineObjConstructor(e,n){const s=(this.registerEngines[n]||new Map).get(e);if(s)return s;console.warn(`未找到${e}在${n}中对应的实现类!`)}createEngineObject(e,n){const r=this.getEngineObjConstructor(e.typeName,n.typeName);if(r){const s=new r(e,n);return s.createdEvent.emit(),s}else{const s=new sl(e,n);return s.createdEvent.emit(),s}}}const Lr=class Lr extends B{constructor(e,n,r=!1){super();f(this,"_createdEvent",this.dv(new D));f(this,"_id",++Lr._accumId);this._sceneObject=e,this._viewer=n;{if(r)return;const s=(o,a)=>{for(let l of o)this._viewer.delete(l);for(let l of a)l.parentID=this.sceneObject.id,this._viewer.add(l)};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 a4),f(Lr,"contextEditing",new l4),f(Lr,"register",Lr.context.register.bind(Lr.context)),f(Lr,"registerEditing",Lr.contextEditing.register.bind(Lr.contextEditing)),f(Lr,"_accumId",-1);let sl=Lr;var Zt;(function(i){i.assertEqual=r=>{};function t(r){}i.assertIs=t;function e(r){throw new Error}i.assertNever=e,i.arrayToEnum=r=>{const s={};for(const o of r)s[o]=o;return s},i.getValidEnumValues=r=>{const s=i.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),o={};for(const a of s)o[a]=r[a];return i.objectValues(o)},i.objectValues=r=>i.objectKeys(r).map(function(s){return r[s]}),i.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&s.push(o);return s},i.find=(r,s)=>{for(const o of r)if(s(o))return o},i.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function n(r,s=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}i.joinValues=n,i.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(Zt||(Zt={}));var n0;(function(i){i.mergeShapes=(t,e)=>({...t,...e})})(n0||(n0={}));const ut=Zt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Eo=i=>{switch(typeof i){case"undefined":return ut.undefined;case"string":return ut.string;case"number":return Number.isNaN(i)?ut.nan:ut.number;case"boolean":return ut.boolean;case"function":return ut.function;case"bigint":return ut.bigint;case"symbol":return ut.symbol;case"object":return Array.isArray(i)?ut.array:i===null?ut.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?ut.promise:typeof Map<"u"&&i instanceof Map?ut.map:typeof Set<"u"&&i instanceof Set?ut.set:typeof Date<"u"&&i instanceof Date?ut.date:ut.object;default:return ut.unknown}},Y=Zt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),u4=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:");class Kn extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=t}format(t){const e=t||function(s){return s.message},n={_errors:[]},r=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)n._errors.push(e(o));else{let a=n,l=0;for(;l<o.path.length;){const u=o.path[l];l===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(e(o))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return r(this),n}static assert(t){if(!(t instanceof Kn))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Zt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=e=>e.message){const e={},n=[];for(const r of this.issues)if(r.path.length>0){const s=r.path[0];e[s]=e[s]||[],e[s].push(t(r))}else n.push(t(r));return{formErrors:n,fieldErrors:e}}get formErrors(){return this.flatten()}}Kn.create=i=>new Kn(i);const Fu=(i,t)=>{let e;switch(i.code){case Y.invalid_type:i.received===ut.undefined?e="Required":e=`Expected ${i.expected}, received ${i.received}`;break;case Y.invalid_literal:e=`Invalid literal value, expected ${JSON.stringify(i.expected,Zt.jsonStringifyReplacer)}`;break;case Y.unrecognized_keys:e=`Unrecognized key(s) in object: ${Zt.joinValues(i.keys,", ")}`;break;case Y.invalid_union:e="Invalid input";break;case Y.invalid_union_discriminator:e=`Invalid discriminator value. Expected ${Zt.joinValues(i.options)}`;break;case Y.invalid_enum_value:e=`Invalid enum value. Expected ${Zt.joinValues(i.options)}, received '${i.received}'`;break;case Y.invalid_arguments:e="Invalid function arguments";break;case Y.invalid_return_type:e="Invalid function return type";break;case Y.invalid_date:e="Invalid date";break;case Y.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(e=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(e=`${e} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?e=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?e=`Invalid input: must end with "${i.validation.endsWith}"`:Zt.assertNever(i.validation):i.validation!=="regex"?e=`Invalid ${i.validation}`:e="Invalid";break;case Y.too_small:i.type==="array"?e=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?e=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?e=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="bigint"?e=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?e=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:e="Invalid input";break;case Y.too_big:i.type==="array"?e=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?e=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?e=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?e=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?e=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:e="Invalid input";break;case Y.custom:e="Invalid input";break;case Y.invalid_intersection_types:e="Intersection results could not be merged";break;case Y.not_multiple_of:e=`Number must be a multiple of ${i.multipleOf}`;break;case Y.not_finite:e="Number must be finite";break;default:e=t.defaultError,Zt.assertNever(i)}return{message:e}};let KE=Fu;function h4(i){KE=i}function Qf(){return KE}const tg=i=>{const{data:t,path:e,errorMaps:n,issueData:r}=i,s=[...e,...r.path||[]],o={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let a="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:t,defaultError:a}).message;return{...r,path:s,message:a}},c4=[];function st(i,t){const e=Qf(),n=tg({issueData:t,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,e,e===Fu?void 0:Fu].filter(r=>!!r)});i.common.issues.push(n)}class Yi{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,e){const n=[];for(const r of e){if(r.status==="aborted")return Tt;r.status==="dirty"&&t.dirty(),n.push(r.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,e){const n=[];for(const r of e){const s=await r.key,o=await r.value;n.push({key:s,value:o})}return Yi.mergeObjectSync(t,n)}static mergeObjectSync(t,e){const n={};for(const r of e){const{key:s,value:o}=r;if(s.status==="aborted"||o.status==="aborted")return Tt;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(n[s.value]=o.value)}return{status:t.value,value:n}}}const Tt=Object.freeze({status:"aborted"}),ku=i=>({status:"dirty",value:i}),pn=i=>({status:"valid",value:i}),r0=i=>i.status==="aborted",s0=i=>i.status==="dirty",ol=i=>i.status==="valid",Uc=i=>typeof Promise<"u"&&i instanceof Promise;var yt;(function(i){i.errToObj=t=>typeof t=="string"?{message:t}:t||{},i.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(yt||(yt={}));class ks{constructor(t,e,n,r){this._cachedPath=[],this.parent=t,this.data=e,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const QE=(i,t)=>{if(ol(t))return{success:!0,data:t.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const e=new Kn(i.common.issues);return this._error=e,this._error}}};function Ft(i){if(!i)return{};const{errorMap:t,invalid_type_error:e,required_error:n,description:r}=i;if(t&&(e||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(o,a)=>{const{message:l}=i;return o.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??n??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:l??e??a.defaultError}},description:r}}class jt{get description(){return this._def.description}_getType(t){return Eo(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:Eo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Yi,ctx:{common:t.parent.common,data:t.data,parsedType:Eo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const e=this._parse(t);if(Uc(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(t){const e=this._parse(t);return Promise.resolve(e)}parse(t,e){const n=this.safeParse(t,e);if(n.success)return n.data;throw n.error}safeParse(t,e){const n={common:{issues:[],async:(e==null?void 0:e.async)??!1,contextualErrorMap:e==null?void 0:e.errorMap},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Eo(t)},r=this._parseSync({data:t,path:n.path,parent:n});return QE(n,r)}"~validate"(t){var n,r;const e={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Eo(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:e});return ol(s)?{value:s.value}:{issues:e.common.issues}}catch(s){(r=(n=s==null?void 0:s.message)==null?void 0:n.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),e.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:e}).then(s=>ol(s)?{value:s.value}:{issues:e.common.issues})}async parseAsync(t,e){const n=await this.safeParseAsync(t,e);if(n.success)return n.data;throw n.error}async safeParseAsync(t,e){const n={common:{issues:[],contextualErrorMap:e==null?void 0:e.errorMap,async:!0},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Eo(t)},r=this._parse({data:t,path:n.path,parent:n}),s=await(Uc(r)?r:Promise.resolve(r));return QE(n,s)}refine(t,e){const n=r=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(r):e;return this._refinement((r,s)=>{const o=t(r),a=()=>s.addIssue({code:Y.custom,...n(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,e){return this._refinement((n,r)=>t(n)?!0:(r.addIssue(typeof e=="function"?e(n,r):e),!1))}_refinement(t){return new is({schema:this,typeName:Z.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return js.create(this,this._def)}nullable(){return ca.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return es.create(this)}promise(){return zu.create(this,this._def)}or(t){return Xc.create([this,t],this._def)}and(t){return $c.create(this,t,this._def)}transform(t){return new is({...Ft(this._def),schema:this,typeName:Z.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const e=typeof t=="function"?t:()=>t;return new Qc({...Ft(this._def),innerType:this,defaultValue:e,typeName:Z.ZodDefault})}brand(){return new l0({typeName:Z.ZodBranded,type:this,...Ft(this._def)})}catch(t){const e=typeof t=="function"?t:()=>t;return new td({...Ft(this._def),innerType:this,catchValue:e,typeName:Z.ZodCatch})}describe(t){const e=this.constructor;return new e({...this._def,description:t})}pipe(t){return ed.create(this,t)}readonly(){return id.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const d4=/^c[^\s-]{8,}$/i,f4=/^[0-9a-z]+$/,g4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,p4=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,m4=/^[a-z0-9_-]{21}$/i,v4=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,y4=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_4=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,w4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let o0;const E4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,S4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,b4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,C4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,P4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,x4=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,tS="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",I4=new RegExp(`^${tS}$`);function eS(i){let t="[0-5]\\d";i.precision?t=`${t}\\.\\d{${i.precision}}`:i.precision==null&&(t=`${t}(\\.\\d+)?`);const e=i.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e}`}function M4(i){return new RegExp(`^${eS(i)}$`)}function iS(i){let t=`${tS}T${eS(i)}`;const e=[];return e.push(i.local?"Z?":"Z"),i.offset&&e.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${e.join("|")})`,new RegExp(`^${t}$`)}function T4(i,t){return!!((t==="v4"||!t)&&E4.test(i)||(t==="v6"||!t)&&b4.test(i))}function N4(i,t){if(!v4.test(i))return!1;try{const[e]=i.split(".");if(!e)return!1;const n=e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(4-e.length%4)%4,"="),r=JSON.parse(atob(n));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function O4(i,t){return!!((t==="v4"||!t)&&S4.test(i)||(t==="v6"||!t)&&C4.test(i))}class ts extends jt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ut.string){const s=this._getOrReturnCtx(t);return st(s,{code:Y.invalid_type,expected:ut.string,received:s.parsedType}),Tt}const n=new Yi;let r;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(r=this._getOrReturnCtx(t,r),st(r,{code:Y.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(r=this._getOrReturnCtx(t,r),st(r,{code:Y.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,a=t.data.length<s.value;(o||a)&&(r=this._getOrReturnCtx(t,r),o?st(r,{code:Y.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&st(r,{code:Y.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")_4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"email",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")o0||(o0=new RegExp(w4,"u")),o0.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"emoji",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")p4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"uuid",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")m4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"nanoid",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")d4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"cuid",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")f4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"cuid2",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")g4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"ulid",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),st(r,{validation:"url",code:Y.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"regex",code:Y.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?iS(s).test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?I4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?M4(s).test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?y4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"duration",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?T4(t.data,s.version)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"ip",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?N4(t.data,s.alg)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"jwt",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?O4(t.data,s.version)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"cidr",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?P4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"base64",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?x4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"base64url",code:Y.invalid_string,message:s.message}),n.dirty()):Zt.assertNever(s);return{status:n.value,value:t.data}}_regex(t,e,n){return this.refinement(r=>t.test(r),{validation:e,code:Y.invalid_string,...yt.errToObj(n)})}_addCheck(t){return new ts({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...yt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...yt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...yt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...yt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...yt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...yt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...yt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...yt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...yt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...yt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...yt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...yt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...yt.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...yt.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...yt.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...yt.errToObj(t)})}regex(t,e){return this._addCheck({kind:"regex",regex:t,...yt.errToObj(e)})}includes(t,e){return this._addCheck({kind:"includes",value:t,position:e==null?void 0:e.position,...yt.errToObj(e==null?void 0:e.message)})}startsWith(t,e){return this._addCheck({kind:"startsWith",value:t,...yt.errToObj(e)})}endsWith(t,e){return this._addCheck({kind:"endsWith",value:t,...yt.errToObj(e)})}min(t,e){return this._addCheck({kind:"min",value:t,...yt.errToObj(e)})}max(t,e){return this._addCheck({kind:"max",value:t,...yt.errToObj(e)})}length(t,e){return this._addCheck({kind:"length",value:t,...yt.errToObj(e)})}nonempty(t){return this.min(1,yt.errToObj(t))}trim(){return new ts({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ts({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ts({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxLength(){let t=null;for(const e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}}ts.create=i=>new ts({checks:[],typeName:Z.ZodString,coerce:(i==null?void 0:i.coerce)??!1,...Ft(i)});function D4(i,t){const e=(i.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,r=e>n?e:n,s=Number.parseInt(i.toFixed(r).replace(".","")),o=Number.parseInt(t.toFixed(r).replace(".",""));return s%o/10**r}class la extends jt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ut.number){const s=this._getOrReturnCtx(t);return st(s,{code:Y.invalid_type,expected:ut.number,received:s.parsedType}),Tt}let n;const r=new Yi;for(const s of this._def.checks)s.kind==="int"?Zt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),st(n,{code:Y.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?D4(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),st(n,{code:Y.not_finite,message:s.message}),r.dirty()):Zt.assertNever(s);return{status:r.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,yt.toString(e))}gt(t,e){return this.setLimit("min",t,!1,yt.toString(e))}lte(t,e){return this.setLimit("max",t,!0,yt.toString(e))}lt(t,e){return this.setLimit("max",t,!1,yt.toString(e))}setLimit(t,e,n,r){return new la({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:n,message:yt.toString(r)}]})}_addCheck(t){return new la({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:yt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:yt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:yt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:yt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:yt.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:yt.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:yt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:yt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:yt.toString(t)})}get minValue(){let t=null;for(const e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(const e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Zt.isInteger(t.value))}get isFinite(){let t=null,e=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(e===null||n.value>e)&&(e=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(e)&&Number.isFinite(t)}}la.create=i=>new la({checks:[],typeName:Z.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...Ft(i)});class ua extends jt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ut.bigint)return this._getInvalidInput(t);let n;const r=new Yi;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):Zt.assertNever(s);return{status:r.value,value:t.data}}_getInvalidInput(t){const e=this._getOrReturnCtx(t);return st(e,{code:Y.invalid_type,expected:ut.bigint,received:e.parsedType}),Tt}gte(t,e){return this.setLimit("min",t,!0,yt.toString(e))}gt(t,e){return this.setLimit("min",t,!1,yt.toString(e))}lte(t,e){return this.setLimit("max",t,!0,yt.toString(e))}lt(t,e){return this.setLimit("max",t,!1,yt.toString(e))}setLimit(t,e,n,r){return new ua({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:n,message:yt.toString(r)}]})}_addCheck(t){return new ua({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:yt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:yt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:yt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:yt.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:yt.toString(e)})}get minValue(){let t=null;for(const e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(const e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}}ua.create=i=>new ua({checks:[],typeName:Z.ZodBigInt,coerce:(i==null?void 0:i.coerce)??!1,...Ft(i)});class qc extends jt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ut.boolean){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.boolean,received:n.parsedType}),Tt}return pn(t.data)}}qc.create=i=>new qc({typeName:Z.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...Ft(i)});class al extends jt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ut.date){const s=this._getOrReturnCtx(t);return st(s,{code:Y.invalid_type,expected:ut.date,received:s.parsedType}),Tt}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return st(s,{code:Y.invalid_date}),Tt}const n=new Yi;let r;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(r=this._getOrReturnCtx(t,r),st(r,{code:Y.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(r=this._getOrReturnCtx(t,r),st(r,{code:Y.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Zt.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new al({...this._def,checks:[...this._def.checks,t]})}min(t,e){return this._addCheck({kind:"min",value:t.getTime(),message:yt.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:yt.toString(e)})}get minDate(){let t=null;for(const e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t!=null?new Date(t):null}}al.create=i=>new al({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:Z.ZodDate,...Ft(i)});class eg extends jt{_parse(t){if(this._getType(t)!==ut.symbol){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.symbol,received:n.parsedType}),Tt}return pn(t.data)}}eg.create=i=>new eg({typeName:Z.ZodSymbol,...Ft(i)});class Wc extends jt{_parse(t){if(this._getType(t)!==ut.undefined){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.undefined,received:n.parsedType}),Tt}return pn(t.data)}}Wc.create=i=>new Wc({typeName:Z.ZodUndefined,...Ft(i)});class Hc extends jt{_parse(t){if(this._getType(t)!==ut.null){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.null,received:n.parsedType}),Tt}return pn(t.data)}}Hc.create=i=>new Hc({typeName:Z.ZodNull,...Ft(i)});class Gu extends jt{constructor(){super(...arguments),this._any=!0}_parse(t){return pn(t.data)}}Gu.create=i=>new Gu({typeName:Z.ZodAny,...Ft(i)});class ll extends jt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return pn(t.data)}}ll.create=i=>new ll({typeName:Z.ZodUnknown,...Ft(i)});class So extends jt{_parse(t){const e=this._getOrReturnCtx(t);return st(e,{code:Y.invalid_type,expected:ut.never,received:e.parsedType}),Tt}}So.create=i=>new So({typeName:Z.ZodNever,...Ft(i)});class ig extends jt{_parse(t){if(this._getType(t)!==ut.undefined){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.void,received:n.parsedType}),Tt}return pn(t.data)}}ig.create=i=>new ig({typeName:Z.ZodVoid,...Ft(i)});class es extends jt{_parse(t){const{ctx:e,status:n}=this._processInputParams(t),r=this._def;if(e.parsedType!==ut.array)return st(e,{code:Y.invalid_type,expected:ut.array,received:e.parsedType}),Tt;if(r.exactLength!==null){const o=e.data.length>r.exactLength.value,a=e.data.length<r.exactLength.value;(o||a)&&(st(e,{code:o?Y.too_big:Y.too_small,minimum:a?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&e.data.length<r.minLength.value&&(st(e,{code:Y.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&e.data.length>r.maxLength.value&&(st(e,{code:Y.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),e.common.async)return Promise.all([...e.data].map((o,a)=>r.type._parseAsync(new ks(e,o,e.path,a)))).then(o=>Yi.mergeArray(n,o));const s=[...e.data].map((o,a)=>r.type._parseSync(new ks(e,o,e.path,a)));return Yi.mergeArray(n,s)}get element(){return this._def.type}min(t,e){return new es({...this._def,minLength:{value:t,message:yt.toString(e)}})}max(t,e){return new es({...this._def,maxLength:{value:t,message:yt.toString(e)}})}length(t,e){return new es({...this._def,exactLength:{value:t,message:yt.toString(e)}})}nonempty(t){return this.min(1,t)}}es.create=(i,t)=>new es({type:i,minLength:null,maxLength:null,exactLength:null,typeName:Z.ZodArray,...Ft(t)});function ju(i){if(i instanceof ke){const t={};for(const e in i.shape){const n=i.shape[e];t[e]=js.create(ju(n))}return new ke({...i._def,shape:()=>t})}else return i instanceof es?new es({...i._def,type:ju(i.element)}):i instanceof js?js.create(ju(i.unwrap())):i instanceof ca?ca.create(ju(i.unwrap())):i instanceof Gs?Gs.create(i.items.map(t=>ju(t))):i}class ke extends jt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),e=Zt.objectKeys(t);return this._cached={shape:t,keys:e},this._cached}_parse(t){if(this._getType(t)!==ut.object){const u=this._getOrReturnCtx(t);return st(u,{code:Y.invalid_type,expected:ut.object,received:u.parsedType}),Tt}const{status:n,ctx:r}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof So&&this._def.unknownKeys==="strip"))for(const u in r.data)o.includes(u)||a.push(u);const l=[];for(const u of o){const h=s[u],c=r.data[u];l.push({key:{status:"valid",value:u},value:h._parse(new ks(r,c,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof So){const u=this._def.unknownKeys;if(u==="passthrough")for(const h of a)l.push({key:{status:"valid",value:h},value:{status:"valid",value:r.data[h]}});else if(u==="strict")a.length>0&&(st(r,{code:Y.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const h of a){const c=r.data[h];l.push({key:{status:"valid",value:h},value:u._parse(new ks(r,c,r.path,h)),alwaysSet:h in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const u=[];for(const h of l){const c=await h.key,d=await h.value;u.push({key:c,value:d,alwaysSet:h.alwaysSet})}return u}).then(u=>Yi.mergeObjectSync(n,u)):Yi.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return yt.errToObj,new ke({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(e,n)=>{var s,o;const r=((o=(s=this._def).errorMap)==null?void 0:o.call(s,e,n).message)??n.defaultError;return e.code==="unrecognized_keys"?{message:yt.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new ke({...this._def,unknownKeys:"strip"})}passthrough(){return new ke({...this._def,unknownKeys:"passthrough"})}extend(t){return new ke({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ke({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Z.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new ke({...this._def,catchall:t})}pick(t){const e={};for(const n of Zt.objectKeys(t))t[n]&&this.shape[n]&&(e[n]=this.shape[n]);return new ke({...this._def,shape:()=>e})}omit(t){const e={};for(const n of Zt.objectKeys(this.shape))t[n]||(e[n]=this.shape[n]);return new ke({...this._def,shape:()=>e})}deepPartial(){return ju(this)}partial(t){const e={};for(const n of Zt.objectKeys(this.shape)){const r=this.shape[n];t&&!t[n]?e[n]=r:e[n]=r.optional()}return new ke({...this._def,shape:()=>e})}required(t){const e={};for(const n of Zt.objectKeys(this.shape))if(t&&!t[n])e[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof js;)s=s._def.innerType;e[n]=s}return new ke({...this._def,shape:()=>e})}keyof(){return nS(Zt.objectKeys(this.shape))}}ke.create=(i,t)=>new ke({shape:()=>i,unknownKeys:"strip",catchall:So.create(),typeName:Z.ZodObject,...Ft(t)}),ke.strictCreate=(i,t)=>new ke({shape:()=>i,unknownKeys:"strict",catchall:So.create(),typeName:Z.ZodObject,...Ft(t)}),ke.lazycreate=(i,t)=>new ke({shape:i,unknownKeys:"strip",catchall:So.create(),typeName:Z.ZodObject,...Ft(t)});class Xc extends jt{_parse(t){const{ctx:e}=this._processInputParams(t),n=this._def.options;function r(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return e.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Kn(a.ctx.common.issues));return st(e,{code:Y.invalid_union,unionErrors:o}),Tt}if(e.common.async)return Promise.all(n.map(async s=>{const o={...e,common:{...e.common,issues:[]},parent:null};return{result:await s._parseAsync({data:e.data,path:e.path,parent:o}),ctx:o}})).then(r);{let s;const o=[];for(const l of n){const u={...e,common:{...e.common,issues:[]},parent:null},h=l._parseSync({data:e.data,path:e.path,parent:u});if(h.status==="valid")return h;h.status==="dirty"&&!s&&(s={result:h,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return e.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new Kn(l));return st(e,{code:Y.invalid_union,unionErrors:a}),Tt}}get options(){return this._def.options}}Xc.create=(i,t)=>new Xc({options:i,typeName:Z.ZodUnion,...Ft(t)});const bo=i=>i instanceof Jc?bo(i.schema):i instanceof is?bo(i.innerType()):i instanceof Zc?[i.value]:i instanceof ha?i.options:i instanceof Kc?Zt.objectValues(i.enum):i instanceof Qc?bo(i._def.innerType):i instanceof Wc?[void 0]:i instanceof Hc?[null]:i instanceof js?[void 0,...bo(i.unwrap())]:i instanceof ca?[null,...bo(i.unwrap())]:i instanceof l0||i instanceof id?bo(i.unwrap()):i instanceof td?bo(i._def.innerType):[];class ng extends jt{_parse(t){const{ctx:e}=this._processInputParams(t);if(e.parsedType!==ut.object)return st(e,{code:Y.invalid_type,expected:ut.object,received:e.parsedType}),Tt;const n=this.discriminator,r=e.data[n],s=this.optionsMap.get(r);return s?e.common.async?s._parseAsync({data:e.data,path:e.path,parent:e}):s._parseSync({data:e.data,path:e.path,parent:e}):(st(e,{code:Y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Tt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,n){const r=new Map;for(const s of e){const o=bo(s.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(r.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);r.set(a,s)}}return new ng({typeName:Z.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:r,...Ft(n)})}}function a0(i,t){const e=Eo(i),n=Eo(t);if(i===t)return{valid:!0,data:i};if(e===ut.object&&n===ut.object){const r=Zt.objectKeys(t),s=Zt.objectKeys(i).filter(a=>r.indexOf(a)!==-1),o={...i,...t};for(const a of s){const l=a0(i[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(e===ut.array&&n===ut.array){if(i.length!==t.length)return{valid:!1};const r=[];for(let s=0;s<i.length;s++){const o=i[s],a=t[s],l=a0(o,a);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return e===ut.date&&n===ut.date&&+i==+t?{valid:!0,data:i}:{valid:!1}}class $c extends jt{_parse(t){const{status:e,ctx:n}=this._processInputParams(t),r=(s,o)=>{if(r0(s)||r0(o))return Tt;const a=a0(s.value,o.value);return a.valid?((s0(s)||s0(o))&&e.dirty(),{status:e.value,value:a.data}):(st(n,{code:Y.invalid_intersection_types}),Tt)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>r(s,o)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}$c.create=(i,t,e)=>new $c({left:i,right:t,typeName:Z.ZodIntersection,...Ft(e)});class Gs extends jt{_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.array)return st(n,{code:Y.invalid_type,expected:ut.array,received:n.parsedType}),Tt;if(n.data.length<this._def.items.length)return st(n,{code:Y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Tt;!this._def.rest&&n.data.length>this._def.items.length&&(st(n,{code:Y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty());const s=[...n.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new ks(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>Yi.mergeArray(e,o)):Yi.mergeArray(e,s)}get items(){return this._def.items}rest(t){return new Gs({...this._def,rest:t})}}Gs.create=(i,t)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gs({items:i,typeName:Z.ZodTuple,rest:null,...Ft(t)})};class Yc extends jt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.object)return st(n,{code:Y.invalid_type,expected:ut.object,received:n.parsedType}),Tt;const r=[],s=this._def.keyType,o=this._def.valueType;for(const a in n.data)r.push({key:s._parse(new ks(n,a,n.path,a)),value:o._parse(new ks(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Yi.mergeObjectAsync(e,r):Yi.mergeObjectSync(e,r)}get element(){return this._def.valueType}static create(t,e,n){return e instanceof jt?new Yc({keyType:t,valueType:e,typeName:Z.ZodRecord,...Ft(n)}):new Yc({keyType:ts.create(),valueType:t,typeName:Z.ZodRecord,...Ft(e)})}}class rg extends jt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.map)return st(n,{code:Y.invalid_type,expected:ut.map,received:n.parsedType}),Tt;const r=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,l],u)=>({key:r._parse(new ks(n,a,n.path,[u,"key"])),value:s._parse(new ks(n,l,n.path,[u,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,h=await l.value;if(u.status==="aborted"||h.status==="aborted")return Tt;(u.status==="dirty"||h.status==="dirty")&&e.dirty(),a.set(u.value,h.value)}return{status:e.value,value:a}})}else{const a=new Map;for(const l of o){const u=l.key,h=l.value;if(u.status==="aborted"||h.status==="aborted")return Tt;(u.status==="dirty"||h.status==="dirty")&&e.dirty(),a.set(u.value,h.value)}return{status:e.value,value:a}}}}rg.create=(i,t,e)=>new rg({valueType:t,keyType:i,typeName:Z.ZodMap,...Ft(e)});class ul extends jt{_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.set)return st(n,{code:Y.invalid_type,expected:ut.set,received:n.parsedType}),Tt;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(st(n,{code:Y.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),e.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(st(n,{code:Y.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),e.dirty());const s=this._def.valueType;function o(l){const u=new Set;for(const h of l){if(h.status==="aborted")return Tt;h.status==="dirty"&&e.dirty(),u.add(h.value)}return{status:e.value,value:u}}const a=[...n.data.values()].map((l,u)=>s._parse(new ks(n,l,n.path,u)));return n.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,e){return new ul({...this._def,minSize:{value:t,message:yt.toString(e)}})}max(t,e){return new ul({...this._def,maxSize:{value:t,message:yt.toString(e)}})}size(t,e){return this.min(t,e).max(t,e)}nonempty(t){return this.min(1,t)}}ul.create=(i,t)=>new ul({valueType:i,minSize:null,maxSize:null,typeName:Z.ZodSet,...Ft(t)});class Vu extends jt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:e}=this._processInputParams(t);if(e.parsedType!==ut.function)return st(e,{code:Y.invalid_type,expected:ut.function,received:e.parsedType}),Tt;function n(a,l){return tg({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Qf(),Fu].filter(u=>!!u),issueData:{code:Y.invalid_arguments,argumentsError:l}})}function r(a,l){return tg({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Qf(),Fu].filter(u=>!!u),issueData:{code:Y.invalid_return_type,returnTypeError:l}})}const s={errorMap:e.common.contextualErrorMap},o=e.data;if(this._def.returns instanceof zu){const a=this;return pn(async function(...l){const u=new Kn([]),h=await a._def.args.parseAsync(l,s).catch(g=>{throw u.addIssue(n(l,g)),u}),c=await Reflect.apply(o,this,h);return await a._def.returns._def.type.parseAsync(c,s).catch(g=>{throw u.addIssue(r(c,g)),u})})}else{const a=this;return pn(function(...l){const u=a._def.args.safeParse(l,s);if(!u.success)throw new Kn([n(l,u.error)]);const h=Reflect.apply(o,this,u.data),c=a._def.returns.safeParse(h,s);if(!c.success)throw new Kn([r(h,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Vu({...this._def,args:Gs.create(t).rest(ll.create())})}returns(t){return new Vu({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,e,n){return new Vu({args:t||Gs.create([]).rest(ll.create()),returns:e||ll.create(),typeName:Z.ZodFunction,...Ft(n)})}}class Jc extends jt{get schema(){return this._def.getter()}_parse(t){const{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}}Jc.create=(i,t)=>new Jc({getter:i,typeName:Z.ZodLazy,...Ft(t)});class Zc extends jt{_parse(t){if(t.data!==this._def.value){const e=this._getOrReturnCtx(t);return st(e,{received:e.data,code:Y.invalid_literal,expected:this._def.value}),Tt}return{status:"valid",value:t.data}}get value(){return this._def.value}}Zc.create=(i,t)=>new Zc({value:i,typeName:Z.ZodLiteral,...Ft(t)});function nS(i,t){return new ha({values:i,typeName:Z.ZodEnum,...Ft(t)})}class ha extends jt{_parse(t){if(typeof t.data!="string"){const e=this._getOrReturnCtx(t),n=this._def.values;return st(e,{expected:Zt.joinValues(n),received:e.parsedType,code:Y.invalid_type}),Tt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const e=this._getOrReturnCtx(t),n=this._def.values;return st(e,{received:e.data,code:Y.invalid_enum_value,options:n}),Tt}return pn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const e of this._def.values)t[e]=e;return t}get Values(){const t={};for(const e of this._def.values)t[e]=e;return t}get Enum(){const t={};for(const e of this._def.values)t[e]=e;return t}extract(t,e=this._def){return ha.create(t,{...this._def,...e})}exclude(t,e=this._def){return ha.create(this.options.filter(n=>!t.includes(n)),{...this._def,...e})}}ha.create=nS;class Kc extends jt{_parse(t){const e=Zt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ut.string&&n.parsedType!==ut.number){const r=Zt.objectValues(e);return st(n,{expected:Zt.joinValues(r),received:n.parsedType,code:Y.invalid_type}),Tt}if(this._cache||(this._cache=new Set(Zt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const r=Zt.objectValues(e);return st(n,{received:n.data,code:Y.invalid_enum_value,options:r}),Tt}return pn(t.data)}get enum(){return this._def.values}}Kc.create=(i,t)=>new Kc({values:i,typeName:Z.ZodNativeEnum,...Ft(t)});class zu extends jt{unwrap(){return this._def.type}_parse(t){const{ctx:e}=this._processInputParams(t);if(e.parsedType!==ut.promise&&e.common.async===!1)return st(e,{code:Y.invalid_type,expected:ut.promise,received:e.parsedType}),Tt;const n=e.parsedType===ut.promise?e.data:Promise.resolve(e.data);return pn(n.then(r=>this._def.type.parseAsync(r,{path:e.path,errorMap:e.common.contextualErrorMap})))}}zu.create=(i,t)=>new zu({type:i,typeName:Z.ZodPromise,...Ft(t)});class is extends jt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:e,ctx:n}=this._processInputParams(t),r=this._def.effect||null,s={addIssue:o=>{st(n,o),o.fatal?e.abort():e.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const o=r.transform(n.data,s);if(n.common.async)return Promise.resolve(o).then(async a=>{if(e.value==="aborted")return Tt;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?Tt:l.status==="dirty"||e.value==="dirty"?ku(l.value):l});{if(e.value==="aborted")return Tt;const a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?Tt:a.status==="dirty"||e.value==="dirty"?ku(a.value):a}}if(r.type==="refinement"){const o=a=>{const l=r.refinement(a,s);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Tt:(a.status==="dirty"&&e.dirty(),o(a.value),{status:e.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Tt:(a.status==="dirty"&&e.dirty(),o(a.value).then(()=>({status:e.value,value:a.value}))))}if(r.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ol(o))return Tt;const a=r.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>ol(o)?Promise.resolve(r.transform(o.value,s)).then(a=>({status:e.value,value:a})):Tt);Zt.assertNever(r)}}is.create=(i,t,e)=>new is({schema:i,typeName:Z.ZodEffects,effect:t,...Ft(e)}),is.createWithPreprocess=(i,t,e)=>new is({schema:t,effect:{type:"preprocess",transform:i},typeName:Z.ZodEffects,...Ft(e)});class js extends jt{_parse(t){return this._getType(t)===ut.undefined?pn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}js.create=(i,t)=>new js({innerType:i,typeName:Z.ZodOptional,...Ft(t)});class ca extends jt{_parse(t){return this._getType(t)===ut.null?pn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ca.create=(i,t)=>new ca({innerType:i,typeName:Z.ZodNullable,...Ft(t)});class Qc extends jt{_parse(t){const{ctx:e}=this._processInputParams(t);let n=e.data;return e.parsedType===ut.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:e.path,parent:e})}removeDefault(){return this._def.innerType}}Qc.create=(i,t)=>new Qc({innerType:i,typeName:Z.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ft(t)});class td extends jt{_parse(t){const{ctx:e}=this._processInputParams(t),n={...e,common:{...e.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Uc(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Kn(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Kn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}td.create=(i,t)=>new td({innerType:i,typeName:Z.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ft(t)});class sg extends jt{_parse(t){if(this._getType(t)!==ut.nan){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.nan,received:n.parsedType}),Tt}return{status:"valid",value:t.data}}}sg.create=i=>new sg({typeName:Z.ZodNaN,...Ft(i)});const R4=Symbol("zod_brand");class l0 extends jt{_parse(t){const{ctx:e}=this._processInputParams(t),n=e.data;return this._def.type._parse({data:n,path:e.path,parent:e})}unwrap(){return this._def.type}}class ed extends jt{_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Tt:s.status==="dirty"?(e.dirty(),ku(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?Tt:r.status==="dirty"?(e.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(t,e){return new ed({in:t,out:e,typeName:Z.ZodPipeline})}}class id extends jt{_parse(t){const e=this._def.innerType._parse(t),n=r=>(ol(r)&&(r.value=Object.freeze(r.value)),r);return Uc(e)?e.then(r=>n(r)):n(e)}unwrap(){return this._def.innerType}}id.create=(i,t)=>new id({innerType:i,typeName:Z.ZodReadonly,...Ft(t)});function rS(i,t){const e=typeof i=="function"?i(t):typeof i=="string"?{message:i}:i;return typeof e=="string"?{message:e}:e}function sS(i,t={},e){return i?Gu.create().superRefine((n,r)=>{const s=i(n);if(s instanceof Promise)return s.then(o=>{if(!o){const a=rS(t,n),l=a.fatal??e??!0;r.addIssue({code:"custom",...a,fatal:l})}});if(!s){const o=rS(t,n),a=o.fatal??e??!0;r.addIssue({code:"custom",...o,fatal:a})}}):Gu.create()}const A4={object:ke.lazycreate};var Z;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(Z||(Z={}));const L4=(i,t={message:`Input not instance of ${i.name}`})=>sS(e=>e instanceof i,t),oS=ts.create,aS=la.create,F4=sg.create,k4=ua.create,lS=qc.create,G4=al.create,j4=eg.create,V4=Wc.create,z4=Hc.create,B4=Gu.create,U4=ll.create,q4=So.create,W4=ig.create,H4=es.create,u0=ke.create,X4=ke.strictCreate,$4=Xc.create,Y4=ng.create,J4=$c.create,Z4=Gs.create,K4=Yc.create,Q4=rg.create,tR=ul.create,eR=Vu.create,iR=Jc.create,nR=Zc.create,rR=ha.create,sR=Kc.create,oR=zu.create,uS=is.create,aR=js.create,lR=ca.create,uR=is.createWithPreprocess,hR=ed.create,Je=Object.freeze(Object.defineProperty({__proto__:null,BRAND:R4,DIRTY:ku,EMPTY_PATH:c4,INVALID:Tt,NEVER:Tt,OK:pn,ParseStatus:Yi,Schema:jt,ZodAny:Gu,ZodArray:es,ZodBigInt:ua,ZodBoolean:qc,ZodBranded:l0,ZodCatch:td,ZodDate:al,ZodDefault:Qc,ZodDiscriminatedUnion:ng,ZodEffects:is,ZodEnum:ha,ZodError:Kn,get ZodFirstPartyTypeKind(){return Z},ZodFunction:Vu,ZodIntersection:$c,ZodIssueCode:Y,ZodLazy:Jc,ZodLiteral:Zc,ZodMap:rg,ZodNaN:sg,ZodNativeEnum:Kc,ZodNever:So,ZodNull:Hc,ZodNullable:ca,ZodNumber:la,ZodObject:ke,ZodOptional:js,ZodParsedType:ut,ZodPipeline:ed,ZodPromise:zu,ZodReadonly:id,ZodRecord:Yc,ZodSchema:jt,ZodSet:ul,ZodString:ts,ZodSymbol:eg,ZodTransformer:is,ZodTuple:Gs,ZodType:jt,ZodUndefined:Wc,ZodUnion:Xc,ZodUnknown:ll,ZodVoid:ig,addIssueToContext:st,any:B4,array:H4,bigint:k4,boolean:lS,coerce:{string:(i=>ts.create({...i,coerce:!0})),number:(i=>la.create({...i,coerce:!0})),boolean:(i=>qc.create({...i,coerce:!0})),bigint:(i=>ua.create({...i,coerce:!0})),date:(i=>al.create({...i,coerce:!0}))},custom:sS,date:G4,datetimeRegex:iS,defaultErrorMap:Fu,discriminatedUnion:Y4,effect:uS,enum:rR,function:eR,getErrorMap:Qf,getParsedType:Eo,instanceof:L4,intersection:J4,isAborted:r0,isAsync:Uc,isDirty:s0,isValid:ol,late:A4,lazy:iR,literal:nR,makeIssue:tg,map:Q4,nan:F4,nativeEnum:sR,never:q4,null:z4,nullable:lR,number:aS,object:u0,get objectUtil(){return n0},oboolean:()=>lS().optional(),onumber:()=>aS().optional(),optional:aR,ostring:()=>oS().optional(),pipeline:hR,preprocess:uR,promise:oR,quotelessJson:u4,record:K4,set:tR,setErrorMap:h4,strictObject:X4,string:oS,symbol:j4,transformer:uS,tuple:Z4,undefined:V4,union:$4,unknown:U4,get util(){return Zt},void:W4},Symbol.toStringTag,{value:"Module"})),cR=Symbol("Let zodToJsonSchema decide on which parser to use"),hS={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},dR=i=>typeof i=="string"?{...hS,name:i}:{...hS,...i},fR=i=>{const t=dR(i),e=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:e,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}};function cS(i,t,e,n){n!=null&&n.errorMessages&&e&&(i.errorMessage={...i.errorMessage,[t]:e})}function ce(i,t,e,n,r){i[t]=e,cS(i,t,n,r)}const dS=(i,t)=>{let e=0;for(;e<i.length&&e<t.length&&i[e]===t[e];e++);return[(i.length-e).toString(),...t.slice(e)].join("/")};function On(i){if(i.target!=="openAi")return{};const t=[...i.basePath,i.definitionPath,i.openAiAnyTypeName];return i.flags.hasReferencedOpenAiAnyType=!0,{$ref:i.$refStrategy==="relative"?dS(t,i.currentPath):t.join("/")}}function gR(i,t){var n,r,s;const e={type:"array"};return(n=i.type)!=null&&n._def&&((s=(r=i.type)==null?void 0:r._def)==null?void 0:s.typeName)!==Z.ZodAny&&(e.items=se(i.type._def,{...t,currentPath:[...t.currentPath,"items"]})),i.minLength&&ce(e,"minItems",i.minLength.value,i.minLength.message,t),i.maxLength&&ce(e,"maxItems",i.maxLength.value,i.maxLength.message,t),i.exactLength&&(ce(e,"minItems",i.exactLength.value,i.exactLength.message,t),ce(e,"maxItems",i.exactLength.value,i.exactLength.message,t)),e}function pR(i,t){const e={type:"integer",format:"int64"};if(!i.checks)return e;for(const n of i.checks)switch(n.kind){case"min":t.target==="jsonSchema7"?n.inclusive?ce(e,"minimum",n.value,n.message,t):ce(e,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(e.exclusiveMinimum=!0),ce(e,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?ce(e,"maximum",n.value,n.message,t):ce(e,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(e.exclusiveMaximum=!0),ce(e,"maximum",n.value,n.message,t));break;case"multipleOf":ce(e,"multipleOf",n.value,n.message,t);break}return e}function mR(){return{type:"boolean"}}function fS(i,t){return se(i.type._def,t)}const vR=(i,t)=>se(i.innerType._def,t);function gS(i,t,e){const n=e??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,s)=>gS(i,t,r))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return yR(i,t)}}const yR=(i,t)=>{const e={type:"integer",format:"unix-time"};if(t.target==="openApi3")return e;for(const n of i.checks)switch(n.kind){case"min":ce(e,"minimum",n.value,n.message,t);break;case"max":ce(e,"maximum",n.value,n.message,t);break}return e};function _R(i,t){return{...se(i.innerType._def,t),default:i.defaultValue()}}function wR(i,t){return t.effectStrategy==="input"?se(i.schema._def,t):On(t)}function ER(i){return{type:"string",enum:Array.from(i.values)}}const SR=i=>"type"in i&&i.type==="string"?!1:"allOf"in i;function bR(i,t){const e=[se(i.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),se(i.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(s=>!!s);let n=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const r=[];return e.forEach(s=>{if(SR(s))r.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:a,...l}=s;o=l}else n=void 0;r.push(o)}}),r.length?{allOf:r,...n}:void 0}function CR(i,t){const e=typeof i.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(i.value)?"array":"object"}:t.target==="openApi3"?{type:e==="bigint"?"integer":e,enum:[i.value]}:{type:e==="bigint"?"integer":e,const:i.value}}let h0;const ns={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(h0===void 0&&(h0=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),h0),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function pS(i,t){const e={type:"string"};if(i.checks)for(const n of i.checks)switch(n.kind){case"min":ce(e,"minLength",typeof e.minLength=="number"?Math.max(e.minLength,n.value):n.value,n.message,t);break;case"max":ce(e,"maxLength",typeof e.maxLength=="number"?Math.min(e.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":rs(e,"email",n.message,t);break;case"format:idn-email":rs(e,"idn-email",n.message,t);break;case"pattern:zod":mn(e,ns.email,n.message,t);break}break;case"url":rs(e,"uri",n.message,t);break;case"uuid":rs(e,"uuid",n.message,t);break;case"regex":mn(e,n.regex,n.message,t);break;case"cuid":mn(e,ns.cuid,n.message,t);break;case"cuid2":mn(e,ns.cuid2,n.message,t);break;case"startsWith":mn(e,RegExp(`^${c0(n.value,t)}`),n.message,t);break;case"endsWith":mn(e,RegExp(`${c0(n.value,t)}$`),n.message,t);break;case"datetime":rs(e,"date-time",n.message,t);break;case"date":rs(e,"date",n.message,t);break;case"time":rs(e,"time",n.message,t);break;case"duration":rs(e,"duration",n.message,t);break;case"length":ce(e,"minLength",typeof e.minLength=="number"?Math.max(e.minLength,n.value):n.value,n.message,t),ce(e,"maxLength",typeof e.maxLength=="number"?Math.min(e.maxLength,n.value):n.value,n.message,t);break;case"includes":{mn(e,RegExp(c0(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&rs(e,"ipv4",n.message,t),n.version!=="v4"&&rs(e,"ipv6",n.message,t);break}case"base64url":mn(e,ns.base64url,n.message,t);break;case"jwt":mn(e,ns.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&mn(e,ns.ipv4Cidr,n.message,t),n.version!=="v4"&&mn(e,ns.ipv6Cidr,n.message,t);break}case"emoji":mn(e,ns.emoji(),n.message,t);break;case"ulid":{mn(e,ns.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{rs(e,"binary",n.message,t);break}case"contentEncoding:base64":{ce(e,"contentEncoding","base64",n.message,t);break}case"pattern:zod":{mn(e,ns.base64,n.message,t);break}}break}case"nanoid":mn(e,ns.nanoid,n.message,t)}return e}function c0(i,t){return t.patternStrategy==="escape"?xR(i):i}const PR=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function xR(i){let t="";for(let e=0;e<i.length;e++)PR.has(i[e])||(t+="\\"),t+=i[e];return t}function rs(i,t,e,n){var r;i.format||(r=i.anyOf)!=null&&r.some(s=>s.format)?(i.anyOf||(i.anyOf=[]),i.format&&(i.anyOf.push({format:i.format,...i.errorMessage&&n.errorMessages&&{errorMessage:{format:i.errorMessage.format}}}),delete i.format,i.errorMessage&&(delete i.errorMessage.format,Object.keys(i.errorMessage).length===0&&delete i.errorMessage)),i.anyOf.push({format:t,...e&&n.errorMessages&&{errorMessage:{format:e}}})):ce(i,"format",t,e,n)}function mn(i,t,e,n){var r;i.pattern||(r=i.allOf)!=null&&r.some(s=>s.pattern)?(i.allOf||(i.allOf=[]),i.pattern&&(i.allOf.push({pattern:i.pattern,...i.errorMessage&&n.errorMessages&&{errorMessage:{pattern:i.errorMessage.pattern}}}),delete i.pattern,i.errorMessage&&(delete i.errorMessage.pattern,Object.keys(i.errorMessage).length===0&&delete i.errorMessage)),i.allOf.push({pattern:mS(t,n),...e&&n.errorMessages&&{errorMessage:{pattern:e}}})):ce(i,"pattern",mS(t,n),e,n)}function mS(i,t){var l;if(!t.applyRegexFlags||!i.flags)return i.source;const e={i:i.flags.includes("i"),m:i.flags.includes("m"),s:i.flags.includes("s")},n=e.i?i.source.toLowerCase():i.source;let r="",s=!1,o=!1,a=!1;for(let u=0;u<n.length;u++){if(s){r+=n[u],s=!1;continue}if(e.i){if(o){if(n[u].match(/[a-z]/)){a?(r+=n[u],r+=`${n[u-2]}-${n[u]}`.toUpperCase(),a=!1):n[u+1]==="-"&&((l=n[u+2])!=null&&l.match(/[a-z]/))?(r+=n[u],a=!0):r+=`${n[u]}${n[u].toUpperCase()}`;continue}}else if(n[u].match(/[a-z]/)){r+=`[${n[u]}${n[u].toUpperCase()}]`;continue}}if(e.m){if(n[u]==="^"){r+=`(^|(?<=[\r
468
+ `,kv=Date.now(),$s=class $s extends mt{constructor(e){super(e);f(this,"_flyToEvent",this.disposeVar(new D));f(this,"_resetClockEvent",this.disposeVar(new D));this.ad(lt([this,"uri"],[this,"url"]))}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 wt([this,"url"],"路径","${earthsdk3-assets-script-dir}/assets/misc/simple.czml",void 0,!0),new W([this,"clockEnabled"],"启用",!1),new O([this,"multiplier"],"倍速",$s.defaults.multiplier),new W([this,"autoResetClock"],"自动设置时钟",!0),new ys([this,"startTime"],"开始时间",$s.defaults.startTime,!0),new ys([this,"stopTime"],"结束时间",$s.defaults.stopTime,!0),new ys([this,"currentTime"],"当前时间",$s.defaults.currentTime,!0),new ht([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep","SYSTEM_CLOCK_MULTIPLIER"),new ht([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange","UNBOUNDED"),new W([this,"shouldAnimate"],"是否启用动画",!1)],general:[...e.general,new W([this,"show"],"是否显示",!0),new W([this,"collision"],"开启碰撞",!1),new W([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new vt("飞入",n=>this.flyTo(n),[1e3],"flyTo"),new vt("重置时钟",()=>this.resetClock(),[],"resetClock"),new io([this,"loadFuncStr"],"loadFnStr",FE,jD,!0)]}}};f($s,"createDefaultProps",()=>({show:!0,uri:void 0,url:void 0,allowPicking:!1,autoResetClock:!0,clockEnabled:!1,startTime:kv,stopTime:kv+864e5,currentTime:kv,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...mt.createDefaultProps()})),f($s,"type",$s.register("ESCzml",$s,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"}));let Gv=$s;const gh=class gh extends mt{getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new _t,new W([this,"show"],"是否显示"),new O([this,"cssSize"],"尺寸"),new Ke([this,"cssPosition"],"位置"),new pt([this,"imgUrl"],"图片地址")]}}};f(gh,"createDefaultProps",()=>({...mt.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:mt.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")})),f(gh,"type",gh.register("ESNavigator",gh,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"}));let jv=gh;const Ys=class Ys extends mt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new _t("通用"),new W([this,"show"],"是否显示",Ys.defaults.show),new O([this,"height"],"高度",Ys.defaults.height,!0),new O([this,"fontSize"],"文字大小",Ys.defaults.fontSize,!0),new Rt([this,"bgColor"],"背景颜色",Ys.defaults.bgColor,!0)]}}};f(Ys,"createDefaultProps",()=>({...mt.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:ot([.2784313725490196,.2784313725490196,.2784313725490196,.8])})),f(Ys,"type",Ys.register("ESViewerStatusBar",Ys,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let Vv=Ys;const Js=class Js extends mt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new _t("通用"),new W([this,"show"],"是否显示",Js.defaults.show),new O([this,"height"],"高度",Js.defaults.height,!0),new O([this,"fontSize"],"文字大小",Js.defaults.fontSize,!0),new Rt([this,"bgColor"],"背景颜色",Js.defaults.bgColor,!0)]}}};f(Js,"createDefaultProps",()=>({...mt.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:ot([.2784313725490196,.2784313725490196,.2784313725490196,.8])})),f(Js,"type",Js.register("ESViewerStatusBarScale",Js,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let zv=Js;const ph=class ph extends dt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new pt([this,"url"],"路径","",!0),new O([this,"progress"],"进度",0,!1,!0)]}}};f(ph,"createDefaultProps",()=>({...dt.createDefaultProps(),url:"",progress:0})),f(ph,"type",ph.register("ESGaussianSplatting",ph,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"}));let Bv=ph;class VD extends B{constructor(t,e){if(super(),!e)return;const n=this.ad(new Jt);n.stroked=!0,this.ad(t.components.disposableAdd(n)),this.ad(lt([n,"points"],[t,"areaLiftingPoints"])),this.ad(n.editingChanged.don(()=>{n.editing||!this.isDestroyed()&&this.destroy()})),n.editing=!0}}var kE=(i=>(i[i.None=0]="None",i[i.Up=1]="Up",i[i.Down=2]="Down",i))(kE||{}),GE=(i=>(i[i.CLICK=0]="CLICK",i[i.MOVE=1]="MOVE",i))(GE||{}),jE=(i=>(i[i.Smooth=0]="Smooth",i[i.Linear=1]="Linear",i[i.Spherical=2]="Spherical",i[i.Tip=3]="Tip",i[i.Hard=4]="Hard",i))(jE||{});const vi=class vi extends dt{constructor(e){super(e);f(this,"_startEvent",this.disposeVar(new D));f(this,"_configs",this.disposeVar(oe(void 0)));f(this,"_heights",this.disposeVar(z({})));f(this,"_heightsEvent",this.ad(new D));f(this,"_areaLiftingUpdateEvent",this.disposeVar(new D));const n=this.ad(Ve(this.modeChanged,this.startEvent));this.ad(new qe(n,()=>{var r;if(this.areaLiftingPoints=void 0,this.mode=="areaLifting")return new VD(this,this.activeViewer);(r=this.activeViewer)==null||r.startEditing(this,nt.BrushErase)}))}updateEditing(){var e;Nf(this.position,[0,0,0])||(this.position=[0,0,0]),(e=this.activeViewer)==null||e.startEditing(this,nt.Place,{callSource:"inner"})}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get configs(){return this._configs.value}set configs(e){this._configs.value=e}get configsChanged(){return this._configs.changed}getConfig(...e){var n,r;if(typeof e[0]=="number")return(n=this.configs)==null?void 0:n.find(s=>s.x===e[0]&&s.y===e[1]);if(typeof e[0]=="string")return(r=this.configs)==null?void 0:r.find(s=>s.url===e[0])}get heights(){return this._heights.value}set heights(e){this._heights.value=e}get heightsChanged(){return this._heights.changed}get heightsEvent(){return this._heightsEvent}getHeights(){return new Promise((e,n)=>{const r=new B;r.ad(this._heightsEvent.don(o=>{o!=="start"&&(!r.isDestroyed()&&r.destroy(),e(o))})),this._heightsEvent.emit("start");const s=setTimeout(()=>{r.isDestroyed()||(r.destroy(),e(void 0))},2e3);r.ad(()=>clearTimeout(s))})}get areaLiftingUpdateEvent(){return this._areaLiftingUpdateEvent}areaLiftingUpdate(){this._areaLiftingUpdateEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new vt("开始编辑",()=>{this.start()},[],"start"),new ht([this,"mode"],vi.modes,"编辑模式",vi.defaults.mode)],basic:[...e.basic,new wt([this,"url"],"URL"),new wt([this,"tileInfo"],"瓦片信息配置"),new O([this,"maxHeight"],"最大高度"),new O([this,"minHeight"],"最小高度"),new O([this,"offset"],"偏移"),new W([this,"autoLoadHeights"],"自动加载高度"),new _t("刷写设置"),new O([this,"brushEraseRadius"],"编辑半径"),new Ke([this,"brushEraseRadiusRange"],"编辑半径范围",void 0,!0,!0),new ht([this,"brushEraseMode"],Object.entries(["CTRL","SHIFT","NONE"]),"刷写模式"),new ht([this,"brushErasePickReference"],vi.brushErasePickReferences,"选择参考"),new _s([this,"brushErasePosition"],"刷写位置"),new _s([this,"brushEraseStartPosition"],"刷写起始位置"),new ht([this,"brushEraseFalloff"],vi.brushEarseFalloffs,"刷写衰减函数"),new ht([this,"brushEraseRayDirection"],[["Up","Up"],["Down","Down"]],"刷写射线方向"),new _t("平整设置"),new ht([this,"flattenMode"],vi.flattenModes,"平整模式",0),new ht([this,"flattenPick"],vi.flattenPicks,"平整选择",0),new O([this,"flattenOffset"],"平整偏移",-.01),new _t("区域升降设置"),new Ne([this,"areaLiftingPoints"],"区域升降位置",[]),new O([this,"areaLiftingOffset"],"区域升降偏移",1),new vt("区域升降更新",()=>{this.areaLiftingUpdate()},[],"areaLiftingUpdate"),new _t("围栏设置"),new Ne([this,"fencePoints"],"围栏位置",[])]}}};f(vi,"createDefaultProps",()=>({...dt.createDefaultProps(),allowPicking:!0,url:"",maxHeight:0,minHeight:0,offset:.01,tileInfo:bt({tileCountX:65,tileCountY:65,tileMaximumLevel:15,tilesPerAxis:5,format:"heights"}),mode:z("sculpt"),autoLoadHeights:!1,brushEraseRadius:100,brushEraseRadiusRange:ot([0,100]),brushErasePosition:ot([0,0,0]),brushEraseStartPosition:ot([0,0,0]),brushEraseMode:z("NONE"),brushErasePickReference:z("NONE"),brushEraseRayDirection:z("Down"),brushEraseFalloff:z(4),flattenMode:z(0),flattenPick:z(1),flattenOffset:-.01,areaLiftingPoints:Pa(void 0),areaLiftingOffset:1,fencePoints:Pa(void 0),fenceMode:z("in")})),f(vi,"modes",[["雕刻","sculpt"],["抹除","erase"],["平滑","smooth"],["平整","flatten"],["区域升降","areaLifting"]]),f(vi,"brushErasePickReferences",[["无限制","NONE"],["地形图层","ESTerrainLayerEditing"],["3DTiles","ES3DTileset"]]),f(vi,"flattenModes",[["None",0],["Up",1],["Down",2]]),f(vi,"flattenPicks",[["CLICK",0],["MOVE",1]]),f(vi,"brushEarseFalloffs",[["平滑",0],["线性",1],["硬边",4],["球形",2],["尖顶",3]]),f(vi,"invalidValue",-1e4),f(vi,"type",vi.register("ESTerrainLayerEditing",vi,{chsName:"地形图层编辑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于对地形数据进行编辑"})),f(vi,"supportEditingModes",[...dt.supportEditingModes,nt.Place,nt.BrushErase]);let Vc=vi;const nr=class nr extends Dt{constructor(e){super(e);f(this,"editingBindMode","doublePoints");f(this,"_startEvent",this.disposeVar(new D));f(this,"_replayEvent",this.disposeVar(new D));this.ad(this.startEvent.don(()=>{var n;(n=this.activeViewer)==null||n.startEditing(this,nt.BrushErase)}))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get replayEvent(){return this._replayEvent}replay(){this._replayEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new vt("开始编辑",()=>this.start(),[]),new vt("重播",()=>this.replay(),[]),new W([this,"showImage"],"显示影像",nr.defaults.showImage),new O([this,"flowSpeed"],"流动速度",nr.defaults.flowSpeed),new O([this,"gravity"],"重力加速度",nr.defaults.gravity),new O([this,"strength"],"泥石流强度",nr.defaults.strength),new O([this,"resistance"],"泥石流阻力(越大越快平息)",nr.defaults.resistance),new O([this,"terrainOffset"],"地形高度偏移",nr.defaults.terrainOffset),new Ne([this,"slidePoints"],"滑坡点数组",Dt.defaults.slidePoints,void 0),new _t("刷写设置"),new O([this,"brushEraseRadius"],"编辑半径"),new Ke([this,"brushEraseRadiusRange"],"编辑半径范围",void 0,!0,!0),new ht([this,"brushEraseMode"],Object.entries(["CTRL","SHIFT","NONE"]),"刷写模式"),new ht([this,"brushErasePickReference"],Vc.brushErasePickReferences,"选择参考"),new _s([this,"brushErasePosition"],"刷写位置"),new _s([this,"brushEraseStartPosition"],"刷写起始位置"),new ht([this,"brushEraseFalloff"],Vc.brushEarseFalloffs,"刷写衰减函数"),new ht([this,"brushEraseRayDirection"],[["Up","Up"],["Down","Down"]],"刷写射线方向")]}}};f(nr,"createDefaultProps",()=>({...Dt.createDefaultProps(),brushEraseRadius:100,brushEraseRadiusRange:ot([0,1e3]),brushErasePosition:ot([0,0,0]),brushEraseStartPosition:ot([0,0,0]),brushEraseMode:z("NONE"),brushErasePickReference:z("NONE"),brushEraseRayDirection:z("Down"),terrainOffset:5,flowSpeed:1,gravity:9.8,slidePoints:ot([]),strength:1,showImage:!0,resistance:.98,stroked:!0,strokeStyle:bt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!0})})),f(nr,"type",nr.register("ESLandSlide",nr,{chsName:"滑坡泥石流分析",tags:["ESObjects","_ES_Impl_Cesium"],description:"滑坡泥石流分析对象"})),f(nr,"supportEditingModes",[...Dt.supportEditingModes,nt.DoublePoints,nt.DoublePointsAppend,nt.DoublePointsModify,nt.BrushErase]);let Uv=nr;const Il=class Il extends dt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new pt([this,"mesh"],"mesh地址",Il.defaults.mesh)]}}};f(Il,"createDefaultProps",()=>({...dt.createDefaultProps(),mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"})),f(Il,"type",Il.register("ESStaticMesh",Il,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"}));let qv=Il;const mh=class mh extends Dt{constructor(e){super(e);f(this,"_startEvent",this.dv(new D));f(this,"_clearEvent",this.dv(new D));f(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new nl),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(F([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(F([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(F([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(F([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(F([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(F([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(F([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 vt("开始分析",()=>this.start(),[],"start"),new vt("清除分析",()=>this.clear(),[],"clear"),new Ne([this,"windowPositions"],"屏幕坐标",[],void 0,!1,!0),new Ne([this,"depths"],"深度值",[],void 0,!1,!0),new O([this,"radius"],"半径",1e4,!0)]}}};f(mh,"createDefaultProps",()=>({...Dt.createDefaultProps(),windowPositions:xm([]),depths:oe([]),radius:z(1e4)})),f(mh,"type",mh.register("ESSkylineAnalysis",mh,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"}));let Wv=mh;const Mo=class Mo extends Xt{constructor(t){super(t)}getESProperties(){const t=super.getESProperties();return{...t,basic:[...t.basic,new Ne([this,"data"],"数据",[],void 0,!0),new wt([this,"gradient"],"渐变",Mo.defaults.gradient,void 0,!0),new O([this,"radius"],"半径",Mo.defaults.radius,void 0),new O([this,"blur"],"模糊",Mo.defaults.blur,!0),new W([this,"is3D"],"is3D",!1,!0)]}}};f(Mo,"createDefaultProps",()=>({...Xt.createDefaultProps(),is3D:z(!1),data:Pa([]),gradient:fe({".5":"green",".7":"yellow",".95":"red"}),radius:z(10),blur:z(.85)})),f(Mo,"type",Mo.register("ESHeatMap",Mo,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"}));let Jf=Mo;const Ml=class Ml extends Dt{constructor(e){super(e);f(this,"editingBindMode","scatter")}};f(Ml,"createDefaultProps",()=>({...Dt.createDefaultProps(),pointed:!0})),f(Ml,"type",Ml.register("ESGeoPoints",Ml,{chsName:"地理点集合",tags:["ESObjects","_ES_Impl_Cesium"],description:"地图中的可视化地理点集合"})),f(Ml,"supportEditingModes",[...Dt.supportEditingModes,nt.ScatterAppend,nt.ScatterModify]);let zc=Ml;const VE=async(i,t=[],e)=>{const n=[];for(const r of t){const{coordinates:s}=r.geometry;for(const o of s){const a=await Promise.all(o.map(async l=>{let u=l[2]??0;if(e)if(e.type==="absolute")u=e.height??u;else if(e.type==="relative"){const h=await i.getTerrainHeight([l[0],l[1]])??0;u=(e.height??u)+h}else e.type==="terrain"&&(u=await i.getTerrainHeight([l[0],l[1]])??0);return[l[0],l[1],u]}));n.push({...r,points:a})}}return n},zE=async(i,t=[],e)=>await Promise.all(t.map(async n=>{var l,u,h,c,d,g,p,E,b;const r=((l=n.geometry)==null?void 0:l.x)??((h=(u=n.geometry)==null?void 0:u.coordinates)==null?void 0:h[0]),s=((c=n.geometry)==null?void 0:c.y)??((g=(d=n.geometry)==null?void 0:d.coordinates)==null?void 0:g[1]);let a=((p=n.geometry)==null?void 0:p.z)??((b=(E=n.geometry)==null?void 0:E.coordinates)==null?void 0:b[2])??0;if(e)if(e.type==="absolute")a=e.height??a;else if(e.type==="relative"){const P=await i.getTerrainHeight([r,s])??0;a=(e.height??a)+P}else e.type==="terrain"&&(a=await i.getTerrainHeight([r,s])??0);return{...n,points:[r,s,a]}})),BE=async(i,t=[],e)=>{const n=[];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 l=>{let u=l[2]??0;if(e)if(e.type==="absolute")u=e.height??u;else if(e.type==="relative"){const h=await i.getTerrainHeight([l[0],l[1]])??0;u=(e.height??u)+h}else e.type==="terrain"&&(u=await i.getTerrainHeight([l[0],l[1]])??0);return[l[0],l[1],u]}));n.push({...r,points:a})}))})),n};function zD(i){const t=yi(i),e=cw(t),n=jp(t,e/2);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function BD(i,t){const e=yi(i),n=cw(e),r=Math.floor(n/t),s=[];if(s.push(i[0]),r<1)return[i[0]];for(let o=1;o<r;o+=1){const a=jp(e,n*(o/r));s.push([a.geometry.coordinates[0],a.geometry.coordinates[1],a.geometry.coordinates[2]||0])}return s}function UD(i){const t=[...i];JSON.stringify(i[0])!==JSON.stringify(i[i.length-1])&&t.push(i[0]);const e=ue([t]),n=Y_(e);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function UE(i,t,e){const n=i.dv(new Ou);for(const r in e)r!=="type"&&(n[r]=e[r]);n.position=t,i.d(i.components.disposableAdd(n))}function Hv(i,t,e,n){let r=n.textTemplate||n.symbol.text||"";const s=/{{(.*?)}}/;for(;s.test(r);){const h=r.match(s);if(h){const c=h[1].trim(),d=e[`${c}`]||"-";r=r.replace(h[0],d)}}let o=n.symbol;const{minVisibleDistance:a,maxVisibleDistance:l}=n;a&&l&&(o={...o,minVisibleDistance:a,maxVisibleDistance:l});const u={...o,text:r};UE(i,t,u)}function Lu(i,t){const e={width:null,height:null,color:null,opacity:null,rotation:null};return t.forEach(n=>{n.type==="size"?n.axis==="width"?e.width=i[n.field]||null:n.axis==="height"&&(e.height=i[n.field]||null):n.type==="color"?e.color=i[n.field]||null:n.type==="opacity"?e.opacity=i[n.field]||null:n.type==="rotation"&&(e.rotation=i[n.field]||null)}),e}function Xv(i,t,e){const r={...t.symbol};if(e&&e.length>0){const s=Lu(i,e);for(let o in s)r[o]!==void 0&&s[o]!==null&&(r[o]=s[o])}return r}function $v(i,t,e){var u,h;const n=t,{uniqueValueInfos:r,field:s,fieldDelimiter:o,defaultSymbol:a}=n;let l={...a};if(Array.isArray(s)){const d=s.map(g=>i[g]??"").join(o);l=((u=r.find(g=>g.value==d))==null?void 0:u.symbol)||a}else l=((h=r.find(c=>c.value==i[s]))==null?void 0:h.symbol)||a;if(e&&e.length>0){const c=Lu(i,e);for(let d in c)l[d]!==void 0&&c[d]!==null&&(l[d]=c[d])}return l}function Yv(i,t,e){const n=t,{classBreakInfos:r,field:s,defaultSymbol:o}=n;let a=o;const l=i[s];if(l===void 0||typeof l!="number")a=o;else{const u=r.find(h=>l<=h.maxValue&&l>=h.minValue);u?a=u.symbol:a=o}if(e&&e.length>0){const u=Lu(i,e);for(let h in u)a[h]!==void 0&&u[h]!==null&&(a[h]=u[h])}return a}function qD(i,t){function e(u,h,c,d){const g=y=>y*Math.PI/180,p=y=>y*180/Math.PI,E=g(u),b=g(c),P=g(d-h),v=Math.sin(P)*Math.cos(b),_=Math.cos(E)*Math.sin(b)-Math.sin(E)*Math.cos(b)*Math.cos(P),m=Math.atan2(v,_);return(p(m)+360)%360}function n(u,h,c,d,g){const E=C=>C*Math.PI/180,b=C=>C*180/Math.PI,P=d/6371e3,v=E(g),_=E(u),m=E(h),y=Math.asin(Math.sin(_)*Math.cos(P)+Math.cos(_)*Math.sin(P)*Math.cos(v)),S=m+Math.atan2(Math.sin(v)*Math.sin(P)*Math.cos(_),Math.cos(P)-Math.sin(_)*Math.sin(y));return{lat:b(y),lng:b(S),alt:c}}function r(u){const h=[];u.length>1&&h.push(e(u[0].lat,u[0].lng,u[1].lat,u[1].lng));for(let c=1;c<u.length-1;c++){const d=e(u[c-1].lat,u[c-1].lng,u[c].lat,u[c].lng),g=e(u[c].lat,u[c].lng,u[c+1].lat,u[c+1].lng);let p=(d+g)/2;Math.abs(d-g)>180&&(p=(p+180)%360),h.push(p)}return u.length>1&&h.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&&h.push(0),h}if(!i||i.length<2)throw new Error("至少需要两个点才能生成路径");if(t<=0)throw new Error("宽度必须大于0");const s=t/2,o=r(i),a=[],l=[];for(let u=0;u<i.length;u++){const h=(o[u]+90)%360,c=(o[u]+270)%360,d=i[u].alt!==void 0?i[u].alt:0;a.push(n(i[u].lat,i[u].lng,d,s,h)),l.push(n(i[u].lat,i[u].lng,d,s,c))}return a.concat(l.reverse())}function WD(i,t,e,n){function r(E){return E*(Math.PI/180)}const s=6378137,o=r(i),a=r(t),l=r(e),u=r(n),h=l-o,c=u-a,d=Math.sin(h/2)**2+Math.cos(o)*Math.cos(l)*Math.sin(c/2)**2,g=2*Math.atan2(Math.sqrt(d),Math.sqrt(1-d));return s*g}const qE=(i,t,e)=>Array.isArray(t)?t.map(s=>i[s]??"").join(e):i[t]??"";function WE(i,t){const n={...t.symbol};return{points:i.map(r=>r.points),symbol:n}}function HE(i,t){const e=t,{uniqueValueInfos:n,field:r,fieldDelimiter:s,defaultSymbol:o}=e,a=[],l=n.reduce((h,c)=>{const d=c.value.toString();return h[d]={points:[],value:c.value,symbol:c.symbol},h},{});for(let h=0;h<i.length;h++){const c=i[h],d=qE(c,r,s);if(d!==void 0&&d!==""){const g=l[d.toString()];g?g.points.push(c.points):a.push(c.points)}else a.push(c.points)}const u=[];for(let h in l){const{points:c,symbol:d}=l[h];c.length>0&&u.push({points:c,symbol:d})}return a.length>0&&u.push({points:a,symbol:o}),u}function XE(i,t){const e=t,{classBreakInfos:n,field:r,defaultSymbol:s}=e,o=[],a=n.map(u=>({...u,points:[]}));for(let u=0;u<i.length;u++){const h=i[u],c=h[r];if(c===void 0||typeof c!="number")o.push(h.points);else{const d=a.findIndex(g=>c<=g.maxValue&&c>=g.minValue);d!==-1?a[d].points.push(h.points):o.push(h.points)}}const l=[];return a.forEach(u=>{u.points.length>0&&l.push({points:u.points,symbol:u.symbol})}),o.length>0&&l.push({points:o,symbol:s}),l}function HD(i,t,e=[]){const r={...t.symbol},s=i.map(o=>{const a=Lu(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 XD(i,t,e=[]){const n=t,{uniqueValueInfos:r,field:s,fieldDelimiter:o}=n,a=n.defaultSymbol,l=[],u=r.reduce((c,d)=>{const g=d.value.toString();return c[g]={locations:[],value:d.value,symbol:d.symbol},c},{});for(let c=0;c<i.length;c++){const d=i[c],g=qE(d,s,o);if(g){const p=u[g.toString()];if(p){const E=Lu(d,e);p.locations.push({position:d.points,rotation:E.rotation||a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else l.push({position:d.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else l.push({position:d.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}const h=[];for(let c in u){const{locations:d,symbol:g}=u[c];d.length>0&&h.push({url:g.url,locations:d})}return l.length>0&&h.push({url:a.url,locations:l}),h}function $D(i,t,e=[]){const n=t,{classBreakInfos:r,field:s}=n,o=n.defaultSymbol,a=[],l=r.map(h=>({...h,locations:[]}));for(let h=0;h<i.length;h++){const c=i[h],d=c[s];if(d===void 0||typeof d!="number")a.push({position:c.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]});else{const g=l.findIndex(p=>d<=p.maxValue&&d>=p.minValue);if(g!==-1){const p=Lu(c,e);l[g].locations.push({position:c.points,rotation:p.rotation||o.rotation||[0,0,0],scale:l[g].symbol.scale||[1,1,1]})}else a.push({position:c.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]})}}const u=[];return l.forEach(h=>{h.locations.length>0&&u.push({url:h.symbol.url,locations:h.locations})}),a.length>0&&u.push({url:o.url,locations:a}),u}class YD extends B{constructor(e,n,r,s){super();f(this,"labelingInfo");this.sceneObject=e;const o=n;if(s&&ms(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 l=WE(o,r);this._simplePointAllRender(l.points,l.symbol);return}if(r.symbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!");const l=WE(o,r);this._imageAllRender(l.points,l.symbol);return}if(r.symbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!");const{url:l,locations:u}=HD(o,r,a);this._modelAllRender(l,u);return}for(let l=0;l<o.length;l++){const u=Xv(o[l],r,a);this.render(o[l],u)}}else if(r.type==="unique-value"){const{visualVariables:a}=r;if(r.uniqueValueInfos.findIndex(c=>c.symbol.type!=="simple-point")===-1&&r.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),HE(o,r).forEach(({points:d,symbol:g})=>{this._simplePointAllRender(d,g)});return}if(r.uniqueValueInfos.findIndex(c=>c.symbol.type!=="ESImageLabel")===-1&&r.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),HE(o,r).forEach(({points:d,symbol:g})=>{this._imageAllRender(d,g)});return}if(r.uniqueValueInfos.findIndex(c=>c.symbol.type!=="ESGltfModel")===-1&&r.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),XD(o,r,a).forEach(({url:d,locations:g})=>{this._modelAllRender(d,g)});return}for(let c=0;c<o.length;c++){const d=$v(o[c],r,a);this.render(o[c],d)}}else if(r.type==="class-breaks"){const{visualVariables:a}=r;if(r.classBreakInfos.findIndex(c=>c.symbol.type!=="simple-point")===-1&&r.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),XE(o,r).forEach(({points:d,symbol:g})=>{this._simplePointAllRender(d,g)});return}if(r.classBreakInfos.findIndex(c=>c.symbol.type!=="ESImageLabel")===-1&&r.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),XE(o,r).forEach(({points:d,symbol:g})=>{this._imageAllRender(d,g)});return}if(r.classBreakInfos.findIndex(c=>c.symbol.type!=="ESGltfModel")===-1&&r.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),$D(o,r,a).forEach(({url:d,locations:g})=>{this._modelAllRender(d,g)});return}for(let c=0;c<o.length;c++){const d=Yv(o[c],r,a);this.render(o[c],d)}}else if(r.type==="heatmap"){const{field:a,fieldValueMax:l,fieldValueMin:u}=r;console.time();const h=o.map(c=>{const{points:d}=c;if(a&&typeof a=="string"){let g=c[a];typeof g=="number"&&(typeof l=="number"&&g>l&&(g=l),typeof u=="number"&&g<u&&(g=u),d[2]=g)}return d});this.renderHeatmap(h,r)}else console.error("PointLayer: renderer type is not supported")}renderLabel(e,n){const{points:r}=e;Hv(this.sceneObject,r,e,n)}renderHeatmap(e,n){const{is3D:r,radius:s,blur:o,gradient:a}=n,l=this.dv(new Jf);this.d(this.sceneObject.components.disposableAdd(l)),l.is3D=r,l.radius=s,l.blur=o,a&&(l.gradient={...a}),l.data=e}render(e,n){n.type==="simple-point"?this._simplePointRender(e,n):n.type==="ESImageLabel"?this._simpleImageRender(e,n):n.type==="ESGltfModel"?this._simpleModelRender(e,n):n.type==="ESTextLabel"?UE(this.sceneObject,e.points,n):n.type==="ESParticleSystemPrimitive"?this._simpleParticleRender(e,n):console.error(" PointLayer: symbol type is not supported")}_simplePointRender(e,n){const{points:r}=e,{size:s,color:o,outlineColor:a,outlineWidth:l}=n,u=this.dv(new zc);this.d(this.sceneObject.components.disposableAdd(u)),u.pointed=!0,u.pointOutlineColor=a,u.pointOutlineWidth=l,u.pointSize=s,u.pointColor=o,u.allowPicking=(n==null?void 0:n.allowPicking)??!0,u.extras={selected:!1},u.points=[r]}_simplePointAllRender(e,n){const{size:r,color:s,outlineColor:o,outlineWidth:a}=n,l=this.dv(new zc);this.d(this.sceneObject.components.disposableAdd(l)),l.pointed=!0,l.pointOutlineColor=o,l.pointOutlineWidth=a,l.pointSize=r,l.pointColor=s,l.allowPicking=(n==null?void 0:n.allowPicking)??!0,l.points=[...e]}_simpleImageRender(e,n){const{points:r}=e,{rotation:s,offset:o,size:a,url:l,screenRender:u,anchor:h,renderMode:c,rotationType:d}=n,g=this.dv(new Vf),p=this.dv(new Ou);this.d(this.sceneObject.components.disposableAdd(g)),this.d(this.sceneObject.components.disposableAdd(p)),g.url=l,g.renderMode=c??0,s&&(g.rotation=s),o&&(g.offset=o),g.size=a||[32,32],h&&(g.anchor=h),d&&(g.rotationType=d),g.screenRender=u??!0,g.allowPicking=(n==null?void 0:n.allowPicking)??!0,g.extras={selected:!1},g.position=[...r],g.sizeByContent=!1,p.allowPicking=(n==null?void 0:n.allowPicking)??!0;const E=a?Math.max(...a)+10:Math.max(...g.size)+10;p.sizeByContent=!1,p.screenRender=!0,p.size=[E,E],p.borderRadius=[E,E,E,E],p.padding=[E/2,E/2,E/2,E/2],p.borderWidth=E/10,p.offset=[0,E/10+5],p.text="",p.backgroundColor=[0,0,0,0],p.borderColor=[0,0,0,0]}_imageAllRender(e,n){const r={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:e}}]},s=this.dv(new kc);this.d(this.sceneObject.components.disposableAdd(s));const o=this.dv(new Ou);this.d(this.sceneObject.components.disposableAdd(o)),s.textDefaultText="";const{offset:a,size:l,url:u,anchor:h}=n;s.imageUrl=u,h&&(s.imageAnchor=h),a&&(s.imageOffset=a),s.imageSize=l||[32,32],s.url=r,s.allowPicking=(n==null?void 0:n.allowPicking)??!0,s.extras={selected:!1},o.allowPicking=!0;const c=l?Math.max(...l)+10:Math.max(...s.imageSize)+10;o.sizeByContent=!1,o.size=[c,c],o.borderRadius=[c,c,c,c],o.padding=[c/2,c/2,c/2,c/2],o.borderWidth=c/10,o.offset=[0,c/10+5],o.text="",o.backgroundColor=[0,0,0,0],o.borderColor=[0,0,0,0]}_simpleModelRender(e,n){const{points:r}=e,{rotation:s,scale:o,url:a}=n,l=this.dv(new Fs);this.d(this.sceneObject.components.disposableAdd(l)),l.url=a,s&&(l.rotation=s),o&&(l.scale=o),l.position=[...r]}_modelAllRender(e,n){const r=this.dv(new Fs);this.d(this.sceneObject.components.disposableAdd(r)),r.url=e,r.instances=n}_simpleParticleRender(e,n){const{points:r}=e,s=this.dv(new zf);this.d(this.sceneObject.components.disposableAdd(s)),s.position=[...r],Object.keys(n).forEach(o=>{s[o]=n[o]})}}class JD extends B{constructor(t,e,n,r){super(),this.sceneObject=t;const s=e;if(r&&ms(s,o=>{this.renderLabel(o,r)}),n)if(n.type==="simple"){const{visualVariables:o}=n;ms(s,a=>{const l=Xv(a,n,o);this.render(a,l)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;ms(s,a=>{const l=$v(a,n,o);this.render(a,l)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;ms(s,a=>{const l=Yv(a,n,o);this.render(a,l)})}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:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Fi);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...n],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:n}=t;if(n.length<3){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Wf);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...n],r.height=e.height,r.materialMode=e.materialMode}_esPipeFenceRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new qf);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...n],r.height=e.height,r.width=e.width,r.materialMode=e.materialMode}_esPathRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Au),s=this.dv(new Ru);if(this.d(this.sceneObject.components.disposableAdd(r)),this.d(this.sceneObject.components.disposableAdd(s)),r.points=[...n],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,l=e==null?void 0:e.modelSymbol;let u;switch(e==null?void 0:e.runModel){case"ESHuman":u=this.dv(new Zn);break;case"ESCar":u=this.dv(new Ff);break;case"ESGltfModel":u=this.dv(new Fs)}if(this.d(this.sceneObject.components.disposableAdd(u)),l)for(let c in l)u[c]=l[c];const h=[0];for(var o=0;o<n.length-1;o+=1){const c=n[o],d=n[o+1],g=WD(c[1],c[0],d[1],d[0]);h.push(h[o]+Math.ceil(g/a)*1e3)}r.timeStamps=h,e!=null&&e.runSpeed&&(r.currentPositionChanged.don(c=>{r.currentPosition&&(u.position=r.currentPosition,r.currentRotation&&(u.rotation=r.currentRotation))}),s.startTime=0,s.stopTime=h[h.length-1],s.playing=!0,s.loop=(e==null?void 0:e.runLoop)??!0,s.currentTimeChanged.don(c=>{r.path.currentTime=c}))}}_eslineInterpolationModelRender(t,e){const{points:n}=t;if(n.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=BD(n,r/1e3),o=this.dv(new Fs);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:n}=t;if(n.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=n.map(h=>({lng:(h==null?void 0:h[0])??0,lat:(h==null?void 0:h[1])??0,alt:(h==null?void 0:h[2])??0})),l=qD(a,s).map(h=>[(h==null?void 0:h.lng)??0,(h==null?void 0:h.lat)??0,(h==null?void 0:h.alt)??0]),u=this.dv(new nl);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=l}renderLabel(t,e){const{points:n}=t,r=zD(n);Hv(this.sceneObject,r,t,e)}}function $E(i,t){try{JSON.stringify(i[i.length-1])!==JSON.stringify(i[0])&&i.push(i[0]);const e=Fn(i.map(l=>Kt(l))),n=ue([i]);return OO(e,t,{gridType:"point",units:"meters"}).features.map(l=>l.geometry.coordinates)[0][0].filter(l=>_i(Kt(l),n))}catch(e){return console.error(e),[]}}class ZD extends B{constructor(t,e,n,r){super(),this.sceneObject=t;const s=e;if(r&&ms(s,o=>{this.renderLabel(o,r)}),n)if(n.type==="simple"){const{visualVariables:o}=n;ms(s,a=>{const l=Xv(a,n,o);this.render(a,l)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;ms(s,a=>{const l=$v(a,n,o);this.render(a,l)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;ms(s,a=>{const l=Yv(a,n,o);this.render(a,l)})}else console.error("PolyLineLayer: renderer type is not supported")}renderLabel(t,e){const{points:n}=t;console.log("PolygonLayer: renderLabel",n);const r=UD(n);Hv(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:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{color:r,outline:s,filled:o,ground:a}=e,{width:l,color:u,stroked:h}=s,c=this.dv(new Jt);this.d(this.sceneObject.components.disposableAdd(c)),c.stroked=h??!1,c.strokeColor=u??[1,1,1,1],c.strokeWidth=l??1,c.filled=o??!0,c.fillGround=a??!1,c.fillColor=r??[1,1,1,1],c.allowPicking=(e==null?void 0:e.allowPicking)??!0,c.extras={selected:!1},c.points=[...n]}_esGeoExtrudedPolygonRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,extrudedHeight:s,color:o}=e,a=this.dv(new nl);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=[...n]}_polygonInterpolateESGltfModelRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,interpolateDistance:s,url:o,rotation:a,scale:l}=e,u=$E(n,s??10),h=this.dv(new Fs);this.d(this.sceneObject.components.disposableAdd(h)),h.url=o,h.instances=u.map(c=>({position:[...c,r??0],rotation:a??[0,0,0],scale:l??[1,1,1]}))}_polygonInterpolateESImageLabelRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,interpolateDistance:s,offset:o,size:a,url:l,anchor:u}=e,c={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:[...$E(n,s??10).map(g=>[...g,r??0])]}}]},d=this.dv(new kc);this.d(this.sceneObject.components.disposableAdd(d)),d.textDefaultText="",d.imageUrl=l,u&&(d.imageAnchor=u),o&&(d.imageOffset=o),a&&(d.imageSize=a),d.url=c}}class KD extends B{constructor(e,n){super();f(this,"_initEvent",this.dv(new D));const r=this,s=async()=>{try{const a=e.featureProps;if(!a)return;const{heightMode:l,features:u,layerType:h,url:c}=a;let d=[];if(!u&&c){let g=await fetch(c).then(p=>p.json());return g=(g==null?void 0:g.features)??g,h==="polylineVector"?d=await VE(n,g,l):h==="polygonVector"?d=await BE(n,g,l):h==="pointVector"&&(d=await zE(n,g,l)),d}else h==="polylineVector"?d=await VE(n,u,l):h==="polygonVector"?d=await BE(n,u,l):h==="pointVector"&&(d=await zE(n,u,l));return d}catch(a){console.error(a);return}},o=this.dv(Ve(this._initEvent,e.featurePropsChanged));r.dv(new qe(o,()=>{if(!e.featureProps)return;const a=e.featureProps;let l;return(async()=>{const{layerType:h,renderer:c,labelingInfo:d}=a,g=await s();!g||g.length===0||(h==="pointVector"?l=new YD(e,g,c,d):h==="polylineVector"?l=new JD(e,g,c,d):h==="polygonVector"&&(l=new ZD(e,g,c,d)),console.log("polygonVectorLayer","createLayer",l))})().catch(console.error),{destroy:()=>{var h;(h=l==null?void 0:l.destroy)==null||h.call(l),l=void 0}}}));{const a=(l,u=1)=>{const h=$1(l);if(!h)return;const{center:c,radius:d}=h;n.flyTo({distance:d*4,heading:0,pitch:-90,flyDuration:u??1,hDelta:0,pDelta:0},c)};r.d(e.flyToEvent.don(async l=>{const{featureProps:u}=e;if(!u)return;const h=await s();if(!h)return;let c=[];u.layerType==="polylineVector"?c=h.map(d=>d.points).flat():u.layerType==="polygonVector"?c=h.map(d=>d.points).flat():u.layerType==="pointVector"&&(c=h.map(d=>d.points)),c.length!==0&&a(c,l)}))}}init(){this._initEvent.emit()}}const vh=class vh extends Xt{constructor(e){super(e);f(this,"featureLayerMap",new Map);const n=this;n.d(n.viewerAttached.don(r=>{if(console.log("ESFeatureLayer","viewerAttached",r.id),n.featureLayerMap.has(r.id))return;const s=new KD(n,r);s.init(),n.featureLayerMap.set(r.id,s)})),n.d(n.viewerDetached.don(r=>{var s;console.log("ESFeatureLayer","viewerDetached",r.id),n.featureLayerMap.has(r.id)&&((s=n.featureLayerMap.get(r.id))==null||s.destroy(),n.featureLayerMap.delete(r.id))})),n.d(()=>{for(const r of n.featureLayerMap.values())r.destroy();n.featureLayerMap.clear()}),n.d(Ze(n.showChanged,()=>{for(const r of n.components.values())Reflect.has(r,"show")&&(r.show=n.show)},{immediate:!0}))}};f(vh,"createDefaultProps",()=>({...Xt.createDefaultProps(),featureProps:fe(void 0)})),f(vh,"type",vh.register("ESFeatureLayer",vh,{chsName:"矢量图层",tags:["ESObjects"],description:"ESFeatureLayer"}));let Jv=vh;const QD=[["256",256],["512",512],["1024",1024]],t4=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],Rn=class Rn extends Xt{constructor(e){super(e);f(this,"_pickFeaturesEvent",this.dv(new D));this.ad(lt([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(lt([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new pt([this,"accessToken"],"令牌",Rn.defaults.accessToken),new rr([this,"rectangle"],"矩形范围",Rn.defaults.rectangle),new wt([this,"url"],"服务地址",Rn.defaults.url),new wt([this,"style"],"样式配置",Rn.defaults.style),new O([this,"zIndex"],"层级序号",Rn.defaults.zIndex),new ht([this,"tileSize"],QD,"瓦片大小",256),new Qe([this,"maximumLevel"],1,[1,24],"最大层级",Rn.defaults.maximumLevel),new Qe([this,"minimumLevel"],1,[0,24],"最小层级",Rn.defaults.minimumLevel),new ht([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像切片规则",Rn.defaults.scheme),new ht([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考"),new pt([this,"targetID"],"targetID")],more:[...e.more,new _t("通用"),new ht([this,"splitDirection"],t4,"splitDirection","NONE"),new _t("czm"),new O([this,"czmAlpha"],"透明度"),new O([this,"czmBrightness"],"亮度"),new O([this,"czmContrast"],"对比度"),new O([this,"czmHue"],"色相"),new O([this,"czmSaturation"],"饱和度"),new O([this,"czmGamma"],"伽马值")]}}};f(Rn,"createDefaultProps",()=>({...Xt.createDefaultProps(),rectangle:fe([-180,-90,180,90]),url:bt(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:oe([]),scheme:z("xyz"),czmSplitDirection:"NONE",heightReference:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",targetID:"",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),f(Rn,"type",Rn.register("ESMVTLayer",Rn,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"用于加载矢量瓦片图层。"}));let Zv=Rn;const Zs=class Zs extends dt{constructor(t){super(t)}getESProperties(){return{...{...super.getESProperties()},basic:[new O([this,"radius"],"半径",Zs.defaults.radius),new O([this,"height"],"高度",Zs.defaults.height),new Rt([this,"color"],"颜色",Zs.defaults.color),new wt([this,"materialParams"],"材质参数",Zs.defaults.materialParams)]}}};f(Zs,"createDefaultProps",()=>({...dt.createDefaultProps(),radius:2,height:10,color:ot([.204,.596,.859,1]),materialParams:bt({ringSpeed:1,ringColor:[1,1,1,1],ringWidth:.03,sides:10,ringRatio:1,ringRepeat:1,ringBottomMove:!1})})),f(Zs,"type",Zs.register("ESCylinder",Zs,{chsName:"圆柱",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"圆柱体"}));let rl=Zs;const gs=class gs extends Lc{constructor(t){super(t)}getESProperties(){const t=super.getESProperties();return{...t,dataSource:[...t.dataSource,new ht([this,"videoStreamType"],gs.videoStreamTypes,"数据源类型",gs.defaults.videoStreamType),new W([this,"looping"],"循环播放",gs.defaults.looping),new W([this,"play"],"播放状态",gs.defaults.play)]}}};f(gs,"createDefaultProps",()=>({...Lc.createDefaultProps(),videoStreamType:"video",looping:!0,play:!0})),f(gs,"type",gs.register("ESMediaLayer",gs,{chsName:"媒体图层",tags:["ESObjects","_ES_Impl_Cesium"],description:"用于添加数据源为图片或者视频的图层"})),f(gs,"videoStreamTypes",[["video","video"],["hls","hls"],["flv","flv"],["img","img"]]);let Kv=gs;const Ks=class Ks extends Xt{constructor(e){super(e);f(this,"_getRepairPolygonEvent",this.disposeVar(new D));f(this,"_getIndicesEvent",this.disposeVar(new D));f(this,"_startEvent",this.disposeVar(new D))}getESProperties(){return{...{...super.getESProperties()},defaultMenu:"general",basic:[new wt([this,"urls"],"URL",Ks.defaults.urls),new ht([this,"mode"],Ks.modes,"模式",Ks.defaults.mode),new vt("开始编辑",()=>this.start(),[])]}}get getRepairPolygonEvent(){return this._getRepairPolygonEvent}getRepairPolygon(){return new Promise((e,n)=>{const r=new B;r.ad(this._getRepairPolygonEvent.don(o=>{o!="get"&&e(o)})),this.getRepairPolygonEvent.emit("get");const s=setTimeout(()=>{r.isDestroyed()||(r.destroy(),e(void 0))},2e3);r.ad(()=>clearTimeout(s))})}get getIndicesEvent(){return this._getIndicesEvent}getIndices(){return new Promise((e,n)=>{const r=new B;r.ad(this._getIndicesEvent.don(o=>{o!="get"&&e(o)})),this.getIndicesEvent.emit("get");const s=setTimeout(()=>{r.isDestroyed()||(r.destroy(),e(void 0))},2e3);r.ad(()=>clearTimeout(s))})}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}};f(Ks,"createDefaultProps",()=>({...Xt.createDefaultProps(),urls:oe([]),mode:"repair",allowPicking:!0})),f(Ks,"type",Ks.register("ESGltfModelEditing",Ks,{chsName:"GLTF模型编辑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载GLTF模型的 ES 对象"})),f(Ks,"modes",[["删除","delete"],["修复","repair"]]);let Qv=Ks;const Sa=class Sa extends Zn{constructor(e){super(e);f(this,"humans",[]);f(this,"humansOffset",new Map);this.ad(this.clear.bind(this)),this.updateHumans();const n=this.ad(Ve(this.instancesCountChanged,this.radiusChanged));this.ad(n.don(this.updateHumans.bind(this)))}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new O([this,"instancesCount"],"实例数量",1,Sa.defaults.instancesCount),new O([this,"radius"],"半径",1,Sa.defaults.radius)]}}updateHumans(){for(this.clear();this.humans.length+1<this.instancesCount;){const e=new Zn;this.humansOffset.set(e.id,[Math.random()*this.radius,Math.random()*this.radius,0]),this.humans.push(e),this.components.add(e),e.d(F([e,"show"],[this,"show"])),e.d(F([e,"allowPicking"],[this,"allowPicking"])),e.d(F([e,"scale"],[this,"scale"])),e.d(F([e,"collision"],[this,"collision"])),e.d(lt([e,"flyInParam"],[this,"flyInParam"])),e.d(lt([e,"flyToParam"],[this,"flyToParam"])),e.d(F([e,"animation"],[this,"animation"])),e.d(F([e,"mode"],[this,"mode"])),e.d(F([e,"minVisibleDistance"],[this,"minVisibleDistance"])),e.d(F([e,"maxVisibleDistance"],[this,"maxVisibleDistance"])),e.d(Ze([this.positionChanged],()=>{const n=bm(this.position,this.humansOffset.get(e.id)??[0,0,0]);n&&(e.position=n)},{immediate:!0})),e.d(lt([e,"rotation"],[this,"rotation"])),e.d(this.flyInEvent.don(n=>{e.flyIn(n)})),e.d(this.flyToEvent.don(n=>{e.flyTo(n)})),e.d(this.calcFlyToParamEvent.don(()=>{e.calcFlyToParam()})),e.d(this.calcFlyInParamEvent.don(()=>{e.calcFlyInParam()})),e.d(this.smoothMoveEvent.don((n,r)=>{e.smoothMove(n,r)})),e.d(this.smoothMoveWithRotationEvent.don((n,r,s)=>{e.smoothMoveWithRotation(n,r,s)})),e.d(this.smoothMoveOnGroundEvent.don((n,r,s,o)=>{e.smoothMoveOnGround(n,r,s,o)})),e.d(this.smoothMoveWithRotationOnGroundEvent.don((n,r,s,o,a)=>{e.smoothMoveWithRotationOnGround(n,r,s,o,a)})),e.d(this.automaticLandingEvent.don(()=>{e.automaticLanding()})),e.d(e.readyEvent.don(n=>{this.readyEvent.emit(n)}))}}clear(){this.humans.forEach(e=>{this.components.delete(e)}),this.humans=[],this.humansOffset.clear()}};f(Sa,"createDefaultProps",()=>({...Zn.createDefaultProps(),instancesCount:1,radius:1})),f(Sa,"type",Sa.register("ESHumans",Sa,{chsName:"人员(批量)",tags:["ESObjects"],description:"批量创建ESHumans对象"}));let t0=Sa;const Tl=class Tl extends Fi{constructor(e){super(e);f(this,"_line",this.ad(new Fi));f(this,"_arrowPolygon",this.ad(new Jt));this.ad(this.components.disposableAdd(this.line,!0)),this.line.show=!1,this.ad(this.components.disposableAdd(this.arrowPolygon));const{line:n,arrowPolygon:r}=this;this.ad(lt([n,"points"],[this,"points"])),this.ad(Ze([this.pointsChanged,this.modeChanged],()=>{this.updateArrowPolygon()},{immediate:!0})),this.ad(F([r,"show"],[this,"show"])),this.ad(F([r,"collision"],[this,"collision"])),this.ad(F([r,"allowPicking"],[this,"allowPicking"])),this.ad(F([r,"filled"],[this,"filled"])),this.ad(F([r,"fillGround"],[this,"fillGround"])),this.ad(F([r,"fillColor"],[this,"fillColor"])),this.ad(F([r,"fillMaterial"],[this,"fillMaterial"])),this.ad(F([r,"fillMaterialParams"],[this,"fillMaterialParams"])),this.ad(F([r,"stroked"],[this,"stroked"])),this.ad(F([r,"strokeGround"],[this,"strokeGround"])),this.ad(F([r,"strokeColor"],[this,"strokeColor"])),this.ad(F([r,"strokeMaterial"],[this,"strokeMaterial"])),this.ad(F([r,"strokeMaterialParams"],[this,"strokeMaterialParams"])),this.ad(F([r,"strokeWidth"],[this,"strokeWidth"])),this.ad(F([r,"strokeWidthType"],[this,"strokeWidthType"])),this.ad(F([r,"classificationType"],[this,"classificationType"]))}get line(){return this._line}get arrowPolygon(){return this._arrowPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,style:[...e.style,new ht([this,"mode"],ep,"箭头模式",Tl.defaults.mode)]}}updateArrowPolygon(){const e=this.points;if(!e||e.length<3){this._arrowPolygon.points=[];return}let n=Tm(e,this.mode,!0);n&&n.length>=3?this._arrowPolygon.points=[...n,n[0]]:this._arrowPolygon.points=[]}};f(Tl,"createDefaultProps",()=>({...Fi.createDefaultProps(),mode:"straightArrow",stroked:!1,filled:!0,fillStyle:bt({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),f(Tl,"type",Tl.register("ESAttackArrow",Tl,{chsName:"进攻箭头",tags:["ESObjects","_ES_Impl_Cesium"],description:"进攻箭头,军事标绘箭头类,支持直箭头和燕尾箭头"}));let e0=Tl;const Nl=class Nl extends Fs{constructor(e){super(e);f(this,"esCylinder",this.dv(new rl));const n=this.esCylinder;n.color=[1,1,1,0],this.ad(this.components.disposableAdd(this.esCylinder)),this.ad(F([n,"show"],[this,"show"])),this.ad(F([n,"collision"],[this,"collision"])),this.ad(F([n,"allowPicking"],[this,"allowPicking"])),this.ad(F([n,"position"],[this,"position"])),this.ad(F([n,"radius"],[this,"esCylinderRadius"])),this.ad(F([n,"height"],[this,"esCylinderHeight"])),this.ad(F([n,"materialParams"],[this,"esCylinderMaterialParams"])),this.ad(Ze(this.esCylinderRotationChanged,()=>{const r=this.esCylinderRotation;n.rotation=[r[0],r[1]-180,r[2]]},{immediate:!0}))}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new Ah([this,"esCylinderRotation"],"波动方向",Nl.defaults.esCylinderRotation),new O([this,"esCylinderRadius"],"半径",rl.defaults.esCylinderRadius),new O([this,"esCylinderHeight"],"高度",rl.defaults.esCylinderHeight),new wt([this,"esCylinderMaterialParams"],"材质参数",rl.defaults.esCylinderMaterialParams)]}}};f(Nl,"createDefaultProps",()=>({...Fs.createDefaultProps(),url:"${earthsdk3-assets-script-dir}/assets/glb/CesiumDrone.glb",esCylinderRotation:ot([0,0,0]),esCylinderRadius:2,esCylinderHeight:10,esCylinderMaterialParams:bt({ringSpeed:1,ringColor:[1,1,0,1],ringWidth:.03,sides:10,ringRatio:1,ringRepeat:10,ringBottomMove:!0})})),f(Nl,"type",Nl.register("ESSignalInterference",Nl,{chsName:"信号干扰",tags:["ESObjects"],description:"信号干扰"}));let i0=Nl;const To=class To extends B{constructor(){super();f(this,"_loading",!1);f(this,"_loadedEvent",this.disposeVar(new D));f(this,"_loaded",!1);f(this,"_loadedPromiseResolve");f(this,"_loadedPromise",new Promise(e=>{this._loadedPromiseResolve=e}));f(this,"_processing");this._processing=this.disposeVar(Ln(async e=>{if(this._loading=!0,window.Hls)console.info("可能系统已经加载hlsjs,此处不再加载!");else{const n=mt.context.getStrFromEnv(To.path);await e.promise(Mg(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 To._instance=To._instance||new To,To._instance}};f(To,"path","${xr-utils-script-dir}/xr-static/xr-utils/hlsjs/1.4.12/hls.min.js"),f(To,"_instance");let Zf=To,e4=class extends B{constructor(e,n){super();f(this,"_element");this._complexImage=e,this._videoSrc=n;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 i4 extends B{constructor(e,n){super();f(this,"_videoDom");f(this,"_processing");this._complexImage=e,this._videoSrc=n,this._videoDom=this.disposeVar(new e4(this._complexImage,"")),this._processing=this.disposeVar(Ln(async r=>{const{videoSrc:s}=this,o=Zf.instance();await r.promise(o.loadedPromise);const a=window.Hls,l=new a,u=this.element;await Ia(r,()=>new Promise((h,c)=>{u.xbsjHLS=l,l.attachMedia(u),l.on(a.Events.MEDIA_ATTACHED,()=>{l.loadSource(s),l.on(a.Events.MANIFEST_PARSED,(d,g)=>{u.play(),h()})}),l.on(a.Events.ERROR,(d,g)=>{const{type:p,details:E,fatal:b}=g;b&&(l.destroy(),c(E))})}))})),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 YE extends B{constructor(e,n){super();f(this,"_videoDom");f(this,"_update");this._complexImage=e,this._imageUri=n,this._videoDom=this.disposeVar(new i4(this._complexImage,this._imageUri)),this._update=this.disposeVar(zl(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:n,videoHeight:r}=this.videoElement;e.size=[n,r],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}const No=class No extends B{constructor(){super();f(this,"_loading",!1);f(this,"_loadedEvent",this.disposeVar(new D));f(this,"_loaded",!1);f(this,"_loadedPromiseResolve");f(this,"_loadedPromise",new Promise(e=>{this._loadedPromiseResolve=e}));f(this,"_processing");this._processing=this.disposeVar(Ln(async e=>{if(this._loading=!0,window.flvjs)console.info("可能系统已经加载flvjs,此处不再加载!");else{const n=mt.context.getStrFromEnv(No.path);await e.promise(Mg(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 No._instance=No._instance||new No,No._instance}};f(No,"path","${xr-utils-script-dir}/xr-static/xr-utils/flvjs/1.6.2/flv.min.js"),f(No,"_instance");let Kf=No;class n4 extends B{constructor(e,n){super();f(this,"_element");this._complexImage=e,this._videoSrc=n;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 r4 extends B{constructor(e,n){super();f(this,"_videoDom");f(this,"_processing");this._complexImage=e,this._videoSrc=n,this._videoDom=this.disposeVar(new n4(this._complexImage,"")),this._processing=this.disposeVar(Ln(async r=>{const{videoSrc:s}=this,o=Kf.instance();await r.promise(o.loadedPromise);const a=window.flvjs,l=this.element;await Ia(r,()=>new Promise((u,h)=>{if(!a.isSupported()){h("flvjs不支持!");return}var c=a.createPlayer({type:"flv",url:s});c.attachMediaElement(l),c.load(),c.play(),l.xbsjFlvPlayer=c}))})),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 JE extends B{constructor(e,n){super();f(this,"_videoDom");f(this,"_update");this._complexImage=e,this._imageUri=n,this._videoDom=this.disposeVar(new r4(e,this._imageUri)),this._update=this.disposeVar(zl(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:n,videoHeight:r}=this.videoElement;e.size=[n,r],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}function ZE(i){const t=i.substring(i.lastIndexOf(".")+1);return Bc.suffixTypes[t]}class Bc extends B{constructor(){super();f(this,"_enabled",this.disposeVar(z(!1)));f(this,"_uri",this.disposeVar(z("")));f(this,"_type",this.disposeVar(z(void 0)));f(this,"_size",this.disposeVar(oe(void 0)));f(this,"_pixelFormat",this.disposeVar(z("RGBA")));f(this,"_flipY",this.disposeVar(z(!0)));f(this,"_crossOriginReact",this.disposeVar(z("")));f(this,"_autoplayReact",this.disposeVar(z(!0)));f(this,"_loopReact",this.disposeVar(z(!0)));f(this,"_copyTextureEvent",this.disposeVar(new D));f(this,"_imageProcessingResettingEvent",this.disposeVar(Ve(this.enabledChanged,this.uriChanged,this.typeChanged)));f(this,"_imageProcessingResetting",this.disposeVar(new qe(this._imageProcessingResettingEvent,()=>{if(!this.enabled||!this.uri)return;let{type:e}=this;if(e||(e=ZE(this.uri)),!!e){if(e==="img")return new uy(this,this.uri);if(e==="video")return new dy(this,this.uri);if(e==="gif")return new Sy(this,this.uri);if(e==="hls")return new YE(this,this.uri);if(e==="flv")return new JE(this,this.uri)}})));f(this,"_createNativeTextureEvent",this.disposeVar(Ve(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(Bc,"types",cy),f(Bc,"czmPixelFormats",hy),f(Bc,"suffixTypes",{png:"img",jpg:"img",svg:"img",webp:"img",gif:"gif",mp4:"video",mov:"video",webm:"video",flv:"flv",m3u8:"hls"});const s4=[0,0,0,0];class o4{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 D),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 n=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,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(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 n=0;n<e-1;++n)if(t>=this._value[n].ratio&&t<=this._value[n+1].ratio)return n;throw console.error("shoud not be here!"),new Error("shoud not be here!")}getRatioColor(t,e){t=vd(t,this.minRatio,this.maxRatio);const n=this._getRatioIndex(t),r=this._value[n],s=this._value[n+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,n=1/e;for(let r=0;r<e;++r){const s=s4;this.getRatioColor((r+.5)*n,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 a4 extends B{constructor(){super(...arguments);f(this,"registerEngines",{})}register(e,n,r){const s=this.registerEngines[e]||new Map;return s.has(n)&&console.warn(`register warn:${e}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,r),this.registerEngines[e]=s,n}getEngineObjConstructor(e,n){const r=this.registerEngines[n];if(!r)return;let s=e.constructor,o=e.typeName,a=r.get(o);if(a)return a;if(e.components.main)return;const l=o;for(;o!=="ESSceneObject"&&(s=s.getParentClass(),!!s);)if(o=s.type,a=r.get(o),a)return console.warn(`未找到${l}在${n}中对应的实现类! 使用父类${o}的实现类!`),a}createEngineObject(e,n){const r=this.getEngineObjConstructor(e,n.typeName);if(r){const s=new r(e,n);return s.createdEvent.emit(),s}else{const s=new sl(e,n);return s.createdEvent.emit(),s}}}class l4 extends B{constructor(){super(...arguments);f(this,"registerEngines",{})}register(e,n,r){const s=this.registerEngines[e]||new Map;s.has(n)&&console.warn(`register warn:${e}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,r),this.registerEngines[e]=s}getEngineObjConstructor(e,n){const s=(this.registerEngines[n]||new Map).get(e);if(s)return s;console.warn(`未找到${e}在${n}中对应的实现类!`)}createEngineObject(e,n){const r=this.getEngineObjConstructor(e.typeName,n.typeName);if(r){const s=new r(e,n);return s.createdEvent.emit(),s}else{const s=new sl(e,n);return s.createdEvent.emit(),s}}}const Lr=class Lr extends B{constructor(e,n,r=!1){super();f(this,"_createdEvent",this.dv(new D));f(this,"_id",++Lr._accumId);this._sceneObject=e,this._viewer=n;{if(r)return;const s=(o,a)=>{for(let l of o)this._viewer.delete(l);for(let l of a)l.parentID=this.sceneObject.id,this._viewer.add(l)};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 a4),f(Lr,"contextEditing",new l4),f(Lr,"register",Lr.context.register.bind(Lr.context)),f(Lr,"registerEditing",Lr.contextEditing.register.bind(Lr.contextEditing)),f(Lr,"_accumId",-1);let sl=Lr;var Zt;(function(i){i.assertEqual=r=>{};function t(r){}i.assertIs=t;function e(r){throw new Error}i.assertNever=e,i.arrayToEnum=r=>{const s={};for(const o of r)s[o]=o;return s},i.getValidEnumValues=r=>{const s=i.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),o={};for(const a of s)o[a]=r[a];return i.objectValues(o)},i.objectValues=r=>i.objectKeys(r).map(function(s){return r[s]}),i.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&s.push(o);return s},i.find=(r,s)=>{for(const o of r)if(s(o))return o},i.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function n(r,s=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}i.joinValues=n,i.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(Zt||(Zt={}));var n0;(function(i){i.mergeShapes=(t,e)=>({...t,...e})})(n0||(n0={}));const ut=Zt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Eo=i=>{switch(typeof i){case"undefined":return ut.undefined;case"string":return ut.string;case"number":return Number.isNaN(i)?ut.nan:ut.number;case"boolean":return ut.boolean;case"function":return ut.function;case"bigint":return ut.bigint;case"symbol":return ut.symbol;case"object":return Array.isArray(i)?ut.array:i===null?ut.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?ut.promise:typeof Map<"u"&&i instanceof Map?ut.map:typeof Set<"u"&&i instanceof Set?ut.set:typeof Date<"u"&&i instanceof Date?ut.date:ut.object;default:return ut.unknown}},Y=Zt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),u4=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:");class Kn extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=t}format(t){const e=t||function(s){return s.message},n={_errors:[]},r=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)n._errors.push(e(o));else{let a=n,l=0;for(;l<o.path.length;){const u=o.path[l];l===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(e(o))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return r(this),n}static assert(t){if(!(t instanceof Kn))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Zt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=e=>e.message){const e={},n=[];for(const r of this.issues)if(r.path.length>0){const s=r.path[0];e[s]=e[s]||[],e[s].push(t(r))}else n.push(t(r));return{formErrors:n,fieldErrors:e}}get formErrors(){return this.flatten()}}Kn.create=i=>new Kn(i);const Fu=(i,t)=>{let e;switch(i.code){case Y.invalid_type:i.received===ut.undefined?e="Required":e=`Expected ${i.expected}, received ${i.received}`;break;case Y.invalid_literal:e=`Invalid literal value, expected ${JSON.stringify(i.expected,Zt.jsonStringifyReplacer)}`;break;case Y.unrecognized_keys:e=`Unrecognized key(s) in object: ${Zt.joinValues(i.keys,", ")}`;break;case Y.invalid_union:e="Invalid input";break;case Y.invalid_union_discriminator:e=`Invalid discriminator value. Expected ${Zt.joinValues(i.options)}`;break;case Y.invalid_enum_value:e=`Invalid enum value. Expected ${Zt.joinValues(i.options)}, received '${i.received}'`;break;case Y.invalid_arguments:e="Invalid function arguments";break;case Y.invalid_return_type:e="Invalid function return type";break;case Y.invalid_date:e="Invalid date";break;case Y.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(e=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(e=`${e} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?e=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?e=`Invalid input: must end with "${i.validation.endsWith}"`:Zt.assertNever(i.validation):i.validation!=="regex"?e=`Invalid ${i.validation}`:e="Invalid";break;case Y.too_small:i.type==="array"?e=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?e=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?e=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="bigint"?e=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?e=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:e="Invalid input";break;case Y.too_big:i.type==="array"?e=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?e=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?e=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?e=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?e=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:e="Invalid input";break;case Y.custom:e="Invalid input";break;case Y.invalid_intersection_types:e="Intersection results could not be merged";break;case Y.not_multiple_of:e=`Number must be a multiple of ${i.multipleOf}`;break;case Y.not_finite:e="Number must be finite";break;default:e=t.defaultError,Zt.assertNever(i)}return{message:e}};let KE=Fu;function h4(i){KE=i}function Qf(){return KE}const tg=i=>{const{data:t,path:e,errorMaps:n,issueData:r}=i,s=[...e,...r.path||[]],o={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let a="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:t,defaultError:a}).message;return{...r,path:s,message:a}},c4=[];function st(i,t){const e=Qf(),n=tg({issueData:t,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,e,e===Fu?void 0:Fu].filter(r=>!!r)});i.common.issues.push(n)}class Yi{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,e){const n=[];for(const r of e){if(r.status==="aborted")return Tt;r.status==="dirty"&&t.dirty(),n.push(r.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,e){const n=[];for(const r of e){const s=await r.key,o=await r.value;n.push({key:s,value:o})}return Yi.mergeObjectSync(t,n)}static mergeObjectSync(t,e){const n={};for(const r of e){const{key:s,value:o}=r;if(s.status==="aborted"||o.status==="aborted")return Tt;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(n[s.value]=o.value)}return{status:t.value,value:n}}}const Tt=Object.freeze({status:"aborted"}),ku=i=>({status:"dirty",value:i}),pn=i=>({status:"valid",value:i}),r0=i=>i.status==="aborted",s0=i=>i.status==="dirty",ol=i=>i.status==="valid",Uc=i=>typeof Promise<"u"&&i instanceof Promise;var yt;(function(i){i.errToObj=t=>typeof t=="string"?{message:t}:t||{},i.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(yt||(yt={}));class ks{constructor(t,e,n,r){this._cachedPath=[],this.parent=t,this.data=e,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const QE=(i,t)=>{if(ol(t))return{success:!0,data:t.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const e=new Kn(i.common.issues);return this._error=e,this._error}}};function Ft(i){if(!i)return{};const{errorMap:t,invalid_type_error:e,required_error:n,description:r}=i;if(t&&(e||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(o,a)=>{const{message:l}=i;return o.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??n??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:l??e??a.defaultError}},description:r}}class jt{get description(){return this._def.description}_getType(t){return Eo(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:Eo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Yi,ctx:{common:t.parent.common,data:t.data,parsedType:Eo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const e=this._parse(t);if(Uc(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(t){const e=this._parse(t);return Promise.resolve(e)}parse(t,e){const n=this.safeParse(t,e);if(n.success)return n.data;throw n.error}safeParse(t,e){const n={common:{issues:[],async:(e==null?void 0:e.async)??!1,contextualErrorMap:e==null?void 0:e.errorMap},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Eo(t)},r=this._parseSync({data:t,path:n.path,parent:n});return QE(n,r)}"~validate"(t){var n,r;const e={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Eo(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:e});return ol(s)?{value:s.value}:{issues:e.common.issues}}catch(s){(r=(n=s==null?void 0:s.message)==null?void 0:n.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),e.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:e}).then(s=>ol(s)?{value:s.value}:{issues:e.common.issues})}async parseAsync(t,e){const n=await this.safeParseAsync(t,e);if(n.success)return n.data;throw n.error}async safeParseAsync(t,e){const n={common:{issues:[],contextualErrorMap:e==null?void 0:e.errorMap,async:!0},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Eo(t)},r=this._parse({data:t,path:n.path,parent:n}),s=await(Uc(r)?r:Promise.resolve(r));return QE(n,s)}refine(t,e){const n=r=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(r):e;return this._refinement((r,s)=>{const o=t(r),a=()=>s.addIssue({code:Y.custom,...n(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,e){return this._refinement((n,r)=>t(n)?!0:(r.addIssue(typeof e=="function"?e(n,r):e),!1))}_refinement(t){return new is({schema:this,typeName:Z.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return js.create(this,this._def)}nullable(){return ca.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return es.create(this)}promise(){return zu.create(this,this._def)}or(t){return Xc.create([this,t],this._def)}and(t){return $c.create(this,t,this._def)}transform(t){return new is({...Ft(this._def),schema:this,typeName:Z.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const e=typeof t=="function"?t:()=>t;return new Qc({...Ft(this._def),innerType:this,defaultValue:e,typeName:Z.ZodDefault})}brand(){return new l0({typeName:Z.ZodBranded,type:this,...Ft(this._def)})}catch(t){const e=typeof t=="function"?t:()=>t;return new td({...Ft(this._def),innerType:this,catchValue:e,typeName:Z.ZodCatch})}describe(t){const e=this.constructor;return new e({...this._def,description:t})}pipe(t){return ed.create(this,t)}readonly(){return id.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const d4=/^c[^\s-]{8,}$/i,f4=/^[0-9a-z]+$/,g4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,p4=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,m4=/^[a-z0-9_-]{21}$/i,v4=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,y4=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_4=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,w4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let o0;const E4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,S4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,b4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,C4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,P4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,x4=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,tS="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",I4=new RegExp(`^${tS}$`);function eS(i){let t="[0-5]\\d";i.precision?t=`${t}\\.\\d{${i.precision}}`:i.precision==null&&(t=`${t}(\\.\\d+)?`);const e=i.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e}`}function M4(i){return new RegExp(`^${eS(i)}$`)}function iS(i){let t=`${tS}T${eS(i)}`;const e=[];return e.push(i.local?"Z?":"Z"),i.offset&&e.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${e.join("|")})`,new RegExp(`^${t}$`)}function T4(i,t){return!!((t==="v4"||!t)&&E4.test(i)||(t==="v6"||!t)&&b4.test(i))}function N4(i,t){if(!v4.test(i))return!1;try{const[e]=i.split(".");if(!e)return!1;const n=e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(4-e.length%4)%4,"="),r=JSON.parse(atob(n));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function O4(i,t){return!!((t==="v4"||!t)&&S4.test(i)||(t==="v6"||!t)&&C4.test(i))}class ts extends jt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ut.string){const s=this._getOrReturnCtx(t);return st(s,{code:Y.invalid_type,expected:ut.string,received:s.parsedType}),Tt}const n=new Yi;let r;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(r=this._getOrReturnCtx(t,r),st(r,{code:Y.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(r=this._getOrReturnCtx(t,r),st(r,{code:Y.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,a=t.data.length<s.value;(o||a)&&(r=this._getOrReturnCtx(t,r),o?st(r,{code:Y.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&st(r,{code:Y.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")_4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"email",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")o0||(o0=new RegExp(w4,"u")),o0.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"emoji",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")p4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"uuid",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")m4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"nanoid",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")d4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"cuid",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")f4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"cuid2",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")g4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"ulid",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),st(r,{validation:"url",code:Y.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"regex",code:Y.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?iS(s).test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?I4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?M4(s).test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?y4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"duration",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?T4(t.data,s.version)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"ip",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?N4(t.data,s.alg)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"jwt",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?O4(t.data,s.version)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"cidr",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?P4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"base64",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?x4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"base64url",code:Y.invalid_string,message:s.message}),n.dirty()):Zt.assertNever(s);return{status:n.value,value:t.data}}_regex(t,e,n){return this.refinement(r=>t.test(r),{validation:e,code:Y.invalid_string,...yt.errToObj(n)})}_addCheck(t){return new ts({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...yt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...yt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...yt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...yt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...yt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...yt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...yt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...yt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...yt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...yt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...yt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...yt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...yt.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...yt.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...yt.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...yt.errToObj(t)})}regex(t,e){return this._addCheck({kind:"regex",regex:t,...yt.errToObj(e)})}includes(t,e){return this._addCheck({kind:"includes",value:t,position:e==null?void 0:e.position,...yt.errToObj(e==null?void 0:e.message)})}startsWith(t,e){return this._addCheck({kind:"startsWith",value:t,...yt.errToObj(e)})}endsWith(t,e){return this._addCheck({kind:"endsWith",value:t,...yt.errToObj(e)})}min(t,e){return this._addCheck({kind:"min",value:t,...yt.errToObj(e)})}max(t,e){return this._addCheck({kind:"max",value:t,...yt.errToObj(e)})}length(t,e){return this._addCheck({kind:"length",value:t,...yt.errToObj(e)})}nonempty(t){return this.min(1,yt.errToObj(t))}trim(){return new ts({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ts({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ts({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxLength(){let t=null;for(const e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}}ts.create=i=>new ts({checks:[],typeName:Z.ZodString,coerce:(i==null?void 0:i.coerce)??!1,...Ft(i)});function D4(i,t){const e=(i.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,r=e>n?e:n,s=Number.parseInt(i.toFixed(r).replace(".","")),o=Number.parseInt(t.toFixed(r).replace(".",""));return s%o/10**r}class la extends jt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ut.number){const s=this._getOrReturnCtx(t);return st(s,{code:Y.invalid_type,expected:ut.number,received:s.parsedType}),Tt}let n;const r=new Yi;for(const s of this._def.checks)s.kind==="int"?Zt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),st(n,{code:Y.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?D4(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),st(n,{code:Y.not_finite,message:s.message}),r.dirty()):Zt.assertNever(s);return{status:r.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,yt.toString(e))}gt(t,e){return this.setLimit("min",t,!1,yt.toString(e))}lte(t,e){return this.setLimit("max",t,!0,yt.toString(e))}lt(t,e){return this.setLimit("max",t,!1,yt.toString(e))}setLimit(t,e,n,r){return new la({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:n,message:yt.toString(r)}]})}_addCheck(t){return new la({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:yt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:yt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:yt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:yt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:yt.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:yt.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:yt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:yt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:yt.toString(t)})}get minValue(){let t=null;for(const e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(const e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Zt.isInteger(t.value))}get isFinite(){let t=null,e=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(e===null||n.value>e)&&(e=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(e)&&Number.isFinite(t)}}la.create=i=>new la({checks:[],typeName:Z.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...Ft(i)});class ua extends jt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ut.bigint)return this._getInvalidInput(t);let n;const r=new Yi;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):Zt.assertNever(s);return{status:r.value,value:t.data}}_getInvalidInput(t){const e=this._getOrReturnCtx(t);return st(e,{code:Y.invalid_type,expected:ut.bigint,received:e.parsedType}),Tt}gte(t,e){return this.setLimit("min",t,!0,yt.toString(e))}gt(t,e){return this.setLimit("min",t,!1,yt.toString(e))}lte(t,e){return this.setLimit("max",t,!0,yt.toString(e))}lt(t,e){return this.setLimit("max",t,!1,yt.toString(e))}setLimit(t,e,n,r){return new ua({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:n,message:yt.toString(r)}]})}_addCheck(t){return new ua({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:yt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:yt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:yt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:yt.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:yt.toString(e)})}get minValue(){let t=null;for(const e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(const e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}}ua.create=i=>new ua({checks:[],typeName:Z.ZodBigInt,coerce:(i==null?void 0:i.coerce)??!1,...Ft(i)});class qc extends jt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ut.boolean){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.boolean,received:n.parsedType}),Tt}return pn(t.data)}}qc.create=i=>new qc({typeName:Z.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...Ft(i)});class al extends jt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ut.date){const s=this._getOrReturnCtx(t);return st(s,{code:Y.invalid_type,expected:ut.date,received:s.parsedType}),Tt}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return st(s,{code:Y.invalid_date}),Tt}const n=new Yi;let r;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(r=this._getOrReturnCtx(t,r),st(r,{code:Y.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(r=this._getOrReturnCtx(t,r),st(r,{code:Y.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Zt.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new al({...this._def,checks:[...this._def.checks,t]})}min(t,e){return this._addCheck({kind:"min",value:t.getTime(),message:yt.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:yt.toString(e)})}get minDate(){let t=null;for(const e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t!=null?new Date(t):null}}al.create=i=>new al({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:Z.ZodDate,...Ft(i)});class eg extends jt{_parse(t){if(this._getType(t)!==ut.symbol){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.symbol,received:n.parsedType}),Tt}return pn(t.data)}}eg.create=i=>new eg({typeName:Z.ZodSymbol,...Ft(i)});class Wc extends jt{_parse(t){if(this._getType(t)!==ut.undefined){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.undefined,received:n.parsedType}),Tt}return pn(t.data)}}Wc.create=i=>new Wc({typeName:Z.ZodUndefined,...Ft(i)});class Hc extends jt{_parse(t){if(this._getType(t)!==ut.null){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.null,received:n.parsedType}),Tt}return pn(t.data)}}Hc.create=i=>new Hc({typeName:Z.ZodNull,...Ft(i)});class Gu extends jt{constructor(){super(...arguments),this._any=!0}_parse(t){return pn(t.data)}}Gu.create=i=>new Gu({typeName:Z.ZodAny,...Ft(i)});class ll extends jt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return pn(t.data)}}ll.create=i=>new ll({typeName:Z.ZodUnknown,...Ft(i)});class So extends jt{_parse(t){const e=this._getOrReturnCtx(t);return st(e,{code:Y.invalid_type,expected:ut.never,received:e.parsedType}),Tt}}So.create=i=>new So({typeName:Z.ZodNever,...Ft(i)});class ig extends jt{_parse(t){if(this._getType(t)!==ut.undefined){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.void,received:n.parsedType}),Tt}return pn(t.data)}}ig.create=i=>new ig({typeName:Z.ZodVoid,...Ft(i)});class es extends jt{_parse(t){const{ctx:e,status:n}=this._processInputParams(t),r=this._def;if(e.parsedType!==ut.array)return st(e,{code:Y.invalid_type,expected:ut.array,received:e.parsedType}),Tt;if(r.exactLength!==null){const o=e.data.length>r.exactLength.value,a=e.data.length<r.exactLength.value;(o||a)&&(st(e,{code:o?Y.too_big:Y.too_small,minimum:a?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&e.data.length<r.minLength.value&&(st(e,{code:Y.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&e.data.length>r.maxLength.value&&(st(e,{code:Y.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),e.common.async)return Promise.all([...e.data].map((o,a)=>r.type._parseAsync(new ks(e,o,e.path,a)))).then(o=>Yi.mergeArray(n,o));const s=[...e.data].map((o,a)=>r.type._parseSync(new ks(e,o,e.path,a)));return Yi.mergeArray(n,s)}get element(){return this._def.type}min(t,e){return new es({...this._def,minLength:{value:t,message:yt.toString(e)}})}max(t,e){return new es({...this._def,maxLength:{value:t,message:yt.toString(e)}})}length(t,e){return new es({...this._def,exactLength:{value:t,message:yt.toString(e)}})}nonempty(t){return this.min(1,t)}}es.create=(i,t)=>new es({type:i,minLength:null,maxLength:null,exactLength:null,typeName:Z.ZodArray,...Ft(t)});function ju(i){if(i instanceof ke){const t={};for(const e in i.shape){const n=i.shape[e];t[e]=js.create(ju(n))}return new ke({...i._def,shape:()=>t})}else return i instanceof es?new es({...i._def,type:ju(i.element)}):i instanceof js?js.create(ju(i.unwrap())):i instanceof ca?ca.create(ju(i.unwrap())):i instanceof Gs?Gs.create(i.items.map(t=>ju(t))):i}class ke extends jt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),e=Zt.objectKeys(t);return this._cached={shape:t,keys:e},this._cached}_parse(t){if(this._getType(t)!==ut.object){const u=this._getOrReturnCtx(t);return st(u,{code:Y.invalid_type,expected:ut.object,received:u.parsedType}),Tt}const{status:n,ctx:r}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof So&&this._def.unknownKeys==="strip"))for(const u in r.data)o.includes(u)||a.push(u);const l=[];for(const u of o){const h=s[u],c=r.data[u];l.push({key:{status:"valid",value:u},value:h._parse(new ks(r,c,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof So){const u=this._def.unknownKeys;if(u==="passthrough")for(const h of a)l.push({key:{status:"valid",value:h},value:{status:"valid",value:r.data[h]}});else if(u==="strict")a.length>0&&(st(r,{code:Y.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const h of a){const c=r.data[h];l.push({key:{status:"valid",value:h},value:u._parse(new ks(r,c,r.path,h)),alwaysSet:h in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const u=[];for(const h of l){const c=await h.key,d=await h.value;u.push({key:c,value:d,alwaysSet:h.alwaysSet})}return u}).then(u=>Yi.mergeObjectSync(n,u)):Yi.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return yt.errToObj,new ke({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(e,n)=>{var s,o;const r=((o=(s=this._def).errorMap)==null?void 0:o.call(s,e,n).message)??n.defaultError;return e.code==="unrecognized_keys"?{message:yt.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new ke({...this._def,unknownKeys:"strip"})}passthrough(){return new ke({...this._def,unknownKeys:"passthrough"})}extend(t){return new ke({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ke({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Z.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new ke({...this._def,catchall:t})}pick(t){const e={};for(const n of Zt.objectKeys(t))t[n]&&this.shape[n]&&(e[n]=this.shape[n]);return new ke({...this._def,shape:()=>e})}omit(t){const e={};for(const n of Zt.objectKeys(this.shape))t[n]||(e[n]=this.shape[n]);return new ke({...this._def,shape:()=>e})}deepPartial(){return ju(this)}partial(t){const e={};for(const n of Zt.objectKeys(this.shape)){const r=this.shape[n];t&&!t[n]?e[n]=r:e[n]=r.optional()}return new ke({...this._def,shape:()=>e})}required(t){const e={};for(const n of Zt.objectKeys(this.shape))if(t&&!t[n])e[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof js;)s=s._def.innerType;e[n]=s}return new ke({...this._def,shape:()=>e})}keyof(){return nS(Zt.objectKeys(this.shape))}}ke.create=(i,t)=>new ke({shape:()=>i,unknownKeys:"strip",catchall:So.create(),typeName:Z.ZodObject,...Ft(t)}),ke.strictCreate=(i,t)=>new ke({shape:()=>i,unknownKeys:"strict",catchall:So.create(),typeName:Z.ZodObject,...Ft(t)}),ke.lazycreate=(i,t)=>new ke({shape:i,unknownKeys:"strip",catchall:So.create(),typeName:Z.ZodObject,...Ft(t)});class Xc extends jt{_parse(t){const{ctx:e}=this._processInputParams(t),n=this._def.options;function r(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return e.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Kn(a.ctx.common.issues));return st(e,{code:Y.invalid_union,unionErrors:o}),Tt}if(e.common.async)return Promise.all(n.map(async s=>{const o={...e,common:{...e.common,issues:[]},parent:null};return{result:await s._parseAsync({data:e.data,path:e.path,parent:o}),ctx:o}})).then(r);{let s;const o=[];for(const l of n){const u={...e,common:{...e.common,issues:[]},parent:null},h=l._parseSync({data:e.data,path:e.path,parent:u});if(h.status==="valid")return h;h.status==="dirty"&&!s&&(s={result:h,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return e.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new Kn(l));return st(e,{code:Y.invalid_union,unionErrors:a}),Tt}}get options(){return this._def.options}}Xc.create=(i,t)=>new Xc({options:i,typeName:Z.ZodUnion,...Ft(t)});const bo=i=>i instanceof Jc?bo(i.schema):i instanceof is?bo(i.innerType()):i instanceof Zc?[i.value]:i instanceof ha?i.options:i instanceof Kc?Zt.objectValues(i.enum):i instanceof Qc?bo(i._def.innerType):i instanceof Wc?[void 0]:i instanceof Hc?[null]:i instanceof js?[void 0,...bo(i.unwrap())]:i instanceof ca?[null,...bo(i.unwrap())]:i instanceof l0||i instanceof id?bo(i.unwrap()):i instanceof td?bo(i._def.innerType):[];class ng extends jt{_parse(t){const{ctx:e}=this._processInputParams(t);if(e.parsedType!==ut.object)return st(e,{code:Y.invalid_type,expected:ut.object,received:e.parsedType}),Tt;const n=this.discriminator,r=e.data[n],s=this.optionsMap.get(r);return s?e.common.async?s._parseAsync({data:e.data,path:e.path,parent:e}):s._parseSync({data:e.data,path:e.path,parent:e}):(st(e,{code:Y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Tt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,n){const r=new Map;for(const s of e){const o=bo(s.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(r.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);r.set(a,s)}}return new ng({typeName:Z.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:r,...Ft(n)})}}function a0(i,t){const e=Eo(i),n=Eo(t);if(i===t)return{valid:!0,data:i};if(e===ut.object&&n===ut.object){const r=Zt.objectKeys(t),s=Zt.objectKeys(i).filter(a=>r.indexOf(a)!==-1),o={...i,...t};for(const a of s){const l=a0(i[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(e===ut.array&&n===ut.array){if(i.length!==t.length)return{valid:!1};const r=[];for(let s=0;s<i.length;s++){const o=i[s],a=t[s],l=a0(o,a);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return e===ut.date&&n===ut.date&&+i==+t?{valid:!0,data:i}:{valid:!1}}class $c extends jt{_parse(t){const{status:e,ctx:n}=this._processInputParams(t),r=(s,o)=>{if(r0(s)||r0(o))return Tt;const a=a0(s.value,o.value);return a.valid?((s0(s)||s0(o))&&e.dirty(),{status:e.value,value:a.data}):(st(n,{code:Y.invalid_intersection_types}),Tt)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>r(s,o)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}$c.create=(i,t,e)=>new $c({left:i,right:t,typeName:Z.ZodIntersection,...Ft(e)});class Gs extends jt{_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.array)return st(n,{code:Y.invalid_type,expected:ut.array,received:n.parsedType}),Tt;if(n.data.length<this._def.items.length)return st(n,{code:Y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Tt;!this._def.rest&&n.data.length>this._def.items.length&&(st(n,{code:Y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty());const s=[...n.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new ks(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>Yi.mergeArray(e,o)):Yi.mergeArray(e,s)}get items(){return this._def.items}rest(t){return new Gs({...this._def,rest:t})}}Gs.create=(i,t)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gs({items:i,typeName:Z.ZodTuple,rest:null,...Ft(t)})};class Yc extends jt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.object)return st(n,{code:Y.invalid_type,expected:ut.object,received:n.parsedType}),Tt;const r=[],s=this._def.keyType,o=this._def.valueType;for(const a in n.data)r.push({key:s._parse(new ks(n,a,n.path,a)),value:o._parse(new ks(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Yi.mergeObjectAsync(e,r):Yi.mergeObjectSync(e,r)}get element(){return this._def.valueType}static create(t,e,n){return e instanceof jt?new Yc({keyType:t,valueType:e,typeName:Z.ZodRecord,...Ft(n)}):new Yc({keyType:ts.create(),valueType:t,typeName:Z.ZodRecord,...Ft(e)})}}class rg extends jt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.map)return st(n,{code:Y.invalid_type,expected:ut.map,received:n.parsedType}),Tt;const r=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,l],u)=>({key:r._parse(new ks(n,a,n.path,[u,"key"])),value:s._parse(new ks(n,l,n.path,[u,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,h=await l.value;if(u.status==="aborted"||h.status==="aborted")return Tt;(u.status==="dirty"||h.status==="dirty")&&e.dirty(),a.set(u.value,h.value)}return{status:e.value,value:a}})}else{const a=new Map;for(const l of o){const u=l.key,h=l.value;if(u.status==="aborted"||h.status==="aborted")return Tt;(u.status==="dirty"||h.status==="dirty")&&e.dirty(),a.set(u.value,h.value)}return{status:e.value,value:a}}}}rg.create=(i,t,e)=>new rg({valueType:t,keyType:i,typeName:Z.ZodMap,...Ft(e)});class ul extends jt{_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.set)return st(n,{code:Y.invalid_type,expected:ut.set,received:n.parsedType}),Tt;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(st(n,{code:Y.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),e.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(st(n,{code:Y.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),e.dirty());const s=this._def.valueType;function o(l){const u=new Set;for(const h of l){if(h.status==="aborted")return Tt;h.status==="dirty"&&e.dirty(),u.add(h.value)}return{status:e.value,value:u}}const a=[...n.data.values()].map((l,u)=>s._parse(new ks(n,l,n.path,u)));return n.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,e){return new ul({...this._def,minSize:{value:t,message:yt.toString(e)}})}max(t,e){return new ul({...this._def,maxSize:{value:t,message:yt.toString(e)}})}size(t,e){return this.min(t,e).max(t,e)}nonempty(t){return this.min(1,t)}}ul.create=(i,t)=>new ul({valueType:i,minSize:null,maxSize:null,typeName:Z.ZodSet,...Ft(t)});class Vu extends jt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:e}=this._processInputParams(t);if(e.parsedType!==ut.function)return st(e,{code:Y.invalid_type,expected:ut.function,received:e.parsedType}),Tt;function n(a,l){return tg({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Qf(),Fu].filter(u=>!!u),issueData:{code:Y.invalid_arguments,argumentsError:l}})}function r(a,l){return tg({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Qf(),Fu].filter(u=>!!u),issueData:{code:Y.invalid_return_type,returnTypeError:l}})}const s={errorMap:e.common.contextualErrorMap},o=e.data;if(this._def.returns instanceof zu){const a=this;return pn(async function(...l){const u=new Kn([]),h=await a._def.args.parseAsync(l,s).catch(g=>{throw u.addIssue(n(l,g)),u}),c=await Reflect.apply(o,this,h);return await a._def.returns._def.type.parseAsync(c,s).catch(g=>{throw u.addIssue(r(c,g)),u})})}else{const a=this;return pn(function(...l){const u=a._def.args.safeParse(l,s);if(!u.success)throw new Kn([n(l,u.error)]);const h=Reflect.apply(o,this,u.data),c=a._def.returns.safeParse(h,s);if(!c.success)throw new Kn([r(h,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Vu({...this._def,args:Gs.create(t).rest(ll.create())})}returns(t){return new Vu({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,e,n){return new Vu({args:t||Gs.create([]).rest(ll.create()),returns:e||ll.create(),typeName:Z.ZodFunction,...Ft(n)})}}class Jc extends jt{get schema(){return this._def.getter()}_parse(t){const{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}}Jc.create=(i,t)=>new Jc({getter:i,typeName:Z.ZodLazy,...Ft(t)});class Zc extends jt{_parse(t){if(t.data!==this._def.value){const e=this._getOrReturnCtx(t);return st(e,{received:e.data,code:Y.invalid_literal,expected:this._def.value}),Tt}return{status:"valid",value:t.data}}get value(){return this._def.value}}Zc.create=(i,t)=>new Zc({value:i,typeName:Z.ZodLiteral,...Ft(t)});function nS(i,t){return new ha({values:i,typeName:Z.ZodEnum,...Ft(t)})}class ha extends jt{_parse(t){if(typeof t.data!="string"){const e=this._getOrReturnCtx(t),n=this._def.values;return st(e,{expected:Zt.joinValues(n),received:e.parsedType,code:Y.invalid_type}),Tt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const e=this._getOrReturnCtx(t),n=this._def.values;return st(e,{received:e.data,code:Y.invalid_enum_value,options:n}),Tt}return pn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const e of this._def.values)t[e]=e;return t}get Values(){const t={};for(const e of this._def.values)t[e]=e;return t}get Enum(){const t={};for(const e of this._def.values)t[e]=e;return t}extract(t,e=this._def){return ha.create(t,{...this._def,...e})}exclude(t,e=this._def){return ha.create(this.options.filter(n=>!t.includes(n)),{...this._def,...e})}}ha.create=nS;class Kc extends jt{_parse(t){const e=Zt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ut.string&&n.parsedType!==ut.number){const r=Zt.objectValues(e);return st(n,{expected:Zt.joinValues(r),received:n.parsedType,code:Y.invalid_type}),Tt}if(this._cache||(this._cache=new Set(Zt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const r=Zt.objectValues(e);return st(n,{received:n.data,code:Y.invalid_enum_value,options:r}),Tt}return pn(t.data)}get enum(){return this._def.values}}Kc.create=(i,t)=>new Kc({values:i,typeName:Z.ZodNativeEnum,...Ft(t)});class zu extends jt{unwrap(){return this._def.type}_parse(t){const{ctx:e}=this._processInputParams(t);if(e.parsedType!==ut.promise&&e.common.async===!1)return st(e,{code:Y.invalid_type,expected:ut.promise,received:e.parsedType}),Tt;const n=e.parsedType===ut.promise?e.data:Promise.resolve(e.data);return pn(n.then(r=>this._def.type.parseAsync(r,{path:e.path,errorMap:e.common.contextualErrorMap})))}}zu.create=(i,t)=>new zu({type:i,typeName:Z.ZodPromise,...Ft(t)});class is extends jt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:e,ctx:n}=this._processInputParams(t),r=this._def.effect||null,s={addIssue:o=>{st(n,o),o.fatal?e.abort():e.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const o=r.transform(n.data,s);if(n.common.async)return Promise.resolve(o).then(async a=>{if(e.value==="aborted")return Tt;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?Tt:l.status==="dirty"||e.value==="dirty"?ku(l.value):l});{if(e.value==="aborted")return Tt;const a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?Tt:a.status==="dirty"||e.value==="dirty"?ku(a.value):a}}if(r.type==="refinement"){const o=a=>{const l=r.refinement(a,s);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Tt:(a.status==="dirty"&&e.dirty(),o(a.value),{status:e.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Tt:(a.status==="dirty"&&e.dirty(),o(a.value).then(()=>({status:e.value,value:a.value}))))}if(r.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ol(o))return Tt;const a=r.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>ol(o)?Promise.resolve(r.transform(o.value,s)).then(a=>({status:e.value,value:a})):Tt);Zt.assertNever(r)}}is.create=(i,t,e)=>new is({schema:i,typeName:Z.ZodEffects,effect:t,...Ft(e)}),is.createWithPreprocess=(i,t,e)=>new is({schema:t,effect:{type:"preprocess",transform:i},typeName:Z.ZodEffects,...Ft(e)});class js extends jt{_parse(t){return this._getType(t)===ut.undefined?pn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}js.create=(i,t)=>new js({innerType:i,typeName:Z.ZodOptional,...Ft(t)});class ca extends jt{_parse(t){return this._getType(t)===ut.null?pn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ca.create=(i,t)=>new ca({innerType:i,typeName:Z.ZodNullable,...Ft(t)});class Qc extends jt{_parse(t){const{ctx:e}=this._processInputParams(t);let n=e.data;return e.parsedType===ut.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:e.path,parent:e})}removeDefault(){return this._def.innerType}}Qc.create=(i,t)=>new Qc({innerType:i,typeName:Z.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ft(t)});class td extends jt{_parse(t){const{ctx:e}=this._processInputParams(t),n={...e,common:{...e.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Uc(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Kn(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Kn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}td.create=(i,t)=>new td({innerType:i,typeName:Z.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ft(t)});class sg extends jt{_parse(t){if(this._getType(t)!==ut.nan){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.nan,received:n.parsedType}),Tt}return{status:"valid",value:t.data}}}sg.create=i=>new sg({typeName:Z.ZodNaN,...Ft(i)});const R4=Symbol("zod_brand");class l0 extends jt{_parse(t){const{ctx:e}=this._processInputParams(t),n=e.data;return this._def.type._parse({data:n,path:e.path,parent:e})}unwrap(){return this._def.type}}class ed extends jt{_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Tt:s.status==="dirty"?(e.dirty(),ku(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?Tt:r.status==="dirty"?(e.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(t,e){return new ed({in:t,out:e,typeName:Z.ZodPipeline})}}class id extends jt{_parse(t){const e=this._def.innerType._parse(t),n=r=>(ol(r)&&(r.value=Object.freeze(r.value)),r);return Uc(e)?e.then(r=>n(r)):n(e)}unwrap(){return this._def.innerType}}id.create=(i,t)=>new id({innerType:i,typeName:Z.ZodReadonly,...Ft(t)});function rS(i,t){const e=typeof i=="function"?i(t):typeof i=="string"?{message:i}:i;return typeof e=="string"?{message:e}:e}function sS(i,t={},e){return i?Gu.create().superRefine((n,r)=>{const s=i(n);if(s instanceof Promise)return s.then(o=>{if(!o){const a=rS(t,n),l=a.fatal??e??!0;r.addIssue({code:"custom",...a,fatal:l})}});if(!s){const o=rS(t,n),a=o.fatal??e??!0;r.addIssue({code:"custom",...o,fatal:a})}}):Gu.create()}const A4={object:ke.lazycreate};var Z;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(Z||(Z={}));const L4=(i,t={message:`Input not instance of ${i.name}`})=>sS(e=>e instanceof i,t),oS=ts.create,aS=la.create,F4=sg.create,k4=ua.create,lS=qc.create,G4=al.create,j4=eg.create,V4=Wc.create,z4=Hc.create,B4=Gu.create,U4=ll.create,q4=So.create,W4=ig.create,H4=es.create,u0=ke.create,X4=ke.strictCreate,$4=Xc.create,Y4=ng.create,J4=$c.create,Z4=Gs.create,K4=Yc.create,Q4=rg.create,tR=ul.create,eR=Vu.create,iR=Jc.create,nR=Zc.create,rR=ha.create,sR=Kc.create,oR=zu.create,uS=is.create,aR=js.create,lR=ca.create,uR=is.createWithPreprocess,hR=ed.create,Je=Object.freeze(Object.defineProperty({__proto__:null,BRAND:R4,DIRTY:ku,EMPTY_PATH:c4,INVALID:Tt,NEVER:Tt,OK:pn,ParseStatus:Yi,Schema:jt,ZodAny:Gu,ZodArray:es,ZodBigInt:ua,ZodBoolean:qc,ZodBranded:l0,ZodCatch:td,ZodDate:al,ZodDefault:Qc,ZodDiscriminatedUnion:ng,ZodEffects:is,ZodEnum:ha,ZodError:Kn,get ZodFirstPartyTypeKind(){return Z},ZodFunction:Vu,ZodIntersection:$c,ZodIssueCode:Y,ZodLazy:Jc,ZodLiteral:Zc,ZodMap:rg,ZodNaN:sg,ZodNativeEnum:Kc,ZodNever:So,ZodNull:Hc,ZodNullable:ca,ZodNumber:la,ZodObject:ke,ZodOptional:js,ZodParsedType:ut,ZodPipeline:ed,ZodPromise:zu,ZodReadonly:id,ZodRecord:Yc,ZodSchema:jt,ZodSet:ul,ZodString:ts,ZodSymbol:eg,ZodTransformer:is,ZodTuple:Gs,ZodType:jt,ZodUndefined:Wc,ZodUnion:Xc,ZodUnknown:ll,ZodVoid:ig,addIssueToContext:st,any:B4,array:H4,bigint:k4,boolean:lS,coerce:{string:(i=>ts.create({...i,coerce:!0})),number:(i=>la.create({...i,coerce:!0})),boolean:(i=>qc.create({...i,coerce:!0})),bigint:(i=>ua.create({...i,coerce:!0})),date:(i=>al.create({...i,coerce:!0}))},custom:sS,date:G4,datetimeRegex:iS,defaultErrorMap:Fu,discriminatedUnion:Y4,effect:uS,enum:rR,function:eR,getErrorMap:Qf,getParsedType:Eo,instanceof:L4,intersection:J4,isAborted:r0,isAsync:Uc,isDirty:s0,isValid:ol,late:A4,lazy:iR,literal:nR,makeIssue:tg,map:Q4,nan:F4,nativeEnum:sR,never:q4,null:z4,nullable:lR,number:aS,object:u0,get objectUtil(){return n0},oboolean:()=>lS().optional(),onumber:()=>aS().optional(),optional:aR,ostring:()=>oS().optional(),pipeline:hR,preprocess:uR,promise:oR,quotelessJson:u4,record:K4,set:tR,setErrorMap:h4,strictObject:X4,string:oS,symbol:j4,transformer:uS,tuple:Z4,undefined:V4,union:$4,unknown:U4,get util(){return Zt},void:W4},Symbol.toStringTag,{value:"Module"})),cR=Symbol("Let zodToJsonSchema decide on which parser to use"),hS={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},dR=i=>typeof i=="string"?{...hS,name:i}:{...hS,...i},fR=i=>{const t=dR(i),e=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:e,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}};function cS(i,t,e,n){n!=null&&n.errorMessages&&e&&(i.errorMessage={...i.errorMessage,[t]:e})}function ce(i,t,e,n,r){i[t]=e,cS(i,t,n,r)}const dS=(i,t)=>{let e=0;for(;e<i.length&&e<t.length&&i[e]===t[e];e++);return[(i.length-e).toString(),...t.slice(e)].join("/")};function On(i){if(i.target!=="openAi")return{};const t=[...i.basePath,i.definitionPath,i.openAiAnyTypeName];return i.flags.hasReferencedOpenAiAnyType=!0,{$ref:i.$refStrategy==="relative"?dS(t,i.currentPath):t.join("/")}}function gR(i,t){var n,r,s;const e={type:"array"};return(n=i.type)!=null&&n._def&&((s=(r=i.type)==null?void 0:r._def)==null?void 0:s.typeName)!==Z.ZodAny&&(e.items=se(i.type._def,{...t,currentPath:[...t.currentPath,"items"]})),i.minLength&&ce(e,"minItems",i.minLength.value,i.minLength.message,t),i.maxLength&&ce(e,"maxItems",i.maxLength.value,i.maxLength.message,t),i.exactLength&&(ce(e,"minItems",i.exactLength.value,i.exactLength.message,t),ce(e,"maxItems",i.exactLength.value,i.exactLength.message,t)),e}function pR(i,t){const e={type:"integer",format:"int64"};if(!i.checks)return e;for(const n of i.checks)switch(n.kind){case"min":t.target==="jsonSchema7"?n.inclusive?ce(e,"minimum",n.value,n.message,t):ce(e,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(e.exclusiveMinimum=!0),ce(e,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?ce(e,"maximum",n.value,n.message,t):ce(e,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(e.exclusiveMaximum=!0),ce(e,"maximum",n.value,n.message,t));break;case"multipleOf":ce(e,"multipleOf",n.value,n.message,t);break}return e}function mR(){return{type:"boolean"}}function fS(i,t){return se(i.type._def,t)}const vR=(i,t)=>se(i.innerType._def,t);function gS(i,t,e){const n=e??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,s)=>gS(i,t,r))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return yR(i,t)}}const yR=(i,t)=>{const e={type:"integer",format:"unix-time"};if(t.target==="openApi3")return e;for(const n of i.checks)switch(n.kind){case"min":ce(e,"minimum",n.value,n.message,t);break;case"max":ce(e,"maximum",n.value,n.message,t);break}return e};function _R(i,t){return{...se(i.innerType._def,t),default:i.defaultValue()}}function wR(i,t){return t.effectStrategy==="input"?se(i.schema._def,t):On(t)}function ER(i){return{type:"string",enum:Array.from(i.values)}}const SR=i=>"type"in i&&i.type==="string"?!1:"allOf"in i;function bR(i,t){const e=[se(i.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),se(i.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(s=>!!s);let n=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const r=[];return e.forEach(s=>{if(SR(s))r.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:a,...l}=s;o=l}else n=void 0;r.push(o)}}),r.length?{allOf:r,...n}:void 0}function CR(i,t){const e=typeof i.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(i.value)?"array":"object"}:t.target==="openApi3"?{type:e==="bigint"?"integer":e,enum:[i.value]}:{type:e==="bigint"?"integer":e,const:i.value}}let h0;const ns={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(h0===void 0&&(h0=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),h0),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function pS(i,t){const e={type:"string"};if(i.checks)for(const n of i.checks)switch(n.kind){case"min":ce(e,"minLength",typeof e.minLength=="number"?Math.max(e.minLength,n.value):n.value,n.message,t);break;case"max":ce(e,"maxLength",typeof e.maxLength=="number"?Math.min(e.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":rs(e,"email",n.message,t);break;case"format:idn-email":rs(e,"idn-email",n.message,t);break;case"pattern:zod":mn(e,ns.email,n.message,t);break}break;case"url":rs(e,"uri",n.message,t);break;case"uuid":rs(e,"uuid",n.message,t);break;case"regex":mn(e,n.regex,n.message,t);break;case"cuid":mn(e,ns.cuid,n.message,t);break;case"cuid2":mn(e,ns.cuid2,n.message,t);break;case"startsWith":mn(e,RegExp(`^${c0(n.value,t)}`),n.message,t);break;case"endsWith":mn(e,RegExp(`${c0(n.value,t)}$`),n.message,t);break;case"datetime":rs(e,"date-time",n.message,t);break;case"date":rs(e,"date",n.message,t);break;case"time":rs(e,"time",n.message,t);break;case"duration":rs(e,"duration",n.message,t);break;case"length":ce(e,"minLength",typeof e.minLength=="number"?Math.max(e.minLength,n.value):n.value,n.message,t),ce(e,"maxLength",typeof e.maxLength=="number"?Math.min(e.maxLength,n.value):n.value,n.message,t);break;case"includes":{mn(e,RegExp(c0(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&rs(e,"ipv4",n.message,t),n.version!=="v4"&&rs(e,"ipv6",n.message,t);break}case"base64url":mn(e,ns.base64url,n.message,t);break;case"jwt":mn(e,ns.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&mn(e,ns.ipv4Cidr,n.message,t),n.version!=="v4"&&mn(e,ns.ipv6Cidr,n.message,t);break}case"emoji":mn(e,ns.emoji(),n.message,t);break;case"ulid":{mn(e,ns.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{rs(e,"binary",n.message,t);break}case"contentEncoding:base64":{ce(e,"contentEncoding","base64",n.message,t);break}case"pattern:zod":{mn(e,ns.base64,n.message,t);break}}break}case"nanoid":mn(e,ns.nanoid,n.message,t)}return e}function c0(i,t){return t.patternStrategy==="escape"?xR(i):i}const PR=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function xR(i){let t="";for(let e=0;e<i.length;e++)PR.has(i[e])||(t+="\\"),t+=i[e];return t}function rs(i,t,e,n){var r;i.format||(r=i.anyOf)!=null&&r.some(s=>s.format)?(i.anyOf||(i.anyOf=[]),i.format&&(i.anyOf.push({format:i.format,...i.errorMessage&&n.errorMessages&&{errorMessage:{format:i.errorMessage.format}}}),delete i.format,i.errorMessage&&(delete i.errorMessage.format,Object.keys(i.errorMessage).length===0&&delete i.errorMessage)),i.anyOf.push({format:t,...e&&n.errorMessages&&{errorMessage:{format:e}}})):ce(i,"format",t,e,n)}function mn(i,t,e,n){var r;i.pattern||(r=i.allOf)!=null&&r.some(s=>s.pattern)?(i.allOf||(i.allOf=[]),i.pattern&&(i.allOf.push({pattern:i.pattern,...i.errorMessage&&n.errorMessages&&{errorMessage:{pattern:i.errorMessage.pattern}}}),delete i.pattern,i.errorMessage&&(delete i.errorMessage.pattern,Object.keys(i.errorMessage).length===0&&delete i.errorMessage)),i.allOf.push({pattern:mS(t,n),...e&&n.errorMessages&&{errorMessage:{pattern:e}}})):ce(i,"pattern",mS(t,n),e,n)}function mS(i,t){var l;if(!t.applyRegexFlags||!i.flags)return i.source;const e={i:i.flags.includes("i"),m:i.flags.includes("m"),s:i.flags.includes("s")},n=e.i?i.source.toLowerCase():i.source;let r="",s=!1,o=!1,a=!1;for(let u=0;u<n.length;u++){if(s){r+=n[u],s=!1;continue}if(e.i){if(o){if(n[u].match(/[a-z]/)){a?(r+=n[u],r+=`${n[u-2]}-${n[u]}`.toUpperCase(),a=!1):n[u+1]==="-"&&((l=n[u+2])!=null&&l.match(/[a-z]/))?(r+=n[u],a=!0):r+=`${n[u]}${n[u].toUpperCase()}`;continue}}else if(n[u].match(/[a-z]/)){r+=`[${n[u]}${n[u].toUpperCase()}]`;continue}}if(e.m){if(n[u]==="^"){r+=`(^|(?<=[\r
469
469
  ]))`;continue}else if(n[u]==="$"){r+=`($|(?=[\r
470
470
  ]))`;continue}}if(e.s&&n[u]==="."){r+=o?`${n[u]}\r
471
471
  `:`[${n[u]}\r
package/dist/earthsdk3.js CHANGED
@@ -44,7 +44,7 @@ function Xd(r) {
44
44
  }
45
45
  let xl;
46
46
  try {
47
- const r = "earthsdk3", e = "3.11.0-beta.24", t = "2026-10-12T03:35:39.000Z", n = "北京西部世界科技有限公司", i = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", s = "8b50b1ea0534d1a7ba6f407cb2232148e22d52d2", a = ((Date.now() - 1791776139e3) / 36e5).toFixed(1), l = `%c🌏 ${r}%c ${e}.${s.slice(0, 8)}.${t} (距今${a}个小时)
47
+ const r = "earthsdk3", e = "3.11.0-beta.25", t = "2026-10-13T04:38:46.000Z", n = "北京西部世界科技有限公司", i = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", s = "5cbf78bb14dd689889ab418416a73d10082d2b19", a = ((Date.now() - 1791866326e3) / 36e5).toFixed(1), l = `%c🌏 ${r}%c ${e}.${s.slice(0, 8)}.${t} (距今${a}个小时)
48
48
  %c${i ? i + `
49
49
  ` : ""}当前网站正在使用${r},此软件版权归${n}所有
50
50
  `;
@@ -58,7 +58,7 @@ try {
58
58
  },
59
59
  // @ts-ignore
60
60
  get gituri() {
61
- return GITURI_ && GITURI_.replace("${commitId}", "8b50b1ea0534d1a7ba6f407cb2232148e22d52d2");
61
+ return GITURI_ && GITURI_.replace("${commitId}", "5cbf78bb14dd689889ab418416a73d10082d2b19");
62
62
  },
63
63
  // @ts-ignore
64
64
  get info() {
@@ -66,7 +66,7 @@ try {
66
66
  },
67
67
  // @ts-ignore
68
68
  get date() {
69
- return "2026-10-12T03:35:39.000Z";
69
+ return "2026-10-13T04:38:46.000Z";
70
70
  },
71
71
  // @ts-ignore
72
72
  get author() {
@@ -74,7 +74,7 @@ try {
74
74
  },
75
75
  // @ts-ignore
76
76
  get version() {
77
- return "3.11.0-beta.24";
77
+ return "3.11.0-beta.25";
78
78
  },
79
79
  // @ts-ignore
80
80
  get name() {
@@ -82,7 +82,7 @@ try {
82
82
  },
83
83
  // @ts-ignore
84
84
  get commitId() {
85
- return "8b50b1ea0534d1a7ba6f407cb2232148e22d52d2";
85
+ return "5cbf78bb14dd689889ab418416a73d10082d2b19";
86
86
  },
87
87
  /**
88
88
  * 打印版权信息到控制台
@@ -41110,7 +41110,7 @@ const is = class is extends kt {
41110
41110
  ...e.basic,
41111
41111
  new Ce([this, "data"], "数据", [], void 0, !0),
41112
41112
  new ft([this, "gradient"], "渐变", is.defaults.gradient, void 0, !0),
41113
- new N([this, "radius"], "半径", is.defaults.radius, void 0, !0),
41113
+ new N([this, "radius"], "半径", is.defaults.radius, void 0),
41114
41114
  new N([this, "blur"], "模糊", is.defaults.blur, !0),
41115
41115
  new G([this, "is3D"], "is3D", !1, !0)
41116
41116
  ]
@@ -1,7 +1,7 @@
1
- (function(m,tr){typeof exports=="object"&&typeof module<"u"?tr(exports,require("js-binary-schema-parser"),require("@turf/turf"),require("proj4"),require("topojson-client"),require("zod"),require("zod-to-json-schema")):typeof define=="function"&&define.amd?define(["exports","js-binary-schema-parser","@turf/turf","proj4","topojson-client","zod","zod-to-json-schema"],tr):(m=typeof globalThis<"u"?globalThis:m||self,tr(m.EarthSDK3={},m.jsBinarySchemaParser,m.turf,m.proj4,m.topojson,m.z$1,m.zodToJsonSchema))})(this,(function(m,tr,_a,sg,t0,pe,e0){"use strict";var jP=Object.defineProperty;var BP=(m,tr,_a)=>tr in m?jP(m,tr,{enumerable:!0,configurable:!0,writable:!0,value:_a}):m[tr]=_a;var h=(m,tr,_a)=>BP(m,typeof tr!="symbol"?tr+"":tr,_a);function og(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 At=og(_a),n0=og(t0);function r0(){var n;const r=((n=globalThis==null?void 0:globalThis.navigator)==null?void 0:n.userAgent)??"unknown";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 i0=Date.now();function ag(r){var a;const{os:e,arch:t}=r0(),n={version:r.version,commitdate:r.date,commitId:r.commitId,runningTime:(Date.now()-i0)/1e3/60|0,date:new Date().toLocaleString(),href:((a=globalThis==null?void 0:globalThis.location)==null?void 0:a.href)??"unknown",os:e,arch:t},s={method:"GET",headers:new Headers,redirect:"follow"},o=globalThis.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(l=>l.text()).then(l=>console.log(l)).catch(l=>console.log("error",l))}m.copyright=void 0;try{const r="earthsdk3",e="3.11.0-beta.24",t="2026-10-12T03:35:39.000Z",n="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="8b50b1ea0534d1a7ba6f407cb2232148e22d52d2",a=((Date.now()-1791776139e3)/36e5).toFixed(1),l=`%c🌏 ${r}%c ${e}.${s.slice(0,8)}.${t} (距今${a}个小时)
1
+ (function(m,tr){typeof exports=="object"&&typeof module<"u"?tr(exports,require("js-binary-schema-parser"),require("@turf/turf"),require("proj4"),require("topojson-client"),require("zod"),require("zod-to-json-schema")):typeof define=="function"&&define.amd?define(["exports","js-binary-schema-parser","@turf/turf","proj4","topojson-client","zod","zod-to-json-schema"],tr):(m=typeof globalThis<"u"?globalThis:m||self,tr(m.EarthSDK3={},m.jsBinarySchemaParser,m.turf,m.proj4,m.topojson,m.z$1,m.zodToJsonSchema))})(this,(function(m,tr,_a,sg,t0,pe,e0){"use strict";var jP=Object.defineProperty;var BP=(m,tr,_a)=>tr in m?jP(m,tr,{enumerable:!0,configurable:!0,writable:!0,value:_a}):m[tr]=_a;var h=(m,tr,_a)=>BP(m,typeof tr!="symbol"?tr+"":tr,_a);function og(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 At=og(_a),n0=og(t0);function r0(){var n;const r=((n=globalThis==null?void 0:globalThis.navigator)==null?void 0:n.userAgent)??"unknown";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 i0=Date.now();function ag(r){var a;const{os:e,arch:t}=r0(),n={version:r.version,commitdate:r.date,commitId:r.commitId,runningTime:(Date.now()-i0)/1e3/60|0,date:new Date().toLocaleString(),href:((a=globalThis==null?void 0:globalThis.location)==null?void 0:a.href)??"unknown",os:e,arch:t},s={method:"GET",headers:new Headers,redirect:"follow"},o=globalThis.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(l=>l.text()).then(l=>console.log(l)).catch(l=>console.log("error",l))}m.copyright=void 0;try{const r="earthsdk3",e="3.11.0-beta.25",t="2026-10-13T04:38:46.000Z",n="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="5cbf78bb14dd689889ab418416a73d10082d2b19",a=((Date.now()-1791866326e3)/36e5).toFixed(1),l=`%c🌏 ${r}%c ${e}.${s.slice(0,8)}.${t} (距今${a}个小时)
2
2
  %c${i?i+`
3
3
  `:""}当前网站正在使用${r},此软件版权归${n}所有
4
- `;m.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","8b50b1ea0534d1a7ba6f407cb2232148e22d52d2")},get info(){return l},get date(){return"2026-10-12T03:35:39.000Z"},get author(){return"suplyang"},get version(){return"3.11.0-beta.24"},get name(){return"earthsdk3"},get commitId(){return"8b50b1ea0534d1a7ba6f407cb2232148e22d52d2"},print(){console.info(this.info,`
4
+ `;m.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","5cbf78bb14dd689889ab418416a73d10082d2b19")},get info(){return l},get date(){return"2026-10-13T04:38:46.000Z"},get author(){return"suplyang"},get version(){return"3.11.0-beta.25"},get name(){return"earthsdk3"},get commitId(){return"5cbf78bb14dd689889ab418416a73d10082d2b19"},print(){console.info(this.info,`
5
5
  font-size: 18px;
6
6
  font-weight: 1000;
7
7
  line-height: 1;
@@ -462,7 +462,7 @@ timePosRots是一个内部包含三个元素的数组,第一个表示时间戳
462
462
  ${P_}
463
463
  \`\`\`
464
464
 
465
- `,Ap=Date.now(),es=class es extends ut{constructor(t){super(t);h(this,"_flyToEvent",this.disposeVar(new M));h(this,"_resetClockEvent",this.disposeVar(new M));this.ad(et([this,"uri"],[this,"url"]))}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 dt([this,"url"],"路径","${earthsdk3-assets-script-dir}/assets/misc/simple.czml",void 0,!0),new W([this,"clockEnabled"],"启用",!1),new N([this,"multiplier"],"倍速",es.defaults.multiplier),new W([this,"autoResetClock"],"自动设置时钟",!0),new Oi([this,"startTime"],"开始时间",es.defaults.startTime,!0),new Oi([this,"stopTime"],"结束时间",es.defaults.stopTime,!0),new Oi([this,"currentTime"],"当前时间",es.defaults.currentTime,!0),new rt([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep","SYSTEM_CLOCK_MULTIPLIER"),new rt([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange","UNBOUNDED"),new W([this,"shouldAnimate"],"是否启用动画",!1)],general:[...t.general,new W([this,"show"],"是否显示",!0),new W([this,"collision"],"开启碰撞",!1),new W([this,"allowPicking"],"允许拾取",!1)],more:[...t.more,new ct("飞入",n=>this.flyTo(n),[1e3],"flyTo"),new ct("重置时钟",()=>this.resetClock(),[],"resetClock"),new ls([this,"loadFuncStr"],"loadFnStr",P_,Ub,!0)]}}};h(es,"createDefaultProps",()=>({show:!0,uri:void 0,url:void 0,allowPicking:!1,autoResetClock:!0,clockEnabled:!1,startTime:Ap,stopTime:Ap+1440*60*1e3,currentTime:Ap,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...ut.createDefaultProps()})),h(es,"type",es.register("ESCzml",es,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"}));let kp=es;const jl=class jl extends ut{getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ht,new W([this,"show"],"是否显示"),new N([this,"cssSize"],"尺寸"),new Me([this,"cssPosition"],"位置"),new at([this,"imgUrl"],"图片地址")]}}};h(jl,"createDefaultProps",()=>({...ut.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:ut.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")})),h(jl,"type",jl.register("ESNavigator",jl,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"}));let Vp=jl;const ns=class ns extends ut{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ht("通用"),new W([this,"show"],"是否显示",ns.defaults.show),new N([this,"height"],"高度",ns.defaults.height,!0),new N([this,"fontSize"],"文字大小",ns.defaults.fontSize,!0),new bt([this,"bgColor"],"背景颜色",ns.defaults.bgColor,!0)]}}};h(ns,"createDefaultProps",()=>({...ut.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:tt([71/255,71/255,71/255,.8])})),h(ns,"type",ns.register("ESViewerStatusBar",ns,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let jp=ns;const rs=class rs extends ut{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ht("通用"),new W([this,"show"],"是否显示",rs.defaults.show),new N([this,"height"],"高度",rs.defaults.height,!0),new N([this,"fontSize"],"文字大小",rs.defaults.fontSize,!0),new bt([this,"bgColor"],"背景颜色",rs.defaults.bgColor,!0)]}}};h(rs,"createDefaultProps",()=>({...ut.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:tt([71/255,71/255,71/255,.8])})),h(rs,"type",rs.register("ESViewerStatusBarScale",rs,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let Bp=rs;const Bl=class Bl extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new at([this,"url"],"路径","",!0),new N([this,"progress"],"进度",0,!1,!0)]}}};h(Bl,"createDefaultProps",()=>({...st.createDefaultProps(),url:"",progress:0})),h(Bl,"type",Bl.register("ESGaussianSplatting",Bl,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"}));let zp=Bl;class Gb extends U{constructor(e,t){if(super(),!t)return;const n=this.ad(new Bt);n.stroked=!0,this.ad(e.components.disposableAdd(n)),this.ad(et([n,"points"],[e,"areaLiftingPoints"])),this.ad(n.editingChanged.don(()=>{n.editing||!this.isDestroyed()&&this.destroy()})),n.editing=!0}}var I_=(r=>(r[r.None=0]="None",r[r.Up=1]="Up",r[r.Down=2]="Down",r))(I_||{}),x_=(r=>(r[r.CLICK=0]="CLICK",r[r.MOVE=1]="MOVE",r))(x_||{}),T_=(r=>(r[r.Smooth=0]="Smooth",r[r.Linear=1]="Linear",r[r.Spherical=2]="Spherical",r[r.Tip=3]="Tip",r[r.Hard=4]="Hard",r))(T_||{});const $e=class $e extends st{constructor(t){super(t);h(this,"_startEvent",this.disposeVar(new M));h(this,"_configs",this.disposeVar(Xt(void 0)));h(this,"_heights",this.disposeVar(z({})));h(this,"_heightsEvent",this.ad(new M));h(this,"_areaLiftingUpdateEvent",this.disposeVar(new M));const n=this.ad(Se(this.modeChanged,this.startEvent));this.ad(new Ie(n,()=>{var i;if(this.areaLiftingPoints=void 0,this.mode=="areaLifting")return new Gb(this,this.activeViewer);(i=this.activeViewer)==null||i.startEditing(this,Z.BrushErase)}))}updateEditing(){var t;ah(this.position,[0,0,0])||(this.position=[0,0,0]),(t=this.activeViewer)==null||t.startEditing(this,Z.Place,{callSource:"inner"})}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get configs(){return this._configs.value}set configs(t){this._configs.value=t}get configsChanged(){return this._configs.changed}getConfig(...t){var n,i;if(typeof t[0]=="number")return(n=this.configs)==null?void 0:n.find(s=>s.x===t[0]&&s.y===t[1]);if(typeof t[0]=="string")return(i=this.configs)==null?void 0:i.find(s=>s.url===t[0])}get heights(){return this._heights.value}set heights(t){this._heights.value=t}get heightsChanged(){return this._heights.changed}get heightsEvent(){return this._heightsEvent}getHeights(){return new Promise((t,n)=>{const i=new U;i.ad(this._heightsEvent.don(o=>{o!=="start"&&(!i.isDestroyed()&&i.destroy(),t(o))})),this._heightsEvent.emit("start");const s=setTimeout(()=>{i.isDestroyed()||(i.destroy(),t(void 0))},2e3);i.ad(()=>clearTimeout(s))})}get areaLiftingUpdateEvent(){return this._areaLiftingUpdateEvent}areaLiftingUpdate(){this._areaLiftingUpdateEvent.emit()}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new ct("开始编辑",()=>{this.start()},[],"start"),new rt([this,"mode"],$e.modes,"编辑模式",$e.defaults.mode)],basic:[...t.basic,new dt([this,"url"],"URL"),new dt([this,"tileInfo"],"瓦片信息配置"),new N([this,"maxHeight"],"最大高度"),new N([this,"minHeight"],"最小高度"),new N([this,"offset"],"偏移"),new W([this,"autoLoadHeights"],"自动加载高度"),new ht("刷写设置"),new N([this,"brushEraseRadius"],"编辑半径"),new Me([this,"brushEraseRadiusRange"],"编辑半径范围",void 0,!0,!0),new rt([this,"brushEraseMode"],Object.entries(["CTRL","SHIFT","NONE"]),"刷写模式"),new rt([this,"brushErasePickReference"],$e.brushErasePickReferences,"选择参考"),new Di([this,"brushErasePosition"],"刷写位置"),new Di([this,"brushEraseStartPosition"],"刷写起始位置"),new rt([this,"brushEraseFalloff"],$e.brushEarseFalloffs,"刷写衰减函数"),new rt([this,"brushEraseRayDirection"],[["Up","Up"],["Down","Down"]],"刷写射线方向"),new ht("平整设置"),new rt([this,"flattenMode"],$e.flattenModes,"平整模式",0),new rt([this,"flattenPick"],$e.flattenPicks,"平整选择",0),new N([this,"flattenOffset"],"平整偏移",-.01),new ht("区域升降设置"),new ge([this,"areaLiftingPoints"],"区域升降位置",[]),new N([this,"areaLiftingOffset"],"区域升降偏移",1),new ct("区域升降更新",()=>{this.areaLiftingUpdate()},[],"areaLiftingUpdate"),new ht("围栏设置"),new ge([this,"fencePoints"],"围栏位置",[])]}}};h($e,"createDefaultProps",()=>({...st.createDefaultProps(),allowPicking:!0,url:"",maxHeight:0,minHeight:0,offset:.01,tileInfo:gt({tileCountX:65,tileCountY:65,tileMaximumLevel:15,tilesPerAxis:5,format:"heights"}),mode:z("sculpt"),autoLoadHeights:!1,brushEraseRadius:100,brushEraseRadiusRange:tt([0,100]),brushErasePosition:tt([0,0,0]),brushEraseStartPosition:tt([0,0,0]),brushEraseMode:z("NONE"),brushErasePickReference:z("NONE"),brushEraseRayDirection:z("Down"),brushEraseFalloff:z(4),flattenMode:z(0),flattenPick:z(1),flattenOffset:-.01,areaLiftingPoints:_o(void 0),areaLiftingOffset:1,fencePoints:_o(void 0),fenceMode:z("in")})),h($e,"modes",[["雕刻","sculpt"],["抹除","erase"],["平滑","smooth"],["平整","flatten"],["区域升降","areaLifting"]]),h($e,"brushErasePickReferences",[["无限制","NONE"],["地形图层","ESTerrainLayerEditing"],["3DTiles","ES3DTileset"]]),h($e,"flattenModes",[["None",0],["Up",1],["Down",2]]),h($e,"flattenPicks",[["CLICK",0],["MOVE",1]]),h($e,"brushEarseFalloffs",[["平滑",0],["线性",1],["硬边",4],["球形",2],["尖顶",3]]),h($e,"invalidValue",-1e4),h($e,"type",$e.register("ESTerrainLayerEditing",$e,{chsName:"地形图层编辑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于对地形数据进行编辑"})),h($e,"supportEditingModes",[...st.supportEditingModes,Z.Place,Z.BrushErase]);let Xu=$e;const Cr=class Cr extends St{constructor(t){super(t);h(this,"editingBindMode","doublePoints");h(this,"_startEvent",this.disposeVar(new M));h(this,"_replayEvent",this.disposeVar(new M));this.ad(this.startEvent.don(()=>{var n;(n=this.activeViewer)==null||n.startEditing(this,Z.BrushErase)}))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get replayEvent(){return this._replayEvent}replay(){this._replayEvent.emit()}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ct("开始编辑",()=>this.start(),[]),new ct("重播",()=>this.replay(),[]),new W([this,"showImage"],"显示影像",Cr.defaults.showImage),new N([this,"flowSpeed"],"流动速度",Cr.defaults.flowSpeed),new N([this,"gravity"],"重力加速度",Cr.defaults.gravity),new N([this,"strength"],"泥石流强度",Cr.defaults.strength),new N([this,"resistance"],"泥石流阻力(越大越快平息)",Cr.defaults.resistance),new N([this,"terrainOffset"],"地形高度偏移",Cr.defaults.terrainOffset),new ge([this,"slidePoints"],"滑坡点数组",St.defaults.slidePoints,void 0),new ht("刷写设置"),new N([this,"brushEraseRadius"],"编辑半径"),new Me([this,"brushEraseRadiusRange"],"编辑半径范围",void 0,!0,!0),new rt([this,"brushEraseMode"],Object.entries(["CTRL","SHIFT","NONE"]),"刷写模式"),new rt([this,"brushErasePickReference"],Xu.brushErasePickReferences,"选择参考"),new Di([this,"brushErasePosition"],"刷写位置"),new Di([this,"brushEraseStartPosition"],"刷写起始位置"),new rt([this,"brushEraseFalloff"],Xu.brushEarseFalloffs,"刷写衰减函数"),new rt([this,"brushEraseRayDirection"],[["Up","Up"],["Down","Down"]],"刷写射线方向")]}}};h(Cr,"createDefaultProps",()=>({...St.createDefaultProps(),brushEraseRadius:100,brushEraseRadiusRange:tt([0,1e3]),brushErasePosition:tt([0,0,0]),brushEraseStartPosition:tt([0,0,0]),brushEraseMode:z("NONE"),brushErasePickReference:z("NONE"),brushEraseRayDirection:z("Down"),terrainOffset:5,flowSpeed:1,gravity:9.8,slidePoints:tt([]),strength:1,showImage:!0,resistance:.98,stroked:!0,strokeStyle:gt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!0})})),h(Cr,"type",Cr.register("ESLandSlide",Cr,{chsName:"滑坡泥石流分析",tags:["ESObjects","_ES_Impl_Cesium"],description:"滑坡泥石流分析对象"})),h(Cr,"supportEditingModes",[...St.supportEditingModes,Z.DoublePoints,Z.DoublePointsAppend,Z.DoublePointsModify,Z.BrushErase]);let Up=Cr;const pa=class pa extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new at([this,"mesh"],"mesh地址",pa.defaults.mesh)]}}};h(pa,"createDefaultProps",()=>({...st.createDefaultProps(),mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"})),h(pa,"type",pa.register("ESStaticMesh",pa,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"}));let Gp=pa;const zl=class zl extends St{constructor(t){super(t);h(this,"_startEvent",this.dv(new M));h(this,"_clearEvent",this.dv(new M));h(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new Yo),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(A([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(A([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(A([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(A([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(A([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(A([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(A([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 ct("开始分析",()=>this.start(),[],"start"),new ct("清除分析",()=>this.clear(),[],"clear"),new ge([this,"windowPositions"],"屏幕坐标",[],void 0,!1,!0),new ge([this,"depths"],"深度值",[],void 0,!1,!0),new N([this,"radius"],"半径",1e4,!0)]}}};h(zl,"createDefaultProps",()=>({...St.createDefaultProps(),windowPositions:Pf([]),depths:Xt([]),radius:z(1e4)})),h(zl,"type",zl.register("ESSkylineAnalysis",zl,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"}));let Wp=zl;const Ds=class Ds extends kt{constructor(e){super(e)}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new ge([this,"data"],"数据",[],void 0,!0),new dt([this,"gradient"],"渐变",Ds.defaults.gradient,void 0,!0),new N([this,"radius"],"半径",Ds.defaults.radius,void 0,!0),new N([this,"blur"],"模糊",Ds.defaults.blur,!0),new W([this,"is3D"],"is3D",!1,!0)]}}};h(Ds,"createDefaultProps",()=>({...kt.createDefaultProps(),is3D:z(!1),data:_o([]),gradient:Kt({".5":"green",".7":"yellow",".95":"red"}),radius:z(10),blur:z(.85)})),h(Ds,"type",Ds.register("ESHeatMap",Ds,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"}));let xh=Ds;const ga=class ga extends St{constructor(t){super(t);h(this,"editingBindMode","scatter")}};h(ga,"createDefaultProps",()=>({...St.createDefaultProps(),pointed:!0})),h(ga,"type",ga.register("ESGeoPoints",ga,{chsName:"地理点集合",tags:["ESObjects","_ES_Impl_Cesium"],description:"地图中的可视化地理点集合"})),h(ga,"supportEditingModes",[...St.supportEditingModes,Z.ScatterAppend,Z.ScatterModify]);let Yu=ga;const O_=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 l=>{let u=l[2]??0;if(t)if(t.type==="absolute")u=t.height??u;else if(t.type==="relative"){const c=await r.getTerrainHeight([l[0],l[1]])??0;u=(t.height??u)+c}else t.type==="terrain"&&(u=await r.getTerrainHeight([l[0],l[1]])??0);return[l[0],l[1],u]}));n.push({...i,points:a})}}return n},D_=async(r,e=[],t)=>await Promise.all(e.map(async n=>{var l,u,c,d,f,p,_,S,b;const i=((l=n.geometry)==null?void 0:l.x)??((c=(u=n.geometry)==null?void 0:u.coordinates)==null?void 0:c[0]),s=((d=n.geometry)==null?void 0:d.y)??((p=(f=n.geometry)==null?void 0:f.coordinates)==null?void 0:p[1]);let a=((_=n.geometry)==null?void 0:_.z)??((b=(S=n.geometry)==null?void 0:S.coordinates)==null?void 0:b[2])??0;if(t)if(t.type==="absolute")a=t.height??a;else if(t.type==="relative"){const I=await r.getTerrainHeight([i,s])??0;a=(t.height??a)+I}else t.type==="terrain"&&(a=await r.getTerrainHeight([i,s])??0);return{...n,points:[i,s,a]}})),N_=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 l=>{let u=l[2]??0;if(t)if(t.type==="absolute")u=t.height??u;else if(t.type==="relative"){const c=await r.getTerrainHeight([l[0],l[1]])??0;u=(t.height??u)+c}else t.type==="terrain"&&(u=await r.getTerrainHeight([l[0],l[1]])??0);return[l[0],l[1],u]}));n.push({...i,points:a})}))})),n};function Wb(r){const e=At.lineString(r),t=At.length(e),n=At.along(e,t/2);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function Hb(r,e){const t=At.lineString(r),n=At.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=At.along(t,n*(o/i));s.push([a.geometry.coordinates[0],a.geometry.coordinates[1],a.geometry.coordinates[2]||0])}return s}function qb(r){const e=[...r];JSON.stringify(r[0])!==JSON.stringify(r[r.length-1])&&e.push(r[0]);const t=At.polygon([e]),n=At.center(t);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function M_(r,e,t){const n=r.dv(new ll);for(const i in t)i!=="type"&&(n[i]=t[i]);n.position=e,r.d(r.components.disposableAdd(n))}function Hp(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 d=c[1].trim(),f=t[`${d}`]||"-";i=i.replace(c[0],f)}}let o=n.symbol;const{minVisibleDistance:a,maxVisibleDistance:l}=n;a&&l&&(o={...o,minVisibleDistance:a,maxVisibleDistance:l});const u={...o,text:i};M_(r,e,u)}function dl(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 qp(r,e,t){const i={...e.symbol};if(t&&t.length>0){const s=dl(r,t);for(let o in s)i[o]!==void 0&&s[o]!==null&&(i[o]=s[o])}return i}function Xp(r,e,t){var u,c;const n=e,{uniqueValueInfos:i,field:s,fieldDelimiter:o,defaultSymbol:a}=n;let l={...a};if(Array.isArray(s)){const f=s.map(p=>r[p]??"").join(o);l=((u=i.find(p=>p.value==f))==null?void 0:u.symbol)||a}else l=((c=i.find(d=>d.value==r[s]))==null?void 0:c.symbol)||a;if(t&&t.length>0){const d=dl(r,t);for(let f in d)l[f]!==void 0&&d[f]!==null&&(l[f]=d[f])}return l}function Yp(r,e,t){const n=e,{classBreakInfos:i,field:s,defaultSymbol:o}=n;let a=o;const l=r[s];if(l===void 0||typeof l!="number")a=o;else{const u=i.find(c=>l<=c.maxValue&&l>=c.minValue);u?a=u.symbol:a=o}if(t&&t.length>0){const u=dl(r,t);for(let c in u)a[c]!==void 0&&u[c]!==null&&(a[c]=u[c])}return a}function Xb(r,e){function t(u,c,d,f){const p=y=>y*Math.PI/180,_=y=>y*180/Math.PI,S=p(u),b=p(d),I=p(f-c),v=Math.sin(I)*Math.cos(b),w=Math.cos(S)*Math.sin(b)-Math.sin(S)*Math.cos(b)*Math.cos(I),g=Math.atan2(v,w);return(_(g)+360)%360}function n(u,c,d,f,p){const S=C=>C*Math.PI/180,b=C=>C*180/Math.PI,I=f/6371e3,v=S(p),w=S(u),g=S(c),y=Math.asin(Math.sin(w)*Math.cos(I)+Math.cos(w)*Math.sin(I)*Math.cos(v)),E=g+Math.atan2(Math.sin(v)*Math.sin(I)*Math.cos(w),Math.cos(I)-Math.sin(w)*Math.sin(y));return{lat:b(y),lng:b(E),alt:d}}function i(u){const c=[];u.length>1&&c.push(t(u[0].lat,u[0].lng,u[1].lat,u[1].lng));for(let d=1;d<u.length-1;d++){const f=t(u[d-1].lat,u[d-1].lng,u[d].lat,u[d].lng),p=t(u[d].lat,u[d].lng,u[d+1].lat,u[d+1].lng);let _=(f+p)/2;Math.abs(f-p)>180&&(_=(_+180)%360),c.push(_)}return u.length>1&&c.push(t(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(!r||r.length<2)throw new Error("至少需要两个点才能生成路径");if(e<=0)throw new Error("宽度必须大于0");const s=e/2,o=i(r),a=[],l=[];for(let u=0;u<r.length;u++){const c=(o[u]+90)%360,d=(o[u]+270)%360,f=r[u].alt!==void 0?r[u].alt:0;a.push(n(r[u].lat,r[u].lng,f,s,c)),l.push(n(r[u].lat,r[u].lng,f,s,d))}return a.concat(l.reverse())}function Yb(r,e,t,n){function i(S){return S*(Math.PI/180)}const s=6378137,o=i(r),a=i(e),l=i(t),u=i(n),c=l-o,d=u-a,f=Math.sin(c/2)**2+Math.cos(o)*Math.cos(l)*Math.sin(d/2)**2,p=2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f));return s*p}const R_=(r,e,t)=>Array.isArray(e)?e.map(s=>r[s]??"").join(t):r[e]??"";function L_(r,e){const n={...e.symbol};return{points:r.map(i=>i.points),symbol:n}}function F_(r,e){const t=e,{uniqueValueInfos:n,field:i,fieldDelimiter:s,defaultSymbol:o}=t,a=[],l=n.reduce((c,d)=>{const f=d.value.toString();return c[f]={points:[],value:d.value,symbol:d.symbol},c},{});for(let c=0;c<r.length;c++){const d=r[c],f=R_(d,i,s);if(f!==void 0&&f!==""){const p=l[f.toString()];p?p.points.push(d.points):a.push(d.points)}else a.push(d.points)}const u=[];for(let c in l){const{points:d,symbol:f}=l[c];d.length>0&&u.push({points:d,symbol:f})}return a.length>0&&u.push({points:a,symbol:o}),u}function A_(r,e){const t=e,{classBreakInfos:n,field:i,defaultSymbol:s}=t,o=[],a=n.map(u=>({...u,points:[]}));for(let u=0;u<r.length;u++){const c=r[u],d=c[i];if(d===void 0||typeof d!="number")o.push(c.points);else{const f=a.findIndex(p=>d<=p.maxValue&&d>=p.minValue);f!==-1?a[f].points.push(c.points):o.push(c.points)}}const l=[];return a.forEach(u=>{u.points.length>0&&l.push({points:u.points,symbol:u.symbol})}),o.length>0&&l.push({points:o,symbol:s}),l}function Jb(r,e,t=[]){const i={...e.symbol},s=r.map(o=>{const a=dl(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 $b(r,e,t=[]){const n=e,{uniqueValueInfos:i,field:s,fieldDelimiter:o}=n,a=n.defaultSymbol,l=[],u=i.reduce((d,f)=>{const p=f.value.toString();return d[p]={locations:[],value:f.value,symbol:f.symbol},d},{});for(let d=0;d<r.length;d++){const f=r[d],p=R_(f,s,o);if(p){const _=u[p.toString()];if(_){const S=dl(f,t);_.locations.push({position:f.points,rotation:S.rotation||a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else l.push({position:f.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else l.push({position:f.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}const c=[];for(let d in u){const{locations:f,symbol:p}=u[d];f.length>0&&c.push({url:p.url,locations:f})}return l.length>0&&c.push({url:a.url,locations:l}),c}function Kb(r,e,t=[]){const n=e,{classBreakInfos:i,field:s}=n,o=n.defaultSymbol,a=[],l=i.map(c=>({...c,locations:[]}));for(let c=0;c<r.length;c++){const d=r[c],f=d[s];if(f===void 0||typeof f!="number")a.push({position:d.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]});else{const p=l.findIndex(_=>f<=_.maxValue&&f>=_.minValue);if(p!==-1){const _=dl(d,t);l[p].locations.push({position:d.points,rotation:_.rotation||o.rotation||[0,0,0],scale:l[p].symbol.scale||[1,1,1]})}else a.push({position:d.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]})}}const u=[];return l.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 Zb extends U{constructor(t,n,i,s){super();h(this,"labelingInfo");this.sceneObject=t;const o=n;if(s&&xi(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 l=L_(o,i);this._simplePointAllRender(l.points,l.symbol);return}if(i.symbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!");const l=L_(o,i);this._imageAllRender(l.points,l.symbol);return}if(i.symbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!");const{url:l,locations:u}=Jb(o,i,a);this._modelAllRender(l,u);return}for(let l=0;l<o.length;l++){const u=qp(o[l],i,a);this.render(o[l],u)}}else if(i.type==="unique-value"){const{visualVariables:a}=i;if(i.uniqueValueInfos.findIndex(d=>d.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),F_(o,i).forEach(({points:f,symbol:p})=>{this._simplePointAllRender(f,p)});return}if(i.uniqueValueInfos.findIndex(d=>d.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),F_(o,i).forEach(({points:f,symbol:p})=>{this._imageAllRender(f,p)});return}if(i.uniqueValueInfos.findIndex(d=>d.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),$b(o,i,a).forEach(({url:f,locations:p})=>{this._modelAllRender(f,p)});return}for(let d=0;d<o.length;d++){const f=Xp(o[d],i,a);this.render(o[d],f)}}else if(i.type==="class-breaks"){const{visualVariables:a}=i;if(i.classBreakInfos.findIndex(d=>d.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),A_(o,i).forEach(({points:f,symbol:p})=>{this._simplePointAllRender(f,p)});return}if(i.classBreakInfos.findIndex(d=>d.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),A_(o,i).forEach(({points:f,symbol:p})=>{this._imageAllRender(f,p)});return}if(i.classBreakInfos.findIndex(d=>d.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),Kb(o,i,a).forEach(({url:f,locations:p})=>{this._modelAllRender(f,p)});return}for(let d=0;d<o.length;d++){const f=Yp(o[d],i,a);this.render(o[d],f)}}else if(i.type==="heatmap"){const{field:a,fieldValueMax:l,fieldValueMin:u}=i;console.time();const c=o.map(d=>{const{points:f}=d;if(a&&typeof a=="string"){let p=d[a];typeof p=="number"&&(typeof l=="number"&&p>l&&(p=l),typeof u=="number"&&p<u&&(p=u),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;Hp(this.sceneObject,i,t,n)}renderHeatmap(t,n){const{is3D:i,radius:s,blur:o,gradient:a}=n,l=this.dv(new xh);this.d(this.sceneObject.components.disposableAdd(l)),l.is3D=i,l.radius=s,l.blur=o,a&&(l.gradient={...a}),l.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"?M_(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:l}=n,u=this.dv(new Yu);this.d(this.sceneObject.components.disposableAdd(u)),u.pointed=!0,u.pointOutlineColor=a,u.pointOutlineWidth=l,u.pointSize=s,u.pointColor=o,u.allowPicking=(n==null?void 0:n.allowPicking)??!0,u.extras={selected:!1},u.points=[i]}_simplePointAllRender(t,n){const{size:i,color:s,outlineColor:o,outlineWidth:a}=n,l=this.dv(new Yu);this.d(this.sceneObject.components.disposableAdd(l)),l.pointed=!0,l.pointOutlineColor=o,l.pointOutlineWidth=a,l.pointSize=i,l.pointColor=s,l.allowPicking=(n==null?void 0:n.allowPicking)??!0,l.points=[...t]}_simpleImageRender(t,n){const{points:i}=t,{rotation:s,offset:o,size:a,url:l,screenRender:u,anchor:c,renderMode:d,rotationType:f}=n,p=this.dv(new vh),_=this.dv(new ll);this.d(this.sceneObject.components.disposableAdd(p)),this.d(this.sceneObject.components.disposableAdd(_)),p.url=l,p.renderMode=d??0,s&&(p.rotation=s),o&&(p.offset=o),p.size=a||[32,32],c&&(p.anchor=c),f&&(p.rotationType=f),p.screenRender=u??!0,p.allowPicking=(n==null?void 0:n.allowPicking)??!0,p.extras={selected:!1},p.position=[...i],p.sizeByContent=!1,_.allowPicking=(n==null?void 0:n.allowPicking)??!0;const S=a?Math.max(...a)+10:Math.max(...p.size)+10;_.sizeByContent=!1,_.screenRender=!0,_.size=[S,S],_.borderRadius=[S,S,S,S],_.padding=[S/2,S/2,S/2,S/2],_.borderWidth=S/10,_.offset=[0,S/10+5],_.text="",_.backgroundColor=[0,0,0,0],_.borderColor=[0,0,0,0]}_imageAllRender(t,n){const i={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:t}}]},s=this.dv(new Wu);this.d(this.sceneObject.components.disposableAdd(s));const o=this.dv(new ll);this.d(this.sceneObject.components.disposableAdd(o)),s.textDefaultText="";const{offset:a,size:l,url:u,anchor:c}=n;s.imageUrl=u,c&&(s.imageAnchor=c),a&&(s.imageOffset=a),s.imageSize=l||[32,32],s.url=i,s.allowPicking=(n==null?void 0:n.allowPicking)??!0,s.extras={selected:!1},o.allowPicking=!0;const d=l?Math.max(...l)+10:Math.max(...s.imageSize)+10;o.sizeByContent=!1,o.size=[d,d],o.borderRadius=[d,d,d,d],o.padding=[d/2,d/2,d/2,d/2],o.borderWidth=d/10,o.offset=[0,d/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,l=this.dv(new qi);this.d(this.sceneObject.components.disposableAdd(l)),l.url=a,s&&(l.rotation=s),o&&(l.scale=o),l.position=[...i]}_modelAllRender(t,n){const i=this.dv(new qi);this.d(this.sceneObject.components.disposableAdd(i)),i.url=t,i.instances=n}_simpleParticleRender(t,n){const{points:i}=t,s=this.dv(new yh);this.d(this.sceneObject.components.disposableAdd(s)),s.position=[...i],Object.keys(n).forEach(o=>{s[o]=n[o]})}}class Qb extends U{constructor(e,t,n,i){super(),this.sceneObject=e;const s=t;if(i&&xi(s,o=>{this.renderLabel(o,i)}),n)if(n.type==="simple"){const{visualVariables:o}=n;xi(s,a=>{const l=qp(a,n,o);this.render(a,l)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;xi(s,a=>{const l=Xp(a,n,o);this.render(a,l)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;xi(s,a=>{const l=Yp(a,n,o);this.render(a,l)})}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 fn);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 Ch);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 Eh);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 hl),s=this.dv(new cl);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,l=t==null?void 0:t.modelSymbol;let u;switch(t==null?void 0:t.runModel){case"ESHuman":u=this.dv(new vr);break;case"ESCar":u=this.dv(new fh);break;case"ESGltfModel":u=this.dv(new qi)}if(this.d(this.sceneObject.components.disposableAdd(u)),l)for(let d in l)u[d]=l[d];const c=[0];for(var o=0;o<n.length-1;o+=1){const d=n[o],f=n[o+1],p=Yb(d[1],d[0],f[1],f[0]);c.push(c[o]+Math.ceil(p/a)*1e3)}i.timeStamps=c,t!=null&&t.runSpeed&&(i.currentPositionChanged.don(d=>{i.currentPosition&&(u.position=i.currentPosition,i.currentRotation&&(u.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(d=>{i.path.currentTime=d}))}}_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=Hb(n,i/1e3),o=this.dv(new qi);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})),l=Xb(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 Yo);this.d(this.sceneObject.components.disposableAdd(u)),u.height=i,u.extrudedHeight=o,u.filled=t.filled??!0,u.fillColor=t.fillColor,u.allowPicking=(t==null?void 0:t.allowPicking)??!0,u.extras={selected:!1},u.points=l}renderLabel(e,t){const{points:n}=e,i=Wb(n);Hp(this.sceneObject,i,e,t)}}function k_(r,e){try{JSON.stringify(r[r.length-1])!==JSON.stringify(r[0])&&r.push(r[0]);const t=At.featureCollection(r.map(l=>At.point(l))),n=At.polygon([r]),i={gridType:"point",units:"meters"};return At.interpolate(t,e,i).features.map(l=>l.geometry.coordinates)[0][0].filter(l=>At.booleanPointInPolygon(At.point(l),n))}catch(t){return console.error(t),[]}}class tP extends U{constructor(e,t,n,i){super(),this.sceneObject=e;const s=t;if(i&&xi(s,o=>{this.renderLabel(o,i)}),n)if(n.type==="simple"){const{visualVariables:o}=n;xi(s,a=>{const l=qp(a,n,o);this.render(a,l)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;xi(s,a=>{const l=Xp(a,n,o);this.render(a,l)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;xi(s,a=>{const l=Yp(a,n,o);this.render(a,l)})}else console.error("PolyLineLayer: renderer type is not supported")}renderLabel(e,t){const{points:n}=e;console.log("PolygonLayer: renderLabel",n);const i=qb(n);Hp(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:l,color:u,stroked:c}=s,d=this.dv(new Bt);this.d(this.sceneObject.components.disposableAdd(d)),d.stroked=c??!1,d.strokeColor=u??[1,1,1,1],d.strokeWidth=l??1,d.filled=o??!0,d.fillGround=a??!1,d.fillColor=i??[1,1,1,1],d.allowPicking=(t==null?void 0:t.allowPicking)??!0,d.extras={selected:!1},d.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 Yo);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:l}=t,u=k_(n,s??10),c=this.dv(new qi);this.d(this.sceneObject.components.disposableAdd(c)),c.url=o,c.instances=u.map(d=>({position:[...d,i??0],rotation:a??[0,0,0],scale:l??[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:l,anchor:u}=t,d={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:[...k_(n,s??10).map(p=>[...p,i??0])]}}]},f=this.dv(new Wu);this.d(this.sceneObject.components.disposableAdd(f)),f.textDefaultText="",f.imageUrl=l,u&&(f.imageAnchor=u),o&&(f.imageOffset=o),a&&(f.imageSize=a),f.url=d}}class eP extends U{constructor(t,n){super();h(this,"_initEvent",this.dv(new M));const i=this,s=async()=>{try{const a=t.featureProps;if(!a)return;const{heightMode:l,features:u,layerType:c,url:d}=a;let f=[];if(!u&&d){let p=await fetch(d).then(_=>_.json());return p=(p==null?void 0:p.features)??p,c==="polylineVector"?f=await O_(n,p,l):c==="polygonVector"?f=await N_(n,p,l):c==="pointVector"&&(f=await D_(n,p,l)),f}else c==="polylineVector"?f=await O_(n,u,l):c==="polygonVector"?f=await N_(n,u,l):c==="pointVector"&&(f=await D_(n,u,l));return f}catch(a){console.error(a);return}},o=this.dv(Se(this._initEvent,t.featurePropsChanged));i.dv(new Ie(o,()=>{if(!t.featureProps)return;const a=t.featureProps;let l;return(async()=>{const{layerType:c,renderer:d,labelingInfo:f}=a,p=await s();!p||p.length===0||(c==="pointVector"?l=new Zb(t,p,d,f):c==="polylineVector"?l=new Qb(t,p,d,f):c==="polygonVector"&&(l=new tP(t,p,d,f)),console.log("polygonVectorLayer","createLayer",l))})().catch(console.error),{destroy:()=>{var c;(c=l==null?void 0:l.destroy)==null||c.call(l),l=void 0}}}));{const a=(l,u=1)=>{const c=ky(l);if(!c)return;const{center:d,radius:f}=c;n.flyTo({distance:f*4,heading:0,pitch:-90,flyDuration:u??1,hDelta:0,pDelta:0},d)};i.d(t.flyToEvent.don(async l=>{const{featureProps:u}=t;if(!u)return;const c=await s();if(!c)return;let d=[];u.layerType==="polylineVector"?d=c.map(f=>f.points).flat():u.layerType==="polygonVector"?d=c.map(f=>f.points).flat():u.layerType==="pointVector"&&(d=c.map(f=>f.points)),d.length!==0&&a(d,l)}))}}init(){this._initEvent.emit()}}const Ul=class Ul extends kt{constructor(t){super(t);h(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 eP(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(Ne(n.showChanged,()=>{for(const i of n.components.values())Reflect.has(i,"show")&&(i.show=n.show)},{immediate:!0}))}};h(Ul,"createDefaultProps",()=>({...kt.createDefaultProps(),featureProps:Kt(void 0)})),h(Ul,"type",Ul.register("ESFeatureLayer",Ul,{chsName:"矢量图层",tags:["ESObjects"],description:"ESFeatureLayer"}));let Jp=Ul;const nP=[["256",256],["512",512],["1024",1024]],rP=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],Qn=class Qn extends kt{constructor(t){super(t);h(this,"_pickFeaturesEvent",this.dv(new M));this.ad(et([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(et([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new at([this,"accessToken"],"令牌",Qn.defaults.accessToken),new Sr([this,"rectangle"],"矩形范围",Qn.defaults.rectangle),new dt([this,"url"],"服务地址",Qn.defaults.url),new dt([this,"style"],"样式配置",Qn.defaults.style),new N([this,"zIndex"],"层级序号",Qn.defaults.zIndex),new rt([this,"tileSize"],nP,"瓦片大小",256),new Re([this,"maximumLevel"],1,[1,24],"最大层级",Qn.defaults.maximumLevel),new Re([this,"minimumLevel"],1,[0,24],"最小层级",Qn.defaults.minimumLevel),new rt([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像切片规则",Qn.defaults.scheme),new rt([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考"),new at([this,"targetID"],"targetID")],more:[...t.more,new ht("通用"),new rt([this,"splitDirection"],rP,"splitDirection","NONE"),new ht("czm"),new N([this,"czmAlpha"],"透明度"),new N([this,"czmBrightness"],"亮度"),new N([this,"czmContrast"],"对比度"),new N([this,"czmHue"],"色相"),new N([this,"czmSaturation"],"饱和度"),new N([this,"czmGamma"],"伽马值")]}}};h(Qn,"createDefaultProps",()=>({...kt.createDefaultProps(),rectangle:Kt([-180,-90,180,90]),url:gt(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:Xt([]),scheme:z("xyz"),czmSplitDirection:"NONE",heightReference:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",targetID:"",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),h(Qn,"type",Qn.register("ESMVTLayer",Qn,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"用于加载矢量瓦片图层。"}));let $p=Qn;const is=class is extends st{constructor(e){super(e)}getESProperties(){return{...{...super.getESProperties()},basic:[new N([this,"radius"],"半径",is.defaults.radius),new N([this,"height"],"高度",is.defaults.height),new bt([this,"color"],"颜色",is.defaults.color),new dt([this,"materialParams"],"材质参数",is.defaults.materialParams)]}}};h(is,"createDefaultProps",()=>({...st.createDefaultProps(),radius:2,height:10,color:tt([.204,.596,.859,1]),materialParams:gt({ringSpeed:1,ringColor:[1,1,1,1],ringWidth:.03,sides:10,ringRatio:1,ringRepeat:1,ringBottomMove:!1})})),h(is,"type",is.register("ESCylinder",is,{chsName:"圆柱",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"圆柱体"}));let Jo=is;const Pi=class Pi extends Uu{constructor(e){super(e)}getESProperties(){const e=super.getESProperties();return{...e,dataSource:[...e.dataSource,new rt([this,"videoStreamType"],Pi.videoStreamTypes,"数据源类型",Pi.defaults.videoStreamType),new W([this,"looping"],"循环播放",Pi.defaults.looping),new W([this,"play"],"播放状态",Pi.defaults.play)]}}};h(Pi,"createDefaultProps",()=>({...Uu.createDefaultProps(),videoStreamType:"video",looping:!0,play:!0})),h(Pi,"type",Pi.register("ESMediaLayer",Pi,{chsName:"媒体图层",tags:["ESObjects","_ES_Impl_Cesium"],description:"用于添加数据源为图片或者视频的图层"})),h(Pi,"videoStreamTypes",[["video","video"],["hls","hls"],["flv","flv"],["img","img"]]);let Kp=Pi;const ss=class ss extends kt{constructor(t){super(t);h(this,"_getRepairPolygonEvent",this.disposeVar(new M));h(this,"_getIndicesEvent",this.disposeVar(new M));h(this,"_startEvent",this.disposeVar(new M))}getESProperties(){return{...{...super.getESProperties()},defaultMenu:"general",basic:[new dt([this,"urls"],"URL",ss.defaults.urls),new rt([this,"mode"],ss.modes,"模式",ss.defaults.mode),new ct("开始编辑",()=>this.start(),[])]}}get getRepairPolygonEvent(){return this._getRepairPolygonEvent}getRepairPolygon(){return new Promise((t,n)=>{const i=new U;i.ad(this._getRepairPolygonEvent.don(o=>{o!="get"&&t(o)})),this.getRepairPolygonEvent.emit("get");const s=setTimeout(()=>{i.isDestroyed()||(i.destroy(),t(void 0))},2e3);i.ad(()=>clearTimeout(s))})}get getIndicesEvent(){return this._getIndicesEvent}getIndices(){return new Promise((t,n)=>{const i=new U;i.ad(this._getIndicesEvent.don(o=>{o!="get"&&t(o)})),this.getIndicesEvent.emit("get");const s=setTimeout(()=>{i.isDestroyed()||(i.destroy(),t(void 0))},2e3);i.ad(()=>clearTimeout(s))})}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}};h(ss,"createDefaultProps",()=>({...kt.createDefaultProps(),urls:Xt([]),mode:"repair",allowPicking:!0})),h(ss,"type",ss.register("ESGltfModelEditing",ss,{chsName:"GLTF模型编辑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载GLTF模型的 ES 对象"})),h(ss,"modes",[["删除","delete"],["修复","repair"]]);let Zp=ss;const mo=class mo extends vr{constructor(t){super(t);h(this,"humans",[]);h(this,"humansOffset",new Map);this.ad(this.clear.bind(this)),this.updateHumans();const n=this.ad(Se(this.instancesCountChanged,this.radiusChanged));this.ad(n.don(this.updateHumans.bind(this)))}getESProperties(){const t=super.getESProperties();return{...t,basic:[...t.basic,new N([this,"instancesCount"],"实例数量",1,mo.defaults.instancesCount),new N([this,"radius"],"半径",1,mo.defaults.radius)]}}updateHumans(){for(this.clear();this.humans.length+1<this.instancesCount;){const t=new vr;this.humansOffset.set(t.id,[Math.random()*this.radius,Math.random()*this.radius,0]),this.humans.push(t),this.components.add(t),t.d(A([t,"show"],[this,"show"])),t.d(A([t,"allowPicking"],[this,"allowPicking"])),t.d(A([t,"scale"],[this,"scale"])),t.d(A([t,"collision"],[this,"collision"])),t.d(et([t,"flyInParam"],[this,"flyInParam"])),t.d(et([t,"flyToParam"],[this,"flyToParam"])),t.d(A([t,"animation"],[this,"animation"])),t.d(A([t,"mode"],[this,"mode"])),t.d(A([t,"minVisibleDistance"],[this,"minVisibleDistance"])),t.d(A([t,"maxVisibleDistance"],[this,"maxVisibleDistance"])),t.d(Ne([this.positionChanged],()=>{const n=Vd(this.position,this.humansOffset.get(t.id)??[0,0,0]);n&&(t.position=n)},{immediate:!0})),t.d(et([t,"rotation"],[this,"rotation"])),t.d(this.flyInEvent.don(n=>{t.flyIn(n)})),t.d(this.flyToEvent.don(n=>{t.flyTo(n)})),t.d(this.calcFlyToParamEvent.don(()=>{t.calcFlyToParam()})),t.d(this.calcFlyInParamEvent.don(()=>{t.calcFlyInParam()})),t.d(this.smoothMoveEvent.don((n,i)=>{t.smoothMove(n,i)})),t.d(this.smoothMoveWithRotationEvent.don((n,i,s)=>{t.smoothMoveWithRotation(n,i,s)})),t.d(this.smoothMoveOnGroundEvent.don((n,i,s,o)=>{t.smoothMoveOnGround(n,i,s,o)})),t.d(this.smoothMoveWithRotationOnGroundEvent.don((n,i,s,o,a)=>{t.smoothMoveWithRotationOnGround(n,i,s,o,a)})),t.d(this.automaticLandingEvent.don(()=>{t.automaticLanding()})),t.d(t.readyEvent.don(n=>{this.readyEvent.emit(n)}))}}clear(){this.humans.forEach(t=>{this.components.delete(t)}),this.humans=[],this.humansOffset.clear()}};h(mo,"createDefaultProps",()=>({...vr.createDefaultProps(),instancesCount:1,radius:1})),h(mo,"type",mo.register("ESHumans",mo,{chsName:"人员(批量)",tags:["ESObjects"],description:"批量创建ESHumans对象"}));let Qp=mo;const ma=class ma extends fn{constructor(t){super(t);h(this,"_line",this.ad(new fn));h(this,"_arrowPolygon",this.ad(new Bt));this.ad(this.components.disposableAdd(this.line,!0)),this.line.show=!1,this.ad(this.components.disposableAdd(this.arrowPolygon));const{line:n,arrowPolygon:i}=this;this.ad(et([n,"points"],[this,"points"])),this.ad(Ne([this.pointsChanged,this.modeChanged],()=>{this.updateArrowPolygon()},{immediate:!0})),this.ad(A([i,"show"],[this,"show"])),this.ad(A([i,"collision"],[this,"collision"])),this.ad(A([i,"allowPicking"],[this,"allowPicking"])),this.ad(A([i,"filled"],[this,"filled"])),this.ad(A([i,"fillGround"],[this,"fillGround"])),this.ad(A([i,"fillColor"],[this,"fillColor"])),this.ad(A([i,"fillMaterial"],[this,"fillMaterial"])),this.ad(A([i,"fillMaterialParams"],[this,"fillMaterialParams"])),this.ad(A([i,"stroked"],[this,"stroked"])),this.ad(A([i,"strokeGround"],[this,"strokeGround"])),this.ad(A([i,"strokeColor"],[this,"strokeColor"])),this.ad(A([i,"strokeMaterial"],[this,"strokeMaterial"])),this.ad(A([i,"strokeMaterialParams"],[this,"strokeMaterialParams"])),this.ad(A([i,"strokeWidth"],[this,"strokeWidth"])),this.ad(A([i,"strokeWidthType"],[this,"strokeWidthType"])),this.ad(A([i,"classificationType"],[this,"classificationType"]))}get line(){return this._line}get arrowPolygon(){return this._arrowPolygon}getESProperties(){const t={...super.getESProperties()};return{...t,style:[...t.style,new rt([this,"mode"],bd,"箭头模式",ma.defaults.mode)]}}updateArrowPolygon(){const t=this.points;if(!t||t.length<3){this._arrowPolygon.points=[];return}let n=Tf(t,this.mode,!0);n&&n.length>=3?this._arrowPolygon.points=[...n,n[0]]:this._arrowPolygon.points=[]}};h(ma,"createDefaultProps",()=>({...fn.createDefaultProps(),mode:"straightArrow",stroked:!1,filled:!0,fillStyle:gt({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),h(ma,"type",ma.register("ESAttackArrow",ma,{chsName:"进攻箭头",tags:["ESObjects","_ES_Impl_Cesium"],description:"进攻箭头,军事标绘箭头类,支持直箭头和燕尾箭头"}));let tg=ma;const va=class va extends qi{constructor(t){super(t);h(this,"esCylinder",this.dv(new Jo));const n=this.esCylinder;n.color=[1,1,1,0],this.ad(this.components.disposableAdd(this.esCylinder)),this.ad(A([n,"show"],[this,"show"])),this.ad(A([n,"collision"],[this,"collision"])),this.ad(A([n,"allowPicking"],[this,"allowPicking"])),this.ad(A([n,"position"],[this,"position"])),this.ad(A([n,"radius"],[this,"esCylinderRadius"])),this.ad(A([n,"height"],[this,"esCylinderHeight"])),this.ad(A([n,"materialParams"],[this,"esCylinderMaterialParams"])),this.ad(Ne(this.esCylinderRotationChanged,()=>{const i=this.esCylinderRotation;n.rotation=[i[0],i[1]-180,i[2]]},{immediate:!0}))}getESProperties(){const t=super.getESProperties();return{...t,basic:[...t.basic,new su([this,"esCylinderRotation"],"波动方向",va.defaults.esCylinderRotation),new N([this,"esCylinderRadius"],"半径",Jo.defaults.esCylinderRadius),new N([this,"esCylinderHeight"],"高度",Jo.defaults.esCylinderHeight),new dt([this,"esCylinderMaterialParams"],"材质参数",Jo.defaults.esCylinderMaterialParams)]}}};h(va,"createDefaultProps",()=>({...qi.createDefaultProps(),url:"${earthsdk3-assets-script-dir}/assets/glb/CesiumDrone.glb",esCylinderRotation:tt([0,0,0]),esCylinderRadius:2,esCylinderHeight:10,esCylinderMaterialParams:gt({ringSpeed:1,ringColor:[1,1,0,1],ringWidth:.03,sides:10,ringRatio:1,ringRepeat:10,ringBottomMove:!0})})),h(va,"type",va.register("ESSignalInterference",va,{chsName:"信号干扰",tags:["ESObjects"],description:"信号干扰"}));let eg=va;const Ns=class Ns extends U{constructor(){super();h(this,"_loading",!1);h(this,"_loadedEvent",this.disposeVar(new M));h(this,"_loaded",!1);h(this,"_loadedPromiseResolve");h(this,"_loadedPromise",new Promise(t=>{this._loadedPromiseResolve=t}));h(this,"_processing");this._processing=this.disposeVar(nr(async t=>{if(this._loading=!0,globalThis.Hls)console.info("可能系统已经加载hlsjs,此处不再加载!");else{const n=ut.context.getStrFromEnv(Ns.path);await t.promise(Kh(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 Ns._instance=Ns._instance||new Ns,Ns._instance}};h(Ns,"path","${xr-utils-script-dir}/xr-static/xr-utils/hlsjs/1.4.12/hls.min.js"),h(Ns,"_instance");let Th=Ns,iP=class extends U{constructor(t,n){super();h(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 sP extends U{constructor(t,n){super();h(this,"_videoDom");h(this,"_processing");this._complexImage=t,this._videoSrc=n,this._videoDom=this.disposeVar(new iP(this._complexImage,"")),this._processing=this.disposeVar(nr(async i=>{const{videoSrc:s}=this,o=Th.instance();await i.promise(o.loadedPromise);const a=globalThis.Hls,l=new a,u=this.element;await Eo(i,()=>new Promise((c,d)=>{u.xbsjHLS=l,l.attachMedia(u),l.on(a.Events.MEDIA_ATTACHED,()=>{l.loadSource(s),l.on(a.Events.MANIFEST_PARSED,(f,p)=>{u.play(),c()})}),l.on(a.Events.ERROR,(f,p)=>{const{type:_,details:S,fatal:b}=p;b&&(l.destroy(),d(S))})}))})),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 V_ extends U{constructor(t,n){super();h(this,"_videoDom");h(this,"_update");this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new sP(this._complexImage,this._imageUri)),this._update=this.disposeVar(Ta(()=>this.update())),this._update.start()}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 Ms=class Ms extends U{constructor(){super();h(this,"_loading",!1);h(this,"_loadedEvent",this.disposeVar(new M));h(this,"_loaded",!1);h(this,"_loadedPromiseResolve");h(this,"_loadedPromise",new Promise(t=>{this._loadedPromiseResolve=t}));h(this,"_processing");this._processing=this.disposeVar(nr(async t=>{if(this._loading=!0,globalThis.flvjs)console.info("可能系统已经加载flvjs,此处不再加载!");else{const n=ut.context.getStrFromEnv(Ms.path);await t.promise(Kh(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 Ms._instance=Ms._instance||new Ms,Ms._instance}};h(Ms,"path","${xr-utils-script-dir}/xr-static/xr-utils/flvjs/1.6.2/flv.min.js"),h(Ms,"_instance");let Oh=Ms;class oP extends U{constructor(t,n){super();h(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 aP extends U{constructor(t,n){super();h(this,"_videoDom");h(this,"_processing");this._complexImage=t,this._videoSrc=n,this._videoDom=this.disposeVar(new oP(this._complexImage,"")),this._processing=this.disposeVar(nr(async i=>{const{videoSrc:s}=this,o=Oh.instance();await i.promise(o.loadedPromise);const a=globalThis.flvjs,l=this.element;await Eo(i,()=>new Promise((u,c)=>{if(!a.isSupported()){c("flvjs不支持!");return}var d=a.createPlayer({type:"flv",url:s});d.attachMediaElement(l),d.load(),d.play(),l.xbsjFlvPlayer=d}))})),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 j_ extends U{constructor(t,n){super();h(this,"_videoDom");h(this,"_update");this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new aP(t,this._imageUri)),this._update=this.disposeVar(Ta(()=>this.update())),this._update.start()}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 B_(r){const e=r.substring(r.lastIndexOf(".")+1);return Ju.suffixTypes[e]}class Ju extends U{constructor(){super();h(this,"_enabled",this.disposeVar(z(!1)));h(this,"_uri",this.disposeVar(z("")));h(this,"_type",this.disposeVar(z(void 0)));h(this,"_size",this.disposeVar(Xt(void 0)));h(this,"_pixelFormat",this.disposeVar(z("RGBA")));h(this,"_flipY",this.disposeVar(z(!0)));h(this,"_crossOriginReact",this.disposeVar(z("")));h(this,"_autoplayReact",this.disposeVar(z(!0)));h(this,"_loopReact",this.disposeVar(z(!0)));h(this,"_copyTextureEvent",this.disposeVar(new M));h(this,"_imageProcessingResettingEvent",this.disposeVar(Se(this.enabledChanged,this.uriChanged,this.typeChanged)));h(this,"_imageProcessingResetting",this.disposeVar(new Ie(this._imageProcessingResettingEvent,()=>{if(!this.enabled||!this.uri)return;let{type:t}=this;if(t||(t=B_(this.uri)),!!t){if(t==="img")return new em(this,this.uri);if(t==="video")return new im(this,this.uri);if(t==="gif")return new fm(this,this.uri);if(t==="hls")return new V_(this,this.uri);if(t==="flv")return new j_(this,this.uri)}})));h(this,"_createNativeTextureEvent",this.disposeVar(Se(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})}}h(Ju,"types",rm),h(Ju,"czmPixelFormats",nm),h(Ju,"suffixTypes",{png:"img",jpg:"img",svg:"img",webp:"img",gif:"gif",mp4:"video",mov:"video",webm:"video",flv:"flv",m3u8:"hls"});const lP=[0,0,0,0];class uP{constructor(){h(this,"_value",[]);h(this,"_valueStr","[]");h(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 M),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=cc(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=lP;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 cP extends U{constructor(){super(...arguments);h(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 l=o;for(;o!=="ESSceneObject"&&(s=s.getParentClass(),!!s);)if(o=s.type,a=i.get(o),a)return console.warn(`未找到${l}在${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 $o(t,n);return s.createdEvent.emit(),s}}}class hP extends U{constructor(){super(...arguments);h(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 $o(t,n);return s.createdEvent.emit(),s}}}const Yr=class Yr extends U{constructor(t,n,i=!1){super();h(this,"_createdEvent",this.dv(new M));h(this,"_id",++Yr._accumId);this._sceneObject=t,this._viewer=n;{if(i)return;const s=(o,a)=>{for(let l of o)this._viewer.delete(l);for(let l of a)l.parentID=this.sceneObject.id,this._viewer.add(l)};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}};h(Yr,"context",new cP),h(Yr,"contextEditing",new hP),h(Yr,"register",Yr.context.register.bind(Yr.context)),h(Yr,"registerEditing",Yr.contextEditing.register.bind(Yr.contextEditing)),h(Yr,"_accumId",-1);let $o=Yr;function ue(r,e,t){return{content:[{type:"text",text:JSON.stringify({toolName:r,status:"error",msg:t?"执行失败,"+t:"执行失败",data:e},null,2)}]}}function mi(r,e,t){return{content:[{type:"text",text:JSON.stringify({toolName:r,status:"success",msg:t?"执行成功,"+t:"执行成功",data:e},null,2)}]}}const z_=r=>[{name:"flyTo",params:{description:"相机飞行定位,根据对象id来改变相机视角位置或查询真实地点名称信息来改变相机视角位置",inputSchema:{option:pe.discriminatedUnion("mode",[pe.object({mode:pe.literal("SceneObject").describe("对象定位模式:分析用户提供的名称是否是场景对象的名称"),id:pe.string().describe("场景对象的唯一标识 id")}).describe("分析用户提供的名称是否是场景对象的名称,是则使用 SceneObject 模式并使用该对象属性值id作为参数"),pe.object({mode:pe.literal("RealPlace").describe("真实地点定位模式:用于定位现实世界中的城市、国家或地名"),longitude:pe.number().min(-180).max(180).describe("经度,单位:度,范围 [-180, 180]"),latitude:pe.number().min(-90).max(90).describe("纬度,单位:度,范围 [-90, 90]"),height:pe.number().optional().default(0).describe("高度,单位:米,默认值为 0")}).describe("真实地点定位模式:用于定位现实世界中的城市、国家或地名,而非场景对象的名称,并主动提供经度、纬度和高度信息")]).describe(`相机定位参数规范:
465
+ `,Ap=Date.now(),es=class es extends ut{constructor(t){super(t);h(this,"_flyToEvent",this.disposeVar(new M));h(this,"_resetClockEvent",this.disposeVar(new M));this.ad(et([this,"uri"],[this,"url"]))}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 dt([this,"url"],"路径","${earthsdk3-assets-script-dir}/assets/misc/simple.czml",void 0,!0),new W([this,"clockEnabled"],"启用",!1),new N([this,"multiplier"],"倍速",es.defaults.multiplier),new W([this,"autoResetClock"],"自动设置时钟",!0),new Oi([this,"startTime"],"开始时间",es.defaults.startTime,!0),new Oi([this,"stopTime"],"结束时间",es.defaults.stopTime,!0),new Oi([this,"currentTime"],"当前时间",es.defaults.currentTime,!0),new rt([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep","SYSTEM_CLOCK_MULTIPLIER"),new rt([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange","UNBOUNDED"),new W([this,"shouldAnimate"],"是否启用动画",!1)],general:[...t.general,new W([this,"show"],"是否显示",!0),new W([this,"collision"],"开启碰撞",!1),new W([this,"allowPicking"],"允许拾取",!1)],more:[...t.more,new ct("飞入",n=>this.flyTo(n),[1e3],"flyTo"),new ct("重置时钟",()=>this.resetClock(),[],"resetClock"),new ls([this,"loadFuncStr"],"loadFnStr",P_,Ub,!0)]}}};h(es,"createDefaultProps",()=>({show:!0,uri:void 0,url:void 0,allowPicking:!1,autoResetClock:!0,clockEnabled:!1,startTime:Ap,stopTime:Ap+1440*60*1e3,currentTime:Ap,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...ut.createDefaultProps()})),h(es,"type",es.register("ESCzml",es,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"}));let kp=es;const jl=class jl extends ut{getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ht,new W([this,"show"],"是否显示"),new N([this,"cssSize"],"尺寸"),new Me([this,"cssPosition"],"位置"),new at([this,"imgUrl"],"图片地址")]}}};h(jl,"createDefaultProps",()=>({...ut.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:ut.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")})),h(jl,"type",jl.register("ESNavigator",jl,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"}));let Vp=jl;const ns=class ns extends ut{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ht("通用"),new W([this,"show"],"是否显示",ns.defaults.show),new N([this,"height"],"高度",ns.defaults.height,!0),new N([this,"fontSize"],"文字大小",ns.defaults.fontSize,!0),new bt([this,"bgColor"],"背景颜色",ns.defaults.bgColor,!0)]}}};h(ns,"createDefaultProps",()=>({...ut.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:tt([71/255,71/255,71/255,.8])})),h(ns,"type",ns.register("ESViewerStatusBar",ns,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let jp=ns;const rs=class rs extends ut{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ht("通用"),new W([this,"show"],"是否显示",rs.defaults.show),new N([this,"height"],"高度",rs.defaults.height,!0),new N([this,"fontSize"],"文字大小",rs.defaults.fontSize,!0),new bt([this,"bgColor"],"背景颜色",rs.defaults.bgColor,!0)]}}};h(rs,"createDefaultProps",()=>({...ut.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:tt([71/255,71/255,71/255,.8])})),h(rs,"type",rs.register("ESViewerStatusBarScale",rs,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let Bp=rs;const Bl=class Bl extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new at([this,"url"],"路径","",!0),new N([this,"progress"],"进度",0,!1,!0)]}}};h(Bl,"createDefaultProps",()=>({...st.createDefaultProps(),url:"",progress:0})),h(Bl,"type",Bl.register("ESGaussianSplatting",Bl,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"}));let zp=Bl;class Gb extends U{constructor(e,t){if(super(),!t)return;const n=this.ad(new Bt);n.stroked=!0,this.ad(e.components.disposableAdd(n)),this.ad(et([n,"points"],[e,"areaLiftingPoints"])),this.ad(n.editingChanged.don(()=>{n.editing||!this.isDestroyed()&&this.destroy()})),n.editing=!0}}var I_=(r=>(r[r.None=0]="None",r[r.Up=1]="Up",r[r.Down=2]="Down",r))(I_||{}),x_=(r=>(r[r.CLICK=0]="CLICK",r[r.MOVE=1]="MOVE",r))(x_||{}),T_=(r=>(r[r.Smooth=0]="Smooth",r[r.Linear=1]="Linear",r[r.Spherical=2]="Spherical",r[r.Tip=3]="Tip",r[r.Hard=4]="Hard",r))(T_||{});const $e=class $e extends st{constructor(t){super(t);h(this,"_startEvent",this.disposeVar(new M));h(this,"_configs",this.disposeVar(Xt(void 0)));h(this,"_heights",this.disposeVar(z({})));h(this,"_heightsEvent",this.ad(new M));h(this,"_areaLiftingUpdateEvent",this.disposeVar(new M));const n=this.ad(Se(this.modeChanged,this.startEvent));this.ad(new Ie(n,()=>{var i;if(this.areaLiftingPoints=void 0,this.mode=="areaLifting")return new Gb(this,this.activeViewer);(i=this.activeViewer)==null||i.startEditing(this,Z.BrushErase)}))}updateEditing(){var t;ah(this.position,[0,0,0])||(this.position=[0,0,0]),(t=this.activeViewer)==null||t.startEditing(this,Z.Place,{callSource:"inner"})}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get configs(){return this._configs.value}set configs(t){this._configs.value=t}get configsChanged(){return this._configs.changed}getConfig(...t){var n,i;if(typeof t[0]=="number")return(n=this.configs)==null?void 0:n.find(s=>s.x===t[0]&&s.y===t[1]);if(typeof t[0]=="string")return(i=this.configs)==null?void 0:i.find(s=>s.url===t[0])}get heights(){return this._heights.value}set heights(t){this._heights.value=t}get heightsChanged(){return this._heights.changed}get heightsEvent(){return this._heightsEvent}getHeights(){return new Promise((t,n)=>{const i=new U;i.ad(this._heightsEvent.don(o=>{o!=="start"&&(!i.isDestroyed()&&i.destroy(),t(o))})),this._heightsEvent.emit("start");const s=setTimeout(()=>{i.isDestroyed()||(i.destroy(),t(void 0))},2e3);i.ad(()=>clearTimeout(s))})}get areaLiftingUpdateEvent(){return this._areaLiftingUpdateEvent}areaLiftingUpdate(){this._areaLiftingUpdateEvent.emit()}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new ct("开始编辑",()=>{this.start()},[],"start"),new rt([this,"mode"],$e.modes,"编辑模式",$e.defaults.mode)],basic:[...t.basic,new dt([this,"url"],"URL"),new dt([this,"tileInfo"],"瓦片信息配置"),new N([this,"maxHeight"],"最大高度"),new N([this,"minHeight"],"最小高度"),new N([this,"offset"],"偏移"),new W([this,"autoLoadHeights"],"自动加载高度"),new ht("刷写设置"),new N([this,"brushEraseRadius"],"编辑半径"),new Me([this,"brushEraseRadiusRange"],"编辑半径范围",void 0,!0,!0),new rt([this,"brushEraseMode"],Object.entries(["CTRL","SHIFT","NONE"]),"刷写模式"),new rt([this,"brushErasePickReference"],$e.brushErasePickReferences,"选择参考"),new Di([this,"brushErasePosition"],"刷写位置"),new Di([this,"brushEraseStartPosition"],"刷写起始位置"),new rt([this,"brushEraseFalloff"],$e.brushEarseFalloffs,"刷写衰减函数"),new rt([this,"brushEraseRayDirection"],[["Up","Up"],["Down","Down"]],"刷写射线方向"),new ht("平整设置"),new rt([this,"flattenMode"],$e.flattenModes,"平整模式",0),new rt([this,"flattenPick"],$e.flattenPicks,"平整选择",0),new N([this,"flattenOffset"],"平整偏移",-.01),new ht("区域升降设置"),new ge([this,"areaLiftingPoints"],"区域升降位置",[]),new N([this,"areaLiftingOffset"],"区域升降偏移",1),new ct("区域升降更新",()=>{this.areaLiftingUpdate()},[],"areaLiftingUpdate"),new ht("围栏设置"),new ge([this,"fencePoints"],"围栏位置",[])]}}};h($e,"createDefaultProps",()=>({...st.createDefaultProps(),allowPicking:!0,url:"",maxHeight:0,minHeight:0,offset:.01,tileInfo:gt({tileCountX:65,tileCountY:65,tileMaximumLevel:15,tilesPerAxis:5,format:"heights"}),mode:z("sculpt"),autoLoadHeights:!1,brushEraseRadius:100,brushEraseRadiusRange:tt([0,100]),brushErasePosition:tt([0,0,0]),brushEraseStartPosition:tt([0,0,0]),brushEraseMode:z("NONE"),brushErasePickReference:z("NONE"),brushEraseRayDirection:z("Down"),brushEraseFalloff:z(4),flattenMode:z(0),flattenPick:z(1),flattenOffset:-.01,areaLiftingPoints:_o(void 0),areaLiftingOffset:1,fencePoints:_o(void 0),fenceMode:z("in")})),h($e,"modes",[["雕刻","sculpt"],["抹除","erase"],["平滑","smooth"],["平整","flatten"],["区域升降","areaLifting"]]),h($e,"brushErasePickReferences",[["无限制","NONE"],["地形图层","ESTerrainLayerEditing"],["3DTiles","ES3DTileset"]]),h($e,"flattenModes",[["None",0],["Up",1],["Down",2]]),h($e,"flattenPicks",[["CLICK",0],["MOVE",1]]),h($e,"brushEarseFalloffs",[["平滑",0],["线性",1],["硬边",4],["球形",2],["尖顶",3]]),h($e,"invalidValue",-1e4),h($e,"type",$e.register("ESTerrainLayerEditing",$e,{chsName:"地形图层编辑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于对地形数据进行编辑"})),h($e,"supportEditingModes",[...st.supportEditingModes,Z.Place,Z.BrushErase]);let Xu=$e;const Cr=class Cr extends St{constructor(t){super(t);h(this,"editingBindMode","doublePoints");h(this,"_startEvent",this.disposeVar(new M));h(this,"_replayEvent",this.disposeVar(new M));this.ad(this.startEvent.don(()=>{var n;(n=this.activeViewer)==null||n.startEditing(this,Z.BrushErase)}))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get replayEvent(){return this._replayEvent}replay(){this._replayEvent.emit()}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ct("开始编辑",()=>this.start(),[]),new ct("重播",()=>this.replay(),[]),new W([this,"showImage"],"显示影像",Cr.defaults.showImage),new N([this,"flowSpeed"],"流动速度",Cr.defaults.flowSpeed),new N([this,"gravity"],"重力加速度",Cr.defaults.gravity),new N([this,"strength"],"泥石流强度",Cr.defaults.strength),new N([this,"resistance"],"泥石流阻力(越大越快平息)",Cr.defaults.resistance),new N([this,"terrainOffset"],"地形高度偏移",Cr.defaults.terrainOffset),new ge([this,"slidePoints"],"滑坡点数组",St.defaults.slidePoints,void 0),new ht("刷写设置"),new N([this,"brushEraseRadius"],"编辑半径"),new Me([this,"brushEraseRadiusRange"],"编辑半径范围",void 0,!0,!0),new rt([this,"brushEraseMode"],Object.entries(["CTRL","SHIFT","NONE"]),"刷写模式"),new rt([this,"brushErasePickReference"],Xu.brushErasePickReferences,"选择参考"),new Di([this,"brushErasePosition"],"刷写位置"),new Di([this,"brushEraseStartPosition"],"刷写起始位置"),new rt([this,"brushEraseFalloff"],Xu.brushEarseFalloffs,"刷写衰减函数"),new rt([this,"brushEraseRayDirection"],[["Up","Up"],["Down","Down"]],"刷写射线方向")]}}};h(Cr,"createDefaultProps",()=>({...St.createDefaultProps(),brushEraseRadius:100,brushEraseRadiusRange:tt([0,1e3]),brushErasePosition:tt([0,0,0]),brushEraseStartPosition:tt([0,0,0]),brushEraseMode:z("NONE"),brushErasePickReference:z("NONE"),brushEraseRayDirection:z("Down"),terrainOffset:5,flowSpeed:1,gravity:9.8,slidePoints:tt([]),strength:1,showImage:!0,resistance:.98,stroked:!0,strokeStyle:gt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!0})})),h(Cr,"type",Cr.register("ESLandSlide",Cr,{chsName:"滑坡泥石流分析",tags:["ESObjects","_ES_Impl_Cesium"],description:"滑坡泥石流分析对象"})),h(Cr,"supportEditingModes",[...St.supportEditingModes,Z.DoublePoints,Z.DoublePointsAppend,Z.DoublePointsModify,Z.BrushErase]);let Up=Cr;const pa=class pa extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new at([this,"mesh"],"mesh地址",pa.defaults.mesh)]}}};h(pa,"createDefaultProps",()=>({...st.createDefaultProps(),mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"})),h(pa,"type",pa.register("ESStaticMesh",pa,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"}));let Gp=pa;const zl=class zl extends St{constructor(t){super(t);h(this,"_startEvent",this.dv(new M));h(this,"_clearEvent",this.dv(new M));h(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new Yo),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(A([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(A([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(A([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(A([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(A([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(A([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(A([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 ct("开始分析",()=>this.start(),[],"start"),new ct("清除分析",()=>this.clear(),[],"clear"),new ge([this,"windowPositions"],"屏幕坐标",[],void 0,!1,!0),new ge([this,"depths"],"深度值",[],void 0,!1,!0),new N([this,"radius"],"半径",1e4,!0)]}}};h(zl,"createDefaultProps",()=>({...St.createDefaultProps(),windowPositions:Pf([]),depths:Xt([]),radius:z(1e4)})),h(zl,"type",zl.register("ESSkylineAnalysis",zl,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"}));let Wp=zl;const Ds=class Ds extends kt{constructor(e){super(e)}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new ge([this,"data"],"数据",[],void 0,!0),new dt([this,"gradient"],"渐变",Ds.defaults.gradient,void 0,!0),new N([this,"radius"],"半径",Ds.defaults.radius,void 0),new N([this,"blur"],"模糊",Ds.defaults.blur,!0),new W([this,"is3D"],"is3D",!1,!0)]}}};h(Ds,"createDefaultProps",()=>({...kt.createDefaultProps(),is3D:z(!1),data:_o([]),gradient:Kt({".5":"green",".7":"yellow",".95":"red"}),radius:z(10),blur:z(.85)})),h(Ds,"type",Ds.register("ESHeatMap",Ds,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"}));let xh=Ds;const ga=class ga extends St{constructor(t){super(t);h(this,"editingBindMode","scatter")}};h(ga,"createDefaultProps",()=>({...St.createDefaultProps(),pointed:!0})),h(ga,"type",ga.register("ESGeoPoints",ga,{chsName:"地理点集合",tags:["ESObjects","_ES_Impl_Cesium"],description:"地图中的可视化地理点集合"})),h(ga,"supportEditingModes",[...St.supportEditingModes,Z.ScatterAppend,Z.ScatterModify]);let Yu=ga;const O_=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 l=>{let u=l[2]??0;if(t)if(t.type==="absolute")u=t.height??u;else if(t.type==="relative"){const c=await r.getTerrainHeight([l[0],l[1]])??0;u=(t.height??u)+c}else t.type==="terrain"&&(u=await r.getTerrainHeight([l[0],l[1]])??0);return[l[0],l[1],u]}));n.push({...i,points:a})}}return n},D_=async(r,e=[],t)=>await Promise.all(e.map(async n=>{var l,u,c,d,f,p,_,S,b;const i=((l=n.geometry)==null?void 0:l.x)??((c=(u=n.geometry)==null?void 0:u.coordinates)==null?void 0:c[0]),s=((d=n.geometry)==null?void 0:d.y)??((p=(f=n.geometry)==null?void 0:f.coordinates)==null?void 0:p[1]);let a=((_=n.geometry)==null?void 0:_.z)??((b=(S=n.geometry)==null?void 0:S.coordinates)==null?void 0:b[2])??0;if(t)if(t.type==="absolute")a=t.height??a;else if(t.type==="relative"){const I=await r.getTerrainHeight([i,s])??0;a=(t.height??a)+I}else t.type==="terrain"&&(a=await r.getTerrainHeight([i,s])??0);return{...n,points:[i,s,a]}})),N_=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 l=>{let u=l[2]??0;if(t)if(t.type==="absolute")u=t.height??u;else if(t.type==="relative"){const c=await r.getTerrainHeight([l[0],l[1]])??0;u=(t.height??u)+c}else t.type==="terrain"&&(u=await r.getTerrainHeight([l[0],l[1]])??0);return[l[0],l[1],u]}));n.push({...i,points:a})}))})),n};function Wb(r){const e=At.lineString(r),t=At.length(e),n=At.along(e,t/2);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function Hb(r,e){const t=At.lineString(r),n=At.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=At.along(t,n*(o/i));s.push([a.geometry.coordinates[0],a.geometry.coordinates[1],a.geometry.coordinates[2]||0])}return s}function qb(r){const e=[...r];JSON.stringify(r[0])!==JSON.stringify(r[r.length-1])&&e.push(r[0]);const t=At.polygon([e]),n=At.center(t);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function M_(r,e,t){const n=r.dv(new ll);for(const i in t)i!=="type"&&(n[i]=t[i]);n.position=e,r.d(r.components.disposableAdd(n))}function Hp(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 d=c[1].trim(),f=t[`${d}`]||"-";i=i.replace(c[0],f)}}let o=n.symbol;const{minVisibleDistance:a,maxVisibleDistance:l}=n;a&&l&&(o={...o,minVisibleDistance:a,maxVisibleDistance:l});const u={...o,text:i};M_(r,e,u)}function dl(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 qp(r,e,t){const i={...e.symbol};if(t&&t.length>0){const s=dl(r,t);for(let o in s)i[o]!==void 0&&s[o]!==null&&(i[o]=s[o])}return i}function Xp(r,e,t){var u,c;const n=e,{uniqueValueInfos:i,field:s,fieldDelimiter:o,defaultSymbol:a}=n;let l={...a};if(Array.isArray(s)){const f=s.map(p=>r[p]??"").join(o);l=((u=i.find(p=>p.value==f))==null?void 0:u.symbol)||a}else l=((c=i.find(d=>d.value==r[s]))==null?void 0:c.symbol)||a;if(t&&t.length>0){const d=dl(r,t);for(let f in d)l[f]!==void 0&&d[f]!==null&&(l[f]=d[f])}return l}function Yp(r,e,t){const n=e,{classBreakInfos:i,field:s,defaultSymbol:o}=n;let a=o;const l=r[s];if(l===void 0||typeof l!="number")a=o;else{const u=i.find(c=>l<=c.maxValue&&l>=c.minValue);u?a=u.symbol:a=o}if(t&&t.length>0){const u=dl(r,t);for(let c in u)a[c]!==void 0&&u[c]!==null&&(a[c]=u[c])}return a}function Xb(r,e){function t(u,c,d,f){const p=y=>y*Math.PI/180,_=y=>y*180/Math.PI,S=p(u),b=p(d),I=p(f-c),v=Math.sin(I)*Math.cos(b),w=Math.cos(S)*Math.sin(b)-Math.sin(S)*Math.cos(b)*Math.cos(I),g=Math.atan2(v,w);return(_(g)+360)%360}function n(u,c,d,f,p){const S=C=>C*Math.PI/180,b=C=>C*180/Math.PI,I=f/6371e3,v=S(p),w=S(u),g=S(c),y=Math.asin(Math.sin(w)*Math.cos(I)+Math.cos(w)*Math.sin(I)*Math.cos(v)),E=g+Math.atan2(Math.sin(v)*Math.sin(I)*Math.cos(w),Math.cos(I)-Math.sin(w)*Math.sin(y));return{lat:b(y),lng:b(E),alt:d}}function i(u){const c=[];u.length>1&&c.push(t(u[0].lat,u[0].lng,u[1].lat,u[1].lng));for(let d=1;d<u.length-1;d++){const f=t(u[d-1].lat,u[d-1].lng,u[d].lat,u[d].lng),p=t(u[d].lat,u[d].lng,u[d+1].lat,u[d+1].lng);let _=(f+p)/2;Math.abs(f-p)>180&&(_=(_+180)%360),c.push(_)}return u.length>1&&c.push(t(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(!r||r.length<2)throw new Error("至少需要两个点才能生成路径");if(e<=0)throw new Error("宽度必须大于0");const s=e/2,o=i(r),a=[],l=[];for(let u=0;u<r.length;u++){const c=(o[u]+90)%360,d=(o[u]+270)%360,f=r[u].alt!==void 0?r[u].alt:0;a.push(n(r[u].lat,r[u].lng,f,s,c)),l.push(n(r[u].lat,r[u].lng,f,s,d))}return a.concat(l.reverse())}function Yb(r,e,t,n){function i(S){return S*(Math.PI/180)}const s=6378137,o=i(r),a=i(e),l=i(t),u=i(n),c=l-o,d=u-a,f=Math.sin(c/2)**2+Math.cos(o)*Math.cos(l)*Math.sin(d/2)**2,p=2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f));return s*p}const R_=(r,e,t)=>Array.isArray(e)?e.map(s=>r[s]??"").join(t):r[e]??"";function L_(r,e){const n={...e.symbol};return{points:r.map(i=>i.points),symbol:n}}function F_(r,e){const t=e,{uniqueValueInfos:n,field:i,fieldDelimiter:s,defaultSymbol:o}=t,a=[],l=n.reduce((c,d)=>{const f=d.value.toString();return c[f]={points:[],value:d.value,symbol:d.symbol},c},{});for(let c=0;c<r.length;c++){const d=r[c],f=R_(d,i,s);if(f!==void 0&&f!==""){const p=l[f.toString()];p?p.points.push(d.points):a.push(d.points)}else a.push(d.points)}const u=[];for(let c in l){const{points:d,symbol:f}=l[c];d.length>0&&u.push({points:d,symbol:f})}return a.length>0&&u.push({points:a,symbol:o}),u}function A_(r,e){const t=e,{classBreakInfos:n,field:i,defaultSymbol:s}=t,o=[],a=n.map(u=>({...u,points:[]}));for(let u=0;u<r.length;u++){const c=r[u],d=c[i];if(d===void 0||typeof d!="number")o.push(c.points);else{const f=a.findIndex(p=>d<=p.maxValue&&d>=p.minValue);f!==-1?a[f].points.push(c.points):o.push(c.points)}}const l=[];return a.forEach(u=>{u.points.length>0&&l.push({points:u.points,symbol:u.symbol})}),o.length>0&&l.push({points:o,symbol:s}),l}function Jb(r,e,t=[]){const i={...e.symbol},s=r.map(o=>{const a=dl(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 $b(r,e,t=[]){const n=e,{uniqueValueInfos:i,field:s,fieldDelimiter:o}=n,a=n.defaultSymbol,l=[],u=i.reduce((d,f)=>{const p=f.value.toString();return d[p]={locations:[],value:f.value,symbol:f.symbol},d},{});for(let d=0;d<r.length;d++){const f=r[d],p=R_(f,s,o);if(p){const _=u[p.toString()];if(_){const S=dl(f,t);_.locations.push({position:f.points,rotation:S.rotation||a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else l.push({position:f.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else l.push({position:f.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}const c=[];for(let d in u){const{locations:f,symbol:p}=u[d];f.length>0&&c.push({url:p.url,locations:f})}return l.length>0&&c.push({url:a.url,locations:l}),c}function Kb(r,e,t=[]){const n=e,{classBreakInfos:i,field:s}=n,o=n.defaultSymbol,a=[],l=i.map(c=>({...c,locations:[]}));for(let c=0;c<r.length;c++){const d=r[c],f=d[s];if(f===void 0||typeof f!="number")a.push({position:d.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]});else{const p=l.findIndex(_=>f<=_.maxValue&&f>=_.minValue);if(p!==-1){const _=dl(d,t);l[p].locations.push({position:d.points,rotation:_.rotation||o.rotation||[0,0,0],scale:l[p].symbol.scale||[1,1,1]})}else a.push({position:d.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]})}}const u=[];return l.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 Zb extends U{constructor(t,n,i,s){super();h(this,"labelingInfo");this.sceneObject=t;const o=n;if(s&&xi(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 l=L_(o,i);this._simplePointAllRender(l.points,l.symbol);return}if(i.symbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!");const l=L_(o,i);this._imageAllRender(l.points,l.symbol);return}if(i.symbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!");const{url:l,locations:u}=Jb(o,i,a);this._modelAllRender(l,u);return}for(let l=0;l<o.length;l++){const u=qp(o[l],i,a);this.render(o[l],u)}}else if(i.type==="unique-value"){const{visualVariables:a}=i;if(i.uniqueValueInfos.findIndex(d=>d.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),F_(o,i).forEach(({points:f,symbol:p})=>{this._simplePointAllRender(f,p)});return}if(i.uniqueValueInfos.findIndex(d=>d.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),F_(o,i).forEach(({points:f,symbol:p})=>{this._imageAllRender(f,p)});return}if(i.uniqueValueInfos.findIndex(d=>d.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),$b(o,i,a).forEach(({url:f,locations:p})=>{this._modelAllRender(f,p)});return}for(let d=0;d<o.length;d++){const f=Xp(o[d],i,a);this.render(o[d],f)}}else if(i.type==="class-breaks"){const{visualVariables:a}=i;if(i.classBreakInfos.findIndex(d=>d.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),A_(o,i).forEach(({points:f,symbol:p})=>{this._simplePointAllRender(f,p)});return}if(i.classBreakInfos.findIndex(d=>d.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),A_(o,i).forEach(({points:f,symbol:p})=>{this._imageAllRender(f,p)});return}if(i.classBreakInfos.findIndex(d=>d.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),Kb(o,i,a).forEach(({url:f,locations:p})=>{this._modelAllRender(f,p)});return}for(let d=0;d<o.length;d++){const f=Yp(o[d],i,a);this.render(o[d],f)}}else if(i.type==="heatmap"){const{field:a,fieldValueMax:l,fieldValueMin:u}=i;console.time();const c=o.map(d=>{const{points:f}=d;if(a&&typeof a=="string"){let p=d[a];typeof p=="number"&&(typeof l=="number"&&p>l&&(p=l),typeof u=="number"&&p<u&&(p=u),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;Hp(this.sceneObject,i,t,n)}renderHeatmap(t,n){const{is3D:i,radius:s,blur:o,gradient:a}=n,l=this.dv(new xh);this.d(this.sceneObject.components.disposableAdd(l)),l.is3D=i,l.radius=s,l.blur=o,a&&(l.gradient={...a}),l.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"?M_(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:l}=n,u=this.dv(new Yu);this.d(this.sceneObject.components.disposableAdd(u)),u.pointed=!0,u.pointOutlineColor=a,u.pointOutlineWidth=l,u.pointSize=s,u.pointColor=o,u.allowPicking=(n==null?void 0:n.allowPicking)??!0,u.extras={selected:!1},u.points=[i]}_simplePointAllRender(t,n){const{size:i,color:s,outlineColor:o,outlineWidth:a}=n,l=this.dv(new Yu);this.d(this.sceneObject.components.disposableAdd(l)),l.pointed=!0,l.pointOutlineColor=o,l.pointOutlineWidth=a,l.pointSize=i,l.pointColor=s,l.allowPicking=(n==null?void 0:n.allowPicking)??!0,l.points=[...t]}_simpleImageRender(t,n){const{points:i}=t,{rotation:s,offset:o,size:a,url:l,screenRender:u,anchor:c,renderMode:d,rotationType:f}=n,p=this.dv(new vh),_=this.dv(new ll);this.d(this.sceneObject.components.disposableAdd(p)),this.d(this.sceneObject.components.disposableAdd(_)),p.url=l,p.renderMode=d??0,s&&(p.rotation=s),o&&(p.offset=o),p.size=a||[32,32],c&&(p.anchor=c),f&&(p.rotationType=f),p.screenRender=u??!0,p.allowPicking=(n==null?void 0:n.allowPicking)??!0,p.extras={selected:!1},p.position=[...i],p.sizeByContent=!1,_.allowPicking=(n==null?void 0:n.allowPicking)??!0;const S=a?Math.max(...a)+10:Math.max(...p.size)+10;_.sizeByContent=!1,_.screenRender=!0,_.size=[S,S],_.borderRadius=[S,S,S,S],_.padding=[S/2,S/2,S/2,S/2],_.borderWidth=S/10,_.offset=[0,S/10+5],_.text="",_.backgroundColor=[0,0,0,0],_.borderColor=[0,0,0,0]}_imageAllRender(t,n){const i={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:t}}]},s=this.dv(new Wu);this.d(this.sceneObject.components.disposableAdd(s));const o=this.dv(new ll);this.d(this.sceneObject.components.disposableAdd(o)),s.textDefaultText="";const{offset:a,size:l,url:u,anchor:c}=n;s.imageUrl=u,c&&(s.imageAnchor=c),a&&(s.imageOffset=a),s.imageSize=l||[32,32],s.url=i,s.allowPicking=(n==null?void 0:n.allowPicking)??!0,s.extras={selected:!1},o.allowPicking=!0;const d=l?Math.max(...l)+10:Math.max(...s.imageSize)+10;o.sizeByContent=!1,o.size=[d,d],o.borderRadius=[d,d,d,d],o.padding=[d/2,d/2,d/2,d/2],o.borderWidth=d/10,o.offset=[0,d/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,l=this.dv(new qi);this.d(this.sceneObject.components.disposableAdd(l)),l.url=a,s&&(l.rotation=s),o&&(l.scale=o),l.position=[...i]}_modelAllRender(t,n){const i=this.dv(new qi);this.d(this.sceneObject.components.disposableAdd(i)),i.url=t,i.instances=n}_simpleParticleRender(t,n){const{points:i}=t,s=this.dv(new yh);this.d(this.sceneObject.components.disposableAdd(s)),s.position=[...i],Object.keys(n).forEach(o=>{s[o]=n[o]})}}class Qb extends U{constructor(e,t,n,i){super(),this.sceneObject=e;const s=t;if(i&&xi(s,o=>{this.renderLabel(o,i)}),n)if(n.type==="simple"){const{visualVariables:o}=n;xi(s,a=>{const l=qp(a,n,o);this.render(a,l)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;xi(s,a=>{const l=Xp(a,n,o);this.render(a,l)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;xi(s,a=>{const l=Yp(a,n,o);this.render(a,l)})}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 fn);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 Ch);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 Eh);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 hl),s=this.dv(new cl);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,l=t==null?void 0:t.modelSymbol;let u;switch(t==null?void 0:t.runModel){case"ESHuman":u=this.dv(new vr);break;case"ESCar":u=this.dv(new fh);break;case"ESGltfModel":u=this.dv(new qi)}if(this.d(this.sceneObject.components.disposableAdd(u)),l)for(let d in l)u[d]=l[d];const c=[0];for(var o=0;o<n.length-1;o+=1){const d=n[o],f=n[o+1],p=Yb(d[1],d[0],f[1],f[0]);c.push(c[o]+Math.ceil(p/a)*1e3)}i.timeStamps=c,t!=null&&t.runSpeed&&(i.currentPositionChanged.don(d=>{i.currentPosition&&(u.position=i.currentPosition,i.currentRotation&&(u.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(d=>{i.path.currentTime=d}))}}_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=Hb(n,i/1e3),o=this.dv(new qi);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})),l=Xb(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 Yo);this.d(this.sceneObject.components.disposableAdd(u)),u.height=i,u.extrudedHeight=o,u.filled=t.filled??!0,u.fillColor=t.fillColor,u.allowPicking=(t==null?void 0:t.allowPicking)??!0,u.extras={selected:!1},u.points=l}renderLabel(e,t){const{points:n}=e,i=Wb(n);Hp(this.sceneObject,i,e,t)}}function k_(r,e){try{JSON.stringify(r[r.length-1])!==JSON.stringify(r[0])&&r.push(r[0]);const t=At.featureCollection(r.map(l=>At.point(l))),n=At.polygon([r]),i={gridType:"point",units:"meters"};return At.interpolate(t,e,i).features.map(l=>l.geometry.coordinates)[0][0].filter(l=>At.booleanPointInPolygon(At.point(l),n))}catch(t){return console.error(t),[]}}class tP extends U{constructor(e,t,n,i){super(),this.sceneObject=e;const s=t;if(i&&xi(s,o=>{this.renderLabel(o,i)}),n)if(n.type==="simple"){const{visualVariables:o}=n;xi(s,a=>{const l=qp(a,n,o);this.render(a,l)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;xi(s,a=>{const l=Xp(a,n,o);this.render(a,l)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;xi(s,a=>{const l=Yp(a,n,o);this.render(a,l)})}else console.error("PolyLineLayer: renderer type is not supported")}renderLabel(e,t){const{points:n}=e;console.log("PolygonLayer: renderLabel",n);const i=qb(n);Hp(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:l,color:u,stroked:c}=s,d=this.dv(new Bt);this.d(this.sceneObject.components.disposableAdd(d)),d.stroked=c??!1,d.strokeColor=u??[1,1,1,1],d.strokeWidth=l??1,d.filled=o??!0,d.fillGround=a??!1,d.fillColor=i??[1,1,1,1],d.allowPicking=(t==null?void 0:t.allowPicking)??!0,d.extras={selected:!1},d.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 Yo);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:l}=t,u=k_(n,s??10),c=this.dv(new qi);this.d(this.sceneObject.components.disposableAdd(c)),c.url=o,c.instances=u.map(d=>({position:[...d,i??0],rotation:a??[0,0,0],scale:l??[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:l,anchor:u}=t,d={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:[...k_(n,s??10).map(p=>[...p,i??0])]}}]},f=this.dv(new Wu);this.d(this.sceneObject.components.disposableAdd(f)),f.textDefaultText="",f.imageUrl=l,u&&(f.imageAnchor=u),o&&(f.imageOffset=o),a&&(f.imageSize=a),f.url=d}}class eP extends U{constructor(t,n){super();h(this,"_initEvent",this.dv(new M));const i=this,s=async()=>{try{const a=t.featureProps;if(!a)return;const{heightMode:l,features:u,layerType:c,url:d}=a;let f=[];if(!u&&d){let p=await fetch(d).then(_=>_.json());return p=(p==null?void 0:p.features)??p,c==="polylineVector"?f=await O_(n,p,l):c==="polygonVector"?f=await N_(n,p,l):c==="pointVector"&&(f=await D_(n,p,l)),f}else c==="polylineVector"?f=await O_(n,u,l):c==="polygonVector"?f=await N_(n,u,l):c==="pointVector"&&(f=await D_(n,u,l));return f}catch(a){console.error(a);return}},o=this.dv(Se(this._initEvent,t.featurePropsChanged));i.dv(new Ie(o,()=>{if(!t.featureProps)return;const a=t.featureProps;let l;return(async()=>{const{layerType:c,renderer:d,labelingInfo:f}=a,p=await s();!p||p.length===0||(c==="pointVector"?l=new Zb(t,p,d,f):c==="polylineVector"?l=new Qb(t,p,d,f):c==="polygonVector"&&(l=new tP(t,p,d,f)),console.log("polygonVectorLayer","createLayer",l))})().catch(console.error),{destroy:()=>{var c;(c=l==null?void 0:l.destroy)==null||c.call(l),l=void 0}}}));{const a=(l,u=1)=>{const c=ky(l);if(!c)return;const{center:d,radius:f}=c;n.flyTo({distance:f*4,heading:0,pitch:-90,flyDuration:u??1,hDelta:0,pDelta:0},d)};i.d(t.flyToEvent.don(async l=>{const{featureProps:u}=t;if(!u)return;const c=await s();if(!c)return;let d=[];u.layerType==="polylineVector"?d=c.map(f=>f.points).flat():u.layerType==="polygonVector"?d=c.map(f=>f.points).flat():u.layerType==="pointVector"&&(d=c.map(f=>f.points)),d.length!==0&&a(d,l)}))}}init(){this._initEvent.emit()}}const Ul=class Ul extends kt{constructor(t){super(t);h(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 eP(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(Ne(n.showChanged,()=>{for(const i of n.components.values())Reflect.has(i,"show")&&(i.show=n.show)},{immediate:!0}))}};h(Ul,"createDefaultProps",()=>({...kt.createDefaultProps(),featureProps:Kt(void 0)})),h(Ul,"type",Ul.register("ESFeatureLayer",Ul,{chsName:"矢量图层",tags:["ESObjects"],description:"ESFeatureLayer"}));let Jp=Ul;const nP=[["256",256],["512",512],["1024",1024]],rP=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],Qn=class Qn extends kt{constructor(t){super(t);h(this,"_pickFeaturesEvent",this.dv(new M));this.ad(et([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(et([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new at([this,"accessToken"],"令牌",Qn.defaults.accessToken),new Sr([this,"rectangle"],"矩形范围",Qn.defaults.rectangle),new dt([this,"url"],"服务地址",Qn.defaults.url),new dt([this,"style"],"样式配置",Qn.defaults.style),new N([this,"zIndex"],"层级序号",Qn.defaults.zIndex),new rt([this,"tileSize"],nP,"瓦片大小",256),new Re([this,"maximumLevel"],1,[1,24],"最大层级",Qn.defaults.maximumLevel),new Re([this,"minimumLevel"],1,[0,24],"最小层级",Qn.defaults.minimumLevel),new rt([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像切片规则",Qn.defaults.scheme),new rt([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考"),new at([this,"targetID"],"targetID")],more:[...t.more,new ht("通用"),new rt([this,"splitDirection"],rP,"splitDirection","NONE"),new ht("czm"),new N([this,"czmAlpha"],"透明度"),new N([this,"czmBrightness"],"亮度"),new N([this,"czmContrast"],"对比度"),new N([this,"czmHue"],"色相"),new N([this,"czmSaturation"],"饱和度"),new N([this,"czmGamma"],"伽马值")]}}};h(Qn,"createDefaultProps",()=>({...kt.createDefaultProps(),rectangle:Kt([-180,-90,180,90]),url:gt(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:Xt([]),scheme:z("xyz"),czmSplitDirection:"NONE",heightReference:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",targetID:"",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),h(Qn,"type",Qn.register("ESMVTLayer",Qn,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"用于加载矢量瓦片图层。"}));let $p=Qn;const is=class is extends st{constructor(e){super(e)}getESProperties(){return{...{...super.getESProperties()},basic:[new N([this,"radius"],"半径",is.defaults.radius),new N([this,"height"],"高度",is.defaults.height),new bt([this,"color"],"颜色",is.defaults.color),new dt([this,"materialParams"],"材质参数",is.defaults.materialParams)]}}};h(is,"createDefaultProps",()=>({...st.createDefaultProps(),radius:2,height:10,color:tt([.204,.596,.859,1]),materialParams:gt({ringSpeed:1,ringColor:[1,1,1,1],ringWidth:.03,sides:10,ringRatio:1,ringRepeat:1,ringBottomMove:!1})})),h(is,"type",is.register("ESCylinder",is,{chsName:"圆柱",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"圆柱体"}));let Jo=is;const Pi=class Pi extends Uu{constructor(e){super(e)}getESProperties(){const e=super.getESProperties();return{...e,dataSource:[...e.dataSource,new rt([this,"videoStreamType"],Pi.videoStreamTypes,"数据源类型",Pi.defaults.videoStreamType),new W([this,"looping"],"循环播放",Pi.defaults.looping),new W([this,"play"],"播放状态",Pi.defaults.play)]}}};h(Pi,"createDefaultProps",()=>({...Uu.createDefaultProps(),videoStreamType:"video",looping:!0,play:!0})),h(Pi,"type",Pi.register("ESMediaLayer",Pi,{chsName:"媒体图层",tags:["ESObjects","_ES_Impl_Cesium"],description:"用于添加数据源为图片或者视频的图层"})),h(Pi,"videoStreamTypes",[["video","video"],["hls","hls"],["flv","flv"],["img","img"]]);let Kp=Pi;const ss=class ss extends kt{constructor(t){super(t);h(this,"_getRepairPolygonEvent",this.disposeVar(new M));h(this,"_getIndicesEvent",this.disposeVar(new M));h(this,"_startEvent",this.disposeVar(new M))}getESProperties(){return{...{...super.getESProperties()},defaultMenu:"general",basic:[new dt([this,"urls"],"URL",ss.defaults.urls),new rt([this,"mode"],ss.modes,"模式",ss.defaults.mode),new ct("开始编辑",()=>this.start(),[])]}}get getRepairPolygonEvent(){return this._getRepairPolygonEvent}getRepairPolygon(){return new Promise((t,n)=>{const i=new U;i.ad(this._getRepairPolygonEvent.don(o=>{o!="get"&&t(o)})),this.getRepairPolygonEvent.emit("get");const s=setTimeout(()=>{i.isDestroyed()||(i.destroy(),t(void 0))},2e3);i.ad(()=>clearTimeout(s))})}get getIndicesEvent(){return this._getIndicesEvent}getIndices(){return new Promise((t,n)=>{const i=new U;i.ad(this._getIndicesEvent.don(o=>{o!="get"&&t(o)})),this.getIndicesEvent.emit("get");const s=setTimeout(()=>{i.isDestroyed()||(i.destroy(),t(void 0))},2e3);i.ad(()=>clearTimeout(s))})}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}};h(ss,"createDefaultProps",()=>({...kt.createDefaultProps(),urls:Xt([]),mode:"repair",allowPicking:!0})),h(ss,"type",ss.register("ESGltfModelEditing",ss,{chsName:"GLTF模型编辑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载GLTF模型的 ES 对象"})),h(ss,"modes",[["删除","delete"],["修复","repair"]]);let Zp=ss;const mo=class mo extends vr{constructor(t){super(t);h(this,"humans",[]);h(this,"humansOffset",new Map);this.ad(this.clear.bind(this)),this.updateHumans();const n=this.ad(Se(this.instancesCountChanged,this.radiusChanged));this.ad(n.don(this.updateHumans.bind(this)))}getESProperties(){const t=super.getESProperties();return{...t,basic:[...t.basic,new N([this,"instancesCount"],"实例数量",1,mo.defaults.instancesCount),new N([this,"radius"],"半径",1,mo.defaults.radius)]}}updateHumans(){for(this.clear();this.humans.length+1<this.instancesCount;){const t=new vr;this.humansOffset.set(t.id,[Math.random()*this.radius,Math.random()*this.radius,0]),this.humans.push(t),this.components.add(t),t.d(A([t,"show"],[this,"show"])),t.d(A([t,"allowPicking"],[this,"allowPicking"])),t.d(A([t,"scale"],[this,"scale"])),t.d(A([t,"collision"],[this,"collision"])),t.d(et([t,"flyInParam"],[this,"flyInParam"])),t.d(et([t,"flyToParam"],[this,"flyToParam"])),t.d(A([t,"animation"],[this,"animation"])),t.d(A([t,"mode"],[this,"mode"])),t.d(A([t,"minVisibleDistance"],[this,"minVisibleDistance"])),t.d(A([t,"maxVisibleDistance"],[this,"maxVisibleDistance"])),t.d(Ne([this.positionChanged],()=>{const n=Vd(this.position,this.humansOffset.get(t.id)??[0,0,0]);n&&(t.position=n)},{immediate:!0})),t.d(et([t,"rotation"],[this,"rotation"])),t.d(this.flyInEvent.don(n=>{t.flyIn(n)})),t.d(this.flyToEvent.don(n=>{t.flyTo(n)})),t.d(this.calcFlyToParamEvent.don(()=>{t.calcFlyToParam()})),t.d(this.calcFlyInParamEvent.don(()=>{t.calcFlyInParam()})),t.d(this.smoothMoveEvent.don((n,i)=>{t.smoothMove(n,i)})),t.d(this.smoothMoveWithRotationEvent.don((n,i,s)=>{t.smoothMoveWithRotation(n,i,s)})),t.d(this.smoothMoveOnGroundEvent.don((n,i,s,o)=>{t.smoothMoveOnGround(n,i,s,o)})),t.d(this.smoothMoveWithRotationOnGroundEvent.don((n,i,s,o,a)=>{t.smoothMoveWithRotationOnGround(n,i,s,o,a)})),t.d(this.automaticLandingEvent.don(()=>{t.automaticLanding()})),t.d(t.readyEvent.don(n=>{this.readyEvent.emit(n)}))}}clear(){this.humans.forEach(t=>{this.components.delete(t)}),this.humans=[],this.humansOffset.clear()}};h(mo,"createDefaultProps",()=>({...vr.createDefaultProps(),instancesCount:1,radius:1})),h(mo,"type",mo.register("ESHumans",mo,{chsName:"人员(批量)",tags:["ESObjects"],description:"批量创建ESHumans对象"}));let Qp=mo;const ma=class ma extends fn{constructor(t){super(t);h(this,"_line",this.ad(new fn));h(this,"_arrowPolygon",this.ad(new Bt));this.ad(this.components.disposableAdd(this.line,!0)),this.line.show=!1,this.ad(this.components.disposableAdd(this.arrowPolygon));const{line:n,arrowPolygon:i}=this;this.ad(et([n,"points"],[this,"points"])),this.ad(Ne([this.pointsChanged,this.modeChanged],()=>{this.updateArrowPolygon()},{immediate:!0})),this.ad(A([i,"show"],[this,"show"])),this.ad(A([i,"collision"],[this,"collision"])),this.ad(A([i,"allowPicking"],[this,"allowPicking"])),this.ad(A([i,"filled"],[this,"filled"])),this.ad(A([i,"fillGround"],[this,"fillGround"])),this.ad(A([i,"fillColor"],[this,"fillColor"])),this.ad(A([i,"fillMaterial"],[this,"fillMaterial"])),this.ad(A([i,"fillMaterialParams"],[this,"fillMaterialParams"])),this.ad(A([i,"stroked"],[this,"stroked"])),this.ad(A([i,"strokeGround"],[this,"strokeGround"])),this.ad(A([i,"strokeColor"],[this,"strokeColor"])),this.ad(A([i,"strokeMaterial"],[this,"strokeMaterial"])),this.ad(A([i,"strokeMaterialParams"],[this,"strokeMaterialParams"])),this.ad(A([i,"strokeWidth"],[this,"strokeWidth"])),this.ad(A([i,"strokeWidthType"],[this,"strokeWidthType"])),this.ad(A([i,"classificationType"],[this,"classificationType"]))}get line(){return this._line}get arrowPolygon(){return this._arrowPolygon}getESProperties(){const t={...super.getESProperties()};return{...t,style:[...t.style,new rt([this,"mode"],bd,"箭头模式",ma.defaults.mode)]}}updateArrowPolygon(){const t=this.points;if(!t||t.length<3){this._arrowPolygon.points=[];return}let n=Tf(t,this.mode,!0);n&&n.length>=3?this._arrowPolygon.points=[...n,n[0]]:this._arrowPolygon.points=[]}};h(ma,"createDefaultProps",()=>({...fn.createDefaultProps(),mode:"straightArrow",stroked:!1,filled:!0,fillStyle:gt({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),h(ma,"type",ma.register("ESAttackArrow",ma,{chsName:"进攻箭头",tags:["ESObjects","_ES_Impl_Cesium"],description:"进攻箭头,军事标绘箭头类,支持直箭头和燕尾箭头"}));let tg=ma;const va=class va extends qi{constructor(t){super(t);h(this,"esCylinder",this.dv(new Jo));const n=this.esCylinder;n.color=[1,1,1,0],this.ad(this.components.disposableAdd(this.esCylinder)),this.ad(A([n,"show"],[this,"show"])),this.ad(A([n,"collision"],[this,"collision"])),this.ad(A([n,"allowPicking"],[this,"allowPicking"])),this.ad(A([n,"position"],[this,"position"])),this.ad(A([n,"radius"],[this,"esCylinderRadius"])),this.ad(A([n,"height"],[this,"esCylinderHeight"])),this.ad(A([n,"materialParams"],[this,"esCylinderMaterialParams"])),this.ad(Ne(this.esCylinderRotationChanged,()=>{const i=this.esCylinderRotation;n.rotation=[i[0],i[1]-180,i[2]]},{immediate:!0}))}getESProperties(){const t=super.getESProperties();return{...t,basic:[...t.basic,new su([this,"esCylinderRotation"],"波动方向",va.defaults.esCylinderRotation),new N([this,"esCylinderRadius"],"半径",Jo.defaults.esCylinderRadius),new N([this,"esCylinderHeight"],"高度",Jo.defaults.esCylinderHeight),new dt([this,"esCylinderMaterialParams"],"材质参数",Jo.defaults.esCylinderMaterialParams)]}}};h(va,"createDefaultProps",()=>({...qi.createDefaultProps(),url:"${earthsdk3-assets-script-dir}/assets/glb/CesiumDrone.glb",esCylinderRotation:tt([0,0,0]),esCylinderRadius:2,esCylinderHeight:10,esCylinderMaterialParams:gt({ringSpeed:1,ringColor:[1,1,0,1],ringWidth:.03,sides:10,ringRatio:1,ringRepeat:10,ringBottomMove:!0})})),h(va,"type",va.register("ESSignalInterference",va,{chsName:"信号干扰",tags:["ESObjects"],description:"信号干扰"}));let eg=va;const Ns=class Ns extends U{constructor(){super();h(this,"_loading",!1);h(this,"_loadedEvent",this.disposeVar(new M));h(this,"_loaded",!1);h(this,"_loadedPromiseResolve");h(this,"_loadedPromise",new Promise(t=>{this._loadedPromiseResolve=t}));h(this,"_processing");this._processing=this.disposeVar(nr(async t=>{if(this._loading=!0,globalThis.Hls)console.info("可能系统已经加载hlsjs,此处不再加载!");else{const n=ut.context.getStrFromEnv(Ns.path);await t.promise(Kh(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 Ns._instance=Ns._instance||new Ns,Ns._instance}};h(Ns,"path","${xr-utils-script-dir}/xr-static/xr-utils/hlsjs/1.4.12/hls.min.js"),h(Ns,"_instance");let Th=Ns,iP=class extends U{constructor(t,n){super();h(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 sP extends U{constructor(t,n){super();h(this,"_videoDom");h(this,"_processing");this._complexImage=t,this._videoSrc=n,this._videoDom=this.disposeVar(new iP(this._complexImage,"")),this._processing=this.disposeVar(nr(async i=>{const{videoSrc:s}=this,o=Th.instance();await i.promise(o.loadedPromise);const a=globalThis.Hls,l=new a,u=this.element;await Eo(i,()=>new Promise((c,d)=>{u.xbsjHLS=l,l.attachMedia(u),l.on(a.Events.MEDIA_ATTACHED,()=>{l.loadSource(s),l.on(a.Events.MANIFEST_PARSED,(f,p)=>{u.play(),c()})}),l.on(a.Events.ERROR,(f,p)=>{const{type:_,details:S,fatal:b}=p;b&&(l.destroy(),d(S))})}))})),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 V_ extends U{constructor(t,n){super();h(this,"_videoDom");h(this,"_update");this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new sP(this._complexImage,this._imageUri)),this._update=this.disposeVar(Ta(()=>this.update())),this._update.start()}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 Ms=class Ms extends U{constructor(){super();h(this,"_loading",!1);h(this,"_loadedEvent",this.disposeVar(new M));h(this,"_loaded",!1);h(this,"_loadedPromiseResolve");h(this,"_loadedPromise",new Promise(t=>{this._loadedPromiseResolve=t}));h(this,"_processing");this._processing=this.disposeVar(nr(async t=>{if(this._loading=!0,globalThis.flvjs)console.info("可能系统已经加载flvjs,此处不再加载!");else{const n=ut.context.getStrFromEnv(Ms.path);await t.promise(Kh(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 Ms._instance=Ms._instance||new Ms,Ms._instance}};h(Ms,"path","${xr-utils-script-dir}/xr-static/xr-utils/flvjs/1.6.2/flv.min.js"),h(Ms,"_instance");let Oh=Ms;class oP extends U{constructor(t,n){super();h(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 aP extends U{constructor(t,n){super();h(this,"_videoDom");h(this,"_processing");this._complexImage=t,this._videoSrc=n,this._videoDom=this.disposeVar(new oP(this._complexImage,"")),this._processing=this.disposeVar(nr(async i=>{const{videoSrc:s}=this,o=Oh.instance();await i.promise(o.loadedPromise);const a=globalThis.flvjs,l=this.element;await Eo(i,()=>new Promise((u,c)=>{if(!a.isSupported()){c("flvjs不支持!");return}var d=a.createPlayer({type:"flv",url:s});d.attachMediaElement(l),d.load(),d.play(),l.xbsjFlvPlayer=d}))})),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 j_ extends U{constructor(t,n){super();h(this,"_videoDom");h(this,"_update");this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new aP(t,this._imageUri)),this._update=this.disposeVar(Ta(()=>this.update())),this._update.start()}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 B_(r){const e=r.substring(r.lastIndexOf(".")+1);return Ju.suffixTypes[e]}class Ju extends U{constructor(){super();h(this,"_enabled",this.disposeVar(z(!1)));h(this,"_uri",this.disposeVar(z("")));h(this,"_type",this.disposeVar(z(void 0)));h(this,"_size",this.disposeVar(Xt(void 0)));h(this,"_pixelFormat",this.disposeVar(z("RGBA")));h(this,"_flipY",this.disposeVar(z(!0)));h(this,"_crossOriginReact",this.disposeVar(z("")));h(this,"_autoplayReact",this.disposeVar(z(!0)));h(this,"_loopReact",this.disposeVar(z(!0)));h(this,"_copyTextureEvent",this.disposeVar(new M));h(this,"_imageProcessingResettingEvent",this.disposeVar(Se(this.enabledChanged,this.uriChanged,this.typeChanged)));h(this,"_imageProcessingResetting",this.disposeVar(new Ie(this._imageProcessingResettingEvent,()=>{if(!this.enabled||!this.uri)return;let{type:t}=this;if(t||(t=B_(this.uri)),!!t){if(t==="img")return new em(this,this.uri);if(t==="video")return new im(this,this.uri);if(t==="gif")return new fm(this,this.uri);if(t==="hls")return new V_(this,this.uri);if(t==="flv")return new j_(this,this.uri)}})));h(this,"_createNativeTextureEvent",this.disposeVar(Se(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})}}h(Ju,"types",rm),h(Ju,"czmPixelFormats",nm),h(Ju,"suffixTypes",{png:"img",jpg:"img",svg:"img",webp:"img",gif:"gif",mp4:"video",mov:"video",webm:"video",flv:"flv",m3u8:"hls"});const lP=[0,0,0,0];class uP{constructor(){h(this,"_value",[]);h(this,"_valueStr","[]");h(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 M),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=cc(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=lP;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 cP extends U{constructor(){super(...arguments);h(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 l=o;for(;o!=="ESSceneObject"&&(s=s.getParentClass(),!!s);)if(o=s.type,a=i.get(o),a)return console.warn(`未找到${l}在${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 $o(t,n);return s.createdEvent.emit(),s}}}class hP extends U{constructor(){super(...arguments);h(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 $o(t,n);return s.createdEvent.emit(),s}}}const Yr=class Yr extends U{constructor(t,n,i=!1){super();h(this,"_createdEvent",this.dv(new M));h(this,"_id",++Yr._accumId);this._sceneObject=t,this._viewer=n;{if(i)return;const s=(o,a)=>{for(let l of o)this._viewer.delete(l);for(let l of a)l.parentID=this.sceneObject.id,this._viewer.add(l)};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}};h(Yr,"context",new cP),h(Yr,"contextEditing",new hP),h(Yr,"register",Yr.context.register.bind(Yr.context)),h(Yr,"registerEditing",Yr.contextEditing.register.bind(Yr.contextEditing)),h(Yr,"_accumId",-1);let $o=Yr;function ue(r,e,t){return{content:[{type:"text",text:JSON.stringify({toolName:r,status:"error",msg:t?"执行失败,"+t:"执行失败",data:e},null,2)}]}}function mi(r,e,t){return{content:[{type:"text",text:JSON.stringify({toolName:r,status:"success",msg:t?"执行成功,"+t:"执行成功",data:e},null,2)}]}}const z_=r=>[{name:"flyTo",params:{description:"相机飞行定位,根据对象id来改变相机视角位置或查询真实地点名称信息来改变相机视角位置",inputSchema:{option:pe.discriminatedUnion("mode",[pe.object({mode:pe.literal("SceneObject").describe("对象定位模式:分析用户提供的名称是否是场景对象的名称"),id:pe.string().describe("场景对象的唯一标识 id")}).describe("分析用户提供的名称是否是场景对象的名称,是则使用 SceneObject 模式并使用该对象属性值id作为参数"),pe.object({mode:pe.literal("RealPlace").describe("真实地点定位模式:用于定位现实世界中的城市、国家或地名"),longitude:pe.number().min(-180).max(180).describe("经度,单位:度,范围 [-180, 180]"),latitude:pe.number().min(-90).max(90).describe("纬度,单位:度,范围 [-90, 90]"),height:pe.number().optional().default(0).describe("高度,单位:米,默认值为 0")}).describe("真实地点定位模式:用于定位现实世界中的城市、国家或地名,而非场景对象的名称,并主动提供经度、纬度和高度信息")]).describe(`相机定位参数规范:
466
466
  1. 分析用户提供的名称是否是场景对象的名称(通过名称对比所有对象的name属性,确定用户所指的是场景对象);
467
467
  2. 若找到对象,则使用 SceneObject 模式并使用该对象属性值id作为参数;
468
468
  3. 若未找到对象,则使用 RealPlace 模式,提供目标地点的经度、纬度和高度信息;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "earthsdk3",
3
- "version": "3.11.0-beta.24",
3
+ "version": "3.11.0-beta.25",
4
4
  "description": "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",
5
5
  "private": false,
6
6
  "type": "module",