mapv-cloudrenderengine 2.7.6 → 2.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{Vector2 as e,Vector3 as t,Quaternion as i,Matrix4 as n,MathUtils as a,Euler as o,Matrix3 as r,Layers as s,FileLoader as l,Color as d,Group as c,MeshBasicMaterial as u,PlaneBufferGeometry as h,Mesh as p,SpriteMaterial as f,Sprite as m}from"three";import g from"earcut";import*as y from"@tweenjs/tween.js";import v from"axios";import b from"@mars3d/heatmap.js";function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function S(e,t,i,n,a,o,r){try{var s=e[o](r),l=s.value}catch(e){return void i(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function N(e){return function(){var t=this,i=arguments;return new Promise((function(n,a){var o=e.apply(t,i);function r(e){S(o,n,a,r,s,"next",e)}function s(e){S(o,n,a,r,s,"throw",e)}r(void 0)}))}}function w(e,t,i){return t=E(t),L(e,I()?Reflect.construct(t,i||[],E(e).constructor):t.apply(e,i))}function U(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,W(n.key),n)}}function k(e,t,i){return t&&C(e.prototype,t),i&&C(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function T(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=G(e))||t){i&&(e=i);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,r=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return r=e.done,e},e:function(e){s=!0,o=e},f:function(){try{r||null==i.return||i.return()}finally{if(s)throw o}}}}function O(e,t,i){return(t=W(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function R(){return R="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=E(e)););return e}(e,t);if(n){var a=Object.getOwnPropertyDescriptor(n,t);return a.get?a.get.call(arguments.length<3?e:i):a.value}},R.apply(null,arguments)}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function z(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&D(e,t)}function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(I=function(){return!!e})()}function M(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function A(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?M(Object(i),!0).forEach((function(t){O(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):M(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function L(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function P(){P=function(){return t};var e,t={},i=Object.prototype,n=i.hasOwnProperty,a=Object.defineProperty||function(e,t,i){e[t]=i.value},o="function"==typeof Symbol?Symbol:{},r=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function d(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,i){return e[t]=i}}function c(e,t,i,n){var o=t&&t.prototype instanceof y?t:y,r=Object.create(o.prototype),s=new E(n||[]);return a(r,"_invoke",{value:k(e,i,s)}),r}function u(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",p="suspendedYield",f="executing",m="completed",g={};function y(){}function v(){}function b(){}var x={};d(x,r,(function(){return this}));var S=Object.getPrototypeOf,N=S&&S(S(z([])));N&&N!==i&&n.call(N,r)&&(x=N);var w=b.prototype=y.prototype=Object.create(x);function U(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function i(a,o,r,s){var l=u(e[a],e,o);if("throw"!==l.type){var d=l.arg,c=d.value;return c&&"object"==typeof c&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){i("next",e,r,s)}),(function(e){i("throw",e,r,s)})):t.resolve(c).then((function(e){d.value=e,r(d)}),(function(e){return i("throw",e,r,s)}))}s(l.arg)}var o;a(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,a){i(e,n,t,a)}))}return o=o?o.then(a,a):a()}})}function k(t,i,n){var a=h;return function(o,r){if(a===f)throw Error("Generator is already running");if(a===m){if("throw"===o)throw r;return{value:e,done:!0}}for(n.method=o,n.arg=r;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=f;var d=u(t,i,n);if("normal"===d.type){if(a=n.done?m:p,d.arg===g)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(a=m,n.method="throw",n.arg=d.arg)}}}function T(t,i){var n=i.method,a=t.iterator[n];if(a===e)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=e,T(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=u(a,t.iterator,i.arg);if("throw"===o.type)return i.method="throw",i.arg=o.arg,i.delegate=null,g;var r=o.arg;return r?r.done?(i[t.resultName]=r.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,g):r:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function z(t){if(t||""===t){var i=t[r];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,o=function i(){for(;++a<t.length;)if(n.call(t,a))return i.value=t[a],i.done=!1,i;return i.value=e,i.done=!0,i};return o.next=o}}throw new TypeError(typeof t+" is not iterable")}return v.prototype=b,a(w,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:v,configurable:!0}),v.displayName=d(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,d(e,l,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},U(C.prototype),d(C.prototype,s,(function(){return this})),t.AsyncIterator=C,t.async=function(e,i,n,a,o){void 0===o&&(o=Promise);var r=new C(c(e,i,n,a),o);return t.isGeneratorFunction(i)?r:r.next().then((function(e){return e.done?e.value:r.next()}))},U(w),d(w,l,"Generator"),d(w,r,(function(){return this})),d(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=z,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var i in this)"t"===i.charAt(0)&&n.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function a(n,a){return s.type="throw",s.arg=t,i.next=n,a&&(i.method="next",i.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var r=this.tryEntries[o],s=r.completion;if("root"===r.tryLoc)return a("end");if(r.tryLoc<=this.prev){var l=n.call(r,"catchLoc"),d=n.call(r,"finallyLoc");if(l&&d){if(this.prev<r.catchLoc)return a(r.catchLoc,!0);if(this.prev<r.finallyLoc)return a(r.finallyLoc)}else if(l){if(this.prev<r.catchLoc)return a(r.catchLoc,!0)}else{if(!d)throw Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return a(r.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var r=o?o.completion:{};return r.type=e,r.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(r)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),R(i),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var a=n.arg;R(i)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:z(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function D(e,t){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},D(e,t)}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,a,o,r,s=[],l=!0,d=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){d=!0,a=e}finally{try{if(!l&&null!=i.return&&(r=i.return(),Object(r)!==r))return}finally{if(d)throw a}}return s}}(e,t)||G(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(e,t,i,n){var a=R(E(e.prototype),t,i);return"function"==typeof a?function(e){return a.apply(i,e)}:a}function F(e){return function(e){if(Array.isArray(e))return x(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||G(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function H(e){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(e)}function G(e,t){if(e){if("string"==typeof e)return x(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?x(e,t):void 0}}var V={CLEAR_SKIES:"clearSkies",PARTLY_CLOUDY:"partlyCloudy",CLOUDY:"cloudy",FOGGY:"foggy",OVERCAST:"overcast",RAIN:"rain",LIGHT_RAIN:"lightRain",THUNDER_STORM:"thunderstorm",SNOW:"snow",LIGHT_SNOW:"lightSnow",BLIZZARD:"blizzard",SAND_DUST_CALM:"sandDustCalm",SAND_DUST_STORM:"sandDustStorm"},J={VOLUMETRIC_CLOUDS:"Volumetric Clouds",STATIC_CLOUDS:"Static Clouds",DYNAMIC_CLOUDS:"2D Dynamic Clouds",NO_CLOUDS:"No Clouds",VOLUMETRIC_AURORA:"Volumetric Aurora"},Y={SKY_ATMOSPHERE:"Sky Atmosphere",SIMPLIFIED_COLOR:"Simplified Color"},q={SET_MOUSE_CURSOR_SHOW:"setMouseCursorShow",SET_CLICK_EVENT:"setClickEvent",SET_EDIT_STATUS:"setEditStatus",SWITCH_EDIT_MODE:"switchEditMode",SAVE_EDIT_RESULT:"saveEditResult",ZOOM_IN:"zoomIn",ZOOM_OUT:"zoomOut",EXIT:"exitClient",ENABLE_TERRAIN:"enableTerrain",ENABLE_POI:"enablePOIByTag",PRELOAD_LOCATION:"preLoadLocation",FOCUS_ACTOR_BY_ID:"focusActorByID",ENABLE_DATALAYER:"Scene_enableDataLayerByName",ENABLE_FPS:"Scene_setFPS",OBJECT_BOUNDINGBOX:"Interact_objectBoundingBox",ASSET_MODEL:"Gis_generateAssetModel",BUILD_GROWTHANIMATE:"Interact_buildGrowth",ENABLE_L2_BUILDING_SELECT:"Interact_enableBuildingL2Select"},X={NAVIGATION:"Camera_navigation",NAVIGATION_PAUSE:"Camera_navigationPause",NAVIGATION_STOP:"Camera_navigationStop",MOVE_TO:"Camera_moveTo",ZOOM_IN:"Camera_zoomIn",ZOOM_OUT:"Camera_zoomOut",PROJECT:"Camera_project",UNPROJECT:"Camera_unproject",UPDATE:"Camera_update",FOCUS_ON:"Camera_focusOn",Constrain_Shape:"Camera_constrainShape",MOVE:"Camera_move",ROTATE:"Camera_rotate",RESET_CAMERA_FOCUS:"Camera_resetCameraFocus"},K={ENABLE_3DTILES_BY_NAME:"Scene_enableTilesByName",SWITCH_TERRAIN_MODE:"Scene_switchTerrainMode",HIDDEN_3DTILES_ITEM:"Scene_hiddenTilesItem",EVENT_LAYER_BUILDING:"Scene_eventLayerBuilding",UPDATA_SLOPE_ANALYSIS:"Scene_updateSlopeAnalysis",GET_ALTITUDE:"Scene_getAltitude",SET_PLANE_POI_MODE:"Scene_setPlanePoiMode"},Q={EXIT_CLIENT:"Application_exitClient",RESTART_LEVEL:"Application_restartLevel",OPEN_LEVEL:"Application_openLevel",RESTART_GAME:"Application_restartGame",CREATE_TRAFFIC_STREAM:"Application_createTrafficStream",CLOSE_TRAFFIC_STREAM:"Application_closeTrafficStream",FOLLOW_TRAFFIC_STREAM_ITEM:"Application_followTrafficStreamItem",ADD_EVENT_LISTENER:"Application_addEvent",REMOVE_EVENT_LISTENER:"Application_removeEvent",RESET_WORLD_CENTER:"Application_resetWorldCenter",CONSOLE_COMMAND:"Application_ConsoleCommand"},Z={ADD:"Gis_AddCommonGISLayer",REMOVE:"Gis_RemoveCommonGISLayer",DESTORY:"Gis_DestoryCommonGISLayer",DESTORY_ALL:"Gis_DestoryAllGenerationLayer",UPDATE:"Gis_UpdateCommonGISLayer",VISIBLE:"Gis_VisibleCommonGISLayer"},ee={ENABLE_DRAW:"Gis_enableDraw",CLOSE_DRAW:"Gis_closeDraw",ENABLE_MEASURE:"Gis_enableMeasure",CLOSE_MEASURE:"Gis_closeMeasure",DESTORY_DRAW:"Gis_clearDraw",DESTORY_MEASURE:"Gis_clearMeasure"},te={SOLID:"solid",DASHED:"dashed",ARROW:"arrow",GRADIENT:"gradient"},ie=O({CENTER:"Ground_Center",STAND:"Stand",SIDE:"Ground_Side"},"SIDE","Cylinder"),ne={LINEAR:"Linear",CURVE:"Curve",CONSTANT:"Constant"},ae={QualityControlOwnership:0,Response:1,Command:2,FreezeFrame:3,UnfreezeFrame:4,VideoEncoderAvgQP:5,LatencyTest:6,InitialSettings:7,FileExtension:8,FileMimeType:9,FileContents:10,Mouse:21,Keyboard:22,InputControlOwnership:12,Protocol:255},oe={LockedMouse:0,HoveringMouse:1},re={controlScheme:oe.HoveringMouse,suppressBrowserKeys:!1,fakeMouseWithTouches:!1},se={IFrameRequest:0,RequestQualityControl:1,FpsRequest:2,AverageBitrateRequest:3,StartStreaming:4,StopStreaming:5,LatencyTest:6,RequestInitialSettings:7,UIInteraction:50,Command:51,KeyDown:60,KeyUp:61,KeyPress:62,MouseEnter:70,MouseLeave:71,MouseDown:72,MouseUp:73,MouseMove:74,MouseWheel:75,TouchStart:80,TouchEnd:81,TouchMove:82,GamepadButtonPressed:90,GamepadButtonReleased:91,GamepadAnalog:92},le={MainButton:0,AuxiliaryButton:1,SecondaryButton:2,FourthButton:3,FifthButton:4},de={PrimaryButton:1,SecondaryButton:2,AuxiliaryButton:4,FourthButton:8,FifthButton:16},ce={BackSpace:8,Shift:16,Control:17,Alt:18,RightShift:253,RightControl:254,RightAlt:255},he={FIRE_BIG:"P_Fire_Big",FIRE_SMALL:"P_Fire_Small",FIRE_FLAMETHROWER:"P_Flamethrower",SMOKE_SMALL_BLACK:"P_Smoke_A",SMOKE_BIG_BLACK:"P_Smoke_B",SMOKE_SMALL_YELLOW:"P_Smoke_C",SMOKE_BIG_YELLOW:"P_Smoke_D",SPARK_A:"P_Sparks_E",FOG_MASS:"P_Mass_Fog",NS_Spark:"NS_Spark",NS_Firefly:"NS_Firefly"},pe=Object.freeze({__proto__:null,ApplicationControl:Q,CameraControl:X,ControlSchemeType:oe,DrawAndMeasureControl:ee,GisControl:Z,InteractMOD:q,LineDirectionOptions:ie,LineSplineTypeOptions:ne,LineTypeOptions:te,MessageType:se,MouseButton:le,MouseButtonsMask:de,ParticleKind:he,SceneControl:K,SkyColorMode:Y,SkyMode:J,SpecialKeyCodes:ce,ToClientMessageType:ae,UDS:V,WS_OPEN_STATE:1,inputOptions:re}),fe=function(){return k((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};U(this,e),this.cloudRender=t,this.weather=i.weather||V.PARTLY_CLOUDY,this.hour=i.hour||14,this.minute=i.minute||30,this.weatherType=V,this.init()}),[{key:"changeWeather",value:function(e){e&&(Object.values(V).indexOf(e)<0||(this.weather=e,this.cloudRender.emitUIInteraction({excuteName:"Scene_changeWeather",params:{WeatherType:e}})))}},{key:"changeTime",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.hour=e,this.minute=Math.floor(10*t/6);var i=(this.hour<10?"0"+this.hour:""+this.hour)+(this.minute<10?"0"+this.minute:""+this.minute);this.cloudRender.emitUIInteraction({excuteName:"Scene_changeTime",params:{Time:i}})}},{key:"setVolumeFog",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,i=Math.max(Math.min(1e5,t),10);this.cloudRender.emitUIInteraction({excuteName:"Scene_setVolumenFog",params:{Enable:e,Distance:100*i}})}},{key:"setAtmosphericFog",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.0075,t=Math.max(Math.min(1,e),0);this.cloudRender.emitUIInteraction({excuteName:"Scene_setBaseFog",params:{BaseFogDensity:t}})}},{key:"setSkyMode",value:function(e){return!!e&&(!(Object.values(J).indexOf(e)<0)&&void this.cloudRender.emitUIInteraction({excuteName:"Scene_setSkyMode",params:{SkyMode:e}}))}},{key:"setSkyColorMode",value:function(e){return!!e&&(!(Object.values(Y).indexOf(e)<0)&&void this.cloudRender.emitUIInteraction({excuteName:"Scene_setSkyColorMode",params:{SkyColorMode:e}}))}},{key:"changeWeatherEffectParameters",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Scene_changeWeatherEffects",params:JSON.stringify(e)})}},{key:"init",value:function(){this.changeWeather(this.weather),this.changeTime(this.hour,this.minute)}}])}(),me=["BMap","Sentinel2","NaturalEarth"],ge=function(){return k((function e(t){U(this,e),this.cloudRender=t,this.earthCloud={VisMode:"Auto"},this.earthRoadNetwork={VisMode:"Auto",Opacity:.2,Color:"rgb(255, 255, 255)",Brightness:6},this.earthTiles={TilesType:"BMap"}}),[{key:"_changeEnvironment",value:function(e,t,i){t?(this[i]=A(A({},this[i]),t),this.cloudRender&&this.cloudRender.emitUIInteraction({excuteName:"Scene_SeqEnvironment",params:{environment:e,properties:A({},this[i])}})):console.warn("".concat(e," params is required"))}},{key:"changeEarthCloud",value:function(e){this._changeEnvironment("EarthCloud",e,"earthCloud")}},{key:"changeEarthRoadNetwork",value:function(e){this._changeEnvironment("EarthRoadNetwork",e,"earthRoadNetwork")}},{key:"changeEarthTiles",value:function(e){e&&e.TilesType&&!me.includes(e.TilesType)?console.warn("TilesType ".concat(e.TilesType," is not supported")):this._changeEnvironment("EarthTiles",e,"earthTiles")}}])}(),ye=function(e){e=void 0!==e?e:{},this.forceTURN=e.forceTURN;var t=this,i=new URLSearchParams(window.location.search);this.cfg=void 0!==e.peerConnectionOptions?e.peerConnectionOptions:{},this.cfg.sdpSemantics="unified-plan",this.cfg.offerExtmapAllowMixed=!1,i.has("ForceTURN")&&(this.forceTURN=i.has("ForceTURN")),this.forceTURN&&(console.log("Forcing TURN usage by setting ICE Transport Policy in peer connection config."),this.cfg.iceTransportPolicy="relay"),this.cfg.bundlePolicy="balanced",this.forceMaxBundle=i.has("ForceMaxBundle"),this.forceMaxBundle&&(this.cfg.bundlePolicy="max-bundle"),this.pcClient=null,this.dcClient=null,this.tnClient=null,this.sdpConstraints={offerToReceiveAudio:1,offerToReceiveVideo:1,voiceActivityDetection:!1},this.dataChannelOptions={ordered:!0,maxPacketLifeTime:3e3},this.startVideoMuted=void 0!==e.startVideoMuted&&e.startVideoMuted,this.autoPlayAudio=void 0===e.autoPlayAudio||e.autoPlayAudio,this.useMic=i.has("useMic"),this.useMic||console.log("Microphone access is not enabled. Pass ?useMic in the url to enable it.");var n="localhost"===location.hostname||"127.0.0.1"===location.hostname,a="https:"===location.protocol;!this.useMic||n||a||(this.useMic=!1,console.error("Microphone access in the browser will not work if you are not on HTTPS or localhost. Disabling mic access."),console.error("For testing you can enable HTTP microphone access Chrome by visiting chrome://flags/ and enabling 'unsafely-treat-insecure-origin-as-secure'")),this.preferSFU=i.has("preferSFU"),console.log(this.preferSFU?"The browser will signal it would prefer an SFU connection. Remove ?preferSFU from the url to signal for P2P usage.":"The browser will signal for a P2P connection. Pass ?preferSFU in the url to signal for SFU usage."),this.latencyTestTimings={TestStartTimeMs:null,UEReceiptTimeMs:null,UEEncodeMs:null,UECaptureToSendMs:null,UETransmissionTimeMs:null,BrowserReceiptTimeMs:null,FrameDisplayDeltaTimeMs:null,Reset:function(){this.TestStartTimeMs=null,this.UEReceiptTimeMs=null,this.UEEncodeMs=null,this.UECaptureToSendMs=null,this.UETransmissionTimeMs=null,this.BrowserReceiptTimeMs=null,this.FrameDisplayDeltaTimeMs=null},SetUETimings:function(e){this.UEReceiptTimeMs=e.ReceiptTimeMs,this.UEEncodeMs=e.EncodeMs,this.UECaptureToSendMs=e.CaptureToSendMs,this.UETransmissionTimeMs=e.TransmissionTimeMs,this.BrowserReceiptTimeMs=Date.now(),this.OnAllLatencyTimingsReady(this)},SetFrameDisplayDeltaTime:function(e){null==this.FrameDisplayDeltaTimeMs&&(this.FrameDisplayDeltaTimeMs=Math.round(e),this.OnAllLatencyTimingsReady(this))},OnAllLatencyTimingsReady:function(e){}},this.createWebRtcVideo=function(){var e=document.createElement("video");if(e.id="streamingVideo",e.playsInline=!0,e.disablepictureinpicture=!0,e.muted=t.startVideoMuted,e.addEventListener("loadedmetadata",(function(e){t.onVideoInitialised&&t.onVideoInitialised()}),!0),"requestVideoFrameCallback"in HTMLVideoElement.prototype){var i=function(n,a){if(a.receiveTime&&a.expectedDisplayTime){var o=a.presentationTime-a.receiveTime;t.aggregatedStats||(t.aggregatedStats={}),t.aggregatedStats.receiveToCompositeMs=o}e.requestVideoFrameCallback(i)};e.requestVideoFrameCallback(i)}return e},this.video=this.createWebRtcVideo(),this.availableVideoStreams=new Map;var o=function(e){console.info("Signaling state change. |",e.srcElement.signalingState,"|")},r=function(e){console.info("Browser ICE connection |",e.srcElement.iceConnectionState,"|")},s=function(e){console.info("Browser ICE gathering |",e.srcElement.iceGatheringState,"|")},l=function(e){if(e.track&&console.log("Got track. | Kind="+e.track.kind+" | Id="+e.track.id+" | readyState="+e.track.readyState+" |"),"audio"!=e.track.kind){e.track.kind;var i,n=T(e.streams);try{for(n.s();!(i=n.n()).done;){var a=i.value;t.availableVideoStreams.has(a.id)||t.availableVideoStreams.set(a.id,a)}}catch(e){n.e(e)}finally{n.f()}t.video.srcObject=e.streams[0],e.track.onunmute=function(){t.video.srcObject=e.streams[0],t.onNewVideoTrack(e.streams)}}else d(e.streams[0])},d=function(e){if(t.video.srcObject!=e&&t.video.srcObject&&t.video.srcObject!==e){var i=document.createElement("Audio");if(i.srcObject=e,t.autoPlayAudio)i.play();else{var n=function(){i.play(),t.video.removeEventListener("click",n)};t.video.addEventListener("click",n)}console.log("Created new audio element to play seperate audio stream.")}},c=function(e){console.log("Data channel created for us by browser as we are a receiving peer."),t.dcClient=e.channel,u(t.dcClient)},u=function(e){try{return e.binaryType="arraybuffer",e.onopen=function(e){console.log("Data channel connected"),t.onDataChannelConnected&&t.onDataChannelConnected()},e.onclose=function(e){console.log("Data channel connected",e)},e.onmessage=function(e){if(t.onDataChannelMessage)if("string"==typeof e.data){var i=function(e){var t,i,n=new Array;t=e.length;for(var a=0;a<t;a++)(i=e.charCodeAt(a))>=65536&&i<=1114111?(n.push(i>>18&7|240),n.push(i>>12&63|128),n.push(i>>6&63|128),n.push(63&i|128)):i>=2048&&i<=65535?(n.push(i>>12&15|224),n.push(i>>6&63|128),n.push(63&i|128)):i>=128&&i<=2047?(n.push(i>>6&31|192),n.push(63&i|128)):n.push(255&i);return new Uint8Array(n).buffer}(e.data);t.onDataChannelMessage(i)}else t.onDataChannelMessage(e.data)},e.onerror=function(e){console.error("Data channel error",e)},e}catch(e){return console.warn("No data channel",e),null}},h=function(e){var i=e.candidate;i&&i.candidate&&(console.log("%c[Browser ICE candidate]","background: violet; color: black","| Type=",i.type,"| Protocol=",i.protocol,"| Address=",i.address,"| Port=",i.port,"|"),t.onWebRtcCandidate(i))},p=function(e){e.sdp=e.sdp.replace("useinbandfec=1","useinbandfec=1;stereo=1;sprop-maxcapturerate=48000")},f=function(e){e.onsignalingstatechange=o,e.oniceconnectionstatechange=r,e.onicegatheringstatechange=s,e.ontrack=l,e.onicecandidate=h,e.ondatachannel=c},m=function(){var e=N(P().mark((function e(i){var n,a,o,r,s,l,d,c,u,h,p,f;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.getTransceivers().length>0,i.addTransceiver("video",{direction:"recvonly"}),t.useMic){e.next=6;break}i.addTransceiver("audio",{direction:"recvonly"}),e.next=11;break;case 6:return a=!!t.useMic&&{autoGainControl:!1,channelCount:1,echoCancellation:!1,latency:0,noiseSuppression:!1,sampleRate:48e3,volume:1},e.next=9,navigator.mediaDevices.getUserMedia({video:!1,audio:a});case 9:if(o=e.sent)if(n){r=T(i.getTransceivers());try{for(r.s();!(s=r.n()).done;)if((l=s.value)&&l.receiver&&l.receiver.track&&"audio"===l.receiver.track.kind){d=T(o.getTracks());try{for(d.s();!(c=d.n()).done;)(u=c.value).kind&&"audio"==u.kind&&(l.sender.replaceTrack(u),l.direction="sendrecv")}catch(e){d.e(e)}finally{d.f()}}}catch(e){r.e(e)}finally{r.f()}}else{h=T(o.getTracks());try{for(h.s();!(p=h.n()).done;)(f=p.value).kind&&"audio"==f.kind&&i.addTransceiver(f,{direction:"sendrecv"})}catch(e){h.e(e)}finally{h.f()}}else i.addTransceiver("audio",{direction:"recvonly"});case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();this.setVideoEnabled=function(e){t.video.srcObject.getTracks().forEach((function(t){return t.enabled=e}))},this.startLatencyTest=function(e){t.video&&(t.latencyTestTimings.Reset(),t.latencyTestTimings.TestStartTimeMs=Date.now(),e(t.latencyTestTimings.TestStartTimeMs))},this.handleCandidateFromServer=function(e){var i=new RTCIceCandidate(e);console.log("%c[Unreal ICE candidate]","background: pink; color: black","| Type=",i.type,"| Protocol=",i.protocol,"| Address=",i.address,"| Port=",i.port,"|"),t.forceTURN&&i.candidate.indexOf("relay")<0?console.warn("Dropping candidate because it was not TURN relay.","| Type=",i.type,"| Protocol=",i.protocol,"| Address=",i.address,"| Port=",i.port,"|"):t.pcClient.addIceCandidate(i).catch((function(e){console.error("Failed to add ICE candidate",e)}))},this.createOffer=function(){t.pcClient&&(console.log("Closing existing PeerConnection"),t.pcClient.close(),t.pcClient=null),t.pcClient=new RTCPeerConnection(t.cfg),f(t.pcClient),m(t.pcClient).finally((function(){var e,i,n,a;t.dcClient=(e=t.pcClient,i="cirrus",n=t.dataChannelOptions,a=e.createDataChannel(i,n),console.log("Created datachannel (".concat(i,")")),u(a),a),function(e){e.createOffer(t.sdpConstraints).then((function(i){p(i),e.setLocalDescription(i),t.onWebRtcOffer&&t.onWebRtcOffer(i)}),(function(){console.warn("Couldn't create offer")}))}(t.pcClient)}))},this.receiveOffer=function(e){var i=new RTCSessionDescription(e);t.pcClient||(console.log("Creating a new PeerConnection in the browser.",t.cfg),t.pcClient=new RTCPeerConnection(t.cfg),f(t.pcClient),t.pcClient.setRemoteDescription(i).then((function(){m(t.pcClient).finally((function(){t.pcClient.createAnswer().then((function(e){return t.pcClient.setLocalDescription(e)})).then((function(){t.onWebRtcAnswer&&t.onWebRtcAnswer(t.pcClient.currentLocalDescription)})).then((function(){var e,i=T(t.pcClient.getReceivers());try{for(i.s();!(e=i.n()).done;)e.value.playoutDelayHint=0}catch(e){i.e(e)}finally{i.f()}})).catch((function(e){return console.error("createAnswer() failed:",e)}))}))})))},this.receiveAnswer=function(e){var i=new RTCSessionDescription(e);t.pcClient.setRemoteDescription(i);var n,a=T(t.pcClient.getReceivers());try{for(a.s();!(n=a.n()).done;)n.value.playoutDelayHint=0}catch(e){a.e(e)}finally{a.f()}},this.close=function(){t.pcClient&&(console.log("Closing existing peerClient"),t.pcClient.close(),t.pcClient=null),t.aggregateStatsIntervalId&&clearInterval(t.aggregateStatsIntervalId)},this.send=function(e){if(t.dcClient&&"open"==t.dcClient.readyState)try{t.dcClient.send(e)}catch(e){console.error("dcClient.send error: ",e)}},this.getStats=function(e){t.pcClient&&e&&t.pcClient.getStats(null).then((function(t){e(t)}))},this.aggregateStats=function(e){var i=(t.aggregatedStats||(t.aggregatedStats={}),function(e){var i={};e.forEach((function(e){"inbound-rtp"!=e.type||e.isRemote||"video"!=e.mediaType&&!e.id.toLowerCase().includes("video")||(i.timestamp=e.timestamp,i.bytesReceived=e.bytesReceived,i.framesDecoded=e.framesDecoded,i.packetsLost=e.packetsLost,i.bytesReceivedStart=t.aggregatedStats&&t.aggregatedStats.bytesReceivedStart?t.aggregatedStats.bytesReceivedStart:e.bytesReceived,i.framesDecodedStart=t.aggregatedStats&&t.aggregatedStats.framesDecodedStart?t.aggregatedStats.framesDecodedStart:e.framesDecoded,i.timestampStart=t.aggregatedStats&&t.aggregatedStats.timestampStart?t.aggregatedStats.timestampStart:e.timestamp,t.aggregatedStats&&t.aggregatedStats.timestamp&&(t.aggregatedStats.bytesReceived&&(i.bitrate=8*(i.bytesReceived-t.aggregatedStats.bytesReceived)/(i.timestamp-t.aggregatedStats.timestamp),i.bitrate=Math.floor(i.bitrate),i.lowBitrate=t.aggregatedStats.lowBitrate&&t.aggregatedStats.lowBitrate<i.bitrate?t.aggregatedStats.lowBitrate:i.bitrate,i.highBitrate=t.aggregatedStats.highBitrate&&t.aggregatedStats.highBitrate>i.bitrate?t.aggregatedStats.highBitrate:i.bitrate),t.aggregatedStats.bytesReceivedStart&&(i.avgBitrate=8*(i.bytesReceived-t.aggregatedStats.bytesReceivedStart)/(i.timestamp-t.aggregatedStats.timestampStart),i.avgBitrate=Math.floor(i.avgBitrate)),t.aggregatedStats.framesDecoded&&(i.framerate=(i.framesDecoded-t.aggregatedStats.framesDecoded)/((i.timestamp-t.aggregatedStats.timestamp)/1e3),i.framerate=Math.floor(i.framerate),i.lowFramerate=t.aggregatedStats.lowFramerate&&t.aggregatedStats.lowFramerate<i.framerate?t.aggregatedStats.lowFramerate:i.framerate,i.highFramerate=t.aggregatedStats.highFramerate&&t.aggregatedStats.highFramerate>i.framerate?t.aggregatedStats.highFramerate:i.framerate),t.aggregatedStats.framesDecodedStart&&(i.avgframerate=(i.framesDecoded-t.aggregatedStats.framesDecodedStart)/((i.timestamp-t.aggregatedStats.timestampStart)/1e3),i.avgframerate=Math.floor(i.avgframerate)))),"track"!=e.type||"video_label"!=e.trackIdentifier&&"video"!=e.kind||(i.framesDropped=e.framesDropped,i.framesReceived=e.framesReceived,i.framesDroppedPercentage=e.framesReceived>0?e.framesDropped/e.framesReceived*100:0,i.frameHeight=e.frameHeight,i.frameWidth=e.frameWidth,i.frameHeightStart=t.aggregatedStats&&t.aggregatedStats.frameHeightStart?t.aggregatedStats.frameHeightStart:e.frameHeight,i.frameWidthStart=t.aggregatedStats&&t.aggregatedStats.frameWidthStart?t.aggregatedStats.frameWidthStart:e.frameWidth),"inbound-rtp"!=e.type||"video"!=e.mediaType&&"video"!=e.kind||(e.frameHeight&&!i.frameHeight&&(i.frameHeight=e.frameHeight),e.frameWidth&&!i.frameWidth&&(i.frameWidth=e.frameWidth),void 0!==e.framesDropped&&void 0===i.framesDropped&&(i.framesDropped=e.framesDropped),void 0!==e.framesReceived&&void 0===i.framesReceived&&(i.framesReceived=e.framesReceived,i.framesReceived>0&&void 0!==i.framesDropped&&(i.framesDroppedPercentage=i.framesDropped/i.framesReceived*100))),"candidate-pair"==e.type&&e.hasOwnProperty("currentRoundTripTime")&&0!=e.currentRoundTripTime&&(i.currentRoundTripTime=e.currentRoundTripTime)})),t.aggregatedStats.receiveToCompositeMs&&(i.receiveToCompositeMs=t.aggregatedStats.receiveToCompositeMs,t.latencyTestTimings.SetFrameDisplayDeltaTime(t.aggregatedStats.receiveToCompositeMs)),t.aggregatedStats=i,t.onAggregatedStats&&t.onAggregatedStats(i)});t.aggregateStatsIntervalId=setInterval((function(){t.getStats(i)}),e)}};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===i&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}("/* 视频流送的视频组件样式 */\nvideo {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n\n/* 视频流送的整体根组件属性 */\n#player {\n width: 100%;\n height: 100%;\n position: relative;\n background-color: #000;\n}\n\n/* 如果不是链接后直接加载(即connect_on_load: false)那么便会显示该画面,用于配置显示蒙版的样式 */\n#videoPlayOverlay {\n z-index: 30;\n position: absolute;\n font-size: 1.8em;\n width: 100%;\n height: 100%;\n color: white;\n background-color: rgba(100, 100, 100, .7);\n}\n\n/* State for element to be clickable */\n/* 待开始页面显示状态的样式 */\n.clickableState {\n align-items: center;\n justify-content: center;\n display: flex;\n cursor: pointer;\n}\n\n.textDisplayState {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n/* State to hide overlay, WebRTC communication is in progress and or is playing */\n/* 待开始页面隐藏 */\n.hiddenState {\n display: none;\n}\n\n/* 如果不是链接后直接加载(即connect_on_load: false)那么便会显示该按钮文字,用于配置显示样式 */\n#playButton {\n display: inline-block;\n height: auto;\n}");var ve=function(){return k((function e(){U(this,e)}),[{key:"addEventListener",value:function(e,t){void 0===this._listeners&&(this._listeners={}),this._needsDispatchedToUE=!1;var i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&(i[e].push(t),this._needsDispatchedToUE=!0,this._dispatchAddListenerTypes||(this._dispatchAddListenerTypes=[]),this._dispatchAddListenerTypes.push(e))}},{key:"hasEventListener",value:function(e,t){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)}},{key:"removeEventListener",value:function(e,t){if(void 0!==this._listeners){this._needsDispatchedToUE=!1;var i=this._listeners[e];if(void 0!==i){var n=i.indexOf(t);-1!==n&&(i.splice(n,1),this._needsDispatchedToUE=!0,this._dispatchRemoveListenerTypes||(this._dispatchRemoveListenerTypes=[]),this._dispatchRemoveListenerTypes.push(e))}}}},{key:"dispatchEvent",value:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var i=t.slice(0),n=0,a=i.length;n<a;n++)e.index=n,i[n].call(this,e);e.target=null}}}},{key:"_silentlyRemoveEventListener",value:function(e,t,i){if(e&&i&&void 0!==e._listeners){var n=e._listeners[t];if(void 0!==n){var a=n.indexOf(i);-1!==a&&n.splice(a,1)}}}}])}(),be=function(){function t(i){var n;return U(this,t),(n=w(this,t)).haveEvents="GamepadEvent"in window,n.haveWebkitEvents="WebKitGamepadEvent"in window,n.cloudRenderEngine=i,n.playerElement=document.getElementById("player"),n.promiseResponses=[],n.scene=n.cloudRenderEngine.scene,n.interactiveObjects=new Map,n.blacklist=new Set,n.mousedownTime=null,n.mouse=new e(0,0),n.selection=[],n.logMessages=!1,n.inputOptions=i.inputOptions,n.playerElement&&(n.playerElement.tabIndex<10&&(n.playerElement.tabIndex=1e3),n.playerElement.addEventListener("contextmenu",(function(e){e.preventDefault()}),!1)),n}return z(t,ve),k(t,[{key:"updateObjectsWithEvent",value:function(){var e=new Map;this.scene&&this.scene.children.length&&this.scene.children.forEach((function(t,i){t._listeners&&e.set(t.uuid,t)})),this.interactiveObjects.clear(),this.interactiveObjects=e}},{key:"isKeyCodeBrowserKey",value:function(e){return e>=112&&e<=123||9===e}},{key:"getKeyCode",value:function(e){return e.keyCode===ce.Shift&&"ShiftRight"===e.code?ce.RightShift:e.keyCode===ce.Control&&"ControlRight"===e.code?ce.RightControl:e.keyCode===ce.Alt&&"AltRight"===e.code?ce.RightAlt:e.keyCode}},{key:"registerKeyboardEvents",value:function(){var e=this;document.onkeydown=function(t){e.print_inputs&&console.log("key down ".concat(t.keyCode,", repeat = ").concat(t.repeat)),e.cloudRenderEngine.sendInputData(new Uint8Array([se.KeyDown,e.getKeyCode(t),t.repeat]).buffer),t.keyCode===ce.BackSpace&&document.onkeypress({charCode:ce.BackSpace}),e.inputOptions.suppressBrowserKeys&&e.isKeyCodeBrowserKey(t.keyCode)&&t.preventDefault()},document.onkeyup=function(t){e.print_inputs&&console.log("key up ".concat(t.keyCode)),e.cloudRenderEngine.sendInputData(new Uint8Array([se.KeyUp,e.getKeyCode(t)]).buffer),e.inputOptions.suppressBrowserKeys&&e.isKeyCodeBrowserKey(t.keyCode)&&t.preventDefault()},document.onkeypress=function(t){e.print_inputs&&console.log("key press ".concat(t.charCode));var i=new DataView(new ArrayBuffer(3));i.setUint8(0,se.KeyPress),i.setUint16(1,t.charCode,!0),e.cloudRenderEngine.sendInputData(i.buffer)}}},{key:"resizePlayerStyleToFillWindow",value:function(e){var t=e.getElementsByTagName("VIDEO"),i=window.innerHeight/window.innerWidth,n=e.clientHeight/e.clientWidth,a=t.videoHeight/t.videoWidth;isNaN(a)?(this.styleWidth=window.innerWidth,this.styleHeight=window.innerHeight,this.styleTop=0,this.styleLeft=0,e.style="top: "+this.styleTop+"px; left: "+this.styleLeft+"px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional):i<n?(this.styleWidth=Math.floor(window.innerHeight/a),this.styleHeight=window.innerHeight,this.styleTop=0,this.styleLeft=Math.floor(.5*(window.innerWidth-this.styleWidth)),e.style="top: "+this.styleTop+"px; left: "+this.styleLeft+"px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional):(this.styleWidth=window.innerWidth,this.styleHeight=Math.floor(window.innerWidth*a),this.styleTop=Math.floor(.5*(window.innerHeight-this.styleHeight)),this.styleLeft=0,e.style="top: "+this.styleTop+"px; left: "+this.styleLeft+"px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional)}},{key:"resizePlayerStyleToActualSize",value:function(e){var t=e.getElementsByTagName("VIDEO");if(t.length>0){this.styleWidth=t[0].videoWidth,this.styleHeight=t[0].videoHeight;var i=Math.floor(.5*(window.innerHeight-this.styleHeight)),n=Math.floor(.5*(window.innerWidth-this.styleWidth));this.styleTop=i>0?i:0,this.styleLeft=n>0?n:0,e.style="top: "+this.styleTop+"px; left: "+this.styleLeft+"px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional}}},{key:"resizePlayerStyleToArbitrarySize",value:function(e){e.style="top: 0px; left: 0px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional}},{key:"setupFreezeFrameOverlay",value:function(){this.cloudRenderEngine.freezeFrameOverlay=document.createElement("div"),this.cloudRenderEngine.freezeFrameOverlay.id="this.cloudRenderEngine.freezeFrameOverlay",this.cloudRenderEngine.freezeFrameOverlay.style.display="none",this.cloudRenderEngine.freezeFrameOverlay.style.pointerEvents="none",this.cloudRenderEngine.freezeFrameOverlay.style.position="absolute",this.cloudRenderEngine.freezeFrameOverlay.style.zIndex="20";var e=document.createElement("img");e.style.position="absolute",this.cloudRenderEngine.freezeFrameOverlay.appendChild(e)}},{key:"showFreezeFrameOverlay",value:function(){this.cloudRenderEngine.freezeFrame.valid&&(this.cloudRenderEngine.freezeFrameOverlay.classList.add("freezeframeBackground"),this.cloudRenderEngine.freezeFrameOverlay.style.display="block")}},{key:"invalidateFreezeFrameOverlay",value:function(){this.cloudRenderEngine.freezeFrameOverlay.style.display="none",this.cloudRenderEngine.freezeFrame.valid=!1,this.cloudRenderEngine.freezeFrameOverlay.classList.remove("freezeframeBackground"),this.cloudRenderEngine.webRtcPlayerObj&&this.cloudRenderEngine.webRtcPlayerObj.setVideoEnabled(!0)}},{key:"resizeFreezeFrameOverlay",value:function(){if(0!==this.cloudRenderEngine.freezeFrame.width&&0!==this.cloudRenderEngine.freezeFrame.height){var e=0,t=0,i=0,n=0,a=document.getElementById("enlarge-display-to-fill-window-tgl"),o=document.getElementById("player");if(null!==a&&a.checked){var r=window.innerWidth/window.innerHeight,s=this.cloudRenderEngine.freezeFrame.width/this.cloudRenderEngine.freezeFrame.height;r<s?(e=window.innerWidth,t=Math.floor(window.innerWidth/s),i=Math.floor(.5*(window.innerHeight-t)),n=0):(e=Math.floor(window.innerHeight*s),t=window.innerHeight,i=0,n=Math.floor(.5*(window.innerWidth-e)))}else{var l=o.offsetWidth/o.offsetHeight,d=this.cloudRenderEngine.freezeFrame.width/this.cloudRenderEngine.freezeFrame.height;l<d?(e=o.offsetWidth,t=Math.floor(o.offsetWidth/d),i=Math.floor(.5*(o.offsetHeight-t)),n=0):(e=Math.floor(o.offsetHeight*d),t=o.offsetHeight,i=0,n=Math.floor(.5*(o.offsetWidth-e)))}var c=document.getElementById("this.cloudRenderEngine.freezeFrameOverlay").childNodes[0];this.cloudRenderEngine.freezeFrameOverlay.style.width=o.offsetWidth+"px",this.cloudRenderEngine.freezeFrameOverlay.style.height=o.offsetHeight+"px",this.cloudRenderEngine.freezeFrameOverlay.style.left="0px",this.cloudRenderEngine.freezeFrameOverlay.style.top="0px",c.style.width=e+"px",c.style.height=t+"px",c.style.left=n+"px",c.style.top=i+"px"}}},{key:"resizePlayerStyle",value:function(e){var t=document.getElementById("player");if(t)if(this.cloudRenderEngine.updateVideoStreamSize(),t.classList.contains("fixed-size"))this.setupMouseAndFreezeFrame(t);else{var i=document.getElementById("enlarge-display-to-fill-window-tgl"),n=window.innerWidth<t.videoWidth||window.innerHeight<t.videoHeight;null!==i?i.checked||n?this.resizePlayerStyleToFillWindow(t):this.resizePlayerStyleToActualSize(t):this.resizePlayerStyleToArbitrarySize(t),this.setupMouseAndFreezeFrame(t)}}},{key:"setupMouseAndFreezeFrame",value:function(e){this.playerElementClientRect=e.getBoundingClientRect(),this.cloudRenderEngine.setupNormalizeAndQuantize(),this.resizeFreezeFrameOverlay()}},{key:"onOrientationChange",value:function(e){var t=this;clearTimeout(this._orientationChangeTimeout),this._orientationChangeTimeout=setTimeout((function(){t.resizePlayerStyle()}),500)}},{key:"setupHtmlEvents",value:function(){var e=this,t=this;if(window.addEventListener("resize",(function(t){e.resizePlayerStyle(t)}),!0),window.addEventListener("orientationchange",(function(t){e.onOrientationChange(t)})),this.haveEvents?(window.addEventListener("gamepadconnected",(function(t){e.gamepadConnectHandler(t)})),window.addEventListener("gamepaddisconnected",(function(t){e.gamepadDisconnectHandler(t)}))):this.haveWebkitEvents&&(window.addEventListener("webkitgamepadconnected",(function(t){e.gamepadConnectHandler(t)})),window.addEventListener("webkitgamepaddisconnected",(function(t){e.gamepadDisconnectHandler(t)}))),this.cloudRenderEngine.isShowTestUI){document.getElementById("overlayButton").addEventListener("click",(function(t){e.onExpandOverlay_Click(t)}));var i=document.getElementById("enlarge-display-to-fill-window-tgl");null!==i&&(i.onchange=function(e){t.resizePlayerStyle()}),this.cloudRenderEngine.qualityControlOwnershipCheckBox=document.getElementById("quality-control-ownership-tgl"),null!==this.cloudRenderEngine.qualityControlOwnershipCheckBox&&(this.cloudRenderEngine.qualityControlOwnershipCheckBox.onchange=function(e){t.cloudRenderEngine.requestQualityControl()});var n=document.getElementById("encoder-params-submit");null!==n&&(n.onclick=function(e){var i=document.getElementById("encoder-min-qp-text").value,n=document.getElementById("encoder-max-qp-text").value;t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.Encoder.MinQP "+i}),t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.Encoder.MaxQP "+n})});var a=document.getElementById("webrtc-params-submit");null!==a&&(a.onclick=function(e){var i=document.getElementById("webrtc-fps-text").value,n=1e3*document.getElementById("webrtc-min-bitrate-text").value,a=1e3*document.getElementById("webrtc-max-bitrate-text").value;t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.WebRTC.Fps "+i}),t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.WebRTC.MinBitrate "+n}),t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.WebRTC.MaxBitrate "+a})});var o=document.getElementById("show-fps-button");null!==o&&(o.onclick=function(e){t.cloudRenderEngine.emitCommand({ConsoleCommand:"Stat FPS"})});var r=document.getElementById("match-viewport-res-tgl");null!==r&&(r.onchange=function(e){t.cloudRenderEngine.matchViewportResolution=r.checked});var s=document.getElementById("show-stats-tgl");null!==s&&(s.onchange=function(e){document.getElementById("statsContainer").style.display=e.target.checked?"block":"none"});var l=document.getElementById("test-latency-button");l&&(l.onclick=function(){e.sendStartLatencyTest()}),this.cloudRenderEngine.setupToggleWithUrlParams("prefer-sfu-tgl","preferSFU"),this.cloudRenderEngine.setupToggleWithUrlParams("use-mic-tgl","useMic"),this.cloudRenderEngine.setupToggleWithUrlParams("force-turn-tgl","ForceTURN");var d=document.getElementById("stream-select"),c=document.getElementById("track-select");d&&(d.onchange=function(e){var i=t.cloudRenderEngine.webRtcPlayerObj.availableVideoStreams.get(d.value);t.cloudRenderEngine.webRtcPlayerObj.video.srcObject=i,t.cloudRenderEngine.streamTrackSource=i,t.cloudRenderEngine.webRtcPlayerObj.video.play(),t.cloudRenderEngine.updateTrackList()},c&&(c.onchange=function(e){if(t.cloudRenderEngine.streamTrackSource||(t.cloudRenderEngine.streamTrackSource=t.cloudRenderEngine.webRtcPlayerObj.availableVideoStreams.get(d.value)),t.cloudRenderEngine.streamTrackSource){var i,n=T(t.cloudRenderEngine.streamTrackSource.getVideoTracks());try{for(n.s();!(i=n.n()).done;){var a=i.value;if(a.id===c.value){t.cloudRenderEngine.webRtcPlayerObj.video.srcObject=new MediaStream([a]),t.cloudRenderEngine.webRtcPlayerObj.video.play(),d.value="";break}}}catch(e){n.e(e)}finally{n.f()}}}))}}},{key:"onExpandOverlay_Click",value:function(){document.getElementById("overlay").classList.toggle("overlay-shown")}},{key:"gamepadConnectHandler",value:function(e){console.log("Gamepad connect handler")}},{key:"gamepadDisconnectHandler",value:function(e){console.log("Gamepad disconnect handler"),console.log("gamepad: "+e.gamepad.id+" disconnected"),delete this.cloudRenderEngine.controllers[e.gamepad.index]}},{key:"emitMouseMove",value:function(e,t,i,n){this.cloudRenderEngine.print_inputs&&console.log("emitMouseMove x: ".concat(e,", y:").concat(t,", dX: ").concat(i,", dY: ").concat(n));var a=this.cloudRenderEngine.normalizeAndQuantizeUnsigned(e,t),o=this.cloudRenderEngine.normalizeAndQuantizeSigned(i,n),r=new DataView(new ArrayBuffer(9));r.setUint8(0,se.MouseMove),r.setUint16(1,a.x,!0),r.setUint16(3,a.y,!0),r.setInt16(5,o.x,!0),r.setInt16(7,o.y,!0),this.cloudRenderEngine.sendInputData(r.buffer)}},{key:"emitMouseDown",value:function(e,t,i){this.print_inputs&&console.log("mouse button ".concat(e," down at (").concat(t,", ").concat(i,")"));var n=this.cloudRenderEngine.normalizeAndQuantizeUnsigned(t,i),a=new DataView(new ArrayBuffer(6));a.setUint8(0,se.MouseDown),a.setUint8(1,e),a.setUint16(2,n.x,!0),a.setUint16(4,n.y,!0),this.cloudRenderEngine.sendInputData(a.buffer)}},{key:"emitMouseUp",value:function(e,t,i){this.print_inputs&&console.log("mouse button ".concat(e," up at (").concat(t,", ").concat(i,")"));var n=this.cloudRenderEngine.normalizeAndQuantizeUnsigned(t,i),a=new DataView(new ArrayBuffer(6));a.setUint8(0,se.MouseUp),a.setUint8(1,e),a.setUint16(2,n.x,!0),a.setUint16(4,n.y,!0),this.cloudRenderEngine.sendInputData(a.buffer)}},{key:"emitMouseWheel",value:function(e,t,i){this.print_inputs&&console.log("mouse wheel with delta ".concat(e," at (").concat(t,", ").concat(i,")"));var n=this.cloudRenderEngine.normalizeAndQuantizeUnsigned(t,i),a=new DataView(new ArrayBuffer(7));a.setUint8(0,se.MouseWheel),a.setInt16(1,e,!0),a.setUint16(3,n.x,!0),a.setUint16(5,n.y,!0),this.cloudRenderEngine.sendInputData(a.buffer)}},{key:"releaseMouseButtons",value:function(e,t,i){e&de.PrimaryButton&&this.emitMouseUp(le.MainButton,t,i),e&de.SecondaryButton&&this.emitMouseUp(le.SecondaryButton,t,i),e&de.AuxiliaryButton&&this.emitMouseUp(le.AuxiliaryButton,t,i),e&de.FourthButton&&this.emitMouseUp(le.FourthButton,t,i),e&de.FifthButton&&this.emitMouseUp(le.FifthButton,t,i)}},{key:"pressMouseButtons",value:function(e,t,i){e&de.PrimaryButton&&this.emitMouseDown(le.MainButton,t,i),e&de.SecondaryButton&&this.emitMouseDown(le.SecondaryButton,t,i),e&de.AuxiliaryButton&&this.emitMouseDown(le.AuxiliaryButton,t,i),e&de.FourthButton&&this.emitMouseDown(le.FourthButton,t,i),e&de.FifthButton&&this.emitMouseDown(le.FifthButton,t,i)}},{key:"registerInputs",value:function(e){e&&(this.registerMouseEnterAndLeaveEvents(e),this.registerTouchEvents(e))}},{key:"registerMouseEnterAndLeaveEvents",value:function(e){var t=this;e.onmouseenter=function(i){t.print_inputs&&console.log("mouse enter");var n=new DataView(new ArrayBuffer(1));n.setUint8(0,se.MouseEnter),t.cloudRenderEngine.sendInputData(n.buffer),e.pressMouseButtons(i)},e.onmouseleave=function(i){t.print_inputs&&console.log("mouse leave");var n=new DataView(new ArrayBuffer(1));n.setUint8(0,se.MouseLeave),t.cloudRenderEngine.sendInputData(n.buffer),e.releaseMouseButtons(i)}}},{key:"registerLockedMouseEvents",value:function(e){var t=this,i=e.width/2,n=e.height/2;function a(){document.pointerLockElement===e||document.mozPointerLockElement===e?(console.log("Pointer locked"),document.addEventListener("mousemove",o,!1)):(console.log("The pointer lock status is now unlocked"),document.removeEventListener("mousemove",o,!1))}function o(e){i+=e.movementX,n+=e.movementY,i>t.styleWidth&&(i-=t.styleWidth),n>t.styleHeight&&(n-=t.styleHeight),i<0&&(i=t.styleWidth+i),n<0&&(n=t.styleHeight-n),t.emitMouseMove(i,n,e.movementX,e.movementY)}e.requestPointerLock=e.requestPointerLock||e.mozRequestPointerLock,document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock,e.onclick=function(){e.requestPointerLock()},document.addEventListener("pointerlockchange",a,!1),document.addEventListener("mozpointerlockchange",a,!1),e.onmousedown=function(e){t.emitMouseDown(e.button,i,n)},e.onmouseup=function(e){t.emitMouseUp(e.button,i,n)},e.onmousewheel=function(e){t.emitMouseWheel(e.wheelDelta,i,n)},e.pressMouseButtons=function(e){t.pressMouseButtons(e.buttons,i,n)},e.releaseMouseButtons=function(e){t.releaseMouseButtons(e.buttons,i,n)}}},{key:"registerHoveringMouseEvents",value:function(e){var t=this;e.onpointermove=function(e){t.emitMouseMove(e.offsetX,e.offsetY,e.movementX,e.movementY),e.preventDefault()},e.onpointerdown=function(e){t.emitMouseDown(e.button,e.offsetX,e.offsetY),e.preventDefault()},e.onpointerup=function(e){t.emitMouseUp(e.button,e.offsetX,e.offsetY),e.preventDefault()},e.oncontextmenu=function(e){t.emitMouseUp(e.button,e.offsetX,e.offsetY),e.preventDefault()},"onmousewheel"in e?e.onmousewheel=function(e){t.emitMouseWheel(e.wheelDelta,e.offsetX,e.offsetY),e.preventDefault()}:e.addEventListener("DOMMouseScroll",(function(e){t.emitMouseWheel(-120*e.detail,e.offsetX,e.offsetY),e.preventDefault()}),!1),e.pressMouseButtons=function(e){t.pressMouseButtons(e.buttons,e.offsetX,e.offsetY)},e.releaseMouseButtons=function(e){t.releaseMouseButtons(e.buttons,e.offsetX,e.offsetY)}}},{key:"registerTouchEvents",value:function(e){var t,i=this,n=[9,8,7,6,5,4,3,2,1,0],a={};function o(e){var t=n.pop();void 0===t&&console.log("exhausted touch indentifiers"),a[e.identifier]=t}function r(t,n){var o=new DataView(new ArrayBuffer(2+7*n.length));o.setUint8(0,t),o.setUint8(1,n.length);for(var r=2,s=0;s<n.length;s++){var l=n[s],d=l.clientX-e.offsetLeft,c=l.clientY-e.offsetTop;i.print_inputs&&console.log("F".concat(a[l.identifier],"=(").concat(d,", ").concat(c,")"));var u=i.cloudRenderEngine.normalizeAndQuantizeUnsigned(d,c);o.setUint16(r,u.x,!0),r+=2,o.setUint16(r,u.y,!0),r+=2,o.setUint8(r,a[l.identifier],!0),r+=1,o.setUint8(r,255*l.force,!0),r+=1,o.setUint8(r,u.inRange?1:0,!0),r+=1}i.cloudRenderEngine.sendInputData(o.buffer)}this.inputOptions.fakeMouseWithTouches?(e.ontouchstart=function(n){if(void 0===t){var a=n.changedTouches[0];t={id:a.identifier,x:a.clientX-i.playerElementClientRect.left,y:a.clientY-i.playerElementClientRect.top},e.onmouseenter(n),i.emitMouseDown(le.MainButton,t.x,t.y)}n.preventDefault()},e.ontouchend=function(n){for(var a=0;a<n.changedTouches.length;a++){var o=n.changedTouches[a];if(o.identifier===t.id){var r=o.clientX-i.playerElementClientRect.left,s=o.clientY-i.playerElementClientRect.top;i.emitMouseUp(le.MainButton,r,s),e.onmouseleave(n),t=void 0;break}}n.preventDefault()},e.ontouchmove=function(e){for(var n=0;n<e.touches.length;n++){var a=e.touches[n];if(a.identifier===t.id){var o=a.clientX-i.playerElementClientRect.left,r=a.clientY-i.playerElementClientRect.top;i.emitMouseMove(o,r,o-t.x,r-t.y),t.x=o,t.y=r;break}}e.preventDefault()}):(e.ontouchstart=function(e){for(var t=0;t<e.changedTouches.length;t++)o(e.changedTouches[t]);i.print_inputs&&console.log("touch start"),r(se.TouchStart,e.changedTouches),e.preventDefault()},e.ontouchend=function(e){i.print_inputs&&console.log("touch end"),r(se.TouchEnd,e.changedTouches);for(var t=0;t<e.changedTouches.length;t++)o=e.changedTouches[t],n.push(a[o.identifier]),delete a[o.identifier];var o;e.preventDefault()},e.ontouchmove=function(e){i.print_inputs&&console.log("touch move"),r(se.TouchMove,e.touches),e.preventDefault()})}},{key:"callRespone",value:function(e){var t=e.uuid,i=e.classType;this.interactiveObjects.has(t)?this.interactiveObjects.get(t).dispatchEvent(e):"cloudrenderengine"===i.toLowerCase()?this.cloudRenderEngine.dispatchEvent(e):"scene"===i.toLowerCase()?this.scene&&this.scene.dispatchEvent(e):"camera"===i.toLowerCase()&&this.cloudRenderEngine.camera&&this.cloudRenderEngine.camera.dispatchEvent(e)}}])}(),xe=0,Se=new t,Ne=new i,we=new n,Ue=new t,Ce=new t,ke=new t,Te=new i,Oe=new t(1,0,0),Re=new t(0,1,0),Ee=new t(0,0,1),ze={type:"added"},Ie={type:"removed"},Me=function(){function e(){var l;U(this,e),(l=w(this,e)).isObject3D=!0,Object.defineProperty(l,"id",{value:xe++}),l.uuid=a.generateUUID(),l.name="",l.type="Object3D",l.parent=null,l.children=[],l.up=e.DEFAULT_UP.clone();var d=new t,c=new o,u=new i,h=new t(1,1,1);return c._onChange((function(){u.setFromEuler(c,!1)})),u._onChange((function(){c.setFromQuaternion(u,void 0,!1)})),Object.defineProperties(l,{position:{configurable:!0,enumerable:!0,value:d},rotation:{configurable:!0,enumerable:!0,value:c},quaternion:{configurable:!0,enumerable:!0,value:u},scale:{configurable:!0,enumerable:!0,value:h},modelViewMatrix:{value:new n},normalMatrix:{value:new r}}),l.matrix=new n,l.matrixWorld=new n,l.matrixAutoUpdate=e.DEFAULT_MATRIX_AUTO_UPDATE,l.matrixWorldNeedsUpdate=!1,l.matrixWorldAutoUpdate=e.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,l.layers=new s,l.visible=!0,l.castShadow=!1,l.receiveShadow=!1,l.frustumCulled=!0,l.renderOrder=0,l.animations=[],l.userData={},l}return z(e,ve),k(e,[{key:"onBeforeRender",value:function(){}},{key:"onAfterRender",value:function(){}},{key:"applyMatrix4",value:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}},{key:"applyQuaternion",value:function(e){return this.quaternion.premultiply(e),this}},{key:"setRotationFromAxisAngle",value:function(e,t){this.quaternion.setFromAxisAngle(e,t)}},{key:"setRotationFromEuler",value:function(e){this.quaternion.setFromEuler(e,!0)}},{key:"setRotationFromMatrix",value:function(e){this.quaternion.setFromRotationMatrix(e)}},{key:"setRotationFromQuaternion",value:function(e){this.quaternion.copy(e)}},{key:"rotateOnAxis",value:function(e,t){return Ne.setFromAxisAngle(e,t),this.quaternion.multiply(Ne),this}},{key:"rotateOnWorldAxis",value:function(e,t){return Ne.setFromAxisAngle(e,t),this.quaternion.premultiply(Ne),this}},{key:"rotateX",value:function(e){return this.rotateOnAxis(Oe,e)}},{key:"rotateY",value:function(e){return this.rotateOnAxis(Re,e)}},{key:"rotateZ",value:function(e){return this.rotateOnAxis(Ee,e)}},{key:"translateOnAxis",value:function(e,t){return Se.copy(e).applyQuaternion(this.quaternion),this.position.add(Se.multiplyScalar(t)),this}},{key:"translateX",value:function(e){return this.translateOnAxis(Oe,e)}},{key:"translateY",value:function(e){return this.translateOnAxis(Re,e)}},{key:"translateZ",value:function(e){return this.translateOnAxis(Ee,e)}},{key:"localToWorld",value:function(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}},{key:"worldToLocal",value:function(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(we.copy(this.matrixWorld).invert())}},{key:"lookAt",value:function(e,t,i){e.isVector3?Ue.copy(e):Ue.set(e,t,i);var n=this.parent;this.updateWorldMatrix(!0,!1),Ce.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?we.lookAt(Ce,Ue,this.up):we.lookAt(Ue,Ce,this.up),this.quaternion.setFromRotationMatrix(we),n&&(we.extractRotation(n.matrixWorld),Ne.setFromRotationMatrix(we),this.quaternion.premultiply(Ne.invert()))}},{key:"add",value:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(ze)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}},{key:"remove",value:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var i=this.children.indexOf(e);return-1!==i&&(e.parent=null,this.children.splice(i,1),e.dispatchEvent(Ie)),this}},{key:"removeFromParent",value:function(){var e=this.parent;return null!==e&&e.remove(this),this}},{key:"clear",value:function(){for(var e=0;e<this.children.length;e++){var t=this.children[e];t.parent=null,t.dispatchEvent(Ie)}return this.children.length=0,this}},{key:"attach",value:function(e){return this.updateWorldMatrix(!0,!1),we.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),we.multiply(e.parent.matrixWorld)),e.applyMatrix4(we),this.add(e),e.updateWorldMatrix(!1,!0),this}},{key:"getObjectById",value:function(e){return this.getObjectByProperty("id",e)}},{key:"getObjectByName",value:function(e){return this.getObjectByProperty("name",e)}},{key:"getObjectByProperty",value:function(e,t){if(this[e]===t)return this;for(var i=0,n=this.children.length;i<n;i++){var a=this.children[i].getObjectByProperty(e,t);if(void 0!==a)return a}}},{key:"getObjectsByProperty",value:function(e,t){var i=[];this[e]===t&&i.push(this);for(var n=0,a=this.children.length;n<a;n++){var o=this.children[n].getObjectsByProperty(e,t);o.length>0&&(i=i.concat(o))}return i}},{key:"getWorldPosition",value:function(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}},{key:"getWorldQuaternion",value:function(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ce,e,ke),e}},{key:"getWorldScale",value:function(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ce,Te,e),e}},{key:"getWorldDirection",value:function(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}},{key:"raycast",value:function(){}},{key:"traverse",value:function(e){e(this);for(var t=this.children,i=0,n=t.length;i<n;i++)t[i].traverse(e)}},{key:"traverseVisible",value:function(e){if(!1!==this.visible){e(this);for(var t=this.children,i=0,n=t.length;i<n;i++)t[i].traverseVisible(e)}}},{key:"traverseAncestors",value:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}},{key:"updateMatrix",value:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}},{key:"updateMatrixWorld",value:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,i=0,n=t.length;i<n;i++){var a=t[i];!0!==a.matrixWorldAutoUpdate&&!0!==e||a.updateMatrixWorld(e)}}},{key:"updateWorldMatrix",value:function(e,t){var i=this.parent;if(!0===e&&null!==i&&!0===i.matrixWorldAutoUpdate&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t)for(var n=this.children,a=0,o=n.length;a<o;a++){var r=n[a];!0===r.matrixWorldAutoUpdate&&r.updateWorldMatrix(!1,!0)}}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e,i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var n={};function a(t,i){return void 0===t[i.uuid]&&(t[i.uuid]=i.toJSON(e)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=a(e.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var r=o.shapes;if(Array.isArray(r))for(var s=0,l=r.length;s<l;s++){var d=r[s];a(e.shapes,d)}else a(e.shapes,r)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(a(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){for(var c=[],u=0,h=this.material.length;u<h;u++)c.push(a(e.materials,this.material[u]));n.material=c}else n.material=a(e.materials,this.material);if(this.children.length>0){n.children=[];for(var p=0;p<this.children.length;p++)n.children.push(this.children[p].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(var f=0;f<this.animations.length;f++){var m=this.animations[f];n.animations.push(a(e.animations,m))}}if(t){var g=U(e.geometries),y=U(e.materials),v=U(e.textures),b=U(e.images),x=U(e.shapes),S=U(e.skeletons),N=U(e.animations),w=U(e.nodes);g.length>0&&(i.geometries=g),y.length>0&&(i.materials=y),v.length>0&&(i.textures=v),b.length>0&&(i.images=b),x.length>0&&(i.shapes=x),S.length>0&&(i.skeletons=S),N.length>0&&(i.animations=N),w.length>0&&(i.nodes=w)}return i.object=n,i;function U(e){var t=[];for(var i in e){var n=e[i];delete n.metadata,t.push(n)}return t}}},{key:"clone",value:function(e){return(new this.constructor).copy(this,e)}},{key:"copy",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var i=0;i<e.children.length;i++){var n=e.children[i];this.add(n.clone())}return this}}])}();Me.DEFAULT_UP=new t(0,1,0),Me.DEFAULT_MATRIX_AUTO_UPDATE=!0,Me.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Ae=function(){function e(){var t;return U(this,e),(t=w(this,e)).isScene=!0,t.type="Scene",t.background=null,t.environment=null,t.fog=null,t.childrenSet=new Set,t.backgroundBlurriness=0,t.backgroundIntensity=1,t.overrideMaterial=null,t}return z(e,Me),k(e,[{key:"copy",value:function(t,i){return B(e,"copy",this)([t,i]),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}},{key:"toJSON",value:function(t){var i=B(e,"toJSON",this)([t]);return null!==this.fog&&(i.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(i.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(i.backgroundIntensity=this.backgroundIntensity),i}},{key:"autoUpdate",get:function(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate},set:function(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}])}(),Le=function(){function e(){var i;U(this,e),(i=w(this,e)).isCamera=!0,i.type="Camera",i.matrixWorldInverse=new n,i._level=0,i._levelChange=0,i.projectionMatrix=new n,i.projectionMatrixInverse=new n;var a=new t,o=-9999,r=-9999,s=-9999,l=-180,d=180,c=-89,u=0,h=-9999,p=-9999;return i.needsUpdate=!1,i.worldLocation=new t,i.sphereLocation=new t,i.constrainPolygon=[],Object.defineProperties(i,{minLocation:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a.x=e.x,a.y=e.y,a.z=e.z,i.needsUpdate=!0)}},maxLocationX:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,i.needsUpdate=!0)}},maxLocationY:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,i.needsUpdate=!0)}},maxLocationZ:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,i.needsUpdate=!0)}},minYaw:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){void 0!==e&&(l=e,i.needsUpdate=!0)}},maxYaw:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){void 0!==e&&(d=e,i.needsUpdate=!0)}},minPitch:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){void 0!==e&&(c=e,i.needsUpdate=!0)}},maxPitch:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){void 0!==e&&(u=e,i.needsUpdate=!0)}},minSpringArm:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){void 0!==e&&(h=e,i.needsUpdate=!0)}},maxSpringArm:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){void 0!==e&&(p=e,i.needsUpdate=!0)}},name:{configurable:!1,enumerable:!0,value:name}}),i}return z(e,Me),k(e,[{key:"level",get:function(){return this._level},set:function(e){var t=Math.floor(e);this._levelChange=this._level-t,this._level=t}},{key:"copy",value:function(t,i){return B(e,"copy",this)([t,i]),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}},{key:"getWorldDirection",value:function(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}},{key:"updateMatrixWorld",value:function(t){B(e,"updateMatrixWorld",this)([t]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"updateWorldMatrix",value:function(t,i){B(e,"updateWorldMatrix",this)([t,i]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"setConstrainPolygon",value:function(e){var t=this;e&&e.length>2&&(this.constrainPolygon=[],e.forEach((function(e,i){t.constrainPolygon.push({x:e[0],y:e[1]})})),this.constrainHeight=-1,this.needsUpdate=!0,this.constrainPolygonNeedsUpdate=!0)}},{key:"setConstrainShape",value:function(e,t){var i=this;t&&t.length>2&&(this.constrainPolygon=[],t.forEach((function(e,t){i.constrainPolygon.push({x:e[0],y:e[1],z:e[2]})})),this.constrainHeight=e,this.needsUpdate=!0,this.constrainShapeNeedsUpdate=!0)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"toJSON",value:function(){return{shape:this.constrainPolygon&&this.constrainPolygon.length?this.constrainPolygon:null,ConstrainHeight:void 0===this.constrainHeight?-1:this.constrainHeight,MaxLocationX:this.maxLocationX,MaxLocationY:this.maxLocationY,MaxLocationZ:this.maxLocationZ,MinYaw:this.minYaw,MaxYaw:this.maxYaw,MinPitch:this.minPitch,MaxPitch:this.maxPitch,MinSpringArm:this.minSpringArm,MaxSpringArm:this.maxSpringArm,type:this.type,name:this.name,uuid:this.uuid}}}])}(),Pe=function(e){return e.flat(1/0)},De=function(e){if(!Array.isArray(e))throw new Error("Input must be an array");return e.map((function(e){return parseInt(e,10)}))};function _e(e){if(!e)return[];var t=null;return t=e.features?e.features:Array.isArray(e)?e:[e],JSON.parse(JSON.stringify(t))}function Be(e){var t=[],i=null,n=null;return _e(e).forEach((function(e){var a,o;je(null==e||null===(a=e.geometry)||void 0===a?void 0:a.coordinates,2),i=g.flatten(null==e||null===(o=e.geometry)||void 0===o?void 0:o.coordinates),n=g(i.vertices,i.holes,i.dimensions);var r=function(e){for(var t=1/0,i=1/0,n=-1/0,a=-1/0,o=[],r=0;r<e.length/3;r++){var s=e[3*r],l=e[3*r+1];t>s&&(t=s),i>l&&(i=l),n<s&&(n=s),a<l&&(a=l)}for(var d=1/(n-t),c=1/(a-i),u=0;u<e.length/3;u++){var h=d*(e[3*u]-t),p=c*(e[3*u+1]-i);o.push({x:h,y:p})}return o}(i.vertices);t.push({vertices:i.vertices,triangles:n,uvs:r})})),t}function Fe(e,t){var i=_e(e);return i.forEach((function(e){var i,n=null==e||null===(i=e.geometry)||void 0===i?void 0:i.coordinates;je(n,1),e.geometry.coordinates=Pe(n),t&&(e.geometry.coordinates.push(e.geometry.coordinates[0]),e.geometry.coordinates.push(e.geometry.coordinates[1]),e.geometry.coordinates.push(e.geometry.coordinates[2]))})),i}function We(e){var t=_e(e);return t.forEach((function(e){var t,i=null==e||null===(t=e.geometry)||void 0===t?void 0:t.coordinates;!function(e){e.type||(e.type="Feature");var t=e.geometry.type,i={Point:0,MultiPoint:1,LineString:1,MultiLineString:2,Polygon:2,MultiPolygon:3};Object.keys(i).includes(t)&&je(e.geometry.coordinates,i[t])}(e),e.geometry.coordinates=Pe(i)})),t}var je=function(e,t){if(e)if(0===t)e[2]||(e[2]=0);else{var i,n=T(e);try{for(n.s();!(i=n.n()).done;){var a=i.value;je(a,t-1)}}catch(e){n.e(e)}finally{n.f()}}};var He=new l;function Ge(e,t){He.load(e,(function(e){var i=new FileReader;i.readAsDataURL(e),i.onloadend=function(e){t(e.target.result)}}),null,(function(e){t(!1)}))}function Ve(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/png";return e.toDataURL(t)}function Je(e){return-1!==e.indexOf("data:")&&-1!==e.indexOf("base64")}function Ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"https://mapdata.bj.bcebos.com",i=new Image;return i.crossOrigin="Anonymous",i.src=t+e,new Promise((function(e,t){i.addEventListener("load",(function(){e(i)})),i.onerror=function(e){t(e)}}))}function qe(e,t,i,n,a,o){e.beginPath(),e.moveTo(t+o,i),e.lineTo(t+n-o,i),e.quadraticCurveTo(t+n,i,t+n,i+o),e.lineTo(t+n,i+a-o),e.quadraticCurveTo(t+n,i+a,t+n-o,i+a),e.lineTo(t+o,i+a),e.quadraticCurveTo(t,i+a,t,i+a-o),e.lineTo(t,i+o),e.quadraticCurveTo(t,i,t+o,i),e.closePath()}function Xe(e,t,i,n){var a,o=i.xScale,r=_(n,2),s=r[0],l=r[1],d=t.text,c=t.fontSize,u=t.fontFamily,h=t.color,p=t.textAlign,f=t.icon;if(d||"number"==typeof d||f)if(d&&f)console.warn("BasicLabel Warning:text和icon不要同时设置");else{if(a=d,e.font="".concat(c*o,"px ").concat(u),e.fillStyle=h,e.textAlign=p||"left",e.textBaseline="top",f){var m=f;-1!==f.indexOf("&amp;")&&(m=f.replace("&amp;","&")),-1!==f.indexOf("&amp")&&(m=f.replace("&amp","&")),a=new Function('return ("'+"".concat(m).replace("&#x","\\u").replace(";","")+'")')()}e.measureText(a).width,e.fillText(a,s,l)}}function Ke(e,t){return Qe.apply(this,arguments)}function Qe(){return(Qe=N(P().mark((function e(t,i){var n,o,r,s,l,d,c,u,h,p,f,m,g,y,v,b,x;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.height,o=t.width,r=t.backgroundImage,s=t.borderRadius,l=t.borderColor,d=t.borderWidth,c=t.backgroundColor,u=o,h=n,p=document.createElement("canvas"),f=p.getContext("2d"),m=a.ceilPowerOfTwo(u),g={width:m,height:m*(h/u),factor:{xScale:m/u,yScale:m/u}},p.width=g.width,p.height=g.height,y=g.factor,v=y.xScale,b=y.yScale,!r){e.next=17;break}return e.next=13,Ye(r,"");case 13:x=e.sent,f.drawImage(x,0,0,u*v,h*b),e.next=18;break;case 17:(l||c)&&(f.strokeStyle=l,f.fillStyle=c,f.lineWidth=d?d*v:1*v,qe(f,f.lineWidth*v,f.lineWidth*b,(u-2*f.lineWidth)*v,(h-2*f.lineWidth)*b,s?s*v:0),c&&f.fill(),l&&f.stroke());case 18:return i&&Ze(f,g,i),e.abrupt("return",p);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ze(e,t,i){return $e.apply(this,arguments)}function $e(){return $e=N(P().mark((function e(t,i,n){var a,o,r,s,l,d,c,u,h,p,f,m,g,y,v,b,x,S,N,w,U,C,k,T,O,R,E,z,I,M,A,L,D,B,F,W,j,H,G;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=i.paddingTop,o=i.paddingLeft,r=i.width,i.height,s=0,l=0,d=0,c=0,u=i.factor,h=u.xScale,p=u.yScale,g=[f=o?o*h:0,m=a?a*p:0],y=Object.keys(n),v=0;case 11:if(!(v<y.length)){e.next=41;break}if(b=n[y[v]],x=b.width,S=b.height,N=b.text,w=b.marginRight,U=b.marginBottom,C=b.backgroundImage,k=b.borderRadius,T=b.borderColor,O=b.borderWidth,R=b.backgroundColor,E=b.position,b.id,E&&(z=_(E,2),I=z[0],M=z[1],g[0]=f+I*h,g[1]=m+M*p,s=0,l=0,d=0,c=0),!x||!S){e.next=37;break}if(g[0]+x*h>r&&((d+=s)+S*p<=l?(g[0]=c,g[1]+=s):(g[0]=o?o*h:0,g[1]+=s,l=0,c=0)),!C){e.next=30;break}return e.prev=18,e.next=21,Ye(C,"");case 21:A=e.sent,t.drawImage(A,g[0],g[1],x*h,S*p),e.next=28;break;case 25:e.prev=25,e.t0=e.catch(18),console.log(e.t0);case 28:e.next=31;break;case 30:R&&(t.strokeStyle=T,t.fillStyle=R,t.lineWidth=O?O*h:1*h,qe(b,g[0]+b.lineWidth*h,g[1]+b.lineWidth*h,(x-2*b.lineWidth)*h,(S-2*b.lineWidth)*p,k?k*h:0),R&&t.fill(),T&&t.stroke());case 31:N&&(L=_(E,2),D=L[0],B=L[1],F=[g[0]+D*h,g[1]+B*p],Xe(t,b,i.factor,F)),g[0]+=(x+(w||0))*h,(s=(S+(U||0))*p)>l&&(l=s,c=g[0]),e.next=38;break;case 37:N&&(W=_(E,2),j=W[0],H=W[1],G=[g[0]+j*h,g[1]+H*p],Xe(t,b,i.factor,G));case 38:v++,e.next=11;break;case 41:case"end":return e.stop()}}),e,null,[[18,25]])}))),$e.apply(this,arguments)}function et(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return!1;var i=document.createElement("canvas"),n=i.getContext("2d"),a=t.scale||1,o=t.fontSize||18,r=t.fontface||"Arial",s=t.borderThickness||0,l=t.backgroundColor||{r:0,g:0,b:0,a:1},d=t.borderColor||{r:0,g:0,b:0,a:1},c=t.strokeStyle||{r:255,g:0,b:0,a:1},u=t.textColor||{r:255,g:0,b:0,a:1};n.font="Bold "+o*a+"px "+r;var h=n.measureText(e).width*a,p=h+2*s*a,f=o*a*1.4+2*s*a;i.width=t.width||p,i.height=t.height||f,n.font="Bold "+o*a+"px "+r;var m=l.r,g=l.g,y=l.b,v=l.a;if(n.fillStyle="rgba("+m+","+g+","+y+","+v+")",n.fillRect(0,0,i.width,i.height),t.drawRoundRect){var b=d.r,x=d.g,S=d.b,N=d.a;n.strokeStyle="rgba("+b+","+x+","+S+","+N+")",n.lineWidth=s*a,qe(n,s/2,s/2,h+s+10*a,o*a*1.4+s,6)}if(n.fill(),n.stroke(),t.drawStrokeStyle){var w=c.r,U=c.g,C=c.b,k=c.a;n.strokeStyle="rgba("+w+","+U+","+C+","+k+")",n.strokeText(e,(s+5)*a+.5*(i.width-p),.5*(i.height-f)+(o+s)*a)}var T=u.r,O=u.g,R=u.b,E=u.a;return n.fillStyle="rgba("+T+","+O+","+R+","+E+")",n.fillText(e,(s+5)*a+.5*(i.width-p),.5*(i.height-f)+(o+s)*a),i}He.setResponseType("blob");var tt=function(){function e(){var n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),n=w(this,e,[r]);var s=r.name,l=new d(1,1,1);r.color&&(l.r=a.clamp(r.color.r,0,1),l.g=a.clamp(r.color.g,0,1),l.b=a.clamp(r.color.b,0,1));var c=new d(1,1,1);r.color2?(c.r=a.clamp(r.color2.r,0,1),c.g=a.clamp(r.color2.g,0,1),c.b=a.clamp(r.color2.b,0,1)):(c.r=l.r,c.g=l.g,c.b=l.b);var u=void 0===r.size?10:r.size,h=void 0===r.sizeAttenuation||r.sizeAttenuation,p=void 0===r.gardientDirection?1:r.gardientDirection,f=void 0===r.brightness?0:r.brightness,m=void 0===r.scroll?0:r.scroll,g=n.childIndex=-1,y=void 0===r.speed?.2:r.speed,v=void 0===r.roughness?1:r.roughness,b=void 0===r.metallic?0:r.metallic;n.map=r.map||null;var x=void 0===r.opacity?1:r.opacity,S=void 0===r.uvRotateSpeed?0:r.uvRotateSpeed,N=void 0===r.WPOScaleAnimateSpeed?0:r.WPOScaleAnimateSpeed,C=void 0===r.WPOMinAnimateScale?1:r.WPOMinAnimateScale,k=void 0===r.WPOMaxAnimateScale?2:r.WPOMaxAnimateScale,T=new d(1,1,1);r.brightnessColor&&(T.r=a.clamp(r.brightnessColor.r,0,1),T.g=a.clamp(r.brightnessColor.g,0,1),T.b=a.clamp(r.brightnessColor.b,0,1));var O=r.position||new t,R=new o;r.rotation&&(R.x=a.clamp(r.rotation.x,-180,180),R.y=a.clamp(r.rotation.y,-180,180),R.z=a.clamp(r.rotation.z,-180,180));var E=new i,z=new t(1,1,1);r.scale&&(z.x=r.scale.x,z.y=r.scale.y,z.z=r.scale.z);var I=new t(0,0,0);return r.offset&&(I.x=r.offset.x,I.y=r.offset.y,I.z=r.offset.z),n.isInstance=r.isInstance||!1,n.transparent=r.transparent||x<1,n.depthTest=!("depthTest"in r)||r.depthTest,n.renderNum=void 0===r.renderNum?20:r.renderNum,n._visible=void 0===r.visible||r.visible,R._onChange((function(){E.setFromEuler(R,!1),this.matrixNeedsUpdate=!0})),E._onChange((function(){R.setFromQuaternion(E,void 0,!1),this.matrixNeedsUpdate=!0})),Object.defineProperties(n,{position:{configurable:!0,enumerable:!0,get:function(){return O},set:function(e){e&&(O.x=e.x,O.y=e.y,O.z=e.z,n.matrixNeedsUpdate=!0)}},childIndex:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){e!==g&&(g=e)}},rotation:{configurable:!0,enumerable:!0,get:function(){return R},set:function(e){e&&(R.x=a.clamp(e.x,-180,180),R.y=a.clamp(e.y,-180,180),R.z=a.clamp(e.z,-180,180),n.matrixNeedsUpdate=!0)}},quaternion:{writable:!0,configurable:!0,value:E,enumerable:!0},scale:{configurable:!0,enumerable:!0,get:function(){return z},set:function(e){e&&(z.x=e.x,z.y=e.y,z.z=e.z,n.matrixNeedsUpdate=!0)}},offset:{configurable:!0,enumerable:!0,get:function(){return I},set:function(e){e&&(I.x=e.x,I.y=e.y,I.z=e.z,n.matrixNeedsUpdate=!0)}},color:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l.r=e.r,l.g=e.g,l.b=e.b,e.a&&(x=e.a),n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},color2:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c.r=e.r,c.g=e.g,c.b=e.b,e.a&&(x=e.a),n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},gardientDirection:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){void 0!==e&&(p=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},scroll:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){void 0!==e&&(m=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},uvRotateSpeed:{configurable:!0,enumerable:!0,get:function(){return S},set:function(e){void 0!==e&&(S=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},WPOMaxAnimateScale:{configurable:!0,enumerable:!0,get:function(){return k},set:function(e){void 0!==e&&(k=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},WPOMinAnimateScale:{configurable:!0,enumerable:!0,get:function(){return C},set:function(e){void 0!==e&&(C=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},WPOScaleAnimateSpeed:{configurable:!0,enumerable:!0,get:function(){return N},set:function(e){void 0!==e&&(N=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},speed:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){void 0!==e&&(y=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},brightness:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){void 0!==e&&(f=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},roughness:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){v=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0}},metallic:{configurable:!0,enumerable:!0,get:function(){return b},set:function(e){b=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0}},opacity:{configurable:!0,enumerable:!0,get:function(){return x},set:function(e){n.transparent=e<1,x=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0}},brightnessColor:{configurable:!0,enumerable:!0,get:function(){return T},set:function(e){e&&(T.copy(e),n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},_layerName:{configurable:!1,enumerable:!1,value:"CommonGISLayer",writable:!0},_cloudControlType:{configurable:!1,enumerable:!1,value:"Gis",writable:!0},type:{configurable:!1,enumerable:!0,value:"Shape",writable:!0},name:{configurable:!1,enumerable:!0,value:s,writable:!0},size:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){void 0!==e&&(u=e,n.overtimeInstanceIndex=[],n.materialNeedsUpdate=!0)}},sizeAttenuation:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){void 0!==e&&(h=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}}}),r.data&&n.setData(r.data),n.matrixNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.visibleNeedsUpdate=!1,n.animateNeedsUpdate=!1,n}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),this.visibleNeedsUpdate=!0,this._visible=e&&!0}},{key:"map",get:function(){return this._map},set:function(e){var t=this;e&&(this._map=e,Je(e)?(this.texture=e,this.overtimeInstanceIndex=[],this.data=[],this.materialNeedsUpdate=!0):Ge(e,(function(e){e&&(t.texture=e,t.overtimeInstanceIndex=[],t.data=[],t.materialNeedsUpdate=!0)})))}},{key:"animate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.to)return!1;var t=e.from,i=void 0===t?{}:t,n=e.to,a=void 0===n?{}:n,o=e.duration,r=void 0===o?3e3:o,s=e.easing,l=void 0===s?"Linear":s,d=e.loop,c=void 0!==d&&d,u=e.yoyo,h=void 0!==u&&u,p=e.stayEnd,f=void 0===p||p;i.position||delete i.position,i.rotation||delete i.rotation,i.scale||delete i.scale,a.position||delete a.position,a.rotation||delete a.rotation,a.scale||delete a.scale,a.animateOffset||delete a.animateOffset,this.animateNeedsUpdate=!0,this.animateJson={Status:"play",From:i,To:a,Duration:r,Easing:l,Loop:c,Yoyo:h,StayEnd:f};var m=new y.Tween({ratio:0}).to({ratio:1},e.duration||3e3).start();return c&&m.repeat(1/0),this.tween=null,this.tween=m,this.tween}},{key:"stopAnimate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;this.animateNeedsUpdate=!0,this.animateJson={Status:"stop",DelayTime:e},this.tween&&this.tween.stop(),this.tween=null}},{key:"setData",value:function(e){var t=_e(e);if(t.length<1)return!1;var i=t[0].geometry.type.toLowerCase();if(this.isInstance&&["point","multipoint"].indexOf(i)<0)return!1;var n={};switch(i){case"point":case"multipoint":n=We(t);break;case"linestring":case"multilinestring":n=Fe(t);break;case"polygon":case"multipolygon":n=Be(t)}if(this.isInstance){var a=function(e,t){if(!e||e.length<1)return{data:t,datas:t,overtimeInstanceIndex:[]};for(var i=[],n=[],a=[],o=[],r=0;r<e.length;r++){for(var s,l=e[r],d=l.geometry,c=l.properties,u=void 0===c?{}:c,h=d.coordinates,p=u.rotation,f=void 0===p?{x:0,y:0,z:0}:p,m=u.scale,g=void 0===m?{x:1,y:1,z:1}:m,y=!1,v=function(){var e=t[b],n=e.geometry,a=e.properties,r=void 0===a?{}:a,s=n.coordinates,l=r.rotation,d=void 0===l?{x:0,y:0,z:0}:l,c=r.scale,u=void 0===c?{x:1,y:1,z:1}:c;return h.length===s.length&&h.every((function(e,t){return e===s[t]}))?f.x!==d.x||f.y!==d.y||f.z!==d.z||g.x!==u.x||g.y!==u.y||g.z!==u.z||i.indexOf(b)>-1?0:(i.push(b),y=!0,o.push(t[b]),1):0},b=0;b<t.length&&(0===(s=v())||1!==s);b++);y||n.push(r)}for(var x=0;x<t.length;x++)i.indexOf(x)<0&&(a.push(t[x]),o.push(t[x]));return{data:a,overtimeInstanceIndex:n,datas:o}}(this.datas,n),o=a.data,r=a.overtimeInstanceIndex,s=a.datas;(o.length>0||r.length>0)&&(this.datas=s,this.data=o,this.overtimeInstanceIndex=r,this.materialNeedsUpdate=!0)}else this.data=n}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this.visibleNeedsUpdate||!e||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,DepthTest:this.depthTest,Scroll:this.scroll,Speed:this.speed,Texture:this.texture,GardientDirection:this.gardientDirection,RotateSpeed:this.uvRotateSpeed,ScaleAnimateSpeed:this.WPOScaleAnimateSpeed,MinAnimateScale:this.WPOMinAnimateScale,MaxAnimateScale:this.WPOMaxAnimateScale,Color2:{r:this.color2.r,g:this.color2.g,b:this.color2.b,a:this.opacity},BrightnessColor:this.brightnessColor?{r:this.brightnessColor.r,g:this.brightnessColor.g,b:this.brightnessColor.b,a:1}:d,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:!this.isInstance&&this.animateNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid,jsondata:!e||this.isInstance?this.data:null,AnimateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation,RenderNum:this.renderNum,ChildIndex:this.isInstance?-1:this.childIndex,IsInstance:this.isInstance,OvertimeInstanceIndex:this.overtimeInstanceIndex}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid,ChildIndex:this.childIndex}}},{key:"dispose",value:function(){this.traverse((function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose(),e.texture=null})),this.data=null,this.datas=null,this.texture=null}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.color.copy(t.color),this.brightness=t.brightness,this.metallic=t.metallic,this.roughness=t.roughness,this.opacity=t.opacity,this.transparent=t.transparent,this.texture=t.texture,this.brightnessColor.copy(t.brightnessColor),this.offset.copy(t.offset),B(e,"copy",this)([t,i]),this}}])}();var it=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="Polygon";var n=i.fillStyle||"Empty",a=void 0===i.speedX?.25:i.speedX,o=void 0===i.speedY?.25:i.speedY,r=void 0===i.rotateAngle?0:i.rotateAngle,s=void 0===i.tile?.5:i.tile;return Object.defineProperties(t,{fillStyle:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e,t.materialNeedsUpdate=!0)}},rotateAngle:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,t.materialNeedsUpdate=!0)}},tile:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,t.materialNeedsUpdate=!0)}},speedX:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,t.materialNeedsUpdate=!0)}},speedY:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,t.materialNeedsUpdate=!0)}}}),t}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=Be(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,FillStyle:this.fillStyle,SpeedX:this.speedX,SpeedY:this.speedY,RotateAngle:this.rotateAngle,Tile:this.tile,Transparent:this.transparent,Texture:this.texture,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}();function nt(e,t){var i=e[0],n=e[1],a=t[0],o=t[1];return Math.sqrt((i-a)*(i-a)+(n-o)*(n-o))}function at(e,t,i){var n=Math.abs(nt(e,t)),a=Math.abs(nt(e,i)),o=Math.abs(nt(t,i)),r=(n+a+o)/2;return 2*Math.sqrt(Math.abs(r*(r-n)*(r-a)*(r-o)))/n}function ot(e,t,i,n,a){if(i<n){for(var o=0,r=0,s=e[i],l=e[n],d=i+1;d<n;d++){var c=at(s,l,e[d]);c>o&&(o=c,r=d)}o>=a&&(t.push(e[r]),ot(e,t,i,r,a),ot(e,t,r,n,a))}return t}function rt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(!(e&&e.length>2))return null;e.forEach((function(e,t){e.id=t}));var n=ot(e,[],0,e.length-i,t);n.push(e[0]),n.push(e[e.length-1]);var a=n.sort((function(e,t){return e.id<t.id?-1:e.id>t.id?1:0}));return a.forEach((function(e){e.id=0})),a}var st=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="Line";var n=i.style||te.SOLID,a=i.splineType||ne.LINEAR,o=i.direction||ie.CENTER,r=i.width||4,s=i.tilling||5,l=i.speed||1,d=void 0!==i.openStroke&&i.openStroke,c=i.strokeColor||null,u=i.strokeWidth||1;t.isDilution=i.isDilution||!1,t.interval=i.interval||1e-5,t.visible=void 0===i.visible||i.visible,t.collision=void 0!==i.collision&&i.collision;var h={enable:!1,speedX:1,speedY:0,uvRotation:0,u:0,v:0};return i.lineUVOption&&(h.enable=void 0!==i.lineUVOption.enable&&i.lineUVOption.enable,h.speedX=void 0===i.lineUVOption.speedX?1:i.lineUVOption.speedX,h.speedY=void 0===i.lineUVOption.speedY?0:i.lineUVOption.speedY,h.uvRotation=void 0===i.lineUVOption.uvRotation?0:i.lineUVOption.uvRotation,h.u=void 0===i.lineUVOption.u?0:i.lineUVOption.u,h.v=void 0===i.lineUVOption.v?0:i.lineUVOption.v),t.renderType=void 0===i.renderType?0:i.renderType,t.section_Length=void 0===i.section_Length?100:i.section_Length,Object.defineProperties(t,{style:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e,t.materialNeedsUpdate=!0)}},lineUVOption:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){e&&(h.enable=void 0!==e.enable&&e.enable,h.speedX=void 0===e.speedX?1:e.speedX,h.speedY=void 0===e.speedY?0:e.speedY,h.uvRotation=void 0===e.uvRotation?0:e.uvRotation,h.u=void 0===e.u?0:e.u,h.v=void 0===e.v?0:e.v,t.materialNeedsUpdate=!0)}},splineType:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,t.materialNeedsUpdate=!0)}},direction:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,t.materialNeedsUpdate=!0)}},width:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,t.materialNeedsUpdate=!0)}},tilling:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,t.materialNeedsUpdate=!0)}},speed:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e,t.materialNeedsUpdate=!0)}},openStroke:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d=e,t.materialNeedsUpdate=!0)}},strokeColor:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c.r=e.r,c.g=e.g,c.b=e.b,c.a=e.a?e.a:1,t.materialNeedsUpdate=!0)}},strokeWidth:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u=e,t.materialNeedsUpdate=!0)}}}),t}return z(e,tt),k(e,[{key:"setData",value:function(e){var t=this;if(this.isDilution){var i=_e(e);i.forEach((function(e,i){var n=e.geometry.coordinates,a=n.length,o=1,r=_(n[0],3),s=r[0],l=r[1],d=r[2],c=_(n[a-1],3),u=c[0],h=c[1],p=c[2];s===u&&l===h&&d===p&&(o=2),e.geometry.coordinates=rt(n,t.interval,o)})),(e={}).features=i}this.data=Fe(e)}},{key:"updataLineColor",value:function(e){Array.isArray(e)&&e.length===this.data.length&&(this.colordata=e,this.materialNeedsUpdate=!0)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Collision:this.collision,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,jsondata:e?null:this.data,Style:this.style,Spline_Type:this.splineType,MeshDirection:this.direction,RenderType:this.renderType,Section_Length:this.section_Length,Width:this.width,Tilling:this.tilling,Speed:this.speed,Open_Stroke:this.openStroke,Stroke_Color:this.strokeColor?{r:this.strokeColor.r,g:this.strokeColor.g,b:this.strokeColor.b,a:1}:null,Stroke_Width:this.strokeWidth,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,LineUVOption:this.lineUVOption,colordata:this.colordata}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.style=t.style,this.splineType=t.splineType,this.direction=t.direction,this.width=t.width,this.tilling=t.tilling,this.speed=t.speed,this.openStroke=t.openStroke,this.strokeColor=t.strokeColor,this.strokeWidth=t.strokeWidth,B(e,"copy",this)([t,i]),this}}])}(),lt=function(){function e(){var i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),i=w(this,e,[n]);var a=n.size||4;return i.type="Point",Object.defineProperties(i,{size:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){(a=Number(e))&&(i.scale=new t(a,a,a),i.matrixNeedsUpdate=!0)}}}),i}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=We(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Size:this.size,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.size=t.size,B(e,"copy",this)([t,i]),this}}])}(),dt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Cube",i}return z(e,tt),k(e)}(),ct=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="MeasureArea";var n=void 0===i.textDisplay||i.textDisplay,a=i.textColor||new d(1,0,0),o=i.fontSize||18,r=i.textBorderColor||new d(1,0,0),s=i.textBorderWidth||1;return Object.defineProperties(t,{textDisplay:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e)}},fontSize:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e)}},textColor:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a.r=e.r,a.g=e.g,a.b=e.b)}},textBorderWidth:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e)}},textBorderColor:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r.r=e.r,r.g=e.g,r.b=e.b)}}}),t}return z(e,tt),k(e,[{key:"updateParameters",value:function(e){for(var t in e)this[t]!==e[t]&&(this[t]=e[t])}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,FontSize:this.fontSize,TextDisplay:this.textDisplay,TextColor:{r:this.textColor.r,g:this.textColor.g,b:this.textColor.b,a:1},TextBorderColor:{r:this.textBorderColor.r,g:this.textBorderColor.g,b:this.textBorderColor.b,a:1},TextBorderWidth:this.textBorderWidth,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontSize=t.fontSize,this.textDisplay=t.textDisplay,this.textColor=t.textColor,this.textBorderColor=t.textBorderColor,this.textBorderWidth=t.textBorderWidth,B(e,"copy",this)([t,i]),this}}])}(),ut=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="MeasureLine";var n=i.style||te.SOLID,a=i.splineType||ne.LINEAR,o=i.direction||ie.CENTER,r=i.width||4,s=i.tilling||300,l=i.speed||1,c=void 0!==i.openStroke&&i.openStroke,u=i.strokeColor||null,h=i.strokeWidth||1,p=void 0===i.textDisplay||i.textDisplay,f=i.textColor||new d(1,0,0),m=i.fontSize||18,g=i.textBorderColor||new d(1,0,0),y=i.textBorderWidth||1;return Object.defineProperties(t,{style:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e)}},splineType:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}},direction:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e)}},width:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e)}},tilling:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e)}},speed:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e)}},openStroke:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c=e)}},strokeColor:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u.r=e.r,u.g=e.g,u.b=e.b,u.a=e.a?e.a:1)}},strokeWidth:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){e&&(h=e)}},textDisplay:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){e&&(p=e)}},fontSize:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){e&&(m=e)}},textColor:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){e&&(f.r=e.r,f.g=e.g,f.b=e.b)}},textBorderWidth:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){e&&(y=e)}},textBorderColor:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){e&&(g.r=e.r,g.g=e.g,g.b=e.b)}}}),t}return z(e,tt),k(e,[{key:"updateParameters",value:function(e){for(var t in e)this[t]!==e[t]&&(this[t]=e[t])}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,jsondata:e?null:this.data,Style:this.style,Spline_Type:this.splineType,MeshDirection:this.direction,Width:this.width,Tilling:this.tilling,Speed:this.speed,Open_Stroke:this.openStroke,Stroke_Color:this.strokeColor?{r:this.strokeColor.r,g:this.strokeColor.g,b:this.strokeColor.b,a:1}:null,Stroke_Width:this.strokeWidth,FontSize:this.fontSize,TextColor:{r:this.textColor.r,g:this.textColor.g,b:this.textColor.b,a:1},TextDisplay:this.textDisplay,TextBorderColor:{r:this.textBorderColor.r,g:this.textBorderColor.g,b:this.textBorderColor.b,a:1},TextBorderWidth:this.textBorderWidth}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.style=t.style,this.splineType=t.splineType,this.direction=t.direction,this.width=t.width,this.tilling=t.tilling,this.speed=t.speed,this.openStroke=t.openStroke,this.strokeColor=t.strokeColor,this.strokeWidth=t.strokeWidth,this.fontSize=t.fontSize,this.textColor=t.textColor,this.textDisplay=t.textDisplay,this.textBorderColor=t.textBorderColor,this.textBorderWidth=t.textBorderWidth,B(e,"copy",this)([t,i]),this}}])}(),ht=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="SurfaceLine";var n=i.rayDistance||100,a=i.width||4,o=i.rayDetectionDistance||500,r=i.textColor||new d(1,0,0),s=i.fontSize||18,l=i.linePixel||1024;return Object.defineProperties(t,{width:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}},rayDistance:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e!==n&&(n=e)}},rayDetectionDistance:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e!==o&&(o=e)}},linePixel:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e!==l&&(l=e)}},fontSize:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e)}},textColor:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r.r=e.r,r.g=e.g,r.b=e.b)}}}),t}return z(e,tt),k(e,[{key:"updateParameters",value:function(e){for(var t in e)this[t]!==e[t]&&(this[t]=e[t])}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,jsondata:e?null:this.data,Style:"solid",Spline_Type:"Curve",MeshDirection:"Ground_Center",Width:this.width,FontSize:this.fontSize,TextColor:{r:this.textColor.r,g:this.textColor.g,b:this.textColor.b,a:1},LinePixel:this.linePixel}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.style="solid",this.splineType="Curve",this.direction="Ground_Center",this.width=t.width,this.fontSize=t.fontSize,this.textColor=t.textColor,this.textDisplay=t.textDisplay,this.textBorderColor=t.textBorderColor,this.textBorderWidth=t.textBorderWidth,B(e,"copy",this)([t,i]),this}}])}(),pt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="LocationPoint",t.EPSG=i.EPSG||"epsg:4326";var n=i.textColor||new d(1,0,0),a=i.fontSize||18,o=i.textBorderColor||new d(1,0,0),r=i.textBorderWidth||1;return Object.defineProperties(t,{fontSize:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}},textColor:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n.r=e.r,n.g=e.g,n.b=e.b)}},textBorderWidth:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e)}},textBorderColor:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o.r=e.r,o.g=e.g,o.b=e.b)}}}),t}return z(e,tt),k(e,[{key:"updateParameters",value:function(e){for(var t in e)this[t]!==e[t]&&(this[t]=e[t])}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,FontSize:this.fontSize,TextColor:{r:this.textColor.r,g:this.textColor.g,b:this.textColor.b,a:1},EPSG:this.EPSG,TextBorderColor:{r:this.textBorderColor.r,g:this.textBorderColor.g,b:this.textBorderColor.b,a:1},TextBorderWidth:this.textBorderWidth,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontSize=t.fontSize,this.textColor=t.textColor,this.textBorderColor=t.textBorderColor,this.EPSG=t.EPSG,this.textBorderWidth=t.textBorderWidth,B(e,"copy",this)([t,i]),this}}])}();var ft=v.create();ft.interceptors.request.use((function(e){var t=localStorage.getItem("authToken");return t&&(e.headers.Authorization="Bearer ".concat(t)),e}),(function(e){return Promise.reject(e)})),ft.interceptors.response.use((function(e){return e}),(function(e){return e.response&&401===e.response.status&&localStorage.removeItem("authToken"),Promise.reject(e)}));var mt=function(){return k((function e(){U(this,e)}),null,[{key:"username",get:function(){return this._username},set:function(e){this._username=e,this._SaveToken()}},{key:"password",get:function(){return this._password},set:function(e){this._password=e,this._SaveToken()}},{key:"_SaveToken",value:function(){localStorage.setItem("authToken",btoa("".concat(this._username,":").concat(this._password)))}}])}();O(mt,"host",""),O(mt,"tag",""),O(mt,"_username","admin"),O(mt,"_password","admin"),O(mt,"_currentProject",void 0),mt.GetProjectCommon=N(P().mark((function e(){var t;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!mt.host){e.next=5;break}return e.next=3,ft.get("".concat(mt.host,"/api/configs/projects/common"));case 3:return t=e.sent,e.abrupt("return",t);case 5:console.error("请先设置Host地址");case 6:case"end":return e.stop()}}),e)}))),mt.getProjectCommon=mt.GetProjectCommon,mt.GetProjectByNodeId=function(){var e=N(P().mark((function e(t){var i;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!mt.host){e.next=5;break}return e.next=3,ft.get("".concat(mt.host,"/api/configs/projects/").concat(t));case 3:return i=e.sent,e.abrupt("return",i);case 5:console.error("请先设置Host地址");case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),mt.getProjectByNodeId=mt.GetProjectByNodeId,mt.GetAllCapacity=N(P().mark((function e(){var t;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!mt.host){e.next=5;break}return e.next=3,ft.get("".concat(mt.host,"/api/nodes/capacity"));case 3:return t=e.sent,e.abrupt("return",t.data.data[""===mt.tag?"all":mt.tag]);case 5:case"end":return e.stop()}}),e)}))),mt.getAllCapacity=mt.GetAllCapacity,mt.GetAllCapacityInfo=N(P().mark((function e(){var t;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!mt.host){e.next=5;break}return e.next=3,ft.get("".concat(mt.host,"/api/nodes/capacity"));case 3:return t=e.sent,e.abrupt("return",t.data.data);case 5:case"end":return e.stop()}}),e)}))),mt.getAllCapacityInfo=mt.GetAllCapacityInfo,mt.GetAllNodes=N(P().mark((function e(){var t;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!mt.host){e.next=5;break}return e.next=3,ft.get("".concat(mt.host,"/api/nodes/all"));case 3:return t=e.sent,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)}))),mt.getAllNodes=mt.GetAllNodes,mt.GetAliveNodes=N(P().mark((function e(){var t;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!mt.host){e.next=5;break}return e.next=3,ft.get("".concat(mt.host,"/api/nodes/list"));case 3:return t=e.sent,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)}))),mt.getAliveNodes=mt.GetAliveNodes,mt.CreateTask=function(){var e=N(P().mark((function e(t){var i,n;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=mt.tag||"",e.next=3,ft.post("".concat(mt.host,"/api/tasks/create"),{project:t,tag:"all"===i?"":i});case 3:return n=e.sent,mt._currentProject=n.data,e.abrupt("return",n.data);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),mt.createTask=mt.CreateTask,mt.KillTask=function(){var e=N(P().mark((function e(t){var i;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!mt.host){e.next=6;break}return e.next=3,ft.post("".concat(mt.host,"/api/tasks/kill/").concat(t));case 3:return i=e.sent,mt._currentProject=null,e.abrupt("return",i);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),mt.killTask=mt.KillTask,mt._SaveToken(),"undefined"==typeof ue&&(window.ue={});var gt=window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.requestAnimationFrame,yt=function(){function e(t){var i;U(this,e),(i=w(this,e)).type="CloudRenderEngine",i.controllers=(null==t?void 0:t.controllers)||{},i.kbEvent=document.createEvent("KeyboardEvent"),i.initMethod=void 0!==i.kbEvent.initKeyboardEvent?"initKeyboardEvent":"initKeyEvent",i.webRtcPlayerObj=null,i.forceTURN=void 0!==t.forceTURN&&t.forceTURN,i.printStats=(null==t?void 0:t.printStats)||!1,i.printInputs=(null==t?void 0:t.printInputs)||!1,i.connectOnLoad=(null==t?void 0:t.connectOnLoad)||!0,i.isReconnection=(null==t?void 0:t.isReconnection)||!1,i.ws,i.wsURL=null==t?void 0:t.wsUrl,i.projectName=void 0===t.projectName?"default":t.projectName,i.renderMode=(null==t?void 0:t.renderMode)||"cloud",i.matchmakerIP=null==t?void 0:t.matchmakerIP,i.matchmakerPort=(null==t?void 0:t.matchmakerPort)||"90",i.scene=new Ae,i.scene.engine=i,i.qualityController=!1,i.qualityControlOwnershipCheckBox,i.matchViewportResolution=(null==t?void 0:t.matchViewportResolution)||!1,i.resolution=(null==t?void 0:t.resolution)||[0,0],i.resizeTimeout=null,i.onDataChannelConnected,i.webRtcConnectionStatsCallback=null,i.lastPacketsLost=0;var n=(null==t?void 0:t.inputOptions)||{},a=n.controlScheme,o=void 0===a?re.controlScheme:a,r=n.suppressBrowserKeys,s=void 0===r?re.suppressBrowserKeys:r,l=n.fakeMouseWithTouches,d=void 0===l?re.fakeMouseWithTouches:l;return i.inputOptions={controlScheme:o,suppressBrowserKeys:s,fakeMouseWithTouches:d},i.eventHandler=new be(i),i.freezeFrameOverlay=null,i.shouldShowPlayOverlay=null==t?void 0:t.shouldShowPlayOverlay,i.freezeFrame={receiving:!1,size:0,jpeg:void 0,height:0,width:0,valid:!1},i.file={mimetype:"",extension:"",receiving:!1,size:0,data:[],valid:!1,timestampStart:void 0},i.afk=(null==t?void 0:t.afk)||{enabled:!1,warnTimeout:120,closeTimeout:10,active:!1,overlay:void 0,warnTimer:void 0,countdown:0,countdownTimer:void 0},i.editTextButton=void 0,i.hiddenInput=void 0,i.t0=Date.now(),i.dataTransferFrequence=20,i.streamTrackSource=null,i.videoEncoderQP="N/A",i.UDSParams=(null==t?void 0:t.UDSParams)||{},i.UDS,i.isSequencer=void 0!==(null==t?void 0:t.isSequencer)&&(null==t?void 0:t.isSequencer),i.styleWidth,i.styleHeight,i.styleTop,i.styleLeft,i.styleCursor=(null==t?void 0:t.styleCursor)||"default",i.styleAdditional,i._orientationChangeTimeout,i.playerElementClientRect=void 0,i.normalizeAndQuantizeUnsigned=void 0,i.normalizeAndQuantizeSigned=void 0,i.isShowTestUI=null==t?void 0:t.isShowTestUI,setTimeout((function(){i.interval(i.dataTransferFrequence)}),1e3),"inner"===i.renderMode&&i._preInitInnerMode(),i}return z(e,ve),k(e,[{key:"interval",value:function(){var e=this;setInterval((function(){e.eventHandler.updateObjectsWithEvent(),e.eventListenerUpdate(e),e.eventListenerUpdate(e.camera),e.scene.traverse((function(t){e.eventListenerUpdate(t),t.visibleNeedsUpdate&&(e.emitUIInteraction({excuteName:Z.VISIBLE,params:t.toJSON()}),t.visibleNeedsUpdate=!1),t.visible&&(t.matrixNeedsUpdate||t.materialNeedsUpdate||t.animateNeedsUpdate)&&("TrafficLayer"===t.type?e.emitUIInteraction({excuteName:Q.CREATE_TRAFFIC_STREAM,params:t.toJSON(!1)}):"LayerBuilding"===t.type?e.emitUIInteraction({excuteName:K.EVENT_LAYER_BUILDING,params:t.toJSON()}):"SlopeAnalysis"===t.type?e.emitUIInteraction({excuteName:K.UPDATA_SLOPE_ANALYSIS,params:t.toJSON()}):e.emitUIInteraction({excuteName:Z.UPDATE,params:t.toJSON()}),t.matrixNeedsUpdate=!1,t.materialNeedsUpdate=!1,t.animateNeedsUpdate=!1),t.visible&&t.messageNeedsUpdate&&("TrafficLayer"===t.type?e.emitUIInteraction({excuteName:Q.CREATE_TRAFFIC_STREAM,params:t.toJSON(!1)}):e.emitUIInteraction({excuteName:Z.UPDATE,params:t.toJSON()}),t.messageNeedsUpdate=!1),t.followNeedsUpdate&&("TrafficLayer"===t.type?e.emitUIInteraction({excuteName:Q.FOLLOW_TRAFFIC_STREAM_ITEM,params:t.toJSON(!1)}):"AutonomousVehicle"===t.type&&e.emitUIInteraction({excuteName:Z.UPDATE,params:t.toJSON()}),t.followNeedsUpdate=!1)})),e.camera&&e.camera.needsUpdate&&(e.camera.constrainPolygonNeedsUpdate?(e.emitUIInteraction({excuteName:X.Constrain_Shape,params:e.camera.toJSON()}),e.camera.constrainPolygonNeedsUpdate=!1):e.emitUIInteraction({excuteName:X.UPDATE,params:e.camera.toJSON()}),e.camera.needsUpdate=!1)}),1e3/(arguments.length>0&&void 0!==arguments[0]?arguments[0]:5))}},{key:"eventListenerUpdate",value:function(e){e&&e._needsDispatchedToUE&&(e._dispatchAddListenerTypes&&e._dispatchAddListenerTypes.length>0&&(this.emitUIInteraction({excuteName:Q.ADD_EVENT_LISTENER,params:{type:e.type,name:e.name,uuid:e.uuid,EventType:e._dispatchAddListenerTypes}}),e._dispatchAddListenerTypes=[]),e._dispatchRemoveListenerTypes&&e._dispatchRemoveListenerTypes.length>0&&(this.emitUIInteraction({excuteName:Q.REMOVE_EVENT_LISTENER,params:{type:e.type,name:e.name,uuid:e.uuid,EventType:e._dispatchRemoveListenerTypes}}),e._dispatchRemoveListenerTypes=[]),e._needsDispatchedToUE=!1,e._dispatchName=null)}},{key:"log",value:function(e){console.log("".concat(Math.floor(Date.now()-this.t0),": ")+e)}},{key:"_preInitInnerMode",value:function(){var e=this;if(!this._preInitInnerModeStarted){this._preInitInnerModeStarted=!0;var t=this,i=setInterval((function(){var n;"undefined"!=typeof ue&&null!==(n=ue)&&void 0!==n&&n.interface&&(clearInterval(i),ue.interface._webUILoadedSet||(ue.interface._webUILoadedSet=!0,ue.interface.webUILoaded=function(){t._initWebUI()}),e.addEventListener("webUIisReady",(function(){})))}),200)}}},{key:"initCamera",value:function(){var e,t=this;this.camera&&(null===(e=this.camera)||void 0===e||e.removeFromParent(),this.camera=null);this.camera=new Le,this.camera.type="Camera",this.camera.addEventListener("cameraChange",(function(e){var i,n,o,r,s,l,d=e.content.camera;t.camera.position.x=d.Location.longitude,t.camera.position.y=d.Location.latitude,t.camera.position.z=d.Location.altitude,t.camera.rotation.x=a.degToRad(d.Rotate.roll),t.camera.rotation.y=a.degToRad(d.Rotate.pitch),t.camera.rotation.z=a.degToRad(d.Rotate.yaw),t.camera.roll=d.Rotate.roll,t.camera.pitch=d.Rotate.pitch,t.camera.yaw=d.Rotate.yaw,t.camera.worldLocation.x=null==d||null===(i=d.Position)||void 0===i?void 0:i.x,t.camera.worldLocation.y=null==d||null===(n=d.Position)||void 0===n?void 0:n.y,t.camera.worldLocation.z=null==d||null===(o=d.Position)||void 0===o?void 0:o.z,t.camera.sphereLocation.x=null==d||null===(r=d.SphereLocation)||void 0===r?void 0:r.longitude,t.camera.sphereLocation.y=null==d||null===(s=d.SphereLocation)||void 0===s?void 0:s.latitude,t.camera.sphereLocation.z=null==d||null===(l=d.SphereLocation)||void 0===l?void 0:l.altitude,t.level=Math.ceil(Math.max(Math.log2(103300/t.camera.worldLocation.z),0)),t.dispatchEvent({type:"camera_changed",data:e})}))}},{key:"initObjectBBox",value:function(){if(this.objectBBox)return!1;this.objectBBox=new dt({color:new d(1,1,0)}),this.scene.add(this.objectBBox),this.objectBBox.visible=!1,this.emitUIInteraction({excuteName:q.OBJECT_BOUNDINGBOX,params:this.objectBBox.toJSON()})}},{key:"_initWebUI",value:function(){if(!this._webUIInitialized){this._webUIInitialized=!0;var e=this;ue.interface.webUIMessage=function(t){e.eventHandler.callRespone(t)},console.log("页面及其所有资源已完全加载"),setTimeout((function(){e.UDS||(e.UDS=new fe(e,e.UDSParams)),e.camera||(console.log("initOthers start"),e.initOthers(),console.log("initOthers end -> ",e.camera)),e.dispatchEvent({type:"videoInitialised"})}),1e3),vt((new Date).getTime())}}},{key:"scanGamepads",value:function(){for(var e=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():[],t=0;t<e.length;t++)e[t]&&e[t].index in this.controllers&&(this.controllers[e[t].index].currentState=e[t])}},{key:"updateStatus",value:function(){for(j in this.scanGamepads(),this.controllers){for(var e=this.controllers[j],t=e.currentState,i=e.prevState,n=0;n<t.buttons.length;n++){var a=t.buttons[n],o=i.buttons[n];a.pressed&&!o.pressed?6==n?this.emitControllerAxisMove(j,5,a.value):7==n?this.emitControllerAxisMove(j,6,a.value):this.emitControllerButtonPressed(j,n,0):!a.pressed&&o.pressed?6==n?this.emitControllerAxisMove(j,5,0):7==n?this.emitControllerAxisMove(j,6,0):this.emitControllerButtonReleased(j,n):a.pressed&&o.pressed&&(6==n?this.emitControllerAxisMove(j,5,a.value):7==n?this.emitControllerAxisMove(j,6,a.value):this.emitControllerButtonPressed(j,n,1))}for(var r=0;r<t.axes.length;r+=2){var s=parseFloat(t.axes[r].toFixed(4)),l=-parseFloat(t.axes[r+1].toFixed(4));0===r?(this.emitControllerAxisMove(j,1,s),this.emitControllerAxisMove(j,2,l)):2===r&&(this.emitControllerAxisMove(j,3,s),this.emitControllerAxisMove(j,4,l))}this.controllers[j].prevState=t}gt(this.updateStatus)}},{key:"emitControllerButtonPressed",value:function(e,t,i){Data=new DataView(new ArrayBuffer(4)),Data.setUint8(0,se.GamepadButtonPressed),Data.setUint8(1,e),Data.setUint8(2,t),Data.setUint8(3,i)}},{key:"emitControllerButtonReleased",value:function(e,t){Data=new DataView(new ArrayBuffer(3)),Data.setUint8(0,se.GamepadButtonReleased),Data.setUint8(1,e),Data.setUint8(2,t)}},{key:"emitControllerAxisMove",value:function(e,t,i){Data=new DataView(new ArrayBuffer(11)),Data.setUint8(0,se.GamepadAnalog),Data.setUint8(1,e),Data.setUint8(2,t),Data.setFloat64(3,i,!0),this.sendInputData(Data.buffer)}},{key:"setupToggleWithUrlParams",value:function(e,t){var i=document.getElementById(e);i&&(i.checked=new URLSearchParams(window.location.search).has(t),i.addEventListener("change",(function(e){var i=new URLSearchParams(window.location.search);e.currentTarget.checked?i.set(t,"true"):i.delete(t),window.history.replaceState({},"",""!==i.toString()?"".concat(location.pathname,"?").concat(i):"".concat(location.pathname))})))}},{key:"updateStreamList",value:function(){for(var e=document.getElementById("stream-select"),t=e.options.length-1;t>=0;t--)e.remove(t);e.value=null;var i,n=T(this.webRtcPlayerObj.availableVideoStreams);try{for(n.s();!(i=n.n()).done;){var a=_(i.value,2),o=a[0],r=(a[1],document.createElement("option"));r.value=o,r.innerHTML=o,e.appendChild(r),null==e.value&&(e.value=o)}}catch(e){n.e(e)}finally{n.f()}this.updateTrackList()}},{key:"updateTrackList",value:function(){for(var e=document.getElementById("stream-select"),t=document.getElementById("track-select"),i=this.webRtcPlayerObj.availableVideoStreams.get(e.value),n=t.options.length-1;n>=0;n--)t.remove(n);t.value=null;var a,o=T(i.getVideoTracks());try{for(o.s();!(a=o.n()).done;){var r=a.value,s=document.createElement("option");s.value=r.id,s.innerHTML=r.label,t.appendChild(s),r.selected&&(t.value=r.id)}}catch(e){o.e(e)}finally{o.f()}}},{key:"sendStartLatencyTest",value:function(){var e=this;if(this.webRtcPlayerObj){this.webRtcPlayerObj.startLatencyTest((function(t){var i={StartTime:t};e.emitDescriptor(se.LatencyTest,i)}))}}},{key:"setOverlay",value:function(e,t,i){var n=document.getElementById("videoPlayOverlay");if(!n){var a=document.getElementById("player");(n=document.createElement("div")).id="videoPlayOverlay",a&&a.appendChild(n)}for(;n.lastChild;)n.removeChild(n.lastChild);t&&n.appendChild(t),i&&n.addEventListener("click",(function e(t){i(t),n.removeEventListener("click",e)}));for(var o=n.classList,r=o.length-1;r>=0;r--)o.remove(o[r]);n.classList.add(e)}},{key:"showConnectOverlay",value:function(){var e=this,t=document.createElement("div");t.id="playButton",t.innerHTML="点击开始",this.setOverlay("clickableState",t,(function(t){e.connect(),e.startAfkWarningTimer()}))}},{key:"showTextOverlay",value:function(e){var t=document.createElement("div");t.id="messageOverlay",t.innerHTML=e||"",this.setOverlay("textDisplayState",t)}},{key:"playVideoStream",value:function(){var e=this;e.webRtcPlayerObj&&this.webRtcPlayerObj.video?(e.webRtcPlayerObj.video.play().catch((function(t){console.error(t),console.log("Browser does not support autoplaying video without interaction - to resolve this we are going to show the play button overlay."),e.showPlayOverlay()})),e.requestInitialSettings(),e.requestQualityControl(),e.eventHandler.showFreezeFrameOverlay(),e.hideOverlay()):console.error("Could not player video stream because this.webRtcPlayerObj.video was not valid.")}},{key:"showPlayOverlay",value:function(){var e=this,t=document.createElement("img");t.id="playButton",t.src="/images/Play.png",t.alt="Start Streaming",this.setOverlay("clickableState",t,(function(t){e.playVideoStream()})),this.shouldShowPlayOverlay=!1}},{key:"updateAfkOverlayText",value:function(){this.afk.overlay.innerHTML="<center>No activity detected<br>Disconnecting in "+this.afk.countdown+" seconds<br>Click to continue<br></center>"}},{key:"showAfkOverlay",value:function(){var e=this;this.stopAfkWarningTimer(),this.afk.overlay=document.createElement("div"),this.afk.overlay.id="afkOverlay",this.setOverlay("clickableState",this.afk.overlay,(function(t){e.hideOverlay(),clearInterval(e.afk.countdownTimer),e.startAfkWarningTimer()})),this.afk.countdown=this.afk.closeTimeout,this.updateAfkOverlayText(),this.inputOptions.controlScheme==oe.LockedMouse&&document.exitPointerLock(),this.afk.countdownTimer=setInterval((function(){this.afk.countdown--,0==this.afk.countdown?(this.hideOverlay(),this.ws.close()):this.updateAfkOverlayText()}),1e3)}},{key:"hideOverlay",value:function(){this.setOverlay("hiddenState")}},{key:"startAfkWarningTimer",value:function(){this.afk.active=this.afk.enabled,this.resetAfkWarningTimer()}},{key:"stopAfkWarningTimer",value:function(){this.afk.active=!1}},{key:"resetAfkWarningTimer",value:function(){var e=this;this.afk.active&&(clearTimeout(this.afk.warnTimer),this.afk.warnTimer=setTimeout((function(){e.showAfkOverlay()}),1e3*e.afk.warnTimeout))}},{key:"createWebRtcOffer",value:function(){this.webRtcPlayerObj?(console.log("Creating offer"),this.showTextOverlay("云渲染服务连接中,请稍等"),this.webRtcPlayerObj.createOffer()):(console.log("WebRTC player not setup, cannot create offer"),this.showTextOverlay("云渲染服务连接失败,无法获取画面"))}},{key:"sendInputData",value:function(e){this.webRtcPlayerObj&&(this.resetAfkWarningTimer(),this.webRtcPlayerObj.send(e))}},{key:"setupWebRtcPlayer",value:function(e,t){var i=this;function n(e){this.freezeFrame.receiving||(this.freezeFrame.receiving=!0,this.freezeFrame.valid=!1,this.freezeFrame.size=0,this.freezeFrame.jpeg=void 0),this.freezeFrame.size=new DataView(e.slice(1,5).buffer).getInt32(0,!0);var t=e.slice(5);if(this.freezeFrame.jpeg){var n=new Uint8Array(this.freezeFrame.jpeg.length+t.length);n.set(this.freezeFrame.jpeg,0),n.set(t,this.freezeFrame.jpeg.length),this.freezeFrame.jpeg=n}else this.freezeFrame.jpeg=t,this.freezeFrame.receiving=!0,console.log("received first chunk of freeze frame: ".concat(this.freezeFrame.jpeg.length,"/").concat(this.freezeFrame.size));this.freezeFrame.jpeg.length===this.freezeFrame.size?(this.freezeFrame.receiving=!1,this.freezeFrame.valid=!0,console.log("received complete freeze frame ".concat(this.freezeFrame.size)),function(){var e=btoa(this.freezeFrame.jpeg.reduce((function(e,t){return e+String.fromCharCode(t)}),"")),t=document.getElementById("this.freezeFrameOverlay").childNodes[0];t.src="data:image/jpeg;base64,"+e,t.onload=function(){i.freezeFrame.height=t.naturalHeight,i.freezeFrame.width=t.naturalWidth,i.resizeFreezeFrameOverlay(),i.shouldShowPlayOverlay?(i.showPlayOverlay(),i.eventHandler.resizePlayerStyle()):i.eventHandler.showFreezeFrameOverlay()}}()):this.freezeFrame.jpeg.length>this.freezeFrame.size&&(console.error("received bigger freeze frame than advertised: ".concat(this.freezeFrame.jpeg.length,"/").concat(this.freezeFrame.size)),this.freezeFrame.jpeg=void 0,this.freezeFrame.receiving=!1)}return this.webRtcPlayerObj=new ye(A(A({},t),{},{forceTURN:this.forceTURN})),e.appendChild(this.webRtcPlayerObj.video),e.appendChild(this.freezeFrameOverlay),this.connectOnLoad&&(this.webRtcPlayerObj.video.muted=!0),this.webRtcPlayerObj.onWebRtcOffer=function(e){if(i.ws&&1===i.ws.readyState){var t=JSON.stringify(e);console.log("%c[Outbound SS message (offer)]","background: lightgreen; color: black",e),i.ws.send(t)}},this.webRtcPlayerObj.onWebRtcCandidate=function(e){i.ws&&1===i.ws.readyState&&i.ws.send(JSON.stringify({type:"iceCandidate",candidate:e}))},this.webRtcPlayerObj.onWebRtcAnswer=function(e){if(i.ws&&1===i.ws.readyState){var t=JSON.stringify(e);console.log("%c[Outbound SS message (answer)]","background: lightgreen; color: black",e),i.ws.send(t)}},this.webRtcPlayerObj.onVideoInitialised=function(){i.ws&&1===i.ws.readyState&&(i.shouldShowPlayOverlay?(i.showPlayOverlay(),i.eventHandler.resizePlayerStyle()):(i.eventHandler.resizePlayerStyle(),i.playVideoStream()),0!==i.resolution[0]&&0!==i.resolution[1]&&i.changeResolution(i.resolution[0],i.resolution[1]))},this.webRtcPlayerObj.onDataChannelConnected=function(){i.ws&&1===i.ws.readyState&&(i.showTextOverlay("云渲染服务连接成功,等待画面推送中"),i.requestQualityControl(),setTimeout((function(){i.UDS||(i.UDS=new fe(i,i.UDSParams)),i.camera||i.initOthers(),i.dispatchEvent({type:"videoInitialised"})}),1e3))},this.webRtcPlayerObj.onNewVideoTrack=function(e){var t,n;null!=i&&null!==(t=i.webRtcPlayerObj)&&void 0!==t&&t.onVideoInitialised&&(null==i||null===(n=i.webRtcPlayerObj)||void 0===n||n.onVideoInitialised());i.isShowTestUI&&i.updateStreamList()},this.webRtcPlayerObj.onDataChannelMessage=function(e){var t=new Uint8Array(e);if(t[0]===ae.QualityControlOwnership){var a=0!==t[1];console.log("Received quality controller message, will control quality: "+a),i.qualityController=a,i.qualityControlOwnershipCheckBox&&(i.qualityControlOwnershipCheckBox.disabled=a,i.qualityControlOwnershipCheckBox.checked=a)}else if(t[0]===ae.Response){var o=new TextDecoder("utf-16").decode(e.slice(1));i.eventHandler.callRespone(JSON.parse(o))}else if(t[0]===ae.Command){var r=new TextDecoder("utf-16").decode(e.slice(1));console.log(r);var s=JSON.parse(r);"onScreenKeyboard"===s.command&&i.showOnScreenKeyboard(s)}else if(t[0]===ae.FreezeFrame)n(t);else if(t[0]===ae.UnfreezeFrame)i.eventHandler.invalidateFreezeFrameOverlay();else if(t[0]===ae.VideoEncoderAvgQP)i.videoEncoderQP=new TextDecoder("utf-16").decode(e.slice(1));else if(t[0]==ae.LatencyTest){var l=new TextDecoder("utf-16").decode(e.slice(1));console.log("Got latency timings from UE."),console.log(l);var d=JSON.parse(l);i.webRtcPlayerObj&&i.webRtcPlayerObj.latencyTestTimings.SetUETimings(d)}else if(t[0]==ae.InitialSettings){if(!i.isShowTestUI)return;var c=new TextDecoder("utf-16").decode(e.slice(1)),u=JSON.parse(c);if(u.PixelStreaming){if(!1===u.PixelStreaming.AllowPixelStreamingCommands){if(document.getElementById("encoder-min-qp-text").disabled=!0,document.getElementById("encoder-max-qp-text").disabled=!0,document.getElementById("webrtc-fps-text").disabled=!0,document.getElementById("webrtc-min-bitrate-text").disabled=!0,document.getElementById("webrtc-max-bitrate-text").disabled=!0,document.getElementById("show-fps-button").disabled=!0,document.getElementById("encoder-params-submit").disabled=!0,document.getElementById("webrtc-params-submit").disabled=!0,!document.getElementById("warning-elem-webrtc")){var h=document.createElement("p");h.innerText="(Disabled by -AllowPixelStreamingCommands=false)",h.classList="subtitle-text",h.id="warning-elem-webrtc",document.getElementById("webRTCSettingsHeader").appendChild(h)}if(!document.getElementById("warning-elem-encoder")){var p=document.createElement("p");p.innerText="(Disabled by -AllowPixelStreamingCommands=false)",p.classList="subtitle-text",p.id="warning-elem-encoder",document.getElementById("encoderSettingsHeader").appendChild(p)}console.warn("-AllowPixelStreamingCommands=false, sending console commands from browser to UE is disabled, including toggling FPS and changing encoder settings from the browser.")}u.PixelStreaming.DisableLatencyTest&&(document.getElementById("test-latency-button").disabled=!0,document.getElementById("test-latency-button").title="Disabled by -PixelStreamingDisableLatencyTester=true",console.warn("-PixelStreamingDisableLatencyTester=true, requesting latency report from the the browser to UE is disabled."))}u.Encoder&&(document.getElementById("encoder-min-qp-text").value=u.Encoder.MinQP,document.getElementById("encoder-max-qp-text").value=u.Encoder.MaxQP),u.WebRTC&&(document.getElementById("webrtc-fps-text").value=u.WebRTC.FPS,document.getElementById("webrtc-min-bitrate-text").value=u.WebRTC.MinBitrate/1e3,document.getElementById("webrtc-max-bitrate-text").value=u.WebRTC.MaxBitrate/1e3)}else if(t[0]==ae.FileExtension)!function(e){this.file.receiving||(this.file.mimetype="",this.file.extension="",this.file.receiving=!0,this.file.valid=!1,this.file.size=0,this.file.data=[],this.file.timestampStart=(new Date).getTime(),console.log("Received first chunk of this.file"));var t=new TextDecoder("utf-16").decode(e.slice(1));console.log(t),this.file.extension=t}(t);else if(t[0]==ae.FileMimeType)!function(e){this.file.receiving||(this.file.mimetype="",this.file.extension="",this.file.receiving=!0,this.file.valid=!1,this.file.size=0,this.file.data=[],this.file.timestampStart=(new Date).getTime(),console.log("Received first chunk of this.file"));var t=new TextDecoder("utf-16").decode(e.slice(1));console.log(t),this.file.mimetype=t}(t);else if(t[0]==ae.FileContents)!function(e){if(this.file.receiving){this.file.size=Math.ceil(new DataView(e.slice(1,5).buffer).getInt32(0,!0)/16379);var t=e.slice(5);if(this.file.data.push(t),console.log("Received this.file chunk: ".concat(this.file.data.length,"/").concat(this.file.size)),this.file.data.length===this.file.size){this.file.receiving=!1,this.file.valid=!0,console.log("Received complete this.file");var i=(new Date).getTime()-this.file.timestampStart,n=Math.round(16*this.file.size*1024/i);console.log("Average transfer bitrate: ".concat(n,"kb/s over ").concat(i/1e3," seconds"));var a=new Blob(this.file.data,{type:this.file.mimetype}),o=document.createElement("a");o.setAttribute("href",URL.createObjectURL(a)),o.setAttribute("download","transfer.".concat(this.file.extension));var r=$(o);r.appendTo("body"),r.remove()}else this.file.data.length>this.file.size&&(this.file.receiving=!1,console.error("Received bigger this.file than advertised: ".concat(this.file.data.length,"/").concat(this.file.size)))}}(t);else if(t[0]==ae.Mouse){var f=new TextDecoder("utf-16").decode(e.slice(1));this.eventHandler.dispatchMouseEvent(f)}else if(t[0]==ae.Keyboard){var m=new TextDecoder("utf-16").decode(e.slice(1));this.eventHandler.dispatchKeyboardEvent(m)}else t[0]==ae.InputControlOwnership||t[0]==ae.Protocol?new TextDecoder("utf-16").decode(e.slice(1)):console.error("unrecognized data received, packet ID ".concat(t[0]))},this.eventHandler.registerInputs(this.webRtcPlayerObj.video),"ontouchstart"in document.documentElement&&this.createOnScreenKeyboardHelpers(e),this.webRtcPlayerObj.video}},{key:"setupStats",value:function(){var e=this;this.webRtcPlayerObj.aggregateStats(1e3);var t=3e5,i=t;this.webRtcPlayerObj.onAggregatedStats=function(n){for(var a=new Intl.NumberFormat(window.navigator.language,{maximumFractionDigits:0}),o=new Intl.NumberFormat(window.navigator.language,{maximumFractionDigits:0,minimumIntegerDigits:2}),r=(n.timestamp-n.timestampStart)/1e3,s=[],l=[60,60],d=0;d<l.length;d++)s.push(r%l[d]),r/=l[d];s.push(r);for(var c=s[0],u=Math.floor(s[1]),h=Math.floor([s[2]]),p="B",f=n.hasOwnProperty("bytesReceived")?n.bytesReceived:0,m=["kB","MB","GB"],g=0;g<m.length&&!(f<1e5);g++)f/=1e3,p=m[g];n.receivedBytes=""+f+m;var y=document.getElementById("qualityStatus"),v=function(e){if(y)var t=e,i=1,n=setInterval((function(){y?(i-=.1,y.style="opacity: ".concat(Math.abs(2*(i-.5))),i<=.1&&(0==--t?clearInterval(n):i=1)):clearInterval(n)}),100/e)},b="",x="lime";e.videoEncoderQP>35?(x="red",v(2),b+='<div style="color: '.concat(x,'">Very blocky encoding quality</div>')):e.videoEncoderQP>26&&(x="orange",v(1),b+='<div style="color: '.concat(x,'">Blocky encoding quality</div>')),y&&(y.className="".concat(x,"Status")),b+="<div>Duration: ".concat(o.format(h),":").concat(o.format(u),":").concat(o.format(c),"</div>"),b+="<div>Video Resolution: ".concat(n.hasOwnProperty("frameWidth")&&n.frameWidth&&n.hasOwnProperty("frameHeight")&&n.frameHeight?n.frameWidth+"x"+n.frameHeight:"Chrome only","</div>"),b+="<div>Received (".concat(p,"): ").concat(a.format(f),"</div>"),b+="<div>Frames Decoded: ".concat(n.hasOwnProperty("framesDecoded")?a.format(n.framesDecoded):"Chrome only","</div>"),b+="<div>Packets Lost: ".concat(n.hasOwnProperty("packetsLost")?a.format(n.packetsLost):"Chrome only","</div>"),b+="<div>Framerate: ".concat(n.hasOwnProperty("framerate")?a.format(n.framerate):"Chrome only","</div>"),b+="<div>Frames dropped: ".concat(n.hasOwnProperty("framesDropped")?a.format(n.framesDropped):"Chrome only","</div>"),b+="<div>Net RTT (ms): ".concat(n.hasOwnProperty("currentRoundTripTime")?a.format(1e3*n.currentRoundTripTime):"Can't calculate","</div>"),b+="<div>Browser receive to composite (ms): ".concat(n.hasOwnProperty("receiveToCompositeMs")?a.format(n.receiveToCompositeMs):"Chrome only","</div>"),b+='<div style="color: '.concat(x,'">Bitrate (kbps): ').concat(n.hasOwnProperty("bitrate")?a.format(n.bitrate):"Chrome only","</div>"),b+='<div style="color: '.concat(x,'">Video Quantization Parameter: ').concat(e.videoEncoderQP,"</div>");var S=document.getElementById("stats");if(S&&(S.innerHTML=b),e.printStats&&n.timestampStart&&n.timestamp-n.timestampStart>i&&(e.ws&&1===e.ws.readyState&&(console.log("-> SS: stats\n".concat(JSON.stringify(n))),e.ws.send(JSON.stringify({type:"stats",data:n}))),i+=t),e.dispatchEvent({type:"aggregatedStats",data:n}),e.webRtcConnectionStatsCallback&&"function"==typeof e.webRtcConnectionStatsCallback)try{var N=n.hasOwnProperty("packetsLost")?n.packetsLost:0,w=n.hasOwnProperty("currentRoundTripTime")?1e3*n.currentRoundTripTime:0,U=n.hasOwnProperty("framerate")?n.framerate:0,C=0;void 0!==e.lastPacketsLost&&(C=Math.max(0,N-e.lastPacketsLost)),e.lastPacketsLost=N;var k=C>0||w>300||U<10&&C>0,T=k?"⚠️ 网络拥堵":"✅ 网络良好",O=C>30?"丢失 ".concat(C," 包/次"):"0 (稳定)",R={bitrate:n.hasOwnProperty("bitrate")?n.bitrate:null,avgBitrate:n.hasOwnProperty("avgBitrate")?n.avgBitrate:null,framerate:U,resolution:{width:n.hasOwnProperty("frameWidth")?n.frameWidth:null,height:n.hasOwnProperty("frameHeight")?n.frameHeight:null},roundTripTime:w,packetsLost:N,framesDroppedPercentage:n.hasOwnProperty("framesDroppedPercentage")?n.framesDroppedPercentage:null,quantizationParameter:e.videoEncoderQP,originData:n,diagnosis:{isCongested:k,status:T,instantPacketLoss:C,instantPacketLossText:O}};e.webRtcConnectionStatsCallback(R)}catch(e){console.error("Error calling webRtcConnectionStatsCallback:",e)}},this.webRtcPlayerObj.latencyTestTimings.OnAllLatencyTimingsReady=function(e){if(e.BrowserReceiptTimeMs){var t=e.BrowserReceiptTimeMs-e.TestStartTimeMs,i=e.UEEncodeMs,n=e.UECaptureToSendMs,a=e.UETransmissionTimeMs-e.UEReceiptTimeMs,o=t-a,r=null,s=null;e.FrameDisplayDeltaTimeMs&&e.BrowserReceiptTimeMs&&(r=e.FrameDisplayDeltaTimeMs+o+("string"==typeof n?0:n),s=e.FrameDisplayDeltaTimeMs+(t-o-a));var l="";l+="<div>Net latency RTT (ms): ".concat(o.toFixed(2),"</div>"),l+="<div>UE Encode (ms): ".concat("string"==typeof i?i:i.toFixed(2),"</div>"),l+="<div>UE Send to capture (ms): ".concat("string"==typeof n?n:n.toFixed(2),"</div>"),l+="<div>UE probe duration (ms): ".concat(a.toFixed(2),"</div>"),l+=e.FrameDisplayDeltaTimeMs&&e.BrowserReceiptTimeMs?"<div>Browser composite latency (ms): ".concat(e.FrameDisplayDeltaTimeMs.toFixed(2),"</div>"):"",l+=s?"<div>Total browser latency (ms): ".concat(s.toFixed(2),"</div>"):"",l+=r?"<div>Total latency (ms): ".concat(r.toFixed(2),"</div>"):"";var d=document.getElementById("LatencyStats");d&&(d.innerHTML=l)}}}},{key:"onWebRtcConnectionStats",value:function(e){"function"==typeof e?(this.webRtcConnectionStatsCallback=e,this.webRtcPlayerObj&&!this.webRtcPlayerObj.aggregateStatsIntervalId&&this.setupStats()):console.warn("onWebRtcConnectionStats: callback must be a function")}},{key:"onWebRtcOffer",value:function(e){this.webRtcPlayerObj.receiveOffer(e),this.isShowTestUI&&this.setupStats()}},{key:"onWebRtcAnswer",value:function(e){this.webRtcPlayerObj.receiveAnswer(e),this.isShowTestUI&&this.setupStats()}},{key:"onWebRtcIce",value:function(e){this.webRtcPlayerObj&&this.webRtcPlayerObj.handleCandidateFromServer(e)}},{key:"updateVideoStreamSize",value:function(){var e=this;this.matchViewportResolution&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((function(){var t=document.getElementById("player");if(t){var i=t.clientWidth,n=t.clientHeight;if(i>3840||n>2160){var a=3840/i,o=2160/n,r=Math.min(a,o);i=Math.floor(i*r),n=Math.floor(n*r)}e.changeResolution(i,n),console.log("Debounced resize: Resolution updated to ".concat(i,"x").concat(n))}}),500))}},{key:"emitDescriptor",value:function(e,t){var i=function(e){var t=JSON.stringify(e);return t.replace(/\r\n/g,"").replace(/\n/g,"").replace(/\s+/g,""),t}(t),n=49152;if(2*i.length>67108864)return console.error("数据量超出最大传输范围6.4MB!"),!1;if(2*i.length<n)return this.sendStringBufferData(e,i),!1;for(var a=Math.ceil(2*i.length/n),o=0;o<a;o++){var r=i.slice(.5*o*n,24576*(o+1));this.sendStringBufferData(e,r,a,o+1)}}},{key:"sendStringBufferData",value:function(e,t){var i,n={total:arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,index:arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,content:t};i=JSON.stringify(n);var a=new DataView(new ArrayBuffer(3+2*i.length)),o=0;a.setUint8(o,e),o++,a.setUint16(o,i.length,!0),o+=2;for(var r=0;r<i.length;r++)a.setUint16(o,i.charCodeAt(r),!0),o+=2;this.sendInputData(a.buffer)}},{key:"emitUIInteraction",value:function(e){var t,i;(console.log(e),"cloud"===this.renderMode)?this.emitDescriptor(se.UIInteraction,e):"undefined"!=typeof ue&&null!==(t=ue)&&void 0!==t&&null!==(i=t.interface)&&void 0!==i&&i.broadcast?ue.interface.broadcast(JSON.stringify(e)):console.warn("ue.interface.broadcast is not available in this environment.")}},{key:"emitCommand",value:function(e){this.emitDescriptor(se.Command,e)}},{key:"requestInitialSettings",value:function(){this.sendInputData(new Uint8Array([se.RequestInitialSettings]).buffer)}},{key:"requestQualityControl",value:function(){this.qualityController||this.sendInputData(new Uint8Array([se.RequestQualityControl]).buffer)}},{key:"setupNormalizeAndQuantize",value:function(){var e=document.getElementById("player"),t=e.getElementsByTagName("video");if(e&&t.length>0){var i=e.clientHeight/e.clientWidth,n=t[0].videoHeight/t[0].videoWidth;if(i>n){this.printInputs&&console.log("Setup Normalize and Quantize for playerAspectRatio > videoAspectRatio");var a=i/n;this.normalizeAndQuantizeUnsigned=function(t,i){var n=t/e.clientWidth,o=a*(i/e.clientHeight-.5)+.5;return n<0||n>1||o<0||o>1?{inRange:!1,x:65535,y:65535}:{inRange:!0,x:65536*n,y:65536*o}},this.unquantizeAndDenormalizeUnsigned=function(t,i){var n=(i/65536-.5)/a+.5;return{x:t/65536*e.clientWidth,y:n*e.clientHeight}},this.normalizeAndQuantizeSigned=function(t,i){return{x:32767*(t/(.5*e.clientWidth)),y:32767*(a*i/(.5*e.clientHeight))}}}else{this.printInputs&&console.log("Setup Normalize and Quantize for playerAspectRatio <= videoAspectRatio");var o=n/i;this.normalizeAndQuantizeUnsigned=function(t,i){var n=o*(t/e.clientWidth-.5)+.5,a=i/e.clientHeight;return n<0||n>1||a<0||a>1?{inRange:!1,x:65535,y:65535}:{inRange:!0,x:65536*n,y:65536*a}},this.unquantizeAndDenormalizeUnsigned=function(t,i){var n=i/65536;return{x:((t/65536-.5)/o+.5)*e.clientWidth,y:n*e.clientHeight}},this.normalizeAndQuantizeSigned=function(t,i){return{x:32767*(o*t/(.5*e.clientWidth)),y:32767*(i/(.5*e.clientHeight))}}}}}},{key:"createOnScreenKeyboardHelpers",value:function(e){var t=this;null===document.getElementById("this.hiddenInput")&&(this.hiddenInput=document.createElement("input"),this.hiddenInput.id="this.hiddenInput",this.hiddenInput.maxLength=0,e.appendChild(this.hiddenInput)),null===document.getElementById("this.editTextButton")&&(this.editTextButton=document.createElement("button"),this.editTextButton.id="this.editTextButton",this.editTextButton.innerHTML="edit text",e.appendChild(this.editTextButton),this.editTextButton.classList.add("hiddenState"),this.editTextButton.addEventListener("click",(function(){t.hiddenInput.focus()})))}},{key:"showOnScreenKeyboard",value:function(e){if(e.showOnScreenKeyboard){this.editTextButton.classList.remove("hiddenState");var t=this.unquantizeAndDenormalizeUnsigned(e.x,e.y);this.editTextButton.style.top=t.y.toString()+"px",this.editTextButton.style.left=(t.x-40).toString()+"px"}else this.editTextButton.classList.add("hiddenState"),this.hiddenInput.blur()}},{key:"start",value:function(e,t){var i=document.getElementById("qualityStatus");i&&(i.className="grey-status");var n=document.getElementById("stats");n&&(n.innerHTML="Not connected"),!this.connectOnLoad||this.isReconnection?(this.showConnectOverlay(),this.eventHandler.invalidateFreezeFrameOverlay(),this.shouldShowPlayOverlay=!0,this.eventHandler.resizePlayerStyle()):(console.log("直接链接~~~~~~"),this.connect(e,t))}},{key:"buildingGrowthAnimate",value:function(e){var t=e.state,i=void 0===t?"play":t,n=e.group,a=void 0===n?1:n,o=e.duration,r=void 0===o?3e3:o,s=e.startHeight,l=void 0===s?0:s,d=e.endHeight,c=void 0===d?100:d,u=e.loop,h=void 0!==u&&u,p=e.easing,f=void 0===p?"Linear":p,m=e.sliceColor,g=void 0===m?{r:1,g:0,b:0}:m,y=e.sliceBrightness,v=void 0===y?30:y,b=e.colorHeight,x=void 0===b?100:b;this.emitUIInteraction({excuteName:q.BUILD_GROWTHANIMATE,params:JSON.stringify({State:i,Group:a,Duration:r,StartHeight:l,EndHeight:c,Loop:h,Easing:f,SliceColor:g,SliceBrightness:v,ColorHeight:x})})}},{key:"changeResolution",value:function(e,t){if(void 0===e||void 0===t||e<=0||t<=0)console.warn("[PixelStream] 传入的分辨率参数无效:",e,t);else{var i=4096,n=e,a=t,o=[];if(n>i)a=(n=i)/(e/t),o.push("宽度 ".concat(e," 超过安全限制 ").concat(i,",已按比例缩放"));var r=2*Math.floor(n/2),s=2*Math.floor(a/2);r===n&&s===a||n%2==0&&a%2==0||o.push("分辨率包含奇数,已修正为偶数"),a=s,(n=r)===e&&a===t||console.warn("[PixelStream] 分辨率自动修正提示:\n"+"原目标: ".concat(e," x ").concat(t,"\n")+"修正后: ".concat(n," x ").concat(a,"\n")+"原因: ".concat(o.join(", ")||"数值取整")),console.log("[PixelStream] Sending command: r.SetRes ".concat(n,"x").concat(a)),this.emitUIInteraction({excuteName:Q.CONSOLE_COMMAND,params:{Command:"r.SetRes "+n+"x"+a}})}}},{key:"changeRenderBitrate",value:function(e){if(null!=e){if(-1===e)return console.log("执行命令: 解除码率限制 (Set to -1)"),this.excuteEngineConsoleCommand("PixelStreaming.Encoder.MaxBitrate -1"),void this.excuteEngineConsoleCommand("PixelStreaming.Encoder.TargetBitrate -1");var t=Number(e);if(!isNaN(t)){var i=(t=Math.max(1e5,t)).toFixed(0);this.excuteEngineConsoleCommand("PixelStreaming.Encoder.MaxBitrate "+i),this.excuteEngineConsoleCommand("PixelStreaming.Encoder.TargetBitrate "+i)}}else console.warn("传入的参数为空")}},{key:"excuteEngineConsoleCommand",value:function(e){void 0!==e?this.emitUIInteraction({excuteName:Q.CONSOLE_COMMAND,params:{Command:e}}):console.warn("传入的参数为空")}},{key:"Swtich3DTilesMode",value:function(e){var t=e.mode,i=e.tilesName;this.emitUIInteraction({excuteName:K.SWITCH_TERRAIN_MODE,params:{Mode:t,TilesName:i}})}},{key:"enable3DTilesByName",value:function(e){var t=e.enable,i=void 0===t||t,n=e.tilesName;this.emitUIInteraction({excuteName:K.ENABLE_3DTILES_BY_NAME,params:{Enable:i,TilesName:n}})}},{key:"hidden3DTilesItem",value:function(e){var t=e.hiddenList,i=void 0===t?[]:t,n=e.tilesName;Array.isArray(i)||(i=[]),this.emitUIInteraction({excuteName:K.HIDDEN_3DTILES_ITEM,params:{HiddenList:i,TilesName:n}})}},{key:"changeWeather",value:function(e){console.warn("方法被移除,请使用UDS设置天气"),e&&this.UDS.changeWeather(e)}},{key:"changeTime",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;console.warn("方法被移除,请使用UDS设置时间"),this.UDS.changeTime(e,t)}},{key:"setWorldCenterPoint",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(void 0===e||void 0===t)return console.warn("传入的参数为空"),!1;this.emitUIInteraction({excuteName:Q.RESET_WORLD_CENTER,params:{Center:{Latitude:a.clamp(t,-90,90),Longitude:a.clamp(e,-180,180),Altitude:a.clamp(i,-500,8848)}}})}},{key:"SetPlanePOIMode",value:function(e){var t=e.enable,i=void 0!==t&&t,n=e.cullingScale,a=void 0===n?2:n,o=e.aspectRatio,r=void 0===o?1.777778:o,s=e.cameraFov,l=void 0===s?90:s,d=e.maxTilesCullingDistance,c=void 0===d?1e3:d,u=e.maxPOICullingDistance,h=void 0===u?2e3:u,p=e.poiSimplifyDistance,f=void 0===p?1500:p,m=e.maxLoadedPoiTilesNum,g=void 0===m?5:m;this.emitUIInteraction({excuteName:K.SET_PLANE_POI_MODE,params:{EnablePoi:i,CullingScale:a,AspectRatio:r,CameraFov:l,MaxTilesCullingDistance:c,MaxPOICullingDistance:h,PoiSimplifyDistance:f,MaxLoadedPoiTilesNum:g}})}},{key:"moveTo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{roll:0,pitch:0,yaw:0},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:1,preload:!1,endLineDetect:!1,detectLength:5e4,flyOverLongitude:!1,zoom:-1,number:0,isGlobalMove:!1,globalCityCenter:null,callback:null};if(!e)return!1;this._silentlyRemoveEventListener(this.camera,"moveTo",this._moveToCallback),this._moveToCallback=i.callback,this.emitUIInteraction({excuteName:X.MOVE_TO,params:{Longitude:null==e?void 0:e.x,Latitude:null==e?void 0:e.y,Altitude:null==e?void 0:e.z,rotation:{Roll:null==t?void 0:t.roll,Pitch:null==t?void 0:t.pitch,Yaw:null==t?void 0:t.yaw},Duration:null==i?void 0:i.duration,Preload:null==i?void 0:i.preload,EndLineDetect:null==i?void 0:i.endLineDetect,DetectLength:null==i?void 0:i.detectLength,FlyOverLongitude:null==i?void 0:i.flyOverLongitude,Zoom:null==i?void 0:i.zoom,Number:null==i?void 0:i.number,IsGlobalMove:null==i?void 0:i.isGlobalMove,GlobalCityCenter:null==i?void 0:i.globalCityCenter}}),console.log("moveTo options is ",i),console.log("moveTo this.camera is ",this.camera),null!=i&&i.callback&&this.camera.addEventListener("moveTo",i.callback)}},{key:"moveCamera",value:function(e){var t=e.multiplier,i=void 0===t?1:t,n=e.x,a=void 0===n?0:n,o=e.y,r=void 0===o?0:o;this.emitUIInteraction({excuteName:X.MOVE,params:{Multiplier:i,ActionValue:{x:a,y:r}}})}},{key:"rotateCamera",value:function(e){var t=e.multiplier,i=void 0===t?1:t,n=e.yaw,a=void 0===n?0:n,o=e.pitch,r=void 0===o?0:o;this.emitUIInteraction({excuteName:X.ROTATE,params:{Multiplier:i,ActionValue:{x:a,y:r}}})}},{key:"zoomIn",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.emitUIInteraction({excuteName:X.ZOOM_IN,params:{Multiplier:e}})}},{key:"zoomOut",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.emitUIInteraction({excuteName:X.ZOOM_OUT,params:{Multiplier:e}})}},{key:"focusOn",value:function(e){var t,i,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{duration:1,index:-1,preload:!1,rotation:{roll:0,pitch:0,yaw:0},flyOverLongitude:!1,callback:null};if(!e)return!1;this.emitUIInteraction({excuteName:X.FOCUS_ON,params:{uuid:null==e?void 0:e.uuid,type:null==e?void 0:e.type,rotation:{Roll:null==a||null===(t=a.rotation)||void 0===t?void 0:t.roll,Pitch:null==a||null===(i=a.rotation)||void 0===i?void 0:i.pitch,Yaw:null==a||null===(n=a.rotation)||void 0===n?void 0:n.yaw},Duration:null==a?void 0:a.duration,Preload:null==a?void 0:a.preload,Index:null==a?void 0:a.index,FlyOverLongitude:null==a?void 0:a.flyOverLongitude}}),null!=a&&a.callback&&this.camera.addEventListener("focusOn",a.callback)}},{key:"navigateByKeypoints",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.lockAll,a=void 0===n||n,o=i.speed,r=void 0===o?36:o,s=i.time,l=void 0===s?0:s,d=i.ignoreLag,c=void 0!==d&&d,u=i.name,h=void 0===u?"":u,p=i.patrolType,f=void 0===p?"default":p,m=i.followRotation,g=void 0===m?{Roll:!1,Pitch:!1,Yaw:!1}:m,y=i.finishDestory,v=void 0===y||y,b=i.rayDetectionDistance,x=void 0===b?1e3:b,S=i.callback,N=void 0===S?null:S,w=i.startCallback,U=void 0===w?null:w,C=i.finishCallback,k=void 0===C?null:C;if(!e||e.length<2)return!1;this._silentlyRemoveEventListener(this.camera,"navigationStart",this._navigationStartCallback),this._silentlyRemoveEventListener(this.camera,"navigationFinish",this._navigationFinishCallback),this._navigationStartCallback=U,this._navigationFinishCallback=k||N,U&&this.camera.addEventListener("navigationStart",U);for(var T=[],O=0,R=e.length;O<R;O++){var E=e[O];T.push(E[0],E[1],E[2]||10,E[3]||0,E[4]||0,E[5]||0)}setTimeout((function(){t.emitUIInteraction({excuteName:X.NAVIGATION,params:JSON.stringify({jsondata:T,Speed:r,Name:h,Time:l,IgnoreLag:c,LockAll:a,PatrolType:f,FollowRotation:g,RayDetectionDistance:x,FinishDestory:v})})}),100),(k||N)&&(k?this.camera.addEventListener("navigationFinish",k):this.camera.addEventListener("navigationFinish",N))}},{key:"pauseNavigation",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).patrolType,t=void 0===e?"default":e;this.emitUIInteraction({excuteName:X.NAVIGATION_PAUSE,params:{State:0,PatrolType:t}})}},{key:"resumeNavigation",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).patrolType,t=void 0===e?"default":e;this.emitUIInteraction({excuteName:X.NAVIGATION_PAUSE,params:{State:1,PatrolType:t}})}},{key:"stopNavigation",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.patrolType,n=void 0===i?"default":i,a=t.delayTime;setTimeout((function(){e.emitUIInteraction({excuteName:X.NAVIGATION_STOP,params:{PatrolType:n}})}),void 0===a?100:a)}},{key:"enableDataLayerByName",value:function(e,t){this.emitUIInteraction({excuteName:q.ENABLE_DATALAYER,params:{Visible:t,DataLayerName:e}})}},{key:"project",value:function(e,t){if(!e)return!1;this.emitUIInteraction({excuteName:X.PROJECT,params:{Position:{x:e.x,y:e.y,z:e.z}}}),this.camera.addEventListener("project",t)}},{key:"unproject",value:function(e,t){if(!e)return!1;this.emitUIInteraction({excuteName:X.UNPROJECT,params:{Position:{x:e.x,y:e.y}}}),this.camera.addEventListener("unproject",t)}},{key:"getAltitudeFromCoordinate",value:function(e,t){var i=this;if(!e)return!1;var n={Coordinate:e.coordinate,DetectLength:e.detectLength||100};this.addEventListener("getAltitude",t),setTimeout((function(){i.emitUIInteraction({excuteName:K.GET_ALTITUDE,params:n})}),100)}},{key:"exit",value:function(){console.warn("方法将被移除,请使用new LevelManage().exit()"),this.emitUIInteraction({excuteName:Q.EXIT_CLIENT})}},{key:"restartGame",value:function(){console.warn("方法将被移除,new LevelManage().restartGame()"),this.emitUIInteraction({excuteName:Q.RESTART_GAME}),this.dispatchEvent({type:"gameResarted"})}},{key:"addToScene",value:function(e){e&&(this.scene.add(e),e.materialNeedsUpdate=!1,e.matrixNeedsUpdate=!1,e.animateNeedsUpdate=!1,"TrafficLayer"===e.type?this.emitUIInteraction({excuteName:Q.CREATE_TRAFFIC_STREAM,params:e.toJSON(!1)}):"LayerBuilding"===e.type?this.emitUIInteraction({excuteName:K.EVENT_LAYER_BUILDING,params:e.toJSON(!1)}):"SlopeAnalysis"===e.type?this.emitUIInteraction({excuteName:K.UPDATA_SLOPE_ANALYSIS,params:e.toJSON()}):this.emitUIInteraction({excuteName:Z.ADD,params:e.toJSON(!1)}))}},{key:"removeFromScene",value:function(e){this.destoryObject(e)}},{key:"removeAllFromScene",value:function(){this.emitUIInteraction({excuteName:Z.DESTORY_ALL}),this.scene.clear()}},{key:"destoryObject",value:function(e){e&&("TrafficLayer"===e.type?this.emitUIInteraction({excuteName:Q.CLOSE_TRAFFIC_STREAM,params:e.toJSON(!1)}):"LayerBuilding"===e.type?(e.buildingState="destory",this.emitUIInteraction({excuteName:K.EVENT_LAYER_BUILDING,params:e.toJSON(!1)})):this.emitUIInteraction({excuteName:Z.DESTORY,uuid:e.uuid}),e.dispose&&e.dispose(),this.scene.remove(e))}},{key:"enableEdit",value:function(e,t,i){var n=null,a={};if(this.drawAndMeasureGroup||(this.drawAndMeasureGroup=new c,this.scene.add(this.drawAndMeasureGroup)),"measure"===e)switch(this.editMode="measure",n=ee.ENABLE_MEASURE,t.toLowerCase()){case"polygon":case"measurearea":if(this.drawAndMeasureGroup.measureArea)this.drawAndMeasureGroup.measureArea.updateParameters(i);else{var o=new ct(i);this.drawAndMeasureGroup.measureArea=o,this.drawAndMeasureGroup.add(o)}a=this.drawAndMeasureGroup.measureArea.toJSON();break;case"line":case"measureline":if(this.drawAndMeasureGroup.measureLine)this.drawAndMeasureGroup.measureLine.updateParameters(i);else{var r=new ut(i);this.drawAndMeasureGroup.measureLine=r,this.drawAndMeasureGroup.add(r)}a=this.drawAndMeasureGroup.measureLine.toJSON();break;case"surfaceline":if(this.drawAndMeasureGroup.surfaceline)this.drawAndMeasureGroup.surfaceline.updateParameters(i);else{var s=new ht(i);this.drawAndMeasureGroup.surfaceline=s,this.drawAndMeasureGroup.add(s)}a=this.drawAndMeasureGroup.surfaceline.toJSON();break;default:if(this.drawAndMeasureGroup.locationPoint)this.drawAndMeasureGroup.locationPoint.updateParameters(i);else{var l=new pt(i);this.drawAndMeasureGroup.locationPoint=l,this.drawAndMeasureGroup.add(l)}a=this.drawAndMeasureGroup.locationPoint.toJSON()}else switch(this.editMode="draw",n=ee.ENABLE_DRAW,t){case"polygon":if(this.drawAndMeasureGroup.polygon)for(var d in i)this.drawAndMeasureGroup.polygon[d]!==i[d]&&(this.drawAndMeasureGroup.polygon[d]=i[d]);else{var u=new it(i);this.drawAndMeasureGroup.polygon=u,this.drawAndMeasureGroup.add(u)}a=this.drawAndMeasureGroup.polygon.toJSON(0);break;case"line":if(this.drawAndMeasureGroup.line)for(var h in i)this.drawAndMeasureGroup.line[h]!==i[h]&&(this.drawAndMeasureGroup.line[h]=i[h]);else{var p=new st(i);this.drawAndMeasureGroup.line=p,this.drawAndMeasureGroup.add(p)}a=this.drawAndMeasureGroup.line.toJSON(0);break;default:if(this.drawAndMeasureGroup.point)for(var f in i)this.drawAndMeasureGroup.point[f]!==i[f]&&(this.drawAndMeasureGroup.point[f]=i[f]);else{var m=new lt(i);this.drawAndMeasureGroup.point=m,this.drawAndMeasureGroup.add(m)}a=this.drawAndMeasureGroup.point.toJSON()}this.emitUIInteraction({ExcuteName:n,params:a})}},{key:"closeEdit",value:function(){if(this.editMode){var e=ee.CLOSE_DRAW;"measure"===this.editMode&&(e=ee.CLOSE_MEASURE),this.emitUIInteraction({ExcuteName:e})}}},{key:"setFPS",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.emitUIInteraction({ExcuteName:q.ENABLE_FPS,params:{state:e}})}},{key:"removeAllEditObjects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["point","line","polygon","surfaceline"];if(this.drawAndMeasureGroup&&!(this.drawAndMeasureGroup.children.length<1)){var i=[];if(e)switch(e){case"draw":(!Array.isArray(t)||t.length<1)&&(t=["point","line","polygon"]),t.indexOf("polygon")>-1&&this.drawAndMeasureGroup.polygon&&(i.push(this.drawAndMeasureGroup.polygon.uuid),this.drawAndMeasureGroup.polygon.removeFromParent(),this.drawAndMeasureGroup.polygon=null),t.indexOf("line")>-1&&this.drawAndMeasureGroup.line&&(i.push(this.drawAndMeasureGroup.line.uuid),this.drawAndMeasureGroup.line.removeFromParent(),this.drawAndMeasureGroup.line=null),t.indexOf("point")>-1&&this.drawAndMeasureGroup.point&&(i.push(this.drawAndMeasureGroup.point.uuid),this.drawAndMeasureGroup.point.removeFromParent(),this.drawAndMeasureGroup.point=null),this.emitUIInteraction({ExcuteName:ee.DESTORY_DRAW,params:{uuids:i,Classes:t}});break;case"measure":(!Array.isArray(t)||t.length<1)&&(t=["point","line","polygon","surfaceline"]);var n=t.indexOf("polygon");n>-1&&(t.splice(n,1),t.push("MeasureArea")),n>-1&&this.drawAndMeasureGroup.measureArea&&(i.push(this.drawAndMeasureGroup.measureArea.uuid),this.drawAndMeasureGroup.measureArea.removeFromParent(),this.drawAndMeasureGroup.measureArea=null),(n=t.indexOf("line"))>-1&&(t.splice(n,1),t.push("MeasureLine")),n>-1&&this.drawAndMeasureGroup.measureLine&&(i.push(this.drawAndMeasureGroup.measureLine.uuid),this.drawAndMeasureGroup.measureLine.removeFromParent(),this.drawAndMeasureGroup.measureLine=null),(n=t.indexOf("point"))>-1&&(t.splice(n,1),t.push("LocationPoint")),n>-1&&this.drawAndMeasureGroup.locationPoint&&(i.push(this.drawAndMeasureGroup.locationPoint.uuid),this.drawAndMeasureGroup.locationPoint.removeFromParent(),this.drawAndMeasureGroup.locationPoint=null),(n=t.indexOf("surfaceline"))>-1&&(t.splice(n,1),t.push("SurfaceLine")),n>-1&&this.drawAndMeasureGroup.surfaceline&&(i.push(this.drawAndMeasureGroup.surfaceline.uuid),this.drawAndMeasureGroup.surfaceline.removeFromParent(),this.drawAndMeasureGroup.surfaceline=null),this.emitUIInteraction({ExcuteName:ee.DESTORY_MEASURE,params:{uuids:i,Classes:t}});break;case"all":this.emitUIInteraction({ExcuteName:ee.DESTORY_DRAW,params:{uuids:i,Classes:["Point","Line","Polygon"]}}),this.emitUIInteraction({ExcuteName:ee.DESTORY_MEASURE,params:{uuids:i,Classes:["MeasureArea","MeasureLine","LocationPoint","SurfaceLine"]}}),this.drawAndMeasureGroup.children=[],this.scene.remove(this.drawAndMeasureGroup),this.drawAndMeasureGroup=null}}}},{key:"connect",value:(t=N(P().mark((function t(){var i,n,a,o,r,s,l,d=arguments;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=d.length>0&&void 0!==d[0]?d[0]:function(){},n=d.length>1&&void 0!==d[1]?d[1]:function(){},o=function(e){console.log("connectToStreamer wsURL :>> ",e),window.WebSocket=window.WebSocket||window.MozWebSocket,window.WebSocket?(a.reclickToStart&&clearTimeout(a.reclickToStart),a.ws=new WebSocket(e),a.ws.onopen=function(t){a.connected||(a.dispatchEvent({type:"connected"}),a.connected=!0),console.log("".concat(e," WebSocket connection")),a.startPSHeartbeat(),console.log("Start the heartbeat detection of the signaling server.")},a.ws.onmessage=function(e){var t=JSON.parse(e.data);"config"===t.type?(console.log("%c[Inbound SS (config)]","background: lightblue; color: black",t),a.onConfig(t)):"playerCount"===t.type?console.log("%c[Inbound SS (playerCount)]","background: lightblue; color: black",t):"offer"===t.type?(console.log("%c[Inbound SS (offer)]","background: lightblue; color: black",t),a.onWebRtcOffer(t)):"answer"===t.type?(console.log("%c[Inbound SS (answer)]","background: lightblue; color: black",t),a.onWebRtcAnswer(t)):"iceCandidate"===t.type?a.onWebRtcIce(t.candidate):"warning"===t.type&&t.warning?console.warn(t.warning):"pong"===t.type?console.log("pong",t.time):console.error("Invalid SS message type",t.type)},a.ws.onerror=function(e){console.log("WS error: ".concat(JSON.stringify(e))),a.stopPSHeartbeat(),a.dispatchEvent({type:"signalingServerError"})},a.ws.onclose=function(e){console.log("WS closed: ".concat(JSON.stringify(e.code)," - ").concat(e.reason)),a.stopPSHeartbeat(),a.ws=void 0,a.isReconnection=!0,a.connected&&(a.connected=!1);var t=document.getElementById("player");a.webRtcPlayerObj&&(t.removeChild(a.webRtcPlayerObj.video),a.webRtcPlayerObj.close(),a.webRtcPlayerObj=void 0),a.showTextOverlay("云渲染服务未正常连接"),a.reclickToStart=setTimeout((function(){a.connect(i,n)}),1500)}):alert("Your browser doesn't support WebSocket")},(a=this).wsURL){t.next=35;break}if(!e.DispatchServer.host){t.next=13;break}return console.log("用新版调度服务启动 ".concat(e.DispatchServer.host,"/api/tasks/create")),t.next=9,e.DispatchServer.CreateTask(a.projectName);case 9:0===(r=t.sent).status?(a.forceTURN=r.data.useTurnServer,a.wsURL="ws://".concat(r.data.host,":").concat(r.data.port),a.currentTask=r,o(a.wsURL),i&&i("Successfully created task: "+r)):(console.error("Failed to create task:"+r.message),n&&n("Failed to create task: "+r.message)),t.next=33;break;case 13:if(!a.matchmakerIP){t.next=31;break}return s="http://".concat(a.matchmakerIP,":").concat(a.matchmakerPort,"/gpuserver?project=").concat(a.projectName),t.prev=15,t.next=18,v.get(s);case 18:if(!(l=t.sent).data||!l.data.error){t.next=22;break}return console.error(l.data.error),t.abrupt("return",!1);case 22:a.wsURL="ws://".concat(l.data.gpuServer,":").concat(l.data.port),o(a.wsURL),t.next=29;break;case 26:t.prev=26,t.t0=t.catch(15),console.error(t.t0);case 29:t.next=33;break;case 31:return console.error("Needs a matchmaker's IP"),t.abrupt("return",!1);case 33:t.next=36;break;case 35:o(a.wsURL);case 36:case"end":return t.stop()}}),t,this,[[15,26]])}))),function(){return t.apply(this,arguments)})},{key:"startPSHeartbeat",value:function(){var t=this;e.DispatchServer.host&&(this.heartbeatInterval=setInterval((function(){t.ws.readyState===WebSocket.OPEN&&(t.ws.send('{"type":"ping"}'),console.log("Heartbeat send: Ping"))}),2e3))}},{key:"stopPSHeartbeat",value:function(){this.heartbeatInterval&&clearInterval(this.heartbeatInterval)}},{key:"onConfig",value:function(e){var t=document.getElementById("player"),i=this.setupWebRtcPlayer(t,e);switch(this.eventHandler.resizePlayerStyle(),this.inputOptions.controlScheme){case oe.HoveringMouse:this.eventHandler.registerHoveringMouseEvents(i);break;case oe.LockedMouse:this.eventHandler.registerLockedMouseEvents(i);break;default:console.log("ERROR: Unknown control scheme ".concat(this.inputOptions.controlScheme)),this.eventHandler.registerLockedMouseEvents(i)}}},{key:"setupModelInfo",value:function(e,t,i,n){if(!e)return!1;if(!n){var a=new URL(e),o=a.protocol,r=a.host,s=a.search,l=a.pathname.split("/").filter(Boolean);0===l.length?l.push("getStaticResourceUrl"):l[l.length-1]="getStaticResourceUrl";var d="/"+l.join("/");n="".concat(o,"//").concat(r).concat(d).concat(s)}t||(t={all:1,common:1,project_id:"418690084255052706"}),this.emitUIInteraction({excuteName:q.ASSET_MODEL,params:{ModInfoUrl:e,StaticResourceURL:n,ModInfoBody:t,ModInfoHeader:i}})}},{key:"initOthers",value:function(){var e=this;this.initCamera(),document.addEventListener("keydown",(function(e){(116===e.keyCode||e.ctrlKey&&82===e.keyCode)&&(window._frash_=!0)})),this.isSequencer&&(this.sequencerEnvironment=new ge(this)),window.onbeforeunload=function(){e.levelReady||window._frash_||(e.levelReady=!0),window._frash_=!1}}},{key:"load",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};"cloud"==this.renderMode&&(this.eventHandler.setupHtmlEvents(),this.eventHandler.setupFreezeFrameOverlay(),this.eventHandler.registerKeyboardEvents(),window.addEventListener("resize",(function(){return e.updateVideoStreamSize()})),this.start(t,i),vt((new Date).getTime()))}}]);var t}();function vt(){gt(vt),y.update()}function bt(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"!=typeof e)throw new Error("decodeBase64: 输入必须是字符串");var i=e.replace(/[\s=]/g,"");try{for(var n=atob(i),a=new Uint8Array(n.length),o=0;o<n.length;o++)a[o]=n.charCodeAt(o);return t?a:(new TextDecoder).decode(a)}catch(e){throw new Error("decodeBase64: 无效的 Base64 字符串")}}O(yt,"DispatchServer",mt);var xt={encodeBase64:function(e){if("string"==typeof e){var t=(new TextEncoder).encode(e);return btoa(String.fromCharCode.apply(String,F(t)))}if(e instanceof Uint8Array)return btoa(String.fromCharCode.apply(String,F(e)));throw new Error("encodeBase64: 输入必须是字符串或 Uint8Array")},decodeBase64:bt,isValidBase64:function(e){if("string"!=typeof e)return!1;if(!/^[A-Za-z0-9+/]*={0,2}$/.test(e))return!1;try{return bt(e),!0}catch(e){return!1}}},St=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).parameters=i,t.renderNum=void 0===i.renderNum?20:i.renderNum,t.visible=void 0===i.visible||i.visible;var n=i.width||1,a=i.circleScale||50,o=void 0!==i.startHide&&i.startHide,r=void 0!==i.endHide&&i.endHide,s=i.speed||.5,l=i.opacity||.02,d=i.brightness||100,c=i.angle||40;return t.type="ODLine",Object.defineProperties(t,{angle:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},width:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},circleScale:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,t.materialNeedsUpdate=!0}},startHide:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},endHide:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},speed:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}},opacity:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},brightness:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,t.materialNeedsUpdate=!0}}}),t}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=Fe(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Angle:this.angle,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,Width:this.width,CircleScale:this.circleScale,StartHide:this.startHide,EndHide:this.endHide,Speed:this.speed,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,RenderNum:this.renderNum}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.width=t.width,this.circleScale=t.circleScale,this.speed=t.speed,this.startHide=t.startHide,this.endHide=t.endHide,B(e,"copy",this)([t,i]),this}}])}();function Nt(e){switch(e){case 0:return"DoNotFcaeToCamera";case 1:default:return"FacetoCamera_XYZ";case 2:return"FacetoCamera_Y";case 3:return"FacetoCamera_Z"}}var wt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).renderNum=void 0===i.renderNum?20:i.renderNum;var n=i.pivot||{x:.5,y:.5};t.visible=void 0===i.visible||i.visible,t.isGlobalPOI=void 0!==i.isGlobalPOI&&i.isGlobalPOI;var a=i.text||null,o=i.iconUrl||"",r=i.texture||"",s=i.width||32,l=i.height||32,d=i.iconPathName||"",c=void 0===i.hideText||i.hideText,u=void 0!==i.hideImage&&i.hideImage,h=i.renderScale||1;t.renderType=i.renderType||0,t.openCollision=void 0!==i.openCollision&&i.openCollision;var p=0===i.faceType?0:i.faceType||1,f=void 0!==i.switchScale&&i.switchScale,m=i.minScale||0,g=i.maxScale||0,y=i.fontSize||12;return t.fadeIn=void 0===i.fadeIn||i.fadeIn,t.type="IconPoint",Object.defineProperties(t,{pivot:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},text:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,t.materialNeedsUpdate=!0}},iconUrl:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},texture:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},width:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}},height:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},faceType:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){p=e,t.materialNeedsUpdate=!0}},switchScale:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){f=e,t.materialNeedsUpdate=!0}},minScale:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){m=e,t.materialNeedsUpdate=!0}},maxScale:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){g=e,t.materialNeedsUpdate=!0}},iconPathName:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,t.materialNeedsUpdate=!0}},hideText:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},hideImage:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,t.materialNeedsUpdate=!0}},renderScale:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,t.materialNeedsUpdate=!0}},fontSize:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){y=e,t.materialNeedsUpdate=!0}}}),t}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=We(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Pivot:this.pivot,Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,IconUrl:this.iconUrl,Width:this.width,Height:this.height,IconPathName:this.iconPathName,IsGlobalPOI:this.isGlobalPOI,HideText:this.hideText,HideImage:this.hideImage,RenderScale:this.renderScale,FontSize:this.fontSize,RenderType:this.renderType,FadeIn:this.fadeIn,OpenCollision:this.openCollision,FaceType:Nt(this.faceType),SwitchScale:this.switchScale,MaxScale:this.maxScale,MinScale:this.minScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation,RenderNum:this.renderNum}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},FadeIn:this.fadeIn,type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.iconUrl=t.iconUrl,this.width=t.width,this.height=t.height,this.iconPathName=t.iconPathName,this.hideText=t.hideText,this.hideImage=t.hideImage,this.renderScale=t.renderScale,this.fontSize=t.fontSize,B(e,"copy",this)([t,i]),this}}])}(),Ut=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).renderNum=void 0===i.renderNum?20:i.renderNum,t.visible=void 0===i.visible||i.visible,t.isGlobalPOI=void 0!==i.isGlobalPOI&&i.isGlobalPOI;var n=i.backgroundColor||{r:0,g:0,b:0,a:0},a=i.backgroundImage||"",o=t.getMargin(i.margin)||{Top:0,Right:0,Bottom:0,Left:0},r=i.fontSize||24,s=i.fontWeight||"Regular",l=i.borderWidth||0,d=i.borderColor||{r:0,g:0,b:0,a:1},c=i.shadowColor||{r:0,g:0,b:0,a:1},u=i.shadowOffset||{x:0,y:0},h=i.pivot||{x:.5,y:.5};t.renderType=i.renderType||0,t.fadeIn=void 0===i.fadeIn||i.fadeIn,t.openCollision=void 0!==i.openCollision&&i.openCollision;var p=0===i.faceType?0:i.faceType||1,f=void 0!==i.switchScale&&i.switchScale,m=i.minDistance||0,g=i.maxDistance||0,y=void 0===i.minScale?1:i.minScale,v=void 0===i.maxScale?1:i.maxScale;return t.autoWrap=i.autoWrap||!1,t.type="TextPoint",Object.defineProperties(t,{backgroundImage:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,t.materialNeedsUpdate=!0}},backgroundColor:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},margin:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=t.getMargin(e),t.materialNeedsUpdate=!0}},fontSize:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},fontWeight:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}},borderWidth:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},borderColor:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,t.materialNeedsUpdate=!0}},shadowColor:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},shadowOffset:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,t.materialNeedsUpdate=!0}},pivot:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,t.materialNeedsUpdate=!0}},faceType:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){p=e,t.materialNeedsUpdate=!0}},switchScale:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){f=e,t.materialNeedsUpdate=!0}},minDistance:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){m=e,t.materialNeedsUpdate=!0}},maxDistance:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){g=e,t.materialNeedsUpdate=!0}},minScale:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){y=e,t.materialNeedsUpdate=!0}},maxScale:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){v=e,t.materialNeedsUpdate=!0}}}),t}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=We(e)}},{key:"getMargin",value:function(e){var t;if(Array.isArray(e))return e.length<2?t={Top:e[0]||0,Right:e[0]||0,Bottom:e[0]||0,Left:e[0]||0}:e.length<3?t={Top:e[0]||0,Right:e[1]||0,Bottom:e[0]||0,Left:e[1]||0}:e.length<4?t={Top:e[0]||0,Right:e[1]||0,Bottom:e[2]||0,Left:e[1]||0}:e.length<5&&(t={Top:e[0]||0,Right:e[1]||0,Bottom:e[2]||0,Left:e[3]||0}),t}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,FadeIn:this.fadeIn,type:this.type,name:this.name,uuid:this.uuid}:{Pivot:this.pivot,Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},BackgroundColor:{r:this.backgroundColor.r,g:this.backgroundColor.g,b:this.backgroundColor.b,a:this.backgroundColor.a},BackgroundImageURL:this.backgroundImage,IsGlobalPOI:this.isGlobalPOI,Margin:this.margin,AutoWrap:this.autoWrap,Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,FontWeight:this.fontWeight,FontSize:this.fontSize,BorderWidth:this.borderWidth,BorderColor:this.borderColor,ShadowColor:this.shadowColor,ShadowOffset:this.shadowOffset,RenderType:this.renderType,FadeIn:this.fadeIn,OpenCollision:this.openCollision,FaceType:Nt(this.faceType),SwitchScale:this.switchScale,MinDistance:this.minDistance,MaxDistance:this.maxDistance,MaxScale:this.maxScale,MinScale:this.minScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,RenderNum:this.renderNum}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontWeight=t.fontWeight,this.fontSize=t.fontSize,this.borderWidth=t.borderWidth,this.borderColor=t.borderColor,this.shadowColor=t.shadowColor,this.shadowOffset=t.shadowOffset,B(e,"copy",this)([t,i]),this}}])}();function Ct(e,t){var i={};if(Object.assign(i,t),i.style){var n=i.style,a=n.width,o=n.height,r=n.borderRadius,s=n.borderWidth,l=n.paddingTop,d=n.paddingLeft;i.style.width=a*e,i.style.height=o*e,r&&(i.style.borderRadius=r*e),s&&(i.style.borderWidth=s*e),l&&(i.style.paddingTop=l*e),d&&(i.style.paddingLeft=d*e)}return i.content&&i.content.forEach((function(t){for(var i in t)"number"==typeof t[i]&&"id"!==i&&(t[i]=t[i]*e);var n=t.position;n&&(t.position=n.map((function(t){return t*e}))),t.textList&&t.textList.forEach((function(t){t.fontSize=t.fontSize*e,t.position=t.position.map((function(t){return t*e}))}))})),i}var kt=function(){function e(t){var i;U(this,e),(i=w(this,e,[t])).renderNum=void 0===t.renderNum?20:t.renderNum,i.name=t.name||"",i.pivot=t.pivot||{x:.5,y:.5},i.offset=t.offset||{x:0,y:0,z:0},i.sizeAttenuation=t.sizeAttenuation||!1,i.constructionConfig=t.constructionConfig||{},i.labelType=t.labelType||"sprite",i.hideText=t.hideText||!1,i.faceType=0===t.faceType?0:t.faceType||1,i.switchScale=t.switchScale||!1,i.renderType=t.renderType||0;var n=t.renderScale||.3;i.minScale=t.minScale||1,i.maxScale=t.maxScale||1,i.type="IconPoint",i.visible=void 0===t.visible||t.visible,i.fadeIn=void 0===t.fadeIn||t.fadeIn;var a=t;return("mesh"===i.labelType||i.sizeAttenuation)&&(a=Ct(n,t)),i.style=a.style,i.drawCanvas=document.createElement("canvas"),i.animationCanvas=document.createElement("canvas"),i.mainView=null,i.sprite=null,i.texture=null,i.animateId=null,i.size=t.size||20,i.extraProps={args:t},a.style?(i.init(a).then((function(){i.materialNeedsUpdate=!0})),Object.defineProperties(i,{renderScale:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,i.materialNeedsUpdate=!0}}}),i):(console.warn("请正确设置BasicLabel的style"),L(i))}return z(e,tt),k(e,[{key:"init",value:(n=N(P().mark((function t(){var i,n,a,o=arguments;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=o.length>0&&void 0!==o[0]?o[0]:{},(n=this.style).height,n.width,this.mainView=document.createElement("canvas"),t.next=5,e.initBackGround(this.style,this.mainView);case 5:if(a=t.sent,this.drawCanvas.width=this.animationCanvas.width=a.width,this.drawCanvas.height=this.animationCanvas.height=a.height,this.factor=a.factor,this.width=a.width,this.height=a.height,this.dispatchEvent({type:"loaded",label:this}),!i.content){t.next=15;break}return t.next=15,this.drawContent(i.content,!0);case 15:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"drawContent",value:function(){var t=N(P().mark((function t(i){var n,a,o,r,s=arguments;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s.length>1&&void 0!==s[1]&&s[1]||"mesh"!==this.labelType&&!this.sizeAttenuation||(i=Ct(this.renderScale,{content:i}).content),n=this.drawCanvas.getContext("2d"),a=this.drawCanvas,o=a.width,r=a.height,n.clearRect(0,0,o,r),n.drawImage(this.mainView,0,0,o,r),t.next=8,e.renderContent(this.style,i,this.drawCanvas,this.factor);case 8:this.texture=Ve(this.drawCanvas),this.dispatchEvent({type:"contentLoaded",label:this});case 10:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"updateContent",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t;("mesh"===this.labelType||this.sizeAttenuation)&&(i=Ct(this.renderScale,t)),this.extraProps={args:t},i.style&&(this.style=i.style),this.init(i).then((function(){e.materialNeedsUpdate=!0}))}},{key:"getFinalFaceType",value:function(e){if(e)switch(e){case 0:return"DoNotFcaeToCamera";case 1:default:return"FacetoCamera_XYZ";case 2:return"FacetoCamera_Y";case 3:return"FacetoCamera_Z"}return"FacetoCamera_XYZ"}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Pivot:this.pivot,Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,HideText:this.hideText,RenderType:this.renderType,FadeIn:this.fadeIn,OpenCollision:this.openCollision,FaceType:this.getFinalFaceType(this.faceType),SwitchScale:this.switchScale,MaxScale:this.maxScale,MinScale:this.minScale,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:1,y:1,z:1},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,Width:this.width,Height:this.height,RenderScale:this.renderScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation,RenderNum:this.renderNum}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},FadeIn:this.fadeIn,type:this.type,name:this.name,uuid:this.uuid}}},{key:"dispose",value:function(){this.children=[],this.sprite=null,this.texture=null,this.drawCanvas=null,this.animationCanvas=null,this.mainView=null}}],[{key:"initBackGround",value:(i=N(P().mark((function t(i,n){var o,r,s,l,d,c,u,h,p,f,m,g,y,v,b,x,S,N,w,U,C,k;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=i.height,r=i.width,s=i.backgroundImage,l=i.borderRadius,d=i.borderColor,c=i.borderWidth,u=i.backgroundColor,h=i.clip,p=r,f=o,m=n.getContext("2d"),g=a.ceilPowerOfTwo(p),y={width:g,height:g*(f/p),factor:{xScale:g/p,yScale:g/p}},n.width=y.width,n.height=y.height,v=y.factor,b=v.xScale,x=v.yScale,!s){t.next=16;break}return t.next=12,e.loadImg(s,"");case 12:S=t.sent,m.drawImage(S,0,0,p*b,f*x),t.next=17;break;case 16:(d||u)&&(m.strokeStyle=d,m.fillStyle=u,m.lineWidth=c?c*b:1*b,e.roundRect(m,m.lineWidth*b,m.lineWidth*x,(p-2*m.lineWidth)*b,(f-2*m.lineWidth)*x,l?l*b:0),u&&m.fill(),d&&m.stroke());case 17:return h&&(N=_(h,4),w=N[0],U=N[1],C=N[2],k=N[3],m.beginPath(),m.moveTo(k*p*b,w*f*x),m.lineTo((1-U)*p*b,w*f*x),m.lineTo((1-U)*p*b,(1-C)*f*x),m.lineTo(k*p*b,(1-C)*f*x),m.lineTo(k*p*b,w*f*x),m.closePath(),m.clip()),t.abrupt("return",y);case 19:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)})},{key:"renderContent",value:(t=N(P().mark((function t(i,n,a,o){var r,s,l,d,c,u,h,p,f,m,g,y,v,b,x,S,N,w,U,C,k,T,O,R,E,z,I,M,A,L,D,B,F,W,j,H,G,V,J,Y,q;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=a.getContext("2d"),s=a.width,l=a.height,d=i.paddingTop,c=i.paddingLeft,u=0,h=0,p=0,f=0,m=o.xScale,g=o.yScale,b=[y=c?c*m:0,v=d?d*g:0],x=[],S=0;case 13:if(!(S<n.length)){t.next=46;break}if(N=n[S],w=N.width,U=N.height,C=N.textList,k=N.marginRight,T=N.marginBottom,O=N.backgroundImage,R=N.borderRadius,E=N.borderColor,z=N.borderWidth,I=N.backgroundColor,M=N.position,A=N.id,L=N.activeInfo,D=void 0===L?{}:L,M&&(B=_(M,2),F=B[0],W=B[1],b[0]=y+F*m,b[1]=v+W*g,u=0,h=0,p=0,f=0),!w||!U){t.next=42;break}if(b[0]+w*m>s&&((p+=u)+U*g<=h?(b[0]=f,b[1]+=u):(b[0]=c?c*m:0,b[1]+=u,h=0,f=0)),!O){t.next=32;break}return t.prev=20,t.next=23,e.loadImg(O,"");case 23:j=t.sent,r.drawImage(j,b[0],b[1],w*m,U*g),t.next=30;break;case 27:t.prev=27,t.t0=t.catch(20),console.warn(t.t0);case 30:t.next=33;break;case 32:I&&(r.strokeStyle=E,r.fillStyle=I,r.lineWidth=z?z*m:1*m,e.roundRect(r,b[0]+r.lineWidth*m,b[1]+r.lineWidth*m,(w-2*r.lineWidth)*m,(U-2*r.lineWidth)*g,R?R*m:0),I&&r.fill(),E&&r.stroke());case 33:C&&C.forEach((function(t){var i=_(t.position,2),n=i[0],a=i[1],s=[b[0]+n*m,b[1]+a*g];e.drawText(r,t,o,s)})),H=b[0]===(c?c*m:0)*m?-.16:-1.3,G=-(l-b[1]-25*g)*(2.05/(107*g))+.1,A&&(V=D.position,J=D.style,Y=void 0===J?{width:5,height:.95}:J,(q=e.addActiveArea(V||{x:H,y:G},Y)).customId=A,x.push(q)),b[0]+=(w+(k||0))*m,(u=(U+(T||0))*g)>h&&(h=u,f=b[0]),t.next=43;break;case 42:C&&C.forEach((function(t){var i=_(t.position,2),n=i[0],a=i[1],s=[b[0]+n*m,b[1]+a*g];e.drawText(r,t,o,s)}));case 43:S++,t.next=13;break;case 46:return t.abrupt("return",x);case 47:case"end":return t.stop()}}),t,null,[[20,27]])}))),function(e,i,n,a){return t.apply(this,arguments)})},{key:"getRectangle",value:function(e,t,i){var n=new u(A({map:i,transparent:!0,fog:!0,depthWrite:!1},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}));n.map&&(n.map.needsUpdate=!0),n.transparent=!0;var a=(.01*e).toFixed(2),o=(.01*t).toFixed(2),r=new h(Number(a),Number(o),1,1),s=new p(r,n);return s.setWidth=a,s.setHeight=o,s}},{key:"loadImg",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=new Image;return i.crossOrigin="Anonymous",i.src=t+e,new Promise((function(e,t){i.addEventListener("load",(function(){e(i)})),i.onerror=function(e){t(e)}}))}},{key:"getTextWidth",value:function(e,t){var i=t.fontSize,n=t.fontFamily,a=t.color,o=t.text,r=e.getContext("2d");return r.font="".concat(i,"px ").concat(n),r.fillStyle=a,r.textAlign="left",r.measureText(o).width}},{key:"drawText",value:function(e,t,i,n){var a,o=i.xScale,r=_(n,2),s=r[0],l=r[1],d=t.text,c=t.fontSize,u=t.fontFamily,h=t.color,p=t.textAlign,f=t.icon;if(d||"number"==typeof d||f)if(d&&f)console.warn("BasicLabel Warning:text和icon不要同时设置");else{if(a=d,e.font="".concat(c*o,"px ").concat(u),e.fillStyle=h,e.textAlign=p||"left",e.textBaseline="top",f){var m=f;-1!==f.indexOf("&amp;")&&(m=f.replace("&amp;","&")),-1!==f.indexOf("&amp")&&(m=f.replace("&amp","&")),a=new Function('return ("'+"".concat(m).replace("&#x","\\u").replace(";","")+'")')()}e.measureText(a).width,e.fillText(a,s,l)}}},{key:"addActiveArea",value:function(e,t){var i=t.width,n=t.height,a=e.x,o=e.y,r=new f({depthTest:!0,depthWrite:!1,transparent:!0,sizeAttenuation:!0,opacity:0}),s=new m(r);return s.scale.set(i,n,1),s.material.color=new d("#58d2d4"),s.center.set(a,o),s}},{key:"roundRect",value:function(e,t,i,n,a,o){e.beginPath(),e.moveTo(t+o,i),e.lineTo(t+n-o,i),e.quadraticCurveTo(t+n,i,t+n,i+o),e.lineTo(t+n,i+a-o),e.quadraticCurveTo(t+n,i+a,t+n-o,i+a),e.lineTo(t+o,i+a),e.quadraticCurveTo(t,i+a,t,i+a-o),e.lineTo(t,i+o),e.quadraticCurveTo(t,i,t+o,i),e.closePath()}}]);var t,i,n}(),Tt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Cone",i}return z(e,tt),k(e)}(),Ot=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:1,g:0,b:0,a:1},brightness:100};return U(this,e),(t=w(this,e,[i])).type="FlashCar",t}return z(e,tt),k(e)}(),Rt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:1,g:0,b:0,a:1},brightness:100};return U(this,e),(t=w(this,e,[i])).type="FlashCarCrash",t}return z(e,tt),k(e)}(),Et=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:1,g:0,b:0,a:1},brightness:100};return U(this,e),(t=w(this,e,[i])).type="FlashPeople",t}return z(e,tt),k(e)}(),zt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Cylinder",i}return z(e,tt),k(e)}(),It=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Decal",i}return z(e,tt),k(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.animateJson){var t=this.animateJson,i=t.From,n=t.To;if(i&&i.scale){var a=i.scale,o=a.x,r=a.z;i.scale.x=r,i.scale.z=o}if(n&&n.scale){var s=n.scale,l=s.x,d=s.z;n.scale.x=d,n.scale.z=l}}return!this.visibleNeedsUpdate||!e||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Scroll:this.scroll,Speed:this.speed,Texture:this.texture,GardientDirection:this.gardientDirection,Color2:{r:this.color2.r,g:this.color2.g,b:this.color2.b,a:this.opacity},BrightnessColor:this.brightnessColor?{r:this.brightnessColor.r,g:this.brightnessColor.g,b:this.brightnessColor.b,a:1}:this.Color,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.z,y:this.scale.y,z:this.scale.x},Rotation:{x:this.rotation.x,y:this.rotation.y+90,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid,jsondata:e?null:this.data,animateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.z,y:this.scale.y,z:this.scale.x},Rotation:{x:this.rotation.x,y:this.rotation.y+90,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}(),Mt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Plane",i}return z(e,tt),k(e)}(),At=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="QuadPyramid",i}return z(e,tt),k(e)}(),Lt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Sphere",i}return z(e,tt),k(e)}(),Pt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="TrafficCone",i}return z(e,tt),k(e)}(),Dt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Circle",i}return z(e,tt),k(e)}(),_t=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Torus",i}return z(e,tt),k(e)}(),Bt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Tube",i}return z(e,tt),k(e)}(),Ft=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="DiamondSign",i}return z(e,tt),k(e)}(),Wt=function(){function i(e){var t;U(this,i),(t=w(this,i,[e])).type="Heatmap",t.kind=e.kind||"texture",t.visible=void 0===e.visible||e.visible,t.container=e.container,t.width=e.width||512,t.height=e.height||512,t.min=e.min,t.max=e.max,t.xName=e.xName,t.yName=e.yName,t.valueName=e.valueName,t.backgroundColor=e.backgroundColor,t.gradient=e.gradient,t.radius=e.radius||40,t.blur=e.blur||.85,t.opacity=e.opacity,t.minOpacity=e.minOpacity||0,t.maxOpacity=e.maxOpacity||1,t.heatmapInstance=null,t.size=e.size||null,t.center=e.center,t.minHeight=e.minHeight||0,t.maxHeight=e.maxHeight||500,t.duration=a.clamp(e.duration||1,0,100),t.data=e.data;var n,o=e.particle||{},r=o.bound||{x:100,y:100,z:0},s=o.scaleBoxXY||1,l=o.noiseStrength||0,d=o.grayPower||1,c=parseInt(o.countX,10)||400,u=parseInt(o.countY,10)||400;return t.particleMaxHeight=o.maxHeight||0,"noiseMap"in o&&(t.noiseMap=n=o.noiseMap,Je(n)||Ge(n,(function(e){e&&(t.noiseMap=n=e)}))),"particle"===t.kind&&(t.gradient={0:"rgb(0, 0, 0)",1:"rgb(256, 256, 256)"}),t.init(),Object.defineProperties(t,{bound:{enumerable:!0,get:function(){return r},set:function(e){e&&"particle"===this.kind&&(r.x=e.x,r.y=e.y,r.z=e.z,this.matrixNeedsUpdate=!0)}},scaleBoxXY:{enumerable:!0,get:function(){return s},set:function(e){console.log(e,s,this.kind),e!==s&&"particle"===this.kind&&(s=e,this.matrixNeedsUpdate=!0)}},noiseStrength:{enumerable:!0,get:function(){return l},set:function(e){e!==l&&"particle"===this.kind&&(l=e,this.matrixNeedsUpdate=!0)}},grayPower:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e!==d&&"particle"===this.kind&&(d=e,this.matrixNeedsUpdate=!0)}},countX:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e!==c&&"particle"===this.kind&&(c=parseInt(e,10),this.matrixNeedsUpdate=!0)}},countY:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e!==u&&"particle"===this.kind&&(u=parseInt(e,10),this.matrixNeedsUpdate=!0)}}}),t}return z(i,tt),k(i,[{key:"init",value:function(){if("particle"===this.kind&&this.data.length<2)console.error("数据量过少,无法绘制粒子热力图");else{var i=function(e,t,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=a.width,r=a.height,s=a.radius,l=void 0===s?40:s;if(!e||e.length<1)return!1;for(var d=1/0,c=-1/0,u={longitude:1/0,latitude:1/0},h={longitude:-1/0,latitude:-1/0},p=0,f=e.length;p<f;p++){var m=n?e[p][n]:e[p].value;d=Math.min(m,d),c=Math.max(m,c),t&&(e[p].x=e[p][t]),i&&(e[p].y=e[p][i]),n&&(e[p].value=e[p][n]),e[p].longitude&&e[p].latitude&&(u.longitude=Math.min(u.longitude,e[p].longitude),u.latitude=Math.min(u.latitude,e[p].latitude),h.longitude=Math.max(h.longitude,e[p].longitude),h.latitude=Math.max(h.latitude,e[p].latitude))}if(e[0].longitude&&e[0].latitude){if(!e[0].hasOwnProperty("x")&&!e[0].hasOwnProperty("y")){for(var g=h.longitude-u.longitude,y=h.latitude-u.latitude,v=1.2*l,b=.5,x=Math.min(v,o*(1-b)/2),S=Math.min(v,r*(1-b)/2),N=o-2*x,w=r-2*S,U=0,C=e.length;U<C;U++)e[U].x=Math.round(x+N*(e[U].longitude-u.longitude)/g),e[U].y=Math.round(S+w*(e[U].latitude-u.latitude)/y);var k=g*(x/N),T=y*(S/w);return{min:d,max:c,bbox:{min:{longitude:u.longitude-k,latitude:u.latitude-T},max:{longitude:h.longitude+k,latitude:h.latitude+T}},originalBbox:{min:A({},u),max:A({},h)}}}return{min:d,max:c,bbox:{min:u,max:h}}}return{min:d,max:c}}(this.data,this.xName,this.yName,this.valueName,{width:this.width,height:this.height,radius:this.radius});if(i&&(void 0===this.min&&(this.min=i.min),void 0===this.max&&(this.max=i.max),i.bbox)){if(!this.center){var n=.5*(i.bbox.min.longitude+i.bbox.max.longitude),a=.5*(i.bbox.min.latitude+i.bbox.max.latitude);this.center={x:n,y:a,z:10}}if(!this.size&&"particle"!==this.kind){var o=i.bbox.max.longitude-i.bbox.min.longitude,r=i.bbox.max.latitude-i.bbox.min.latitude;this.size={x:1e5*o,y:1e5*r}}this.bbox=i.bbox}var s=this.data,l=this.max,d=this.min;if(this.heatmapInstance)this.heatmapInstance.configure(this.getConfig()),this.heatmapInstance.setData({max:l,min:d,data:s}),this.heatmapInstance.repaint();else{this.container||(this.container=jt(this.width,this.height));var c=function(e){if(!e)return!1;var t=e.container||jt(e),i=b.create({container:t,backgroundColor:e.backgroundColor||"rgba(0,0,0,.95)",gradient:e.gradient||{0:"rgb(50, 50, 256)",.1:"rgb(50, 250, 56)",.5:"rgb(250, 250, 56)",1:"rgb(250, 50, 56)"},radius:e.radius||40,opacity:e.opacity,maxOpacity:e.maxOpacity||1,minOpacity:e.minOpacity||0});return i}(this.getConfig());c&&(this.heatmapInstance=c,this.heatmapInstance.setData({max:l,min:d,data:s}))}this.canvas||(this.canvas=this.container.children[0]),this.texture=Ve(this.canvas),this.materialNeedsUpdate=!0,this.center||(this.center=new t(0,0,10)),"particle"!==this.kind&&(this.size||(this.size=new e(this.width,this.height)),this.scale.set(this.size.x,this.size.y,200)),this.position.set(this.center.x,this.center.y,this.center.z)}}},{key:"setData",value:function(e){return!1}},{key:"getConfig",value:function(){return{container:this.container,backgroundColor:this.backgroundColor,gradient:this.gradient,radius:this.radius,opacity:this.opacity,maxOpacity:this.maxOpacity||1,minOpacity:this.minOpacity||0,blur:this.blur||0,width:this.width,height:this.height}}},{key:"repaint",value:function(e){e&&(this.duration=a.clamp(e,.1,100)),this.init()}},{key:"getGeojsonData",value:function(){if(this.container&&this.heatmapInstance){for(var e,t=(this.maxHeight-this.minHeight)/(this.max-this.min),i=this.heatmapInstance._renderer._palette,n=[],a=this.size.x/this.width,o=this.size.y/this.height,r=1/256,s=null===(e=this.heatmapInstance)||void 0===e?void 0:e.getData().data,l=0,d=s.length;l<d;l++){var c=parseInt(s[l].x,10),u=parseInt(s[l].y,10),h=Math.max(Math.min(s[l].value,this.max),this.min),p=(h-this.min)*t+this.minHeight,f=Math.floor((h-this.min)/(this.max-this.min)*252),m=s[l].radius,g={r:i[4*f]*r,g:i[4*f+1]*r,b:i[4*f+2]*r};if(!(p<1)){var y={type:"Feature",properties:{id:l,height:p,color:g,xSize:m,ySize:m},geometry:{type:"Point",coordinates:[a*(c-.5*this.width)/1e5,o*(u-.5*this.height)/1e5]}};n.push(y)}}return n}return!1}},{key:"toJSON",value:function(){var e,t;if((!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&(!this.visible||!this.materialNeedsUpdate))return{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid};if("texture"===this.kind.toLowerCase())return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,Duration:this.duration,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,Kind:this.kind,uuid:this.uuid,RawData:this.data,Min:(null===(e=this.bbox)||void 0===e?void 0:e.min)||null,Max:(null===(t=this.bbox)||void 0===t?void 0:t.max)||null,CanvasWidth:this.width,CanvasHeight:this.height};if("particle"===this.kind.toLowerCase())return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,Duration:this.duration,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,Kind:this.kind,uuid:this.uuid,Bound:this.bound,ScaleBoxXY:this.scaleBoxXY,NoiseStrength:this.noiseStrength,NoiseMap:this.noiseMap,GrayPower:this.grayPower,MaxHeight:this.particleMaxHeight||this.maxHeight,countX:this.countX,countY:this.countY,Min:this.bbox.min,Max:this.bbox.max};var i=this.getGeojsonData();return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,Kind:this.kind,uuid:this.uuid,jsondata:i}}}])}();function jt(e,t){var i=document.createElement("div");return i.style.width=e?e+"px":"512px",i.style.height=t?t+"px":"512px",i.style.top="0px",i.style.display="none",document.getElementsByTagName("body")[0].appendChild(i),i}var Ht=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).renderNum=void 0===i.renderNum?20:i.renderNum,t.type="Particle";var n=i.kind||he.FIRE_SMALL,o=i.spawnRate||30,r=i.brightness||3,s=i.lifeTime||1,l=new d(1,0,1);i.brightnessColor&&(l.r=a.clamp(i.brightnessColor.r,0,1),l.g=a.clamp(i.brightnessColor.g,0,1),l.b=a.clamp(i.brightnessColor.b,0,1));var c=i.speed||5,u=i.height||200,h=i.width||.01,p=i.zVelocity||100;return t.thickness=i.thickness||.2,Object.defineProperties(t,{kind:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},spawnRate:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},brightness:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},brightnessColor:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l.r=e.r,l.g=e.g,l.b=e.b,l.a=1,t.materialNeedsUpdate=!0)}},speed:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},height:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,t.materialNeedsUpdate=!0}},width:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,t.materialNeedsUpdate=!0}},zVelocity:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){p=e,t.materialNeedsUpdate=!0}},lifeTime:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}}}),t}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=We(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,BrightnessColor:this.brightnessColor?{r:this.brightnessColor.r,g:this.brightnessColor.g,b:this.brightnessColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},SpawnRate:this.spawnRate,Speed:this.speed,Height:this.height,ZVelocity:this.zVelocity,LifeTime:this.lifeTime,Width:this.width,Kind:this.kind,type:this.type,uuid:this.uuid,Thickness:this.thickness,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,RenderNum:this.renderNum}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.size=t.size,this.kind=t.kind,this.thickness=t.thickness,B(e,"copy",this)([t,i]),this}}])}(),Gt=function(){function e(i){var n;return U(this,e),(n=w(this,e)).type="TrafficLayer",n.url=i.url,n.eventName=i.eventName||"geo_window_state",n.interval=i.interval||100,n._message=null,n.message=i.message,n.query=i.query,n.label=new Me,n.label.visible=void 0!==i._labelVisible&&i._labelVisible,n.rayDetectionDistance=i.rayDetectionDistance||0,n.uiRenderDistance=i.uiRenderDistance||5e4,n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.followNeedsUpdate=!1,n.labelVisible=i.labelVisible,n.offset=new t,n.handShakePath=i.handShakePath||"socket.io",n.namespace=i.namespace||"/",n.carRenderDistance=i.carRenderDistance||3e5,n.labelGroup=i.labelGroup||"highSpeed",n.labelScale=void 0===i.labelScale?1:i.labelScale,n.labelRenderType=void 0===i.labelRenderType?0:i.labelRenderType,n.enableLabelCulling=i.enableLabelCulling||!1,n.isSubsection=i.isSubsection||!1,n.plateEncode=i.plateEncode||!1,n.plateEncoding=i.plateEncoding||"auto",n}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"labelVisible",get:function(){return this.label.visible},set:function(e){e!==this.label.visible&&(this.materialNeedsUpdate=!0,this.label.visible=e&&!0)}},{key:"message",get:function(){return this._message},set:function(e){this.messageNeedsUpdate=!0,this._message=e}},{key:"setLabelVisible",value:function(e){e!==this.label.visible&&(this.materialNeedsUpdate=!0,this.label.visible=e)}},{key:"getLabelVisible",value:function(){return this.label.visible}},{key:"dispose",value:function(){return!1}},{key:"followTraffic",value:function(e){var t=e.zoomLength,i=void 0===t?-1:t,n=e.followPitch,a=void 0===n?999:n;this.isFollow=null==e?void 0:e.isFollow,this.followCarId=null==e?void 0:e.carId,this.followCarPlateNumber=null==e?void 0:e.plateNumber,this.followColor=(null==e?void 0:e.color)||{r:0,g:1,b:.8},this.followRotations=(null==e?void 0:e.followRotations)||{Roll:!1,Pitch:!1,Yaw:!1},this.zoomLength=i,this.followPitch=a,this.followNeedsUpdate=!0}},{key:"followGroups",value:function(e){this.isFollow=null==e?void 0:e.isFollow,this.followCarIdList=null==e?void 0:e.carIdList,this.followRotations=(null==e?void 0:e.followRotations)||{Roll:!1,Pitch:!1,Yaw:!1},this.followNeedsUpdate=!0}},{key:"initEventListener",value:function(){}},{key:"dispatchEvent",value:function(t){var i,n;if(this.plateEncode&&"mousedown"===t.type&&null!==(i=t.content)&&void 0!==i&&null!==(n=i.content)&&void 0!==n&&n.plate)try{var a=this._decodePlate(t.content.content.plate);t.content.content.plateEncoded=t.content.content.plate,t.content.content.plate=a}catch(e){console.error("TrafficLayer: Failed to decode plate",e)}return B(e,"dispatchEvent",this)([t])}},{key:"_decodePlate",value:function(e){try{if("auto"===this.plateEncoding)return bt(e);var t=bt(e,!0);return new TextDecoder(this.plateEncoding).decode(t)}catch(t){return console.warn("TrafficLayer: Plate decode failed, returning original value",t),e}}},{key:"toJSON",value:function(){return{Url:this.url,EventName:this.eventName,LabelVisible:this.labelVisible,LabelGroup:this.labelGroup,LabelScale:this.labelScale,LabelRenderType:this.labelRenderType,EnableWidgetCulling:this.enableLabelCulling,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,Id:this.followCarId,CarIdList:this.followCarIdList,Namespace:this.namespace,HandShakePath:this.handShakePath,FollowColor:this.followColor||{r:0,g:1,b:.8},FollowRotation:this.followRotations||{Roll:!1,Pitch:!1,Yaw:!1},Plate:this.followCarPlateNumber,PlateEncode:this.plateEncode,PlateEncoding:this.plateEncoding,ZoomLength:this.zoomLength,FollowPitch:this.followPitch,IsFollow:this.isFollow,Content:this.content,Message:this.message,Query:this.query,RayDetectionDistance:this.rayDetectionDistance,UIRenderDistance:this.uiRenderDistance,CarRenderDistance:this.carRenderDistance,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},IsSubsection:this.isSubsection}}}])}(),Vt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=w(this,e,[i])).name=i.name||"",t.type="FastRoadCondition",t.colors=i.colors||{1:(new d).setStyle("#00ff00"),2:(new d).setStyle("#ffff00"),3:(new d).setStyle("#ff0000"),4:(new d).setStyle("#ff00ff")},t}return z(e,st),k(e,[{key:"setData",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"condition";this.data=Fe(e),this.data.forEach((function(e){var n=e.properties[i],a=t.colors[n]||t.colors[1];e.properties.color={r:a.r,g:a.g,b:a.b,a:a.a||1}}))}}])}(),Jt=function(){function e(){var n,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(n=w(this,e,[a])).initChild();var r=a.coneColor||new d(1,1,1),s=a.groundColor||new d(1,1,1),l=a.fenceColor||new d(1,1,1),c=a.brightness||0,u=a.roughness||1,h=a.metallic||0;n.coneMap=a.coneMap||null,n.groundMap=a.groundMap||null,n.fenceMap=a.fenceMap||null,n.fenceHeight=a.fenceHeight||1;var p=a.coneOpacity||r.a||1,f=a.groundOpacity||s.a||1,m=a.fenceOpacity||l.a||1,g=a.bloomColor||null,y=a.position||new t,v=a.rotation||new o,b=new i,x=a.scale||new t(1,1,1),S=a.coneScale||new t(1,1,1),N=a.offset||new t(0,0,0),C=!1;return v._onChange((function(){b.setFromEuler(v,!1),this.matrixNeedsUpdate=!0})),b._onChange((function(){v.setFromQuaternion(b,void 0,!1),this.matrixNeedsUpdate=!0})),Object.defineProperties(n,{position:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){e&&(y.x=e.x,y.y=e.y,y.z=e.z,n.matrixNeedsUpdate=!0)}},rotation:{configurable:!0,enumerable:!0,value:v},quaternion:{configurable:!0,enumerable:!0,value:b},scale:{configurable:!0,enumerable:!0,get:function(){return x},set:function(e){e&&(x.x=e.x,x.y=e.y,x.z=e.z,n.matrixNeedsUpdate=!0)}},coneScale:{configurable:!0,enumerable:!0,get:function(){return S},set:function(e){e&&(S.x=e.x,S.y=e.y,S.z=e.z,n.matrixNeedsUpdate=!0)}},offset:{configurable:!0,enumerable:!0,get:function(){return N},set:function(e){e&&(N.x=e.x,N.y=e.y,N.z=e.z,n.matrixNeedsUpdate=!0)}},coneColor:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r.r=e.r,r.g=e.g,r.b=e.b,e.a&&(p=e.a),n.materialNeedsUpdate=!0)}},groundColor:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s.r=e.r,s.g=e.g,s.b=e.b,e.a&&(f=e.a),n.materialNeedsUpdate=!0)}},fenceColor:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l.r=e.r,l.g=e.g,l.b=e.b,e.a&&(m=e.a),n.materialNeedsUpdate=!0)}},coneOpacity:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){p=e,n.materialNeedsUpdate=!0}},groundOpacity:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){f=e,n.materialNeedsUpdate=!0}},fenceOpacity:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){m=e,n.materialNeedsUpdate=!0}},brightness:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){void 0!==e&&(c=e,n.materialNeedsUpdate=!0)}},roughness:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,n.materialNeedsUpdate=!0}},metallic:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,n.materialNeedsUpdate=!0}},bloomColor:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){e&&(g.copy(e),n.materialNeedsUpdate=!0)}},transparent:{configurable:!0,enumerable:!0,get:function(){return C},set:function(e){C=e&&1,n.materialNeedsUpdate=!0}},_visible:{configurable:!0,enumerable:!0,value:!0},_layerName:{configurable:!1,enumerable:!1,value:"CommonGISLayer"},_cloudControlType:{configurable:!1,enumerable:!1,value:"Gis"},type:{configurable:!0,enumerable:!0,value:"Construction"}}),n.matrixNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.visibleNeedsUpdate=!1,n}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"coneMap",get:function(){return this.cone.map},set:function(e){e&&(this.cone.map=e,this.materialNeedsUpdate=!0)}},{key:"groundMap",get:function(){return this.ground.map},set:function(e){e&&(this.ground.map=e,this.materialNeedsUpdate=!0)}},{key:"fenceMap",get:function(){return this.fence.map},set:function(e){e&&(this.fence.map=e,this.materialNeedsUpdate=!0)}},{key:"fenceHeight",get:function(){return this._fenceHeight},set:function(e){e&&(this._fenceHeight=e)}},{key:"initChild",value:function(){this.ground=new it,this.add(this.ground),this.fence=new st,this.add(this.fence),this.cone=new Pt,this.add(this.cone)}},{key:"setData",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.data=Fe(e,t)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:1,g:1,b:1,a:1},ConeColor:{r:this.coneColor.r,g:this.coneColor.g,b:this.coneColor.b,a:this.coneOpacity},GroundColor:{r:this.groundColor.r,g:this.groundColor.g,b:this.groundColor.b,a:this.groundOpacity},FenceColor:{r:this.fenceColor.r,g:this.fenceColor.g,b:this.fenceColor.b,a:this.fenceOpacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:1,ConeOpacity:this.coneOpacity,GroundOpacity:this.groundOpacity,FenceOpacity:this.fenceOpacity,Transparent:this.transparent,GroundTexture:this.ground.map,ConeTexture:this.cone.map,FenceTexture:this.fence.map,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},ConeScale:{x:this.coneScale.x,y:this.coneScale.y,z:this.coneScale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,groundUuid:this.ground.uuid,coneUuid:this.cone.uuid,fenceUuid:this.fence.uuid,jsondata:e?null:this.data,FenceWidth:this.fenceHeight}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"dispose",value:function(){this.traverse((function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose(),e.texture=null})),this.data=null,this.texture=null}}])}(),Yt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).name=t.name||"",i.url=t.url,i._enableSlope=!1,i.token=t.token||null,i.type="i3DTileLayer",i.initialize(),i}return z(e,tt),k(e,[{key:"url",get:function(){return this._url},set:function(e){e!==this._url&&(this.visibleNeedsUpdate=!0,this._url=e)}},{key:"initialize",value:function(){if(!this.url)return!1}},{key:"slopeAnalysis",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._enableSlope=e&&!0,this.slopeParams={},e&&Object.assign(this.slopeParams,t)}},{key:"toJSON",value:function(){return!(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},Token:this.token,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,Url:this.url?this.url:null,EnableSlope:this._enableSlope,SlopeParams:this._enableSlope?this.slopeParams:null}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"dispose",value:function(){this.traverse((function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose(),e.texture=null})),this.url=null,this.texture=null}}])}(),qt=function(){function e(i){var n;U(this,e),(n=w(this,e,[i])).type="AssetLayer",n.url=i.url,n.header=i.header,n.body=i.body,n.messageNeedsUpdate=!1,n.childNeedsUpdate=!1;var a=i.deviceAutoUpdate||!1,o=Math.max(1,i.deviceAutoUpdateInterval||2),r=void 0===i.renderNum?15:i.renderNum,s=void 0===i.searchMode?"coord":i.searchMode,l=void 0===i.tileLevel?16:i.tileLevel,d=void 0!==i.rtEnable&&i.rtEnable,c=i.rtUrl,u=void 0===i.rtTilelLevel?17:i.rtTilelLevel;return n.maxUpdateHeight=void 0===i.maxUpdateHeight?1e3:i.maxUpdateHeight,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{deviceAutoUpdate:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,n.messageNeedsUpdate=!0)}},deviceAutoUpdateInterval:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=Math.max(e,2),n.messageNeedsUpdate=!0)}},renderNum:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,n.messageNeedsUpdate=!0)}},searchMode:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,n.messageNeedsUpdate=!0)}},tileLevel:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e,n.messageNeedsUpdate=!0)}},rtEnable:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,n.messageNeedsUpdate=!0}},rtUrl:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c=e,n.messageNeedsUpdate=!0)}},rtTilelLevel:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u=e,n.messageNeedsUpdate=!0)}}}),n}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"body",get:function(){return this._body},set:function(e){this.messageNeedsUpdate=!0,this._body=e}},{key:"addChildren",value:function(e){var t=this;if(!e||e.length<1)return!1;this.childOperate="add",this.childrenContent=[],e.forEach((function(e,i){t.childrenContent.push({uuid:e.uuid,point_id:e.point_id,config:{material:{},transform:null}})})),this.childNeedsUpdate=!0,this.materialNeedsUpdate=!0}},{key:"removeChild",value:function(e){e&&(e instanceof Array?this.removeChildren(e):this.removeChildren([e]))}},{key:"removeChildren",value:function(e){var t=this;if(!e||e.length<1)return!1;this.childOperate="remove",this.childrenContent=[],e.forEach((function(e,i){t.childrenContent.push({uuid:e.uuid,point_id:e.point_id,config:{material:{},transform:null}})})),this.childNeedsUpdate=!0,this.materialNeedsUpdate=!0}},{key:"updateChild",value:function(e){if(!e)return!1;e instanceof Array?this.updateChildren(e):this.updateChildren([e])}},{key:"updateChildren",value:function(e){var t=this;if(!e||e.length<1)return!1;this.childrenContent=[],this.childOperate="update",this.childNeedsUpdate=!0,this.materialNeedsUpdate=!0,e.forEach((function(e,i){t.updateChildContent(e)}))}},{key:"updateChildContent",value:function(e){if(!e.uuid)return!1;var t={uuid:e.uuid,point_id:e.point_id,config:{material:{},transform:null}},i=e.params;if(void 0!==i.opacity&&(i.color.a=i.opacity),i.color&&(t.config.material.Color={r:i.color.r,g:i.color.g,b:i.color.b,a:i.color.a||1}),i.brightnessColor&&(t.config.material.BrightnessColor={r:i.brightnessColor.r,g:i.brightnessColor.g,b:i.brightnessColor.b,a:1}),i.text){var n=et(i.text,i.textStyle);t.config.material.Texture=Ve(n)}else i.map&&(Je(i.map)?t.config.material.Texture=i.map:Ge(i.map,(function(e){e&&(t.config.material.Texture=e)})));void 0!==i.metallic&&(t.config.material.Metallic=i.metallic),void 0!==i.roughness&&(t.config.material.Roughness=i.roughness),void 0!==i.brightness&&(t.config.material.Brightness=i.brightness),i.position&&(t.config.transform||(t.config.transform={}),t.config.transform.Location={x:i.position.x,y:i.position.y,z:i.position.z}),i.scale&&(t.config.transform||(t.config.transform={}),t.config.transform.Scale={x:i.scale.x,y:i.scale.y,z:i.scale.z}),i.rotation&&(t.config.transform||(t.config.transform={}),t.config.transform.Rotation={x:i.rotation.x,y:i.rotation.y,z:i.rotation.z}),void 0!==i.scroll&&(t.config.scroll=a.clamp(i.scroll,-1,1)),void 0!==i.speed&&(t.config.speed=i.speed),void 0!==i.animationIndex&&(t.config.animationIndex=i.animationIndex),void 0!==i.animationLoop&&(t.config.animationLoop=i.animationLoop),void 0!==i.animationSpeed&&(t.config.animationSpeed=i.animationSpeed),this.childrenContent.push(t)}},{key:"updateChildAnimation",value:function(e){if(!e)return!1;e instanceof Array?this.updateChildrenAnimation(e):this.updateChildrenAnimation([e])}},{key:"updateChildrenAnimation",value:function(e){var t=this;if(!e||e.length<1)return!1;this.childrenContent=[],e.forEach((function(e,i){t.updateChildContent(e)})),this.childOperate="animation",this.childNeedsUpdate=!0,this.materialNeedsUpdate=!0}},{key:"toJSON",value:function(){var e={DeviceUrl:this.url,DeviceBody:this.body,DeviceHeader:this.header,SearchMode:this.searchMode,TileLevel:this.tileLevel,RenderNum:this.renderNum,RTUrl:this.rtUrl,RTEnable:this.rtEnable,RTTileLevel:this.rtTilelLevel,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,content:this.materialNeedsUpdate?this.childrenContent:null,childOperate:this.childOperate,AutoUpdate:this.deviceAutoUpdate,AutoUpdateInterval:this.deviceAutoUpdateInterval,MaxUpdateHeight:this.maxUpdateHeight};return this.childNeedsUpdate&&(this.childNeedsUpdate=!1,this.childOperate=null,this.materialNeedsUpdate=!0),e}}])}(),Xt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:0,g:1,b:0,a:1},brightness:1,speed:.2};return U(this,e),(t=w(this,e,[i])).type="Radar",t}return z(e,tt),k(e)}(),Kt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:1,g:0,b:0,a:1},brightness:1,speed:2};return U(this,e),(t=w(this,e,[i])).type="Ripple",t}return z(e,tt),k(e)}(),Qt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Soil",i}return z(e,tt),k(e)}(),Zt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{gardientDirection:-1,color:{r:0,g:.48,b:.0047,a:1},color2:{r:.43,g:1,b:.42,a:1}};return U(this,e),(t=w(this,e,[i])).type="Diamond",t}return z(e,tt),k(e)}(),$t=function(){function e(t){var i;U(this,e),(i=w(this,e,[t])).type="CommonCar";var n=void 0===t.carType?3:t.carType;return Object.defineProperties(i,{carType:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){void 0!==e&&(n=e,i.overtimeInstanceIndex=[],i.data=[],i.materialNeedsUpdate=!0)}}}),i}return z(e,tt),k(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this.visibleNeedsUpdate||!e||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Scroll:this.scroll,Speed:this.speed,Texture:this.texture,GardientDirection:this.gardientDirection,Color2:{r:this.color2.r,g:this.color2.g,b:this.color2.b,a:this.opacity},BrightnessColor:this.brightnessColor?{r:this.brightnessColor.r,g:this.brightnessColor.g,b:this.brightnessColor.b,a:1}:this.color,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:!this.isInstance&&this.animateNeedsUpdate,visible:this.visible,type:this.type,CarType:this.carType,name:this.name,uuid:this.uuid,jsondata:!e||this.isInstance?this.data:null,animateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation,ChildIndex:this.isInstance?-1:this.childIndex,IsInstance:this.isInstance,overtimeInstanceIndex:this.overtimeInstanceIndex}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}(),ei=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="TriangleWarning",i}return z(e,tt),k(e)}(),ti=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Bucket",i}return z(e,tt),k(e)}(),ii=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="InundationAnalysis",i}return z(e,tt),k(e)}(),ni=function(){function e(t){var i;U(this,e),(i=w(this,e,[t])).type="SkylineAnalysis";var n=t.distance||120,a=t.lineWidth||1;return Object.defineProperties(i,{distance:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,i.materialNeedsUpdate=!0}},lineWidth:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,i.materialNeedsUpdate=!0}}}),i}return z(e,tt),k(e,[{key:"toJSON",value:function(){return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Distance:this.distance,LineWidth:this.lineWidth}}}])}(),ai=function(){function e(t){var i;U(this,e),(i=w(this,e,[t])).type="VisualFieldAnalysis";var n=t.fov||60,a=t.maxDistance||5,o=t.resYX||.5,r=t.resolution||1024;return Object.defineProperties(i,{fov:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,i.materialNeedsUpdate=!0}},maxDistance:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,i.materialNeedsUpdate=!0}},resYX:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,i.materialNeedsUpdate=!0}},resolution:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,i.materialNeedsUpdate=!0}}}),i}return z(e,tt),k(e,[{key:"toJSON",value:function(){return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Position:{x:this.position.x,y:this.position.y,z:this.position.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,AnimateJson:this.animateNeedsUpdate?this.animateJson:null,visible:this.visible,FOV:this.fov,MaxDistance:this.maxDistance,ResYX:this.resYX,Resolution:this.resolution,Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z}}}}])}(),oi=function(){function e(i){var n;U(this,e),(n=w(this,e,[i])).type="CarPark";var r,s=i.position||new t,l=i.rotation||new o,d=i.scale||new t(1,1,1),c=i.color||{r:1,g:1,b:1,a:1};return Object.defineProperties(n,{position:{enumerable:!0,get:function(){return s},set:function(e){e&&(s.x=e.x,s.y=e.y,s.z=e.z,n.matrixNeedsUpdate=!0)}},rotation:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l.x=a.clamp(e.x,-180,180),l.y=a.clamp(e.y,-180,180),l.z=a.clamp(e.z,-180,180),n.matrixNeedsUpdate=!0)}},scale:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d.x=e.x,d.y=e.y,d.z=e.z,n.matrixNeedsUpdate=!0)}},modelType:{configurable:!0,enumerable:!0,get:function(){return n._modelType},set:function(e){e&&(n._modelType=e)}},color:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c.r=e.r,c.g=e.g,c.b=e.b,c.a=e.a||1,n.materialNeedsUpdate=!0)}},parkType:{configurable:!0,enumerable:!0,get:function(){return n._parkType},set:function(e){e&&("out"===e.toLowerCase?n._parkType="out":n._parkType="in")}}}),n.position=s,n.rotation=l,n.scale=d,n.modelType=(r=i.modelType,isNaN(r)||r<3||r>6&&r<12||r>16?3:r),n.speed=Number(i.speed)||36,n.endState=i.endState||!1,n.color=c,n.parkType=i.parkType||"in",n}return z(e,tt),k(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this.visibleNeedsUpdate||!e||this.visible&&this.materialNeedsUpdate?{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.color.a},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Speed:this.speed,ModelType:this.modelType,EndState:this.endState,Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid,jsondata:e?null:this.data,ParkType:this.parkType}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}();var ri=function(){function e(i){var n;U(this,e),(n=w(this,e,[i])).type="TrafficLight",n.url=i.url,n.header=i.header,n.message=i.message;var a=void 0===i.brightness?1:i.brightness;return n.lightAltitude=void 0===i.lightAltitude?1:i.lightAltitude,n.renderScale=void 0===i.renderScale?1:i.renderScale,n.rayDetection={enable:!1,distance:0,displacementHeight:0},i.rayDetection&&(n.rayDetection.enable=void 0!==i.rayDetection.enable&&i.rayDetection.enable,n.rayDetection.distance=void 0===i.rayDetection.distance?0:i.rayDetection.distance,n.rayDetection.displacementHeight=void 0===i.rayDetection.displacementHeight?0:i.rayDetection.displacementHeight),n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{brightness:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,n.materialNeedsUpdate=!0}}}),n}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"message",get:function(){return this._body},set:function(e){this.messageNeedsUpdate=!0,this._body=e}},{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){return{Url:this.url,Message:this.message,Header:this.header,RenderScale:this.renderScale,LightAltitude:this.lightAltitude,RayDetection:this.rayDetection,Brightness:this.brightness,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}}])}(),si=function(){function e(t){var i;U(this,e),(i=w(this,e,[t])).type="RoadName",i.fontSize=t.fontSize||14,i.rayDetectionDistance="rayDetectionDistance"in t?t.rayDetectionDistance:500,i.displacementHeight="displacementHeight"in t?t.displacementHeight:40*i.scale.z,i.data=t.data||[],i.filename=t.filename||null;var n=t.color||{r:1,g:1,b:1,a:1};i.openCollision=t.openCollision||!1,i.switchScale=t.switchScale||!1,i.minScale="minScale"in t?t.minScale:1,i.maxScale="maxScale"in t?t.maxScale:2,i.minDistance=t.minDistance||0,i.maxDistance=t.maxDistance||5e3;var a=t.switchPitchRotate||!1;return i.minPitch="minPitch"in t?t.minPitch:0,i.maxPitch="maxPitch"in t?t.maxPitch:90,i.collisionScale=t.collisionScale||2,i.brightness=t.brightness||1,Object.defineProperties(i,{color:{enumerable:!0,get:function(){return n},set:function(e){e!==n&&(n=e,this.materialNeedsUpdate=!0)}},switchPitchRotate:{enumerable:!0,get:function(){return a},set:function(e){e!==a&&(a=e,this.materialNeedsUpdate=!0)}}}),i}return z(e,tt),k(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this.visibleNeedsUpdate||!e||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.z,y:this.scale.y,z:this.scale.x},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid,jsondata:this.data,rayDetectionDistance:this.rayDetectionDistance,displacementHeight:this.displacementHeight,FileName:this.filename,FontSize:this.fontSize,OpenCollision:this.openCollision,SwitchScale:this.switchScale,MinScale:this.minScale,MaxScale:this.maxScale,MinDistance:this.minDistance,MaxDistance:this.maxDistance,SwitchPitchRotate:this.switchPitchRotate,MinPitch:this.minPitch,MaxPitch:this.maxPitch,CollisionScale:this.collisionScale,ShadowColor:this.shadowColor,ShadowOffset:this.shadowOffset,Brightness:this.brightness}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.z,y:this.scale.y,z:this.scale.x},Rotation:{x:this.rotation.x,y:this.rotation.y+90,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}(),li=function(){function e(i){var n;U(this,e),(n=w(this,e,[i])).type="AutonomousVehicle";var a=i.url,o=i.header,r=void 0===i.labelRenderScale?1:i.labelRenderScale,s=void 0===i.labelRenderType?1:i.labelRenderType,l=void 0===i.labelBrightness?1:i.labelBrightness,d=void 0===i.followMode?"Third":i.followMode;n.labelField=void 0===i.labelField?"":i.labelField,n.followRotation=void 0===i.followRotation?{Roll:!1,Pitch:!1,Yaw:!0}:i.followRotation;var c=void 0===i.followZoom?0:i.followZoom,u=void 0!==i.switchScale&&i.switchScale,h=void 0===i.minViewPortHeight?30:i.minViewPortHeight,p=void 0===i.maxViewPortHeight?300:i.maxViewPortHeight,f=void 0===i.minScale?1:i.minScale,m=void 0===i.maxScale?2:i.maxScale,g=void 0===i.controlTypeList?[]:i.controlTypeList,y=void 0!==i.predictionEnable&&i.predictionEnable,v=void 0===i.predictionLineStyle?{}:i.predictionLineStyle;return n.rayDetection={enable:!1,distance:0},i.rayDetection&&(n.rayDetection.enable=void 0!==i.rayDetection.enable&&i.rayDetection.enable,n.rayDetection.distance=void 0===i.rayDetection.distance?0:i.rayDetection.distance),n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.followNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{url:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,n.messageNeedsUpdate=!0)}},header:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,n.messageNeedsUpdate=!0)}},labelRenderScale:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,n.materialNeedsUpdate=!0)}},labelBrightness:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e,n.materialNeedsUpdate=!0)}},predictionLineStyle:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){e&&(v=e,n.materialNeedsUpdate=!0)}},labelRenderType:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,n.materialNeedsUpdate=!0)}},predictionEnable:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){e&&(y=e,n.materialNeedsUpdate=!0)}},followMode:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d=e,n.followNeedsUpdate=!0)}},followZoom:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c=e,n.materialNeedsUpdate=!0)}},switchScale:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u=e,n.materialNeedsUpdate=!0)}},minViewPortHeight:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){e&&(h=e,n.materialNeedsUpdate=!0)}},maxViewPortHeight:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){e&&(p=e,n.materialNeedsUpdate=!0)}},minScale:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){e&&(f=e,n.materialNeedsUpdate=!0)}},maxScale:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){e&&(m=e,n.materialNeedsUpdate=!0)}},controlTypeList:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){g=e||[]}}}),n}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible?this._visible=!0:(this._visible=e&&!0,this.visibleNeedsUpdate=!0)}},{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate?{Url:this.url,Header:this.header,LabelRenderScale:this.labelRenderScale,LabelRenderType:this.labelRenderType,LabelField:this.labelField,RayDetection:this.rayDetection,ControlTypeList:this.controlTypeList,FollowMode:this.followMode,SwitchScale:this.switchScale,MinViewPortHeight:this.minViewPortHeight,MaxViewPortHeight:this.maxViewPortHeight,FollowRotation:this.followRotation,LabelBrightness:this.labelBrightness,MinScale:this.minScale,MaxScale:this.maxScale,FollowZoom:this.followZoom,PredictionLineStyle:this.predictionLineStyle,PredictionEnable:this.predictionEnable,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}:{Url:this.url,Header:this.header,LabelRenderScale:this.labelRenderScale,LabelRenderType:this.labelRenderType,RayDetection:this.rayDetection,FollowMode:this.followMode,SwitchScale:this.switchScale,MinViewPortHeight:this.minViewPortHeight,MaxViewPortHeight:this.maxViewPortHeight,ControlTypeList:this.controlTypeList,FollowRotation:this.followRotation,FollowZoom:this.followZoom,LabelBrightness:this.labelBrightness,PredictionLineStyle:this.predictionLineStyle,PredictionEnable:this.predictionEnable,MinScale:this.minScale,MaxScale:this.maxScale,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}}])}(),di=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="QuadPyramidTop",i}return z(e,tt),k(e)}(),ci=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).visible=void 0===i.visible||i.visible;var n=i.url||"",a=i.size||{x:300,y:200},o=0===i.faceType?0:i.faceType||1,r=i.pivot||{x:.5,y:.5},s=void 0!==i.switchScale&&i.switchScale,l=i.minDistance||0,d=i.maxDistance||0,c=void 0===i.minScale?1:i.minScale,u=void 0===i.maxScale?1:i.maxScale;return t.type="WebViewPoint",Object.defineProperties(t,{url:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},size:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,t.materialNeedsUpdate=!0}},pivot:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},faceType:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},switchScale:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}},minDistance:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},maxDistance:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,t.materialNeedsUpdate=!0}},minScale:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},maxScale:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,t.materialNeedsUpdate=!0}}}),t}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=We(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,FadeIn:this.fadeIn,type:this.type,name:this.name,uuid:this.uuid}:{Pivot:this.pivot,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,FaceType:Nt(this.faceType),SwitchScale:this.switchScale,MinDistance:this.minDistance,MaxDistance:this.maxDistance,MaxScale:this.maxScale,MinScale:this.minScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,URL:this.url,Size:this.size,Brightness:this.brightness}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontWeight=t.fontWeight,this.fontSize=t.fontSize,this.borderWidth=t.borderWidth,this.borderColor=t.borderColor,this.shadowColor=t.shadowColor,this.shadowOffset=t.shadowOffset,B(e,"copy",this)([t,i]),this}}])}(),ui=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="LayerBuilding";var n=i.buildingName||"all",a=i.layeringHeight||500,o=i.layeringBaseHeight||300,r=i.floorPullDir||{x:5e3,y:0,z:0};return t.hiddenDefault=void 0===i.HiddenDefault||i.HiddenDefault,t.floorNum=0,t.eventName="",t.buildingState="create",t.isLayering={},t.isLayering[n]=!1,Object.defineProperties(t,{layeringHeight:{enumerable:!0,get:function(){return a},set:function(e){e!==a&&(a=e,this.materialNeedsUpdate=!0,this.buildingState="update")}},buildingName:{enumerable:!0,get:function(){return n},set:function(e){e&&e!==n&&(n=e,this.materialNeedsUpdate=!0,this.buildingState="update")}},layeringBaseHeight:{enumerable:!0,get:function(){return o},set:function(e){e!==o&&(o=e,this.materialNeedsUpdate=!0,this.buildingState="update")}},floorPullDir:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r.x=e.x,r.y=e.y,r.z=e.z,t.materialNeedsUpdate=!0,t.buildingState="update")}}}),t}return z(e,tt),k(e,[{key:"layeringBuilding",value:function(){if(this.eventName="Layering",this.animateNeedsUpdate=!0,this.buildingState="update","all"===this.buildingName)for(var e in this.isLayering)this.isLayering[e]=!0;else this.isLayering[this.buildingName]=!0}},{key:"backBuildingToNormal",value:function(){if(this.eventName="BackToNormal",this.animateNeedsUpdate=!0,this.buildingState="update","all"===this.buildingName)for(var e in this.isLayering)this.isLayering[e]=!1;else this.isLayering[this.buildingName]=!1}},{key:"pullBuilding",value:function(e){if(void 0===this.isLayering[this.buildingName]){if(!this.isLayering.all)return void console.warn("该建筑物不在分解状态")}else if(!1===this.isLayering[this.buildingName])return void console.warn("该建筑物不在分解状态");e?(this.eventName="Pull",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update"):console.warn("请输入有效楼层")}},{key:"pushBuilding",value:function(e){if(void 0===this.isLayering[this.buildingName]){if(!this.isLayering.all)return void console.warn("该建筑物不在分解状态")}else if(!this.isLayering[this.buildingName])return void console.warn("该建筑物不在分解状态");e?(this.eventName="Push",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update"):console.warn("请输入有效楼层")}},{key:"hideBuildings",value:function(e){Array.isArray(e)?(this.eventName="Hide",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update"):console.error("numbers必须为数组")}},{key:"showBuildings",value:function(e){Array.isArray(e)?(this.eventName="Show",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update"):console.error("numbers必须为数组")}},{key:"hideAboveFloor",value:function(e){0!==e&&(this.eventName="HideAboveFloor",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update")}},{key:"showAll",value:function(){this.eventName="ShowAll",this.animateNeedsUpdate=!0,this.buildingState="update"}},{key:"hideAll",value:function(){this.eventName="HideAll",this.animateNeedsUpdate=!0,this.buildingState="update"}},{key:"toJSON",value:function(){return{type:this.type,name:this.name,uuid:this.uuid,BuildingName:this.buildingName,LayeringHeight:this.layeringHeight,LayeringBaseHeight:this.layeringBaseHeight,FloorPullDir:this.floorPullDir,FloorNum:this.floorNum,EventName:this.eventName,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,BuildingState:this.buildingState,HiddenDefault:this.hiddenDefault}}}])}(),hi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="MockCarStream",t.renderNum=void 0===i.renderNum?20:i.renderNum,t.enableTrigger=void 0!==i.enableTrigger&&i.enableTrigger,t.twoSide=i.twoSide||!1,t.twoSideWidth=i.twoSideWidth||200,t.reverseInterval=i.reverseInterval||1e3,t.reverseSpeed=i.reverseSpeed||1500;var n=i.runOnTheGround||!1,a=i.lanesNumber||1,o=i.forwardInterval||1e3,r=i.forwardSpeed||200,s=i.splineLoop||!1,l=i.randomBool||!1,d=i.randomForwardOffset||0,c=i.laneWidth||300,u=i.rotationOffset||0,h=i.scaleOffset||{x:1,y:1,z:1};return Object.defineProperties(t,{runOnTheGround:{enumerable:!0,get:function(){return n},set:function(e){n!==e&&(n=e,t.materialNeedsUpdate=!0)}},lanesNumber:{enumerable:!0,get:function(){return a},set:function(e){a!==e&&(a=e,t.materialNeedsUpdate=!0)}},forwardInterval:{enumerable:!0,get:function(){return o},set:function(e){o!==e&&(o=e,t.materialNeedsUpdate=!0)}},forwardSpeed:{enumerable:!0,get:function(){return r},set:function(e){r!==e&&(r=e,t.materialNeedsUpdate=!0)}},splineLoop:{enumerable:!0,get:function(){return s},set:function(e){s!==e&&(s=e,t.materialNeedsUpdate=!0)}},randomBool:{enumerable:!0,get:function(){return l},set:function(e){l!==e&&(l=e,t.materialNeedsUpdate=!0)}},randomForwardOffset:{enumerable:!0,get:function(){return d},set:function(e){d!==e&&(d=e,t.materialNeedsUpdate=!0)}},laneWidth:{enumerable:!0,get:function(){return c},set:function(e){c!==e&&(c=e,t.materialNeedsUpdate=!0)}},rotationOffset:{enumerable:!0,get:function(){return u},set:function(e){u!==e&&(u=e,t.materialNeedsUpdate=!0)}},scaleOffset:{enumerable:!0,get:function(){return h},set:function(e){h=e,t.materialNeedsUpdate=!0}}}),t}return z(e,tt),k(e,[{key:"toJSON",value:function(){return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},EnableTrigger:this.enableTrigger,TwiSide:this.twoSide,TwoSideWidth:this.twoSideWidth,ReverseInterval:this.reverseInterval,ReverseSpeed:this.reverseSpeed,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},RunOnTheGround:this.runOnTheGround,LanesNumber:this.lanesNumber,ForwardInterval:this.forwardInterval,ForwardSpeed:this.forwardSpeed,SplineLoop:this.splineLoop,RandomBool:this.randomBool,RandomForwardOffset:this.randomForwardOffset,LaneWidth:this.laneWidth,RotationOffset:this.rotationOffset,ScaleOffset:this.scaleOffset,jsondata:this.data,RenderNum:this.renderNum}}}])}(),pi=[{r:.685325,g:1,b:.298996},{r:.963023,g:1,b:.198688},{r:1,g:.710181,b:.235817},{r:1,g:.440705,b:.156314},{r:1,g:.310357,b:.150163},{r:1,g:.219426,b:.155697}],fi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="SlopeAnalysis";var n=i.range||null,a=gi(i.minAngle,!0),o=gi(i.maxAngle,!1),r=mi(i.colorRange),s=i.useSlopeAnalysis||!1,l=i.tilePathFieldName||"";return Object.defineProperties(t,{tilePathFieldName:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},range:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},minAngle:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=gi(e,!0),t.materialNeedsUpdate=!0}},maxAngle:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=gi(e,!1),t.materialNeedsUpdate=!0}},colorRange:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=mi(e),t.materialNeedsUpdate=!0}},useSlopeAnalysis:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,e&&(t.materialNeedsUpdate=!0)}}}),t}return z(e,tt),k(e,[{key:"toJSON",value:function(){return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,jsonData:this.range,MinAngle:this.minAngle,MaxAngle:this.maxAngle,ColorRange:this.colorRange,UseSlopeAnalysis:Number(this.useSlopeAnalysis),TilePathFieldName:this.tilePathFieldName}}}])}();function mi(e){if(e&&e instanceof Object){var t=0,i=0;for(var n in e)i=n,t++;if(0===i)return{25:pi[0],40:pi[1],55:pi[2],70:pi[3],80:pi[4],90:pi[5]};for(var a=t;a<6;a++)i<25?e[i=40]=pi[1]:i<40.00001?e[i=55]=pi[2]:i<55.00001?e[i=70]=pi[3]:i<70.00001?e[i=80]=pi[4]:i<80.00001?e[i=90]=pi[5]:i<90.00001?e[i=91]=pi[5]:e[i+=a]=pi[5];return e}return{25:pi[0],40:pi[1],55:pi[2],70:pi[3],80:pi[4],90:pi[5]}}function gi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?e<=0?0:e:e<=0?90:e}var yi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).pointType="pointType"in i?i.pointType.toLowerCase():"iconpoint";var n=i.pointStyle||{};for(var a in n.renderType=0,n.openCollision=!1,t.pointJSON=vi(t.pointType,n),t.clusterStyle=i.clusterStyle||{},t.clusterStyle){var o=t.clusterStyle[a];t.clusterStyle[a]=vi(t.pointType,o)}var r=i.minPixelDistance||100;return t.type="ClusterPoint",Object.defineProperties(t,{minPixelDistance:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){var i=Number(e);i&&r!==i&&(r=i,t.materialNeedsUpdate=!0)}}}),t}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=We(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,MinPixelDistance:this.minPixelDistance,PointJSON:this.pointJSON,PointType:this.pointType,ClusterStyle:this.clusterStyle}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.size=t.size,B(e,"copy",this)([t,i]),this}}])}();function vi(e,t){var i;switch(e){case"basiclabel":i=new kt(t).toJSON();case"iconpoint":i=new wt(t).toJSON();case"textpoint":i=new Ut(t).toJSON();default:i=new wt(t).toJSON()}return t.clusterText&&(i.ClusterText=t.clusterText),i}var bi=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).visible=void 0===t.visible||t.visible,i}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}}])}(),xi=function(){function e(i){var n;U(this,e),(n=w(this,e,[i])).type="UserInfoLightLayer";var a=i.url,o=i.header,r=void 0===i.brightness?1:i.brightness,s=void 0===i.lightAltitude?1:i.lightAltitude,l=void 0===i.renderScale?1:i.renderScale,d=void 0===i.renderTilesNum?3:i.renderTilesNum,c=void 0===i.updateCheckInterval?2:i.updateCheckInterval,u=void 0===i.maxUpdateHeight?1e3:i.maxUpdateHeight,h=void 0===i.centerDetectDistance?3e3:i.centerDetectDistance;return n.guidingLine={enable:!0,color:{r:.171441,g:.223228,b:.376262}},i.guidingLine&&(n.guidingLine.enable=void 0===i.guidingLine.enable||i.guidingLine.enable,n.guidingLine.color=void 0===i.guidingLine.color?{r:.171441,g:.223228,b:.376262}:i.guidingLine.color),n.rayDetection={enable:!1,distance:0,displacementHeight:0},i.rayDetection&&(n.rayDetection.enable=void 0!==i.rayDetection.enable&&i.rayDetection.enable,n.rayDetection.distance=void 0===i.rayDetection.distance?0:i.rayDetection.distance,n.rayDetection.displacementHeight=void 0===i.rayDetection.displacementHeight?0:i.rayDetection.displacementHeight),n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{url:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,n.materialNeedsUpdate=!0}},header:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,n.materialNeedsUpdate=!0}},lightAltitude:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,n.materialNeedsUpdate=!0}},renderScale:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,n.materialNeedsUpdate=!0}},renderTilesNum:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,n.materialNeedsUpdate=!0}},updateCheckInterval:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,n.materialNeedsUpdate=!0}},centerDetectDistance:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,n.materialNeedsUpdate=!0}},brightness:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,n.materialNeedsUpdate=!0}},maxUpdateHeight:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,n.materialNeedsUpdate=!0}}}),n}return z(e,bi),k(e,[{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){return{Url:this.url,Header:this.header,RenderScale:this.renderScale,LightAltitude:this.lightAltitude,CenterDetectDistance:this.centerDetectDistance,RayDetection:this.rayDetection,GuidingLine:this.guidingLine,Brightness:this.brightness,RenderTilesNum:this.renderTilesNum,UpdateCheckInterval:this.updateCheckInterval,MaxUpdateHeight:this.maxUpdateHeight,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}}])}(),Si=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).name=i.name||"",t.type="RoutePlan";var n=i.url;return t.messageNeedsUpdate=!1,Object.defineProperties(t,{url:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e,t.messageNeedsUpdate=!0)}}}),t}return z(e,st),k(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},URL:this.url,Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Collision:this.collision,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,jsondata:e?null:this.data,Style:this.style,Spline_Type:this.splineType,MeshDirection:this.direction,RenderType:this.renderType,Section_Length:this.section_Length,Width:this.width,Tilling:this.tilling,Speed:this.speed,Open_Stroke:this.openStroke,Stroke_Color:this.strokeColor?{r:this.strokeColor.r,g:this.strokeColor.g,b:this.strokeColor.b,a:1}:null,Stroke_Width:this.strokeWidth,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,LineUVOption:this.lineUVOption,colordata:this.colordata}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.style=t.style,this.splineType=t.splineType,this.direction=t.direction,this.width=t.width,this.tilling=t.tilling,this.speed=t.speed,this.openStroke=t.openStroke,this.strokeColor=t.strokeColor,this.strokeWidth=t.strokeWidth,B(e,"copy",this)([t,i]),this}}])}(),Ni=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=w(this,e,[i])).visible=void 0===i.visible||i.visible,t.lightType=void 0===i.lightType?"PointLight":i.lightType,t.pointLightStyle=void 0===i.pointLightStyle?{intensity:8,color:{r:1,g:1,b:1}}:i.pointLightStyle,t.spotLightStyle=void 0===i.spotLightStyle?{intensity:8,color:{r:1,g:1,b:1},innerConeAngle:0,outerConeAngle:44}:i.spotLightStyle,t.rectLightStyle=void 0===i.rectLightStyle?{intensity:8,color:{r:1,g:1,b:1},barnDoorAngle:88,barnDoorlength:20}:i.rectLightStyle,t.type="Light",t}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=We(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,LightType:this.lightType,PointLightStyle:this.pointLightStyle,SpotLightStyle:this.spotLightStyle,RectLightStyle:this.rectLightStyle,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontWeight=t.fontWeight,this.fontSize=t.fontSize,this.borderWidth=t.borderWidth,this.borderColor=t.borderColor,this.shadowColor=t.shadowColor,this.shadowOffset=t.shadowOffset,B(e,"copy",this)([t,i]),this}}])}(),wi=function(){function e(){var i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(i=w(this,e,[n])).name=n.name||"",i.type="LargeRoadCondition",i.defaultColors={1:{r:.015625,g:0,b:0,a:1},2:{r:.043403,g:.001204,b:.001635,a:1},3:{r:.078125,g:.058385,b:0,a:1},4:{r:207e-6,g:.109375,b:0,a:1}};var a=n.roadGeoJsonUrl||"",o=n.roadConditionUrl||"",r=n.layerGroupName||"",s=void 0===n.heightOffset?.7:n.heightOffset,l=void 0===n.camFOV?90:n.camFOV,d=void 0===n.aspectRatio?1:n.aspectRatio,c=n.colors||i.defaultColors,u=i.validateColors(c)?c:i.defaultColors,h=i.getValidBrightnessList(n.brightnessList);return i.messageNeedsUpdate=!1,i.materialNeedsUpdate=!1,i.matrixNeedsUpdate=!1,i.offset=new t,Object.defineProperties(i,{roadGeoJsonUrl:{enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,this.materialNeedsUpdate=!0)}},roadConditionUrl:{enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,this.materialNeedsUpdate=!0)}},layerGroupName:{enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,this.materialNeedsUpdate=!0)}},heightOffset:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){void 0!==e&&(s=e,i.materialNeedsUpdate=!0)}},camFOV:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){void 0!==e&&(l=e,i.materialNeedsUpdate=!0)}},aspectRatio:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){void 0!==e&&(d=e,i.materialNeedsUpdate=!0)}},colors:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){void 0!==e&&(u=i.validateColors(e)?e:i.defaultColors,i.materialNeedsUpdate=!0)}},brightnessList:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){void 0!==e&&(h=i.getValidBrightnessList(e),i.materialNeedsUpdate=!0)}}}),i}return z(e,bi),k(e,[{key:"getValidBrightnessList",value:function(e){return Array.isArray(e)&&4===e.length&&this.allElementsGreaterThanZero(e)?e:[15,15,15,15]}},{key:"allElementsGreaterThanZero",value:function(e){return e.every((function(e){return"number"==typeof e&&e>=0}))}},{key:"validateColors",value:function(e){if("object"!==H(e)||null===e)return console.error("Invalid color format: Colors should be a non-null object."),!1;for(var t in this.defaultColors)if(this.defaultColors.hasOwnProperty(t)){if(!e.hasOwnProperty(t))return console.error("Missing color key: ".concat(t)),!1;var i=e[t];if(!this.isValidColorComponent(i))return console.error("Invalid color components at key: ".concat(t)),!1}return!0}},{key:"isValidColorComponent",value:function(e){if("object"!==H(e)||null===e)return!1;var t=e.r,i=e.g,n=e.b,a=e.a;return this.isNumberInRange(t)&&this.isNumberInRange(i)&&this.isNumberInRange(n)&&this.isNumberInRange(a)}},{key:"isNumberInRange",value:function(e){return"number"==typeof e&&e>=0&&e<=1}},{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){return{RoadGeoJsonUrl:this.roadGeoJsonUrl,LayerGroupName:this.layerGroupName,RoadConditionUrl:this.roadConditionUrl,HeightOffset:this.heightOffset,CamFOV:this.camFOV,AspectRatio:this.aspectRatio,Colors:this.colors,BrightnessList:this.brightnessList,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}}])}(),Ui={version:"2.7.6",name:"CloudRenderEngine",author:["liran23"]},Ci=function(){function e(i){var n;U(this,e),(n=w(this,e,[i])).type="IndoorMap",n.url=i.url,n.mpoi="",n.floor=999,n.floorList=[];var a=i.layeringHeight||500,o=i.layeringBaseHeight||300;return n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.animateNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{layeringHeight:{enumerable:!0,get:function(){return a},set:function(e){e!==a&&(a=e,this.materialNeedsUpdate=!0)}},layeringBaseHeight:{enumerable:!0,get:function(){return o},set:function(e){e!==o&&(o=e,this.materialNeedsUpdate=!0)}}}),n}return z(e,Me),k(e,[{key:"dispose",value:function(){return!1}},{key:"getIndoorDataByCenter",value:(n=N(P().mark((function e(t){var i,n,a=arguments;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:500,n=this._getBoundingBox(t,i),e.next=4,this._requestDataList(n.minLng,n.minLat,n.maxLng,n.maxLat);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_requestDataList",value:(i=N(P().mark((function e(t,i,n,a){var o,r,s,l,d;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s="http://".concat(this.url,"/indoor/query/?minX=").concat(t,"&minY=").concat(i,"&maxX=").concat(n,"&maxY=").concat(a),e.next=3,v.get(s);case 3:if(0===(null==(l=e.sent)||null===(o=l.data)||void 0===o?void 0:o.status)){e.next=7;break}return console.error((null==l||null===(d=l.data)||void 0===d?void 0:d.message)||"获取室内数据失败"),e.abrupt("return",[]);case 7:return e.abrupt("return",null===(r=l.data)||void 0===r?void 0:r.indoor);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n,a){return i.apply(this,arguments)})},{key:"_getBoundingBox",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,i=t/111e3,n=t/(111320*Math.cos(e.lat*Math.PI/180));return{minLat:e.lat-i,maxLat:e.lat+i,minLng:e.lng-n,maxLng:e.lng+n}}},{key:"openIndoor",value:function(e){console.log("params --\x3e ",e);var t=e.mpoi,i=void 0===t?"":t,n=e.floor,a=void 0===n?0:n,o=e.floorList,r=void 0===o?[]:o,s=e.buildingCenter,l=void 0===s?{}:s;this.mpoi=i,this.floor=a,this.floorList=r,this.buildingCenter=l,this.materialNeedsUpdate=!0}},{key:"closeIndoor",value:function(){this.mpoi="close",this.floor="",this.materialNeedsUpdate=!0}},{key:"convertFloorString",value:function(e){if(e.startsWith("B"))return-parseInt(e.substring(1),10);if(e.startsWith("F"))return parseInt(e.substring(1),10);throw new Error("Invalid floor string")}},{key:"convertFloorStringToArray",value:function(e){return e.split("|").map((function(e){if(e.startsWith("B"))return-parseInt(e.substring(1),10);if(e.startsWith("F"))return parseInt(e.substring(1),10);throw new Error("Invalid floor string")}))}},{key:"hideBuildings",value:function(e){if(Array.isArray(e)){if((e=De(e)).sort((function(e,t){return e-t})),e.length===this.floorList.length)this.floor=999;else{var t=this.floorList.filter((function(t){return!e.includes(t)}));this.floor=t[t.length-1]}this.eventName="Hide",this.floorNum=e,this.animateNeedsUpdate=!0}else console.error("hideBuildings numbers必须为数组")}},{key:"showBuildings",value:function(e){Array.isArray(e)?((e=De(e)).sort((function(e,t){return e-t})),this.eventName="Show",this.floorNum=e,this.floor=e[e.length-1],this.animateNeedsUpdate=!0):console.error("showBuildings numbers必须为数组")}},{key:"toJSON",value:function(){return{Url:this.url,Mpoi:this.mpoi,Floor:this.floor,LayeringHeight:this.layeringHeight,LayeringBaseHeight:this.layeringBaseHeight,BuildingCenter:this.buildingCenter,FloorNum:this.floorNum,FloorList:this.floorList,EventName:this.eventName,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,type:this.type,uuid:this.uuid}}}]);var i,n}(),ki=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),t=w(this,e,[i]);var n=["Video","Picture"],a=void 0===i.cityList?[]:i.cityList,o=void 0===i.event?"":i.event,r=void 0===i.folderName?"RenderResult":i.folderName,s=void 0===i.renderMode?"Video":i.renderMode,l=void 0===i.sceneBrightness?7:i.sceneBrightness,d=void 0===i.operateData?[]:i.operateData,c=void 0===i.brightness?0:i.brightness,u=void 0===i.renderFrame?60:i.renderFrame;return Object.defineProperties(t,{renderMode:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=n.includes(e)?e:"Video")}},renderFrame:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u=e)}},sceneBrightness:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e)}},operateData:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d=e)}},brightness:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){void 0!==e&&(c=e)}},cityList:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}},event:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,t.materialNeedsUpdate=!0)}},folderName:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e)}}}),t}return z(e,tt),k(e,[{key:"changeRenderMode",value:function(e){this.renderMode=e}},{key:"changeRenderFrame",value:function(e){this.renderFrame=e,this.event="ChangeRenderFrame"}},{key:"changeCityColor",value:function(e){this.cityList=e,this.event="ColorChange"}},{key:"changeHeatmapCoefficient",value:function(e,t){this.cityList=e,this.operateData=[t],this.event="CoefficientChange"}},{key:"changeSceneBrightness",value:function(e){this.sceneBrightness=e,this.event="changeSceneBrightness"}},{key:"changeBrightness",value:function(e){this.brightness=e,this.event="changeBrightness"}},{key:"renderResult",value:function(e,t){this.folderName=t,this.cityList=e,this.event="Render"}},{key:"visAll",value:function(){this.operateData=[],this.event="VisAll"}},{key:"previewAll",value:function(){this.operateData=[],this.event="Preview"}},{key:"previewSingleCity",value:function(e,t){this.cityList=e;var i=this.cityList.map((function(e){return e.CityName})),n=i.indexOf(t);-1!==n?n!==i.length-1?(this.operateData=[t,i[n+1]],this.event="Preview"):console.warn("非法参数,最后一个城市不能预览"):console.warn("没有该城市数据")}},{key:"focusCity",value:function(e){this.operateData=[e],this.event="Focus"}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Brightness:this.brightness,SceneBrightness:this.sceneBrightness,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},OperateData:this.operateData,FolderName:this.folderName,RenderFrame:this.renderFrame,RenderMode:this.renderMode,CityList:this.cityList,Opacity:this.opacity,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return B(e,"copy",this)([t,i]),this}}])}(),Ti=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=w(this,e,[i])).roadGeoJsonUrl=i.roadGeoJsonUrl,t.roadConditionUrl=i.roadConditionUrl,t.type="EarthRoadCondition",t}return z(e,ki),k(e,[{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},RoadConditionUrl:this.roadConditionUrl,RenderFrame:this.renderFrame,RenderMode:this.renderMode,RoadGeoJsonUrl:this.roadGeoJsonUrl,FolderName:this.folderName,CityList:this.cityList,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return B(e,"copy",this)([t,i]),this}}])}(),Oi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=w(this,e,[i])).type="EarthCityRank",t}return z(e,ki),k(e,[{key:"changeRenderFrame",value:function(e){this.renderFrame=e,this.event="ChangeRenderFrame"}},{key:"changeCityColor",value:function(e){this.cityList=e,this.event="ColorChange"}},{key:"renderResult",value:function(e,t){this.folderName=t,this.cityList=e,this.event="Render"}},{key:"visAll",value:function(){this.operateData=[],this.event="VisAll"}},{key:"previewAll",value:function(){this.operateData=[],this.event="Preview"}},{key:"previewSingleCity",value:function(e,t){this.cityList=e;var i=this.cityList.map((function(e){return e.CityName})),n=i.indexOf(t);-1!==n?n!==i.length-1?(this.operateData=[t,i[n+1]],this.event="Preview"):console.warn("非法参数,最后一个城市不能预览"):console.warn("没有该城市数据")}},{key:"focusCity",value:function(e){this.operateData=[e],this.event="Focus"}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},OperateData:this.operateData,FolderName:this.folderName,RenderFrame:this.renderFrame,RenderMode:this.renderMode,CityList:this.cityList,Opacity:this.opacity,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return B(e,"copy",this)([t,i]),this}}])}(),Ri=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=w(this,e,[i])).type="EarthCityHeatMap",t}return z(e,ki),k(e,[{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Brightness:this.brightness,SceneBrightness:this.sceneBrightness,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},OperateData:this.operateData,FolderName:this.folderName,RenderFrame:this.renderFrame,RenderMode:this.renderMode,CityList:this.cityList,Opacity:this.opacity,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return B(e,"copy",this)([t,i]),this}}])}(),Ei=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),t=w(this,e,[i]);var n=void 0===i.roadList?[]:i.roadList,a=void 0===i.cityCompareList?[]:i.cityCompareList;return t.roadURL=i.roadURL,Object.defineProperties(t,{roadList:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e)}},cityCompareList:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}}}),t.type="EarthPersonLine",t}return z(e,ki),k(e,[{key:"changeRenderFrame",value:function(e){this.renderFrame=e,this.event="ChangeRenderFrame"}},{key:"changeColor",value:function(e){this.color=e,this.event="ColorChange"}},{key:"renderResult",value:function(e){this.folderName=e,this.event="Render"}},{key:"previewAll",value:function(){this.event="Preview"}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},RoadList:this.roadList,RoadURL:this.roadURL,CityCompareList:this.cityCompareList,FolderName:this.folderName,Texture:this.texture,RenderFrame:this.renderFrame,RenderMode:this.renderMode,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return B(e,"copy",this)([t,i]),this}}])}(),zi=function(){return k((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};U(this,e),this.cloudRender=t,this.enable=void 0!==i.enable&&i.enable,this.workDistance=void 0===i.workDistance?50:i.workDistance,this.init()}),[{key:"changeEnable",value:function(e){this.enable=e,this.cloudRender.emitUIInteraction({excuteName:"Application_enableFadeMode",params:{Enable:this.enable}})}},{key:"changeWorkDistance",value:function(e){this.workDistance=e,this.cloudRender.emitUIInteraction({excuteName:"Application_enableFadeMode",params:{WorkDistance:this.workDistance}})}},{key:"init",value:function(){this.changeEnable(this.enable),this.changeWorkDistance(this.workDistance)}}])}(),Ii=function(){return k((function e(t){U(this,e),this.cloudRender=t}),[{key:"switchLevel",value:function(e){""!==e&&void 0!==e||console.warn("LevelManage.switchLevel: levelName is required"),this.cloudRender.emitUIInteraction({excuteName:Q.OPEN_LEVEL,params:{LevelName:e}})}},{key:"restartLevel",value:function(){this.cloudRender.emitUIInteraction({excuteName:Q.RESTART_LEVEL}),this.cloudRender.dispatchEvent({type:"levelRecovered"})}},{key:"restartGame",value:function(){this.cloudRender.emitUIInteraction({excuteName:Q.RESTART_GAME}),this.cloudRender.dispatchEvent({type:"gameResarted"})}},{key:"exit",value:function(){this.cloudRender.emitUIInteraction({excuteName:Q.EXIT_CLIENT})}}])}(),Mi=function(){function e(i){var n;if(U(this,e),e._instance)return L(n,e._instance);(n=w(this,e,[i])).type="RoadPile",n.url=i.url,n.header=i.header,n.body=i.body,n.messageNeedsUpdate=!1,n.childNeedsUpdate=!1;var a=Math.max(1,i.updateInterval||2),o=void 0===i.searchMode?"coord":i.searchMode,r=void 0===i.tileLevel?16:i.tileLevel,s=void 0===i.renderScale?1:i.renderScale;return n.maxUpdateHeight=void 0===i.maxUpdateHeight?1e3:i.maxUpdateHeight,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{renderScale:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=Math.max(e,.1),n.messageNeedsUpdate=!0)}},updateInterval:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=Math.max(e,2),n.messageNeedsUpdate=!0)}},searchMode:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,n.messageNeedsUpdate=!0)}},tileLevel:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,n.messageNeedsUpdate=!0)}}}),e._instance=n,n}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"body",get:function(){return this._body},set:function(e){this.messageNeedsUpdate=!0,this._body=e}},{key:"toJSON",value:function(){return{Url:this.url,Body:this.body,Header:this.header,SearchMode:this.searchMode,TileLevel:this.tileLevel,RenderScale:this.renderScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,UpdateInterval:this.updateInterval}}}],[{key:"getInstance",value:function(t){return e._instance||(e._instance=new e(t)),e._instance}}])}();O(Mi,"_instance",null);var Ai=function(){function e(t){var i;if(U(this,e),e._instance)return L(i,e._instance);(i=w(this,e,[t])).type="RoadDataManager",i.messageNeedsUpdate=!1,i.childNeedsUpdate=!1;var n=void 0===t.poiRenderScale?1:t.poiRenderScale,a=void 0===t.roadnameRenderScale?1:t.roadnameRenderScale,o=t.hiddenList||[];return i.materialNeedsUpdate=!1,i.matrixNeedsUpdate=!1,Object.defineProperties(i,{poiRenderScale:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=Math.max(e,.1),i.messageNeedsUpdate=!0)}},roadnameRenderScale:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=Math.max(e,.1),i.messageNeedsUpdate=!0)}},hiddenList:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,i.messageNeedsUpdate=!0)}}}),e._instance=i,i}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"body",get:function(){return this._body},set:function(e){this.messageNeedsUpdate=!0,this._body=e}},{key:"toJSON",value:function(){return{PoiRenderScale:this.poiRenderScale,RoadnameRenderScale:this.roadnameRenderScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,HiddenList:this.hiddenList,visible:this.visible,type:this.type,uuid:this.uuid}}}],[{key:"getInstance",value:function(t){return e._instance||(e._instance=new e(t)),e._instance}}])}();O(Ai,"_instance",null);var Li=function(){return k((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};U(this,e),this.cloudRender=t,this.rayDetectionDistance=i.rayDetectionDistance||5e5,this.url=i.url||"",this.enableUI=void 0===i.enableUI||i.enableUI,i.onSelected&&this.cloudRender.addEventListener("L2Selected",i.onSelected),this.enable=i.enable,i.enable&&this.enablePickup()}),[{key:"enablePickup",value:function(){this.enable=!0,this.cloudRender.emitUIInteraction({excuteName:q.ENABLE_L2_BUILDING_SELECT,params:{Url:this.url,RayDetectionDistance:this.rayDetectionDistance,Enable:this.enable,EnableUI:this.enableUI}})}},{key:"disablePickup",value:function(){this.enable=!1,this.cloudRender.emitUIInteraction({excuteName:q.ENABLE_L2_BUILDING_SELECT,params:{Enable:this.enable}})}}])}();export{zi as AdvancedFade,qt as AssetLayer,li as AutonomousVehicleLayer,kt as BasicLabel,ti as Bucket,Li as BuildingPickup,oi as CarPark,Dt as Circle,yt as CloudRenderEngine,yi as ClusterPoint,pe as CommonConstant,Tt as Cone,Jt as ConstructionLayer,dt as Cube,zt as Cylinder,It as Decal,Zt as Diamond,Ft as DiamondSign,Ot as FlashCar,Rt as FlashCarCrash,Et as FlashPeople,Wt as Heatmap,Yt as I3DTileLayer,wt as IconPoint,Ci as IndoorMap,xi as InfoLightLayer,ii as Inundation,wi as LargeRoadCondition,ui as LayerBuilding,Ii as LevelManage,Ni as Light,st as Line,hi as MockCarStream,St as ODLine,Ht as Particle,Mt as Plane,lt as Point,it as Polygon,At as QuadPyramid,di as QuadPyramidTop,Xt as Radar,Kt as Ripple,Vt as RoadCondition,Ai as RoadDataManager,si as RoadName,Mi as RoadPile,Si as RoutePlan,Ri as SequencerEarthCityHeatmap,Oi as SequencerEarthCityRank,Ei as SequencerEarthPersonLine,Ti as SequencerEarthRoadCondition,tt as Shape,ni as Skyline,fi as SlopeAnalysis,Qt as Soil,Lt as Sphere,Ut as TextPoint,xt as TextUtils,_t as Torus,Pt as TrafficCone,Gt as TrafficLayer,ri as TrafficLightLayer,$t as TrafficShape,ei as TriangleWarning,Bt as Tube,fe as UltralDynamicSky,Ui as VersionInfo,ai as VisualField,ci as WebViewPoint,Ve as convertCanvas2Base64,Ke as drawCanvas,et as drawTextToImage,Ge as loadImageAsBase64};
1
+ import{Vector2 as e,Vector3 as t,Quaternion as i,Matrix4 as n,MathUtils as a,Euler as o,Matrix3 as r,Layers as s,FileLoader as l,Color as d,Group as c,MeshBasicMaterial as u,PlaneBufferGeometry as h,Mesh as p,SpriteMaterial as f,Sprite as m}from"three";import g from"earcut";import*as y from"@tweenjs/tween.js";import v from"axios";import b from"@mars3d/heatmap.js";function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function S(e,t,i,n,a,o,r){try{var s=e[o](r),l=s.value}catch(e){return void i(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function N(e){return function(){var t=this,i=arguments;return new Promise((function(n,a){var o=e.apply(t,i);function r(e){S(o,n,a,r,s,"next",e)}function s(e){S(o,n,a,r,s,"throw",e)}r(void 0)}))}}function w(e,t,i){return t=E(t),L(e,I()?Reflect.construct(t,i||[],E(e).constructor):t.apply(e,i))}function U(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,W(n.key),n)}}function k(e,t,i){return t&&C(e.prototype,t),i&&C(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function T(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=G(e))||t){i&&(e=i);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,r=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return r=e.done,e},e:function(e){s=!0,o=e},f:function(){try{r||null==i.return||i.return()}finally{if(s)throw o}}}}function O(e,t,i){return(t=W(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function R(){return R="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=E(e)););return e}(e,t);if(n){var a=Object.getOwnPropertyDescriptor(n,t);return a.get?a.get.call(arguments.length<3?e:i):a.value}},R.apply(null,arguments)}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function z(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&D(e,t)}function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(I=function(){return!!e})()}function M(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function A(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?M(Object(i),!0).forEach((function(t){O(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):M(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function L(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function P(){P=function(){return t};var e,t={},i=Object.prototype,n=i.hasOwnProperty,a=Object.defineProperty||function(e,t,i){e[t]=i.value},o="function"==typeof Symbol?Symbol:{},r=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function d(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,i){return e[t]=i}}function c(e,t,i,n){var o=t&&t.prototype instanceof y?t:y,r=Object.create(o.prototype),s=new E(n||[]);return a(r,"_invoke",{value:k(e,i,s)}),r}function u(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",p="suspendedYield",f="executing",m="completed",g={};function y(){}function v(){}function b(){}var x={};d(x,r,(function(){return this}));var S=Object.getPrototypeOf,N=S&&S(S(z([])));N&&N!==i&&n.call(N,r)&&(x=N);var w=b.prototype=y.prototype=Object.create(x);function U(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function i(a,o,r,s){var l=u(e[a],e,o);if("throw"!==l.type){var d=l.arg,c=d.value;return c&&"object"==typeof c&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){i("next",e,r,s)}),(function(e){i("throw",e,r,s)})):t.resolve(c).then((function(e){d.value=e,r(d)}),(function(e){return i("throw",e,r,s)}))}s(l.arg)}var o;a(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,a){i(e,n,t,a)}))}return o=o?o.then(a,a):a()}})}function k(t,i,n){var a=h;return function(o,r){if(a===f)throw Error("Generator is already running");if(a===m){if("throw"===o)throw r;return{value:e,done:!0}}for(n.method=o,n.arg=r;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=f;var d=u(t,i,n);if("normal"===d.type){if(a=n.done?m:p,d.arg===g)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(a=m,n.method="throw",n.arg=d.arg)}}}function T(t,i){var n=i.method,a=t.iterator[n];if(a===e)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=e,T(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=u(a,t.iterator,i.arg);if("throw"===o.type)return i.method="throw",i.arg=o.arg,i.delegate=null,g;var r=o.arg;return r?r.done?(i[t.resultName]=r.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,g):r:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function z(t){if(t||""===t){var i=t[r];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,o=function i(){for(;++a<t.length;)if(n.call(t,a))return i.value=t[a],i.done=!1,i;return i.value=e,i.done=!0,i};return o.next=o}}throw new TypeError(typeof t+" is not iterable")}return v.prototype=b,a(w,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:v,configurable:!0}),v.displayName=d(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,d(e,l,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},U(C.prototype),d(C.prototype,s,(function(){return this})),t.AsyncIterator=C,t.async=function(e,i,n,a,o){void 0===o&&(o=Promise);var r=new C(c(e,i,n,a),o);return t.isGeneratorFunction(i)?r:r.next().then((function(e){return e.done?e.value:r.next()}))},U(w),d(w,l,"Generator"),d(w,r,(function(){return this})),d(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=z,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var i in this)"t"===i.charAt(0)&&n.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function a(n,a){return s.type="throw",s.arg=t,i.next=n,a&&(i.method="next",i.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var r=this.tryEntries[o],s=r.completion;if("root"===r.tryLoc)return a("end");if(r.tryLoc<=this.prev){var l=n.call(r,"catchLoc"),d=n.call(r,"finallyLoc");if(l&&d){if(this.prev<r.catchLoc)return a(r.catchLoc,!0);if(this.prev<r.finallyLoc)return a(r.finallyLoc)}else if(l){if(this.prev<r.catchLoc)return a(r.catchLoc,!0)}else{if(!d)throw Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return a(r.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var r=o?o.completion:{};return r.type=e,r.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(r)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),R(i),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var a=n.arg;R(i)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:z(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function D(e,t){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},D(e,t)}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,a,o,r,s=[],l=!0,d=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){d=!0,a=e}finally{try{if(!l&&null!=i.return&&(r=i.return(),Object(r)!==r))return}finally{if(d)throw a}}return s}}(e,t)||G(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(e,t,i,n){var a=R(E(e.prototype),t,i);return"function"==typeof a?function(e){return a.apply(i,e)}:a}function F(e){return function(e){if(Array.isArray(e))return x(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||G(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function H(e){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(e)}function G(e,t){if(e){if("string"==typeof e)return x(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?x(e,t):void 0}}var V={CLEAR_SKIES:"clearSkies",PARTLY_CLOUDY:"partlyCloudy",CLOUDY:"cloudy",FOGGY:"foggy",OVERCAST:"overcast",RAIN:"rain",LIGHT_RAIN:"lightRain",THUNDER_STORM:"thunderstorm",SNOW:"snow",LIGHT_SNOW:"lightSnow",BLIZZARD:"blizzard",SAND_DUST_CALM:"sandDustCalm",SAND_DUST_STORM:"sandDustStorm"},J={VOLUMETRIC_CLOUDS:"Volumetric Clouds",STATIC_CLOUDS:"Static Clouds",DYNAMIC_CLOUDS:"2D Dynamic Clouds",NO_CLOUDS:"No Clouds",VOLUMETRIC_AURORA:"Volumetric Aurora"},Y={SKY_ATMOSPHERE:"Sky Atmosphere",SIMPLIFIED_COLOR:"Simplified Color"},q={SET_MOUSE_CURSOR_SHOW:"setMouseCursorShow",SET_CLICK_EVENT:"setClickEvent",SET_EDIT_STATUS:"setEditStatus",SWITCH_EDIT_MODE:"switchEditMode",SAVE_EDIT_RESULT:"saveEditResult",ZOOM_IN:"zoomIn",ZOOM_OUT:"zoomOut",EXIT:"exitClient",ENABLE_TERRAIN:"enableTerrain",ENABLE_POI:"enablePOIByTag",PRELOAD_LOCATION:"preLoadLocation",FOCUS_ACTOR_BY_ID:"focusActorByID",ENABLE_DATALAYER:"Scene_enableDataLayerByName",ENABLE_FPS:"Scene_setFPS",OBJECT_BOUNDINGBOX:"Interact_objectBoundingBox",ASSET_MODEL:"Gis_generateAssetModel",BUILD_GROWTHANIMATE:"Interact_buildGrowth",ENABLE_L2_BUILDING_SELECT:"Interact_enableBuildingL2Select"},X={NAVIGATION:"Camera_navigation",NAVIGATION_PAUSE:"Camera_navigationPause",NAVIGATION_STOP:"Camera_navigationStop",MOVE_TO:"Camera_moveTo",ZOOM_IN:"Camera_zoomIn",ZOOM_OUT:"Camera_zoomOut",PROJECT:"Camera_project",UNPROJECT:"Camera_unproject",UPDATE:"Camera_update",FOCUS_ON:"Camera_focusOn",Constrain_Shape:"Camera_constrainShape",MOVE:"Camera_move",ROTATE:"Camera_rotate",RESET_CAMERA_FOCUS:"Camera_resetCameraFocus"},K={ENABLE_3DTILES_BY_NAME:"Scene_enableTilesByName",SWITCH_TERRAIN_MODE:"Scene_switchTerrainMode",HIDDEN_3DTILES_ITEM:"Scene_hiddenTilesItem",EVENT_LAYER_BUILDING:"Scene_eventLayerBuilding",UPDATA_SLOPE_ANALYSIS:"Scene_updateSlopeAnalysis",GET_ALTITUDE:"Scene_getAltitude",SET_PLANE_POI_MODE:"Scene_setPlanePoiMode"},Q={EXIT_CLIENT:"Application_exitClient",RESTART_LEVEL:"Application_restartLevel",OPEN_LEVEL:"Application_openLevel",RESTART_GAME:"Application_restartGame",CREATE_TRAFFIC_STREAM:"Application_createTrafficStream",CLOSE_TRAFFIC_STREAM:"Application_closeTrafficStream",FOLLOW_TRAFFIC_STREAM_ITEM:"Application_followTrafficStreamItem",ADD_EVENT_LISTENER:"Application_addEvent",REMOVE_EVENT_LISTENER:"Application_removeEvent",RESET_WORLD_CENTER:"Application_resetWorldCenter",CONSOLE_COMMAND:"Application_ConsoleCommand"},Z={ADD:"Gis_AddCommonGISLayer",REMOVE:"Gis_RemoveCommonGISLayer",DESTORY:"Gis_DestoryCommonGISLayer",DESTORY_ALL:"Gis_DestoryAllGenerationLayer",UPDATE:"Gis_UpdateCommonGISLayer",VISIBLE:"Gis_VisibleCommonGISLayer"},ee={ENABLE_DRAW:"Gis_enableDraw",CLOSE_DRAW:"Gis_closeDraw",ENABLE_MEASURE:"Gis_enableMeasure",CLOSE_MEASURE:"Gis_closeMeasure",DESTORY_DRAW:"Gis_clearDraw",DESTORY_MEASURE:"Gis_clearMeasure"},te={SOLID:"solid",DASHED:"dashed",ARROW:"arrow",GRADIENT:"gradient"},ie=O({CENTER:"Ground_Center",STAND:"Stand",SIDE:"Ground_Side"},"SIDE","Cylinder"),ne={LINEAR:"Linear",CURVE:"Curve",CONSTANT:"Constant"},ae={QualityControlOwnership:0,Response:1,Command:2,FreezeFrame:3,UnfreezeFrame:4,VideoEncoderAvgQP:5,LatencyTest:6,InitialSettings:7,FileExtension:8,FileMimeType:9,FileContents:10,Mouse:21,Keyboard:22,InputControlOwnership:12,Protocol:255},oe={LockedMouse:0,HoveringMouse:1},re={controlScheme:oe.HoveringMouse,suppressBrowserKeys:!1,fakeMouseWithTouches:!1},se={IFrameRequest:0,RequestQualityControl:1,FpsRequest:2,AverageBitrateRequest:3,StartStreaming:4,StopStreaming:5,LatencyTest:6,RequestInitialSettings:7,UIInteraction:50,Command:51,KeyDown:60,KeyUp:61,KeyPress:62,MouseEnter:70,MouseLeave:71,MouseDown:72,MouseUp:73,MouseMove:74,MouseWheel:75,TouchStart:80,TouchEnd:81,TouchMove:82,GamepadButtonPressed:90,GamepadButtonReleased:91,GamepadAnalog:92},le={MainButton:0,AuxiliaryButton:1,SecondaryButton:2,FourthButton:3,FifthButton:4},de={PrimaryButton:1,SecondaryButton:2,AuxiliaryButton:4,FourthButton:8,FifthButton:16},ce={BackSpace:8,Shift:16,Control:17,Alt:18,RightShift:253,RightControl:254,RightAlt:255},he={FIRE_BIG:"P_Fire_Big",FIRE_SMALL:"P_Fire_Small",FIRE_FLAMETHROWER:"P_Flamethrower",SMOKE_SMALL_BLACK:"P_Smoke_A",SMOKE_BIG_BLACK:"P_Smoke_B",SMOKE_SMALL_YELLOW:"P_Smoke_C",SMOKE_BIG_YELLOW:"P_Smoke_D",SPARK_A:"P_Sparks_E",FOG_MASS:"P_Mass_Fog",NS_Spark:"NS_Spark",NS_Firefly:"NS_Firefly"},pe=Object.freeze({__proto__:null,ApplicationControl:Q,CameraControl:X,ControlSchemeType:oe,DrawAndMeasureControl:ee,GisControl:Z,InteractMOD:q,LineDirectionOptions:ie,LineSplineTypeOptions:ne,LineTypeOptions:te,MessageType:se,MouseButton:le,MouseButtonsMask:de,ParticleKind:he,SceneControl:K,SkyColorMode:Y,SkyMode:J,SpecialKeyCodes:ce,ToClientMessageType:ae,UDS:V,WS_OPEN_STATE:1,inputOptions:re}),fe=function(){return k((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};U(this,e),this.cloudRender=t,this.weather=i.weather||V.PARTLY_CLOUDY,this.hour=i.hour||14,this.minute=i.minute||30,this.weatherType=V,this.init()}),[{key:"changeWeather",value:function(e){e&&(Object.values(V).indexOf(e)<0||(this.weather=e,this.cloudRender.emitUIInteraction({excuteName:"Scene_changeWeather",params:{WeatherType:e}})))}},{key:"changeTime",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.hour=e,this.minute=Math.floor(10*t/6);var i=(this.hour<10?"0"+this.hour:""+this.hour)+(this.minute<10?"0"+this.minute:""+this.minute);this.cloudRender.emitUIInteraction({excuteName:"Scene_changeTime",params:{Time:i}})}},{key:"setVolumeFog",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,i=Math.max(Math.min(1e5,t),10);this.cloudRender.emitUIInteraction({excuteName:"Scene_setVolumenFog",params:{Enable:e,Distance:100*i}})}},{key:"setAtmosphericFog",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.0075,t=Math.max(Math.min(1,e),0);this.cloudRender.emitUIInteraction({excuteName:"Scene_setBaseFog",params:{BaseFogDensity:t}})}},{key:"setSkyMode",value:function(e){return!!e&&(!(Object.values(J).indexOf(e)<0)&&void this.cloudRender.emitUIInteraction({excuteName:"Scene_setSkyMode",params:{SkyMode:e}}))}},{key:"setSkyColorMode",value:function(e){return!!e&&(!(Object.values(Y).indexOf(e)<0)&&void this.cloudRender.emitUIInteraction({excuteName:"Scene_setSkyColorMode",params:{SkyColorMode:e}}))}},{key:"changeWeatherEffectParameters",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Scene_changeWeatherEffects",params:JSON.stringify(e)})}},{key:"init",value:function(){this.changeWeather(this.weather),this.changeTime(this.hour,this.minute)}}])}(),me=["BMap","Sentinel2","NaturalEarth"],ge=function(){return k((function e(t){U(this,e),this.cloudRender=t,this.earthCloud={VisMode:"Auto"},this.earthRoadNetwork={VisMode:"Auto",Opacity:.2,Color:"rgb(255, 255, 255)",Brightness:6},this.earthTiles={TilesType:"BMap"}}),[{key:"_changeEnvironment",value:function(e,t,i){t?(this[i]=A(A({},this[i]),t),this.cloudRender&&this.cloudRender.emitUIInteraction({excuteName:"Scene_SeqEnvironment",params:{environment:e,properties:A({},this[i])}})):console.warn("".concat(e," params is required"))}},{key:"changeEarthCloud",value:function(e){this._changeEnvironment("EarthCloud",e,"earthCloud")}},{key:"changeEarthRoadNetwork",value:function(e){this._changeEnvironment("EarthRoadNetwork",e,"earthRoadNetwork")}},{key:"changeEarthTiles",value:function(e){e&&e.TilesType&&!me.includes(e.TilesType)?console.warn("TilesType ".concat(e.TilesType," is not supported")):this._changeEnvironment("EarthTiles",e,"earthTiles")}}])}(),ye=function(e){e=void 0!==e?e:{},this.forceTURN=e.forceTURN;var t=this,i=new URLSearchParams(window.location.search);this.cfg=void 0!==e.peerConnectionOptions?e.peerConnectionOptions:{},this.cfg.sdpSemantics="unified-plan",this.cfg.offerExtmapAllowMixed=!1,i.has("ForceTURN")&&(this.forceTURN=i.has("ForceTURN")),this.forceTURN&&(console.log("Forcing TURN usage by setting ICE Transport Policy in peer connection config."),this.cfg.iceTransportPolicy="relay"),this.cfg.bundlePolicy="balanced",this.forceMaxBundle=i.has("ForceMaxBundle"),this.forceMaxBundle&&(this.cfg.bundlePolicy="max-bundle"),this.pcClient=null,this.dcClient=null,this.tnClient=null,this.sdpConstraints={offerToReceiveAudio:1,offerToReceiveVideo:1,voiceActivityDetection:!1},this.dataChannelOptions={ordered:!0,maxPacketLifeTime:3e3},this.startVideoMuted=void 0!==e.startVideoMuted&&e.startVideoMuted,this.autoPlayAudio=void 0===e.autoPlayAudio||e.autoPlayAudio,this.useMic=i.has("useMic"),this.useMic||console.log("Microphone access is not enabled. Pass ?useMic in the url to enable it.");var n="localhost"===location.hostname||"127.0.0.1"===location.hostname,a="https:"===location.protocol;!this.useMic||n||a||(this.useMic=!1,console.error("Microphone access in the browser will not work if you are not on HTTPS or localhost. Disabling mic access."),console.error("For testing you can enable HTTP microphone access Chrome by visiting chrome://flags/ and enabling 'unsafely-treat-insecure-origin-as-secure'")),this.preferSFU=i.has("preferSFU"),console.log(this.preferSFU?"The browser will signal it would prefer an SFU connection. Remove ?preferSFU from the url to signal for P2P usage.":"The browser will signal for a P2P connection. Pass ?preferSFU in the url to signal for SFU usage."),this.latencyTestTimings={TestStartTimeMs:null,UEReceiptTimeMs:null,UEEncodeMs:null,UECaptureToSendMs:null,UETransmissionTimeMs:null,BrowserReceiptTimeMs:null,FrameDisplayDeltaTimeMs:null,Reset:function(){this.TestStartTimeMs=null,this.UEReceiptTimeMs=null,this.UEEncodeMs=null,this.UECaptureToSendMs=null,this.UETransmissionTimeMs=null,this.BrowserReceiptTimeMs=null,this.FrameDisplayDeltaTimeMs=null},SetUETimings:function(e){this.UEReceiptTimeMs=e.ReceiptTimeMs,this.UEEncodeMs=e.EncodeMs,this.UECaptureToSendMs=e.CaptureToSendMs,this.UETransmissionTimeMs=e.TransmissionTimeMs,this.BrowserReceiptTimeMs=Date.now(),this.OnAllLatencyTimingsReady(this)},SetFrameDisplayDeltaTime:function(e){null==this.FrameDisplayDeltaTimeMs&&(this.FrameDisplayDeltaTimeMs=Math.round(e),this.OnAllLatencyTimingsReady(this))},OnAllLatencyTimingsReady:function(e){}},this.createWebRtcVideo=function(){var e=document.createElement("video");if(e.id="streamingVideo",e.playsInline=!0,e.disablepictureinpicture=!0,e.muted=t.startVideoMuted,e.addEventListener("loadedmetadata",(function(e){t.onVideoInitialised&&t.onVideoInitialised()}),!0),"requestVideoFrameCallback"in HTMLVideoElement.prototype){var i=function(n,a){if(a.receiveTime&&a.expectedDisplayTime){var o=a.presentationTime-a.receiveTime;t.aggregatedStats||(t.aggregatedStats={}),t.aggregatedStats.receiveToCompositeMs=o}e.requestVideoFrameCallback(i)};e.requestVideoFrameCallback(i)}return e},this.video=this.createWebRtcVideo(),this.availableVideoStreams=new Map;var o=function(e){console.info("Signaling state change. |",e.srcElement.signalingState,"|")},r=function(e){console.info("Browser ICE connection |",e.srcElement.iceConnectionState,"|")},s=function(e){console.info("Browser ICE gathering |",e.srcElement.iceGatheringState,"|")},l=function(e){if(e.track&&console.log("Got track. | Kind="+e.track.kind+" | Id="+e.track.id+" | readyState="+e.track.readyState+" |"),"audio"!=e.track.kind){e.track.kind;var i,n=T(e.streams);try{for(n.s();!(i=n.n()).done;){var a=i.value;t.availableVideoStreams.has(a.id)||t.availableVideoStreams.set(a.id,a)}}catch(e){n.e(e)}finally{n.f()}t.video.srcObject=e.streams[0],e.track.onunmute=function(){t.video.srcObject=e.streams[0],t.onNewVideoTrack(e.streams)}}else d(e.streams[0])},d=function(e){if(t.video.srcObject!=e&&t.video.srcObject&&t.video.srcObject!==e){var i=document.createElement("Audio");if(i.srcObject=e,t.autoPlayAudio)i.play();else{var n=function(){i.play(),t.video.removeEventListener("click",n)};t.video.addEventListener("click",n)}console.log("Created new audio element to play seperate audio stream.")}},c=function(e){console.log("Data channel created for us by browser as we are a receiving peer."),t.dcClient=e.channel,u(t.dcClient)},u=function(e){try{return e.binaryType="arraybuffer",e.onopen=function(e){console.log("Data channel connected"),t.onDataChannelConnected&&t.onDataChannelConnected()},e.onclose=function(e){console.log("Data channel connected",e)},e.onmessage=function(e){if(t.onDataChannelMessage)if("string"==typeof e.data){var i=function(e){var t,i,n=new Array;t=e.length;for(var a=0;a<t;a++)(i=e.charCodeAt(a))>=65536&&i<=1114111?(n.push(i>>18&7|240),n.push(i>>12&63|128),n.push(i>>6&63|128),n.push(63&i|128)):i>=2048&&i<=65535?(n.push(i>>12&15|224),n.push(i>>6&63|128),n.push(63&i|128)):i>=128&&i<=2047?(n.push(i>>6&31|192),n.push(63&i|128)):n.push(255&i);return new Uint8Array(n).buffer}(e.data);t.onDataChannelMessage(i)}else t.onDataChannelMessage(e.data)},e.onerror=function(e){console.error("Data channel error",e)},e}catch(e){return console.warn("No data channel",e),null}},h=function(e){var i=e.candidate;i&&i.candidate&&(console.log("%c[Browser ICE candidate]","background: violet; color: black","| Type=",i.type,"| Protocol=",i.protocol,"| Address=",i.address,"| Port=",i.port,"|"),t.onWebRtcCandidate(i))},p=function(e){e.sdp=e.sdp.replace("useinbandfec=1","useinbandfec=1;stereo=1;sprop-maxcapturerate=48000")},f=function(e){e.onsignalingstatechange=o,e.oniceconnectionstatechange=r,e.onicegatheringstatechange=s,e.ontrack=l,e.onicecandidate=h,e.ondatachannel=c},m=function(){var e=N(P().mark((function e(i){var n,a,o,r,s,l,d,c,u,h,p,f;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.getTransceivers().length>0,i.addTransceiver("video",{direction:"recvonly"}),t.useMic){e.next=6;break}i.addTransceiver("audio",{direction:"recvonly"}),e.next=11;break;case 6:return a=!!t.useMic&&{autoGainControl:!1,channelCount:1,echoCancellation:!1,latency:0,noiseSuppression:!1,sampleRate:48e3,volume:1},e.next=9,navigator.mediaDevices.getUserMedia({video:!1,audio:a});case 9:if(o=e.sent)if(n){r=T(i.getTransceivers());try{for(r.s();!(s=r.n()).done;)if((l=s.value)&&l.receiver&&l.receiver.track&&"audio"===l.receiver.track.kind){d=T(o.getTracks());try{for(d.s();!(c=d.n()).done;)(u=c.value).kind&&"audio"==u.kind&&(l.sender.replaceTrack(u),l.direction="sendrecv")}catch(e){d.e(e)}finally{d.f()}}}catch(e){r.e(e)}finally{r.f()}}else{h=T(o.getTracks());try{for(h.s();!(p=h.n()).done;)(f=p.value).kind&&"audio"==f.kind&&i.addTransceiver(f,{direction:"sendrecv"})}catch(e){h.e(e)}finally{h.f()}}else i.addTransceiver("audio",{direction:"recvonly"});case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();this.setVideoEnabled=function(e){t.video.srcObject.getTracks().forEach((function(t){return t.enabled=e}))},this.startLatencyTest=function(e){t.video&&(t.latencyTestTimings.Reset(),t.latencyTestTimings.TestStartTimeMs=Date.now(),e(t.latencyTestTimings.TestStartTimeMs))},this.handleCandidateFromServer=function(e){var i=new RTCIceCandidate(e);console.log("%c[Unreal ICE candidate]","background: pink; color: black","| Type=",i.type,"| Protocol=",i.protocol,"| Address=",i.address,"| Port=",i.port,"|"),t.forceTURN&&i.candidate.indexOf("relay")<0?console.warn("Dropping candidate because it was not TURN relay.","| Type=",i.type,"| Protocol=",i.protocol,"| Address=",i.address,"| Port=",i.port,"|"):t.pcClient.addIceCandidate(i).catch((function(e){console.error("Failed to add ICE candidate",e)}))},this.createOffer=function(){t.pcClient&&(console.log("Closing existing PeerConnection"),t.pcClient.close(),t.pcClient=null),t.pcClient=new RTCPeerConnection(t.cfg),f(t.pcClient),m(t.pcClient).finally((function(){var e,i,n,a;t.dcClient=(e=t.pcClient,i="cirrus",n=t.dataChannelOptions,a=e.createDataChannel(i,n),console.log("Created datachannel (".concat(i,")")),u(a),a),function(e){e.createOffer(t.sdpConstraints).then((function(i){p(i),e.setLocalDescription(i),t.onWebRtcOffer&&t.onWebRtcOffer(i)}),(function(){console.warn("Couldn't create offer")}))}(t.pcClient)}))},this.receiveOffer=function(e){var i=new RTCSessionDescription(e);t.pcClient||(console.log("Creating a new PeerConnection in the browser.",t.cfg),t.pcClient=new RTCPeerConnection(t.cfg),f(t.pcClient),t.pcClient.setRemoteDescription(i).then((function(){m(t.pcClient).finally((function(){t.pcClient.createAnswer().then((function(e){return t.pcClient.setLocalDescription(e)})).then((function(){t.onWebRtcAnswer&&t.onWebRtcAnswer(t.pcClient.currentLocalDescription)})).then((function(){var e,i=T(t.pcClient.getReceivers());try{for(i.s();!(e=i.n()).done;)e.value.playoutDelayHint=0}catch(e){i.e(e)}finally{i.f()}})).catch((function(e){return console.error("createAnswer() failed:",e)}))}))})))},this.receiveAnswer=function(e){var i=new RTCSessionDescription(e);t.pcClient.setRemoteDescription(i);var n,a=T(t.pcClient.getReceivers());try{for(a.s();!(n=a.n()).done;)n.value.playoutDelayHint=0}catch(e){a.e(e)}finally{a.f()}},this.close=function(){t.pcClient&&(console.log("Closing existing peerClient"),t.pcClient.close(),t.pcClient=null),t.aggregateStatsIntervalId&&clearInterval(t.aggregateStatsIntervalId)},this.send=function(e){if(t.dcClient&&"open"==t.dcClient.readyState)try{t.dcClient.send(e)}catch(e){console.error("dcClient.send error: ",e)}},this.getStats=function(e){t.pcClient&&e&&t.pcClient.getStats(null).then((function(t){e(t)}))},this.aggregateStats=function(e){var i=(t.aggregatedStats||(t.aggregatedStats={}),function(e){var i={};e.forEach((function(e){"inbound-rtp"!=e.type||e.isRemote||"video"!=e.mediaType&&!e.id.toLowerCase().includes("video")||(i.timestamp=e.timestamp,i.bytesReceived=e.bytesReceived,i.framesDecoded=e.framesDecoded,i.packetsLost=e.packetsLost,i.bytesReceivedStart=t.aggregatedStats&&t.aggregatedStats.bytesReceivedStart?t.aggregatedStats.bytesReceivedStart:e.bytesReceived,i.framesDecodedStart=t.aggregatedStats&&t.aggregatedStats.framesDecodedStart?t.aggregatedStats.framesDecodedStart:e.framesDecoded,i.timestampStart=t.aggregatedStats&&t.aggregatedStats.timestampStart?t.aggregatedStats.timestampStart:e.timestamp,t.aggregatedStats&&t.aggregatedStats.timestamp&&(t.aggregatedStats.bytesReceived&&(i.bitrate=8*(i.bytesReceived-t.aggregatedStats.bytesReceived)/(i.timestamp-t.aggregatedStats.timestamp),i.bitrate=Math.floor(i.bitrate),i.lowBitrate=t.aggregatedStats.lowBitrate&&t.aggregatedStats.lowBitrate<i.bitrate?t.aggregatedStats.lowBitrate:i.bitrate,i.highBitrate=t.aggregatedStats.highBitrate&&t.aggregatedStats.highBitrate>i.bitrate?t.aggregatedStats.highBitrate:i.bitrate),t.aggregatedStats.bytesReceivedStart&&(i.avgBitrate=8*(i.bytesReceived-t.aggregatedStats.bytesReceivedStart)/(i.timestamp-t.aggregatedStats.timestampStart),i.avgBitrate=Math.floor(i.avgBitrate)),t.aggregatedStats.framesDecoded&&(i.framerate=(i.framesDecoded-t.aggregatedStats.framesDecoded)/((i.timestamp-t.aggregatedStats.timestamp)/1e3),i.framerate=Math.floor(i.framerate),i.lowFramerate=t.aggregatedStats.lowFramerate&&t.aggregatedStats.lowFramerate<i.framerate?t.aggregatedStats.lowFramerate:i.framerate,i.highFramerate=t.aggregatedStats.highFramerate&&t.aggregatedStats.highFramerate>i.framerate?t.aggregatedStats.highFramerate:i.framerate),t.aggregatedStats.framesDecodedStart&&(i.avgframerate=(i.framesDecoded-t.aggregatedStats.framesDecodedStart)/((i.timestamp-t.aggregatedStats.timestampStart)/1e3),i.avgframerate=Math.floor(i.avgframerate)))),"track"!=e.type||"video_label"!=e.trackIdentifier&&"video"!=e.kind||(i.framesDropped=e.framesDropped,i.framesReceived=e.framesReceived,i.framesDroppedPercentage=e.framesReceived>0?e.framesDropped/e.framesReceived*100:0,i.frameHeight=e.frameHeight,i.frameWidth=e.frameWidth,i.frameHeightStart=t.aggregatedStats&&t.aggregatedStats.frameHeightStart?t.aggregatedStats.frameHeightStart:e.frameHeight,i.frameWidthStart=t.aggregatedStats&&t.aggregatedStats.frameWidthStart?t.aggregatedStats.frameWidthStart:e.frameWidth),"inbound-rtp"!=e.type||"video"!=e.mediaType&&"video"!=e.kind||(e.frameHeight&&!i.frameHeight&&(i.frameHeight=e.frameHeight),e.frameWidth&&!i.frameWidth&&(i.frameWidth=e.frameWidth),void 0!==e.framesDropped&&void 0===i.framesDropped&&(i.framesDropped=e.framesDropped),void 0!==e.framesReceived&&void 0===i.framesReceived&&(i.framesReceived=e.framesReceived,i.framesReceived>0&&void 0!==i.framesDropped&&(i.framesDroppedPercentage=i.framesDropped/i.framesReceived*100))),"candidate-pair"==e.type&&e.hasOwnProperty("currentRoundTripTime")&&0!=e.currentRoundTripTime&&(i.currentRoundTripTime=e.currentRoundTripTime)})),t.aggregatedStats.receiveToCompositeMs&&(i.receiveToCompositeMs=t.aggregatedStats.receiveToCompositeMs,t.latencyTestTimings.SetFrameDisplayDeltaTime(t.aggregatedStats.receiveToCompositeMs)),t.aggregatedStats=i,t.onAggregatedStats&&t.onAggregatedStats(i)});t.aggregateStatsIntervalId=setInterval((function(){t.getStats(i)}),e)}};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===i&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}("/* 视频流送的视频组件样式 */\nvideo {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n\n/* 视频流送的整体根组件属性 */\n#player {\n width: 100%;\n height: 100%;\n position: relative;\n background-color: #000;\n}\n\n/* 如果不是链接后直接加载(即connect_on_load: false)那么便会显示该画面,用于配置显示蒙版的样式 */\n#videoPlayOverlay {\n z-index: 30;\n position: absolute;\n font-size: 1.8em;\n width: 100%;\n height: 100%;\n color: white;\n background-color: rgba(100, 100, 100, .7);\n}\n\n/* State for element to be clickable */\n/* 待开始页面显示状态的样式 */\n.clickableState {\n align-items: center;\n justify-content: center;\n display: flex;\n cursor: pointer;\n}\n\n.textDisplayState {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n/* State to hide overlay, WebRTC communication is in progress and or is playing */\n/* 待开始页面隐藏 */\n.hiddenState {\n display: none;\n}\n\n/* 如果不是链接后直接加载(即connect_on_load: false)那么便会显示该按钮文字,用于配置显示样式 */\n#playButton {\n display: inline-block;\n height: auto;\n}");var ve=function(){return k((function e(){U(this,e)}),[{key:"addEventListener",value:function(e,t){void 0===this._listeners&&(this._listeners={}),this._needsDispatchedToUE=!1;var i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&(i[e].push(t),this._needsDispatchedToUE=!0,this._dispatchAddListenerTypes||(this._dispatchAddListenerTypes=[]),this._dispatchAddListenerTypes.push(e))}},{key:"hasEventListener",value:function(e,t){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)}},{key:"removeEventListener",value:function(e,t){if(void 0!==this._listeners){this._needsDispatchedToUE=!1;var i=this._listeners[e];if(void 0!==i){var n=i.indexOf(t);-1!==n&&(i.splice(n,1),this._needsDispatchedToUE=!0,this._dispatchRemoveListenerTypes||(this._dispatchRemoveListenerTypes=[]),this._dispatchRemoveListenerTypes.push(e))}}}},{key:"dispatchEvent",value:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var i=t.slice(0),n=0,a=i.length;n<a;n++)e.index=n,i[n].call(this,e);e.target=null}}}},{key:"_silentlyRemoveEventListener",value:function(e,t,i){if(e&&i&&void 0!==e._listeners){var n=e._listeners[t];if(void 0!==n){var a=n.indexOf(i);-1!==a&&n.splice(a,1)}}}}])}(),be=function(){function t(i){var n;return U(this,t),(n=w(this,t)).haveEvents="GamepadEvent"in window,n.haveWebkitEvents="WebKitGamepadEvent"in window,n.cloudRenderEngine=i,n.playerElement=document.getElementById("player"),n.promiseResponses=[],n.scene=n.cloudRenderEngine.scene,n.interactiveObjects=new Map,n.blacklist=new Set,n.mousedownTime=null,n.mouse=new e(0,0),n.selection=[],n.logMessages=!1,n.inputOptions=i.inputOptions,n.playerElement&&(n.playerElement.tabIndex<10&&(n.playerElement.tabIndex=1e3),n.playerElement.addEventListener("contextmenu",(function(e){e.preventDefault()}),!1)),n}return z(t,ve),k(t,[{key:"updateObjectsWithEvent",value:function(){var e=new Map;this.scene&&this.scene.children.length&&this.scene.children.forEach((function(t,i){t._listeners&&e.set(t.uuid,t)})),this.interactiveObjects.clear(),this.interactiveObjects=e}},{key:"isKeyCodeBrowserKey",value:function(e){return e>=112&&e<=123||9===e}},{key:"getKeyCode",value:function(e){return e.keyCode===ce.Shift&&"ShiftRight"===e.code?ce.RightShift:e.keyCode===ce.Control&&"ControlRight"===e.code?ce.RightControl:e.keyCode===ce.Alt&&"AltRight"===e.code?ce.RightAlt:e.keyCode}},{key:"registerKeyboardEvents",value:function(){var e=this;document.onkeydown=function(t){e.print_inputs&&console.log("key down ".concat(t.keyCode,", repeat = ").concat(t.repeat)),e.cloudRenderEngine.sendInputData(new Uint8Array([se.KeyDown,e.getKeyCode(t),t.repeat]).buffer),t.keyCode===ce.BackSpace&&document.onkeypress({charCode:ce.BackSpace}),e.inputOptions.suppressBrowserKeys&&e.isKeyCodeBrowserKey(t.keyCode)&&t.preventDefault()},document.onkeyup=function(t){e.print_inputs&&console.log("key up ".concat(t.keyCode)),e.cloudRenderEngine.sendInputData(new Uint8Array([se.KeyUp,e.getKeyCode(t)]).buffer),e.inputOptions.suppressBrowserKeys&&e.isKeyCodeBrowserKey(t.keyCode)&&t.preventDefault()},document.onkeypress=function(t){e.print_inputs&&console.log("key press ".concat(t.charCode));var i=new DataView(new ArrayBuffer(3));i.setUint8(0,se.KeyPress),i.setUint16(1,t.charCode,!0),e.cloudRenderEngine.sendInputData(i.buffer)}}},{key:"resizePlayerStyleToFillWindow",value:function(e){var t=e.getElementsByTagName("VIDEO"),i=window.innerHeight/window.innerWidth,n=e.clientHeight/e.clientWidth,a=t.videoHeight/t.videoWidth;isNaN(a)?(this.styleWidth=window.innerWidth,this.styleHeight=window.innerHeight,this.styleTop=0,this.styleLeft=0,e.style="top: "+this.styleTop+"px; left: "+this.styleLeft+"px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional):i<n?(this.styleWidth=Math.floor(window.innerHeight/a),this.styleHeight=window.innerHeight,this.styleTop=0,this.styleLeft=Math.floor(.5*(window.innerWidth-this.styleWidth)),e.style="top: "+this.styleTop+"px; left: "+this.styleLeft+"px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional):(this.styleWidth=window.innerWidth,this.styleHeight=Math.floor(window.innerWidth*a),this.styleTop=Math.floor(.5*(window.innerHeight-this.styleHeight)),this.styleLeft=0,e.style="top: "+this.styleTop+"px; left: "+this.styleLeft+"px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional)}},{key:"resizePlayerStyleToActualSize",value:function(e){var t=e.getElementsByTagName("VIDEO");if(t.length>0){this.styleWidth=t[0].videoWidth,this.styleHeight=t[0].videoHeight;var i=Math.floor(.5*(window.innerHeight-this.styleHeight)),n=Math.floor(.5*(window.innerWidth-this.styleWidth));this.styleTop=i>0?i:0,this.styleLeft=n>0?n:0,e.style="top: "+this.styleTop+"px; left: "+this.styleLeft+"px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional}}},{key:"resizePlayerStyleToArbitrarySize",value:function(e){e.style="top: 0px; left: 0px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional}},{key:"setupFreezeFrameOverlay",value:function(){this.cloudRenderEngine.freezeFrameOverlay=document.createElement("div"),this.cloudRenderEngine.freezeFrameOverlay.id="this.cloudRenderEngine.freezeFrameOverlay",this.cloudRenderEngine.freezeFrameOverlay.style.display="none",this.cloudRenderEngine.freezeFrameOverlay.style.pointerEvents="none",this.cloudRenderEngine.freezeFrameOverlay.style.position="absolute",this.cloudRenderEngine.freezeFrameOverlay.style.zIndex="20";var e=document.createElement("img");e.style.position="absolute",this.cloudRenderEngine.freezeFrameOverlay.appendChild(e)}},{key:"showFreezeFrameOverlay",value:function(){this.cloudRenderEngine.freezeFrame.valid&&(this.cloudRenderEngine.freezeFrameOverlay.classList.add("freezeframeBackground"),this.cloudRenderEngine.freezeFrameOverlay.style.display="block")}},{key:"invalidateFreezeFrameOverlay",value:function(){this.cloudRenderEngine.freezeFrameOverlay.style.display="none",this.cloudRenderEngine.freezeFrame.valid=!1,this.cloudRenderEngine.freezeFrameOverlay.classList.remove("freezeframeBackground"),this.cloudRenderEngine.webRtcPlayerObj&&this.cloudRenderEngine.webRtcPlayerObj.setVideoEnabled(!0)}},{key:"resizeFreezeFrameOverlay",value:function(){if(0!==this.cloudRenderEngine.freezeFrame.width&&0!==this.cloudRenderEngine.freezeFrame.height){var e=0,t=0,i=0,n=0,a=document.getElementById("enlarge-display-to-fill-window-tgl"),o=document.getElementById("player");if(null!==a&&a.checked){var r=window.innerWidth/window.innerHeight,s=this.cloudRenderEngine.freezeFrame.width/this.cloudRenderEngine.freezeFrame.height;r<s?(e=window.innerWidth,t=Math.floor(window.innerWidth/s),i=Math.floor(.5*(window.innerHeight-t)),n=0):(e=Math.floor(window.innerHeight*s),t=window.innerHeight,i=0,n=Math.floor(.5*(window.innerWidth-e)))}else{var l=o.offsetWidth/o.offsetHeight,d=this.cloudRenderEngine.freezeFrame.width/this.cloudRenderEngine.freezeFrame.height;l<d?(e=o.offsetWidth,t=Math.floor(o.offsetWidth/d),i=Math.floor(.5*(o.offsetHeight-t)),n=0):(e=Math.floor(o.offsetHeight*d),t=o.offsetHeight,i=0,n=Math.floor(.5*(o.offsetWidth-e)))}var c=document.getElementById("this.cloudRenderEngine.freezeFrameOverlay").childNodes[0];this.cloudRenderEngine.freezeFrameOverlay.style.width=o.offsetWidth+"px",this.cloudRenderEngine.freezeFrameOverlay.style.height=o.offsetHeight+"px",this.cloudRenderEngine.freezeFrameOverlay.style.left="0px",this.cloudRenderEngine.freezeFrameOverlay.style.top="0px",c.style.width=e+"px",c.style.height=t+"px",c.style.left=n+"px",c.style.top=i+"px"}}},{key:"resizePlayerStyle",value:function(e){var t=document.getElementById("player");if(t)if(this.cloudRenderEngine.updateVideoStreamSize(),t.classList.contains("fixed-size"))this.setupMouseAndFreezeFrame(t);else{var i=document.getElementById("enlarge-display-to-fill-window-tgl"),n=window.innerWidth<t.videoWidth||window.innerHeight<t.videoHeight;null!==i?i.checked||n?this.resizePlayerStyleToFillWindow(t):this.resizePlayerStyleToActualSize(t):this.resizePlayerStyleToArbitrarySize(t),this.setupMouseAndFreezeFrame(t)}}},{key:"setupMouseAndFreezeFrame",value:function(e){this.playerElementClientRect=e.getBoundingClientRect(),this.cloudRenderEngine.setupNormalizeAndQuantize(),this.resizeFreezeFrameOverlay()}},{key:"onOrientationChange",value:function(e){var t=this;clearTimeout(this._orientationChangeTimeout),this._orientationChangeTimeout=setTimeout((function(){t.resizePlayerStyle()}),500)}},{key:"setupHtmlEvents",value:function(){var e=this,t=this;if(window.addEventListener("resize",(function(t){e.resizePlayerStyle(t)}),!0),window.addEventListener("orientationchange",(function(t){e.onOrientationChange(t)})),this.haveEvents?(window.addEventListener("gamepadconnected",(function(t){e.gamepadConnectHandler(t)})),window.addEventListener("gamepaddisconnected",(function(t){e.gamepadDisconnectHandler(t)}))):this.haveWebkitEvents&&(window.addEventListener("webkitgamepadconnected",(function(t){e.gamepadConnectHandler(t)})),window.addEventListener("webkitgamepaddisconnected",(function(t){e.gamepadDisconnectHandler(t)}))),this.cloudRenderEngine.isShowTestUI){document.getElementById("overlayButton").addEventListener("click",(function(t){e.onExpandOverlay_Click(t)}));var i=document.getElementById("enlarge-display-to-fill-window-tgl");null!==i&&(i.onchange=function(e){t.resizePlayerStyle()}),this.cloudRenderEngine.qualityControlOwnershipCheckBox=document.getElementById("quality-control-ownership-tgl"),null!==this.cloudRenderEngine.qualityControlOwnershipCheckBox&&(this.cloudRenderEngine.qualityControlOwnershipCheckBox.onchange=function(e){t.cloudRenderEngine.requestQualityControl()});var n=document.getElementById("encoder-params-submit");null!==n&&(n.onclick=function(e){var i=document.getElementById("encoder-min-qp-text").value,n=document.getElementById("encoder-max-qp-text").value;t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.Encoder.MinQP "+i}),t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.Encoder.MaxQP "+n})});var a=document.getElementById("webrtc-params-submit");null!==a&&(a.onclick=function(e){var i=document.getElementById("webrtc-fps-text").value,n=1e3*document.getElementById("webrtc-min-bitrate-text").value,a=1e3*document.getElementById("webrtc-max-bitrate-text").value;t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.WebRTC.Fps "+i}),t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.WebRTC.MinBitrate "+n}),t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.WebRTC.MaxBitrate "+a})});var o=document.getElementById("show-fps-button");null!==o&&(o.onclick=function(e){t.cloudRenderEngine.emitCommand({ConsoleCommand:"Stat FPS"})});var r=document.getElementById("match-viewport-res-tgl");null!==r&&(r.onchange=function(e){t.cloudRenderEngine.matchViewportResolution=r.checked});var s=document.getElementById("show-stats-tgl");null!==s&&(s.onchange=function(e){document.getElementById("statsContainer").style.display=e.target.checked?"block":"none"});var l=document.getElementById("test-latency-button");l&&(l.onclick=function(){e.sendStartLatencyTest()}),this.cloudRenderEngine.setupToggleWithUrlParams("prefer-sfu-tgl","preferSFU"),this.cloudRenderEngine.setupToggleWithUrlParams("use-mic-tgl","useMic"),this.cloudRenderEngine.setupToggleWithUrlParams("force-turn-tgl","ForceTURN");var d=document.getElementById("stream-select"),c=document.getElementById("track-select");d&&(d.onchange=function(e){var i=t.cloudRenderEngine.webRtcPlayerObj.availableVideoStreams.get(d.value);t.cloudRenderEngine.webRtcPlayerObj.video.srcObject=i,t.cloudRenderEngine.streamTrackSource=i,t.cloudRenderEngine.webRtcPlayerObj.video.play(),t.cloudRenderEngine.updateTrackList()},c&&(c.onchange=function(e){if(t.cloudRenderEngine.streamTrackSource||(t.cloudRenderEngine.streamTrackSource=t.cloudRenderEngine.webRtcPlayerObj.availableVideoStreams.get(d.value)),t.cloudRenderEngine.streamTrackSource){var i,n=T(t.cloudRenderEngine.streamTrackSource.getVideoTracks());try{for(n.s();!(i=n.n()).done;){var a=i.value;if(a.id===c.value){t.cloudRenderEngine.webRtcPlayerObj.video.srcObject=new MediaStream([a]),t.cloudRenderEngine.webRtcPlayerObj.video.play(),d.value="";break}}}catch(e){n.e(e)}finally{n.f()}}}))}}},{key:"onExpandOverlay_Click",value:function(){document.getElementById("overlay").classList.toggle("overlay-shown")}},{key:"gamepadConnectHandler",value:function(e){console.log("Gamepad connect handler")}},{key:"gamepadDisconnectHandler",value:function(e){console.log("Gamepad disconnect handler"),console.log("gamepad: "+e.gamepad.id+" disconnected"),delete this.cloudRenderEngine.controllers[e.gamepad.index]}},{key:"emitMouseMove",value:function(e,t,i,n){this.cloudRenderEngine.print_inputs&&console.log("emitMouseMove x: ".concat(e,", y:").concat(t,", dX: ").concat(i,", dY: ").concat(n));var a=this.cloudRenderEngine.normalizeAndQuantizeUnsigned(e,t),o=this.cloudRenderEngine.normalizeAndQuantizeSigned(i,n),r=new DataView(new ArrayBuffer(9));r.setUint8(0,se.MouseMove),r.setUint16(1,a.x,!0),r.setUint16(3,a.y,!0),r.setInt16(5,o.x,!0),r.setInt16(7,o.y,!0),this.cloudRenderEngine.sendInputData(r.buffer)}},{key:"emitMouseDown",value:function(e,t,i){this.print_inputs&&console.log("mouse button ".concat(e," down at (").concat(t,", ").concat(i,")"));var n=this.cloudRenderEngine.normalizeAndQuantizeUnsigned(t,i),a=new DataView(new ArrayBuffer(6));a.setUint8(0,se.MouseDown),a.setUint8(1,e),a.setUint16(2,n.x,!0),a.setUint16(4,n.y,!0),this.cloudRenderEngine.sendInputData(a.buffer)}},{key:"emitMouseUp",value:function(e,t,i){this.print_inputs&&console.log("mouse button ".concat(e," up at (").concat(t,", ").concat(i,")"));var n=this.cloudRenderEngine.normalizeAndQuantizeUnsigned(t,i),a=new DataView(new ArrayBuffer(6));a.setUint8(0,se.MouseUp),a.setUint8(1,e),a.setUint16(2,n.x,!0),a.setUint16(4,n.y,!0),this.cloudRenderEngine.sendInputData(a.buffer)}},{key:"emitMouseWheel",value:function(e,t,i){this.print_inputs&&console.log("mouse wheel with delta ".concat(e," at (").concat(t,", ").concat(i,")"));var n=this.cloudRenderEngine.normalizeAndQuantizeUnsigned(t,i),a=new DataView(new ArrayBuffer(7));a.setUint8(0,se.MouseWheel),a.setInt16(1,e,!0),a.setUint16(3,n.x,!0),a.setUint16(5,n.y,!0),this.cloudRenderEngine.sendInputData(a.buffer)}},{key:"releaseMouseButtons",value:function(e,t,i){e&de.PrimaryButton&&this.emitMouseUp(le.MainButton,t,i),e&de.SecondaryButton&&this.emitMouseUp(le.SecondaryButton,t,i),e&de.AuxiliaryButton&&this.emitMouseUp(le.AuxiliaryButton,t,i),e&de.FourthButton&&this.emitMouseUp(le.FourthButton,t,i),e&de.FifthButton&&this.emitMouseUp(le.FifthButton,t,i)}},{key:"pressMouseButtons",value:function(e,t,i){e&de.PrimaryButton&&this.emitMouseDown(le.MainButton,t,i),e&de.SecondaryButton&&this.emitMouseDown(le.SecondaryButton,t,i),e&de.AuxiliaryButton&&this.emitMouseDown(le.AuxiliaryButton,t,i),e&de.FourthButton&&this.emitMouseDown(le.FourthButton,t,i),e&de.FifthButton&&this.emitMouseDown(le.FifthButton,t,i)}},{key:"registerInputs",value:function(e){e&&(this.registerMouseEnterAndLeaveEvents(e),this.registerTouchEvents(e))}},{key:"registerMouseEnterAndLeaveEvents",value:function(e){var t=this;e.onmouseenter=function(i){t.print_inputs&&console.log("mouse enter");var n=new DataView(new ArrayBuffer(1));n.setUint8(0,se.MouseEnter),t.cloudRenderEngine.sendInputData(n.buffer),e.pressMouseButtons(i)},e.onmouseleave=function(i){t.print_inputs&&console.log("mouse leave");var n=new DataView(new ArrayBuffer(1));n.setUint8(0,se.MouseLeave),t.cloudRenderEngine.sendInputData(n.buffer),e.releaseMouseButtons(i)}}},{key:"registerLockedMouseEvents",value:function(e){var t=this,i=e.width/2,n=e.height/2;function a(){document.pointerLockElement===e||document.mozPointerLockElement===e?(console.log("Pointer locked"),document.addEventListener("mousemove",o,!1)):(console.log("The pointer lock status is now unlocked"),document.removeEventListener("mousemove",o,!1))}function o(e){i+=e.movementX,n+=e.movementY,i>t.styleWidth&&(i-=t.styleWidth),n>t.styleHeight&&(n-=t.styleHeight),i<0&&(i=t.styleWidth+i),n<0&&(n=t.styleHeight-n),t.emitMouseMove(i,n,e.movementX,e.movementY)}e.requestPointerLock=e.requestPointerLock||e.mozRequestPointerLock,document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock,e.onclick=function(){e.requestPointerLock()},document.addEventListener("pointerlockchange",a,!1),document.addEventListener("mozpointerlockchange",a,!1),e.onmousedown=function(e){t.emitMouseDown(e.button,i,n)},e.onmouseup=function(e){t.emitMouseUp(e.button,i,n)},e.onmousewheel=function(e){t.emitMouseWheel(e.wheelDelta,i,n)},e.pressMouseButtons=function(e){t.pressMouseButtons(e.buttons,i,n)},e.releaseMouseButtons=function(e){t.releaseMouseButtons(e.buttons,i,n)}}},{key:"registerHoveringMouseEvents",value:function(e){var t=this;e.onpointermove=function(e){t.emitMouseMove(e.offsetX,e.offsetY,e.movementX,e.movementY),e.preventDefault()},e.onpointerdown=function(e){t.emitMouseDown(e.button,e.offsetX,e.offsetY),e.preventDefault()},e.onpointerup=function(e){t.emitMouseUp(e.button,e.offsetX,e.offsetY),e.preventDefault()},e.oncontextmenu=function(e){t.emitMouseUp(e.button,e.offsetX,e.offsetY),e.preventDefault()},"onmousewheel"in e?e.onmousewheel=function(e){t.emitMouseWheel(e.wheelDelta,e.offsetX,e.offsetY),e.preventDefault()}:e.addEventListener("DOMMouseScroll",(function(e){t.emitMouseWheel(-120*e.detail,e.offsetX,e.offsetY),e.preventDefault()}),!1),e.pressMouseButtons=function(e){t.pressMouseButtons(e.buttons,e.offsetX,e.offsetY)},e.releaseMouseButtons=function(e){t.releaseMouseButtons(e.buttons,e.offsetX,e.offsetY)}}},{key:"registerTouchEvents",value:function(e){var t,i=this,n=[9,8,7,6,5,4,3,2,1,0],a={};function o(e){var t=n.pop();void 0===t&&console.log("exhausted touch indentifiers"),a[e.identifier]=t}function r(t,n){var o=new DataView(new ArrayBuffer(2+7*n.length));o.setUint8(0,t),o.setUint8(1,n.length);for(var r=2,s=0;s<n.length;s++){var l=n[s],d=l.clientX-e.offsetLeft,c=l.clientY-e.offsetTop;i.print_inputs&&console.log("F".concat(a[l.identifier],"=(").concat(d,", ").concat(c,")"));var u=i.cloudRenderEngine.normalizeAndQuantizeUnsigned(d,c);o.setUint16(r,u.x,!0),r+=2,o.setUint16(r,u.y,!0),r+=2,o.setUint8(r,a[l.identifier],!0),r+=1,o.setUint8(r,255*l.force,!0),r+=1,o.setUint8(r,u.inRange?1:0,!0),r+=1}i.cloudRenderEngine.sendInputData(o.buffer)}this.inputOptions.fakeMouseWithTouches?(e.ontouchstart=function(n){if(void 0===t){var a=n.changedTouches[0];t={id:a.identifier,x:a.clientX-i.playerElementClientRect.left,y:a.clientY-i.playerElementClientRect.top},e.onmouseenter(n),i.emitMouseDown(le.MainButton,t.x,t.y)}n.preventDefault()},e.ontouchend=function(n){for(var a=0;a<n.changedTouches.length;a++){var o=n.changedTouches[a];if(o.identifier===t.id){var r=o.clientX-i.playerElementClientRect.left,s=o.clientY-i.playerElementClientRect.top;i.emitMouseUp(le.MainButton,r,s),e.onmouseleave(n),t=void 0;break}}n.preventDefault()},e.ontouchmove=function(e){for(var n=0;n<e.touches.length;n++){var a=e.touches[n];if(a.identifier===t.id){var o=a.clientX-i.playerElementClientRect.left,r=a.clientY-i.playerElementClientRect.top;i.emitMouseMove(o,r,o-t.x,r-t.y),t.x=o,t.y=r;break}}e.preventDefault()}):(e.ontouchstart=function(e){for(var t=0;t<e.changedTouches.length;t++)o(e.changedTouches[t]);i.print_inputs&&console.log("touch start"),r(se.TouchStart,e.changedTouches),e.preventDefault()},e.ontouchend=function(e){i.print_inputs&&console.log("touch end"),r(se.TouchEnd,e.changedTouches);for(var t=0;t<e.changedTouches.length;t++)o=e.changedTouches[t],n.push(a[o.identifier]),delete a[o.identifier];var o;e.preventDefault()},e.ontouchmove=function(e){i.print_inputs&&console.log("touch move"),r(se.TouchMove,e.touches),e.preventDefault()})}},{key:"callRespone",value:function(e){var t=e.uuid,i=e.classType;this.interactiveObjects.has(t)?this.interactiveObjects.get(t).dispatchEvent(e):"cloudrenderengine"===i.toLowerCase()?this.cloudRenderEngine.dispatchEvent(e):"scene"===i.toLowerCase()?this.scene&&this.scene.dispatchEvent(e):"camera"===i.toLowerCase()&&this.cloudRenderEngine.camera&&this.cloudRenderEngine.camera.dispatchEvent(e)}}])}(),xe=0,Se=new t,Ne=new i,we=new n,Ue=new t,Ce=new t,ke=new t,Te=new i,Oe=new t(1,0,0),Re=new t(0,1,0),Ee=new t(0,0,1),ze={type:"added"},Ie={type:"removed"},Me=function(){function e(){var l;U(this,e),(l=w(this,e)).isObject3D=!0,Object.defineProperty(l,"id",{value:xe++}),l.uuid=a.generateUUID(),l.name="",l.type="Object3D",l.parent=null,l.children=[],l.up=e.DEFAULT_UP.clone();var d=new t,c=new o,u=new i,h=new t(1,1,1);return c._onChange((function(){u.setFromEuler(c,!1)})),u._onChange((function(){c.setFromQuaternion(u,void 0,!1)})),Object.defineProperties(l,{position:{configurable:!0,enumerable:!0,value:d},rotation:{configurable:!0,enumerable:!0,value:c},quaternion:{configurable:!0,enumerable:!0,value:u},scale:{configurable:!0,enumerable:!0,value:h},modelViewMatrix:{value:new n},normalMatrix:{value:new r}}),l.matrix=new n,l.matrixWorld=new n,l.matrixAutoUpdate=e.DEFAULT_MATRIX_AUTO_UPDATE,l.matrixWorldNeedsUpdate=!1,l.matrixWorldAutoUpdate=e.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,l.layers=new s,l.visible=!0,l.castShadow=!1,l.receiveShadow=!1,l.frustumCulled=!0,l.renderOrder=0,l.animations=[],l.userData={},l}return z(e,ve),k(e,[{key:"onBeforeRender",value:function(){}},{key:"onAfterRender",value:function(){}},{key:"applyMatrix4",value:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}},{key:"applyQuaternion",value:function(e){return this.quaternion.premultiply(e),this}},{key:"setRotationFromAxisAngle",value:function(e,t){this.quaternion.setFromAxisAngle(e,t)}},{key:"setRotationFromEuler",value:function(e){this.quaternion.setFromEuler(e,!0)}},{key:"setRotationFromMatrix",value:function(e){this.quaternion.setFromRotationMatrix(e)}},{key:"setRotationFromQuaternion",value:function(e){this.quaternion.copy(e)}},{key:"rotateOnAxis",value:function(e,t){return Ne.setFromAxisAngle(e,t),this.quaternion.multiply(Ne),this}},{key:"rotateOnWorldAxis",value:function(e,t){return Ne.setFromAxisAngle(e,t),this.quaternion.premultiply(Ne),this}},{key:"rotateX",value:function(e){return this.rotateOnAxis(Oe,e)}},{key:"rotateY",value:function(e){return this.rotateOnAxis(Re,e)}},{key:"rotateZ",value:function(e){return this.rotateOnAxis(Ee,e)}},{key:"translateOnAxis",value:function(e,t){return Se.copy(e).applyQuaternion(this.quaternion),this.position.add(Se.multiplyScalar(t)),this}},{key:"translateX",value:function(e){return this.translateOnAxis(Oe,e)}},{key:"translateY",value:function(e){return this.translateOnAxis(Re,e)}},{key:"translateZ",value:function(e){return this.translateOnAxis(Ee,e)}},{key:"localToWorld",value:function(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}},{key:"worldToLocal",value:function(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(we.copy(this.matrixWorld).invert())}},{key:"lookAt",value:function(e,t,i){e.isVector3?Ue.copy(e):Ue.set(e,t,i);var n=this.parent;this.updateWorldMatrix(!0,!1),Ce.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?we.lookAt(Ce,Ue,this.up):we.lookAt(Ue,Ce,this.up),this.quaternion.setFromRotationMatrix(we),n&&(we.extractRotation(n.matrixWorld),Ne.setFromRotationMatrix(we),this.quaternion.premultiply(Ne.invert()))}},{key:"add",value:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(ze)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}},{key:"remove",value:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var i=this.children.indexOf(e);return-1!==i&&(e.parent=null,this.children.splice(i,1),e.dispatchEvent(Ie)),this}},{key:"removeFromParent",value:function(){var e=this.parent;return null!==e&&e.remove(this),this}},{key:"clear",value:function(){for(var e=0;e<this.children.length;e++){var t=this.children[e];t.parent=null,t.dispatchEvent(Ie)}return this.children.length=0,this}},{key:"attach",value:function(e){return this.updateWorldMatrix(!0,!1),we.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),we.multiply(e.parent.matrixWorld)),e.applyMatrix4(we),this.add(e),e.updateWorldMatrix(!1,!0),this}},{key:"getObjectById",value:function(e){return this.getObjectByProperty("id",e)}},{key:"getObjectByName",value:function(e){return this.getObjectByProperty("name",e)}},{key:"getObjectByProperty",value:function(e,t){if(this[e]===t)return this;for(var i=0,n=this.children.length;i<n;i++){var a=this.children[i].getObjectByProperty(e,t);if(void 0!==a)return a}}},{key:"getObjectsByProperty",value:function(e,t){var i=[];this[e]===t&&i.push(this);for(var n=0,a=this.children.length;n<a;n++){var o=this.children[n].getObjectsByProperty(e,t);o.length>0&&(i=i.concat(o))}return i}},{key:"getWorldPosition",value:function(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}},{key:"getWorldQuaternion",value:function(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ce,e,ke),e}},{key:"getWorldScale",value:function(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ce,Te,e),e}},{key:"getWorldDirection",value:function(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}},{key:"raycast",value:function(){}},{key:"traverse",value:function(e){e(this);for(var t=this.children,i=0,n=t.length;i<n;i++)t[i].traverse(e)}},{key:"traverseVisible",value:function(e){if(!1!==this.visible){e(this);for(var t=this.children,i=0,n=t.length;i<n;i++)t[i].traverseVisible(e)}}},{key:"traverseAncestors",value:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}},{key:"updateMatrix",value:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}},{key:"updateMatrixWorld",value:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,i=0,n=t.length;i<n;i++){var a=t[i];!0!==a.matrixWorldAutoUpdate&&!0!==e||a.updateMatrixWorld(e)}}},{key:"updateWorldMatrix",value:function(e,t){var i=this.parent;if(!0===e&&null!==i&&!0===i.matrixWorldAutoUpdate&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t)for(var n=this.children,a=0,o=n.length;a<o;a++){var r=n[a];!0===r.matrixWorldAutoUpdate&&r.updateWorldMatrix(!1,!0)}}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e,i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var n={};function a(t,i){return void 0===t[i.uuid]&&(t[i.uuid]=i.toJSON(e)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=a(e.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var r=o.shapes;if(Array.isArray(r))for(var s=0,l=r.length;s<l;s++){var d=r[s];a(e.shapes,d)}else a(e.shapes,r)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(a(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){for(var c=[],u=0,h=this.material.length;u<h;u++)c.push(a(e.materials,this.material[u]));n.material=c}else n.material=a(e.materials,this.material);if(this.children.length>0){n.children=[];for(var p=0;p<this.children.length;p++)n.children.push(this.children[p].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(var f=0;f<this.animations.length;f++){var m=this.animations[f];n.animations.push(a(e.animations,m))}}if(t){var g=U(e.geometries),y=U(e.materials),v=U(e.textures),b=U(e.images),x=U(e.shapes),S=U(e.skeletons),N=U(e.animations),w=U(e.nodes);g.length>0&&(i.geometries=g),y.length>0&&(i.materials=y),v.length>0&&(i.textures=v),b.length>0&&(i.images=b),x.length>0&&(i.shapes=x),S.length>0&&(i.skeletons=S),N.length>0&&(i.animations=N),w.length>0&&(i.nodes=w)}return i.object=n,i;function U(e){var t=[];for(var i in e){var n=e[i];delete n.metadata,t.push(n)}return t}}},{key:"clone",value:function(e){return(new this.constructor).copy(this,e)}},{key:"copy",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var i=0;i<e.children.length;i++){var n=e.children[i];this.add(n.clone())}return this}}])}();Me.DEFAULT_UP=new t(0,1,0),Me.DEFAULT_MATRIX_AUTO_UPDATE=!0,Me.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Ae=function(){function e(){var t;return U(this,e),(t=w(this,e)).isScene=!0,t.type="Scene",t.background=null,t.environment=null,t.fog=null,t.childrenSet=new Set,t.backgroundBlurriness=0,t.backgroundIntensity=1,t.overrideMaterial=null,t}return z(e,Me),k(e,[{key:"copy",value:function(t,i){return B(e,"copy",this)([t,i]),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}},{key:"toJSON",value:function(t){var i=B(e,"toJSON",this)([t]);return null!==this.fog&&(i.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(i.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(i.backgroundIntensity=this.backgroundIntensity),i}},{key:"autoUpdate",get:function(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate},set:function(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}])}(),Le=function(){function e(){var i;U(this,e),(i=w(this,e)).isCamera=!0,i.type="Camera",i.matrixWorldInverse=new n,i._level=0,i._levelChange=0,i.projectionMatrix=new n,i.projectionMatrixInverse=new n;var a=new t,o=-9999,r=-9999,s=-9999,l=-180,d=180,c=-89,u=0,h=-9999,p=-9999;return i.needsUpdate=!1,i.worldLocation=new t,i.sphereLocation=new t,i.constrainPolygon=[],Object.defineProperties(i,{minLocation:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a.x=e.x,a.y=e.y,a.z=e.z,i.needsUpdate=!0)}},maxLocationX:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,i.needsUpdate=!0)}},maxLocationY:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,i.needsUpdate=!0)}},maxLocationZ:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,i.needsUpdate=!0)}},minYaw:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){void 0!==e&&(l=e,i.needsUpdate=!0)}},maxYaw:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){void 0!==e&&(d=e,i.needsUpdate=!0)}},minPitch:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){void 0!==e&&(c=e,i.needsUpdate=!0)}},maxPitch:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){void 0!==e&&(u=e,i.needsUpdate=!0)}},minSpringArm:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){void 0!==e&&(h=e,i.needsUpdate=!0)}},maxSpringArm:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){void 0!==e&&(p=e,i.needsUpdate=!0)}},name:{configurable:!1,enumerable:!0,value:name}}),i}return z(e,Me),k(e,[{key:"level",get:function(){return this._level},set:function(e){var t=Math.floor(e);this._levelChange=this._level-t,this._level=t}},{key:"copy",value:function(t,i){return B(e,"copy",this)([t,i]),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}},{key:"getWorldDirection",value:function(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}},{key:"updateMatrixWorld",value:function(t){B(e,"updateMatrixWorld",this)([t]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"updateWorldMatrix",value:function(t,i){B(e,"updateWorldMatrix",this)([t,i]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"setConstrainPolygon",value:function(e){var t=this;e&&e.length>2&&(this.constrainPolygon=[],e.forEach((function(e,i){t.constrainPolygon.push({x:e[0],y:e[1]})})),this.constrainHeight=-1,this.needsUpdate=!0,this.constrainPolygonNeedsUpdate=!0)}},{key:"setConstrainShape",value:function(e,t){var i=this;t&&t.length>2&&(this.constrainPolygon=[],t.forEach((function(e,t){i.constrainPolygon.push({x:e[0],y:e[1],z:e[2]})})),this.constrainHeight=e,this.needsUpdate=!0,this.constrainShapeNeedsUpdate=!0)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"toJSON",value:function(){return{shape:this.constrainPolygon&&this.constrainPolygon.length?this.constrainPolygon:null,ConstrainHeight:void 0===this.constrainHeight?-1:this.constrainHeight,MaxLocationX:this.maxLocationX,MaxLocationY:this.maxLocationY,MaxLocationZ:this.maxLocationZ,MinYaw:this.minYaw,MaxYaw:this.maxYaw,MinPitch:this.minPitch,MaxPitch:this.maxPitch,MinSpringArm:this.minSpringArm,MaxSpringArm:this.maxSpringArm,type:this.type,name:this.name,uuid:this.uuid}}}])}(),Pe=function(e){return e.flat(1/0)},De=function(e){if(!Array.isArray(e))throw new Error("Input must be an array");return e.map((function(e){return parseInt(e,10)}))};function _e(e){if(!e)return[];var t=null;return t=e.features?e.features:Array.isArray(e)?e:[e],JSON.parse(JSON.stringify(t))}function Be(e){var t=[],i=null,n=null;return _e(e).forEach((function(e){var a,o;je(null==e||null===(a=e.geometry)||void 0===a?void 0:a.coordinates,2),i=g.flatten(null==e||null===(o=e.geometry)||void 0===o?void 0:o.coordinates),n=g(i.vertices,i.holes,i.dimensions);var r=function(e){for(var t=1/0,i=1/0,n=-1/0,a=-1/0,o=[],r=0;r<e.length/3;r++){var s=e[3*r],l=e[3*r+1];t>s&&(t=s),i>l&&(i=l),n<s&&(n=s),a<l&&(a=l)}for(var d=1/(n-t),c=1/(a-i),u=0;u<e.length/3;u++){var h=d*(e[3*u]-t),p=c*(e[3*u+1]-i);o.push({x:h,y:p})}return o}(i.vertices);t.push({vertices:i.vertices,triangles:n,uvs:r})})),t}function Fe(e,t){var i=_e(e);return i.forEach((function(e){var i,n=null==e||null===(i=e.geometry)||void 0===i?void 0:i.coordinates;je(n,1),e.geometry.coordinates=Pe(n),t&&(e.geometry.coordinates.push(e.geometry.coordinates[0]),e.geometry.coordinates.push(e.geometry.coordinates[1]),e.geometry.coordinates.push(e.geometry.coordinates[2]))})),i}function We(e){var t=_e(e);return t.forEach((function(e){var t,i=null==e||null===(t=e.geometry)||void 0===t?void 0:t.coordinates;!function(e){e.type||(e.type="Feature");var t=e.geometry.type,i={Point:0,MultiPoint:1,LineString:1,MultiLineString:2,Polygon:2,MultiPolygon:3};Object.keys(i).includes(t)&&je(e.geometry.coordinates,i[t])}(e),e.geometry.coordinates=Pe(i)})),t}var je=function(e,t){if(e)if(0===t)e[2]||(e[2]=0);else{var i,n=T(e);try{for(n.s();!(i=n.n()).done;){var a=i.value;je(a,t-1)}}catch(e){n.e(e)}finally{n.f()}}};var He=new l;function Ge(e,t){He.load(e,(function(e){var i=new FileReader;i.readAsDataURL(e),i.onloadend=function(e){t(e.target.result)}}),null,(function(e){t(!1)}))}function Ve(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/png";return e.toDataURL(t)}function Je(e){return-1!==e.indexOf("data:")&&-1!==e.indexOf("base64")}function Ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"https://mapdata.bj.bcebos.com",i=new Image;return i.crossOrigin="Anonymous",i.src=t+e,new Promise((function(e,t){i.addEventListener("load",(function(){e(i)})),i.onerror=function(e){t(e)}}))}function qe(e,t,i,n,a,o){e.beginPath(),e.moveTo(t+o,i),e.lineTo(t+n-o,i),e.quadraticCurveTo(t+n,i,t+n,i+o),e.lineTo(t+n,i+a-o),e.quadraticCurveTo(t+n,i+a,t+n-o,i+a),e.lineTo(t+o,i+a),e.quadraticCurveTo(t,i+a,t,i+a-o),e.lineTo(t,i+o),e.quadraticCurveTo(t,i,t+o,i),e.closePath()}function Xe(e,t,i,n){var a,o=i.xScale,r=_(n,2),s=r[0],l=r[1],d=t.text,c=t.fontSize,u=t.fontFamily,h=t.color,p=t.textAlign,f=t.icon;if(d||"number"==typeof d||f)if(d&&f)console.warn("BasicLabel Warning:text和icon不要同时设置");else{if(a=d,e.font="".concat(c*o,"px ").concat(u),e.fillStyle=h,e.textAlign=p||"left",e.textBaseline="top",f){var m=f;-1!==f.indexOf("&amp;")&&(m=f.replace("&amp;","&")),-1!==f.indexOf("&amp")&&(m=f.replace("&amp","&")),a=new Function('return ("'+"".concat(m).replace("&#x","\\u").replace(";","")+'")')()}e.measureText(a).width,e.fillText(a,s,l)}}function Ke(e,t){return Qe.apply(this,arguments)}function Qe(){return(Qe=N(P().mark((function e(t,i){var n,o,r,s,l,d,c,u,h,p,f,m,g,y,v,b,x;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.height,o=t.width,r=t.backgroundImage,s=t.borderRadius,l=t.borderColor,d=t.borderWidth,c=t.backgroundColor,u=o,h=n,p=document.createElement("canvas"),f=p.getContext("2d"),m=a.ceilPowerOfTwo(u),g={width:m,height:m*(h/u),factor:{xScale:m/u,yScale:m/u}},p.width=g.width,p.height=g.height,y=g.factor,v=y.xScale,b=y.yScale,!r){e.next=17;break}return e.next=13,Ye(r,"");case 13:x=e.sent,f.drawImage(x,0,0,u*v,h*b),e.next=18;break;case 17:(l||c)&&(f.strokeStyle=l,f.fillStyle=c,f.lineWidth=d?d*v:1*v,qe(f,f.lineWidth*v,f.lineWidth*b,(u-2*f.lineWidth)*v,(h-2*f.lineWidth)*b,s?s*v:0),c&&f.fill(),l&&f.stroke());case 18:return i&&Ze(f,g,i),e.abrupt("return",p);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ze(e,t,i){return $e.apply(this,arguments)}function $e(){return $e=N(P().mark((function e(t,i,n){var a,o,r,s,l,d,c,u,h,p,f,m,g,y,v,b,x,S,N,w,U,C,k,T,O,R,E,z,I,M,A,L,D,B,F,W,j,H,G;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=i.paddingTop,o=i.paddingLeft,r=i.width,i.height,s=0,l=0,d=0,c=0,u=i.factor,h=u.xScale,p=u.yScale,g=[f=o?o*h:0,m=a?a*p:0],y=Object.keys(n),v=0;case 11:if(!(v<y.length)){e.next=41;break}if(b=n[y[v]],x=b.width,S=b.height,N=b.text,w=b.marginRight,U=b.marginBottom,C=b.backgroundImage,k=b.borderRadius,T=b.borderColor,O=b.borderWidth,R=b.backgroundColor,E=b.position,b.id,E&&(z=_(E,2),I=z[0],M=z[1],g[0]=f+I*h,g[1]=m+M*p,s=0,l=0,d=0,c=0),!x||!S){e.next=37;break}if(g[0]+x*h>r&&((d+=s)+S*p<=l?(g[0]=c,g[1]+=s):(g[0]=o?o*h:0,g[1]+=s,l=0,c=0)),!C){e.next=30;break}return e.prev=18,e.next=21,Ye(C,"");case 21:A=e.sent,t.drawImage(A,g[0],g[1],x*h,S*p),e.next=28;break;case 25:e.prev=25,e.t0=e.catch(18),console.log(e.t0);case 28:e.next=31;break;case 30:R&&(t.strokeStyle=T,t.fillStyle=R,t.lineWidth=O?O*h:1*h,qe(b,g[0]+b.lineWidth*h,g[1]+b.lineWidth*h,(x-2*b.lineWidth)*h,(S-2*b.lineWidth)*p,k?k*h:0),R&&t.fill(),T&&t.stroke());case 31:N&&(L=_(E,2),D=L[0],B=L[1],F=[g[0]+D*h,g[1]+B*p],Xe(t,b,i.factor,F)),g[0]+=(x+(w||0))*h,(s=(S+(U||0))*p)>l&&(l=s,c=g[0]),e.next=38;break;case 37:N&&(W=_(E,2),j=W[0],H=W[1],G=[g[0]+j*h,g[1]+H*p],Xe(t,b,i.factor,G));case 38:v++,e.next=11;break;case 41:case"end":return e.stop()}}),e,null,[[18,25]])}))),$e.apply(this,arguments)}function et(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return!1;var i=document.createElement("canvas"),n=i.getContext("2d"),a=t.scale||1,o=t.fontSize||18,r=t.fontface||"Arial",s=t.borderThickness||0,l=t.backgroundColor||{r:0,g:0,b:0,a:1},d=t.borderColor||{r:0,g:0,b:0,a:1},c=t.strokeStyle||{r:255,g:0,b:0,a:1},u=t.textColor||{r:255,g:0,b:0,a:1};n.font="Bold "+o*a+"px "+r;var h=n.measureText(e).width*a,p=h+2*s*a,f=o*a*1.4+2*s*a;i.width=t.width||p,i.height=t.height||f,n.font="Bold "+o*a+"px "+r;var m=l.r,g=l.g,y=l.b,v=l.a;if(n.fillStyle="rgba("+m+","+g+","+y+","+v+")",n.fillRect(0,0,i.width,i.height),t.drawRoundRect){var b=d.r,x=d.g,S=d.b,N=d.a;n.strokeStyle="rgba("+b+","+x+","+S+","+N+")",n.lineWidth=s*a,qe(n,s/2,s/2,h+s+10*a,o*a*1.4+s,6)}if(n.fill(),n.stroke(),t.drawStrokeStyle){var w=c.r,U=c.g,C=c.b,k=c.a;n.strokeStyle="rgba("+w+","+U+","+C+","+k+")",n.strokeText(e,(s+5)*a+.5*(i.width-p),.5*(i.height-f)+(o+s)*a)}var T=u.r,O=u.g,R=u.b,E=u.a;return n.fillStyle="rgba("+T+","+O+","+R+","+E+")",n.fillText(e,(s+5)*a+.5*(i.width-p),.5*(i.height-f)+(o+s)*a),i}He.setResponseType("blob");var tt=function(){function e(){var n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),n=w(this,e,[r]);var s=r.name,l=new d(1,1,1);r.color&&(l.r=a.clamp(r.color.r,0,1),l.g=a.clamp(r.color.g,0,1),l.b=a.clamp(r.color.b,0,1));var c=new d(1,1,1);r.color2?(c.r=a.clamp(r.color2.r,0,1),c.g=a.clamp(r.color2.g,0,1),c.b=a.clamp(r.color2.b,0,1)):(c.r=l.r,c.g=l.g,c.b=l.b);var u=void 0===r.size?10:r.size,h=void 0===r.sizeAttenuation||r.sizeAttenuation,p=void 0===r.gardientDirection?1:r.gardientDirection,f=void 0===r.brightness?0:r.brightness,m=void 0===r.scroll?0:r.scroll,g=n.childIndex=-1,y=void 0===r.speed?.2:r.speed,v=void 0===r.roughness?1:r.roughness,b=void 0===r.metallic?0:r.metallic;n.map=r.map||null;var x=void 0===r.opacity?1:r.opacity,S=void 0===r.uvRotateSpeed?0:r.uvRotateSpeed,N=void 0===r.WPOScaleAnimateSpeed?0:r.WPOScaleAnimateSpeed,C=void 0===r.WPOMinAnimateScale?1:r.WPOMinAnimateScale,k=void 0===r.WPOMaxAnimateScale?2:r.WPOMaxAnimateScale,T=new d(1,1,1);r.brightnessColor&&(T.r=a.clamp(r.brightnessColor.r,0,1),T.g=a.clamp(r.brightnessColor.g,0,1),T.b=a.clamp(r.brightnessColor.b,0,1));var O=r.position||new t,R=new o;r.rotation&&(R.x=a.clamp(r.rotation.x,-180,180),R.y=a.clamp(r.rotation.y,-180,180),R.z=a.clamp(r.rotation.z,-180,180));var E=new i,z=new t(1,1,1);r.scale&&(z.x=r.scale.x,z.y=r.scale.y,z.z=r.scale.z);var I=new t(0,0,0);return r.offset&&(I.x=r.offset.x,I.y=r.offset.y,I.z=r.offset.z),n.isInstance=r.isInstance||!1,n.transparent=r.transparent||x<1,n.depthTest=!("depthTest"in r)||r.depthTest,n.renderNum=void 0===r.renderNum?20:r.renderNum,n._visible=void 0===r.visible||r.visible,R._onChange((function(){E.setFromEuler(R,!1),this.matrixNeedsUpdate=!0})),E._onChange((function(){R.setFromQuaternion(E,void 0,!1),this.matrixNeedsUpdate=!0})),Object.defineProperties(n,{position:{configurable:!0,enumerable:!0,get:function(){return O},set:function(e){e&&(O.x=e.x,O.y=e.y,O.z=e.z,n.matrixNeedsUpdate=!0)}},childIndex:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){e!==g&&(g=e)}},rotation:{configurable:!0,enumerable:!0,get:function(){return R},set:function(e){e&&(R.x=a.clamp(e.x,-180,180),R.y=a.clamp(e.y,-180,180),R.z=a.clamp(e.z,-180,180),n.matrixNeedsUpdate=!0)}},quaternion:{writable:!0,configurable:!0,value:E,enumerable:!0},scale:{configurable:!0,enumerable:!0,get:function(){return z},set:function(e){e&&(z.x=e.x,z.y=e.y,z.z=e.z,n.matrixNeedsUpdate=!0)}},offset:{configurable:!0,enumerable:!0,get:function(){return I},set:function(e){e&&(I.x=e.x,I.y=e.y,I.z=e.z,n.matrixNeedsUpdate=!0)}},color:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l.r=e.r,l.g=e.g,l.b=e.b,e.a&&(x=e.a),n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},color2:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c.r=e.r,c.g=e.g,c.b=e.b,e.a&&(x=e.a),n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},gardientDirection:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){void 0!==e&&(p=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},scroll:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){void 0!==e&&(m=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},uvRotateSpeed:{configurable:!0,enumerable:!0,get:function(){return S},set:function(e){void 0!==e&&(S=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},WPOMaxAnimateScale:{configurable:!0,enumerable:!0,get:function(){return k},set:function(e){void 0!==e&&(k=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},WPOMinAnimateScale:{configurable:!0,enumerable:!0,get:function(){return C},set:function(e){void 0!==e&&(C=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},WPOScaleAnimateSpeed:{configurable:!0,enumerable:!0,get:function(){return N},set:function(e){void 0!==e&&(N=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},speed:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){void 0!==e&&(y=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},brightness:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){void 0!==e&&(f=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},roughness:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){v=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0}},metallic:{configurable:!0,enumerable:!0,get:function(){return b},set:function(e){b=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0}},opacity:{configurable:!0,enumerable:!0,get:function(){return x},set:function(e){n.transparent=e<1,x=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0}},brightnessColor:{configurable:!0,enumerable:!0,get:function(){return T},set:function(e){e&&(T.copy(e),n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},_layerName:{configurable:!1,enumerable:!1,value:"CommonGISLayer",writable:!0},_cloudControlType:{configurable:!1,enumerable:!1,value:"Gis",writable:!0},type:{configurable:!1,enumerable:!0,value:"Shape",writable:!0},name:{configurable:!1,enumerable:!0,value:s,writable:!0},size:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){void 0!==e&&(u=e,n.overtimeInstanceIndex=[],n.materialNeedsUpdate=!0)}},sizeAttenuation:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){void 0!==e&&(h=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}}}),r.data&&n.setData(r.data),n.matrixNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.visibleNeedsUpdate=!1,n.animateNeedsUpdate=!1,n}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),this.visibleNeedsUpdate=!0,this._visible=e&&!0}},{key:"map",get:function(){return this._map},set:function(e){var t=this;e&&(this._map=e,Je(e)?(this.texture=e,this.overtimeInstanceIndex=[],this.data=[],this.materialNeedsUpdate=!0):Ge(e,(function(e){e&&(t.texture=e,t.overtimeInstanceIndex=[],t.data=[],t.materialNeedsUpdate=!0)})))}},{key:"animate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.to)return!1;var t=e.from,i=void 0===t?{}:t,n=e.to,a=void 0===n?{}:n,o=e.duration,r=void 0===o?3e3:o,s=e.easing,l=void 0===s?"Linear":s,d=e.loop,c=void 0!==d&&d,u=e.yoyo,h=void 0!==u&&u,p=e.stayEnd,f=void 0===p||p;i.position||delete i.position,i.rotation||delete i.rotation,i.scale||delete i.scale,a.position||delete a.position,a.rotation||delete a.rotation,a.scale||delete a.scale,a.animateOffset||delete a.animateOffset,this.animateNeedsUpdate=!0,this.animateJson={Status:"play",From:i,To:a,Duration:r,Easing:l,Loop:c,Yoyo:h,StayEnd:f};var m=new y.Tween({ratio:0}).to({ratio:1},e.duration||3e3).start();return c&&m.repeat(1/0),this.tween=null,this.tween=m,this.tween}},{key:"stopAnimate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;this.animateNeedsUpdate=!0,this.animateJson={Status:"stop",DelayTime:e},this.tween&&this.tween.stop(),this.tween=null}},{key:"setData",value:function(e){var t=_e(e);if(t.length<1)return!1;var i=t[0].geometry.type.toLowerCase();if(this.isInstance&&["point","multipoint"].indexOf(i)<0)return!1;var n={};switch(i){case"point":case"multipoint":n=We(t);break;case"linestring":case"multilinestring":n=Fe(t);break;case"polygon":case"multipolygon":n=Be(t)}if(this.isInstance){var a=function(e,t){if(!e||e.length<1)return{data:t,datas:t,overtimeInstanceIndex:[]};for(var i=[],n=[],a=[],o=[],r=0;r<e.length;r++){for(var s,l=e[r],d=l.geometry,c=l.properties,u=void 0===c?{}:c,h=d.coordinates,p=u.rotation,f=void 0===p?{x:0,y:0,z:0}:p,m=u.scale,g=void 0===m?{x:1,y:1,z:1}:m,y=!1,v=function(){var e=t[b],n=e.geometry,a=e.properties,r=void 0===a?{}:a,s=n.coordinates,l=r.rotation,d=void 0===l?{x:0,y:0,z:0}:l,c=r.scale,u=void 0===c?{x:1,y:1,z:1}:c;return h.length===s.length&&h.every((function(e,t){return e===s[t]}))?f.x!==d.x||f.y!==d.y||f.z!==d.z||g.x!==u.x||g.y!==u.y||g.z!==u.z||i.indexOf(b)>-1?0:(i.push(b),y=!0,o.push(t[b]),1):0},b=0;b<t.length&&(0===(s=v())||1!==s);b++);y||n.push(r)}for(var x=0;x<t.length;x++)i.indexOf(x)<0&&(a.push(t[x]),o.push(t[x]));return{data:a,overtimeInstanceIndex:n,datas:o}}(this.datas,n),o=a.data,r=a.overtimeInstanceIndex,s=a.datas;(o.length>0||r.length>0)&&(this.datas=s,this.data=o,this.overtimeInstanceIndex=r,this.materialNeedsUpdate=!0)}else this.data=n}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this.visibleNeedsUpdate||!e||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,DepthTest:this.depthTest,Scroll:this.scroll,Speed:this.speed,Texture:this.texture,GardientDirection:this.gardientDirection,RotateSpeed:this.uvRotateSpeed,ScaleAnimateSpeed:this.WPOScaleAnimateSpeed,MinAnimateScale:this.WPOMinAnimateScale,MaxAnimateScale:this.WPOMaxAnimateScale,Color2:{r:this.color2.r,g:this.color2.g,b:this.color2.b,a:this.opacity},BrightnessColor:this.brightnessColor?{r:this.brightnessColor.r,g:this.brightnessColor.g,b:this.brightnessColor.b,a:1}:d,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:!this.isInstance&&this.animateNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid,jsondata:!e||this.isInstance?this.data:null,AnimateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation,RenderNum:this.renderNum,ChildIndex:this.isInstance?-1:this.childIndex,IsInstance:this.isInstance,OvertimeInstanceIndex:this.overtimeInstanceIndex}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid,ChildIndex:this.childIndex}}},{key:"dispose",value:function(){this.traverse((function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose(),e.texture=null})),this.data=null,this.datas=null,this.texture=null}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.color.copy(t.color),this.brightness=t.brightness,this.metallic=t.metallic,this.roughness=t.roughness,this.opacity=t.opacity,this.transparent=t.transparent,this.texture=t.texture,this.brightnessColor.copy(t.brightnessColor),this.offset.copy(t.offset),B(e,"copy",this)([t,i]),this}}])}();var it=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="Polygon";var n=i.fillStyle||"Empty",a=void 0===i.speedX?.25:i.speedX,o=void 0===i.speedY?.25:i.speedY,r=void 0===i.rotateAngle?0:i.rotateAngle,s=void 0===i.tile?.5:i.tile;return Object.defineProperties(t,{fillStyle:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e,t.materialNeedsUpdate=!0)}},rotateAngle:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,t.materialNeedsUpdate=!0)}},tile:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,t.materialNeedsUpdate=!0)}},speedX:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,t.materialNeedsUpdate=!0)}},speedY:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,t.materialNeedsUpdate=!0)}}}),t}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=Be(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,FillStyle:this.fillStyle,SpeedX:this.speedX,SpeedY:this.speedY,RotateAngle:this.rotateAngle,Tile:this.tile,Transparent:this.transparent,Texture:this.texture,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}();function nt(e,t){var i=e[0],n=e[1],a=t[0],o=t[1];return Math.sqrt((i-a)*(i-a)+(n-o)*(n-o))}function at(e,t,i){var n=Math.abs(nt(e,t)),a=Math.abs(nt(e,i)),o=Math.abs(nt(t,i)),r=(n+a+o)/2;return 2*Math.sqrt(Math.abs(r*(r-n)*(r-a)*(r-o)))/n}function ot(e,t,i,n,a){if(i<n){for(var o=0,r=0,s=e[i],l=e[n],d=i+1;d<n;d++){var c=at(s,l,e[d]);c>o&&(o=c,r=d)}o>=a&&(t.push(e[r]),ot(e,t,i,r,a),ot(e,t,r,n,a))}return t}function rt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(!(e&&e.length>2))return null;e.forEach((function(e,t){e.id=t}));var n=ot(e,[],0,e.length-i,t);n.push(e[0]),n.push(e[e.length-1]);var a=n.sort((function(e,t){return e.id<t.id?-1:e.id>t.id?1:0}));return a.forEach((function(e){e.id=0})),a}var st=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="Line";var n=i.style||te.SOLID,a=i.splineType||ne.LINEAR,o=i.direction||ie.CENTER,r=i.width||4,s=i.tilling||5,l=i.speed||1,d=void 0!==i.openStroke&&i.openStroke,c=i.strokeColor||null,u=i.strokeWidth||1;t.isDilution=i.isDilution||!1,t.interval=i.interval||1e-5,t.visible=void 0===i.visible||i.visible,t.collision=void 0!==i.collision&&i.collision;var h={enable:!1,speedX:1,speedY:0,uvRotation:0,u:0,v:0};return i.lineUVOption&&(h.enable=void 0!==i.lineUVOption.enable&&i.lineUVOption.enable,h.speedX=void 0===i.lineUVOption.speedX?1:i.lineUVOption.speedX,h.speedY=void 0===i.lineUVOption.speedY?0:i.lineUVOption.speedY,h.uvRotation=void 0===i.lineUVOption.uvRotation?0:i.lineUVOption.uvRotation,h.u=void 0===i.lineUVOption.u?0:i.lineUVOption.u,h.v=void 0===i.lineUVOption.v?0:i.lineUVOption.v),t.renderType=void 0===i.renderType?0:i.renderType,t.section_Length=void 0===i.section_Length?100:i.section_Length,Object.defineProperties(t,{style:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e,t.materialNeedsUpdate=!0)}},lineUVOption:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){e&&(h.enable=void 0!==e.enable&&e.enable,h.speedX=void 0===e.speedX?1:e.speedX,h.speedY=void 0===e.speedY?0:e.speedY,h.uvRotation=void 0===e.uvRotation?0:e.uvRotation,h.u=void 0===e.u?0:e.u,h.v=void 0===e.v?0:e.v,t.materialNeedsUpdate=!0)}},splineType:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,t.materialNeedsUpdate=!0)}},direction:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,t.materialNeedsUpdate=!0)}},width:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,t.materialNeedsUpdate=!0)}},tilling:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,t.materialNeedsUpdate=!0)}},speed:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e,t.materialNeedsUpdate=!0)}},openStroke:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d=e,t.materialNeedsUpdate=!0)}},strokeColor:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c.r=e.r,c.g=e.g,c.b=e.b,c.a=e.a?e.a:1,t.materialNeedsUpdate=!0)}},strokeWidth:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u=e,t.materialNeedsUpdate=!0)}}}),t}return z(e,tt),k(e,[{key:"setData",value:function(e){var t=this;if(this.isDilution){var i=_e(e);i.forEach((function(e,i){var n=e.geometry.coordinates,a=n.length,o=1,r=_(n[0],3),s=r[0],l=r[1],d=r[2],c=_(n[a-1],3),u=c[0],h=c[1],p=c[2];s===u&&l===h&&d===p&&(o=2),e.geometry.coordinates=rt(n,t.interval,o)})),(e={}).features=i}this.data=Fe(e)}},{key:"updataLineColor",value:function(e){Array.isArray(e)&&e.length===this.data.length&&(this.colordata=e,this.materialNeedsUpdate=!0)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Collision:this.collision,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,jsondata:e?null:this.data,Style:this.style,Spline_Type:this.splineType,MeshDirection:this.direction,RenderType:this.renderType,Section_Length:this.section_Length,Width:this.width,Tilling:this.tilling,Speed:this.speed,Open_Stroke:this.openStroke,Stroke_Color:this.strokeColor?{r:this.strokeColor.r,g:this.strokeColor.g,b:this.strokeColor.b,a:1}:null,Stroke_Width:this.strokeWidth,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,LineUVOption:this.lineUVOption,colordata:this.colordata}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.style=t.style,this.splineType=t.splineType,this.direction=t.direction,this.width=t.width,this.tilling=t.tilling,this.speed=t.speed,this.openStroke=t.openStroke,this.strokeColor=t.strokeColor,this.strokeWidth=t.strokeWidth,B(e,"copy",this)([t,i]),this}}])}(),lt=function(){function e(){var i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),i=w(this,e,[n]);var a=n.size||4;return i.type="Point",Object.defineProperties(i,{size:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){(a=Number(e))&&(i.scale=new t(a,a,a),i.matrixNeedsUpdate=!0)}}}),i}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=We(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Size:this.size,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.size=t.size,B(e,"copy",this)([t,i]),this}}])}(),dt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Cube",i}return z(e,tt),k(e)}(),ct=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="MeasureArea";var n=void 0===i.textDisplay||i.textDisplay,a=i.textColor||new d(1,0,0),o=i.fontSize||18,r=i.textBorderColor||new d(1,0,0),s=i.textBorderWidth||1;return Object.defineProperties(t,{textDisplay:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e)}},fontSize:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e)}},textColor:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a.r=e.r,a.g=e.g,a.b=e.b)}},textBorderWidth:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e)}},textBorderColor:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r.r=e.r,r.g=e.g,r.b=e.b)}}}),t}return z(e,tt),k(e,[{key:"updateParameters",value:function(e){for(var t in e)this[t]!==e[t]&&(this[t]=e[t])}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,FontSize:this.fontSize,TextDisplay:this.textDisplay,TextColor:{r:this.textColor.r,g:this.textColor.g,b:this.textColor.b,a:1},TextBorderColor:{r:this.textBorderColor.r,g:this.textBorderColor.g,b:this.textBorderColor.b,a:1},TextBorderWidth:this.textBorderWidth,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontSize=t.fontSize,this.textDisplay=t.textDisplay,this.textColor=t.textColor,this.textBorderColor=t.textBorderColor,this.textBorderWidth=t.textBorderWidth,B(e,"copy",this)([t,i]),this}}])}(),ut=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="MeasureLine";var n=i.style||te.SOLID,a=i.splineType||ne.LINEAR,o=i.direction||ie.CENTER,r=i.width||4,s=i.tilling||300,l=i.speed||1,c=void 0!==i.openStroke&&i.openStroke,u=i.strokeColor||null,h=i.strokeWidth||1,p=void 0===i.textDisplay||i.textDisplay,f=i.textColor||new d(1,0,0),m=i.fontSize||18,g=i.textBorderColor||new d(1,0,0),y=i.textBorderWidth||1;return Object.defineProperties(t,{style:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e)}},splineType:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}},direction:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e)}},width:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e)}},tilling:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e)}},speed:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e)}},openStroke:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c=e)}},strokeColor:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u.r=e.r,u.g=e.g,u.b=e.b,u.a=e.a?e.a:1)}},strokeWidth:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){e&&(h=e)}},textDisplay:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){e&&(p=e)}},fontSize:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){e&&(m=e)}},textColor:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){e&&(f.r=e.r,f.g=e.g,f.b=e.b)}},textBorderWidth:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){e&&(y=e)}},textBorderColor:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){e&&(g.r=e.r,g.g=e.g,g.b=e.b)}}}),t}return z(e,tt),k(e,[{key:"updateParameters",value:function(e){for(var t in e)this[t]!==e[t]&&(this[t]=e[t])}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,jsondata:e?null:this.data,Style:this.style,Spline_Type:this.splineType,MeshDirection:this.direction,Width:this.width,Tilling:this.tilling,Speed:this.speed,Open_Stroke:this.openStroke,Stroke_Color:this.strokeColor?{r:this.strokeColor.r,g:this.strokeColor.g,b:this.strokeColor.b,a:1}:null,Stroke_Width:this.strokeWidth,FontSize:this.fontSize,TextColor:{r:this.textColor.r,g:this.textColor.g,b:this.textColor.b,a:1},TextDisplay:this.textDisplay,TextBorderColor:{r:this.textBorderColor.r,g:this.textBorderColor.g,b:this.textBorderColor.b,a:1},TextBorderWidth:this.textBorderWidth}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.style=t.style,this.splineType=t.splineType,this.direction=t.direction,this.width=t.width,this.tilling=t.tilling,this.speed=t.speed,this.openStroke=t.openStroke,this.strokeColor=t.strokeColor,this.strokeWidth=t.strokeWidth,this.fontSize=t.fontSize,this.textColor=t.textColor,this.textDisplay=t.textDisplay,this.textBorderColor=t.textBorderColor,this.textBorderWidth=t.textBorderWidth,B(e,"copy",this)([t,i]),this}}])}(),ht=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="SurfaceLine";var n=i.rayDistance||100,a=i.width||4,o=i.rayDetectionDistance||500,r=i.textColor||new d(1,0,0),s=i.fontSize||18,l=i.linePixel||1024;return Object.defineProperties(t,{width:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}},rayDistance:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e!==n&&(n=e)}},rayDetectionDistance:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e!==o&&(o=e)}},linePixel:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e!==l&&(l=e)}},fontSize:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e)}},textColor:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r.r=e.r,r.g=e.g,r.b=e.b)}}}),t}return z(e,tt),k(e,[{key:"updateParameters",value:function(e){for(var t in e)this[t]!==e[t]&&(this[t]=e[t])}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,jsondata:e?null:this.data,Style:"solid",Spline_Type:"Curve",MeshDirection:"Ground_Center",Width:this.width,FontSize:this.fontSize,TextColor:{r:this.textColor.r,g:this.textColor.g,b:this.textColor.b,a:1},LinePixel:this.linePixel}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.style="solid",this.splineType="Curve",this.direction="Ground_Center",this.width=t.width,this.fontSize=t.fontSize,this.textColor=t.textColor,this.textDisplay=t.textDisplay,this.textBorderColor=t.textBorderColor,this.textBorderWidth=t.textBorderWidth,B(e,"copy",this)([t,i]),this}}])}(),pt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="LocationPoint",t.EPSG=i.EPSG||"epsg:4326";var n=i.textColor||new d(1,0,0),a=i.fontSize||18,o=i.textBorderColor||new d(1,0,0),r=i.textBorderWidth||1;return Object.defineProperties(t,{fontSize:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}},textColor:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n.r=e.r,n.g=e.g,n.b=e.b)}},textBorderWidth:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e)}},textBorderColor:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o.r=e.r,o.g=e.g,o.b=e.b)}}}),t}return z(e,tt),k(e,[{key:"updateParameters",value:function(e){for(var t in e)this[t]!==e[t]&&(this[t]=e[t])}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,FontSize:this.fontSize,TextColor:{r:this.textColor.r,g:this.textColor.g,b:this.textColor.b,a:1},EPSG:this.EPSG,TextBorderColor:{r:this.textBorderColor.r,g:this.textBorderColor.g,b:this.textBorderColor.b,a:1},TextBorderWidth:this.textBorderWidth,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontSize=t.fontSize,this.textColor=t.textColor,this.textBorderColor=t.textBorderColor,this.EPSG=t.EPSG,this.textBorderWidth=t.textBorderWidth,B(e,"copy",this)([t,i]),this}}])}();var ft=v.create();ft.interceptors.request.use((function(e){var t=localStorage.getItem("authToken");return t&&(e.headers.Authorization="Bearer ".concat(t)),e}),(function(e){return Promise.reject(e)})),ft.interceptors.response.use((function(e){return e}),(function(e){return e.response&&401===e.response.status&&localStorage.removeItem("authToken"),Promise.reject(e)}));var mt=function(){return k((function e(){U(this,e)}),null,[{key:"username",get:function(){return this._username},set:function(e){this._username=e,this._SaveToken()}},{key:"password",get:function(){return this._password},set:function(e){this._password=e,this._SaveToken()}},{key:"_SaveToken",value:function(){localStorage.setItem("authToken",btoa("".concat(this._username,":").concat(this._password)))}}])}();O(mt,"host",""),O(mt,"tag",""),O(mt,"_username","admin"),O(mt,"_password","admin"),O(mt,"_currentProject",void 0),mt.GetProjectCommon=N(P().mark((function e(){var t;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!mt.host){e.next=5;break}return e.next=3,ft.get("".concat(mt.host,"/api/configs/projects/common"));case 3:return t=e.sent,e.abrupt("return",t);case 5:console.error("请先设置Host地址");case 6:case"end":return e.stop()}}),e)}))),mt.getProjectCommon=mt.GetProjectCommon,mt.GetProjectByNodeId=function(){var e=N(P().mark((function e(t){var i;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!mt.host){e.next=5;break}return e.next=3,ft.get("".concat(mt.host,"/api/configs/projects/").concat(t));case 3:return i=e.sent,e.abrupt("return",i);case 5:console.error("请先设置Host地址");case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),mt.getProjectByNodeId=mt.GetProjectByNodeId,mt.GetAllCapacity=N(P().mark((function e(){var t;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!mt.host){e.next=5;break}return e.next=3,ft.get("".concat(mt.host,"/api/nodes/capacity"));case 3:return t=e.sent,e.abrupt("return",t.data.data[""===mt.tag?"all":mt.tag]);case 5:case"end":return e.stop()}}),e)}))),mt.getAllCapacity=mt.GetAllCapacity,mt.GetAllCapacityInfo=N(P().mark((function e(){var t;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!mt.host){e.next=5;break}return e.next=3,ft.get("".concat(mt.host,"/api/nodes/capacity"));case 3:return t=e.sent,e.abrupt("return",t.data.data);case 5:case"end":return e.stop()}}),e)}))),mt.getAllCapacityInfo=mt.GetAllCapacityInfo,mt.GetAllNodes=N(P().mark((function e(){var t;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!mt.host){e.next=5;break}return e.next=3,ft.get("".concat(mt.host,"/api/nodes/all"));case 3:return t=e.sent,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)}))),mt.getAllNodes=mt.GetAllNodes,mt.GetAliveNodes=N(P().mark((function e(){var t;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!mt.host){e.next=5;break}return e.next=3,ft.get("".concat(mt.host,"/api/nodes/list"));case 3:return t=e.sent,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)}))),mt.getAliveNodes=mt.GetAliveNodes,mt.CreateTask=function(){var e=N(P().mark((function e(t){var i,n;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=mt.tag||"",e.next=3,ft.post("".concat(mt.host,"/api/tasks/create"),{project:t,tag:"all"===i?"":i});case 3:return n=e.sent,mt._currentProject=n.data,e.abrupt("return",n.data);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),mt.createTask=mt.CreateTask,mt.KillTask=function(){var e=N(P().mark((function e(t){var i;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!mt.host){e.next=6;break}return e.next=3,ft.post("".concat(mt.host,"/api/tasks/kill/").concat(t));case 3:return i=e.sent,mt._currentProject=null,e.abrupt("return",i);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),mt.killTask=mt.KillTask,mt._SaveToken(),"undefined"==typeof ue&&(window.ue={});var gt=window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.requestAnimationFrame,yt=function(){function e(t){var i;U(this,e),(i=w(this,e)).type="CloudRenderEngine",i.controllers=(null==t?void 0:t.controllers)||{},i.kbEvent=document.createEvent("KeyboardEvent"),i.initMethod=void 0!==i.kbEvent.initKeyboardEvent?"initKeyboardEvent":"initKeyEvent",i.webRtcPlayerObj=null,i.forceTURN=void 0!==t.forceTURN&&t.forceTURN,i.printStats=(null==t?void 0:t.printStats)||!1,i.printInputs=(null==t?void 0:t.printInputs)||!1,i.connectOnLoad=(null==t?void 0:t.connectOnLoad)||!0,i.isReconnection=(null==t?void 0:t.isReconnection)||!1,i.ws,i.wsURL=null==t?void 0:t.wsUrl,i.projectName=void 0===t.projectName?"default":t.projectName,i.renderMode=(null==t?void 0:t.renderMode)||"cloud",i.matchmakerIP=null==t?void 0:t.matchmakerIP,i.matchmakerPort=(null==t?void 0:t.matchmakerPort)||"90",i.scene=new Ae,i.scene.engine=i,i.qualityController=!1,i.qualityControlOwnershipCheckBox,i.matchViewportResolution=(null==t?void 0:t.matchViewportResolution)||!1,i.resolution=(null==t?void 0:t.resolution)||[0,0],i.resizeTimeout=null,i.onDataChannelConnected,i.webRtcConnectionStatsCallback=null,i.lastPacketsLost=0;var n=(null==t?void 0:t.inputOptions)||{},a=n.controlScheme,o=void 0===a?re.controlScheme:a,r=n.suppressBrowserKeys,s=void 0===r?re.suppressBrowserKeys:r,l=n.fakeMouseWithTouches,d=void 0===l?re.fakeMouseWithTouches:l;return i.inputOptions={controlScheme:o,suppressBrowserKeys:s,fakeMouseWithTouches:d},i.eventHandler=new be(i),i.freezeFrameOverlay=null,i.shouldShowPlayOverlay=null==t?void 0:t.shouldShowPlayOverlay,i.freezeFrame={receiving:!1,size:0,jpeg:void 0,height:0,width:0,valid:!1},i.file={mimetype:"",extension:"",receiving:!1,size:0,data:[],valid:!1,timestampStart:void 0},i.afk=(null==t?void 0:t.afk)||{enabled:!1,warnTimeout:120,closeTimeout:10,active:!1,overlay:void 0,warnTimer:void 0,countdown:0,countdownTimer:void 0},i.editTextButton=void 0,i.hiddenInput=void 0,i.t0=Date.now(),i.dataTransferFrequence=20,i.streamTrackSource=null,i.videoEncoderQP="N/A",i.UDSParams=(null==t?void 0:t.UDSParams)||{},i.UDS,i.isSequencer=void 0!==(null==t?void 0:t.isSequencer)&&(null==t?void 0:t.isSequencer),i.styleWidth,i.styleHeight,i.styleTop,i.styleLeft,i.styleCursor=(null==t?void 0:t.styleCursor)||"default",i.styleAdditional,i._orientationChangeTimeout,i.playerElementClientRect=void 0,i.normalizeAndQuantizeUnsigned=void 0,i.normalizeAndQuantizeSigned=void 0,i.isShowTestUI=null==t?void 0:t.isShowTestUI,setTimeout((function(){i.interval(i.dataTransferFrequence)}),1e3),"inner"===i.renderMode&&i._preInitInnerMode(),i}return z(e,ve),k(e,[{key:"interval",value:function(){var e=this;setInterval((function(){e.eventHandler.updateObjectsWithEvent(),e.eventListenerUpdate(e),e.eventListenerUpdate(e.camera),e.scene.traverse((function(t){e.eventListenerUpdate(t),t.visibleNeedsUpdate&&(e.emitUIInteraction({excuteName:Z.VISIBLE,params:t.toJSON()}),t.visibleNeedsUpdate=!1),t.visible&&(t.matrixNeedsUpdate||t.materialNeedsUpdate||t.animateNeedsUpdate)&&("TrafficLayer"===t.type?e.emitUIInteraction({excuteName:Q.CREATE_TRAFFIC_STREAM,params:t.toJSON(!1)}):"LayerBuilding"===t.type?e.emitUIInteraction({excuteName:K.EVENT_LAYER_BUILDING,params:t.toJSON()}):"SlopeAnalysis"===t.type?e.emitUIInteraction({excuteName:K.UPDATA_SLOPE_ANALYSIS,params:t.toJSON()}):e.emitUIInteraction({excuteName:Z.UPDATE,params:t.toJSON()}),t.matrixNeedsUpdate=!1,t.materialNeedsUpdate=!1,t.animateNeedsUpdate=!1),t.visible&&t.messageNeedsUpdate&&("TrafficLayer"===t.type?e.emitUIInteraction({excuteName:Q.CREATE_TRAFFIC_STREAM,params:t.toJSON(!1)}):e.emitUIInteraction({excuteName:Z.UPDATE,params:t.toJSON()}),t.messageNeedsUpdate=!1),t.followNeedsUpdate&&("TrafficLayer"===t.type?e.emitUIInteraction({excuteName:Q.FOLLOW_TRAFFIC_STREAM_ITEM,params:t.toJSON(!1)}):"AutonomousVehicle"===t.type&&e.emitUIInteraction({excuteName:Z.UPDATE,params:t.toJSON()}),t.followNeedsUpdate=!1)})),e.camera&&e.camera.needsUpdate&&(e.camera.constrainPolygonNeedsUpdate?(e.emitUIInteraction({excuteName:X.Constrain_Shape,params:e.camera.toJSON()}),e.camera.constrainPolygonNeedsUpdate=!1):e.emitUIInteraction({excuteName:X.UPDATE,params:e.camera.toJSON()}),e.camera.needsUpdate=!1)}),1e3/(arguments.length>0&&void 0!==arguments[0]?arguments[0]:5))}},{key:"eventListenerUpdate",value:function(e){e&&e._needsDispatchedToUE&&(e._dispatchAddListenerTypes&&e._dispatchAddListenerTypes.length>0&&(this.emitUIInteraction({excuteName:Q.ADD_EVENT_LISTENER,params:{type:e.type,name:e.name,uuid:e.uuid,EventType:e._dispatchAddListenerTypes}}),e._dispatchAddListenerTypes=[]),e._dispatchRemoveListenerTypes&&e._dispatchRemoveListenerTypes.length>0&&(this.emitUIInteraction({excuteName:Q.REMOVE_EVENT_LISTENER,params:{type:e.type,name:e.name,uuid:e.uuid,EventType:e._dispatchRemoveListenerTypes}}),e._dispatchRemoveListenerTypes=[]),e._needsDispatchedToUE=!1,e._dispatchName=null)}},{key:"log",value:function(e){console.log("".concat(Math.floor(Date.now()-this.t0),": ")+e)}},{key:"_preInitInnerMode",value:function(){var e=this;if(!this._preInitInnerModeStarted){this._preInitInnerModeStarted=!0;var t=this,i=setInterval((function(){var n;"undefined"!=typeof ue&&null!==(n=ue)&&void 0!==n&&n.interface&&(clearInterval(i),ue.interface._webUILoadedSet||(ue.interface._webUILoadedSet=!0,ue.interface.webUILoaded=function(){t._initWebUI()}),e.addEventListener("webUIisReady",(function(){})))}),200)}}},{key:"initCamera",value:function(){var e,t=this;this.camera&&(null===(e=this.camera)||void 0===e||e.removeFromParent(),this.camera=null);this.camera=new Le,this.camera.type="Camera",this.camera.addEventListener("cameraChange",(function(e){var i,n,o,r,s,l,d=e.content.camera;t.camera.position.x=d.Location.longitude,t.camera.position.y=d.Location.latitude,t.camera.position.z=d.Location.altitude,t.camera.rotation.x=a.degToRad(d.Rotate.roll),t.camera.rotation.y=a.degToRad(d.Rotate.pitch),t.camera.rotation.z=a.degToRad(d.Rotate.yaw),t.camera.roll=d.Rotate.roll,t.camera.pitch=d.Rotate.pitch,t.camera.yaw=d.Rotate.yaw,t.camera.worldLocation.x=null==d||null===(i=d.Position)||void 0===i?void 0:i.x,t.camera.worldLocation.y=null==d||null===(n=d.Position)||void 0===n?void 0:n.y,t.camera.worldLocation.z=null==d||null===(o=d.Position)||void 0===o?void 0:o.z,t.camera.sphereLocation.x=null==d||null===(r=d.SphereLocation)||void 0===r?void 0:r.longitude,t.camera.sphereLocation.y=null==d||null===(s=d.SphereLocation)||void 0===s?void 0:s.latitude,t.camera.sphereLocation.z=null==d||null===(l=d.SphereLocation)||void 0===l?void 0:l.altitude,t.level=Math.ceil(Math.max(Math.log2(103300/t.camera.worldLocation.z),0)),t.dispatchEvent({type:"camera_changed",data:e})}))}},{key:"initObjectBBox",value:function(){if(this.objectBBox)return!1;this.objectBBox=new dt({color:new d(1,1,0)}),this.scene.add(this.objectBBox),this.objectBBox.visible=!1,this.emitUIInteraction({excuteName:q.OBJECT_BOUNDINGBOX,params:this.objectBBox.toJSON()})}},{key:"_initWebUI",value:function(){if(!this._webUIInitialized){this._webUIInitialized=!0;var e=this;ue.interface.webUIMessage=function(t){e.eventHandler.callRespone(t)},console.log("页面及其所有资源已完全加载"),setTimeout((function(){e.UDS||(e.UDS=new fe(e,e.UDSParams)),e.camera||(console.log("initOthers start"),e.initOthers(),console.log("initOthers end -> ",e.camera)),e.dispatchEvent({type:"videoInitialised"})}),1e3),vt((new Date).getTime())}}},{key:"scanGamepads",value:function(){for(var e=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():[],t=0;t<e.length;t++)e[t]&&e[t].index in this.controllers&&(this.controllers[e[t].index].currentState=e[t])}},{key:"updateStatus",value:function(){for(j in this.scanGamepads(),this.controllers){for(var e=this.controllers[j],t=e.currentState,i=e.prevState,n=0;n<t.buttons.length;n++){var a=t.buttons[n],o=i.buttons[n];a.pressed&&!o.pressed?6==n?this.emitControllerAxisMove(j,5,a.value):7==n?this.emitControllerAxisMove(j,6,a.value):this.emitControllerButtonPressed(j,n,0):!a.pressed&&o.pressed?6==n?this.emitControllerAxisMove(j,5,0):7==n?this.emitControllerAxisMove(j,6,0):this.emitControllerButtonReleased(j,n):a.pressed&&o.pressed&&(6==n?this.emitControllerAxisMove(j,5,a.value):7==n?this.emitControllerAxisMove(j,6,a.value):this.emitControllerButtonPressed(j,n,1))}for(var r=0;r<t.axes.length;r+=2){var s=parseFloat(t.axes[r].toFixed(4)),l=-parseFloat(t.axes[r+1].toFixed(4));0===r?(this.emitControllerAxisMove(j,1,s),this.emitControllerAxisMove(j,2,l)):2===r&&(this.emitControllerAxisMove(j,3,s),this.emitControllerAxisMove(j,4,l))}this.controllers[j].prevState=t}gt(this.updateStatus)}},{key:"emitControllerButtonPressed",value:function(e,t,i){Data=new DataView(new ArrayBuffer(4)),Data.setUint8(0,se.GamepadButtonPressed),Data.setUint8(1,e),Data.setUint8(2,t),Data.setUint8(3,i)}},{key:"emitControllerButtonReleased",value:function(e,t){Data=new DataView(new ArrayBuffer(3)),Data.setUint8(0,se.GamepadButtonReleased),Data.setUint8(1,e),Data.setUint8(2,t)}},{key:"emitControllerAxisMove",value:function(e,t,i){Data=new DataView(new ArrayBuffer(11)),Data.setUint8(0,se.GamepadAnalog),Data.setUint8(1,e),Data.setUint8(2,t),Data.setFloat64(3,i,!0),this.sendInputData(Data.buffer)}},{key:"setupToggleWithUrlParams",value:function(e,t){var i=document.getElementById(e);i&&(i.checked=new URLSearchParams(window.location.search).has(t),i.addEventListener("change",(function(e){var i=new URLSearchParams(window.location.search);e.currentTarget.checked?i.set(t,"true"):i.delete(t),window.history.replaceState({},"",""!==i.toString()?"".concat(location.pathname,"?").concat(i):"".concat(location.pathname))})))}},{key:"updateStreamList",value:function(){for(var e=document.getElementById("stream-select"),t=e.options.length-1;t>=0;t--)e.remove(t);e.value=null;var i,n=T(this.webRtcPlayerObj.availableVideoStreams);try{for(n.s();!(i=n.n()).done;){var a=_(i.value,2),o=a[0],r=(a[1],document.createElement("option"));r.value=o,r.innerHTML=o,e.appendChild(r),null==e.value&&(e.value=o)}}catch(e){n.e(e)}finally{n.f()}this.updateTrackList()}},{key:"updateTrackList",value:function(){for(var e=document.getElementById("stream-select"),t=document.getElementById("track-select"),i=this.webRtcPlayerObj.availableVideoStreams.get(e.value),n=t.options.length-1;n>=0;n--)t.remove(n);t.value=null;var a,o=T(i.getVideoTracks());try{for(o.s();!(a=o.n()).done;){var r=a.value,s=document.createElement("option");s.value=r.id,s.innerHTML=r.label,t.appendChild(s),r.selected&&(t.value=r.id)}}catch(e){o.e(e)}finally{o.f()}}},{key:"sendStartLatencyTest",value:function(){var e=this;if(this.webRtcPlayerObj){this.webRtcPlayerObj.startLatencyTest((function(t){var i={StartTime:t};e.emitDescriptor(se.LatencyTest,i)}))}}},{key:"setOverlay",value:function(e,t,i){var n=document.getElementById("videoPlayOverlay");if(!n){var a=document.getElementById("player");(n=document.createElement("div")).id="videoPlayOverlay",a&&a.appendChild(n)}for(;n.lastChild;)n.removeChild(n.lastChild);t&&n.appendChild(t),i&&n.addEventListener("click",(function e(t){i(t),n.removeEventListener("click",e)}));for(var o=n.classList,r=o.length-1;r>=0;r--)o.remove(o[r]);n.classList.add(e)}},{key:"showConnectOverlay",value:function(){var e=this,t=document.createElement("div");t.id="playButton",t.innerHTML="点击开始",this.setOverlay("clickableState",t,(function(t){e.connect(),e.startAfkWarningTimer()}))}},{key:"showTextOverlay",value:function(e){var t=document.createElement("div");t.id="messageOverlay",t.innerHTML=e||"",this.setOverlay("textDisplayState",t)}},{key:"playVideoStream",value:function(){var e=this;e.webRtcPlayerObj&&this.webRtcPlayerObj.video?(e.webRtcPlayerObj.video.play().catch((function(t){console.error(t),console.log("Browser does not support autoplaying video without interaction - to resolve this we are going to show the play button overlay."),e.showPlayOverlay()})),e.requestInitialSettings(),e.requestQualityControl(),e.eventHandler.showFreezeFrameOverlay(),e.hideOverlay()):console.error("Could not player video stream because this.webRtcPlayerObj.video was not valid.")}},{key:"showPlayOverlay",value:function(){var e=this,t=document.createElement("img");t.id="playButton",t.src="/images/Play.png",t.alt="Start Streaming",this.setOverlay("clickableState",t,(function(t){e.playVideoStream()})),this.shouldShowPlayOverlay=!1}},{key:"updateAfkOverlayText",value:function(){this.afk.overlay.innerHTML="<center>No activity detected<br>Disconnecting in "+this.afk.countdown+" seconds<br>Click to continue<br></center>"}},{key:"showAfkOverlay",value:function(){var e=this;this.stopAfkWarningTimer(),this.afk.overlay=document.createElement("div"),this.afk.overlay.id="afkOverlay",this.setOverlay("clickableState",this.afk.overlay,(function(t){e.hideOverlay(),clearInterval(e.afk.countdownTimer),e.startAfkWarningTimer()})),this.afk.countdown=this.afk.closeTimeout,this.updateAfkOverlayText(),this.inputOptions.controlScheme==oe.LockedMouse&&document.exitPointerLock(),this.afk.countdownTimer=setInterval((function(){this.afk.countdown--,0==this.afk.countdown?(this.hideOverlay(),this.ws.close()):this.updateAfkOverlayText()}),1e3)}},{key:"hideOverlay",value:function(){this.setOverlay("hiddenState")}},{key:"startAfkWarningTimer",value:function(){this.afk.active=this.afk.enabled,this.resetAfkWarningTimer()}},{key:"stopAfkWarningTimer",value:function(){this.afk.active=!1}},{key:"resetAfkWarningTimer",value:function(){var e=this;this.afk.active&&(clearTimeout(this.afk.warnTimer),this.afk.warnTimer=setTimeout((function(){e.showAfkOverlay()}),1e3*e.afk.warnTimeout))}},{key:"createWebRtcOffer",value:function(){this.webRtcPlayerObj?(console.log("Creating offer"),this.showTextOverlay("云渲染服务连接中,请稍等"),this.webRtcPlayerObj.createOffer()):(console.log("WebRTC player not setup, cannot create offer"),this.showTextOverlay("云渲染服务连接失败,无法获取画面"))}},{key:"sendInputData",value:function(e){this.webRtcPlayerObj&&(this.resetAfkWarningTimer(),this.webRtcPlayerObj.send(e))}},{key:"setupWebRtcPlayer",value:function(e,t){var i=this;function n(e){this.freezeFrame.receiving||(this.freezeFrame.receiving=!0,this.freezeFrame.valid=!1,this.freezeFrame.size=0,this.freezeFrame.jpeg=void 0),this.freezeFrame.size=new DataView(e.slice(1,5).buffer).getInt32(0,!0);var t=e.slice(5);if(this.freezeFrame.jpeg){var n=new Uint8Array(this.freezeFrame.jpeg.length+t.length);n.set(this.freezeFrame.jpeg,0),n.set(t,this.freezeFrame.jpeg.length),this.freezeFrame.jpeg=n}else this.freezeFrame.jpeg=t,this.freezeFrame.receiving=!0,console.log("received first chunk of freeze frame: ".concat(this.freezeFrame.jpeg.length,"/").concat(this.freezeFrame.size));this.freezeFrame.jpeg.length===this.freezeFrame.size?(this.freezeFrame.receiving=!1,this.freezeFrame.valid=!0,console.log("received complete freeze frame ".concat(this.freezeFrame.size)),function(){var e=btoa(this.freezeFrame.jpeg.reduce((function(e,t){return e+String.fromCharCode(t)}),"")),t=document.getElementById("this.freezeFrameOverlay").childNodes[0];t.src="data:image/jpeg;base64,"+e,t.onload=function(){i.freezeFrame.height=t.naturalHeight,i.freezeFrame.width=t.naturalWidth,i.resizeFreezeFrameOverlay(),i.shouldShowPlayOverlay?(i.showPlayOverlay(),i.eventHandler.resizePlayerStyle()):i.eventHandler.showFreezeFrameOverlay()}}()):this.freezeFrame.jpeg.length>this.freezeFrame.size&&(console.error("received bigger freeze frame than advertised: ".concat(this.freezeFrame.jpeg.length,"/").concat(this.freezeFrame.size)),this.freezeFrame.jpeg=void 0,this.freezeFrame.receiving=!1)}return this.webRtcPlayerObj=new ye(A(A({},t),{},{forceTURN:this.forceTURN})),e.appendChild(this.webRtcPlayerObj.video),e.appendChild(this.freezeFrameOverlay),this.connectOnLoad&&(this.webRtcPlayerObj.video.muted=!0),this.webRtcPlayerObj.onWebRtcOffer=function(e){if(i.ws&&1===i.ws.readyState){var t=JSON.stringify(e);console.log("%c[Outbound SS message (offer)]","background: lightgreen; color: black",e),i.ws.send(t)}},this.webRtcPlayerObj.onWebRtcCandidate=function(e){i.ws&&1===i.ws.readyState&&i.ws.send(JSON.stringify({type:"iceCandidate",candidate:e}))},this.webRtcPlayerObj.onWebRtcAnswer=function(e){if(i.ws&&1===i.ws.readyState){var t=JSON.stringify(e);console.log("%c[Outbound SS message (answer)]","background: lightgreen; color: black",e),i.ws.send(t)}},this.webRtcPlayerObj.onVideoInitialised=function(){i.ws&&1===i.ws.readyState&&(i.shouldShowPlayOverlay?(i.showPlayOverlay(),i.eventHandler.resizePlayerStyle()):(i.eventHandler.resizePlayerStyle(),i.playVideoStream()),0!==i.resolution[0]&&0!==i.resolution[1]&&i.changeResolution(i.resolution[0],i.resolution[1]))},this.webRtcPlayerObj.onDataChannelConnected=function(){i.ws&&1===i.ws.readyState&&(i.showTextOverlay("云渲染服务连接成功,等待画面推送中"),i.requestQualityControl(),setTimeout((function(){i.UDS||(i.UDS=new fe(i,i.UDSParams)),i.camera||i.initOthers(),i.dispatchEvent({type:"videoInitialised"})}),1e3))},this.webRtcPlayerObj.onNewVideoTrack=function(e){var t,n;null!=i&&null!==(t=i.webRtcPlayerObj)&&void 0!==t&&t.onVideoInitialised&&(null==i||null===(n=i.webRtcPlayerObj)||void 0===n||n.onVideoInitialised());i.isShowTestUI&&i.updateStreamList()},this.webRtcPlayerObj.onDataChannelMessage=function(e){var t=new Uint8Array(e);if(t[0]===ae.QualityControlOwnership){var a=0!==t[1];console.log("Received quality controller message, will control quality: "+a),i.qualityController=a,i.qualityControlOwnershipCheckBox&&(i.qualityControlOwnershipCheckBox.disabled=a,i.qualityControlOwnershipCheckBox.checked=a)}else if(t[0]===ae.Response){var o=new TextDecoder("utf-16").decode(e.slice(1));i.eventHandler.callRespone(JSON.parse(o))}else if(t[0]===ae.Command){var r=new TextDecoder("utf-16").decode(e.slice(1));console.log(r);var s=JSON.parse(r);"onScreenKeyboard"===s.command&&i.showOnScreenKeyboard(s)}else if(t[0]===ae.FreezeFrame)n(t);else if(t[0]===ae.UnfreezeFrame)i.eventHandler.invalidateFreezeFrameOverlay();else if(t[0]===ae.VideoEncoderAvgQP)i.videoEncoderQP=new TextDecoder("utf-16").decode(e.slice(1));else if(t[0]==ae.LatencyTest){var l=new TextDecoder("utf-16").decode(e.slice(1));console.log("Got latency timings from UE."),console.log(l);var d=JSON.parse(l);i.webRtcPlayerObj&&i.webRtcPlayerObj.latencyTestTimings.SetUETimings(d)}else if(t[0]==ae.InitialSettings){if(!i.isShowTestUI)return;var c=new TextDecoder("utf-16").decode(e.slice(1)),u=JSON.parse(c);if(u.PixelStreaming){if(!1===u.PixelStreaming.AllowPixelStreamingCommands){if(document.getElementById("encoder-min-qp-text").disabled=!0,document.getElementById("encoder-max-qp-text").disabled=!0,document.getElementById("webrtc-fps-text").disabled=!0,document.getElementById("webrtc-min-bitrate-text").disabled=!0,document.getElementById("webrtc-max-bitrate-text").disabled=!0,document.getElementById("show-fps-button").disabled=!0,document.getElementById("encoder-params-submit").disabled=!0,document.getElementById("webrtc-params-submit").disabled=!0,!document.getElementById("warning-elem-webrtc")){var h=document.createElement("p");h.innerText="(Disabled by -AllowPixelStreamingCommands=false)",h.classList="subtitle-text",h.id="warning-elem-webrtc",document.getElementById("webRTCSettingsHeader").appendChild(h)}if(!document.getElementById("warning-elem-encoder")){var p=document.createElement("p");p.innerText="(Disabled by -AllowPixelStreamingCommands=false)",p.classList="subtitle-text",p.id="warning-elem-encoder",document.getElementById("encoderSettingsHeader").appendChild(p)}console.warn("-AllowPixelStreamingCommands=false, sending console commands from browser to UE is disabled, including toggling FPS and changing encoder settings from the browser.")}u.PixelStreaming.DisableLatencyTest&&(document.getElementById("test-latency-button").disabled=!0,document.getElementById("test-latency-button").title="Disabled by -PixelStreamingDisableLatencyTester=true",console.warn("-PixelStreamingDisableLatencyTester=true, requesting latency report from the the browser to UE is disabled."))}u.Encoder&&(document.getElementById("encoder-min-qp-text").value=u.Encoder.MinQP,document.getElementById("encoder-max-qp-text").value=u.Encoder.MaxQP),u.WebRTC&&(document.getElementById("webrtc-fps-text").value=u.WebRTC.FPS,document.getElementById("webrtc-min-bitrate-text").value=u.WebRTC.MinBitrate/1e3,document.getElementById("webrtc-max-bitrate-text").value=u.WebRTC.MaxBitrate/1e3)}else if(t[0]==ae.FileExtension)!function(e){this.file.receiving||(this.file.mimetype="",this.file.extension="",this.file.receiving=!0,this.file.valid=!1,this.file.size=0,this.file.data=[],this.file.timestampStart=(new Date).getTime(),console.log("Received first chunk of this.file"));var t=new TextDecoder("utf-16").decode(e.slice(1));console.log(t),this.file.extension=t}(t);else if(t[0]==ae.FileMimeType)!function(e){this.file.receiving||(this.file.mimetype="",this.file.extension="",this.file.receiving=!0,this.file.valid=!1,this.file.size=0,this.file.data=[],this.file.timestampStart=(new Date).getTime(),console.log("Received first chunk of this.file"));var t=new TextDecoder("utf-16").decode(e.slice(1));console.log(t),this.file.mimetype=t}(t);else if(t[0]==ae.FileContents)!function(e){if(this.file.receiving){this.file.size=Math.ceil(new DataView(e.slice(1,5).buffer).getInt32(0,!0)/16379);var t=e.slice(5);if(this.file.data.push(t),console.log("Received this.file chunk: ".concat(this.file.data.length,"/").concat(this.file.size)),this.file.data.length===this.file.size){this.file.receiving=!1,this.file.valid=!0,console.log("Received complete this.file");var i=(new Date).getTime()-this.file.timestampStart,n=Math.round(16*this.file.size*1024/i);console.log("Average transfer bitrate: ".concat(n,"kb/s over ").concat(i/1e3," seconds"));var a=new Blob(this.file.data,{type:this.file.mimetype}),o=document.createElement("a");o.setAttribute("href",URL.createObjectURL(a)),o.setAttribute("download","transfer.".concat(this.file.extension));var r=$(o);r.appendTo("body"),r.remove()}else this.file.data.length>this.file.size&&(this.file.receiving=!1,console.error("Received bigger this.file than advertised: ".concat(this.file.data.length,"/").concat(this.file.size)))}}(t);else if(t[0]==ae.Mouse){var f=new TextDecoder("utf-16").decode(e.slice(1));this.eventHandler.dispatchMouseEvent(f)}else if(t[0]==ae.Keyboard){var m=new TextDecoder("utf-16").decode(e.slice(1));this.eventHandler.dispatchKeyboardEvent(m)}else t[0]==ae.InputControlOwnership||t[0]==ae.Protocol?new TextDecoder("utf-16").decode(e.slice(1)):console.error("unrecognized data received, packet ID ".concat(t[0]))},this.eventHandler.registerInputs(this.webRtcPlayerObj.video),"ontouchstart"in document.documentElement&&this.createOnScreenKeyboardHelpers(e),this.webRtcPlayerObj.video}},{key:"setupStats",value:function(){var e=this;this.webRtcPlayerObj.aggregateStats(1e3);var t=3e5,i=t;this.webRtcPlayerObj.onAggregatedStats=function(n){for(var a=new Intl.NumberFormat(window.navigator.language,{maximumFractionDigits:0}),o=new Intl.NumberFormat(window.navigator.language,{maximumFractionDigits:0,minimumIntegerDigits:2}),r=(n.timestamp-n.timestampStart)/1e3,s=[],l=[60,60],d=0;d<l.length;d++)s.push(r%l[d]),r/=l[d];s.push(r);for(var c=s[0],u=Math.floor(s[1]),h=Math.floor([s[2]]),p="B",f=n.hasOwnProperty("bytesReceived")?n.bytesReceived:0,m=["kB","MB","GB"],g=0;g<m.length&&!(f<1e5);g++)f/=1e3,p=m[g];n.receivedBytes=""+f+m;var y=document.getElementById("qualityStatus"),v=function(e){if(y)var t=e,i=1,n=setInterval((function(){y?(i-=.1,y.style="opacity: ".concat(Math.abs(2*(i-.5))),i<=.1&&(0==--t?clearInterval(n):i=1)):clearInterval(n)}),100/e)},b="",x="lime";e.videoEncoderQP>35?(x="red",v(2),b+='<div style="color: '.concat(x,'">Very blocky encoding quality</div>')):e.videoEncoderQP>26&&(x="orange",v(1),b+='<div style="color: '.concat(x,'">Blocky encoding quality</div>')),y&&(y.className="".concat(x,"Status")),b+="<div>Duration: ".concat(o.format(h),":").concat(o.format(u),":").concat(o.format(c),"</div>"),b+="<div>Video Resolution: ".concat(n.hasOwnProperty("frameWidth")&&n.frameWidth&&n.hasOwnProperty("frameHeight")&&n.frameHeight?n.frameWidth+"x"+n.frameHeight:"Chrome only","</div>"),b+="<div>Received (".concat(p,"): ").concat(a.format(f),"</div>"),b+="<div>Frames Decoded: ".concat(n.hasOwnProperty("framesDecoded")?a.format(n.framesDecoded):"Chrome only","</div>"),b+="<div>Packets Lost: ".concat(n.hasOwnProperty("packetsLost")?a.format(n.packetsLost):"Chrome only","</div>"),b+="<div>Framerate: ".concat(n.hasOwnProperty("framerate")?a.format(n.framerate):"Chrome only","</div>"),b+="<div>Frames dropped: ".concat(n.hasOwnProperty("framesDropped")?a.format(n.framesDropped):"Chrome only","</div>"),b+="<div>Net RTT (ms): ".concat(n.hasOwnProperty("currentRoundTripTime")?a.format(1e3*n.currentRoundTripTime):"Can't calculate","</div>"),b+="<div>Browser receive to composite (ms): ".concat(n.hasOwnProperty("receiveToCompositeMs")?a.format(n.receiveToCompositeMs):"Chrome only","</div>"),b+='<div style="color: '.concat(x,'">Bitrate (kbps): ').concat(n.hasOwnProperty("bitrate")?a.format(n.bitrate):"Chrome only","</div>"),b+='<div style="color: '.concat(x,'">Video Quantization Parameter: ').concat(e.videoEncoderQP,"</div>");var S=document.getElementById("stats");if(S&&(S.innerHTML=b),e.printStats&&n.timestampStart&&n.timestamp-n.timestampStart>i&&(e.ws&&1===e.ws.readyState&&(console.log("-> SS: stats\n".concat(JSON.stringify(n))),e.ws.send(JSON.stringify({type:"stats",data:n}))),i+=t),e.dispatchEvent({type:"aggregatedStats",data:n}),e.webRtcConnectionStatsCallback&&"function"==typeof e.webRtcConnectionStatsCallback)try{var N=n.hasOwnProperty("packetsLost")?n.packetsLost:0,w=n.hasOwnProperty("currentRoundTripTime")?1e3*n.currentRoundTripTime:0,U=n.hasOwnProperty("framerate")?n.framerate:0,C=0;void 0!==e.lastPacketsLost&&(C=Math.max(0,N-e.lastPacketsLost)),e.lastPacketsLost=N;var k=C>0||w>300||U<10&&C>0,T=k?"⚠️ 网络拥堵":"✅ 网络良好",O=C>30?"丢失 ".concat(C," 包/次"):"0 (稳定)",R={bitrate:n.hasOwnProperty("bitrate")?n.bitrate:null,avgBitrate:n.hasOwnProperty("avgBitrate")?n.avgBitrate:null,framerate:U,resolution:{width:n.hasOwnProperty("frameWidth")?n.frameWidth:null,height:n.hasOwnProperty("frameHeight")?n.frameHeight:null},roundTripTime:w,packetsLost:N,framesDroppedPercentage:n.hasOwnProperty("framesDroppedPercentage")?n.framesDroppedPercentage:null,quantizationParameter:e.videoEncoderQP,originData:n,diagnosis:{isCongested:k,status:T,instantPacketLoss:C,instantPacketLossText:O}};e.webRtcConnectionStatsCallback(R)}catch(e){console.error("Error calling webRtcConnectionStatsCallback:",e)}},this.webRtcPlayerObj.latencyTestTimings.OnAllLatencyTimingsReady=function(e){if(e.BrowserReceiptTimeMs){var t=e.BrowserReceiptTimeMs-e.TestStartTimeMs,i=e.UEEncodeMs,n=e.UECaptureToSendMs,a=e.UETransmissionTimeMs-e.UEReceiptTimeMs,o=t-a,r=null,s=null;e.FrameDisplayDeltaTimeMs&&e.BrowserReceiptTimeMs&&(r=e.FrameDisplayDeltaTimeMs+o+("string"==typeof n?0:n),s=e.FrameDisplayDeltaTimeMs+(t-o-a));var l="";l+="<div>Net latency RTT (ms): ".concat(o.toFixed(2),"</div>"),l+="<div>UE Encode (ms): ".concat("string"==typeof i?i:i.toFixed(2),"</div>"),l+="<div>UE Send to capture (ms): ".concat("string"==typeof n?n:n.toFixed(2),"</div>"),l+="<div>UE probe duration (ms): ".concat(a.toFixed(2),"</div>"),l+=e.FrameDisplayDeltaTimeMs&&e.BrowserReceiptTimeMs?"<div>Browser composite latency (ms): ".concat(e.FrameDisplayDeltaTimeMs.toFixed(2),"</div>"):"",l+=s?"<div>Total browser latency (ms): ".concat(s.toFixed(2),"</div>"):"",l+=r?"<div>Total latency (ms): ".concat(r.toFixed(2),"</div>"):"";var d=document.getElementById("LatencyStats");d&&(d.innerHTML=l)}}}},{key:"onWebRtcConnectionStats",value:function(e){"function"==typeof e?(this.webRtcConnectionStatsCallback=e,this.webRtcPlayerObj&&!this.webRtcPlayerObj.aggregateStatsIntervalId&&this.setupStats()):console.warn("onWebRtcConnectionStats: callback must be a function")}},{key:"onWebRtcOffer",value:function(e){this.webRtcPlayerObj.receiveOffer(e),this.isShowTestUI&&this.setupStats()}},{key:"onWebRtcAnswer",value:function(e){this.webRtcPlayerObj.receiveAnswer(e),this.isShowTestUI&&this.setupStats()}},{key:"onWebRtcIce",value:function(e){this.webRtcPlayerObj&&this.webRtcPlayerObj.handleCandidateFromServer(e)}},{key:"updateVideoStreamSize",value:function(){var e=this;this.matchViewportResolution&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((function(){var t=document.getElementById("player");if(t){var i=t.clientWidth,n=t.clientHeight;if(i>3840||n>2160){var a=3840/i,o=2160/n,r=Math.min(a,o);i=Math.floor(i*r),n=Math.floor(n*r)}e.changeResolution(i,n),console.log("Debounced resize: Resolution updated to ".concat(i,"x").concat(n))}}),500))}},{key:"emitDescriptor",value:function(e,t){var i=function(e){var t=JSON.stringify(e);return t.replace(/\r\n/g,"").replace(/\n/g,"").replace(/\s+/g,""),t}(t),n=49152;if(2*i.length>67108864)return console.error("数据量超出最大传输范围6.4MB!"),!1;if(2*i.length<n)return this.sendStringBufferData(e,i),!1;for(var a=Math.ceil(2*i.length/n),o=0;o<a;o++){var r=i.slice(.5*o*n,24576*(o+1));this.sendStringBufferData(e,r,a,o+1)}}},{key:"sendStringBufferData",value:function(e,t){var i,n={total:arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,index:arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,content:t};i=JSON.stringify(n);var a=new DataView(new ArrayBuffer(3+2*i.length)),o=0;a.setUint8(o,e),o++,a.setUint16(o,i.length,!0),o+=2;for(var r=0;r<i.length;r++)a.setUint16(o,i.charCodeAt(r),!0),o+=2;this.sendInputData(a.buffer)}},{key:"emitUIInteraction",value:function(e){var t,i;(console.log(e),"cloud"===this.renderMode)?this.emitDescriptor(se.UIInteraction,e):"undefined"!=typeof ue&&null!==(t=ue)&&void 0!==t&&null!==(i=t.interface)&&void 0!==i&&i.broadcast?ue.interface.broadcast(JSON.stringify(e)):console.warn("ue.interface.broadcast is not available in this environment.")}},{key:"emitCommand",value:function(e){this.emitDescriptor(se.Command,e)}},{key:"requestInitialSettings",value:function(){this.sendInputData(new Uint8Array([se.RequestInitialSettings]).buffer)}},{key:"requestQualityControl",value:function(){this.qualityController||this.sendInputData(new Uint8Array([se.RequestQualityControl]).buffer)}},{key:"setupNormalizeAndQuantize",value:function(){var e=document.getElementById("player"),t=e.getElementsByTagName("video");if(e&&t.length>0){var i=e.clientHeight/e.clientWidth,n=t[0].videoHeight/t[0].videoWidth;if(i>n){this.printInputs&&console.log("Setup Normalize and Quantize for playerAspectRatio > videoAspectRatio");var a=i/n;this.normalizeAndQuantizeUnsigned=function(t,i){var n=t/e.clientWidth,o=a*(i/e.clientHeight-.5)+.5;return n<0||n>1||o<0||o>1?{inRange:!1,x:65535,y:65535}:{inRange:!0,x:65536*n,y:65536*o}},this.unquantizeAndDenormalizeUnsigned=function(t,i){var n=(i/65536-.5)/a+.5;return{x:t/65536*e.clientWidth,y:n*e.clientHeight}},this.normalizeAndQuantizeSigned=function(t,i){return{x:32767*(t/(.5*e.clientWidth)),y:32767*(a*i/(.5*e.clientHeight))}}}else{this.printInputs&&console.log("Setup Normalize and Quantize for playerAspectRatio <= videoAspectRatio");var o=n/i;this.normalizeAndQuantizeUnsigned=function(t,i){var n=o*(t/e.clientWidth-.5)+.5,a=i/e.clientHeight;return n<0||n>1||a<0||a>1?{inRange:!1,x:65535,y:65535}:{inRange:!0,x:65536*n,y:65536*a}},this.unquantizeAndDenormalizeUnsigned=function(t,i){var n=i/65536;return{x:((t/65536-.5)/o+.5)*e.clientWidth,y:n*e.clientHeight}},this.normalizeAndQuantizeSigned=function(t,i){return{x:32767*(o*t/(.5*e.clientWidth)),y:32767*(i/(.5*e.clientHeight))}}}}}},{key:"createOnScreenKeyboardHelpers",value:function(e){var t=this;null===document.getElementById("this.hiddenInput")&&(this.hiddenInput=document.createElement("input"),this.hiddenInput.id="this.hiddenInput",this.hiddenInput.maxLength=0,e.appendChild(this.hiddenInput)),null===document.getElementById("this.editTextButton")&&(this.editTextButton=document.createElement("button"),this.editTextButton.id="this.editTextButton",this.editTextButton.innerHTML="edit text",e.appendChild(this.editTextButton),this.editTextButton.classList.add("hiddenState"),this.editTextButton.addEventListener("click",(function(){t.hiddenInput.focus()})))}},{key:"showOnScreenKeyboard",value:function(e){if(e.showOnScreenKeyboard){this.editTextButton.classList.remove("hiddenState");var t=this.unquantizeAndDenormalizeUnsigned(e.x,e.y);this.editTextButton.style.top=t.y.toString()+"px",this.editTextButton.style.left=(t.x-40).toString()+"px"}else this.editTextButton.classList.add("hiddenState"),this.hiddenInput.blur()}},{key:"start",value:function(e,t){var i=document.getElementById("qualityStatus");i&&(i.className="grey-status");var n=document.getElementById("stats");n&&(n.innerHTML="Not connected"),!this.connectOnLoad||this.isReconnection?(this.showConnectOverlay(),this.eventHandler.invalidateFreezeFrameOverlay(),this.shouldShowPlayOverlay=!0,this.eventHandler.resizePlayerStyle()):(console.log("直接链接~~~~~~"),this.connect(e,t))}},{key:"buildingGrowthAnimate",value:function(e){var t=e.state,i=void 0===t?"play":t,n=e.group,a=void 0===n?1:n,o=e.duration,r=void 0===o?3e3:o,s=e.startHeight,l=void 0===s?0:s,d=e.endHeight,c=void 0===d?100:d,u=e.loop,h=void 0!==u&&u,p=e.easing,f=void 0===p?"Linear":p,m=e.sliceColor,g=void 0===m?{r:1,g:0,b:0}:m,y=e.sliceBrightness,v=void 0===y?30:y,b=e.colorHeight,x=void 0===b?100:b;this.emitUIInteraction({excuteName:q.BUILD_GROWTHANIMATE,params:JSON.stringify({State:i,Group:a,Duration:r,StartHeight:l,EndHeight:c,Loop:h,Easing:f,SliceColor:g,SliceBrightness:v,ColorHeight:x})})}},{key:"changeResolution",value:function(e,t){if(void 0===e||void 0===t||e<=0||t<=0)console.warn("[PixelStream] 传入的分辨率参数无效:",e,t);else{var i=4096,n=e,a=t,o=[];if(n>i)a=(n=i)/(e/t),o.push("宽度 ".concat(e," 超过安全限制 ").concat(i,",已按比例缩放"));var r=2*Math.floor(n/2),s=2*Math.floor(a/2);r===n&&s===a||n%2==0&&a%2==0||o.push("分辨率包含奇数,已修正为偶数"),a=s,(n=r)===e&&a===t||console.warn("[PixelStream] 分辨率自动修正提示:\n"+"原目标: ".concat(e," x ").concat(t,"\n")+"修正后: ".concat(n," x ").concat(a,"\n")+"原因: ".concat(o.join(", ")||"数值取整")),console.log("[PixelStream] Sending command: r.SetRes ".concat(n,"x").concat(a)),this.emitUIInteraction({excuteName:Q.CONSOLE_COMMAND,params:{Command:"r.SetRes "+n+"x"+a}})}}},{key:"changeRenderBitrate",value:function(e){if(null!=e){if(-1===e)return console.log("执行命令: 解除码率限制 (Set to -1)"),this.excuteEngineConsoleCommand("PixelStreaming.Encoder.MaxBitrate -1"),void this.excuteEngineConsoleCommand("PixelStreaming.Encoder.TargetBitrate -1");var t=Number(e);if(!isNaN(t)){var i=(t=Math.max(1e5,t)).toFixed(0);this.excuteEngineConsoleCommand("PixelStreaming.Encoder.MaxBitrate "+i),this.excuteEngineConsoleCommand("PixelStreaming.Encoder.TargetBitrate "+i)}}else console.warn("传入的参数为空")}},{key:"excuteEngineConsoleCommand",value:function(e){void 0!==e?this.emitUIInteraction({excuteName:Q.CONSOLE_COMMAND,params:{Command:e}}):console.warn("传入的参数为空")}},{key:"Swtich3DTilesMode",value:function(e){var t=e.mode,i=e.tilesName;this.emitUIInteraction({excuteName:K.SWITCH_TERRAIN_MODE,params:{Mode:t,TilesName:i}})}},{key:"enable3DTilesByName",value:function(e){var t=e.enable,i=void 0===t||t,n=e.tilesName;this.emitUIInteraction({excuteName:K.ENABLE_3DTILES_BY_NAME,params:{Enable:i,TilesName:n}})}},{key:"hidden3DTilesItem",value:function(e){var t=e.hiddenList,i=void 0===t?[]:t,n=e.tilesName;Array.isArray(i)||(i=[]),this.emitUIInteraction({excuteName:K.HIDDEN_3DTILES_ITEM,params:{HiddenList:i,TilesName:n}})}},{key:"changeWeather",value:function(e){console.warn("方法被移除,请使用UDS设置天气"),e&&this.UDS.changeWeather(e)}},{key:"changeTime",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;console.warn("方法被移除,请使用UDS设置时间"),this.UDS.changeTime(e,t)}},{key:"setWorldCenterPoint",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(void 0===e||void 0===t)return console.warn("传入的参数为空"),!1;this.emitUIInteraction({excuteName:Q.RESET_WORLD_CENTER,params:{Center:{Latitude:a.clamp(t,-90,90),Longitude:a.clamp(e,-180,180),Altitude:a.clamp(i,-500,8848)}}})}},{key:"SetPlanePOIMode",value:function(e){var t=e.enable,i=void 0!==t&&t,n=e.cullingScale,a=void 0===n?2:n,o=e.aspectRatio,r=void 0===o?1.777778:o,s=e.cameraFov,l=void 0===s?90:s,d=e.maxTilesCullingDistance,c=void 0===d?1e3:d,u=e.maxPOICullingDistance,h=void 0===u?2e3:u,p=e.poiSimplifyDistance,f=void 0===p?1500:p,m=e.maxLoadedPoiTilesNum,g=void 0===m?5:m;this.emitUIInteraction({excuteName:K.SET_PLANE_POI_MODE,params:{EnablePoi:i,CullingScale:a,AspectRatio:r,CameraFov:l,MaxTilesCullingDistance:c,MaxPOICullingDistance:h,PoiSimplifyDistance:f,MaxLoadedPoiTilesNum:g}})}},{key:"moveTo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{roll:0,pitch:0,yaw:0},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:1,preload:!1,endLineDetect:!1,detectLength:5e4,flyOverLongitude:!1,zoom:-1,number:0,isGlobalMove:!1,globalCityCenter:null,callback:null};if(!e)return!1;this._silentlyRemoveEventListener(this.camera,"moveTo",this._moveToCallback),this._moveToCallback=i.callback,this.emitUIInteraction({excuteName:X.MOVE_TO,params:{Longitude:null==e?void 0:e.x,Latitude:null==e?void 0:e.y,Altitude:null==e?void 0:e.z,rotation:{Roll:null==t?void 0:t.roll,Pitch:null==t?void 0:t.pitch,Yaw:null==t?void 0:t.yaw},Duration:null==i?void 0:i.duration,Preload:null==i?void 0:i.preload,EndLineDetect:null==i?void 0:i.endLineDetect,DetectLength:null==i?void 0:i.detectLength,FlyOverLongitude:null==i?void 0:i.flyOverLongitude,Zoom:null==i?void 0:i.zoom,Number:null==i?void 0:i.number,IsGlobalMove:null==i?void 0:i.isGlobalMove,GlobalCityCenter:null==i?void 0:i.globalCityCenter}}),console.log("moveTo options is ",i),console.log("moveTo this.camera is ",this.camera),null!=i&&i.callback&&this.camera.addEventListener("moveTo",i.callback)}},{key:"moveCamera",value:function(e){var t=e.multiplier,i=void 0===t?1:t,n=e.x,a=void 0===n?0:n,o=e.y,r=void 0===o?0:o;this.emitUIInteraction({excuteName:X.MOVE,params:{Multiplier:i,ActionValue:{x:a,y:r}}})}},{key:"rotateCamera",value:function(e){var t=e.multiplier,i=void 0===t?1:t,n=e.yaw,a=void 0===n?0:n,o=e.pitch,r=void 0===o?0:o;this.emitUIInteraction({excuteName:X.ROTATE,params:{Multiplier:i,ActionValue:{x:a,y:r}}})}},{key:"zoomIn",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.emitUIInteraction({excuteName:X.ZOOM_IN,params:{Multiplier:e}})}},{key:"zoomOut",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.emitUIInteraction({excuteName:X.ZOOM_OUT,params:{Multiplier:e}})}},{key:"focusOn",value:function(e){var t,i,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{duration:1,index:-1,preload:!1,rotation:{roll:0,pitch:0,yaw:0},flyOverLongitude:!1,callback:null};if(!e)return!1;this.emitUIInteraction({excuteName:X.FOCUS_ON,params:{uuid:null==e?void 0:e.uuid,type:null==e?void 0:e.type,rotation:{Roll:null==a||null===(t=a.rotation)||void 0===t?void 0:t.roll,Pitch:null==a||null===(i=a.rotation)||void 0===i?void 0:i.pitch,Yaw:null==a||null===(n=a.rotation)||void 0===n?void 0:n.yaw},Duration:null==a?void 0:a.duration,Preload:null==a?void 0:a.preload,Index:null==a?void 0:a.index,FlyOverLongitude:null==a?void 0:a.flyOverLongitude}}),null!=a&&a.callback&&this.camera.addEventListener("focusOn",a.callback)}},{key:"navigateByKeypoints",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.lockAll,a=void 0===n||n,o=i.speed,r=void 0===o?36:o,s=i.time,l=void 0===s?0:s,d=i.ignoreLag,c=void 0!==d&&d,u=i.name,h=void 0===u?"":u,p=i.patrolType,f=void 0===p?"default":p,m=i.followRotation,g=void 0===m?{Roll:!1,Pitch:!1,Yaw:!1}:m,y=i.finishDestory,v=void 0===y||y,b=i.rayDetectionDistance,x=void 0===b?1e3:b,S=i.callback,N=void 0===S?null:S,w=i.startCallback,U=void 0===w?null:w,C=i.finishCallback,k=void 0===C?null:C;if(!e||e.length<2)return!1;this._silentlyRemoveEventListener(this.camera,"navigationStart",this._navigationStartCallback),this._silentlyRemoveEventListener(this.camera,"navigationFinish",this._navigationFinishCallback),this._navigationStartCallback=U,this._navigationFinishCallback=k||N,U&&this.camera.addEventListener("navigationStart",U);for(var T=[],O=0,R=e.length;O<R;O++){var E=e[O];T.push(E[0],E[1],E[2]||10,E[3]||0,E[4]||0,E[5]||0)}setTimeout((function(){t.emitUIInteraction({excuteName:X.NAVIGATION,params:JSON.stringify({jsondata:T,Speed:r,Name:h,Time:l,IgnoreLag:c,LockAll:a,PatrolType:f,FollowRotation:g,RayDetectionDistance:x,FinishDestory:v})})}),100),(k||N)&&(k?this.camera.addEventListener("navigationFinish",k):this.camera.addEventListener("navigationFinish",N))}},{key:"pauseNavigation",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).patrolType,t=void 0===e?"default":e;this.emitUIInteraction({excuteName:X.NAVIGATION_PAUSE,params:{State:0,PatrolType:t}})}},{key:"resumeNavigation",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).patrolType,t=void 0===e?"default":e;this.emitUIInteraction({excuteName:X.NAVIGATION_PAUSE,params:{State:1,PatrolType:t}})}},{key:"stopNavigation",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.patrolType,n=void 0===i?"default":i,a=t.delayTime;setTimeout((function(){e.emitUIInteraction({excuteName:X.NAVIGATION_STOP,params:{PatrolType:n}})}),void 0===a?100:a)}},{key:"enableDataLayerByName",value:function(e,t){this.emitUIInteraction({excuteName:q.ENABLE_DATALAYER,params:{Visible:t,DataLayerName:e}})}},{key:"project",value:function(e,t){if(!e)return!1;this.emitUIInteraction({excuteName:X.PROJECT,params:{Position:{x:e.x,y:e.y,z:e.z}}}),this.camera.addEventListener("project",t)}},{key:"unproject",value:function(e,t){if(!e)return!1;this.emitUIInteraction({excuteName:X.UNPROJECT,params:{Position:{x:e.x,y:e.y}}}),this.camera.addEventListener("unproject",t)}},{key:"getAltitudeFromCoordinate",value:function(e,t){var i=this;if(!e)return!1;var n={Coordinate:e.coordinate,DetectLength:e.detectLength||100};this.addEventListener("getAltitude",t),setTimeout((function(){i.emitUIInteraction({excuteName:K.GET_ALTITUDE,params:n})}),100)}},{key:"exit",value:function(){console.warn("方法将被移除,请使用new LevelManage().exit()"),this.emitUIInteraction({excuteName:Q.EXIT_CLIENT})}},{key:"restartGame",value:function(){console.warn("方法将被移除,new LevelManage().restartGame()"),this.emitUIInteraction({excuteName:Q.RESTART_GAME}),this.dispatchEvent({type:"gameResarted"})}},{key:"addToScene",value:function(e){e&&(this.scene.add(e),e.materialNeedsUpdate=!1,e.matrixNeedsUpdate=!1,e.animateNeedsUpdate=!1,"TrafficLayer"===e.type?this.emitUIInteraction({excuteName:Q.CREATE_TRAFFIC_STREAM,params:e.toJSON(!1)}):"LayerBuilding"===e.type?this.emitUIInteraction({excuteName:K.EVENT_LAYER_BUILDING,params:e.toJSON(!1)}):"SlopeAnalysis"===e.type?this.emitUIInteraction({excuteName:K.UPDATA_SLOPE_ANALYSIS,params:e.toJSON()}):this.emitUIInteraction({excuteName:Z.ADD,params:e.toJSON(!1)}))}},{key:"removeFromScene",value:function(e){this.destoryObject(e)}},{key:"removeAllFromScene",value:function(){this.emitUIInteraction({excuteName:Z.DESTORY_ALL}),this.scene.clear()}},{key:"destoryObject",value:function(e){e&&("TrafficLayer"===e.type?this.emitUIInteraction({excuteName:Q.CLOSE_TRAFFIC_STREAM,params:e.toJSON(!1)}):"LayerBuilding"===e.type?(e.buildingState="destory",this.emitUIInteraction({excuteName:K.EVENT_LAYER_BUILDING,params:e.toJSON(!1)})):this.emitUIInteraction({excuteName:Z.DESTORY,uuid:e.uuid}),e.dispose&&e.dispose(),this.scene.remove(e))}},{key:"enableEdit",value:function(e,t,i){var n=null,a={};if(this.drawAndMeasureGroup||(this.drawAndMeasureGroup=new c,this.scene.add(this.drawAndMeasureGroup)),"measure"===e)switch(this.editMode="measure",n=ee.ENABLE_MEASURE,t.toLowerCase()){case"polygon":case"measurearea":if(this.drawAndMeasureGroup.measureArea)this.drawAndMeasureGroup.measureArea.updateParameters(i);else{var o=new ct(i);this.drawAndMeasureGroup.measureArea=o,this.drawAndMeasureGroup.add(o)}a=this.drawAndMeasureGroup.measureArea.toJSON();break;case"line":case"measureline":if(this.drawAndMeasureGroup.measureLine)this.drawAndMeasureGroup.measureLine.updateParameters(i);else{var r=new ut(i);this.drawAndMeasureGroup.measureLine=r,this.drawAndMeasureGroup.add(r)}a=this.drawAndMeasureGroup.measureLine.toJSON();break;case"surfaceline":if(this.drawAndMeasureGroup.surfaceline)this.drawAndMeasureGroup.surfaceline.updateParameters(i);else{var s=new ht(i);this.drawAndMeasureGroup.surfaceline=s,this.drawAndMeasureGroup.add(s)}a=this.drawAndMeasureGroup.surfaceline.toJSON();break;default:if(this.drawAndMeasureGroup.locationPoint)this.drawAndMeasureGroup.locationPoint.updateParameters(i);else{var l=new pt(i);this.drawAndMeasureGroup.locationPoint=l,this.drawAndMeasureGroup.add(l)}a=this.drawAndMeasureGroup.locationPoint.toJSON()}else switch(this.editMode="draw",n=ee.ENABLE_DRAW,t){case"polygon":if(this.drawAndMeasureGroup.polygon)for(var d in i)this.drawAndMeasureGroup.polygon[d]!==i[d]&&(this.drawAndMeasureGroup.polygon[d]=i[d]);else{var u=new it(i);this.drawAndMeasureGroup.polygon=u,this.drawAndMeasureGroup.add(u)}a=this.drawAndMeasureGroup.polygon.toJSON(0);break;case"line":if(this.drawAndMeasureGroup.line)for(var h in i)this.drawAndMeasureGroup.line[h]!==i[h]&&(this.drawAndMeasureGroup.line[h]=i[h]);else{var p=new st(i);this.drawAndMeasureGroup.line=p,this.drawAndMeasureGroup.add(p)}a=this.drawAndMeasureGroup.line.toJSON(0);break;default:if(this.drawAndMeasureGroup.point)for(var f in i)this.drawAndMeasureGroup.point[f]!==i[f]&&(this.drawAndMeasureGroup.point[f]=i[f]);else{var m=new lt(i);this.drawAndMeasureGroup.point=m,this.drawAndMeasureGroup.add(m)}a=this.drawAndMeasureGroup.point.toJSON()}this.emitUIInteraction({ExcuteName:n,params:a})}},{key:"closeEdit",value:function(){if(this.editMode){var e=ee.CLOSE_DRAW;"measure"===this.editMode&&(e=ee.CLOSE_MEASURE),this.emitUIInteraction({ExcuteName:e})}}},{key:"setFPS",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.emitUIInteraction({ExcuteName:q.ENABLE_FPS,params:{state:e}})}},{key:"removeAllEditObjects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["point","line","polygon","surfaceline"];if(this.drawAndMeasureGroup&&!(this.drawAndMeasureGroup.children.length<1)){var i=[];if(e)switch(e){case"draw":(!Array.isArray(t)||t.length<1)&&(t=["point","line","polygon"]),t.indexOf("polygon")>-1&&this.drawAndMeasureGroup.polygon&&(i.push(this.drawAndMeasureGroup.polygon.uuid),this.drawAndMeasureGroup.polygon.removeFromParent(),this.drawAndMeasureGroup.polygon=null),t.indexOf("line")>-1&&this.drawAndMeasureGroup.line&&(i.push(this.drawAndMeasureGroup.line.uuid),this.drawAndMeasureGroup.line.removeFromParent(),this.drawAndMeasureGroup.line=null),t.indexOf("point")>-1&&this.drawAndMeasureGroup.point&&(i.push(this.drawAndMeasureGroup.point.uuid),this.drawAndMeasureGroup.point.removeFromParent(),this.drawAndMeasureGroup.point=null),this.emitUIInteraction({ExcuteName:ee.DESTORY_DRAW,params:{uuids:i,Classes:t}});break;case"measure":(!Array.isArray(t)||t.length<1)&&(t=["point","line","polygon","surfaceline"]);var n=t.indexOf("polygon");n>-1&&(t.splice(n,1),t.push("MeasureArea")),n>-1&&this.drawAndMeasureGroup.measureArea&&(i.push(this.drawAndMeasureGroup.measureArea.uuid),this.drawAndMeasureGroup.measureArea.removeFromParent(),this.drawAndMeasureGroup.measureArea=null),(n=t.indexOf("line"))>-1&&(t.splice(n,1),t.push("MeasureLine")),n>-1&&this.drawAndMeasureGroup.measureLine&&(i.push(this.drawAndMeasureGroup.measureLine.uuid),this.drawAndMeasureGroup.measureLine.removeFromParent(),this.drawAndMeasureGroup.measureLine=null),(n=t.indexOf("point"))>-1&&(t.splice(n,1),t.push("LocationPoint")),n>-1&&this.drawAndMeasureGroup.locationPoint&&(i.push(this.drawAndMeasureGroup.locationPoint.uuid),this.drawAndMeasureGroup.locationPoint.removeFromParent(),this.drawAndMeasureGroup.locationPoint=null),(n=t.indexOf("surfaceline"))>-1&&(t.splice(n,1),t.push("SurfaceLine")),n>-1&&this.drawAndMeasureGroup.surfaceline&&(i.push(this.drawAndMeasureGroup.surfaceline.uuid),this.drawAndMeasureGroup.surfaceline.removeFromParent(),this.drawAndMeasureGroup.surfaceline=null),this.emitUIInteraction({ExcuteName:ee.DESTORY_MEASURE,params:{uuids:i,Classes:t}});break;case"all":this.emitUIInteraction({ExcuteName:ee.DESTORY_DRAW,params:{uuids:i,Classes:["Point","Line","Polygon"]}}),this.emitUIInteraction({ExcuteName:ee.DESTORY_MEASURE,params:{uuids:i,Classes:["MeasureArea","MeasureLine","LocationPoint","SurfaceLine"]}}),this.drawAndMeasureGroup.children=[],this.scene.remove(this.drawAndMeasureGroup),this.drawAndMeasureGroup=null}}}},{key:"connect",value:(t=N(P().mark((function t(){var i,n,a,o,r,s,l,d=arguments;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=d.length>0&&void 0!==d[0]?d[0]:function(){},n=d.length>1&&void 0!==d[1]?d[1]:function(){},o=function(e){console.log("connectToStreamer wsURL :>> ",e),window.WebSocket=window.WebSocket||window.MozWebSocket,window.WebSocket?(a.reclickToStart&&clearTimeout(a.reclickToStart),a.ws=new WebSocket(e),a.ws.onopen=function(t){a.connected||(a.dispatchEvent({type:"connected"}),a.connected=!0),console.log("".concat(e," WebSocket connection")),a.startPSHeartbeat(),console.log("Start the heartbeat detection of the signaling server.")},a.ws.onmessage=function(e){var t=JSON.parse(e.data);"config"===t.type?(console.log("%c[Inbound SS (config)]","background: lightblue; color: black",t),a.onConfig(t)):"playerCount"===t.type?console.log("%c[Inbound SS (playerCount)]","background: lightblue; color: black",t):"offer"===t.type?(console.log("%c[Inbound SS (offer)]","background: lightblue; color: black",t),a.onWebRtcOffer(t)):"answer"===t.type?(console.log("%c[Inbound SS (answer)]","background: lightblue; color: black",t),a.onWebRtcAnswer(t)):"iceCandidate"===t.type?a.onWebRtcIce(t.candidate):"warning"===t.type&&t.warning?console.warn(t.warning):"pong"===t.type?console.log("pong",t.time):console.error("Invalid SS message type",t.type)},a.ws.onerror=function(e){console.log("WS error: ".concat(JSON.stringify(e))),a.stopPSHeartbeat(),a.dispatchEvent({type:"signalingServerError"})},a.ws.onclose=function(e){console.log("WS closed: ".concat(JSON.stringify(e.code)," - ").concat(e.reason)),a.stopPSHeartbeat(),a.ws=void 0,a.isReconnection=!0,a.connected&&(a.connected=!1);var t=document.getElementById("player");a.webRtcPlayerObj&&(t.removeChild(a.webRtcPlayerObj.video),a.webRtcPlayerObj.close(),a.webRtcPlayerObj=void 0),a.showTextOverlay("云渲染服务未正常连接"),a.reclickToStart=setTimeout((function(){a.connect(i,n)}),1500)}):alert("Your browser doesn't support WebSocket")},(a=this).wsURL){t.next=35;break}if(!e.DispatchServer.host){t.next=13;break}return console.log("用新版调度服务启动 ".concat(e.DispatchServer.host,"/api/tasks/create")),t.next=9,e.DispatchServer.CreateTask(a.projectName);case 9:0===(r=t.sent).status?(a.forceTURN=r.data.useTurnServer,a.wsURL="ws://".concat(r.data.host,":").concat(r.data.port),a.currentTask=r,o(a.wsURL),i&&i("Successfully created task: "+r)):(console.error("Failed to create task:"+r.message),n&&n("Failed to create task: "+r.message)),t.next=33;break;case 13:if(!a.matchmakerIP){t.next=31;break}return s="http://".concat(a.matchmakerIP,":").concat(a.matchmakerPort,"/gpuserver?project=").concat(a.projectName),t.prev=15,t.next=18,v.get(s);case 18:if(!(l=t.sent).data||!l.data.error){t.next=22;break}return console.error(l.data.error),t.abrupt("return",!1);case 22:a.wsURL="ws://".concat(l.data.gpuServer,":").concat(l.data.port),o(a.wsURL),t.next=29;break;case 26:t.prev=26,t.t0=t.catch(15),console.error(t.t0);case 29:t.next=33;break;case 31:return console.error("Needs a matchmaker's IP"),t.abrupt("return",!1);case 33:t.next=36;break;case 35:o(a.wsURL);case 36:case"end":return t.stop()}}),t,this,[[15,26]])}))),function(){return t.apply(this,arguments)})},{key:"startPSHeartbeat",value:function(){var t=this;e.DispatchServer.host&&(this.heartbeatInterval=setInterval((function(){t.ws.readyState===WebSocket.OPEN&&(t.ws.send('{"type":"ping"}'),console.log("Heartbeat send: Ping"))}),2e3))}},{key:"stopPSHeartbeat",value:function(){this.heartbeatInterval&&clearInterval(this.heartbeatInterval)}},{key:"onConfig",value:function(e){var t=document.getElementById("player"),i=this.setupWebRtcPlayer(t,e);switch(this.eventHandler.resizePlayerStyle(),this.inputOptions.controlScheme){case oe.HoveringMouse:this.eventHandler.registerHoveringMouseEvents(i);break;case oe.LockedMouse:this.eventHandler.registerLockedMouseEvents(i);break;default:console.log("ERROR: Unknown control scheme ".concat(this.inputOptions.controlScheme)),this.eventHandler.registerLockedMouseEvents(i)}}},{key:"setupModelInfo",value:function(e,t,i,n){if(!e)return!1;if(!n){var a=new URL(e),o=a.protocol,r=a.host,s=a.search,l=a.pathname.split("/").filter(Boolean);0===l.length?l.push("getStaticResourceUrl"):l[l.length-1]="getStaticResourceUrl";var d="/"+l.join("/");n="".concat(o,"//").concat(r).concat(d).concat(s)}t||(t={all:1,common:1,project_id:"418690084255052706"}),this.emitUIInteraction({excuteName:q.ASSET_MODEL,params:{ModInfoUrl:e,StaticResourceURL:n,ModInfoBody:t,ModInfoHeader:i}})}},{key:"initOthers",value:function(){var e=this;this.initCamera(),document.addEventListener("keydown",(function(e){(116===e.keyCode||e.ctrlKey&&82===e.keyCode)&&(window._frash_=!0)})),this.isSequencer&&(this.sequencerEnvironment=new ge(this)),window.onbeforeunload=function(){e.levelReady||window._frash_||(e.levelReady=!0),window._frash_=!1}}},{key:"load",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};"cloud"==this.renderMode&&(this.eventHandler.setupHtmlEvents(),this.eventHandler.setupFreezeFrameOverlay(),this.eventHandler.registerKeyboardEvents(),window.addEventListener("resize",(function(){return e.updateVideoStreamSize()})),this.start(t,i),vt((new Date).getTime()))}}]);var t}();function vt(){gt(vt),y.update()}function bt(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"!=typeof e)throw new Error("decodeBase64: 输入必须是字符串");var i=e.replace(/[\s=]/g,"");try{for(var n=atob(i),a=new Uint8Array(n.length),o=0;o<n.length;o++)a[o]=n.charCodeAt(o);return t?a:(new TextDecoder).decode(a)}catch(e){throw new Error("decodeBase64: 无效的 Base64 字符串")}}O(yt,"DispatchServer",mt);var xt={encodeBase64:function(e){if("string"==typeof e){var t=(new TextEncoder).encode(e);return btoa(String.fromCharCode.apply(String,F(t)))}if(e instanceof Uint8Array)return btoa(String.fromCharCode.apply(String,F(e)));throw new Error("encodeBase64: 输入必须是字符串或 Uint8Array")},decodeBase64:bt,isValidBase64:function(e){if("string"!=typeof e)return!1;if(!/^[A-Za-z0-9+/]*={0,2}$/.test(e))return!1;try{return bt(e),!0}catch(e){return!1}}},St=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).parameters=i,t.renderNum=void 0===i.renderNum?20:i.renderNum,t.visible=void 0===i.visible||i.visible;var n=i.width||1,a=i.circleScale||50,o=void 0!==i.startHide&&i.startHide,r=void 0!==i.endHide&&i.endHide,s=i.speed||.5,l=i.opacity||.02,d=i.brightness||100,c=i.angle||40;return t.type="ODLine",Object.defineProperties(t,{angle:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},width:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},circleScale:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,t.materialNeedsUpdate=!0}},startHide:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},endHide:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},speed:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}},opacity:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},brightness:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,t.materialNeedsUpdate=!0}}}),t}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=Fe(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Angle:this.angle,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,Width:this.width,CircleScale:this.circleScale,StartHide:this.startHide,EndHide:this.endHide,Speed:this.speed,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,RenderNum:this.renderNum}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.width=t.width,this.circleScale=t.circleScale,this.speed=t.speed,this.startHide=t.startHide,this.endHide=t.endHide,B(e,"copy",this)([t,i]),this}}])}();function Nt(e){switch(e){case 0:return"DoNotFcaeToCamera";case 1:default:return"FacetoCamera_XYZ";case 2:return"FacetoCamera_Y";case 3:return"FacetoCamera_Z"}}var wt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).renderNum=void 0===i.renderNum?20:i.renderNum;var n=i.pivot||{x:.5,y:.5};t.visible=void 0===i.visible||i.visible,t.isGlobalPOI=void 0!==i.isGlobalPOI&&i.isGlobalPOI;var a=i.text||null,o=i.iconUrl||"",r=i.texture||"",s=i.width||32,l=i.height||32,d=i.iconPathName||"",c=void 0===i.hideText||i.hideText,u=void 0!==i.hideImage&&i.hideImage,h=i.renderScale||1;t.renderType=i.renderType||0,t.openCollision=void 0!==i.openCollision&&i.openCollision;var p=0===i.faceType?0:i.faceType||1,f=void 0!==i.switchScale&&i.switchScale,m=i.minScale||0,g=i.maxScale||0,y=i.fontSize||12;return t.fadeIn=void 0===i.fadeIn||i.fadeIn,t.type="IconPoint",Object.defineProperties(t,{pivot:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},text:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,t.materialNeedsUpdate=!0}},iconUrl:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},texture:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},width:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}},height:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},faceType:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){p=e,t.materialNeedsUpdate=!0}},switchScale:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){f=e,t.materialNeedsUpdate=!0}},minScale:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){m=e,t.materialNeedsUpdate=!0}},maxScale:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){g=e,t.materialNeedsUpdate=!0}},iconPathName:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,t.materialNeedsUpdate=!0}},hideText:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},hideImage:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,t.materialNeedsUpdate=!0}},renderScale:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,t.materialNeedsUpdate=!0}},fontSize:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){y=e,t.materialNeedsUpdate=!0}}}),t}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=We(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Pivot:this.pivot,Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,IconUrl:this.iconUrl,Width:this.width,Height:this.height,IconPathName:this.iconPathName,IsGlobalPOI:this.isGlobalPOI,HideText:this.hideText,HideImage:this.hideImage,RenderScale:this.renderScale,FontSize:this.fontSize,RenderType:this.renderType,FadeIn:this.fadeIn,OpenCollision:this.openCollision,FaceType:Nt(this.faceType),SwitchScale:this.switchScale,MaxScale:this.maxScale,MinScale:this.minScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation,RenderNum:this.renderNum}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},FadeIn:this.fadeIn,type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.iconUrl=t.iconUrl,this.width=t.width,this.height=t.height,this.iconPathName=t.iconPathName,this.hideText=t.hideText,this.hideImage=t.hideImage,this.renderScale=t.renderScale,this.fontSize=t.fontSize,B(e,"copy",this)([t,i]),this}}])}(),Ut=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).renderNum=void 0===i.renderNum?20:i.renderNum,t.visible=void 0===i.visible||i.visible,t.isGlobalPOI=void 0!==i.isGlobalPOI&&i.isGlobalPOI;var n=i.backgroundColor||{r:0,g:0,b:0,a:0},a=i.backgroundImage||"",o=t.getMargin(i.margin)||{Top:0,Right:0,Bottom:0,Left:0},r=i.fontSize||24,s=i.fontWeight||"Regular",l=i.borderWidth||0,d=i.borderColor||{r:0,g:0,b:0,a:1},c=i.shadowColor||{r:0,g:0,b:0,a:1},u=i.shadowOffset||{x:0,y:0},h=i.pivot||{x:.5,y:.5};t.renderType=i.renderType||0,t.fadeIn=void 0===i.fadeIn||i.fadeIn,t.openCollision=void 0!==i.openCollision&&i.openCollision;var p=0===i.faceType?0:i.faceType||1,f=void 0!==i.switchScale&&i.switchScale,m=i.minDistance||0,g=i.maxDistance||0,y=void 0===i.minScale?1:i.minScale,v=void 0===i.maxScale?1:i.maxScale;return t.autoWrap=i.autoWrap||!1,t.type="TextPoint",Object.defineProperties(t,{backgroundImage:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,t.materialNeedsUpdate=!0}},backgroundColor:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},margin:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=t.getMargin(e),t.materialNeedsUpdate=!0}},fontSize:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},fontWeight:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}},borderWidth:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},borderColor:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,t.materialNeedsUpdate=!0}},shadowColor:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},shadowOffset:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,t.materialNeedsUpdate=!0}},pivot:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,t.materialNeedsUpdate=!0}},faceType:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){p=e,t.materialNeedsUpdate=!0}},switchScale:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){f=e,t.materialNeedsUpdate=!0}},minDistance:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){m=e,t.materialNeedsUpdate=!0}},maxDistance:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){g=e,t.materialNeedsUpdate=!0}},minScale:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){y=e,t.materialNeedsUpdate=!0}},maxScale:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){v=e,t.materialNeedsUpdate=!0}}}),t}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=We(e)}},{key:"getMargin",value:function(e){var t;if(Array.isArray(e))return e.length<2?t={Top:e[0]||0,Right:e[0]||0,Bottom:e[0]||0,Left:e[0]||0}:e.length<3?t={Top:e[0]||0,Right:e[1]||0,Bottom:e[0]||0,Left:e[1]||0}:e.length<4?t={Top:e[0]||0,Right:e[1]||0,Bottom:e[2]||0,Left:e[1]||0}:e.length<5&&(t={Top:e[0]||0,Right:e[1]||0,Bottom:e[2]||0,Left:e[3]||0}),t}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,FadeIn:this.fadeIn,type:this.type,name:this.name,uuid:this.uuid}:{Pivot:this.pivot,Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},BackgroundColor:{r:this.backgroundColor.r,g:this.backgroundColor.g,b:this.backgroundColor.b,a:this.backgroundColor.a},BackgroundImageURL:this.backgroundImage,IsGlobalPOI:this.isGlobalPOI,Margin:this.margin,AutoWrap:this.autoWrap,Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,FontWeight:this.fontWeight,FontSize:this.fontSize,BorderWidth:this.borderWidth,BorderColor:this.borderColor,ShadowColor:this.shadowColor,ShadowOffset:this.shadowOffset,RenderType:this.renderType,FadeIn:this.fadeIn,OpenCollision:this.openCollision,FaceType:Nt(this.faceType),SwitchScale:this.switchScale,MinDistance:this.minDistance,MaxDistance:this.maxDistance,MaxScale:this.maxScale,MinScale:this.minScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,RenderNum:this.renderNum}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontWeight=t.fontWeight,this.fontSize=t.fontSize,this.borderWidth=t.borderWidth,this.borderColor=t.borderColor,this.shadowColor=t.shadowColor,this.shadowOffset=t.shadowOffset,B(e,"copy",this)([t,i]),this}}])}();function Ct(e,t){var i={};if(Object.assign(i,t),i.style){var n=i.style,a=n.width,o=n.height,r=n.borderRadius,s=n.borderWidth,l=n.paddingTop,d=n.paddingLeft;i.style.width=a*e,i.style.height=o*e,r&&(i.style.borderRadius=r*e),s&&(i.style.borderWidth=s*e),l&&(i.style.paddingTop=l*e),d&&(i.style.paddingLeft=d*e)}return i.content&&i.content.forEach((function(t){for(var i in t)"number"==typeof t[i]&&"id"!==i&&(t[i]=t[i]*e);var n=t.position;n&&(t.position=n.map((function(t){return t*e}))),t.textList&&t.textList.forEach((function(t){t.fontSize=t.fontSize*e,t.position=t.position.map((function(t){return t*e}))}))})),i}var kt=function(){function e(t){var i;U(this,e),(i=w(this,e,[t])).renderNum=void 0===t.renderNum?20:t.renderNum,i.name=t.name||"",i.pivot=t.pivot||{x:.5,y:.5},i.offset=t.offset||{x:0,y:0,z:0},i.sizeAttenuation=t.sizeAttenuation||!1,i.constructionConfig=t.constructionConfig||{},i.labelType=t.labelType||"sprite",i.hideText=t.hideText||!1,i.faceType=0===t.faceType?0:t.faceType||1,i.switchScale=t.switchScale||!1,i.renderType=t.renderType||0;var n=t.renderScale||.3;i.minScale=t.minScale||1,i.maxScale=t.maxScale||1,i.type="IconPoint",i.visible=void 0===t.visible||t.visible,i.fadeIn=void 0===t.fadeIn||t.fadeIn;var a=t;return("mesh"===i.labelType||i.sizeAttenuation)&&(a=Ct(n,t)),i.style=a.style,i.drawCanvas=document.createElement("canvas"),i.animationCanvas=document.createElement("canvas"),i.mainView=null,i.sprite=null,i.texture=null,i.animateId=null,i.size=t.size||20,i.extraProps={args:t},a.style?(i.init(a).then((function(){i.materialNeedsUpdate=!0})),Object.defineProperties(i,{renderScale:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,i.materialNeedsUpdate=!0}}}),i):(console.warn("请正确设置BasicLabel的style"),L(i))}return z(e,tt),k(e,[{key:"init",value:(n=N(P().mark((function t(){var i,n,a,o=arguments;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=o.length>0&&void 0!==o[0]?o[0]:{},(n=this.style).height,n.width,this.mainView=document.createElement("canvas"),t.next=5,e.initBackGround(this.style,this.mainView);case 5:if(a=t.sent,this.drawCanvas.width=this.animationCanvas.width=a.width,this.drawCanvas.height=this.animationCanvas.height=a.height,this.factor=a.factor,this.width=a.width,this.height=a.height,this.dispatchEvent({type:"loaded",label:this}),!i.content){t.next=15;break}return t.next=15,this.drawContent(i.content,!0);case 15:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"drawContent",value:function(){var t=N(P().mark((function t(i){var n,a,o,r,s=arguments;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s.length>1&&void 0!==s[1]&&s[1]||"mesh"!==this.labelType&&!this.sizeAttenuation||(i=Ct(this.renderScale,{content:i}).content),n=this.drawCanvas.getContext("2d"),a=this.drawCanvas,o=a.width,r=a.height,n.clearRect(0,0,o,r),n.drawImage(this.mainView,0,0,o,r),t.next=8,e.renderContent(this.style,i,this.drawCanvas,this.factor);case 8:this.texture=Ve(this.drawCanvas),this.dispatchEvent({type:"contentLoaded",label:this});case 10:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"updateContent",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t;("mesh"===this.labelType||this.sizeAttenuation)&&(i=Ct(this.renderScale,t)),this.extraProps={args:t},i.style&&(this.style=i.style),this.init(i).then((function(){e.materialNeedsUpdate=!0}))}},{key:"getFinalFaceType",value:function(e){if(e)switch(e){case 0:return"DoNotFcaeToCamera";case 1:default:return"FacetoCamera_XYZ";case 2:return"FacetoCamera_Y";case 3:return"FacetoCamera_Z"}return"FacetoCamera_XYZ"}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Pivot:this.pivot,Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,HideText:this.hideText,RenderType:this.renderType,FadeIn:this.fadeIn,OpenCollision:this.openCollision,FaceType:this.getFinalFaceType(this.faceType),SwitchScale:this.switchScale,MaxScale:this.maxScale,MinScale:this.minScale,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:1,y:1,z:1},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,Width:this.width,Height:this.height,RenderScale:this.renderScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation,RenderNum:this.renderNum}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},FadeIn:this.fadeIn,type:this.type,name:this.name,uuid:this.uuid}}},{key:"dispose",value:function(){this.children=[],this.sprite=null,this.texture=null,this.drawCanvas=null,this.animationCanvas=null,this.mainView=null}}],[{key:"initBackGround",value:(i=N(P().mark((function t(i,n){var o,r,s,l,d,c,u,h,p,f,m,g,y,v,b,x,S,N,w,U,C,k;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=i.height,r=i.width,s=i.backgroundImage,l=i.borderRadius,d=i.borderColor,c=i.borderWidth,u=i.backgroundColor,h=i.clip,p=r,f=o,m=n.getContext("2d"),g=a.ceilPowerOfTwo(p),y={width:g,height:g*(f/p),factor:{xScale:g/p,yScale:g/p}},n.width=y.width,n.height=y.height,v=y.factor,b=v.xScale,x=v.yScale,!s){t.next=16;break}return t.next=12,e.loadImg(s,"");case 12:S=t.sent,m.drawImage(S,0,0,p*b,f*x),t.next=17;break;case 16:(d||u)&&(m.strokeStyle=d,m.fillStyle=u,m.lineWidth=c?c*b:1*b,e.roundRect(m,m.lineWidth*b,m.lineWidth*x,(p-2*m.lineWidth)*b,(f-2*m.lineWidth)*x,l?l*b:0),u&&m.fill(),d&&m.stroke());case 17:return h&&(N=_(h,4),w=N[0],U=N[1],C=N[2],k=N[3],m.beginPath(),m.moveTo(k*p*b,w*f*x),m.lineTo((1-U)*p*b,w*f*x),m.lineTo((1-U)*p*b,(1-C)*f*x),m.lineTo(k*p*b,(1-C)*f*x),m.lineTo(k*p*b,w*f*x),m.closePath(),m.clip()),t.abrupt("return",y);case 19:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)})},{key:"renderContent",value:(t=N(P().mark((function t(i,n,a,o){var r,s,l,d,c,u,h,p,f,m,g,y,v,b,x,S,N,w,U,C,k,T,O,R,E,z,I,M,A,L,D,B,F,W,j,H,G,V,J,Y,q;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=a.getContext("2d"),s=a.width,l=a.height,d=i.paddingTop,c=i.paddingLeft,u=0,h=0,p=0,f=0,m=o.xScale,g=o.yScale,b=[y=c?c*m:0,v=d?d*g:0],x=[],S=0;case 13:if(!(S<n.length)){t.next=46;break}if(N=n[S],w=N.width,U=N.height,C=N.textList,k=N.marginRight,T=N.marginBottom,O=N.backgroundImage,R=N.borderRadius,E=N.borderColor,z=N.borderWidth,I=N.backgroundColor,M=N.position,A=N.id,L=N.activeInfo,D=void 0===L?{}:L,M&&(B=_(M,2),F=B[0],W=B[1],b[0]=y+F*m,b[1]=v+W*g,u=0,h=0,p=0,f=0),!w||!U){t.next=42;break}if(b[0]+w*m>s&&((p+=u)+U*g<=h?(b[0]=f,b[1]+=u):(b[0]=c?c*m:0,b[1]+=u,h=0,f=0)),!O){t.next=32;break}return t.prev=20,t.next=23,e.loadImg(O,"");case 23:j=t.sent,r.drawImage(j,b[0],b[1],w*m,U*g),t.next=30;break;case 27:t.prev=27,t.t0=t.catch(20),console.warn(t.t0);case 30:t.next=33;break;case 32:I&&(r.strokeStyle=E,r.fillStyle=I,r.lineWidth=z?z*m:1*m,e.roundRect(r,b[0]+r.lineWidth*m,b[1]+r.lineWidth*m,(w-2*r.lineWidth)*m,(U-2*r.lineWidth)*g,R?R*m:0),I&&r.fill(),E&&r.stroke());case 33:C&&C.forEach((function(t){var i=_(t.position,2),n=i[0],a=i[1],s=[b[0]+n*m,b[1]+a*g];e.drawText(r,t,o,s)})),H=b[0]===(c?c*m:0)*m?-.16:-1.3,G=-(l-b[1]-25*g)*(2.05/(107*g))+.1,A&&(V=D.position,J=D.style,Y=void 0===J?{width:5,height:.95}:J,(q=e.addActiveArea(V||{x:H,y:G},Y)).customId=A,x.push(q)),b[0]+=(w+(k||0))*m,(u=(U+(T||0))*g)>h&&(h=u,f=b[0]),t.next=43;break;case 42:C&&C.forEach((function(t){var i=_(t.position,2),n=i[0],a=i[1],s=[b[0]+n*m,b[1]+a*g];e.drawText(r,t,o,s)}));case 43:S++,t.next=13;break;case 46:return t.abrupt("return",x);case 47:case"end":return t.stop()}}),t,null,[[20,27]])}))),function(e,i,n,a){return t.apply(this,arguments)})},{key:"getRectangle",value:function(e,t,i){var n=new u(A({map:i,transparent:!0,fog:!0,depthWrite:!1},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}));n.map&&(n.map.needsUpdate=!0),n.transparent=!0;var a=(.01*e).toFixed(2),o=(.01*t).toFixed(2),r=new h(Number(a),Number(o),1,1),s=new p(r,n);return s.setWidth=a,s.setHeight=o,s}},{key:"loadImg",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=new Image;return i.crossOrigin="Anonymous",i.src=t+e,new Promise((function(e,t){i.addEventListener("load",(function(){e(i)})),i.onerror=function(e){t(e)}}))}},{key:"getTextWidth",value:function(e,t){var i=t.fontSize,n=t.fontFamily,a=t.color,o=t.text,r=e.getContext("2d");return r.font="".concat(i,"px ").concat(n),r.fillStyle=a,r.textAlign="left",r.measureText(o).width}},{key:"drawText",value:function(e,t,i,n){var a,o=i.xScale,r=_(n,2),s=r[0],l=r[1],d=t.text,c=t.fontSize,u=t.fontFamily,h=t.color,p=t.textAlign,f=t.icon;if(d||"number"==typeof d||f)if(d&&f)console.warn("BasicLabel Warning:text和icon不要同时设置");else{if(a=d,e.font="".concat(c*o,"px ").concat(u),e.fillStyle=h,e.textAlign=p||"left",e.textBaseline="top",f){var m=f;-1!==f.indexOf("&amp;")&&(m=f.replace("&amp;","&")),-1!==f.indexOf("&amp")&&(m=f.replace("&amp","&")),a=new Function('return ("'+"".concat(m).replace("&#x","\\u").replace(";","")+'")')()}e.measureText(a).width,e.fillText(a,s,l)}}},{key:"addActiveArea",value:function(e,t){var i=t.width,n=t.height,a=e.x,o=e.y,r=new f({depthTest:!0,depthWrite:!1,transparent:!0,sizeAttenuation:!0,opacity:0}),s=new m(r);return s.scale.set(i,n,1),s.material.color=new d("#58d2d4"),s.center.set(a,o),s}},{key:"roundRect",value:function(e,t,i,n,a,o){e.beginPath(),e.moveTo(t+o,i),e.lineTo(t+n-o,i),e.quadraticCurveTo(t+n,i,t+n,i+o),e.lineTo(t+n,i+a-o),e.quadraticCurveTo(t+n,i+a,t+n-o,i+a),e.lineTo(t+o,i+a),e.quadraticCurveTo(t,i+a,t,i+a-o),e.lineTo(t,i+o),e.quadraticCurveTo(t,i,t+o,i),e.closePath()}}]);var t,i,n}(),Tt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Cone",i}return z(e,tt),k(e)}(),Ot=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:1,g:0,b:0,a:1},brightness:100};return U(this,e),(t=w(this,e,[i])).type="FlashCar",t}return z(e,tt),k(e)}(),Rt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:1,g:0,b:0,a:1},brightness:100};return U(this,e),(t=w(this,e,[i])).type="FlashCarCrash",t}return z(e,tt),k(e)}(),Et=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:1,g:0,b:0,a:1},brightness:100};return U(this,e),(t=w(this,e,[i])).type="FlashPeople",t}return z(e,tt),k(e)}(),zt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Cylinder",i}return z(e,tt),k(e)}(),It=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Decal",i}return z(e,tt),k(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.animateJson){var t=this.animateJson,i=t.From,n=t.To;if(i&&i.scale){var a=i.scale,o=a.x,r=a.z;i.scale.x=r,i.scale.z=o}if(n&&n.scale){var s=n.scale,l=s.x,d=s.z;n.scale.x=d,n.scale.z=l}}return!this.visibleNeedsUpdate||!e||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Scroll:this.scroll,Speed:this.speed,Texture:this.texture,GardientDirection:this.gardientDirection,Color2:{r:this.color2.r,g:this.color2.g,b:this.color2.b,a:this.opacity},BrightnessColor:this.brightnessColor?{r:this.brightnessColor.r,g:this.brightnessColor.g,b:this.brightnessColor.b,a:1}:this.Color,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.z,y:this.scale.y,z:this.scale.x},Rotation:{x:this.rotation.x,y:this.rotation.y+90,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid,jsondata:e?null:this.data,animateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.z,y:this.scale.y,z:this.scale.x},Rotation:{x:this.rotation.x,y:this.rotation.y+90,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}(),Mt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Plane",i}return z(e,tt),k(e)}(),At=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="QuadPyramid",i}return z(e,tt),k(e)}(),Lt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Sphere",i}return z(e,tt),k(e)}(),Pt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="TrafficCone",i}return z(e,tt),k(e)}(),Dt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Circle",i}return z(e,tt),k(e)}(),_t=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Torus",i}return z(e,tt),k(e)}(),Bt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Tube",i}return z(e,tt),k(e)}(),Ft=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="DiamondSign",i}return z(e,tt),k(e)}(),Wt=function(){function i(e){var t;U(this,i),(t=w(this,i,[e])).type="Heatmap",t.kind=e.kind||"texture",t.visible=void 0===e.visible||e.visible,t.container=e.container,t.width=e.width||512,t.height=e.height||512,t.min=e.min,t.max=e.max,t.xName=e.xName,t.yName=e.yName,t.valueName=e.valueName,t.backgroundColor=e.backgroundColor,t.gradient=e.gradient,t.radius=e.radius||40,t.blur=e.blur||.85,t.opacity=e.opacity,t.minOpacity=e.minOpacity||0,t.maxOpacity=e.maxOpacity||1,t.heatmapInstance=null,t.size=e.size||null,t.center=e.center,t.minHeight=e.minHeight||0,t.maxHeight=e.maxHeight||500,t.duration=a.clamp(e.duration||1,0,100),t.data=e.data;var n,o=e.particle||{},r=o.bound||{x:100,y:100,z:0},s=o.scaleBoxXY||1,l=o.noiseStrength||0,d=o.grayPower||1,c=parseInt(o.countX,10)||400,u=parseInt(o.countY,10)||400;return t.particleMaxHeight=o.maxHeight||0,"noiseMap"in o&&(t.noiseMap=n=o.noiseMap,Je(n)||Ge(n,(function(e){e&&(t.noiseMap=n=e)}))),"particle"===t.kind&&(t.gradient={0:"rgb(0, 0, 0)",1:"rgb(256, 256, 256)"}),t.init(),Object.defineProperties(t,{bound:{enumerable:!0,get:function(){return r},set:function(e){e&&"particle"===this.kind&&(r.x=e.x,r.y=e.y,r.z=e.z,this.matrixNeedsUpdate=!0)}},scaleBoxXY:{enumerable:!0,get:function(){return s},set:function(e){console.log(e,s,this.kind),e!==s&&"particle"===this.kind&&(s=e,this.matrixNeedsUpdate=!0)}},noiseStrength:{enumerable:!0,get:function(){return l},set:function(e){e!==l&&"particle"===this.kind&&(l=e,this.matrixNeedsUpdate=!0)}},grayPower:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e!==d&&"particle"===this.kind&&(d=e,this.matrixNeedsUpdate=!0)}},countX:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e!==c&&"particle"===this.kind&&(c=parseInt(e,10),this.matrixNeedsUpdate=!0)}},countY:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e!==u&&"particle"===this.kind&&(u=parseInt(e,10),this.matrixNeedsUpdate=!0)}}}),t}return z(i,tt),k(i,[{key:"init",value:function(){if("particle"===this.kind&&this.data.length<2)console.error("数据量过少,无法绘制粒子热力图");else{var i=function(e,t,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=a.width,r=a.height,s=a.radius,l=void 0===s?40:s;if(!e||e.length<1)return!1;for(var d=1/0,c=-1/0,u={longitude:1/0,latitude:1/0},h={longitude:-1/0,latitude:-1/0},p=0,f=e.length;p<f;p++){var m=n?e[p][n]:e[p].value;d=Math.min(m,d),c=Math.max(m,c),t&&(e[p].x=e[p][t]),i&&(e[p].y=e[p][i]),n&&(e[p].value=e[p][n]),e[p].longitude&&e[p].latitude&&(u.longitude=Math.min(u.longitude,e[p].longitude),u.latitude=Math.min(u.latitude,e[p].latitude),h.longitude=Math.max(h.longitude,e[p].longitude),h.latitude=Math.max(h.latitude,e[p].latitude))}if(e[0].longitude&&e[0].latitude){if(!e[0].hasOwnProperty("x")&&!e[0].hasOwnProperty("y")){for(var g=h.longitude-u.longitude,y=h.latitude-u.latitude,v=1.2*l,b=.5,x=Math.min(v,o*(1-b)/2),S=Math.min(v,r*(1-b)/2),N=o-2*x,w=r-2*S,U=0,C=e.length;U<C;U++)e[U].x=Math.round(x+N*(e[U].longitude-u.longitude)/g),e[U].y=Math.round(S+w*(e[U].latitude-u.latitude)/y);var k=g*(x/N),T=y*(S/w);return{min:d,max:c,bbox:{min:{longitude:u.longitude-k,latitude:u.latitude-T},max:{longitude:h.longitude+k,latitude:h.latitude+T}},originalBbox:{min:A({},u),max:A({},h)}}}return{min:d,max:c,bbox:{min:u,max:h}}}return{min:d,max:c}}(this.data,this.xName,this.yName,this.valueName,{width:this.width,height:this.height,radius:this.radius});if(i&&(void 0===this.min&&(this.min=i.min),void 0===this.max&&(this.max=i.max),i.bbox)){if(!this.center){var n=.5*(i.bbox.min.longitude+i.bbox.max.longitude),a=.5*(i.bbox.min.latitude+i.bbox.max.latitude);this.center={x:n,y:a,z:10}}if(!this.size&&"particle"!==this.kind){var o=i.bbox.max.longitude-i.bbox.min.longitude,r=i.bbox.max.latitude-i.bbox.min.latitude;this.size={x:1e5*o,y:1e5*r}}this.bbox=i.bbox}var s=this.data,l=this.max,d=this.min;if(this.heatmapInstance)this.heatmapInstance.configure(this.getConfig()),this.heatmapInstance.setData({max:l,min:d,data:s}),this.heatmapInstance.repaint();else{this.container||(this.container=jt(this.width,this.height));var c=function(e){if(!e)return!1;var t=e.container||jt(e),i=b.create({container:t,backgroundColor:e.backgroundColor||"rgba(0,0,0,.95)",gradient:e.gradient||{0:"rgb(50, 50, 256)",.1:"rgb(50, 250, 56)",.5:"rgb(250, 250, 56)",1:"rgb(250, 50, 56)"},radius:e.radius||40,opacity:e.opacity,maxOpacity:e.maxOpacity||1,minOpacity:e.minOpacity||0});return i}(this.getConfig());c&&(this.heatmapInstance=c,this.heatmapInstance.setData({max:l,min:d,data:s}))}this.canvas||(this.canvas=this.container.children[0]),this.texture=Ve(this.canvas),this.materialNeedsUpdate=!0,this.center||(this.center=new t(0,0,10)),"particle"!==this.kind&&(this.size||(this.size=new e(this.width,this.height)),this.scale.set(this.size.x,this.size.y,200)),this.position.set(this.center.x,this.center.y,this.center.z)}}},{key:"setData",value:function(e){return!1}},{key:"getConfig",value:function(){return{container:this.container,backgroundColor:this.backgroundColor,gradient:this.gradient,radius:this.radius,opacity:this.opacity,maxOpacity:this.maxOpacity||1,minOpacity:this.minOpacity||0,blur:this.blur||0,width:this.width,height:this.height}}},{key:"repaint",value:function(e){e&&(this.duration=a.clamp(e,.1,100)),this.init()}},{key:"getGeojsonData",value:function(){if(this.container&&this.heatmapInstance){for(var e,t=(this.maxHeight-this.minHeight)/(this.max-this.min),i=this.heatmapInstance._renderer._palette,n=[],a=this.size.x/this.width,o=this.size.y/this.height,r=1/256,s=null===(e=this.heatmapInstance)||void 0===e?void 0:e.getData().data,l=0,d=s.length;l<d;l++){var c=parseInt(s[l].x,10),u=parseInt(s[l].y,10),h=Math.max(Math.min(s[l].value,this.max),this.min),p=(h-this.min)*t+this.minHeight,f=Math.floor((h-this.min)/(this.max-this.min)*252),m=s[l].radius,g={r:i[4*f]*r,g:i[4*f+1]*r,b:i[4*f+2]*r};if(!(p<1)){var y={type:"Feature",properties:{id:l,height:p,color:g,xSize:m,ySize:m},geometry:{type:"Point",coordinates:[a*(c-.5*this.width)/1e5,o*(u-.5*this.height)/1e5]}};n.push(y)}}return n}return!1}},{key:"toJSON",value:function(){var e,t;if((!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&(!this.visible||!this.materialNeedsUpdate))return{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid};if("texture"===this.kind.toLowerCase())return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,Duration:this.duration,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,Kind:this.kind,uuid:this.uuid,RawData:this.data,Min:(null===(e=this.bbox)||void 0===e?void 0:e.min)||null,Max:(null===(t=this.bbox)||void 0===t?void 0:t.max)||null,CanvasWidth:this.width,CanvasHeight:this.height};if("particle"===this.kind.toLowerCase())return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,Duration:this.duration,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,Kind:this.kind,uuid:this.uuid,Bound:this.bound,ScaleBoxXY:this.scaleBoxXY,NoiseStrength:this.noiseStrength,NoiseMap:this.noiseMap,GrayPower:this.grayPower,MaxHeight:this.particleMaxHeight||this.maxHeight,countX:this.countX,countY:this.countY,Min:this.bbox.min,Max:this.bbox.max};var i=this.getGeojsonData();return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,Kind:this.kind,uuid:this.uuid,jsondata:i}}}])}();function jt(e,t){var i=document.createElement("div");return i.style.width=e?e+"px":"512px",i.style.height=t?t+"px":"512px",i.style.top="0px",i.style.display="none",document.getElementsByTagName("body")[0].appendChild(i),i}var Ht=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).renderNum=void 0===i.renderNum?20:i.renderNum,t.type="Particle";var n=i.kind||he.FIRE_SMALL,o=i.spawnRate||30,r=i.brightness||3,s=i.lifeTime||1,l=new d(1,0,1);i.brightnessColor&&(l.r=a.clamp(i.brightnessColor.r,0,1),l.g=a.clamp(i.brightnessColor.g,0,1),l.b=a.clamp(i.brightnessColor.b,0,1));var c=i.speed||5,u=i.height||200,h=i.width||.01,p=i.zVelocity||100;return t.thickness=i.thickness||.2,Object.defineProperties(t,{kind:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},spawnRate:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},brightness:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},brightnessColor:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l.r=e.r,l.g=e.g,l.b=e.b,l.a=1,t.materialNeedsUpdate=!0)}},speed:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},height:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,t.materialNeedsUpdate=!0}},width:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,t.materialNeedsUpdate=!0}},zVelocity:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){p=e,t.materialNeedsUpdate=!0}},lifeTime:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}}}),t}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=We(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,BrightnessColor:this.brightnessColor?{r:this.brightnessColor.r,g:this.brightnessColor.g,b:this.brightnessColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},SpawnRate:this.spawnRate,Speed:this.speed,Height:this.height,ZVelocity:this.zVelocity,LifeTime:this.lifeTime,Width:this.width,Kind:this.kind,type:this.type,uuid:this.uuid,Thickness:this.thickness,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,RenderNum:this.renderNum}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.size=t.size,this.kind=t.kind,this.thickness=t.thickness,B(e,"copy",this)([t,i]),this}}])}(),Gt=function(){function e(i){var n;return U(this,e),(n=w(this,e)).type="TrafficLayer",n.url=i.url,n.eventName=i.eventName||"geo_window_state",n.interval=i.interval||100,n._message=null,n.message=i.message,n.query=i.query,n.label=new Me,n.label.visible=void 0!==i._labelVisible&&i._labelVisible,n.rayDetectionDistance=i.rayDetectionDistance||0,n.uiRenderDistance=i.uiRenderDistance||5e4,n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.followNeedsUpdate=!1,n.labelVisible=i.labelVisible,n.offset=new t,n.handShakePath=i.handShakePath||"socket.io",n.namespace=i.namespace||"/",n.carRenderDistance=i.carRenderDistance||3e5,n.labelGroup=i.labelGroup||"highSpeed",n.labelScale=void 0===i.labelScale?1:i.labelScale,n.labelRenderType=void 0===i.labelRenderType?0:i.labelRenderType,n.enableLabelCulling=i.enableLabelCulling||!1,n.isSubsection=i.isSubsection||!1,n.plateEncode=i.plateEncode||!1,n.plateEncoding=i.plateEncoding||"auto",n}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"labelVisible",get:function(){return this.label.visible},set:function(e){e!==this.label.visible&&(this.materialNeedsUpdate=!0,this.label.visible=e&&!0)}},{key:"message",get:function(){return this._message},set:function(e){this.messageNeedsUpdate=!0,this._message=e}},{key:"setLabelVisible",value:function(e){e!==this.label.visible&&(this.materialNeedsUpdate=!0,this.label.visible=e)}},{key:"getLabelVisible",value:function(){return this.label.visible}},{key:"dispose",value:function(){return!1}},{key:"followTraffic",value:function(e){var t=e.zoomLength,i=void 0===t?-1:t,n=e.followPitch,a=void 0===n?999:n;this.isFollow=null==e?void 0:e.isFollow,this.followCarId=null==e?void 0:e.carId,this.followCarPlateNumber=null==e?void 0:e.plateNumber,this.followColor=(null==e?void 0:e.color)||{r:0,g:1,b:.8},this.followRotations=(null==e?void 0:e.followRotations)||{Roll:!1,Pitch:!1,Yaw:!1},this.zoomLength=i,this.followPitch=a,this.followNeedsUpdate=!0}},{key:"followGroups",value:function(e){this.isFollow=null==e?void 0:e.isFollow,this.followCarIdList=null==e?void 0:e.carIdList,this.followRotations=(null==e?void 0:e.followRotations)||{Roll:!1,Pitch:!1,Yaw:!1},this.followNeedsUpdate=!0}},{key:"initEventListener",value:function(){}},{key:"dispatchEvent",value:function(t){var i,n;if(this.plateEncode&&"mousedown"===t.type&&null!==(i=t.content)&&void 0!==i&&null!==(n=i.content)&&void 0!==n&&n.plate)try{var a=this._decodePlate(t.content.content.plate);t.content.content.plateEncoded=t.content.content.plate,t.content.content.plate=a}catch(e){console.error("TrafficLayer: Failed to decode plate",e)}return B(e,"dispatchEvent",this)([t])}},{key:"_decodePlate",value:function(e){try{if("auto"===this.plateEncoding)return bt(e);var t=bt(e,!0);return new TextDecoder(this.plateEncoding).decode(t)}catch(t){return console.warn("TrafficLayer: Plate decode failed, returning original value",t),e}}},{key:"toJSON",value:function(){return{Url:this.url,EventName:this.eventName,LabelVisible:this.labelVisible,LabelGroup:this.labelGroup,LabelScale:this.labelScale,LabelRenderType:this.labelRenderType,EnableWidgetCulling:this.enableLabelCulling,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,Id:this.followCarId,CarIdList:this.followCarIdList,Namespace:this.namespace,HandShakePath:this.handShakePath,FollowColor:this.followColor||{r:0,g:1,b:.8},FollowRotation:this.followRotations||{Roll:!1,Pitch:!1,Yaw:!1},Plate:this.followCarPlateNumber,PlateEncode:this.plateEncode,PlateEncoding:this.plateEncoding,ZoomLength:this.zoomLength,FollowPitch:this.followPitch,IsFollow:this.isFollow,Content:this.content,Message:this.message,Query:this.query,RayDetectionDistance:this.rayDetectionDistance,UIRenderDistance:this.uiRenderDistance,CarRenderDistance:this.carRenderDistance,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},IsSubsection:this.isSubsection}}}])}(),Vt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=w(this,e,[i])).name=i.name||"",t.type="FastRoadCondition",t.colors=i.colors||{1:(new d).setStyle("#00ff00"),2:(new d).setStyle("#ffff00"),3:(new d).setStyle("#ff0000"),4:(new d).setStyle("#ff00ff")},t}return z(e,st),k(e,[{key:"setData",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"condition";this.data=Fe(e),this.data.forEach((function(e){var n=e.properties[i],a=t.colors[n]||t.colors[1];e.properties.color={r:a.r,g:a.g,b:a.b,a:a.a||1}}))}}])}(),Jt=function(){function e(){var n,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(n=w(this,e,[a])).initChild();var r=a.coneColor||new d(1,1,1),s=a.groundColor||new d(1,1,1),l=a.fenceColor||new d(1,1,1),c=a.brightness||0,u=a.roughness||1,h=a.metallic||0;n.coneMap=a.coneMap||null,n.groundMap=a.groundMap||null,n.fenceMap=a.fenceMap||null,n.fenceHeight=a.fenceHeight||1;var p=a.coneOpacity||r.a||1,f=a.groundOpacity||s.a||1,m=a.fenceOpacity||l.a||1,g=a.bloomColor||null,y=a.position||new t,v=a.rotation||new o,b=new i,x=a.scale||new t(1,1,1),S=a.coneScale||new t(1,1,1),N=a.offset||new t(0,0,0),C=!1;return v._onChange((function(){b.setFromEuler(v,!1),this.matrixNeedsUpdate=!0})),b._onChange((function(){v.setFromQuaternion(b,void 0,!1),this.matrixNeedsUpdate=!0})),Object.defineProperties(n,{position:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){e&&(y.x=e.x,y.y=e.y,y.z=e.z,n.matrixNeedsUpdate=!0)}},rotation:{configurable:!0,enumerable:!0,value:v},quaternion:{configurable:!0,enumerable:!0,value:b},scale:{configurable:!0,enumerable:!0,get:function(){return x},set:function(e){e&&(x.x=e.x,x.y=e.y,x.z=e.z,n.matrixNeedsUpdate=!0)}},coneScale:{configurable:!0,enumerable:!0,get:function(){return S},set:function(e){e&&(S.x=e.x,S.y=e.y,S.z=e.z,n.matrixNeedsUpdate=!0)}},offset:{configurable:!0,enumerable:!0,get:function(){return N},set:function(e){e&&(N.x=e.x,N.y=e.y,N.z=e.z,n.matrixNeedsUpdate=!0)}},coneColor:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r.r=e.r,r.g=e.g,r.b=e.b,e.a&&(p=e.a),n.materialNeedsUpdate=!0)}},groundColor:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s.r=e.r,s.g=e.g,s.b=e.b,e.a&&(f=e.a),n.materialNeedsUpdate=!0)}},fenceColor:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l.r=e.r,l.g=e.g,l.b=e.b,e.a&&(m=e.a),n.materialNeedsUpdate=!0)}},coneOpacity:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){p=e,n.materialNeedsUpdate=!0}},groundOpacity:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){f=e,n.materialNeedsUpdate=!0}},fenceOpacity:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){m=e,n.materialNeedsUpdate=!0}},brightness:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){void 0!==e&&(c=e,n.materialNeedsUpdate=!0)}},roughness:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,n.materialNeedsUpdate=!0}},metallic:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,n.materialNeedsUpdate=!0}},bloomColor:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){e&&(g.copy(e),n.materialNeedsUpdate=!0)}},transparent:{configurable:!0,enumerable:!0,get:function(){return C},set:function(e){C=e&&1,n.materialNeedsUpdate=!0}},_visible:{configurable:!0,enumerable:!0,value:!0},_layerName:{configurable:!1,enumerable:!1,value:"CommonGISLayer"},_cloudControlType:{configurable:!1,enumerable:!1,value:"Gis"},type:{configurable:!0,enumerable:!0,value:"Construction"}}),n.matrixNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.visibleNeedsUpdate=!1,n}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"coneMap",get:function(){return this.cone.map},set:function(e){e&&(this.cone.map=e,this.materialNeedsUpdate=!0)}},{key:"groundMap",get:function(){return this.ground.map},set:function(e){e&&(this.ground.map=e,this.materialNeedsUpdate=!0)}},{key:"fenceMap",get:function(){return this.fence.map},set:function(e){e&&(this.fence.map=e,this.materialNeedsUpdate=!0)}},{key:"fenceHeight",get:function(){return this._fenceHeight},set:function(e){e&&(this._fenceHeight=e)}},{key:"initChild",value:function(){this.ground=new it,this.add(this.ground),this.fence=new st,this.add(this.fence),this.cone=new Pt,this.add(this.cone)}},{key:"setData",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.data=Fe(e,t)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:1,g:1,b:1,a:1},ConeColor:{r:this.coneColor.r,g:this.coneColor.g,b:this.coneColor.b,a:this.coneOpacity},GroundColor:{r:this.groundColor.r,g:this.groundColor.g,b:this.groundColor.b,a:this.groundOpacity},FenceColor:{r:this.fenceColor.r,g:this.fenceColor.g,b:this.fenceColor.b,a:this.fenceOpacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:1,ConeOpacity:this.coneOpacity,GroundOpacity:this.groundOpacity,FenceOpacity:this.fenceOpacity,Transparent:this.transparent,GroundTexture:this.ground.map,ConeTexture:this.cone.map,FenceTexture:this.fence.map,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},ConeScale:{x:this.coneScale.x,y:this.coneScale.y,z:this.coneScale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,groundUuid:this.ground.uuid,coneUuid:this.cone.uuid,fenceUuid:this.fence.uuid,jsondata:e?null:this.data,FenceWidth:this.fenceHeight}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"dispose",value:function(){this.traverse((function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose(),e.texture=null})),this.data=null,this.texture=null}}])}(),Yt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).name=t.name||"",i.url=t.url,i._enableSlope=!1,i.token=t.token||null,i.type="i3DTileLayer",i.initialize(),i}return z(e,tt),k(e,[{key:"url",get:function(){return this._url},set:function(e){e!==this._url&&(this.visibleNeedsUpdate=!0,this._url=e)}},{key:"initialize",value:function(){if(!this.url)return!1}},{key:"slopeAnalysis",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._enableSlope=e&&!0,this.slopeParams={},e&&Object.assign(this.slopeParams,t)}},{key:"toJSON",value:function(){return!(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},Token:this.token,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,Url:this.url?this.url:null,EnableSlope:this._enableSlope,SlopeParams:this._enableSlope?this.slopeParams:null}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"dispose",value:function(){this.traverse((function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose(),e.texture=null})),this.url=null,this.texture=null}}])}(),qt=function(){function e(i){var n;U(this,e),(n=w(this,e,[i])).type="AssetLayer",n.url=i.url,n.header=i.header,n.body=i.body,n.messageNeedsUpdate=!1,n.childNeedsUpdate=!1;var a=i.deviceAutoUpdate||!1,o=Math.max(1,i.deviceAutoUpdateInterval||2),r=void 0===i.renderNum?15:i.renderNum,s=void 0===i.searchMode?"coord":i.searchMode,l=void 0===i.tileLevel?16:i.tileLevel,d=void 0!==i.rtEnable&&i.rtEnable,c=i.rtUrl,u=void 0===i.rtTilelLevel?17:i.rtTilelLevel;return n.maxUpdateHeight=void 0===i.maxUpdateHeight?1e3:i.maxUpdateHeight,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{deviceAutoUpdate:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,n.messageNeedsUpdate=!0)}},deviceAutoUpdateInterval:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=Math.max(e,2),n.messageNeedsUpdate=!0)}},renderNum:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,n.messageNeedsUpdate=!0)}},searchMode:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,n.messageNeedsUpdate=!0)}},tileLevel:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e,n.messageNeedsUpdate=!0)}},rtEnable:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,n.messageNeedsUpdate=!0}},rtUrl:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c=e,n.messageNeedsUpdate=!0)}},rtTilelLevel:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u=e,n.messageNeedsUpdate=!0)}}}),n}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"body",get:function(){return this._body},set:function(e){this.messageNeedsUpdate=!0,this._body=e}},{key:"addChildren",value:function(e){var t=this;if(!e||e.length<1)return!1;this.childOperate="add",this.childrenContent=[],e.forEach((function(e,i){t.childrenContent.push({uuid:e.uuid,point_id:e.point_id,config:{material:{},transform:null}})})),this.childNeedsUpdate=!0,this.materialNeedsUpdate=!0}},{key:"removeChild",value:function(e){e&&(e instanceof Array?this.removeChildren(e):this.removeChildren([e]))}},{key:"removeChildren",value:function(e){var t=this;if(!e||e.length<1)return!1;this.childOperate="remove",this.childrenContent=[],e.forEach((function(e,i){t.childrenContent.push({uuid:e.uuid,point_id:e.point_id,config:{material:{},transform:null}})})),this.childNeedsUpdate=!0,this.materialNeedsUpdate=!0}},{key:"updateChild",value:function(e){if(!e)return!1;e instanceof Array?this.updateChildren(e):this.updateChildren([e])}},{key:"updateChildren",value:function(e){var t=this;if(!e||e.length<1)return!1;this.childrenContent=[],this.childOperate="update",this.childNeedsUpdate=!0,this.materialNeedsUpdate=!0,e.forEach((function(e,i){t.updateChildContent(e)}))}},{key:"updateChildContent",value:function(e){if(!e.uuid)return!1;var t={uuid:e.uuid,point_id:e.point_id,config:{material:{},transform:null}},i=e.params;if(void 0!==i.opacity&&(i.color.a=i.opacity),i.color&&(t.config.material.Color={r:i.color.r,g:i.color.g,b:i.color.b,a:i.color.a||1}),i.brightnessColor&&(t.config.material.BrightnessColor={r:i.brightnessColor.r,g:i.brightnessColor.g,b:i.brightnessColor.b,a:1}),i.text){var n=et(i.text,i.textStyle);t.config.material.Texture=Ve(n)}else i.map&&(Je(i.map)?t.config.material.Texture=i.map:Ge(i.map,(function(e){e&&(t.config.material.Texture=e)})));void 0!==i.metallic&&(t.config.material.Metallic=i.metallic),void 0!==i.roughness&&(t.config.material.Roughness=i.roughness),void 0!==i.brightness&&(t.config.material.Brightness=i.brightness),i.position&&(t.config.transform||(t.config.transform={}),t.config.transform.Location={x:i.position.x,y:i.position.y,z:i.position.z}),i.scale&&(t.config.transform||(t.config.transform={}),t.config.transform.Scale={x:i.scale.x,y:i.scale.y,z:i.scale.z}),i.rotation&&(t.config.transform||(t.config.transform={}),t.config.transform.Rotation={x:i.rotation.x,y:i.rotation.y,z:i.rotation.z}),void 0!==i.scroll&&(t.config.scroll=a.clamp(i.scroll,-1,1)),void 0!==i.speed&&(t.config.speed=i.speed),void 0!==i.animationIndex&&(t.config.animationIndex=i.animationIndex),void 0!==i.animationLoop&&(t.config.animationLoop=i.animationLoop),void 0!==i.animationSpeed&&(t.config.animationSpeed=i.animationSpeed),this.childrenContent.push(t)}},{key:"updateChildAnimation",value:function(e){if(!e)return!1;e instanceof Array?this.updateChildrenAnimation(e):this.updateChildrenAnimation([e])}},{key:"updateChildrenAnimation",value:function(e){var t=this;if(!e||e.length<1)return!1;this.childrenContent=[],e.forEach((function(e,i){t.updateChildContent(e)})),this.childOperate="animation",this.childNeedsUpdate=!0,this.materialNeedsUpdate=!0}},{key:"toJSON",value:function(){var e={DeviceUrl:this.url,DeviceBody:this.body,DeviceHeader:this.header,SearchMode:this.searchMode,TileLevel:this.tileLevel,RenderNum:this.renderNum,RTUrl:this.rtUrl,RTEnable:this.rtEnable,RTTileLevel:this.rtTilelLevel,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,content:this.materialNeedsUpdate?this.childrenContent:null,childOperate:this.childOperate,AutoUpdate:this.deviceAutoUpdate,AutoUpdateInterval:this.deviceAutoUpdateInterval,MaxUpdateHeight:this.maxUpdateHeight};return this.childNeedsUpdate&&(this.childNeedsUpdate=!1,this.childOperate=null,this.materialNeedsUpdate=!0),e}}])}(),Xt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:0,g:1,b:0,a:1},brightness:1,speed:.2};return U(this,e),(t=w(this,e,[i])).type="Radar",t}return z(e,tt),k(e)}(),Kt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:1,g:0,b:0,a:1},brightness:1,speed:2};return U(this,e),(t=w(this,e,[i])).type="Ripple",t}return z(e,tt),k(e)}(),Qt=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Soil",i}return z(e,tt),k(e)}(),Zt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{gardientDirection:-1,color:{r:0,g:.48,b:.0047,a:1},color2:{r:.43,g:1,b:.42,a:1}};return U(this,e),(t=w(this,e,[i])).type="Diamond",t}return z(e,tt),k(e)}(),$t=function(){function e(t){var i;U(this,e),(i=w(this,e,[t])).type="CommonCar";var n=void 0===t.carType?3:t.carType;return Object.defineProperties(i,{carType:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){void 0!==e&&(n=e,i.overtimeInstanceIndex=[],i.data=[],i.materialNeedsUpdate=!0)}}}),i}return z(e,tt),k(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this.visibleNeedsUpdate||!e||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Scroll:this.scroll,Speed:this.speed,Texture:this.texture,GardientDirection:this.gardientDirection,Color2:{r:this.color2.r,g:this.color2.g,b:this.color2.b,a:this.opacity},BrightnessColor:this.brightnessColor?{r:this.brightnessColor.r,g:this.brightnessColor.g,b:this.brightnessColor.b,a:1}:this.color,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:!this.isInstance&&this.animateNeedsUpdate,visible:this.visible,type:this.type,CarType:this.carType,name:this.name,uuid:this.uuid,jsondata:!e||this.isInstance?this.data:null,animateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation,ChildIndex:this.isInstance?-1:this.childIndex,IsInstance:this.isInstance,overtimeInstanceIndex:this.overtimeInstanceIndex}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}(),ei=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="TriangleWarning",i}return z(e,tt),k(e)}(),ti=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="Bucket",i}return z(e,tt),k(e)}(),ii=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="InundationAnalysis",i}return z(e,tt),k(e)}(),ni=function(){function e(t){var i;U(this,e),(i=w(this,e,[t])).type="SkylineAnalysis";var n=t.distance||120,a=t.lineWidth||1;return Object.defineProperties(i,{distance:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,i.materialNeedsUpdate=!0}},lineWidth:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,i.materialNeedsUpdate=!0}}}),i}return z(e,tt),k(e,[{key:"toJSON",value:function(){return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Distance:this.distance,LineWidth:this.lineWidth}}}])}(),ai=function(){function e(t){var i;U(this,e),(i=w(this,e,[t])).type="VisualFieldAnalysis";var n=t.fov||60,a=t.maxDistance||5,o=t.resYX||.5,r=t.resolution||1024;return Object.defineProperties(i,{fov:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,i.materialNeedsUpdate=!0}},maxDistance:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,i.materialNeedsUpdate=!0}},resYX:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,i.materialNeedsUpdate=!0}},resolution:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,i.materialNeedsUpdate=!0}}}),i}return z(e,tt),k(e,[{key:"toJSON",value:function(){return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Position:{x:this.position.x,y:this.position.y,z:this.position.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,AnimateJson:this.animateNeedsUpdate?this.animateJson:null,visible:this.visible,FOV:this.fov,MaxDistance:this.maxDistance,ResYX:this.resYX,Resolution:this.resolution,Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z}}}}])}(),oi=function(){function e(i){var n;U(this,e),(n=w(this,e,[i])).type="CarPark";var r,s=i.position||new t,l=i.rotation||new o,d=i.scale||new t(1,1,1),c=i.color||{r:1,g:1,b:1,a:1};return Object.defineProperties(n,{position:{enumerable:!0,get:function(){return s},set:function(e){e&&(s.x=e.x,s.y=e.y,s.z=e.z,n.matrixNeedsUpdate=!0)}},rotation:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l.x=a.clamp(e.x,-180,180),l.y=a.clamp(e.y,-180,180),l.z=a.clamp(e.z,-180,180),n.matrixNeedsUpdate=!0)}},scale:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d.x=e.x,d.y=e.y,d.z=e.z,n.matrixNeedsUpdate=!0)}},modelType:{configurable:!0,enumerable:!0,get:function(){return n._modelType},set:function(e){e&&(n._modelType=e)}},color:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c.r=e.r,c.g=e.g,c.b=e.b,c.a=e.a||1,n.materialNeedsUpdate=!0)}},parkType:{configurable:!0,enumerable:!0,get:function(){return n._parkType},set:function(e){e&&("out"===e.toLowerCase?n._parkType="out":n._parkType="in")}}}),n.position=s,n.rotation=l,n.scale=d,n.modelType=(r=i.modelType,isNaN(r)||r<3||r>6&&r<12||r>16?3:r),n.speed=Number(i.speed)||36,n.endState=i.endState||!1,n.color=c,n.parkType=i.parkType||"in",n}return z(e,tt),k(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this.visibleNeedsUpdate||!e||this.visible&&this.materialNeedsUpdate?{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.color.a},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Speed:this.speed,ModelType:this.modelType,EndState:this.endState,Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid,jsondata:e?null:this.data,ParkType:this.parkType}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}();var ri=function(){function e(i){var n;U(this,e),(n=w(this,e,[i])).type="TrafficLight",n.url=i.url,n.header=i.header,n.message=i.message;var a=void 0===i.brightness?1:i.brightness;return n.lightAltitude=void 0===i.lightAltitude?1:i.lightAltitude,n.renderScale=void 0===i.renderScale?1:i.renderScale,n.rayDetection={enable:!1,distance:0,displacementHeight:0},i.rayDetection&&(n.rayDetection.enable=void 0!==i.rayDetection.enable&&i.rayDetection.enable,n.rayDetection.distance=void 0===i.rayDetection.distance?0:i.rayDetection.distance,n.rayDetection.displacementHeight=void 0===i.rayDetection.displacementHeight?0:i.rayDetection.displacementHeight),n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{brightness:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,n.materialNeedsUpdate=!0}}}),n}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"message",get:function(){return this._body},set:function(e){this.messageNeedsUpdate=!0,this._body=e}},{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){return{Url:this.url,Message:this.message,Header:this.header,RenderScale:this.renderScale,LightAltitude:this.lightAltitude,RayDetection:this.rayDetection,Brightness:this.brightness,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}}])}(),si=function(){function e(t){var i;U(this,e),(i=w(this,e,[t])).type="RoadName",i.fontSize=t.fontSize||14,i.rayDetectionDistance="rayDetectionDistance"in t?t.rayDetectionDistance:500,i.displacementHeight="displacementHeight"in t?t.displacementHeight:40*i.scale.z,i.data=t.data||[],i.filename=t.filename||null;var n=t.color||{r:1,g:1,b:1,a:1};i.openCollision=t.openCollision||!1,i.switchScale=t.switchScale||!1,i.minScale="minScale"in t?t.minScale:1,i.maxScale="maxScale"in t?t.maxScale:2,i.minDistance=t.minDistance||0,i.maxDistance=t.maxDistance||5e3;var a=t.switchPitchRotate||!1;return i.minPitch="minPitch"in t?t.minPitch:0,i.maxPitch="maxPitch"in t?t.maxPitch:90,i.collisionScale=t.collisionScale||2,i.brightness=t.brightness||1,Object.defineProperties(i,{color:{enumerable:!0,get:function(){return n},set:function(e){e!==n&&(n=e,this.materialNeedsUpdate=!0)}},switchPitchRotate:{enumerable:!0,get:function(){return a},set:function(e){e!==a&&(a=e,this.materialNeedsUpdate=!0)}}}),i}return z(e,tt),k(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this.visibleNeedsUpdate||!e||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.z,y:this.scale.y,z:this.scale.x},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid,jsondata:this.data,rayDetectionDistance:this.rayDetectionDistance,displacementHeight:this.displacementHeight,FileName:this.filename,FontSize:this.fontSize,OpenCollision:this.openCollision,SwitchScale:this.switchScale,MinScale:this.minScale,MaxScale:this.maxScale,MinDistance:this.minDistance,MaxDistance:this.maxDistance,SwitchPitchRotate:this.switchPitchRotate,MinPitch:this.minPitch,MaxPitch:this.maxPitch,CollisionScale:this.collisionScale,ShadowColor:this.shadowColor,ShadowOffset:this.shadowOffset,Brightness:this.brightness}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.z,y:this.scale.y,z:this.scale.x},Rotation:{x:this.rotation.x,y:this.rotation.y+90,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}(),li=function(){function e(i){var n;U(this,e),(n=w(this,e,[i])).type="AutonomousVehicle";var a=i.url,o=i.header,r=void 0===i.labelRenderScale?1:i.labelRenderScale,s=void 0===i.labelRenderType?1:i.labelRenderType,l=void 0===i.labelBrightness?1:i.labelBrightness,d=void 0===i.followMode?"Third":i.followMode;n.labelField=void 0===i.labelField?"":i.labelField,n.followRotation=void 0===i.followRotation?{Roll:!1,Pitch:!1,Yaw:!0}:i.followRotation;var c=void 0===i.followZoom?0:i.followZoom,u=void 0!==i.switchScale&&i.switchScale,h=void 0===i.minViewPortHeight?30:i.minViewPortHeight,p=void 0===i.maxViewPortHeight?300:i.maxViewPortHeight,f=void 0===i.minScale?1:i.minScale,m=void 0===i.maxScale?2:i.maxScale,g=void 0===i.controlTypeList?[]:i.controlTypeList,y=void 0!==i.predictionEnable&&i.predictionEnable,v=void 0===i.predictionLineStyle?{}:i.predictionLineStyle;return n.rayDetection={enable:!1,distance:0},i.rayDetection&&(n.rayDetection.enable=void 0!==i.rayDetection.enable&&i.rayDetection.enable,n.rayDetection.distance=void 0===i.rayDetection.distance?0:i.rayDetection.distance),n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.followNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{url:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,n.messageNeedsUpdate=!0)}},header:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,n.messageNeedsUpdate=!0)}},labelRenderScale:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,n.materialNeedsUpdate=!0)}},labelBrightness:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e,n.materialNeedsUpdate=!0)}},predictionLineStyle:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){e&&(v=e,n.materialNeedsUpdate=!0)}},labelRenderType:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,n.materialNeedsUpdate=!0)}},predictionEnable:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){e&&(y=e,n.materialNeedsUpdate=!0)}},followMode:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d=e,n.followNeedsUpdate=!0)}},followZoom:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c=e,n.materialNeedsUpdate=!0)}},switchScale:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u=e,n.materialNeedsUpdate=!0)}},minViewPortHeight:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){e&&(h=e,n.materialNeedsUpdate=!0)}},maxViewPortHeight:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){e&&(p=e,n.materialNeedsUpdate=!0)}},minScale:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){e&&(f=e,n.materialNeedsUpdate=!0)}},maxScale:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){e&&(m=e,n.materialNeedsUpdate=!0)}},controlTypeList:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){g=e||[]}}}),n}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible?this._visible=!0:(this._visible=e&&!0,this.visibleNeedsUpdate=!0)}},{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate?{Url:this.url,Header:this.header,LabelRenderScale:this.labelRenderScale,LabelRenderType:this.labelRenderType,LabelField:this.labelField,RayDetection:this.rayDetection,ControlTypeList:this.controlTypeList,FollowMode:this.followMode,SwitchScale:this.switchScale,MinViewPortHeight:this.minViewPortHeight,MaxViewPortHeight:this.maxViewPortHeight,FollowRotation:this.followRotation,LabelBrightness:this.labelBrightness,MinScale:this.minScale,MaxScale:this.maxScale,FollowZoom:this.followZoom,PredictionLineStyle:this.predictionLineStyle,PredictionEnable:this.predictionEnable,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}:{Url:this.url,Header:this.header,LabelRenderScale:this.labelRenderScale,LabelRenderType:this.labelRenderType,LabelField:this.labelField,RayDetection:this.rayDetection,FollowMode:this.followMode,SwitchScale:this.switchScale,MinViewPortHeight:this.minViewPortHeight,MaxViewPortHeight:this.maxViewPortHeight,ControlTypeList:this.controlTypeList,FollowRotation:this.followRotation,FollowZoom:this.followZoom,LabelBrightness:this.labelBrightness,PredictionLineStyle:this.predictionLineStyle,PredictionEnable:this.predictionEnable,MinScale:this.minScale,MaxScale:this.maxScale,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}}])}(),di=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).type="QuadPyramidTop",i}return z(e,tt),k(e)}(),ci=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).visible=void 0===i.visible||i.visible;var n=i.url||"",a=i.size||{x:300,y:200},o=0===i.faceType?0:i.faceType||1,r=i.pivot||{x:.5,y:.5},s=void 0!==i.switchScale&&i.switchScale,l=i.minDistance||0,d=i.maxDistance||0,c=void 0===i.minScale?1:i.minScale,u=void 0===i.maxScale?1:i.maxScale;return t.type="WebViewPoint",Object.defineProperties(t,{url:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},size:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,t.materialNeedsUpdate=!0}},pivot:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},faceType:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},switchScale:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}},minDistance:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},maxDistance:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,t.materialNeedsUpdate=!0}},minScale:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},maxScale:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,t.materialNeedsUpdate=!0}}}),t}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=We(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,FadeIn:this.fadeIn,type:this.type,name:this.name,uuid:this.uuid}:{Pivot:this.pivot,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,FaceType:Nt(this.faceType),SwitchScale:this.switchScale,MinDistance:this.minDistance,MaxDistance:this.maxDistance,MaxScale:this.maxScale,MinScale:this.minScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,URL:this.url,Size:this.size,Brightness:this.brightness}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontWeight=t.fontWeight,this.fontSize=t.fontSize,this.borderWidth=t.borderWidth,this.borderColor=t.borderColor,this.shadowColor=t.shadowColor,this.shadowOffset=t.shadowOffset,B(e,"copy",this)([t,i]),this}}])}(),ui=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="LayerBuilding";var n=i.buildingName||"all",a=i.layeringHeight||500,o=i.layeringBaseHeight||300,r=i.floorPullDir||{x:5e3,y:0,z:0};return t.hiddenDefault=void 0===i.HiddenDefault||i.HiddenDefault,t.floorNum=0,t.eventName="",t.buildingState="create",t.isLayering={},t.isLayering[n]=!1,Object.defineProperties(t,{layeringHeight:{enumerable:!0,get:function(){return a},set:function(e){e!==a&&(a=e,this.materialNeedsUpdate=!0,this.buildingState="update")}},buildingName:{enumerable:!0,get:function(){return n},set:function(e){e&&e!==n&&(n=e,this.materialNeedsUpdate=!0,this.buildingState="update")}},layeringBaseHeight:{enumerable:!0,get:function(){return o},set:function(e){e!==o&&(o=e,this.materialNeedsUpdate=!0,this.buildingState="update")}},floorPullDir:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r.x=e.x,r.y=e.y,r.z=e.z,t.materialNeedsUpdate=!0,t.buildingState="update")}}}),t}return z(e,tt),k(e,[{key:"layeringBuilding",value:function(){if(this.eventName="Layering",this.animateNeedsUpdate=!0,this.buildingState="update","all"===this.buildingName)for(var e in this.isLayering)this.isLayering[e]=!0;else this.isLayering[this.buildingName]=!0}},{key:"backBuildingToNormal",value:function(){if(this.eventName="BackToNormal",this.animateNeedsUpdate=!0,this.buildingState="update","all"===this.buildingName)for(var e in this.isLayering)this.isLayering[e]=!1;else this.isLayering[this.buildingName]=!1}},{key:"pullBuilding",value:function(e){if(void 0===this.isLayering[this.buildingName]){if(!this.isLayering.all)return void console.warn("该建筑物不在分解状态")}else if(!1===this.isLayering[this.buildingName])return void console.warn("该建筑物不在分解状态");e?(this.eventName="Pull",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update"):console.warn("请输入有效楼层")}},{key:"pushBuilding",value:function(e){if(void 0===this.isLayering[this.buildingName]){if(!this.isLayering.all)return void console.warn("该建筑物不在分解状态")}else if(!this.isLayering[this.buildingName])return void console.warn("该建筑物不在分解状态");e?(this.eventName="Push",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update"):console.warn("请输入有效楼层")}},{key:"hideBuildings",value:function(e){Array.isArray(e)?(this.eventName="Hide",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update"):console.error("numbers必须为数组")}},{key:"showBuildings",value:function(e){Array.isArray(e)?(this.eventName="Show",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update"):console.error("numbers必须为数组")}},{key:"hideAboveFloor",value:function(e){0!==e&&(this.eventName="HideAboveFloor",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update")}},{key:"showAll",value:function(){this.eventName="ShowAll",this.animateNeedsUpdate=!0,this.buildingState="update"}},{key:"hideAll",value:function(){this.eventName="HideAll",this.animateNeedsUpdate=!0,this.buildingState="update"}},{key:"toJSON",value:function(){return{type:this.type,name:this.name,uuid:this.uuid,BuildingName:this.buildingName,LayeringHeight:this.layeringHeight,LayeringBaseHeight:this.layeringBaseHeight,FloorPullDir:this.floorPullDir,FloorNum:this.floorNum,EventName:this.eventName,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,BuildingState:this.buildingState,HiddenDefault:this.hiddenDefault}}}])}(),hi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="MockCarStream",t.renderNum=void 0===i.renderNum?20:i.renderNum,t.enableTrigger=void 0!==i.enableTrigger&&i.enableTrigger,t.twoSide=i.twoSide||!1,t.twoSideWidth=i.twoSideWidth||200,t.reverseInterval=i.reverseInterval||1e3,t.reverseSpeed=i.reverseSpeed||1500;var n=i.runOnTheGround||!1,a=i.lanesNumber||1,o=i.forwardInterval||1e3,r=i.forwardSpeed||200,s=i.splineLoop||!1,l=i.randomBool||!1,d=i.randomForwardOffset||0,c=i.laneWidth||300,u=i.rotationOffset||0,h=i.scaleOffset||{x:1,y:1,z:1};return Object.defineProperties(t,{runOnTheGround:{enumerable:!0,get:function(){return n},set:function(e){n!==e&&(n=e,t.materialNeedsUpdate=!0)}},lanesNumber:{enumerable:!0,get:function(){return a},set:function(e){a!==e&&(a=e,t.materialNeedsUpdate=!0)}},forwardInterval:{enumerable:!0,get:function(){return o},set:function(e){o!==e&&(o=e,t.materialNeedsUpdate=!0)}},forwardSpeed:{enumerable:!0,get:function(){return r},set:function(e){r!==e&&(r=e,t.materialNeedsUpdate=!0)}},splineLoop:{enumerable:!0,get:function(){return s},set:function(e){s!==e&&(s=e,t.materialNeedsUpdate=!0)}},randomBool:{enumerable:!0,get:function(){return l},set:function(e){l!==e&&(l=e,t.materialNeedsUpdate=!0)}},randomForwardOffset:{enumerable:!0,get:function(){return d},set:function(e){d!==e&&(d=e,t.materialNeedsUpdate=!0)}},laneWidth:{enumerable:!0,get:function(){return c},set:function(e){c!==e&&(c=e,t.materialNeedsUpdate=!0)}},rotationOffset:{enumerable:!0,get:function(){return u},set:function(e){u!==e&&(u=e,t.materialNeedsUpdate=!0)}},scaleOffset:{enumerable:!0,get:function(){return h},set:function(e){h=e,t.materialNeedsUpdate=!0}}}),t}return z(e,tt),k(e,[{key:"toJSON",value:function(){return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},EnableTrigger:this.enableTrigger,TwiSide:this.twoSide,TwoSideWidth:this.twoSideWidth,ReverseInterval:this.reverseInterval,ReverseSpeed:this.reverseSpeed,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},RunOnTheGround:this.runOnTheGround,LanesNumber:this.lanesNumber,ForwardInterval:this.forwardInterval,ForwardSpeed:this.forwardSpeed,SplineLoop:this.splineLoop,RandomBool:this.randomBool,RandomForwardOffset:this.randomForwardOffset,LaneWidth:this.laneWidth,RotationOffset:this.rotationOffset,ScaleOffset:this.scaleOffset,jsondata:this.data,RenderNum:this.renderNum}}}])}(),pi=[{r:.685325,g:1,b:.298996},{r:.963023,g:1,b:.198688},{r:1,g:.710181,b:.235817},{r:1,g:.440705,b:.156314},{r:1,g:.310357,b:.150163},{r:1,g:.219426,b:.155697}],fi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).type="SlopeAnalysis";var n=i.range||null,a=gi(i.minAngle,!0),o=gi(i.maxAngle,!1),r=mi(i.colorRange),s=i.useSlopeAnalysis||!1,l=i.tilePathFieldName||"";return Object.defineProperties(t,{tilePathFieldName:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},range:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},minAngle:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=gi(e,!0),t.materialNeedsUpdate=!0}},maxAngle:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=gi(e,!1),t.materialNeedsUpdate=!0}},colorRange:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=mi(e),t.materialNeedsUpdate=!0}},useSlopeAnalysis:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,e&&(t.materialNeedsUpdate=!0)}}}),t}return z(e,tt),k(e,[{key:"toJSON",value:function(){return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,jsonData:this.range,MinAngle:this.minAngle,MaxAngle:this.maxAngle,ColorRange:this.colorRange,UseSlopeAnalysis:Number(this.useSlopeAnalysis),TilePathFieldName:this.tilePathFieldName}}}])}();function mi(e){if(e&&e instanceof Object){var t=0,i=0;for(var n in e)i=n,t++;if(0===i)return{25:pi[0],40:pi[1],55:pi[2],70:pi[3],80:pi[4],90:pi[5]};for(var a=t;a<6;a++)i<25?e[i=40]=pi[1]:i<40.00001?e[i=55]=pi[2]:i<55.00001?e[i=70]=pi[3]:i<70.00001?e[i=80]=pi[4]:i<80.00001?e[i=90]=pi[5]:i<90.00001?e[i=91]=pi[5]:e[i+=a]=pi[5];return e}return{25:pi[0],40:pi[1],55:pi[2],70:pi[3],80:pi[4],90:pi[5]}}function gi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?e<=0?0:e:e<=0?90:e}var yi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).pointType="pointType"in i?i.pointType.toLowerCase():"iconpoint";var n=i.pointStyle||{};for(var a in n.renderType=0,n.openCollision=!1,t.pointJSON=vi(t.pointType,n),t.clusterStyle=i.clusterStyle||{},t.clusterStyle){var o=t.clusterStyle[a];t.clusterStyle[a]=vi(t.pointType,o)}var r=i.minPixelDistance||100;return t.type="ClusterPoint",Object.defineProperties(t,{minPixelDistance:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){var i=Number(e);i&&r!==i&&(r=i,t.materialNeedsUpdate=!0)}}}),t}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=We(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,MinPixelDistance:this.minPixelDistance,PointJSON:this.pointJSON,PointType:this.pointType,ClusterStyle:this.clusterStyle}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.size=t.size,B(e,"copy",this)([t,i]),this}}])}();function vi(e,t){var i;switch(e){case"basiclabel":i=new kt(t).toJSON();case"iconpoint":i=new wt(t).toJSON();case"textpoint":i=new Ut(t).toJSON();default:i=new wt(t).toJSON()}return t.clusterText&&(i.ClusterText=t.clusterText),i}var bi=function(){function e(t){var i;return U(this,e),(i=w(this,e,[t])).visible=void 0===t.visible||t.visible,i}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}}])}(),xi=function(){function e(i){var n;U(this,e),(n=w(this,e,[i])).type="UserInfoLightLayer";var a=i.url,o=i.header,r=void 0===i.brightness?1:i.brightness,s=void 0===i.lightAltitude?1:i.lightAltitude,l=void 0===i.renderScale?1:i.renderScale,d=void 0===i.renderTilesNum?3:i.renderTilesNum,c=void 0===i.updateCheckInterval?2:i.updateCheckInterval,u=void 0===i.maxUpdateHeight?1e3:i.maxUpdateHeight,h=void 0===i.centerDetectDistance?3e3:i.centerDetectDistance;return n.guidingLine={enable:!0,color:{r:.171441,g:.223228,b:.376262}},i.guidingLine&&(n.guidingLine.enable=void 0===i.guidingLine.enable||i.guidingLine.enable,n.guidingLine.color=void 0===i.guidingLine.color?{r:.171441,g:.223228,b:.376262}:i.guidingLine.color),n.rayDetection={enable:!1,distance:0,displacementHeight:0},i.rayDetection&&(n.rayDetection.enable=void 0!==i.rayDetection.enable&&i.rayDetection.enable,n.rayDetection.distance=void 0===i.rayDetection.distance?0:i.rayDetection.distance,n.rayDetection.displacementHeight=void 0===i.rayDetection.displacementHeight?0:i.rayDetection.displacementHeight),n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{url:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,n.materialNeedsUpdate=!0}},header:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,n.materialNeedsUpdate=!0}},lightAltitude:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,n.materialNeedsUpdate=!0}},renderScale:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,n.materialNeedsUpdate=!0}},renderTilesNum:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,n.materialNeedsUpdate=!0}},updateCheckInterval:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,n.materialNeedsUpdate=!0}},centerDetectDistance:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,n.materialNeedsUpdate=!0}},brightness:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,n.materialNeedsUpdate=!0}},maxUpdateHeight:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,n.materialNeedsUpdate=!0}}}),n}return z(e,bi),k(e,[{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){return{Url:this.url,Header:this.header,RenderScale:this.renderScale,LightAltitude:this.lightAltitude,CenterDetectDistance:this.centerDetectDistance,RayDetection:this.rayDetection,GuidingLine:this.guidingLine,Brightness:this.brightness,RenderTilesNum:this.renderTilesNum,UpdateCheckInterval:this.updateCheckInterval,MaxUpdateHeight:this.maxUpdateHeight,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}}])}(),Si=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=w(this,e,[i])).name=i.name||"",t.type="RoutePlan";var n=i.url;return t.messageNeedsUpdate=!1,Object.defineProperties(t,{url:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e,t.messageNeedsUpdate=!0)}}}),t}return z(e,st),k(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},URL:this.url,Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Collision:this.collision,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,jsondata:e?null:this.data,Style:this.style,Spline_Type:this.splineType,MeshDirection:this.direction,RenderType:this.renderType,Section_Length:this.section_Length,Width:this.width,Tilling:this.tilling,Speed:this.speed,Open_Stroke:this.openStroke,Stroke_Color:this.strokeColor?{r:this.strokeColor.r,g:this.strokeColor.g,b:this.strokeColor.b,a:1}:null,Stroke_Width:this.strokeWidth,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,LineUVOption:this.lineUVOption,colordata:this.colordata}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.style=t.style,this.splineType=t.splineType,this.direction=t.direction,this.width=t.width,this.tilling=t.tilling,this.speed=t.speed,this.openStroke=t.openStroke,this.strokeColor=t.strokeColor,this.strokeWidth=t.strokeWidth,B(e,"copy",this)([t,i]),this}}])}(),Ni=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=w(this,e,[i])).visible=void 0===i.visible||i.visible,t.lightType=void 0===i.lightType?"PointLight":i.lightType,t.pointLightStyle=void 0===i.pointLightStyle?{intensity:8,color:{r:1,g:1,b:1}}:i.pointLightStyle,t.spotLightStyle=void 0===i.spotLightStyle?{intensity:8,color:{r:1,g:1,b:1},innerConeAngle:0,outerConeAngle:44}:i.spotLightStyle,t.rectLightStyle=void 0===i.rectLightStyle?{intensity:8,color:{r:1,g:1,b:1},barnDoorAngle:88,barnDoorlength:20}:i.rectLightStyle,t.type="Light",t}return z(e,tt),k(e,[{key:"setData",value:function(e){this.data=We(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,LightType:this.lightType,PointLightStyle:this.pointLightStyle,SpotLightStyle:this.spotLightStyle,RectLightStyle:this.rectLightStyle,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontWeight=t.fontWeight,this.fontSize=t.fontSize,this.borderWidth=t.borderWidth,this.borderColor=t.borderColor,this.shadowColor=t.shadowColor,this.shadowOffset=t.shadowOffset,B(e,"copy",this)([t,i]),this}}])}(),wi=function(){function e(){var i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(i=w(this,e,[n])).name=n.name||"",i.type="LargeRoadCondition",i.defaultColors={1:{r:.015625,g:0,b:0,a:1},2:{r:.043403,g:.001204,b:.001635,a:1},3:{r:.078125,g:.058385,b:0,a:1},4:{r:207e-6,g:.109375,b:0,a:1}};var a=n.roadGeoJsonUrl||"",o=n.roadConditionUrl||"",r=n.layerGroupName||"",s=void 0===n.heightOffset?.7:n.heightOffset,l=void 0===n.camFOV?90:n.camFOV,d=void 0===n.aspectRatio?1:n.aspectRatio,c=n.colors||i.defaultColors,u=i.validateColors(c)?c:i.defaultColors,h=i.getValidBrightnessList(n.brightnessList);return i.messageNeedsUpdate=!1,i.materialNeedsUpdate=!1,i.matrixNeedsUpdate=!1,i.offset=new t,Object.defineProperties(i,{roadGeoJsonUrl:{enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,this.materialNeedsUpdate=!0)}},roadConditionUrl:{enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,this.materialNeedsUpdate=!0)}},layerGroupName:{enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,this.materialNeedsUpdate=!0)}},heightOffset:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){void 0!==e&&(s=e,i.materialNeedsUpdate=!0)}},camFOV:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){void 0!==e&&(l=e,i.materialNeedsUpdate=!0)}},aspectRatio:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){void 0!==e&&(d=e,i.materialNeedsUpdate=!0)}},colors:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){void 0!==e&&(u=i.validateColors(e)?e:i.defaultColors,i.materialNeedsUpdate=!0)}},brightnessList:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){void 0!==e&&(h=i.getValidBrightnessList(e),i.materialNeedsUpdate=!0)}}}),i}return z(e,bi),k(e,[{key:"getValidBrightnessList",value:function(e){return Array.isArray(e)&&4===e.length&&this.allElementsGreaterThanZero(e)?e:[15,15,15,15]}},{key:"allElementsGreaterThanZero",value:function(e){return e.every((function(e){return"number"==typeof e&&e>=0}))}},{key:"validateColors",value:function(e){if("object"!==H(e)||null===e)return console.error("Invalid color format: Colors should be a non-null object."),!1;for(var t in this.defaultColors)if(this.defaultColors.hasOwnProperty(t)){if(!e.hasOwnProperty(t))return console.error("Missing color key: ".concat(t)),!1;var i=e[t];if(!this.isValidColorComponent(i))return console.error("Invalid color components at key: ".concat(t)),!1}return!0}},{key:"isValidColorComponent",value:function(e){if("object"!==H(e)||null===e)return!1;var t=e.r,i=e.g,n=e.b,a=e.a;return this.isNumberInRange(t)&&this.isNumberInRange(i)&&this.isNumberInRange(n)&&this.isNumberInRange(a)}},{key:"isNumberInRange",value:function(e){return"number"==typeof e&&e>=0&&e<=1}},{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){return{RoadGeoJsonUrl:this.roadGeoJsonUrl,LayerGroupName:this.layerGroupName,RoadConditionUrl:this.roadConditionUrl,HeightOffset:this.heightOffset,CamFOV:this.camFOV,AspectRatio:this.aspectRatio,Colors:this.colors,BrightnessList:this.brightnessList,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}}])}(),Ui={version:"2.7.7",name:"CloudRenderEngine",author:["liran23"]},Ci=function(){function e(i){var n;U(this,e),(n=w(this,e,[i])).type="IndoorMap",n.url=i.url,n.mpoi="",n.floor=999,n.floorList=[];var a=i.layeringHeight||500,o=i.layeringBaseHeight||300;return n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.animateNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{layeringHeight:{enumerable:!0,get:function(){return a},set:function(e){e!==a&&(a=e,this.materialNeedsUpdate=!0)}},layeringBaseHeight:{enumerable:!0,get:function(){return o},set:function(e){e!==o&&(o=e,this.materialNeedsUpdate=!0)}}}),n}return z(e,Me),k(e,[{key:"dispose",value:function(){return!1}},{key:"getIndoorDataByCenter",value:(n=N(P().mark((function e(t){var i,n,a=arguments;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:500,n=this._getBoundingBox(t,i),e.next=4,this._requestDataList(n.minLng,n.minLat,n.maxLng,n.maxLat);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_requestDataList",value:(i=N(P().mark((function e(t,i,n,a){var o,r,s,l,d;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s="http://".concat(this.url,"/indoor/query/?minX=").concat(t,"&minY=").concat(i,"&maxX=").concat(n,"&maxY=").concat(a),e.next=3,v.get(s);case 3:if(0===(null==(l=e.sent)||null===(o=l.data)||void 0===o?void 0:o.status)){e.next=7;break}return console.error((null==l||null===(d=l.data)||void 0===d?void 0:d.message)||"获取室内数据失败"),e.abrupt("return",[]);case 7:return e.abrupt("return",null===(r=l.data)||void 0===r?void 0:r.indoor);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n,a){return i.apply(this,arguments)})},{key:"_getBoundingBox",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,i=t/111e3,n=t/(111320*Math.cos(e.lat*Math.PI/180));return{minLat:e.lat-i,maxLat:e.lat+i,minLng:e.lng-n,maxLng:e.lng+n}}},{key:"openIndoor",value:function(e){console.log("params --\x3e ",e);var t=e.mpoi,i=void 0===t?"":t,n=e.floor,a=void 0===n?0:n,o=e.floorList,r=void 0===o?[]:o,s=e.buildingCenter,l=void 0===s?{}:s;this.mpoi=i,this.floor=a,this.floorList=r,this.buildingCenter=l,this.materialNeedsUpdate=!0}},{key:"closeIndoor",value:function(){this.mpoi="close",this.floor="",this.materialNeedsUpdate=!0}},{key:"convertFloorString",value:function(e){if(e.startsWith("B"))return-parseInt(e.substring(1),10);if(e.startsWith("F"))return parseInt(e.substring(1),10);throw new Error("Invalid floor string")}},{key:"convertFloorStringToArray",value:function(e){return e.split("|").map((function(e){if(e.startsWith("B"))return-parseInt(e.substring(1),10);if(e.startsWith("F"))return parseInt(e.substring(1),10);throw new Error("Invalid floor string")}))}},{key:"hideBuildings",value:function(e){if(Array.isArray(e)){if((e=De(e)).sort((function(e,t){return e-t})),e.length===this.floorList.length)this.floor=999;else{var t=this.floorList.filter((function(t){return!e.includes(t)}));this.floor=t[t.length-1]}this.eventName="Hide",this.floorNum=e,this.animateNeedsUpdate=!0}else console.error("hideBuildings numbers必须为数组")}},{key:"showBuildings",value:function(e){Array.isArray(e)?((e=De(e)).sort((function(e,t){return e-t})),this.eventName="Show",this.floorNum=e,this.floor=e[e.length-1],this.animateNeedsUpdate=!0):console.error("showBuildings numbers必须为数组")}},{key:"toJSON",value:function(){return{Url:this.url,Mpoi:this.mpoi,Floor:this.floor,LayeringHeight:this.layeringHeight,LayeringBaseHeight:this.layeringBaseHeight,BuildingCenter:this.buildingCenter,FloorNum:this.floorNum,FloorList:this.floorList,EventName:this.eventName,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,type:this.type,uuid:this.uuid}}}]);var i,n}(),ki=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),t=w(this,e,[i]);var n=["Video","Picture"],a=void 0===i.cityList?[]:i.cityList,o=void 0===i.event?"":i.event,r=void 0===i.folderName?"RenderResult":i.folderName,s=void 0===i.renderMode?"Video":i.renderMode,l=void 0===i.sceneBrightness?7:i.sceneBrightness,d=void 0===i.operateData?[]:i.operateData,c=void 0===i.brightness?0:i.brightness,u=void 0===i.renderFrame?60:i.renderFrame;return Object.defineProperties(t,{renderMode:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=n.includes(e)?e:"Video")}},renderFrame:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u=e)}},sceneBrightness:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e)}},operateData:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d=e)}},brightness:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){void 0!==e&&(c=e)}},cityList:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}},event:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,t.materialNeedsUpdate=!0)}},folderName:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e)}}}),t}return z(e,tt),k(e,[{key:"changeRenderMode",value:function(e){this.renderMode=e}},{key:"changeRenderFrame",value:function(e){this.renderFrame=e,this.event="ChangeRenderFrame"}},{key:"changeCityColor",value:function(e){this.cityList=e,this.event="ColorChange"}},{key:"changeHeatmapCoefficient",value:function(e,t){this.cityList=e,this.operateData=[t],this.event="CoefficientChange"}},{key:"changeSceneBrightness",value:function(e){this.sceneBrightness=e,this.event="changeSceneBrightness"}},{key:"changeBrightness",value:function(e){this.brightness=e,this.event="changeBrightness"}},{key:"renderResult",value:function(e,t){this.folderName=t,this.cityList=e,this.event="Render"}},{key:"visAll",value:function(){this.operateData=[],this.event="VisAll"}},{key:"previewAll",value:function(){this.operateData=[],this.event="Preview"}},{key:"previewSingleCity",value:function(e,t){this.cityList=e;var i=this.cityList.map((function(e){return e.CityName})),n=i.indexOf(t);-1!==n?n!==i.length-1?(this.operateData=[t,i[n+1]],this.event="Preview"):console.warn("非法参数,最后一个城市不能预览"):console.warn("没有该城市数据")}},{key:"focusCity",value:function(e){this.operateData=[e],this.event="Focus"}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Brightness:this.brightness,SceneBrightness:this.sceneBrightness,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},OperateData:this.operateData,FolderName:this.folderName,RenderFrame:this.renderFrame,RenderMode:this.renderMode,CityList:this.cityList,Opacity:this.opacity,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return B(e,"copy",this)([t,i]),this}}])}(),Ti=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=w(this,e,[i])).roadGeoJsonUrl=i.roadGeoJsonUrl,t.roadConditionUrl=i.roadConditionUrl,t.type="EarthRoadCondition",t}return z(e,ki),k(e,[{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},RoadConditionUrl:this.roadConditionUrl,RenderFrame:this.renderFrame,RenderMode:this.renderMode,RoadGeoJsonUrl:this.roadGeoJsonUrl,FolderName:this.folderName,CityList:this.cityList,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return B(e,"copy",this)([t,i]),this}}])}(),Oi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=w(this,e,[i])).type="EarthCityRank",t}return z(e,ki),k(e,[{key:"changeRenderFrame",value:function(e){this.renderFrame=e,this.event="ChangeRenderFrame"}},{key:"changeCityColor",value:function(e){this.cityList=e,this.event="ColorChange"}},{key:"renderResult",value:function(e,t){this.folderName=t,this.cityList=e,this.event="Render"}},{key:"visAll",value:function(){this.operateData=[],this.event="VisAll"}},{key:"previewAll",value:function(){this.operateData=[],this.event="Preview"}},{key:"previewSingleCity",value:function(e,t){this.cityList=e;var i=this.cityList.map((function(e){return e.CityName})),n=i.indexOf(t);-1!==n?n!==i.length-1?(this.operateData=[t,i[n+1]],this.event="Preview"):console.warn("非法参数,最后一个城市不能预览"):console.warn("没有该城市数据")}},{key:"focusCity",value:function(e){this.operateData=[e],this.event="Focus"}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},OperateData:this.operateData,FolderName:this.folderName,RenderFrame:this.renderFrame,RenderMode:this.renderMode,CityList:this.cityList,Opacity:this.opacity,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return B(e,"copy",this)([t,i]),this}}])}(),Ri=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=w(this,e,[i])).type="EarthCityHeatMap",t}return z(e,ki),k(e,[{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Brightness:this.brightness,SceneBrightness:this.sceneBrightness,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},OperateData:this.operateData,FolderName:this.folderName,RenderFrame:this.renderFrame,RenderMode:this.renderMode,CityList:this.cityList,Opacity:this.opacity,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return B(e,"copy",this)([t,i]),this}}])}(),Ei=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),t=w(this,e,[i]);var n=void 0===i.roadList?[]:i.roadList,a=void 0===i.cityCompareList?[]:i.cityCompareList;return t.roadURL=i.roadURL,Object.defineProperties(t,{roadList:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e)}},cityCompareList:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}}}),t.type="EarthPersonLine",t}return z(e,ki),k(e,[{key:"changeRenderFrame",value:function(e){this.renderFrame=e,this.event="ChangeRenderFrame"}},{key:"changeColor",value:function(e){this.color=e,this.event="ColorChange"}},{key:"renderResult",value:function(e){this.folderName=e,this.event="Render"}},{key:"previewAll",value:function(){this.event="Preview"}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},RoadList:this.roadList,RoadURL:this.roadURL,CityCompareList:this.cityCompareList,FolderName:this.folderName,Texture:this.texture,RenderFrame:this.renderFrame,RenderMode:this.renderMode,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return B(e,"copy",this)([t,i]),this}}])}(),zi=function(){return k((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};U(this,e),this.cloudRender=t,this.enable=void 0!==i.enable&&i.enable,this.workDistance=void 0===i.workDistance?50:i.workDistance,this.init()}),[{key:"changeEnable",value:function(e){this.enable=e,this.cloudRender.emitUIInteraction({excuteName:"Application_enableFadeMode",params:{Enable:this.enable}})}},{key:"changeWorkDistance",value:function(e){this.workDistance=e,this.cloudRender.emitUIInteraction({excuteName:"Application_enableFadeMode",params:{WorkDistance:this.workDistance}})}},{key:"init",value:function(){this.changeEnable(this.enable),this.changeWorkDistance(this.workDistance)}}])}(),Ii=function(){return k((function e(t){U(this,e),this.cloudRender=t}),[{key:"switchLevel",value:function(e){""!==e&&void 0!==e||console.warn("LevelManage.switchLevel: levelName is required"),this.cloudRender.emitUIInteraction({excuteName:Q.OPEN_LEVEL,params:{LevelName:e}})}},{key:"restartLevel",value:function(){this.cloudRender.emitUIInteraction({excuteName:Q.RESTART_LEVEL}),this.cloudRender.dispatchEvent({type:"levelRecovered"})}},{key:"restartGame",value:function(){this.cloudRender.emitUIInteraction({excuteName:Q.RESTART_GAME}),this.cloudRender.dispatchEvent({type:"gameResarted"})}},{key:"exit",value:function(){this.cloudRender.emitUIInteraction({excuteName:Q.EXIT_CLIENT})}}])}(),Mi=function(){function e(i){var n;if(U(this,e),e._instance)return L(n,e._instance);(n=w(this,e,[i])).type="RoadPile",n.url=i.url,n.header=i.header,n.body=i.body,n.messageNeedsUpdate=!1,n.childNeedsUpdate=!1;var a=Math.max(1,i.updateInterval||2),o=void 0===i.searchMode?"coord":i.searchMode,r=void 0===i.tileLevel?16:i.tileLevel,s=void 0===i.renderScale?1:i.renderScale;return n.maxUpdateHeight=void 0===i.maxUpdateHeight?1e3:i.maxUpdateHeight,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{renderScale:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=Math.max(e,.1),n.messageNeedsUpdate=!0)}},updateInterval:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=Math.max(e,2),n.messageNeedsUpdate=!0)}},searchMode:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,n.messageNeedsUpdate=!0)}},tileLevel:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,n.messageNeedsUpdate=!0)}}}),e._instance=n,n}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"body",get:function(){return this._body},set:function(e){this.messageNeedsUpdate=!0,this._body=e}},{key:"toJSON",value:function(){return{Url:this.url,Body:this.body,Header:this.header,SearchMode:this.searchMode,TileLevel:this.tileLevel,RenderScale:this.renderScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,UpdateInterval:this.updateInterval}}}],[{key:"getInstance",value:function(t){return e._instance||(e._instance=new e(t)),e._instance}}])}();O(Mi,"_instance",null);var Ai=function(){function e(t){var i;if(U(this,e),e._instance)return L(i,e._instance);(i=w(this,e,[t])).type="RoadDataManager",i.messageNeedsUpdate=!1,i.childNeedsUpdate=!1;var n=void 0===t.poiRenderScale?1:t.poiRenderScale,a=void 0===t.roadnameRenderScale?1:t.roadnameRenderScale,o=t.hiddenList||[];return i.materialNeedsUpdate=!1,i.matrixNeedsUpdate=!1,Object.defineProperties(i,{poiRenderScale:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=Math.max(e,.1),i.messageNeedsUpdate=!0)}},roadnameRenderScale:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=Math.max(e,.1),i.messageNeedsUpdate=!0)}},hiddenList:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,i.messageNeedsUpdate=!0)}}}),e._instance=i,i}return z(e,Me),k(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"body",get:function(){return this._body},set:function(e){this.messageNeedsUpdate=!0,this._body=e}},{key:"toJSON",value:function(){return{PoiRenderScale:this.poiRenderScale,RoadnameRenderScale:this.roadnameRenderScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,HiddenList:this.hiddenList,visible:this.visible,type:this.type,uuid:this.uuid}}}],[{key:"getInstance",value:function(t){return e._instance||(e._instance=new e(t)),e._instance}}])}();O(Ai,"_instance",null);var Li=function(){return k((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};U(this,e),this.cloudRender=t,this.rayDetectionDistance=i.rayDetectionDistance||5e5,this.url=i.url||"",this.enableUI=void 0===i.enableUI||i.enableUI,i.onSelected&&this.cloudRender.addEventListener("L2Selected",i.onSelected),this.enable=i.enable,i.enable&&this.enablePickup()}),[{key:"enablePickup",value:function(){this.enable=!0,this.cloudRender.emitUIInteraction({excuteName:q.ENABLE_L2_BUILDING_SELECT,params:{Url:this.url,RayDetectionDistance:this.rayDetectionDistance,Enable:this.enable,EnableUI:this.enableUI}})}},{key:"disablePickup",value:function(){this.enable=!1,this.cloudRender.emitUIInteraction({excuteName:q.ENABLE_L2_BUILDING_SELECT,params:{Enable:this.enable}})}}])}();export{zi as AdvancedFade,qt as AssetLayer,li as AutonomousVehicleLayer,kt as BasicLabel,ti as Bucket,Li as BuildingPickup,oi as CarPark,Dt as Circle,yt as CloudRenderEngine,yi as ClusterPoint,pe as CommonConstant,Tt as Cone,Jt as ConstructionLayer,dt as Cube,zt as Cylinder,It as Decal,Zt as Diamond,Ft as DiamondSign,Ot as FlashCar,Rt as FlashCarCrash,Et as FlashPeople,Wt as Heatmap,Yt as I3DTileLayer,wt as IconPoint,Ci as IndoorMap,xi as InfoLightLayer,ii as Inundation,wi as LargeRoadCondition,ui as LayerBuilding,Ii as LevelManage,Ni as Light,st as Line,hi as MockCarStream,St as ODLine,Ht as Particle,Mt as Plane,lt as Point,it as Polygon,At as QuadPyramid,di as QuadPyramidTop,Xt as Radar,Kt as Ripple,Vt as RoadCondition,Ai as RoadDataManager,si as RoadName,Mi as RoadPile,Si as RoutePlan,Ri as SequencerEarthCityHeatmap,Oi as SequencerEarthCityRank,Ei as SequencerEarthPersonLine,Ti as SequencerEarthRoadCondition,tt as Shape,ni as Skyline,fi as SlopeAnalysis,Qt as Soil,Lt as Sphere,Ut as TextPoint,xt as TextUtils,_t as Torus,Pt as TrafficCone,Gt as TrafficLayer,ri as TrafficLightLayer,$t as TrafficShape,ei as TriangleWarning,Bt as Tube,fe as UltralDynamicSky,Ui as VersionInfo,ai as VisualField,ci as WebViewPoint,Ve as convertCanvas2Base64,Ke as drawCanvas,et as drawTextToImage,Ge as loadImageAsBase64};