19 lines
2.5 MiB
19 lines
2.5 MiB
/*! update time: 2025/9/24 18:23:35*/!function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=22)}([function(e,t,i){var n=i(23)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(18);function o(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}e.exports=function(e,t,i){return t&&o(e.prototype,t),i&&o(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function i(e,t,i,n,o,s,a){try{var r=e[s](a),l=r.value}catch(e){return void i(e)}r.done?t(l):Promise.resolve(l).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,s){var a=e.apply(t,n);function r(e){i(a,o,s,r,l,"next",e)}function l(e){i(a,o,s,r,l,"throw",e)}r(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(15);e.exports=function(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&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function i(t){return e.exports=i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,i(t)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(28),o=i(29),s=i(16),a=i(30);e.exports=function(e){return n(e)||o(e)||s(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(11).default,o=i(12);e.exports=function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(18);e.exports=function(e,t,i){return(t=n(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(19);function o(){return e.exports=o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var o=n(e,t);if(o){var s=Object.getOwnPropertyDescriptor(o,t);return s.get?s.get.call(arguments.length<3?e:i):s.value}},e.exports.__esModule=!0,e.exports.default=e.exports,o.apply(null,arguments)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(24),o=i(25),s=i(16),a=i(26);e.exports=function(e,t){return n(e)||o(e,t)||s(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function i(t){return e.exports=i="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},e.exports.__esModule=!0,e.exports.default=e.exports,i(t)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){throw new TypeError('"'+e+'" is read-only')},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(19),o=i(8);function s(e,t,i,a){return(s="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(e,t,i,s){var a,r=n(e,t);if(r){if((a=Object.getOwnPropertyDescriptor(r,t)).set)return a.set.call(s,i),!0;if(!a.writable)return!1}if(a=Object.getOwnPropertyDescriptor(s,t)){if(!a.writable)return!1;a.value=i,Object.defineProperty(s,t,a)}else o(s,t,i);return!0})(e,t,i,a)}e.exports=function(e,t,i,n,o){if(!s(e,t,i,n||e)&&o)throw new TypeError("failed to set property");return i},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function i(t,n){return e.exports=i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,i(t,n)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(17);e.exports=function(e,t){if(e){if("string"==typeof e)return n(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)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(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},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(11).default,o=i(27);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(5);e.exports=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(module,exports,__webpack_require__){(function(process,global){var __WEBPACK_AMD_DEFINE_RESULT__;
|
||
/**
|
||
* [js-md5]{@link https://github.com/emn178/js-md5}
|
||
*
|
||
* @namespace md5
|
||
* @version 0.7.3
|
||
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
||
* @copyright Chen, Yi-Cyuan 2014-2017
|
||
* @license MIT
|
||
*/!function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD=__webpack_require__(33),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t){return new Md5(!0).update(t)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.create=function(){return new Md5},e.update=function(t){return e.create().update(t)};for(var t=0;t<OUTPUT_TYPES.length;++t){var i=OUTPUT_TYPES[t];e[i]=createOutputMethod(i)}return e},nodeWrap=function(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function(e){if("string"==typeof e)return crypto.createHash("md5").update(e,"utf8").digest("hex");if(null==e)throw ERROR;return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||ArrayBuffer.isView(e)||e.constructor===Buffer?crypto.createHash("md5").update(new Buffer(e)).digest("hex"):method(e)};return nodeMethod};function Md5(e){if(e)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Md5.prototype.update=function(e){if(!this.finalized){var t,i=typeof e;if("string"!==i){if("object"!==i)throw ERROR;if(null===e)throw ERROR;if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw ERROR;t=!0}for(var n,o,s=0,a=e.length,r=this.blocks,l=this.buffer8;s<a;){if(this.hashed&&(this.hashed=!1,r[0]=r[16],r[16]=r[1]=r[2]=r[3]=r[4]=r[5]=r[6]=r[7]=r[8]=r[9]=r[10]=r[11]=r[12]=r[13]=r[14]=r[15]=0),t)if(ARRAY_BUFFER)for(o=this.start;s<a&&o<64;++s)l[o++]=e[s];else for(o=this.start;s<a&&o<64;++s)r[o>>2]|=e[s]<<SHIFT[3&o++];else if(ARRAY_BUFFER)for(o=this.start;s<a&&o<64;++s)(n=e.charCodeAt(s))<128?l[o++]=n:n<2048?(l[o++]=192|n>>6,l[o++]=128|63&n):n<55296||n>=57344?(l[o++]=224|n>>12,l[o++]=128|n>>6&63,l[o++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++s)),l[o++]=240|n>>18,l[o++]=128|n>>12&63,l[o++]=128|n>>6&63,l[o++]=128|63&n);else for(o=this.start;s<a&&o<64;++s)(n=e.charCodeAt(s))<128?r[o>>2]|=n<<SHIFT[3&o++]:n<2048?(r[o>>2]|=(192|n>>6)<<SHIFT[3&o++],r[o>>2]|=(128|63&n)<<SHIFT[3&o++]):n<55296||n>=57344?(r[o>>2]|=(224|n>>12)<<SHIFT[3&o++],r[o>>2]|=(128|n>>6&63)<<SHIFT[3&o++],r[o>>2]|=(128|63&n)<<SHIFT[3&o++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++s)),r[o>>2]|=(240|n>>18)<<SHIFT[3&o++],r[o>>2]|=(128|n>>12&63)<<SHIFT[3&o++],r[o>>2]|=(128|n>>6&63)<<SHIFT[3&o++],r[o>>2]|=(128|63&n)<<SHIFT[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,i,n,o,s,a=this.blocks;this.first?t=((t=((e=((e=a[0]-680876937)<<7|e>>>25)-271733879<<0)^(i=((i=(-271733879^(n=((n=(-1732584194^2004318071&e)+a[1]-117830708)<<12|n>>>20)+e<<0)&(-271733879^e))+a[2]-1126478375)<<17|i>>>15)+n<<0)&(n^e))+a[3]-1316259209)<<22|t>>>10)+i<<0:(e=this.h0,t=this.h1,i=this.h2,t=((t+=((e=((e+=((n=this.h3)^t&(i^n))+a[0]-680876936)<<7|e>>>25)+t<<0)^(i=((i+=(t^(n=((n+=(i^e&(t^i))+a[1]-389564586)<<12|n>>>20)+e<<0)&(e^t))+a[2]+606105819)<<17|i>>>15)+n<<0)&(n^e))+a[3]-1044525330)<<22|t>>>10)+i<<0),t=((t+=((e=((e+=(n^t&(i^n))+a[4]-176418897)<<7|e>>>25)+t<<0)^(i=((i+=(t^(n=((n+=(i^e&(t^i))+a[5]+1200080426)<<12|n>>>20)+e<<0)&(e^t))+a[6]-1473231341)<<17|i>>>15)+n<<0)&(n^e))+a[7]-45705983)<<22|t>>>10)+i<<0,t=((t+=((e=((e+=(n^t&(i^n))+a[8]+1770035416)<<7|e>>>25)+t<<0)^(i=((i+=(t^(n=((n+=(i^e&(t^i))+a[9]-1958414417)<<12|n>>>20)+e<<0)&(e^t))+a[10]-42063)<<17|i>>>15)+n<<0)&(n^e))+a[11]-1990404162)<<22|t>>>10)+i<<0,t=((t+=((e=((e+=(n^t&(i^n))+a[12]+1804603682)<<7|e>>>25)+t<<0)^(i=((i+=(t^(n=((n+=(i^e&(t^i))+a[13]-40341101)<<12|n>>>20)+e<<0)&(e^t))+a[14]-1502002290)<<17|i>>>15)+n<<0)&(n^e))+a[15]+1236535329)<<22|t>>>10)+i<<0,t=((t+=((n=((n+=(t^i&((e=((e+=(i^n&(t^i))+a[1]-165796510)<<5|e>>>27)+t<<0)^t))+a[6]-1069501632)<<9|n>>>23)+e<<0)^e&((i=((i+=(e^t&(n^e))+a[11]+643717713)<<14|i>>>18)+n<<0)^n))+a[0]-373897302)<<20|t>>>12)+i<<0,t=((t+=((n=((n+=(t^i&((e=((e+=(i^n&(t^i))+a[5]-701558691)<<5|e>>>27)+t<<0)^t))+a[10]+38016083)<<9|n>>>23)+e<<0)^e&((i=((i+=(e^t&(n^e))+a[15]-660478335)<<14|i>>>18)+n<<0)^n))+a[4]-405537848)<<20|t>>>12)+i<<0,t=((t+=((n=((n+=(t^i&((e=((e+=(i^n&(t^i))+a[9]+568446438)<<5|e>>>27)+t<<0)^t))+a[14]-1019803690)<<9|n>>>23)+e<<0)^e&((i=((i+=(e^t&(n^e))+a[3]-187363961)<<14|i>>>18)+n<<0)^n))+a[8]+1163531501)<<20|t>>>12)+i<<0,t=((t+=((n=((n+=(t^i&((e=((e+=(i^n&(t^i))+a[13]-1444681467)<<5|e>>>27)+t<<0)^t))+a[2]-51403784)<<9|n>>>23)+e<<0)^e&((i=((i+=(e^t&(n^e))+a[7]+1735328473)<<14|i>>>18)+n<<0)^n))+a[12]-1926607734)<<20|t>>>12)+i<<0,t=((t+=((s=(n=((n+=((o=t^i)^(e=((e+=(o^n)+a[5]-378558)<<4|e>>>28)+t<<0))+a[8]-2022574463)<<11|n>>>21)+e<<0)^e)^(i=((i+=(s^t)+a[11]+1839030562)<<16|i>>>16)+n<<0))+a[14]-35309556)<<23|t>>>9)+i<<0,t=((t+=((s=(n=((n+=((o=t^i)^(e=((e+=(o^n)+a[1]-1530992060)<<4|e>>>28)+t<<0))+a[4]+1272893353)<<11|n>>>21)+e<<0)^e)^(i=((i+=(s^t)+a[7]-155497632)<<16|i>>>16)+n<<0))+a[10]-1094730640)<<23|t>>>9)+i<<0,t=((t+=((s=(n=((n+=((o=t^i)^(e=((e+=(o^n)+a[13]+681279174)<<4|e>>>28)+t<<0))+a[0]-358537222)<<11|n>>>21)+e<<0)^e)^(i=((i+=(s^t)+a[3]-722521979)<<16|i>>>16)+n<<0))+a[6]+76029189)<<23|t>>>9)+i<<0,t=((t+=((s=(n=((n+=((o=t^i)^(e=((e+=(o^n)+a[9]-640364487)<<4|e>>>28)+t<<0))+a[12]-421815835)<<11|n>>>21)+e<<0)^e)^(i=((i+=(s^t)+a[15]+530742520)<<16|i>>>16)+n<<0))+a[2]-995338651)<<23|t>>>9)+i<<0,t=((t+=((n=((n+=(t^((e=((e+=(i^(t|~n))+a[0]-198630844)<<6|e>>>26)+t<<0)|~i))+a[7]+1126891415)<<10|n>>>22)+e<<0)^((i=((i+=(e^(n|~t))+a[14]-1416354905)<<15|i>>>17)+n<<0)|~e))+a[5]-57434055)<<21|t>>>11)+i<<0,t=((t+=((n=((n+=(t^((e=((e+=(i^(t|~n))+a[12]+1700485571)<<6|e>>>26)+t<<0)|~i))+a[3]-1894986606)<<10|n>>>22)+e<<0)^((i=((i+=(e^(n|~t))+a[10]-1051523)<<15|i>>>17)+n<<0)|~e))+a[1]-2054922799)<<21|t>>>11)+i<<0,t=((t+=((n=((n+=(t^((e=((e+=(i^(t|~n))+a[8]+1873313359)<<6|e>>>26)+t<<0)|~i))+a[15]-30611744)<<10|n>>>22)+e<<0)^((i=((i+=(e^(n|~t))+a[6]-1560198380)<<15|i>>>17)+n<<0)|~e))+a[13]+1309151649)<<21|t>>>11)+i<<0,t=((t+=((n=((n+=(t^((e=((e+=(i^(t|~n))+a[4]-145523070)<<6|e>>>26)+t<<0)|~i))+a[11]-1120210379)<<10|n>>>22)+e<<0)^((i=((i+=(e^(n|~t))+a[2]+718787259)<<15|i>>>17)+n<<0)|~e))+a[9]-343485551)<<21|t>>>11)+i<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=i-1732584194<<0,this.h3=n+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+i<<0,this.h3=this.h3+n<<0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,n=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,n=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&i,i>>8&255,i>>16&255,i>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,i,n="",o=this.array(),s=0;s<15;)e=o[s++],t=o[s++],i=o[s++],n+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|i>>>6)]+BASE64_ENCODE_CHAR[63&i];return e=o[s],n+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(31),__webpack_require__(32))},function(e,t,i){var n=i(5),o=i(15),s=i(34),a=i(35);function r(t){var i="function"==typeof Map?new Map:void 0;return e.exports=r=function(e){if(null===e||!s(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,t)}function t(){return a(e,arguments,n(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){e.exports=i(39)},function(e,t,i){var n=i(11).default;function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e.exports=o=function(){return i},e.exports.__esModule=!0,e.exports.default=e.exports;var t,i={},s=Object.prototype,a=s.hasOwnProperty,r=Object.defineProperty||function(e,t,i){e[t]=i.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function p(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,i){return e[t]=i}}function d(e,t,i,n){var o=t&&t.prototype instanceof b?t:b,s=Object.create(o.prototype),a=new N(n||[]);return r(s,"_invoke",{value:D(e,i,a)}),s}function m(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}i.wrap=d;var f="suspendedStart",v="executing",g="completed",y={};function b(){}function C(){}function w(){}var k={};p(k,c,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(B([])));x&&x!==s&&a.call(x,c)&&(k=x);var E=w.prototype=b.prototype=Object.create(k);function S(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function i(o,s,r,l){var c=m(e[o],e,s);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==n(h)&&a.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,r,l)}),(function(e){i("throw",e,r,l)})):t.resolve(h).then((function(e){u.value=e,r(u)}),(function(e){return i("throw",e,r,l)}))}l(c.arg)}var o;r(this,"_invoke",{value:function(e,n){function s(){return new t((function(t,o){i(e,n,t,o)}))}return o=o?o.then(s,s):s()}})}function D(e,i,n){var o=f;return function(s,a){if(o===v)throw Error("Generator is already running");if(o===g){if("throw"===s)throw a;return{value:t,done:!0}}for(n.method=s,n.arg=a;;){var r=n.delegate;if(r){var l=M(r,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=m(e,i,n);if("normal"===c.type){if(o=n.done?g:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.arg)}}}function M(e,i){var n=i.method,o=e.iterator[n];if(o===t)return i.delegate=null,"throw"===n&&e.iterator.return&&(i.method="return",i.arg=t,M(e,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var s=m(o,e.iterator,i.arg);if("throw"===s.type)return i.method="throw",i.arg=s.arg,i.delegate=null,y;var a=s.arg;return a?a.done?(i[e.resultName]=a.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,y):a:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function T(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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function B(e){if(e||""===e){var i=e[c];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,s=function i(){for(;++o<e.length;)if(a.call(e,o))return i.value=e[o],i.done=!1,i;return i.value=t,i.done=!0,i};return s.next=s}}throw new TypeError(n(e)+" is not iterable")}return C.prototype=w,r(E,"constructor",{value:w,configurable:!0}),r(w,"constructor",{value:C,configurable:!0}),C.displayName=p(w,h,"GeneratorFunction"),i.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===C||"GeneratorFunction"===(t.displayName||t.name))},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,p(e,h,"GeneratorFunction")),e.prototype=Object.create(E),e},i.awrap=function(e){return{__await:e}},S(P.prototype),p(P.prototype,u,(function(){return this})),i.AsyncIterator=P,i.async=function(e,t,n,o,s){void 0===s&&(s=Promise);var a=new P(d(e,t,n,o),s);return i.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(E),p(E,h,"Generator"),p(E,c,(function(){return this})),p(E,"toString",(function(){return"[object Generator]"})),i.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}},i.values=B,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var i in this)"t"===i.charAt(0)&&a.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function n(n,o){return r.type="throw",r.arg=e,i.next=n,o&&(i.method="next",i.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],r=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var l=a.call(s,"catchLoc"),c=a.call(s,"finallyLoc");if(l&&c){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(s)},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),y},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),O(i),y}},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 o=n.arg;O(i)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,i,n){return this.delegate={iterator:B(e),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=t),y}},i}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,o,s,a,r=[],l=!0,c=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(r.push(n.value),r.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(c)throw o}}return r}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(11).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var o=i.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(17);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){var i,n,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function r(e){if(i===setTimeout)return setTimeout(e,0);if((i===s||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:s}catch(e){i=s}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var l,c=[],u=!1,h=-1;function p(){u&&l&&(u=!1,l.length?c=l.concat(c):h=-1,c.length&&d())}function d(){if(!u){var e=r(p);u=!0;for(var t=c.length;t;){for(l=c,c=[];++h<t;)l&&l[h].run();h=-1,t=c.length}l=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function f(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];c.push(new m(e,t)),1!==c.length||u||r(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=f,o.addListener=f,o.once=f,o.off=f,o.removeListener=f,o.removeAllListeners=f,o.emit=f,o.prependListener=f,o.prependOnceListener=f,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t){(function(t){e.exports=t}).call(this,{toUrlUndefined:!0})},function(e,t){e.exports=function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(36),o=i(15);e.exports=function(e,t,i){if(n())return Reflect.construct.apply(null,arguments);var s=[null];s.push.apply(s,t);var a=new(e.bind.apply(e,s));return i&&o(a,i.prototype),a},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function i(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(e.exports=i=function(){return!!t},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},function(e){e.exports=JSON.parse("{}")},function(e){e.exports=JSON.parse('{"地震灾害":{"1":{"c":30,"m":85,"y":65,"k":0},"2":{"c":0,"m":95,"y":40,"k":0},"3":{"c":5,"m":55,"y":40,"k":0},"4":{"c":2,"m":20,"y":20,"k":0}},"洪水灾害":{"1":{"c":100,"m":70,"y":40,"k":0},"2":{"c":70,"m":50,"y":10,"k":0},"3":{"c":55,"m":30,"y":10,"k":0},"4":{"c":20,"m":10,"y":5,"k":0}},"干旱灾害":{"1":{"c":10,"m":15,"y":100,"k":10},"2":{"c":0,"m":5,"y":55,"k":0},"3":{"c":0,"m":2,"y":25,"k":0},"4":{"c":0,"m":0,"y":10,"k":0}},"雪灾灾害":{"1":{"c":100,"m":65,"y":40,"k":0},"2":{"c":100,"m":40,"y":15,"k":0},"3":{"c":65,"m":25,"y":10,"k":0},"4":{"c":18,"m":8,"y":8,"k":0}},"雷电、冰雹灾害":{"1":{"c":40,"m":45,"y":40,"k":0},"2":{"c":30,"m":30,"y":25,"k":0},"3":{"c":0,"m":0,"y":0,"k":16},"4":{"c":0,"m":0,"y":0,"k":0}},"高温灾害":{"1":{"c":20,"m":90,"y":65,"k":20},"2":{"c":20,"m":85,"y":100,"k":0},"3":{"c":0,"m":55,"y":80,"k":0},"4":{"c":0,"m":30,"y":85,"k":0}},"低温灾害":{"1":{"c":70,"m":70,"y":50,"k":0},"2":{"c":60,"m":50,"y":30,"k":0},"3":{"c":40,"m":35,"y":20,"k":0},"4":{"c":10,"m":10,"y":5,"k":0}},"台风灾害":{"1":{"c":95,"m":75,"y":75,"k":0},"2":{"c":75,"m":60,"y":65,"k":0},"3":{"c":40,"m":25,"y":30,"k":0},"4":{"c":25,"m":10,"y":15,"k":0}},"大风、沙尘暴灾害":{"1":{"c":0,"m":40,"y":100,"k":45},"2":{"c":0,"m":0,"y":100,"k":25},"3":{"c":0,"m":0,"y":60,"k":0},"4":{"c":0,"m":0,"y":25,"k":0}},"暴雨灾害":{"1":{"c":100,"m":70,"y":40,"k":0},"2":{"c":70,"m":50,"y":10,"k":0},"3":{"c":55,"m":30,"y":10,"k":0},"4":{"c":20,"m":10,"y":5,"k":0}},"自然灾害GDP综合风险图色彩样式":{"1":{"c":15,"m":100,"y":85,"k":0},"2":{"c":7,"m":50,"y":60,"k":0},"3":{"c":0,"m":5,"y":55,"k":0},"4":{"c":0,"m":2,"y":25,"k":0},"5":{"c":0,"m":0,"y":10,"k":0}},"自然灾害死亡人口综合风险图色彩样式":{"1":{"c":0,"m":100,"y":100,"k":25},"2":{"c":15,"m":100,"y":85,"k":0},"3":{"c":5,"m":50,"y":60,"k":0},"4":{"c":5,"m":35,"y":40,"k":0},"5":{"c":0,"m":15,"y":15,"k":0}},"自然灾害受灾人口综合风险图色彩样式":{"1":{"c":25,"m":58,"y":95,"k":0},"2":{"c":8,"m":45,"y":95,"k":0},"3":{"c":5,"m":30,"y":60,"k":0},"4":{"c":2,"m":20,"y":40,"k":0},"5":{"c":0,"m":10,"y":20,"k":0}},"自然灾害农作物综合风险图色彩样式":{"1":{"c":0,"m":40,"y":100,"k":45},"2":{"c":0,"m":0,"y":100,"k":45},"3":{"c":0,"m":0,"y":100,"k":25},"4":{"c":0,"m":0,"y":60,"k":0},"5":{"c":10,"m":5,"y":15,"k":0}},"自然灾害房屋综合风险图色彩样式":{"1":{"c":60,"m":90,"y":70,"k":0},"2":{"c":50,"m":90,"y":60,"k":0},"3":{"c":40,"m":80,"y":40,"k":0},"4":{"c":25,"m":45,"y":25,"k":0},"5":{"c":15,"m":25,"y":15,"k":0}},"自然灾害道路综合风险图色彩样式":{"1":{"c":55,"m":65,"y":75,"k":0},"2":{"c":45,"m":50,"y":60,"k":0},"3":{"c":20,"m":30,"y":40,"k":0},"4":{"c":7,"m":15,"y":35,"k":0},"5":{"c":0,"m":10,"y":25,"k":0}},"自然灾害减灾能力图色彩样式":{"1":{"c":90,"m":50,"y":95,"k":0},"2":{"c":70,"m":40,"y":80,"k":0},"3":{"c":50,"m":30,"y":65,"k":0},"4":{"c":35,"m":20,"y":50,"k":0},"5":{"c":10,"m":5,"y":35,"k":0}},"自然灾害综合防治区划图色彩样式":{"1":{"c":0,"m":90,"y":80,"k":0},"2":{"c":0,"m":50,"y":80,"k":0},"3":{"c":60,"m":0,"y":50,"k":25},"4":{"c":60,"m":0,"y":100,"k":0}}}')},function(e,t,i){"use strict";i.r(t);var n=i(3),o=i.n(n),s=i(0),a=i.n(s);var r="9e549c39c542fc9f835c2a5c260f8cc1",l="40ef4712c26360d01e397ebcb0d031ca";function c(){return u.apply(this,arguments)}function u(){return(u=o()(a.a.mark((function e(){var t,i,n,o=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},e.next=3,fetch((t.host||"")+"/yjearth4.0/api/v1/user/sign-in",{method:"post",body:JSON.stringify({username:t.username,password:t.password}),headers:{"Content-Type":"application/json"}});case 3:return i=e.sent,e.next=6,i.text();case 6:n=e.sent,0===(n=JSON.parse(n)).code&&(h(t.host),n.token?d(n.token):d(n.data.token));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(e){localStorage.setItem(l,e||"")}function p(){return localStorage.getItem(l)||""}function d(e){localStorage.setItem(r,e)}function m(){return localStorage.getItem(r)}function f(){var e=document.querySelectorAll("script"),t="";return e.forEach((function(e){if(e.src.indexOf("YJEarth.min.js")>-1){var i=e.src.split("/");i.pop(),t=i.join("/")}})),t}var g=i(10),y=i.n(g),b=i(8),C=i.n(b),w=i(1),k=i.n(w),_=i(2),x=i.n(_);function E(e){document.addEventListener("keydown",M.bind(e),!1),document.addEventListener("keyup",T.bind(e),!1),e&&e.clock.onTick.addEventListener((function(){!function(e){if(!e||!e.scene||!e.scene.screenSpaceCameraController.enableTilt)return;var t=e.camera,i=e.scene.globe.ellipsoid.cartesianToCartographic(t.position).height,n=t.positionCartographic.height,o=i/20,s=o/5e5/Cesium.Math.toDegrees(t.pitch),a=n/100;S.moveForward&&(2==e.scene.mode?t.moveUp(a):t.rotate(t.right,-s));S.moveBackward&&(2==e.scene.mode?t.moveDown(a):t.rotate(t.right,s));S.moveLeft&&(2==e.scene.mode?t.moveLeft(a):t.rotate(t.up,-s));S.moveRight&&(2==e.scene.mode?t.moveRight(a):t.rotate(t.up,s));S.moveUp&&t.moveUp(o);S.moveDown&&t.moveDown(o);S.lookUp&&t.lookUp();S.lookDown&&t.lookDown();S.lookLeft&&t.lookLeft();S.lookRight&&t.lookRight();S.twistLeft&&t.twistLeft();S.twistRight&&t.twistRight();if(S.zoomIn){var r=i/2;r<1&&(r=0),t.zoomIn(r)}if(S.zoomOut){var l=i/2;i+i>=5e7&&(l=5e7-i),t.zoomOut(l)}}(e)}))}var S={moveForward:!1,moveBackward:!1,moveLeft:!1,moveRight:!1,moveUp:!1,moveDown:!1,lookUp:!1,lookDown:!1,lookLeft:!1,lookRight:!1,twistLeft:!1,twistRight:!1,zoomIn:!1,zoomOut:!1};function D(e){switch(e){case 87:return"moveForward";case 83:return"moveBackward";case 68:return"moveRight";case 65:return"moveLeft";case 81:return"moveUp";case 69:return"moveDown";case 38:return"lookUp";case 40:return"lookDown";case 37:return"lookLeft";case 39:return"lookRight";case 96:return"twistLeft";case 110:return"twistRight";case 107:return"zoomIn";case 109:return"zoomOut";default:return}}function M(e){var t;if("input"===(t=document.activeElement).tagName.toLowerCase()&&"checkbox"!==t.type||"textarea"===t.tagName.toLowerCase()||"textarea"===t.getAttribute("role"));else if(this.trackedEntity);else if(this._firstPersonView);else if(this._disableKeyboardEvent);else if(e.ctrlKey&&e.altKey){if("v"===e.key||"V"===e.key){var i=this.camera;this._CAMERA_SHORTCUT_VIEW={orientation:{heading:i.heading,pitch:i.pitch,roll:i.roll},position:{x:i.position.x,y:i.position.y,z:i.position.z}},localStorage.setItem("CAMERA_SHORTCUT_VIEW",JSON.stringify(this._CAMERA_SHORTCUT_VIEW))}if("f"===e.key||"F"===e.key){var n=localStorage.getItem("CAMERA_SHORTCUT_VIEW");this._CAMERA_SHORTCUT_VIEW=JSON.parse(n),this._CAMERA_SHORTCUT_VIEW&&this._CAMERA_SHORTCUT_VIEW.position&&this._CAMERA_SHORTCUT_VIEW.orientation&&this.camera.flyTo({destination:this._CAMERA_SHORTCUT_VIEW.position,orientation:this._CAMERA_SHORTCUT_VIEW.orientation})}}else{var o=D(e.keyCode);void 0!==o&&(S[o]=!0)}}function T(e){var t=D(e.keyCode);void 0!==t&&(S[t]=!1)}var O=i(11),N=i.n(O),B=i(6),A=i.n(B),L=i(20),I=i.n(L),j=[{name:"GCS_WGS_1984",epsg:"EPSG:4326",def:"+proj=longlat +datum=WGS84 +no_defs"},{name:"GCS_China_Geodetic_Coordinate_System_2000",epsg:"EPSG:4490",def:"+proj=longlat +ellps=GRS80 +no_defs"},{name:"WGS 84 / UTM zone 1N",epsg:"EPSG:32601",def:"+proj=utm +zone=1 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 2N",epsg:"EPSG:32602",def:"+proj=utm +zone=2 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 3N",epsg:"EPSG:32603",def:"+proj=utm +zone=3 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 4N",epsg:"EPSG:32604",def:"+proj=utm +zone=4 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 5N",epsg:"EPSG:32605",def:"+proj=utm +zone=5 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 6N",epsg:"EPSG:32606",def:"+proj=utm +zone=6 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 7N",epsg:"EPSG:32607",def:"+proj=utm +zone=7 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 8N",epsg:"EPSG:32608",def:"+proj=utm +zone=8 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 9N",epsg:"EPSG:32609",def:"+proj=utm +zone=9 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 10N",epsg:"EPSG:32610",def:"+proj=utm +zone=10 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 11N",epsg:"EPSG:32611",def:"+proj=utm +zone=11 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 12N",epsg:"EPSG:32612",def:"+proj=utm +zone=12 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 13N",epsg:"EPSG:32613",def:"+proj=utm +zone=13 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 14N",epsg:"EPSG:32614",def:"+proj=utm +zone=14 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 15N",epsg:"EPSG:32615",def:"+proj=utm +zone=15 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 16N",epsg:"EPSG:32616",def:"+proj=utm +zone=16 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 17N",epsg:"EPSG:32617",def:"+proj=utm +zone=17 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 18N",epsg:"EPSG:32618",def:"+proj=utm +zone=18 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 19N",epsg:"EPSG:32619",def:"+proj=utm +zone=19 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 20N",epsg:"EPSG:32620",def:"+proj=utm +zone=20 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 21N",epsg:"EPSG:32621",def:"+proj=utm +zone=21 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 22N",epsg:"EPSG:32622",def:"+proj=utm +zone=22 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 23N",epsg:"EPSG:32623",def:"+proj=utm +zone=23 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 24N",epsg:"EPSG:32624",def:"+proj=utm +zone=24 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 25N",epsg:"EPSG:32625",def:"+proj=utm +zone=25 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 26N",epsg:"EPSG:32626",def:"+proj=utm +zone=26 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 27N",epsg:"EPSG:32627",def:"+proj=utm +zone=27 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 28N",epsg:"EPSG:32628",def:"+proj=utm +zone=28 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 29N",epsg:"EPSG:32629",def:"+proj=utm +zone=29 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 30N",epsg:"EPSG:32630",def:"+proj=utm +zone=30 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 31N",epsg:"EPSG:32631",def:"+proj=utm +zone=31 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 32N",epsg:"EPSG:32632",def:"+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 33N",epsg:"EPSG:32633",def:"+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 34N",epsg:"EPSG:32634",def:"+proj=utm +zone=34 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 35N",epsg:"EPSG:32635",def:"+proj=utm +zone=35 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 36N",epsg:"EPSG:32636",def:"+proj=utm +zone=36 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 37N",epsg:"EPSG:32637",def:"+proj=utm +zone=37 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 38N",epsg:"EPSG:32638",def:"+proj=utm +zone=38 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 39N",epsg:"EPSG:32639",def:"+proj=utm +zone=39 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 40N",epsg:"EPSG:32640",def:"+proj=utm +zone=40 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 41N",epsg:"EPSG:32641",def:"+proj=utm +zone=41 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 42N",epsg:"EPSG:32642",def:"+proj=utm +zone=42 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 43N",epsg:"EPSG:32643",def:"+proj=utm +zone=43 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 44N",epsg:"EPSG:32644",def:"+proj=utm +zone=44 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 45N",epsg:"EPSG:32645",def:"+proj=utm +zone=45 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 46N",epsg:"EPSG:32646",def:"+proj=utm +zone=46 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 47N",epsg:"EPSG:32647",def:"+proj=utm +zone=47 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 48N",epsg:"EPSG:32648",def:"+proj=utm +zone=48 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 49N",epsg:"EPSG:32649",def:"+proj=utm +zone=49 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 50N",epsg:"EPSG:32650",def:"+proj=utm +zone=50 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 51N",epsg:"EPSG:32651",def:"+proj=utm +zone=51 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 52N",epsg:"EPSG:32652",def:"+proj=utm +zone=52 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 53N",epsg:"EPSG:32653",def:"+proj=utm +zone=53 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 54N",epsg:"EPSG:32654",def:"+proj=utm +zone=54 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 55N",epsg:"EPSG:32655",def:"+proj=utm +zone=55 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 56N",epsg:"EPSG:32656",def:"+proj=utm +zone=56 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 57N",epsg:"EPSG:32657",def:"+proj=utm +zone=57 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 58N",epsg:"EPSG:32658",def:"+proj=utm +zone=58 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 59N",epsg:"EPSG:32659",def:"+proj=utm +zone=59 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 60N",epsg:"EPSG:32660",def:"+proj=utm +zone=60 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 1S",epsg:"EPSG:32701",def:"+proj=utm +zone=1 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 2S",epsg:"EPSG:32702",def:"+proj=utm +zone=2 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 3S",epsg:"EPSG:32703",def:"+proj=utm +zone=3 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 4S",epsg:"EPSG:32704",def:"+proj=utm +zone=4 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 5S",epsg:"EPSG:32705",def:"+proj=utm +zone=5 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 6S",epsg:"EPSG:32706",def:"+proj=utm +zone=6 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 7S",epsg:"EPSG:32707",def:"+proj=utm +zone=7 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 8S",epsg:"EPSG:32708",def:"+proj=utm +zone=8 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 9S",epsg:"EPSG:32709",def:"+proj=utm +zone=9 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 10S",epsg:"EPSG:32710",def:"+proj=utm +zone=10 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 11S",epsg:"EPSG:32711",def:"+proj=utm +zone=11 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 12S",epsg:"EPSG:32712",def:"+proj=utm +zone=12 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 13S",epsg:"EPSG:32713",def:"+proj=utm +zone=13 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 14S",epsg:"EPSG:32714",def:"+proj=utm +zone=14 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 15S",epsg:"EPSG:32715",def:"+proj=utm +zone=15 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 16S",epsg:"EPSG:32716",def:"+proj=utm +zone=16 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 17S",epsg:"EPSG:32717",def:"+proj=utm +zone=17 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 18S",epsg:"EPSG:32718",def:"+proj=utm +zone=18 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 19S",epsg:"EPSG:32719",def:"+proj=utm +zone=19 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 20S",epsg:"EPSG:32720",def:"+proj=utm +zone=20 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 21S",epsg:"EPSG:32721",def:"+proj=utm +zone=21 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 22S",epsg:"EPSG:32722",def:"+proj=utm +zone=22 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 23S",epsg:"EPSG:32723",def:"+proj=utm +zone=23 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 24S",epsg:"EPSG:32724",def:"+proj=utm +zone=24 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 25S",epsg:"EPSG:32725",def:"+proj=utm +zone=25 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 26S",epsg:"EPSG:32726",def:"+proj=utm +zone=26 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 27S",epsg:"EPSG:32727",def:"+proj=utm +zone=27 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 28S",epsg:"EPSG:32728",def:"+proj=utm +zone=28 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 29S",epsg:"EPSG:32729",def:"+proj=utm +zone=29 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 30S",epsg:"EPSG:32730",def:"+proj=utm +zone=30 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 31S",epsg:"EPSG:32731",def:"+proj=utm +zone=31 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 32S",epsg:"EPSG:32732",def:"+proj=utm +zone=32 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 33S",epsg:"EPSG:32733",def:"+proj=utm +zone=33 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 34S",epsg:"EPSG:32734",def:"+proj=utm +zone=34 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 35S",epsg:"EPSG:32735",def:"+proj=utm +zone=35 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 36S",epsg:"EPSG:32736",def:"+proj=utm +zone=36 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 37S",epsg:"EPSG:32737",def:"+proj=utm +zone=37 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 38S",epsg:"EPSG:32738",def:"+proj=utm +zone=38 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 39S",epsg:"EPSG:32739",def:"+proj=utm +zone=39 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 40S",epsg:"EPSG:32740",def:"+proj=utm +zone=40 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 41S",epsg:"EPSG:32741",def:"+proj=utm +zone=41 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 42S",epsg:"EPSG:32742",def:"+proj=utm +zone=42 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 43S",epsg:"EPSG:32743",def:"+proj=utm +zone=43 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 44S",epsg:"EPSG:32744",def:"+proj=utm +zone=44 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 45S",epsg:"EPSG:32745",def:"+proj=utm +zone=45 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 46S",epsg:"EPSG:32746",def:"+proj=utm +zone=46 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 47S",epsg:"EPSG:32747",def:"+proj=utm +zone=47 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 48S",epsg:"EPSG:32748",def:"+proj=utm +zone=48 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 49S",epsg:"EPSG:32749",def:"+proj=utm +zone=49 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 50S",epsg:"EPSG:32750",def:"+proj=utm +zone=50 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 51S",epsg:"EPSG:32751",def:"+proj=utm +zone=51 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 52S",epsg:"EPSG:32752",def:"+proj=utm +zone=52 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 53S",epsg:"EPSG:32753",def:"+proj=utm +zone=53 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 54S",epsg:"EPSG:32754",def:"+proj=utm +zone=54 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 55S",epsg:"EPSG:32755",def:"+proj=utm +zone=55 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 56S",epsg:"EPSG:32756",def:"+proj=utm +zone=56 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 57S",epsg:"EPSG:32757",def:"+proj=utm +zone=57 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 58S",epsg:"EPSG:32758",def:"+proj=utm +zone=58 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 59S",epsg:"EPSG:32759",def:"+proj=utm +zone=59 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 60S",epsg:"EPSG:32760",def:"+proj=utm +zone=60 +south +datum=WGS84 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_13",epsg:"EPSG:4491",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_14",epsg:"EPSG:4492",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_15",epsg:"EPSG:4493",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_16",epsg:"EPSG:4494",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_17",epsg:"EPSG:4495",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_18",epsg:"EPSG:4496",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_19",epsg:"EPSG:4497",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_20",epsg:"EPSG:4498",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_21",epsg:"EPSG:4499",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_22",epsg:"EPSG:4500",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_23",epsg:"EPSG:4501",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_75E",epsg:"EPSG:4502",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_81E",epsg:"EPSG:4503",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_87E",epsg:"EPSG:4504",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_93E",epsg:"EPSG:4505",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_99E",epsg:"EPSG:4506",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_105E",epsg:"EPSG:4507",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_111E",epsg:"EPSG:4508",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_117E",epsg:"EPSG:4509",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_123E",epsg:"EPSG:4510",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_129E",epsg:"EPSG:4511",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_135E",epsg:"EPSG:4512",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_25",epsg:"EPSG:4513",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_26",epsg:"EPSG:4514",def:"+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_27",epsg:"EPSG:4515",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_28",epsg:"EPSG:4516",def:"+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_29",epsg:"EPSG:4517",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_30",epsg:"EPSG:4518",def:"+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_31",epsg:"EPSG:4519",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_32",epsg:"EPSG:4520",def:"+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_33",epsg:"EPSG:4521",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_34",epsg:"EPSG:4522",def:"+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_35",epsg:"EPSG:4523",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_36",epsg:"EPSG:4524",def:"+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_37",epsg:"EPSG:4525",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_38",epsg:"EPSG:4526",def:"+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_39",epsg:"EPSG:4527",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_40",epsg:"EPSG:4528",def:"+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_41",epsg:"EPSG:4529",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_42",epsg:"EPSG:4530",def:"+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_43",epsg:"EPSG:4531",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_44",epsg:"EPSG:4532",def:"+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_45",epsg:"EPSG:4533",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_75E",epsg:"EPSG:4534",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_78E",epsg:"EPSG:4535",def:"+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_81E",epsg:"EPSG:4536",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_84E",epsg:"EPSG:4537",def:"+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_87E",epsg:"EPSG:4538",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_90E",epsg:"EPSG:4539",def:"+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_93E",epsg:"EPSG:4540",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_96E",epsg:"EPSG:4541",def:"+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_99E",epsg:"EPSG:4542",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_102E",epsg:"EPSG:4543",def:"+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_105E",epsg:"EPSG:4544",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_108E",epsg:"EPSG:4545",def:"+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_111E",epsg:"EPSG:4546",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_114E",epsg:"EPSG:4547",def:"+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_117E",epsg:"EPSG:4548",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_120E",epsg:"EPSG:4549",def:"+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_123E",epsg:"EPSG:4550",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_126E",epsg:"EPSG:4551",def:"+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_129E",epsg:"EPSG:4552",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_132E",epsg:"EPSG:4553",def:"+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_135E",epsg:"EPSG:4554",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"}],R=function(){return x()((function e(){k()(this,e),this.name_map=new Map,this.epsg_map=new Map,this.initProj()}),[{key:"initProj",value:function(){var e=this;j.forEach((function(t){proj4.defs(t.epsg,t.def),e.name_map.set(t.name,t),e.epsg_map.set(t.epsg,t)}))}},{key:"convert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n={points:[],code:0,message:""};if(!this.name_map.has(t)&&!this.epsg_map.has(t))return n.code=1,n.message="不支持的坐标系:"+t,n;if(!this.name_map.has(i)&&!this.epsg_map.has(i))return n.code=1,n.message="不支持的坐标系:"+i,n;var o=(this.name_map.get(t)||this.epsg_map.get(t)).epsg,s=(this.name_map.get(i)||this.epsg_map.get(i)).epsg,a=proj4.defs(o),r=proj4.defs(s);return e.forEach((function(e){var t=Number(e.x),i=Number(e.y),o=Number(e.z||0),s=proj4(a,r,[t,i]);n.points.push({x:Number(s[0].toFixed(10)),y:Number(s[1].toFixed(10)),z:o})})),n}},{key:"getAllProjection",value:function(){return Array.from(this.name_map.values())}},{key:"projectionIsExists",value:function(e){return this.name_map.has(e)||this.epsg_map.has(e)}},{key:"degreesToDMS",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function i(e){var t=e.toString(),i=t.indexOf(".");return-1!==i?t.length-i-1:0}function n(e){return Math.pow(10,e)}var o=Math.floor(e),s=n(i(e)),a=Math.floor((e-o)*s*60)/s,r=Math.floor(a),l=n(i(a)),c=Math.floor((a-r)*l)/l*60;return t?o+"°"+Number(a.toFixed(4))+"'":o+"°"+r+"'"+c.toFixed(2)+'"'}},{key:"dmsToDecimal",value:function(e,t){var i,n,o;if(t){var s=e.split("°"),a=s[1].split("'");i=s[0],n=a[0],console.log(i,n);var r=Math.pow(10,8),l=Number(i*r)+n*r/60;return Math.round(l)/r}var c=e.split("°"),u=c[1].split("'"),h=u[1].split('"');i=c[0],n=u[0],o=h[0],console.log(i,n,o);var p=Math.pow(10,8),d=Number(i*p)+n*p/60+o*p/3600;return Math.round(d)/p}}])}();function F(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 z(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?F(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):F(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var H,V,G,W,U=function(){return x()((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];k()(this,e),this.container=t,this.options=z({},i),this.options.ismove=!0,!1===i.ismove&&(this.options.ismove=i.ismove),this.closeCallBack=i.closeCallBack,this._element={},this._element_style=void 0,this.only=n}),[{key:"init",value:(e=o()(a.a.mark((function e(){var t,i,n,o=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.only&&this.closeAll(),Y.push(this),this.isDestroy=!1,this._element.body=document.createElement("div"),this._element.body.className="YJ-custom-base-dialog",this._element.body.style.top=this.options.top,this._element.body.style.bottom=this.options.bottom,this._element.body.style.left=this.options.left,this._element.body.style.right=this.options.right,this.container.appendChild(this._element.body),this._element.title=document.createElement("div"),this._element.title.className="title-box",this._element.title.innerHTML='<span class="title">'.concat(this.options.title||"","</span>")+'<span class="close-box"><span class="close"></span><i>✕</i></span>',this._element.body.appendChild(this._element.title),e.next=16,document.createElement("div");case 16:return this._element.content=e.sent,this._element.content.className="content",this._element.body.appendChild(this._element.content),e.next=21,document.createElement("div");case 21:return this._element.foot=e.sent,this._element.foot.className="foot",this._element.foot.innerHTML='\n <button class="close">关闭</button>\n ',this._element.body.appendChild(this._element.foot),e.next=27,document.createElement("div");case 27:for((t=e.sent).style.position="absolute",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t.style.backdropFilter="blur(2px)",t.style.zIndex="-999999",this._element.body.appendChild(t),this._element.body.getElementsByClassName("close-box")[0].addEventListener("click",(function(){o.close()})),i=this._element.body.getElementsByClassName("close"),n=0;n<i.length;n++)i[n].addEventListener("click",(function(){o.close()}));this.options.ismove&&this.moveDiv();case 41:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"close",value:function(){for(var e=document.getElementsByTagName("style"),t=e.length-1;t>=0;t--)e[t].dataset&&"YJ_style_dialog"===e[t].dataset.name&&document.getElementsByTagName("head")[0].removeChild(e[t]);this._element.body&&this._element.body.parentNode&&this.container.removeChild(this._element.body),this._element.body=null,this._element.title=null,this._element.content=null,this._element.foot=null,this._element_style=null,this.isDestroy=!0,this.closeCallBack&&(this.closeCallBack(),this.closeCallBack=null)}},{key:"closeAll",value:function(){for(var e=Y.length-1;e>=0;e--)Y[e].close(),Y.splice(e,1)}},{key:"titleAppChild",value:function(e){this._element.title.appendChild(e)}},{key:"contentAppChild",value:function(e){this._element.content.appendChild(e)}},{key:"footAppChild",value:function(e,t){t?this._element.foot.insertBefore(e,t):this._element.foot.prepend(e)}},{key:"moveDiv",value:function(){var e=this,t=0,i=0,n=0,o=0,s=this._element.body,a=this;s.onmousedown=function(s){if("title-box"===s.toElement.className){var r=e._element.body.offsetHeight,l=e._element.body.offsetWidth;t=s.clientX,i=s.clientY;var c=window.getComputedStyle(e._element.body).left,u=window.getComputedStyle(e._element.body).top;n=1*c.substr(0,c.indexOf("px")),o=1*u.substr(0,u.indexOf("px"));var h=document.documentElement.clientHeight,p=document.documentElement.clientWidth;window.onmousemove=function(e){e.preventDefault();var s=e.clientX,c=e.clientY,u=s-(t-n),d=c-(i-o);u<0?u=0:u+l>p&&(u=p-l),d<=0?d=0:d+r>h&&(d=h-r),a._element.body.style.left=u+"px",a._element.body.style.top=d+"px",a._element.body.style.bottom="unset",a._element.body.style.right="unset"},document.onmouseup=function(e){window.onmousemove=null},window.ondragend=function(e){window.onmousemove=null}}},document.onmouseup=function(e){window.onmousemove=null},window.ondragend=function(e){window.onmousemove=null}}}]);var e}(),Y=[],J=U,q=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=null;return{that:Array.prototype.slice.call(e.querySelectorAll(t),0),stopPropagation:function(e){(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!0},hide:function(){q(e,t).that.forEach((function(e){e.style.cssText+="display:none;"}))},show:function(i){void 0!==i?q(e,t).that[i].style.cssText+="display:block;":q(e,t).that.forEach((function(e){e.style.cssText+="display:block;"}))},legp_searchList:function(t){var i=[];return q(e,"input[name="+t+"]").that.forEach((function(e){i.push(e.value)})),i},legp_search:function(o){var s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=q(e,t).that[i];if(a){var r='<div class="cy_datalist"><i class="yj-custom-icon-arrow-down"></i>\n '.concat(s?'<input type="text" placeholder="输入或选择" autocomplete="off">':'<input type="text" class="datalist '.concat(i,'" readonly="readonly" placeholder="请选择" autocomplete="off">'),'\n <dl style="display: none;position: absolute;background: rgba(0, 0, 0, 0.5);color: rgba(var(--color-sdk-base-rgb), 1);border: 1px solid rgba(var(--color-sdk-base-rgb), 0.2);border-radius: 3px;margin: 2px 0px;max-height: 300px;overflow-x: hidden;white-space: nowrap; font-size: 12px;z-index: 8;">\n </dl>\n </div>');a.innerHTML=r,q(e,".cy_datalist input").that[i].oninput=function(t){var s=this.value;if(q(e,".cy_datalist dl").hide(),o.length>0){q(e,".cy_datalist dl").show();var a=new RegExp(s),r=!1;q(e,".cy_datalist dl").that[i].innerHTML="",o.forEach((function(t){a.test(t.name)&&(r=!0,q(e,".cy_datalist dl").that[i].innerHTML+='<dd class="'+(n===t.value?"active":"")+'" style="margin: 0; padding: 5px 5px; color: #fff;cursor: pointer;" value="'+t.value+'">'+t.name+"</dd>")})),r||(q(e,".cy_datalist dl").that[i].innerHTML='<dd style="padding: 10px 20px; color: #fff;">暂无数据</dd>'),l()}},q(e,".cy_datalist input").that[i].onclick=function(t){q(e,".cy_datalist dl").hide();var i=1*t.srcElement.classList[1];i=i||0,"none"===q(e,".cy_datalist dl").that[i].style.display&&(0==o.length?this.innerHTML="暂无数据":q(e,".cy_datalist dl").show(i),q(e,".cy_datalist dl").that[i].innerHTML="",o.forEach((function(t){q(e,".cy_datalist dl").that[i].innerHTML+='<dd class="'+(n===t.value?"active":"")+'" style="margin: 0; padding: 5px 5px; color: #fff;cursor: pointer;" value="'+t.value+'">'+t.name+"</dd>"})),l()),t.stopPropagation()},document.addEventListener("click",(function(){q(e,".cy_datalist dl").hide()}))}function l(){q(e,".cy_datalist dl dd").that.forEach((function(e){e.onclick=function(e){if(this&&this.attributes){var t=this.attributes.value.value;n=t,e.currentTarget.parentNode.previousElementSibling.value=t;var i=new Event("input",{bubbles:!0});e.currentTarget.parentNode.previousElementSibling.dispatchEvent(i)}}}))}},legp_searchActive:function(e){n=e}}},X=function(){var e=o()(a.a.mark((function e(t,i){var n,o,s,r,l,c,u,h,p,d,m;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new R,o=new vi(t),s=document.getElementsByClassName("proj-convert")[0].getElementsByClassName("content")[0],r=s.getElementsByClassName("item"),l=a.a.mark((function e(t){var i,l,c,u;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=r[t].getAttribute("data-type"),l=r[t].getElementsByClassName("convert")[0],c=r[t].getElementsByClassName("icon-copy-box")[0],(u=new ClipboardJS(c,{text:function(e){var n;switch(i){case 0:case"0":n=r[t].getElementsByClassName("lng")[0].value+"°,"+r[t].getElementsByClassName("lat")[0].value+"°";break;case 1:case"1":n=s.getElementsByClassName("lng-dm-d")[0].value+"°"+s.getElementsByClassName("lng-dm-m")[0].value+"',"+s.getElementsByClassName("lat-dm-d")[0].value+"°"+s.getElementsByClassName("lat-dm-m")[0].value+"'";break;case 2:case"2":n=s.getElementsByClassName("lng-dms-d")[0].value+"°"+s.getElementsByClassName("lng-dms-m")[0].value+"'"+s.getElementsByClassName("lng-dms-s")[0].value+'",'+s.getElementsByClassName("lat-dms-d")[0].value+"°"+s.getElementsByClassName("lat-dms-m")[0].value+"'"+s.getElementsByClassName("lat-dms-s")[0].value+'"'}return n}})).on("success",(function(e){o.message({text:"已复制到剪切板"})})),u.on("error",(function(e){o.message({type:"warning",text:"复制失败"})})),l.addEventListener("click",(function(){var e,a,l,c,u,h,p,d,m,f,v,g,y,b,C,w,k,_,x,E;switch(i){case 0:case"0":e=r[t].getElementsByClassName("lng")[0].value,a=r[t].getElementsByClassName("lat")[0].value,p=n.degreesToDMS(e,!0),d=n.degreesToDMS(a,!0),g=(v=p.split("°"))[1].split("'"),b=(y=d.split("°"))[1].split("'"),s.getElementsByClassName("lng-dm-d")[0].value=v[0],s.getElementsByClassName("lng-dm-m")[0].value=g[0],s.getElementsByClassName("lat-dm-d")[0].value=y[0],s.getElementsByClassName("lat-dm-m")[0].value=b[0],m=n.degreesToDMS(e),f=n.degreesToDMS(a),k=(w=(C=m.split("°"))[1].split("'"))[1].split('"'),E=(x=(_=f.split("°"))[1].split("'"))[1].split('"'),s.getElementsByClassName("lng-dms-d")[0].value=C[0],s.getElementsByClassName("lng-dms-m")[0].value=w[0],s.getElementsByClassName("lng-dms-s")[0].value=k[0],s.getElementsByClassName("lat-dms-d")[0].value=_[0],s.getElementsByClassName("lat-dms-m")[0].value=x[0],s.getElementsByClassName("lat-dms-s")[0].value=E[0];break;case 1:case"1":l=r[t].getElementsByClassName("lng-dm-d")[0].value,c=r[t].getElementsByClassName("lng-dm-m")[0].value,u=r[t].getElementsByClassName("lat-dm-d")[0].value,h=r[t].getElementsByClassName("lat-dm-m")[0].value,e=n.dmsToDecimal(l+"°"+c+"'",!0),a=n.dmsToDecimal(u+"°"+h+"'",!0),s.getElementsByClassName("lng")[0].value=e,s.getElementsByClassName("lat")[0].value=a,m=n.degreesToDMS(e),f=n.degreesToDMS(a),k=(w=(C=m.split("°"))[1].split("'"))[1].split('"'),E=(x=(_=f.split("°"))[1].split("'"))[1].split('"'),s.getElementsByClassName("lng-dms-d")[0].value=C[0],s.getElementsByClassName("lng-dms-m")[0].value=w[0],s.getElementsByClassName("lng-dms-s")[0].value=k[0],s.getElementsByClassName("lat-dms-d")[0].value=_[0],s.getElementsByClassName("lat-dms-m")[0].value=x[0],s.getElementsByClassName("lat-dms-s")[0].value=E[0];break;case 2:case"2":m=(l=r[t].getElementsByClassName("lng-dms-d")[0].value)+"°"+(c=r[t].getElementsByClassName("lng-dms-m")[0].value)+"'"+r[t].getElementsByClassName("lng-dms-s")[0].value+'"',f=(u=r[t].getElementsByClassName("lat-dms-d")[0].value)+"°"+(h=r[t].getElementsByClassName("lat-dms-m")[0].value)+"'"+r[t].getElementsByClassName("lat-dms-s")[0].value+'"',e=n.dmsToDecimal(m),a=n.dmsToDecimal(f),s.getElementsByClassName("lng")[0].value=e,s.getElementsByClassName("lat")[0].value=a,p=n.degreesToDMS(e,!0),d=n.degreesToDMS(a,!0),g=(v=p.split("°"))[1].split("'"),b=(y=d.split("°"))[1].split("'"),s.getElementsByClassName("lng-dm-d")[0].value=v[0],s.getElementsByClassName("lng-dm-m")[0].value=g[0],s.getElementsByClassName("lat-dm-d")[0].value=y[0],s.getElementsByClassName("lat-dm-m")[0].value=b[0]}o.message({text:"转换成功"});for(var S=0;S<r.length;S++)r[S].style.display="block"})),0==t?(r[t].style.order=0,r[t].style.display="block",l.style.display="inline-block"):(r[t].style.order=1,r[t].style.display="none",l.style.display="none");case 8:case"end":return e.stop()}}),e)})),c=0;case 6:if(!(c<r.length)){e.next=11;break}return e.delegateYield(l(c),"t0",8);case 8:c++,e.next=6;break;case 11:for(u=s.getElementsByTagName("input"),h=0;h<u.length;h++)u[h].addEventListener("blur",(function(e){e.target.value||(e.target.value=0);var t=Number(e.target.value);e.target.max&&t>Number(e.target.max)&&(t=Number(e.target.max)),e.target.min&&t<Number(e.target.min)&&(t=Number(e.target.min)),e.target.value=t}));p=[{name:"度",value:"度",key:0},{name:"度分",value:"度分",key:1},{name:"度分秒",value:"度分秒",key:2}],(d=q(s.getElementsByClassName("input-select-box")[0],".input-select"))&&(d.legp_search(p),(m=s.getElementsByClassName("input-select")[0].getElementsByTagName("input")[0]).value=p[0].value,m.addEventListener("input",(function(){for(var e=0;e<p.length;e++)if(p[e].value===m.value){for(var t=0;t<r.length;t++){var i=r[t].getElementsByClassName("convert")[0];t==p[e].key?(r[t].style.order=0,r[t].style.display="block",i.style.display="inline-block"):(r[t].style.order=0===t?2:1,r[t].style.display="none",i.style.display="none")}break}})));case 16:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}(),Z=function(){H&&H.close&&(H.close(),H=null)},K=function(){return x()((function e(t){k()(this,e),this.sdk=t,this.viewer=t.viewer,this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.canvas)}),[{key:"mouse_left",value:function(e){var t=this;this.handler&&this.handler.setInputAction((function(i){var n=t.getcartesian(i);n&&e(i,n)}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}},{key:"mouse_left_down",value:function(e){var t=this;this.handler&&this.handler.setInputAction((function(i){var n=t.getcartesian(i);n&&e(i,n)}),Cesium.ScreenSpaceEventType.LEFT_DOWN)}},{key:"mouse_left_up",value:function(e){var t=this;this.handler&&this.handler.setInputAction((function(i){var n=t.getcartesian(i);n&&e(i,n)}),Cesium.ScreenSpaceEventType.LEFT_UP)}},{key:"mouse_move",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=t.getcartesian(n);(o||i)&&e(n,o)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}},{key:"mouse_right",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=t.getcartesian(n);(o||i)&&e(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)}},{key:"mouse_right_down",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=t.getcartesian(n);(o||i)&&e(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_DOWN)}},{key:"mouse_right_up",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=t.getcartesian(n);(o||i)&&e(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_UP)}},{key:"mouse_wheel",value:function(e){this.handler&&this.handler.setInputAction((function(){e()}),Cesium.ScreenSpaceEventType.WHEEL)}},{key:"getcartesian",value:function(e){var t=e.position||e.endPosition;e.position1&&e.position2&&(t={x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2});var i=this.viewer.scene.pickPosition(t);if(!i){for(var n=this.viewer.camera.getPickRay(t),o=this.viewer.scene.drillPickFromRay(n,10),s={},a=0;a<o.length;a++)if(o[a].position){s=o[a];break}(i=s.position)||(i=this.viewer.scene.globe.pick(n,this.viewer.scene))}return i}},{key:"mouse_right_keyboard_ctrl",value:function(e){var t=this;this.handler&&this.handler.setInputAction((function(i){var n=t.getcartesian(i);n&&e(i,n)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK,Cesium.KeyboardEventModifier.CTRL)}},{key:"gesture_pinck_start",value:function(e){var t=this;this.handler&&this.handler.setInputAction((function(i){var n=t.getcartesian(i);n&&e(i,n)}),Cesium.ScreenSpaceEventType.PINCH_START)}},{key:"gesture_pinck_start_keyboard_ctrl",value:function(e){var t=this;this.handler&&this.handler.setInputAction((function(i){var n=t.getcartesian(i);n&&e(i,n)}),Cesium.ScreenSpaceEventType.PINCH_START,Cesium.KeyboardEventModifier.CTRL)}},{key:"gesture_pinck_end",value:function(e){this.handler&&this.handler.setInputAction((function(t){e()}),Cesium.ScreenSpaceEventType.PINCH_END)}},{key:"gesture_pinck_move",value:function(e){this.handler&&this.handler.setInputAction((function(e){}),Cesium.ScreenSpaceEventType.PINCH_MOVE)}},{key:"destroy",value:function(){this.handler&&this.handler.destroy(),this.handler=null}}])}(),Q=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"左键开始,右键结束",i=arguments.length>1?arguments[1]:void 0;k()(this,e),this.point=void 0,this.text=t,this.div=void 0,this.mouse_type=0,this.position=new Cesium.Cartesian3,this.viewer=i.viewer,this.create_tip(this.viewer)}),[{key:"set_text",value:function(e){this.div.getElementsByTagName("p")[0].innerText=e}},{key:"get_mouse_style",value:function(e){var t="";switch(e){case 1:t="move.png";break;default:t="arrow.png"}return"url(lib/img/"+t+"),auto"}},{key:"create_tip",value:function(e){this.create_tooltip()}},{key:"setPosition",value:function(e,t,i){this.position=e,this.move_tooltip(t,i)}},{key:"destroy",value:function(){this.viewer.entities.remove(this.point),this.remove_tooltip()}},{key:"create_tooltip",value:function(){var e=new vi;this.div=document.createElement("div");this.div.setAttribute("style","position: absolute;z-index: 777;color: #ec131a;left:10px;top:0px;pointer-events: none;");var t=document.createElement("p");t.style.margin="0px",t.style.padding="0px",t.innerText=this.text,this.div.appendChild(t);var i=document.createElement("div");i.style.width="12px",i.style.height="12px",i.style.background="url(".concat(e.getSourceRootPath()+"/img/point.png",") 100% 100% no-repeat"),i.style.backgroundSize="100% 100%",i.style.position="absolute",i.style.left="-36px",i.style.top="-4px",this.div.style.display="none",this.div.appendChild(i),e=null,document.querySelector("body").appendChild(this.div)}},{key:"style_tip",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e._element.style.cursor=this.get_mouse_style(t)}},{key:"remove_tooltip",value:function(){document.querySelector("body").contains(this.div)&&document.querySelector("body").removeChild(this.div)}},{key:"move_tooltip",value:function(e,t){var i=0,n=0;if(this.div.style.display="block",this.viewer&&this.viewer._element){var o=this.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0];i=o.getBoundingClientRect().top+window.scrollY,n=o.getBoundingClientRect().left+window.scrollX}this.div.style.left=e+30+n+"px",this.div.style.top=t+i+"px"}}])}(),$=function(){var e=o()(a.a.mark((function e(t,i){var n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w,k;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new vi,o=new R,s=document.getElementsByClassName("projection-convert")[0].getElementsByClassName("content")[0],r=[],l=0,o.epsg_map.forEach((function(e,t){l++,r.push({name:"".concat(l,". ").concat(t,"(").concat(e.name,")"),value:t})})),(c=q(s.getElementsByClassName("left")[0],".datalist_left")).legp_search(r,!0),(u=q(s.getElementsByClassName("right")[0],".datalist_right")).legp_search(r,!0),h=s.getElementsByClassName("pick")[0],p=s.getElementsByClassName("copy")[0],d=s.getElementsByClassName("sourceCopy")[0],(m=s.getElementsByClassName("datalist_left")[0].getElementsByTagName("input")[0]).value=r[0].value,c.legp_searchActive(r[0].value),(f=s.getElementsByClassName("datalist_right")[0].getElementsByTagName("input")[0]).value=r[0].value,u.legp_searchActive(r[0].value),v=s.getElementsByClassName("convert")[0],g=s.getElementsByClassName("left-x")[0],y=s.getElementsByClassName("left-y")[0],b=s.getElementsByClassName("right-x")[0],C=s.getElementsByClassName("right-y")[0],w="EPSG:4326",k="EPSG:4326",m.addEventListener("input",(function(e){var t=e.target.value;if(g.value&&y.value){var i=o.convert([{x:Number(g.value),y:Number(y.value)}],w,t);0===i.code&&(g.value=i.points[0].x,y.value=i.points[0].y)}w=t,c.legp_searchActive(t)})),f.addEventListener("input",(function(e){var t=e.target.value;if(b.value&&C.value){var i=o.convert([{x:Number(b.value),y:Number(C.value)}],k,t);0===i.code&&(b.value=i.points[0].x,C.value=i.points[0].y)}k=f.value,u.legp_searchActive(t)})),h.addEventListener("click",(function(){G&&G.destroy(),W&&W.destroy(),G=new Q("左键选择起点坐标,右键取消",t),(W=new K(t)).mouse_move((function(e,t){G.setPosition(t,e.endPosition.x,e.endPosition.y)})),W.mouse_left((function(e,i){var s=n.cartesian3Towgs84(i,t.viewer);G&&G.destroy(),W&&W.destroy();var a=o.convert([{x:Number(s.lng),y:Number(s.lat)}],"EPSG:4326",m.value);0===a.code&&(g.value=a.points[0].x,y.value=a.points[0].y)})),W.mouse_right((function(e,t){G&&G.destroy(),W&&W.destroy()}))})),v.addEventListener("click",(function(){if(!g.value||!y.value)return b.value="",C.value="",void n.message({type:"warning",text:"请输入源坐标"});var e=o.convert([{x:Number(g.value),y:Number(y.value)}],m.value,f.value);0===e.code?(b.value=e.points[0].x,C.value=e.points[0].y):n.message({type:"warning",text:e.message})})),new ClipboardJS(p,{text:function(e){if(b.value&&C.value){var t="".concat(b.value,",").concat(C.value);return t}b.value="",C.value="",n.message({type:"warning",text:"复制失败,目标坐标为空!"})}}).on("success",(function(e){n.message({text:"已复制到剪切板"})})),new ClipboardJS(d,{text:function(e){if(g.value&&y.value){var t="".concat(g.value,",").concat(y.value);return t}g.value="",y.value="",n.message({type:"warning",text:"复制失败,目标坐标为空!"})}}).on("success",(function(e){n.message({text:"已复制到剪切板"})}));case 34:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}(),ee=function(){V&&V.close&&(V.close(),V=null),G&&G.destroy(),W&&W.destroy()},te=[new Map,new Map,new Map];te[0].set("--color-sdk-base-rgb","0, 255, 255"),te[0].set("--color-sdk-gradual","rgb(0, 255, 255) 6.25%, rgb(0, 200, 255) 100%"),te[0].set("--color-sdk-bg-gradual","#00ffff33 0%, #00ffff00 100%"),te[0].set("--color-sdk-text-shadow","rgba(20, 118, 255, 1)"),te[1].set("--color-sdk-base-rgb","42, 200, 251"),te[1].set("--color-sdk-gradual","rgb(42, 200, 251) 6.25%, rgb(42, 145, 251) 100%"),te[1].set("--color-sdk-bg-gradual","#2ac8fb33 0%, #2ac8fb00 100%"),te[1].set("--color-sdk-text-shadow","rgba(20, 63, 255, 1)"),te[2].set("--color-sdk-base-rgb","187, 26, 41"),te[2].set("--color-sdk-gradual","rgb(187, 26, 41) 6.25%, rgb(236, 20, 20) 100%"),te[2].set("--color-sdk-bg-gradual","#bb1a2933 0%, #bb1a2900 100%"),te[2].set("--color-sdk-text-shadow","rgba(246, 8, 30, 1)");var ie={};function ne(e,t,i){if(e&&e.div_id){var n=rt().sdkD,o=document.getElementById(e.div_id).getElementsByClassName("cesium-viewer")[0],s=new vi;ie[e.div_id]||(ie[e.div_id]={}),ie[e.div_id].mousedown&&document.removeEventListener("mousedown",ie[e.div_id].mousedown),ie[e.div_id].click&&document.removeEventListener("click",ie[e.div_id].click),ie[e.div_id].callBack||(ie[e.div_id].callBack=i),e!==n&&ie[e.div_id].mouseRightMenuEvent&&ie[e.div_id].mouseRightMenuEvent.destroy();var a=document.getElementById("custom-menu");a&&o.removeChild(a),ie[e.div_id].status=t,t&&(ie[e.div_id].mousedown=function(e){if(!(e.target.parentNode&&"custom-menu"==e.target.parentNode.id||e.target.parentNode&&e.target.parentNode.parentNode&&"custom-menu"==e.target.parentNode.parentNode.id)){var t=document.getElementById("custom-menu");t&&o.removeChild(t)}},document.addEventListener("mousedown",ie[e.div_id].mousedown),ie[e.div_id].click=function(e){if(!(e.target.parentNode&&"custom-menu"==e.target.parentNode.id||e.target.parentNode&&e.target.parentNode.parentNode&&"custom-menu"==e.target.parentNode.parentNode.id)){var t=document.getElementById("custom-menu");t&&o.removeChild(t)}},document.addEventListener("click",ie[e.div_id].click),ie[e.div_id].mouseRightMenuEvent=new K(e),ie[e.div_id].mouseRightMenuEvent.mouse_right((function(t,i){if(!YJ.Measure.GetMeasureStatus()&&!e.viewer.trackedEntity){var n=e.viewer.entities.getById("svg-control-points_0");if(!n||!n.show){var a=document.getElementById("custom-menu");a&&o.removeChild(a);var r,l=function(t){var i=e.viewer.scene.pick(t.position);if(i)if(i.id){if(i.id.type&&"vector"===i.id.type&&i.id.parentId)return{parentId:i.id.parentId,id:i.id.id};if(i.id.id)return i.id.id;if("string"==typeof i.id)return i.id}else if(i.primitive&&i.primitive.id)return i.primitive.id}(t);"[object Object]"===Object.prototype.toString.call(l)&&(r=l.id,l=l.parentId);var c="",u=e.entityMap.get(l);if(!u&&l){var h=l.split("-");h.splice(h.length-1,1),l=h.join("-"),u=e.entityMap.get(l)}u&&u.picking&&(c='\n <span class="divider" style="display: block;border-top: 1px solid #ddd;margin: 5px;"></span>\n <ul class="added" style="list-style: none;padding: 0;margin: 0;font-size: 12px;">\n <li style="padding: 3px 10px;cursor: pointer;">属性</li>\n </ul>\n ');var p=s.cartesian3Towgs84(i,e.viewer);(a=document.createElement("div")).id="custom-menu",a.style.position="absolute",a.style.width="110px",a.style.backgroundColor="#00000085",a.style.color="#ffffff",a.style.padding="6px 0",a.style.boxShadow="4px 4px 4px 0px rgba(0, 0, 0, 0.8)",a.innerHTML='\n <ul class="base" style="list-style: none;padding: 0;margin: 0;font-size: 12px;">\n <li style="padding: 3px 10px;cursor: pointer;">绕鼠标点旋转</li>\n </ul>\n <ul class="base" style="list-style: none;padding: 0;margin: 0;font-size: 12px;">\n <li style="padding: 3px 10px;cursor: pointer;">文本框</li>\n </ul>\n '.concat(c,"\n "),o.appendChild(a);var d=t.position.x,m=t.position.y;t.position.x+a.offsetWidth>o.offsetWidth&&(d=t.position.x-a.offsetWidth),t.position.y+a.offsetHeight>o.offsetHeight&&(m=t.position.y-a.offsetHeight),a.style.left=d+"px",a.style.top=m+"px",a.addEventListener("contextmenu",(function(e){e.preventDefault()}));for(var f=a.getElementsByTagName("li"),v={},g=function(t){f[t].addEventListener("mouseover",(function(){f[t].style.backgroundColor="#5e5e5e"})),f[t].addEventListener("mouseout",(function(){f[t].style.backgroundColor="unset"})),f[t].addEventListener("click",(function(){var i="";switch(f[t].innerHTML){case"绕鼠标点旋转":v.position=p,i="rotateAround";break;case"属性":r?(v.id=r,v.parentId=u.options.id):v.id=u.options.id,i="attribute";break;case"文本框":v.position=p,i="textBox"}ie[e.div_id].callBack(i,v),o.removeChild(a)}))},y=0;y<f.length;y++)g(y)}}})))}}function oe(e){return e&&e.div_id&&ie[e.div_id]?ie[e.div_id].status:void 0}var se=null,ae=null,re=null,le=new Map,ce=new Map,ue=new Map;function he(e,t){var i=t.scene.globe.ellipsoid,n=new Cesium.Cartesian3(e.x,e.y,e.z),o=i.cartesianToCartographic(n),s=Cesium.Math.toDegrees(o.latitude);return{lng:Cesium.Math.toDegrees(o.longitude),lat:s,alt:o.height<0?0:o.height}}function pe(e,t){t.endPosition&&(t.endPosition.y-=2);var i=t.position||t.endPosition,n=e.viewer.scene.pickPosition(i);if(!n){var o=e.viewer.camera.getPickRay(i);n=e.viewer.scene.globe.pick(o,e.viewer.scene)}return n}function de(e,t){if(e&&e.viewer){var i=!0;(se=new Cesium.ScreenSpaceEventHandler(e.viewer.canvas)).setInputAction((function(n){var o=e.viewer.scene.pickPosition(n.position);if(!o){var s=e.viewer.camera.getPickRay(n.position);o=e.viewer.scene.globe.pick(s,e.viewer.scene)}if(o){var a=he(o,e.viewer);if(t&&t(a),i&&(i=!1,setTimeout((function(){i=!0}),600),!YJ.Measure.GetMeasureStatus()&&o)){for(var r=!1,l=le.size-1;l>=0;l--){var c=Array.from(le.keys())[l],u=le.get(c);if(u&&u.that)if("PolygonObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var h=turf.point([a.lng,a.lat]),p=[],d=0;d<u.that.options.positions.length;d++)p.push([u.that.options.positions[d].lng,u.that.options.positions[d].lat]);p.push([u.that.options.positions[0].lng,u.that.options.positions[0].lat]);var m=turf.polygon([p]);if(turf.booleanPointInPolygon(h,m)){u.callback(n,u.that.options.id,he(pe(e,n),e.viewer),u.that),r=!0;break}}}else if("AssembleObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var f=u.that.computeAssemble(u.that.options.positions,!0),v=turf.point([a.lng,a.lat]),g=[],y=0;y<f.length;y+=2)g.push([f[y],f[y+1]]);var b=turf.polygon([g]);if(turf.booleanPointInPolygon(v,b)){u.callback(n,u.that.options.id,he(pe(e,n),e.viewer),u.that),r=!0;break}}}else if("AttackArrowObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var C=turf.point([a.lng,a.lat]),w=u.that.computeAttackArrow(u.that.options.positions),k=[],_=0;_<w.length;_++){var x=he(w[_],e.viewer);k.push([x.lng,x.lat])}var E=turf.polygon([k]);if(turf.booleanPointInPolygon(C,E)){u.callback(n,u.that.options.id,he(pe(e,n),e.viewer),u.that),r=!0;break}}}else if("PincerArrowObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=5){for(var S=turf.point([a.lng,a.lat]),P=u.that.computePincerArrow(u.that.options.positions),D=[],M=0;M<P.length;M++){var T=he(P[M],e.viewer);D.push([T.lng,T.lat])}var O=he(P[0],e.viewer);D.push([O.lng,O.lat]);var N=turf.polygon([D]);if(turf.booleanPointInPolygon(S,N)){u.callback(n,u.that.options.id,he(pe(e,n),e.viewer),u.that),r=!0;break}}}else if("CircleObject"===u.that.type){if(u.that.picking){var B=turf.point([a.lng,a.lat]);if(u.that.options.center&&u.that.options.radius){var A=[u.that.options.center.lng,u.that.options.center.lat],L=u.that.options.radius/1e3,I=turf.circle(A,L,{steps:360,units:"kilometers"});if(turf.booleanPointInPolygon(B,I)){u.callback(n,u.that.options.id,he(pe(e,n),e.viewer),u.that),r=!0;break}}}}else if("SectorObject"===u.that.type&&u.that.picking){var j=turf.point([a.lng,a.lat]);if(u.that.options.center&&u.that.options.radius&&u.that.options.startAngle&&u.that.options.endAngle){for(var R=u.that.calSector(u.that.options.center,u.that.options.radius,u.that.options.startAngle,u.that.options.endAngle,void 0,!0),F=[],z=0;z<R.length;z++)F.push([R[z].lng,R[z].lat]);var H=turf.polygon([F]);if(turf.booleanPointInPolygon(j,H)){u.callback(n,u.that.options.id,he(pe(e,n),e.viewer),u.that),r=!0;break}}}}if(!r){var V=e.viewer.scene.pick(n.position);if(V){if(V.id){var G;if(V.id.type&&"vector"===V.id.type&&V.id.parentId){var W=le.get(V.id.parentId);if(W.that.picking&&W.that.geojson)for(var U=0;U<W.that.geojson.features.length;U++)W.that.geojson.features[U].id===V.id._id&&W.callback(n,W.that.geojson.features[U].id,he(pe(e,n),e.viewer),W.that)}else if("string"==typeof V.id.id){var Y=V.id.id.split("-");Y.splice(Y.length-1,1),G=Y.join("-")}if(V.id.properties&&V.id.properties.id&&le.has(V.id.properties.id._value)){var J=le.get(V.id.properties.id._value);J.that.picking&&J.callback(n,V.id.properties.id._value,he(pe(e,n),e.viewer),J.that)}else if(le.has(V.id.id)){var q=le.get(V.id.id);q.that.picking&&q.callback(n,V.id.id,he(pe(e,n),e.viewer),q.that)}else if(G&&le.has(G)){var X=le.get(G);X.that.picking&&X.callback(n,G,he(pe(e,n),e.viewer),X.that)}else if(V.primitive&&"string"==typeof V.id&&le.has(V.id)){var Z=le.get(V.id);Z.callback(n,V.id,he(pe(e,n),e.viewer),Z.that)}}else if(V.primitive&&V.primitive.id&&le.has(V.primitive.id)){var K=le.get(V.primitive.id);K.that.picking&&("bim"===K.that.type?YJ.Global.getBimPickStatus(e)&&K.callback(n,V.primitive,he(pe(e,n),e.viewer),K.that):K.callback(n,V.primitive.id,he(pe(e,n),e.viewer),K.that))}if(V.content&&(!V.primitive||!V.primitive.id)&&le.has(V.content.tileset.id)){var Q=le.get(V.content.tileset.id);Q.that.picking&&("bim"===Q.that.type?YJ.Global.getBimPickStatus(e)&&Q.callback(n,V.content.tileset,he(pe(e,n),e.viewer),Q.that):Q.callback(n,V.content.tileset.id,he(pe(e,n),e.viewer),Q.that))}}}}}}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}}function me(e){se.destroy(),se=null}function fe(e,t,i){le.set(e,{callback:t,that:i})}function ve(e,t,i){ce.set(e,{callback:t,that:i})}function ge(e,t,i){ue.set(e,{callback:t,that:i})}function ye(){if(se)return!0}function be(){if(ae)return!0}function Ce(){if(re)return!0}var we,ke=new Map,_e=new Map,xe=new Map;function Ee(e,t){var i=t.scene.globe.ellipsoid,n=new Cesium.Cartesian3(e.x,e.y,e.z),o=i.cartesianToCartographic(n),s=Cesium.Math.toDegrees(o.latitude);return{lng:Cesium.Math.toDegrees(o.longitude),lat:s,alt:o.height<0?0:o.height}}function Se(e,t){t.endPosition&&(t.endPosition.y-=2);var i=t.position||t.endPosition,n=e.viewer.scene.pickPosition(i);if(!n){var o=e.viewer.camera.getPickRay(i);n=e.viewer.scene.globe.pick(o,e.viewer.scene)}return n}function Pe(e,t){if(e&&e.viewer){var i=!0;new Cesium.ScreenSpaceEventHandler(e.viewer.canvas).setInputAction((function(n){var o=e.viewer.scene.pickPosition(n.position);if(!o){var s=e.viewer.camera.getPickRay(n.position);o=e.viewer.scene.globe.pick(s,e.viewer.scene)}if(o){var a=Ee(o,e.viewer);if(t&&t(a),i&&(i=!1,setTimeout((function(){i=!0}),600),!YJ.Measure.GetMeasureStatus()&&o)){for(var r=!1,l=ke.size-1;l>=0;l--){var c=Array.from(ke.keys())[l],u=ke.get(c);if(u&&u.that)if("PolygonObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var h=turf.point([a.lng,a.lat]),p=[],d=0;d<u.that.options.positions.length;d++)p.push([u.that.options.positions[d].lng,u.that.options.positions[d].lat]);p.push([u.that.options.positions[0].lng,u.that.options.positions[0].lat]);var m=turf.polygon([p]);if(turf.booleanPointInPolygon(h,m)){u.callback(n,u.that.options.id,Ee(Se(e,n),e.viewer),u.that),r=!0;break}}}else if("AssembleObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var f=u.that.computeAssemble(u.that.options.positions,!0),v=turf.point([a.lng,a.lat]),g=[],y=0;y<f.length;y+=2)g.push([f[y],f[y+1]]);var b=turf.polygon([g]);if(turf.booleanPointInPolygon(v,b)){u.callback(n,u.that.options.id,Ee(Se(e,n),e.viewer),u.that),r=!0;break}}}else if("AttackArrowObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var C=turf.point([a.lng,a.lat]),w=u.that.computeAttackArrow(u.that.options.positions),k=[],_=0;_<w.length;_++){var x=Ee(w[_],e.viewer);k.push([x.lng,x.lat])}var E=turf.polygon([k]);if(turf.booleanPointInPolygon(C,E)){u.callback(n,u.that.options.id,Ee(Se(e,n),e.viewer),u.that),r=!0;break}}}else if("PincerArrowObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=5){for(var S=turf.point([a.lng,a.lat]),P=u.that.computePincerArrow(u.that.options.positions),D=[],M=0;M<P.length;M++){var T=Ee(P[M],e.viewer);D.push([T.lng,T.lat])}var O=Ee(P[0],e.viewer);D.push([O.lng,O.lat]);var N=turf.polygon([D]);if(turf.booleanPointInPolygon(S,N)){u.callback(n,u.that.options.id,Ee(Se(e,n),e.viewer),u.that),r=!0;break}}}else if("CircleObject"===u.that.type){if(u.that.picking){var B=turf.point([a.lng,a.lat]);if(u.that.options.center&&u.that.options.radius){var A=[u.that.options.center.lng,u.that.options.center.lat],L=u.that.options.radius/1e3,I=turf.circle(A,L,{steps:360,units:"kilometers"});if(turf.booleanPointInPolygon(B,I)){u.callback(n,u.that.options.id,Ee(Se(e,n),e.viewer),u.that),r=!0;break}}}}else if("SectorObject"===u.that.type&&u.that.picking){var j=turf.point([a.lng,a.lat]);if(u.that.options.center&&u.that.options.radius&&u.that.options.startAngle&&u.that.options.endAngle){for(var R=u.that.calSector(u.that.options.center,u.that.options.radius,u.that.options.startAngle,u.that.options.endAngle,void 0,!0),F=[],z=0;z<R.length;z++)F.push([R[z].lng,R[z].lat]);var H=turf.polygon([F]);if(turf.booleanPointInPolygon(j,H)){u.callback(n,u.that.options.id,Ee(Se(e,n),e.viewer),u.that),r=!0;break}}}}if(!r){var V=e.viewer.scene.pick(n.position);if(V){if(V.id){var G;if(V.id.type&&"vector"===V.id.type&&V.id.parentId){var W=ke.get(V.id.parentId);if(W.that.picking&&W.that.geojson)for(var U=0;U<W.that.geojson.features.length;U++)W.that.geojson.features[U].id===V.id._id&&W.callback(n,W.that.geojson.features[U].id,Ee(Se(e,n),e.viewer),W.that)}else if("string"==typeof V.id.id){var Y=V.id.id.split("-");Y.splice(Y.length-1,1),G=Y.join("-")}if(V.id.properties&&V.id.properties.id&&ke.has(V.id.properties.id._value)){var J=ke.get(V.id.properties.id._value);J.that.picking&&J.callback(n,V.id.properties.id._value,Ee(Se(e,n),e.viewer),J.that)}else if(ke.has(V.id.id)){var q=ke.get(V.id.id);q.that.picking&&q.callback(n,V.id.id,Ee(Se(e,n),e.viewer),q.that)}else if(G&&ke.has(G)){var X=ke.get(G);X.that.picking&&X.callback(n,G,Ee(Se(e,n),e.viewer),X.that)}else if(V.primitive&&"string"==typeof V.id&&ke.has(V.id)){var Z=ke.get(V.id);Z.callback(n,V.id,Ee(Se(e,n),e.viewer),Z.that)}}else if(V.primitive&&V.primitive.id&&ke.has(V.primitive.id)){var K=ke.get(V.primitive.id);K.that.picking&&("bim"===K.that.type?YJ.Global.getBimPickStatus(e)&&K.callback(n,V.primitive,Ee(Se(e,n),e.viewer),K.that):K.callback(n,V.primitive.id,Ee(Se(e,n),e.viewer),K.that))}if(V.content&&(!V.primitive||!V.primitive.id)&&ke.has(V.content.tileset.id)){var Q=ke.get(V.content.tileset.id);Q.that.picking&&("bim"===Q.that.type?YJ.Global.getBimPickStatus(e)&&Q.callback(n,V.content.tileset,Ee(Se(e,n),e.viewer),Q.that):Q.callback(n,V.content.tileset.id,Ee(Se(e,n),e.viewer),Q.that))}}}}}}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}}function De(e){e&&e.viewer&&new Cesium.ScreenSpaceEventHandler(e.viewer.canvas).setInputAction((function(t){if(!YJ.Measure.GetMeasureStatus()){var i,n=e.viewer.scene.pick(t.position);if(n&&n.id)if(n.id.type&&"vector"===n.id.type&&n.id.parentId){var o=_e.get(n.id.parentId);if(o.that.picking&&o.that.geojson)for(var s=0;s<o.that.geojson.features.length;s++)o.that.geojson.features[s].id===n.id._id&&o.callback(t,o.that.geojson.features[s].id,Ee(Se(e,t),e.viewer),o.that)}else if(i="string"==typeof n.id?n.id:n.id.id,_e.has(i)){var a=_e.get(i);if(a.that.picking){var r=Se(e,t);if(!r)return;a.callback(t,i,Ee(r,e.viewer),a.that)}}if(n&&n.content&&_e.has(n.content.tileset.id)){var l=_e.get(n.content.tileset.id);if(l.that.picking)if("bim"===l.that.type){if(YJ.Global.getBimPickStatus(e)){var c=Se(e,t);if(!c)return;l.callback(t,n.getProperty("id"),Ee(c,e.viewer),l.that)}}else{var u=Se(e,t);if(!u)return;l.callback(t,n.content.tileset.id,Ee(u,e.viewer),l.that)}}}}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)}function Me(e){new Cesium.ScreenSpaceEventHandler(e.viewer.canvas).setInputAction((function(t){e.viewer.scene.pick(t.endPosition)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}var Te=!1,Oe="1:100万";function Ne(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e){we||(we=new vi),(Te=!!t)?Be(e,Oe):Ie(e);var i=Rt();i&&(Te?Be(e,Oe):Ie(i));var n=rt().sdkD;n&&e!==n&&Ne(n,t)}}function Be(e,t){Oe=t,Te&&Le(e);var i=Rt();return i&&Te&&Le(i),new Promise(function(){var e=o()(a.a.mark((function e(t,i){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:setTimeout((function(){t()}),1e3);case 1:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}())}function Ae(){return Te}function Le(e){Ie(e);var t,i,n=e.viewer.camera.positionCartographic,o={position:{lng:Cesium.Math.toDegrees(n.longitude),lat:Cesium.Math.toDegrees(n.latitude),alt:n.height}},s=e.viewer;switch(Oe){case"1:100万":o.position.alt=16e6;break;case"1:50万":o.position.alt=5e6;break;case"1:25万":o.position.alt=23e5;break;case"1:10万":o.position.alt=68e4;break;case"1:5万":o.position.alt=385e3;break;case"1:2.5万":o.position.alt=18e4;break;case"1:1万":o.position.alt=9e4;break;case"1:5000":o.position.alt=46e3}for(var a=0;a<s.scene.primitives._primitives.length;a++)if("SheetIndexGridPrimitives"===s.scene.primitives._primitives[a].name){t=s.scene.primitives._primitives[a];for(var r=0;r<t._primitives.length;r++)if("SheetIndexLabelCollection"===t._primitives[r].name){i=t._primitives[r];break}break}t||((t=new Cesium.PrimitiveCollection).name="SheetIndexGridPrimitives",s.scene.primitives.add(t)),i||((i=new Cesium.LabelCollection).name="SheetIndexLabelCollection");var l=0,c=null;function u(e){i.removeAll(),t.removeAll(),(i=new Cesium.LabelCollection).name="SheetIndexLabelCollection",t.add(i);var n,o,s,a=p();switch(e){case"1:100万":n=6,o=4,s=new Cesium.NearFarScalar(2e7,1,8e7,0);break;case"1:50万":n=3,o=2,s=new Cesium.NearFarScalar(5e6,1,3e7,0);break;case"1:25万":n=1.5,o=1,s=new Cesium.NearFarScalar(23e5,1,2e7,0);break;case"1:10万":n=.5,o=1/3,s=new Cesium.NearFarScalar(68e4,1,5e6,0);break;case"1:5万":n=.25,o=1/6,s=new Cesium.NearFarScalar(385e3,1,24e5,0);break;case"1:2.5万":n=.125,o=1/12,s=new Cesium.NearFarScalar(18e4,1,12e5,0);break;case"1:1万":n=.0625,o=1/24,s=new Cesium.NearFarScalar(9e4,1,7e5,0);break;case"1:5000":n=.03125,o=1/48,s=new Cesium.NearFarScalar(46e3,1,3e5,0)}var r=Math.floor((180+Cesium.Math.toDegrees(a.west))/n)*n-180,l=Math.floor((88+Cesium.Math.toDegrees(a.south))/o)*o-88,u=Math.ceil((180+Cesium.Math.toDegrees(a.east))/n)*n-180,d=Math.ceil((88+Cesium.Math.toDegrees(a.north))/o)*o-88;if(r>u&&(u+=360),c={minLng:r,minLat:l,maxLng:u,maxLat:d},l<-88&&(l=-88),d>88&&(d=88),(c.maxLng-c.minLng)/n*((c.maxLat-c.minLat)/o)>7e3)c=null;else{for(var m=r;m<=u;m+=n){for(var f=[],v=[],g=l;Math.floor(1e9*g)/1e9<=d;g+=o/2)v.push([m,g]),f.push(Cesium.Cartesian3.fromDegrees(m,g,8848));88!=d&&d+o/2>=88&&f.push(Cesium.Cartesian3.fromDegrees(m,88,8848));var y=new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:f,width:1,vertexFormat:Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,arcType:Cesium.ArcType.RHUMB})});if(t.add(new Cesium.Primitive({geometryInstances:y,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.fromCssColorString("#fcfc00")})})})),m<u)for(var b=l;b<d;b+=o){var C={lng:m+n/2,lat:b+o/2};if(C.lat>d)break;var w=h(C.lng,C.lat,e);i.add({position:Cesium.Cartesian3.fromDegrees(C.lng,C.lat,8848),text:w,font:"16px Inter, sans-serif",fillColor:Cesium.Color.fromCssColorString("#fcfc00"),pixelOffset:new Cesium.Cartesian2(0,0),showBackground:!1,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,scale:1,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,8e7),scaleByDistance:s})}}for(var k=l;Math.floor(1e9*k)/1e9<=d;k+=o){for(var _=[],x=[],E=r;E<=u;E+=n/2)x.push([E,k]),_.push(Cesium.Cartesian3.fromDegrees(E,k,8848));var S=new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:_,width:1,vertexFormat:Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,arcType:Cesium.ArcType.RHUMB})});t.add(new Cesium.Primitive({geometryInstances:S,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.fromCssColorString("#fcfc00")})})}))}}}function h(e,t,i){var n,o;switch(i){case"1:100万":n=6,o=4;break;case"1:50万":n=3,o=2;break;case"1:25万":n=1.5,o=1;break;case"1:10万":n=.5,o=1/3;break;case"1:5万":n=.25,o=1/6;break;case"1:2.5万":n=.125,o=1/12;break;case"1:1万":n=.0625,o=1/24;break;case"1:5000":n=.03125,o=1/48}t=Math.max(-88,Math.min(88,t));var s,a=e,r=t=Math.abs(t),l=Math.floor(a/6+31),c="ABCDEFGHIJKLMNOPQRSTUV".charAt(Math.floor(r/4+1)-1),u={"1:100万":"","1:50万":"B","1:25万":"C","1:10万":"D","1:5万":"E","1:2.5万":"F","1:1万":"G","1:5000":"H"}[i];if(!u&&"1:100万"!==i)throw new Error("不支持的比例尺,请使用: 1:100万, 1:50万, 1:25万, 1:10万, 1:5万, 1:2.5万, 1:1万, 1:5000");s=c+l;var h=("000"+(Math.floor((4*Math.ceil(r/4)-r)/o)+1)).slice(-3),p=a-6*Math.floor(a/6),d=("000"+(Math.floor(p/n)+1)).slice(-3);switch(i){case"1:100万":return s;case"1:50万":case"1:25万":case"1:10万":case"1:5万":case"1:2.5万":case"1:1万":case"1:5000":break;default:throw new Error("不支持的比例尺")}return s+u+h+d}function p(){var e=s.camera.computeViewRectangle();if(2==s.scene.mode){var t=s.scene.canvas,i=new Cesium.Cartesian2(0,0),n=new Cesium.Cartesian2(t.clientWidth,t.clientHeight),o=s.scene.globe.ellipsoid,a=s.camera.pickEllipsoid(i,o),r=s.camera.pickEllipsoid(n,o);if(!a){var l=Cesium.SceneTransforms.wgs84ToWindowCoordinates(s.scene,{x:0,y:0,z:6356755});i.y=l.y+5,a=s.camera.pickEllipsoid(i,o)}if(!r){var c=Cesium.SceneTransforms.wgs84ToWindowCoordinates(s.scene,{x:0,y:0,z:-6356755});n.y=c.y-5,r=s.camera.pickEllipsoid(n,o)}var u=s.scene.globe.ellipsoid.cartesianToCartographic(a),h=s.scene.globe.ellipsoid.cartesianToCartographic(r);return e=(n.y-i.y)/(n.x-i.x)<=.49998752339363695?new Cesium.Rectangle(Cesium.Math.toRadians(-180),Cesium.Math.toRadians(-90),Cesium.Math.toRadians(180),Cesium.Math.toRadians(90)):new Cesium.Rectangle(u.longitude,h.latitude,h.longitude,u.latitude)}return e}t.postRenderEvent=function(){var i=e.viewer.camera.positionCartographic.height;switch(Oe){case"1:100万":o.position.alt=16e6;break;case"1:50万":o.position.alt=5e6;break;case"1:25万":o.position.alt=23e5;break;case"1:10万":o.position.alt=68e4;break;case"1:5万":o.position.alt=385e3;break;case"1:2.5万":o.position.alt=18e4;break;case"1:1万":o.position.alt=9e4;break;case"1:5000":o.position.alt=46e3}if(i>5*o.position.alt)return c=null,void t.removeAll();var n=!1,s=p(),a=Cesium.Math.toDegrees(s.west),r=Cesium.Math.toDegrees(s.south),h=Cesium.Math.toDegrees(s.east);a>h&&(h+=360),s={minLng:a,minLat:r,maxLng:h,maxLat:Cesium.Math.toDegrees(s.north)},c?(c.minLng>s.minLng||c.minLat>s.minLat||c.maxLng<s.maxLng||c.maxLat<s.maxLat)&&Cesium.Math.toDegrees(e.viewer.camera.pitch)<0&&(n=!0):u(Oe),n?++l>=50&&(u(Oe),n=!1):l=0},o.complete=function(){s.scene.postRender.addEventListener(t.postRenderEvent)},Zt(e,o,.5)}function Ie(e){for(var t,i,n=e.viewer,o=0;o<n.scene.primitives._primitives.length;o++)if("SheetIndexGridPrimitives"===n.scene.primitives._primitives[o].name){t=n.scene.primitives._primitives[o];for(var s=0;s<t._primitives.length;s++)if("SheetIndexLabelCollection"===t._primitives[s].name){i=t._primitives[s];break}break}i&&i.removeAll(),t&&t.removeAll(),t&&n.scene.postRender.removeEventListener(t.postRenderEvent)}function je(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 Re(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?je(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):je(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Fe(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return ze(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)?ze(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function ze(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}var He,Ve,Ge,We,Ue={},Ye=[],Je=new Map;function qe(){return(qe=o()(a.a.mark((function e(t){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:!0,He||(Ze(t),St(t));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xe(){if(!1,Ve){Qe(-1,void 0,!0);var e=Ve.viewer._element.getElementsByClassName("YJ-custom-slider")[0],t=Ve.viewer._element.getElementsByClassName("YJ-custom-checkbox-left")[0],i=Ve.viewer._element.getElementsByClassName("YJ-custom-checkbox-right")[0];e&&(Ve.viewer._element.removeChild(e),Ve.viewer._element.removeChild(t),Ve.viewer._element.removeChild(i)),Ve.viewer.scene.preRender.removeEventListener(st,Ue),Ve.viewer.imageryLayers.layerAdded.removeEventListener(et),Ve.viewer.imageryLayers.layerMoved.removeEventListener(tt),Ve.viewer.imageryLayers.layerRemoved.removeEventListener(it),Ve.viewer.imageryLayers.layerShownOrHidden.removeEventListener(nt);for(var n=0;n<Ye.length;n++)Ye[n].destroy();if(He){var o=Ve.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].getElementsByClassName("cesium-widget")[1];Ve.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].removeChild(o),Ye=[],He=null,Ge=null,Ue={}}var s=Ve.viewer._element.getElementsByClassName("cesium-widget")[0],a=s.getElementsByTagName("canvas")[0];s.style.width="100%",a.style.width="100%";for(var r=Ve.viewer._element.getElementsByClassName("billboard-attribute-box"),l=0;l<r.length;l++)r[l].style.display="block";Ve=null}}function Ze(e){return Ke.apply(this,arguments)}function Ke(){return(Ke=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,b,C;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(C=function(e){var i,n,o=Fe(Je);try{for(o.s();!(n=o.n()).done;){var s=y()(n.value,2),a=s[0],r=s[1];r?r.P&&r.D?i=0:(r.P&&(i=-1),r.D&&(i=1)):i=-1,t.entityMap.get(a)&&Qe(i,a)}}catch(e){o.e(e)}finally{o.f()}},b=function(e){if(t.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0]===e.target||t.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0]===e.target||t.viewer._element.getElementsByClassName("cesium-widget")[1].getElementsByTagName("canvas")[0]===e.target){var i=e.offsetX;e.offsetX<60&&(i=60),e.target.width-e.offsetX<60&&(i=e.target.width-60),o.style.left=i/t.viewer._element.scrollWidth*100+"%",d.style.width=i/t.viewer._element.scrollWidth*100+"%",m.style.width=100/(i/t.viewer._element.scrollWidth)+"%",v.style.width=100*(1-i/t.viewer._element.scrollWidth)+"%",g.style.width=100/(1-i/t.viewer._element.scrollWidth)+"%",s.style.left="calc(".concat(i/t.viewer._element.scrollWidth*100,"% - 50px)"),r.style.right="calc(".concat(100*(1-i/t.viewer._element.scrollWidth),"% - 50px)")}},i=t.viewer._element.getElementsByClassName("billboard-attribute-box"),n=0;n<i.length;n++)i[n].style.display="none";if(t.entityMap.forEach((function(e,t){e.type&&"TrajectoryMotion"==e.type&&e.viewFollow&&(e.viewFollow=!1)})),o=t.viewer._element.getElementsByClassName("YJ-custom-slider")[0],s=t.viewer._element.getElementsByClassName("YJ-custom-checkbox-left")[0],r=t.viewer._element.getElementsByClassName("YJ-custom-checkbox-right")[0],o&&(t.viewer._element.removeChild(o),t.viewer._element.removeChild(s),t.viewer._element.removeChild(r)),(o=document.createElement("div")).className="YJ-custom-slider",o.style.position="absolute",o.style.left="50%",o.style.top="0px",(s=document.createElement("input")).className="YJ-custom-checkbox-left",s.type="checkbox",s.style.position="absolute",s.style.left="calc(50% - 50px)",(r=document.createElement("input")).className="YJ-custom-checkbox-right",r.type="checkbox",r.style.position="absolute",r.style.right="calc(50% - 50px)",s.style.display="none",r.style.display="none",t.viewer._element.appendChild(s),t.viewer._element.appendChild(r),l=0,c=0,!We){e.next=43;break}u=0;case 32:if(!(u<We.length)){e.next=43;break}if((h=t.entityMap.get(We[u]))&&"terrain"!==h.type&&h.show&&"TextBox"!==h.type){e.next=36;break}return e.abrupt("continue",40);case 36:s.style.display="unset",r.style.display="unset",(p=Je.get(We[u]))&&(p.P&&l++,p.D&&c++);case 40:u++,e.next=32;break;case 43:return Ve=t,l||c||l++,s.checked=!!l,r.checked=!!c,s.addEventListener("change",(function(e){e.target.checked||r.checked||(r.checked=!0);for(var t=0;t<We.length;t++){var i=Je.get(We[t]);(i=i||{}).P=e.target.checked,i.D=r.checked,Je.set(We[t],i)}C()})),r.addEventListener("change",(function(e){e.target.checked||s.checked||(s.checked=!0);for(var t=0;t<We.length;t++){var i=Je.get(We[t]);(i=i||{}).P=s.checked,i.D=e.target.checked,Je.set(We[t],i)}C()})),o.addEventListener("mousedown",(function(){t.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].style.cursor="e-resize",document.body.addEventListener("mousemove",b),o.addEventListener("mouseup",(function(){t.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].style.cursor="unset",document.body.removeEventListener("mousemove",b)}))})),t.viewer._element.appendChild(o),d=t.viewer._element.getElementsByClassName("cesium-widget")[0],m=d.getElementsByTagName("canvas")[0],d.style.width="50%",d.style.left="0px",d.style.overflow="hidden",m.style.width="200%",Ge=0,f=new vi,e.next=61,new YJ.YJEarth(t.div_id);case 61:if(He=e.sent,!ye()){e.next=65;break}return e.next=65,new Pe(He);case 65:if(!be()){e.next=68;break}return e.next=68,new De(He);case 68:if(!Ce()){e.next=71;break}return e.next=71,new Me(He);case 71:return oe(t)&&ne(He,!0),He.viewer._element.style.display="none",(v=document.createElement("div")).className="cesium-widget cesium-widget-split",v.style.width="50%",v.style.position="absolute",v.style.right="0px",v.style.overflow="hidden",(g=He.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].getElementsByTagName("canvas")[0]).style.width="200%",g.style.position="absolute",g.style.right="0px",v.appendChild(g),t.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].appendChild(v),document.getElementById(t.div_id).removeChild(He.viewer._element),e.next=88,ot();case 88:Ue={sdks:[t,He],tools:f},C(),t.viewer.scene.preRender.addEventListener(st,Ue),t.viewer.imageryLayers.layerMoved.addEventListener(tt),ai(t)&&si(He,!0),li(t)&&ri(He,!0),Ae()&&Ne(He,!0);case 95:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Qe(e,t){return $e.apply(this,arguments)}function $e(){return($e=o()(a.a.mark((function e(t,i){var n,s,r,l,c,u,h,p,d,m,f,v,g=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v=function(){return(v=o()(a.a.mark((function e(i,o){var s,c,u,h,p,d,m,f,v,g,y,b,C,w,k,_,x,E,S,P,D,M,T,O;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s={},(c=r.get(i))||c.show){e.next=4;break}return e.abrupt("return");case 4:if(!(u=l&&l.get(i))){e.next=42;break}e.t0=t,e.next=null===e.t0||void 0===e.t0||0===e.t0||"0"===e.t0?9:1===e.t0||"1"===e.t0?21:-1===e.t0||"-1"===e.t0?32:40;break;case 9:if(s.P=!0,s.D=!0,"TrajectoryMotion"===c.type)h=function(e){if(c.options.state=e,cancelAnimationFrame(c._requestAnimationFrameEventId),c.editObj&&(c.editObj.destroy(),c.editObj=null),c.TweenAnimate)if(clearTimeout(c.TweenAnimate.timeout),e)c.lineEdit=!1,c.TweenAnimate.isPlaying()?c.TweenAnimate.timeout=setTimeout((function(){c.TweenAnimate.resume()}),c.options.delay):c.TweenAnimate.delay(c.delay).start();else{var t=Re({},c.sdk.viewer.camera._position);c._requestAnimationFrameEventId=requestAnimationFrame((function e(){c.firstPersonView&&c.sdk.viewer.camera.setView({destination:Re({},t),orientation:{heading:c.sdk.viewer.camera.heading,pitch:c.sdk.viewer.camera.pitch,roll:c.sdk.viewer.camera.roll}}),c._requestAnimationFrameEventId=requestAnimationFrame(e)})),c.TweenAnimate.pause()}else if(e){var i=c.renewLinePositions(c.options.line.positions);c.modelMove(i)}},c.entity&&c.modelShow&&!c.firstPersonView&&(c.entity.show=!0),c.line&&c.lineShow&&(c.line.show=!0),c.realTimeLine&&c.realTimeRoute&&(c.realTimeLine.show=!0),c.TweenAnimate&&((p=c.state)&&h(!1),u.setMovePositionByDistance(c.TweenAnimate._object.distance),h(p));else if("vector"===c.type){if(c.entity)if(o)for(d=0;d<c.entity.entities.values.length;d++)c.entity.entities.values[d].id===o&&(c.entity.entities.values[d].show=!1!==c.entity.entities.values[d]._customShow);else for(m=0;m<c.entity.entities.values.length;m++)c.entity.entities.values[m].show=!1!==c.entity.entities.values[m]._customShow}else c.entity&&(c.entity.show=!0);if("PincerArrowObject"===c.type&&c.TweenAnimate&&!c.TweenAnimate._isPaused&&c.setSpreadProgressByTime(c.TweenAnimate._object.distance1/c.TweenAnimate._valuesEnd.distance1*c.spreadTime),"AttackArrowObject"!==c.type&&"StraightArrowObject"!==c.type||c.TweenAnimate&&!c.TweenAnimate._isPaused&&c.setSpreadProgressByTime(c.TweenAnimate._object.distance/c.TweenAnimate._valuesEnd.distance*c.spreadTime),"GroundSvg"===c.type&&c.text&&(c.text.show=c.textShow,u.textShow=c.textShow),c.label&&c.labelShow&&(c.labelShow=!0),u.label&&(u.label.options.ground=!1),"vector"===u.type){if(u.entity)if(o)for(f=0;f<u.entity.entities.values.length;f++)u.entity.entities.values[f].id===o&&(u.entity.entities.values[f].show=!1!==c.entity.entities.values[f]._customShow);else for(v=0;v<u.entity.entities.values.length;v++)u.entity.entities.values[v].show=!1!==c.entity.entities.values[v]._customShow}else u.show=!0;return"TrajectoryMotion"===u.type&&(u.firstPersonView=c.firstPersonView),"Explosion"===u.type&&(u.entity.imgIndex=c.entity.imgIndex),e.abrupt("break",40);case 21:if(s.P=!1,s.D=!0,"TrajectoryMotion"===c.type)c.entity&&(c.entity.show=!1),c.line&&(c.line.show=!1),c.realTimeLine&&(c.realTimeLine.show=!1);else if("vector"===c.type){if(c.entity)if(o)for(y=0;y<c.entity.entities.values.length;y++)c.entity.entities.values[y].id===o&&(c.entity.entities.values[y].show=!1);else for(g=0;g<c.entity.entities.values.length;g++)c.entity.entities.values[g].show=!1}else c.entity&&(c.entity.show=!1);if("PincerArrowObject"===c.type&&c.TweenAnimate&&!c.TweenAnimate._isPaused&&c.setSpreadProgressByTime(c.TweenAnimate._object.distance1/c.TweenAnimate._valuesEnd.distance1*c.spreadTime),"AttackArrowObject"!==c.type&&"StraightArrowObject"!==c.type||c.TweenAnimate&&!c.TweenAnimate._isPaused&&c.setSpreadProgressByTime(c.TweenAnimate._object.distance/c.TweenAnimate._valuesEnd.distance*c.spreadTime),"GroundSvg"===c.type&&c.text&&(c.text.show=!1,u.textShow=c.textShow),c.label&&(c.label.entity.show=!1),u.label&&(u.label.options.ground=!1),"vector"===u.type){if(u.entity)if(o)for(b=0;b<u.entity.entities.values.length;b++)u.entity.entities.values[b].id===o&&(u.entity.entities.values[b].show=!1!==c.entity.entities.values[b]._customShow);else for(C=0;C<u.entity.entities.values.length;C++)u.entity.entities.values[C].show=!1!==c.entity.entities.values[C]._customShow}else u.show=!0;return"TrajectoryMotion"===u.type&&(u.firstPersonView=c.firstPersonView),e.abrupt("break",40);case 32:if(s.P=!0,s.D=!1,"TrajectoryMotion"===c.type)c.entity&&c.modelShow&&!c.firstPersonView&&(c.entity.show=!0),c.line&&c.lineShow&&(c.line.show=!0),c.realTimeLine&&c.realTimeRoute&&(c.realTimeLine.show=!0);else if("vector"===c.type){if(c.entity)if(o)for(w=0;w<c.entity.entities.values.length;w++)c.entity.entities.values[w].id===o&&(c.entity.entities.values[w].show=!1!==c.entity.entities.values[w]._customShow);else for(k=0;k<c.entity.entities.values.length;k++)c.entity.entities.values[k].show=!1!==c.entity.entities.values[k]._customShow}else c.entity&&(c.entity.show=!0);if("GroundSvg"===c.type&&c.text&&(c.text.show=c.textShow,u.textShow=!1),c.label&&c.labelShow&&(c.label.entity.show=!0),u.label&&(u.label.options.ground=!1),"terrain"===c.type)u.show=!0;else if("vector"===u.type){if(u.entity)if(o)for(_=0;_<u.entity.entities.values.length;_++)u.entity.entities.values[_].id===o&&u.entity.entities.values[_].id===o&&(u.entity.entities.values[_].show=!1);else for(x=0;x<u.entity.entities.values.length;x++)u.entity.entities.values[x].show=!1}else u.show=!1;return e.abrupt("break",40);case 40:e.next=120;break;case 42:E=Ue.tools.deepCopyObj(c.options),e.t1=t,e.next=null===e.t1||void 0===e.t1||0===e.t1||"0"===e.t1?46:1===e.t1||"1"===e.t1?75:-1===e.t1||"-1"===e.t1?100:120;break;case 46:return s.P=!0,s.D=!0,E.show=!0,"layer"===c.type&&(E.layer_index=c.layer_index),e.next=52,new c.constructor(He,E);case 52:if(S=e.sent,c.onClick&&(S.onClick=c.onClick),c.onRightClick&&(S.onRightClick=c.onRightClick),c.onMouseMove&&(S.onMouseMove=c.onMouseMove),"TrajectoryMotion"!==c.type){e.next=63;break}c.entity&&c.modelShow&&!c.firstPersonView&&(c.entity.show=!0),c.line&&c.lineShow&&(c.line.show=!0),c.realTimeLine&&c.realTimeRoute&&(c.realTimeLine.show=!0),c.TweenAnimate&&((P=c.state)&&(c.state=!1),S.setMovePositionByDistance(c.TweenAnimate._object.distance),c.state=P),e.next=72;break;case 63:if("glb"===S.type||!S.on){e.next=67;break}return"vector"===S.type&&(S.data=c.data),e.next=67,S.on();case 67:"Explosion"===S.type&&(S.entity.imgIndex=c.entity.imgIndex),"PincerArrowObject"===S.type&&c.TweenAnimate&&!c.TweenAnimate._isPaused&&S.setSpreadProgressByTime(c.TweenAnimate._object.distance1/c.TweenAnimate._valuesEnd.distance1*c.spreadTime),"AttackArrowObject"!==S.type&&"StraightArrowObject"!==S.type||c.TweenAnimate&&!c.TweenAnimate._isPaused&&S.setSpreadProgressByTime(c.TweenAnimate._object.distance/c.TweenAnimate._valuesEnd.distance*c.spreadTime),"vector"===c.type&&S.load((function(){if(S.entity)if(o)for(var e=0;e<S.entity.entities.values.length;e++)S.entity.entities.values[e].id===o&&(S.entity.entities.values[e].show=!1!==c.entity.entities.values[e]._customShow);else for(var t=0;t<S.entity.entities.values.length;t++)S.entity.entities.values[t].show=!1!==c.entity.entities.values[t]._customShow})),c.entity&&(c.entity.show=!0);case 72:return"GroundSvg"===c.type&&c.text&&(c.text.show=c.textShow,S.textShow=c.textShow),c.label&&c.labelShow&&(c.label.entity.show=!0),e.abrupt("break",120);case 75:return s.P=!1,s.D=!0,E.show=!0,"layer"===c.type&&(E.layer_index=c.layer_index),e.next=81,new c.constructor(He,E);case 81:if(S=e.sent,c.onClick&&(S.onClick=c.onClick),c.onRightClick&&(S.onRightClick=c.onRightClick),c.onMouseMove&&(S.onMouseMove=c.onMouseMove),"TrajectoryMotion"!==c.type){e.next=92;break}c.entity&&c.modelShow&&(c.entity.show=!1),c.line&&c.lineShow&&(c.line.show=!1),c.realTimeLine&&c.realTimeRoute&&(c.realTimeLine.show=!1),c.TweenAnimate&&((D=c.state)&&(c.state=!1),S.setMovePositionByDistance(c.TweenAnimate._object.distance),c.state=D),e.next=97;break;case 92:if("glb"===S.type||!S.on){e.next=96;break}if("vector"===c.type&&(S.data=c.data,c.entity))for(M=0;M<c.entity.entities.values.length;M++)c.entity.entities.values[M].show=!1;return e.next=96,S.on();case 96:if("vector"===c.type){if(S.entity)if(o)for(T=0;T<S.entity.entities.values.length;T++)S.entity.entities.values[T].id===o&&(S.entity.entities.values[T].show=!1!==c.entity.entities.values[T]._customShow);else for(O=0;O<S.entity.entities.values.length;O++)S.entity.entities.values[O].show=!1!==c.entity.entities.values[O]._customShow}else c.entity&&(c.entity.show=!1);case 97:return"GroundSvg"===c.type&&c.text&&(c.text.show=!1,S.textShow=c.textShow),c.label&&(c.label.entity.show=!1),e.abrupt("break",120);case 100:if(s.P=!0,s.D=!1,"TrajectoryMotion"!==c.type){e.next=108;break}c.entity&&c.modelShow&&!c.firstPersonView&&(c.entity.show=!0),c.line&&c.lineShow&&(c.line.show=!0),c.realTimeLine&&c.realTimeRoute&&(c.realTimeLine.show=!0),e.next=117;break;case 108:if(c.entity&&(c.entity.show=!0),"terrain"!==c.type){e.next=117;break}return E.show=!0,e.next=113,new c.constructor(He,E);case 113:S=e.sent,c.onClick&&(S.onClick=c.onClick),c.onRightClick&&(S.onRightClick=c.onRightClick),c.onMouseMove&&(S.onMouseMove=c.onMouseMove);case 117:return"GroundSvg"===c.type&&c.text&&(c.text.show=c.textShow,S&&(S.textShow=!1)),c.label&&c.labelShow&&(c.label.entity.show=!0),e.abrupt("break",120);case 120:n||Je.set(i,s);case 121:case"end":return e.stop()}}),e)})))).apply(this,arguments)},f=function(e,t){return v.apply(this,arguments)},n=g.length>2&&void 0!==g[2]&&g[2],s=g.length>3?g[3]:void 0,Ve){e.next=6;break}return e.abrupt("return");case 6:if(r=Ve.entityMap,l=He&&He.entityMap,!i){e.next=15;break}if((c=r.get(i))&&c.show){e.next=12;break}return e.abrupt("return");case 12:f(i,s),e.next=35;break;case 15:u=Fe(Ve.entityMap),e.prev=16,u.s();case 18:if((h=u.n()).done){e.next=27;break}if(p=y()(h.value,2),d=p[0],(m=p[1])&&m.show){e.next=24;break}return e.abrupt("continue",25);case 24:f(d,s);case 25:e.next=18;break;case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(16),u.e(e.t0);case 32:return e.prev=32,u.f(),e.finish(32);case 35:if(!n){e.next=37;break}return e.abrupt("return");case 37:case"end":return e.stop()}}),e,null,[[16,29,32,35]])})))).apply(this,arguments)}function et(e,t){He.viewer.imageryLayers.addImageryProvider(e.imageryProvider,t)}function tt(e,t,i){for(var n,o=0;o<He.viewer.imageryLayers._layers.length;o++)if(He.viewer.imageryLayers._layers[o]._id===e._id){n=He.viewer.imageryLayers._layers[o];break}n&&(0===t?He.viewer.imageryLayers.lowerToBottom(n):t===He.viewer.imageryLayers._layers.length-1?He.viewer.imageryLayers.raiseToTop(n):t<i?t<He.viewer.imageryLayers._layers.length-1&&He.viewer.imageryLayers.lower(n):He.viewer.imageryLayers.raise(n))}function it(e,t){var i=He.viewer.imageryLayers._layers[t];i&&He.viewer.imageryLayers.remove(i)}function nt(e,t,i){var n=He.viewer.imageryLayers._layers[t];n&&(n.show=i)}function ot(){var e=new Cesium.ScreenSpaceEventHandler(Ve.viewer._element.getElementsByClassName("cesium-widget")[0]);e.setInputAction((function(){Ge=0}),Cesium.ScreenSpaceEventType.LEFT_DOWN),e.setInputAction((function(){Ge=0}),Cesium.ScreenSpaceEventType.RIGHT_DOWN),e.setInputAction((function(){Ge=0}),Cesium.ScreenSpaceEventType.WHEEL),Ye.push(e);var t=document.getElementById("distanceLegendDiv");function i(e){Ge=0}t.addEventListener("mousemove",i),Ye.push({destroy:function(){t.removeEventListener("mousemove",i)}});var n=new Cesium.ScreenSpaceEventHandler(Ve.viewer._element.getElementsByClassName("cesium-widget")[1]);n.setInputAction((function(){Ge=1,ni(Ve)}),Cesium.ScreenSpaceEventType.LEFT_DOWN),n.setInputAction((function(){Ge=1,ni(Ve)}),Cesium.ScreenSpaceEventType.RIGHT_DOWN),n.setInputAction((function(){Ge=1,ni(Ve)}),Cesium.ScreenSpaceEventType.WHEEL),Ye.push(n)}function st(){var e,t=this.sdks[Ge];0===Ge?e=this.sdks[1]:1===Ge&&(e=this.sdks[0]);var i=t.viewer.camera.position;e.viewer.camera.setView({destination:i,orientation:{heading:t.viewer.camera.heading,pitch:t.viewer.camera.pitch,roll:t.viewer.camera.roll}})}function at(e,t,i){if(Ve&&He&&e===Ve&&t){var n=Je.get(t),o=Ve.entityMap.get(t),s=He.entityMap.get(t);if(o){var a;if(n)n.P&&n.D?a=0:(n.P&&(a=-1),n.D&&(a=1));else{var r=e.viewer._element.getElementsByClassName("YJ-custom-checkbox-left")[0],l=e.viewer._element.getElementsByClassName("YJ-custom-checkbox-right")[0];"none"===r.style.display||"none"===l.style.display?a=-1:r.checked&&l.checked?a=0:(r.checked&&(a=-1),l.checked&&(a=1))}if(s)s.options=JSON.parse(JSON.stringify(o.options)),s.originalOptions=JSON.parse(JSON.stringify(o.options)),o.oldData&&(s.oldData=JSON.parse(JSON.stringify(o.oldData))),"TrajectoryMotion"===s.type&&(s.height=s.options.height),s.reset&&s.reset(),o.show?Qe(a,t,!1,i):s.show=!1;else{Qe(-1,t,!1,i)}}else s&&s.remove()}}function rt(){return{sdkP:Ve,sdkD:He}}var lt,ct,ut,ht=new Map,pt=new Map,dt=new Map;function mt(e,t){var i=t.scene.globe.ellipsoid,n=new Cesium.Cartesian3(e.x,e.y,e.z),o=i.cartesianToCartographic(n),s=Cesium.Math.toDegrees(o.latitude);return{lng:Cesium.Math.toDegrees(o.longitude),lat:s,alt:o.height<0?0:o.height}}function ft(e,t){t.endPosition&&(t.endPosition.y-=2);var i=t.position||t.endPosition,n=e.viewer.scene.pickPosition(i);if(!n){var o=e.viewer.camera.getPickRay(i);n=e.viewer.scene.globe.pick(o,e.viewer.scene)}return n}function vt(e,t){if(e&&e.viewer){var i=!0;new Cesium.ScreenSpaceEventHandler(e.viewer.canvas).setInputAction((function(n){var o=e.viewer.scene.pickPosition(n.position);if(!o){var s=e.viewer.camera.getPickRay(n.position);o=e.viewer.scene.globe.pick(s,e.viewer.scene)}if(o){var a=mt(o,e.viewer);if(t&&t(a),i&&(i=!1,setTimeout((function(){i=!0}),600),!YJ.Measure.GetMeasureStatus()&&o)){for(var r=!1,l=ht.size-1;l>=0;l--){var c=Array.from(ht.keys())[l],u=ht.get(c);if(u&&u.that)if("PolygonObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var h=turf.point([a.lng,a.lat]),p=[],d=0;d<u.that.options.positions.length;d++)p.push([u.that.options.positions[d].lng,u.that.options.positions[d].lat]);p.push([u.that.options.positions[0].lng,u.that.options.positions[0].lat]);var m=turf.polygon([p]);if(turf.booleanPointInPolygon(h,m)){u.callback(n,u.that.options.id,mt(ft(e,n),e.viewer),u.that),r=!0;break}}}else if("AssembleObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var f=u.that.computeAssemble(u.that.options.positions,!0),v=turf.point([a.lng,a.lat]),g=[],y=0;y<f.length;y+=2)g.push([f[y],f[y+1]]);var b=turf.polygon([g]);if(turf.booleanPointInPolygon(v,b)){u.callback(n,u.that.options.id,mt(ft(e,n),e.viewer),u.that),r=!0;break}}}else if("AttackArrowObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var C=turf.point([a.lng,a.lat]),w=u.that.computeAttackArrow(u.that.options.positions),k=[],_=0;_<w.length;_++){var x=mt(w[_],e.viewer);k.push([x.lng,x.lat])}var E=turf.polygon([k]);if(turf.booleanPointInPolygon(C,E)){u.callback(n,u.that.options.id,mt(ft(e,n),e.viewer),u.that),r=!0;break}}}else if("PincerArrowObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=5){for(var S=turf.point([a.lng,a.lat]),P=u.that.computePincerArrow(u.that.options.positions),D=[],M=0;M<P.length;M++){var T=mt(P[M],e.viewer);D.push([T.lng,T.lat])}var O=mt(P[0],e.viewer);D.push([O.lng,O.lat]);var N=turf.polygon([D]);if(turf.booleanPointInPolygon(S,N)){u.callback(n,u.that.options.id,mt(ft(e,n),e.viewer),u.that),r=!0;break}}}else if("CircleObject"===u.that.type){if(u.that.picking){var B=turf.point([a.lng,a.lat]);if(u.that.options.center&&u.that.options.radius){var A=[u.that.options.center.lng,u.that.options.center.lat],L=u.that.options.radius/1e3,I=turf.circle(A,L,{steps:360,units:"kilometers"});if(turf.booleanPointInPolygon(B,I)){u.callback(n,u.that.options.id,mt(ft(e,n),e.viewer),u.that),r=!0;break}}}}else if("SectorObject"===u.that.type&&u.that.picking){var j=turf.point([a.lng,a.lat]);if(u.that.options.center&&u.that.options.radius&&u.that.options.startAngle&&u.that.options.endAngle){for(var R=u.that.calSector(u.that.options.center,u.that.options.radius,u.that.options.startAngle,u.that.options.endAngle,void 0,!0),F=[],z=0;z<R.length;z++)F.push([R[z].lng,R[z].lat]);var H=turf.polygon([F]);if(turf.booleanPointInPolygon(j,H)){u.callback(n,u.that.options.id,mt(ft(e,n),e.viewer),u.that),r=!0;break}}}}if(!r){var V=e.viewer.scene.pick(n.position);if(V){if(V.id){var G;if(V.id.type&&"vector"===V.id.type&&V.id.parentId){var W=ht.get(V.id.parentId);if(W.that.picking&&W.that.geojson)for(var U=0;U<W.that.geojson.features.length;U++)W.that.geojson.features[U].id===V.id._id&&W.callback(n,W.that.geojson.features[U].id,mt(ft(e,n),e.viewer),W.that)}else if("string"==typeof V.id.id){var Y=V.id.id.split("-");Y.splice(Y.length-1,1),G=Y.join("-")}if(V.id.properties&&V.id.properties.id&&ht.has(V.id.properties.id._value)){var J=ht.get(V.id.properties.id._value);J.that.picking&&J.callback(n,V.id.properties.id._value,mt(ft(e,n),e.viewer),J.that)}else if(ht.has(V.id.id)){var q=ht.get(V.id.id);q.that.picking&&q.callback(n,V.id.id,mt(ft(e,n),e.viewer),q.that)}else if(G&&ht.has(G)){var X=ht.get(G);X.that.picking&&X.callback(n,G,mt(ft(e,n),e.viewer),X.that)}else if(V.primitive&&"string"==typeof V.id&&ht.has(V.id)){var Z=ht.get(V.id);Z.callback(n,V.id,mt(ft(e,n),e.viewer),Z.that)}}else if(V.primitive&&V.primitive.id&&ht.has(V.primitive.id)){var K=ht.get(V.primitive.id);K.that.picking&&("bim"===K.that.type?YJ.Global.getBimPickStatus(e)&&K.callback(n,V.primitive,mt(ft(e,n),e.viewer),K.that):K.callback(n,V.primitive.id,mt(ft(e,n),e.viewer),K.that))}if(V.content&&(!V.primitive||!V.primitive.id)&&ht.has(V.content.tileset.id)){var Q=ht.get(V.content.tileset.id);Q.that.picking&&("bim"===Q.that.type?YJ.Global.getBimPickStatus(e)&&Q.callback(n,V.content.tileset,mt(ft(e,n),e.viewer),Q.that):Q.callback(n,V.content.tileset.id,mt(ft(e,n),e.viewer),Q.that))}}}}}}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}}function gt(e){e&&e.viewer&&new Cesium.ScreenSpaceEventHandler(e.viewer.canvas).setInputAction((function(t){if(!YJ.Measure.GetMeasureStatus()){var i,n=e.viewer.scene.pick(t.position);if(n&&n.id)if(n.id.type&&"vector"===n.id.type&&n.id.parentId){var o=pt.get(n.id.parentId);if(o.that.picking&&o.that.geojson)for(var s=0;s<o.that.geojson.features.length;s++)o.that.geojson.features[s].id===n.id._id&&o.callback(t,o.that.geojson.features[s].id,mt(ft(e,t),e.viewer),o.that)}else if(i="string"==typeof n.id?n.id:n.id.id,pt.has(i)){var a=pt.get(i);if(a.that.picking){var r=ft(e,t);if(!r)return;a.callback(t,i,mt(r,e.viewer),a.that)}}if(n&&n.content&&pt.has(n.content.tileset.id)){var l=pt.get(n.content.tileset.id);if(l.that.picking)if("bim"===l.that.type){if(YJ.Global.getBimPickStatus(e)){var c=ft(e,t);if(!c)return;l.callback(t,n.getProperty("id"),mt(c,e.viewer),l.that)}}else{var u=ft(e,t);if(!u)return;l.callback(t,n.content.tileset.id,mt(u,e.viewer),l.that)}}}}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)}function yt(e){new Cesium.ScreenSpaceEventHandler(e.viewer.canvas).setInputAction((function(t){e.viewer.scene.pick(t.endPosition)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}function bt(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Ct(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)?Ct(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ct(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}var wt={},kt=[];function _t(e){return xt.apply(this,arguments)}function xt(){return(xt=o()(a.a.mark((function e(t){var i,n,o,s,r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ct=t,ut=0,i=new vi,e.next=5,new YJ.YJEarth(t.div_id);case 5:return(n=e.sent).viewer._element.className="cesium-viewer 2d",Ne(n,Ae()),$t(n,{compass:!1,info:!1,frame:!1}),n.viewer.scene.mode=Cesium.SceneMode.SCENE2D,e.next=12,n;case 12:return lt=e.sent,ye()&&vt(lt),be()&>(lt),Ce()&&yt(lt),zt(),wt={sdks:[t,n],tools:i},e.next=20,It(t,0,wt);case 20:return e.next=22,It(n,1,wt);case 22:return e.next=24,Mt(t);case 24:for(t.viewer.scene.preRender.addEventListener(jt,wt),t.viewer.imageryLayers.layerAdded.addEventListener(Ot),t.viewer.imageryLayers.layerMoved.addEventListener(Nt),t.viewer.imageryLayers.layerRemoved.addEventListener(Bt),t.viewer.imageryLayers.layerShownOrHidden.addEventListener(At),(o=A()(t.viewer.imageryLayers._layers)).sort((function(e,t){return e._layerIndex-t._layerIndex})),lt.viewer.imageryLayers.removeAll(),s=0;s<o.length;s++)r=lt.viewer.imageryLayers.addImageryProvider(o[s].imageryProvider,o[s]._layerIndex),o[s]._id&&(r._id=o[s]._id),r.show=o[s].show,r.alpha=o[s].alpha,o[s]._objectState&&3==o[s]._showView&&(r.show=!1);ai(t)&&si(n,!0),li(t)&&ri(n,!0),t.entityMap.forEach((function(e,t){2==e.showView&&(e.showView=2)}));case 36:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Et(){return(Et=o()(a.a.mark((function e(t){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:lt||(_t(t),Xe());case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function St(e){e.viewer.scene.preRender.removeEventListener(jt,wt),e.viewer.imageryLayers.layerAdded.removeEventListener(Ot),e.viewer.imageryLayers.layerMoved.removeEventListener(Nt),e.viewer.imageryLayers.layerRemoved.removeEventListener(Bt),e.viewer.imageryLayers.layerShownOrHidden.removeEventListener(At);for(var t=0;t<kt.length;t++)kt[t].destroy();lt&&(lt.destroy(),kt=[],lt=null,ct=null,ut=null,wt={}),e.entityMap.forEach((function(e,t){e.showView&&(e.show=e.show)}))}function Pt(e,t,i){return Dt.apply(this,arguments)}function Dt(){return(Dt=o()(a.a.mark((function e(t,i,n){var o,s,r,l,c,u,h,p,d,m,f,v,g,b,C,w;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t&&t.viewer&&t.viewer._element&&"cesium-viewer 2d"===t.viewer._element.className)){e.next=2;break}return e.abrupt("return");case 2:if(ct&<){e.next=4;break}return e.abrupt("return");case 4:if(o=ct.entityMap,!i){e.next=39;break}if(!(s=o.get(i))){e.next=33;break}if(!(r=lt.entityMap.get(i))){e.next=12;break}return e.next=12,r.remove();case 12:if(l=wt.tools.deepCopyObj(s.options),"BillboardObject"===s.type&&(l.heightReference=1),"PolygonObject"===s.type&&(l.heightMode=0,l.height=0),s.type&&("tileset"===s.type||"bim"===s.type||"glb"===s.type||"layer"===s.type||"wallStereoscopic"===s.type)){e.next=31;break}return 3==s.showView&&(l.show=!1),"TextBox"===s.type&&(c=s.callback),e.next=20,new s.constructor(lt,l,c);case 20:if((u=e.sent).onClick=s.onClick,u.onRightClick=s.onRightClick,u.onMouseMove=s.onMouseMove,"TrajectoryMotion"===s.type&&(s.firstPersonView=!1,s.TweenAnimate?((h=s.state)&&(s.state=!1),u.state?u.setMovePositionByDistance(Number(s.TweenAnimate._object.distance.toFixed(8))):setTimeout((function(){u.setMovePositionByDistance(Number(s.TweenAnimate._object.distance.toFixed(8))+1e-8),setTimeout((function(){u.setMovePositionByDistance(Number(s.TweenAnimate._object.distance.toFixed(8))+2e-8)}),500)}),500),s.state=h):setTimeout((function(){u.setMovePositionByDistance(1e-8),setTimeout((function(){u.setMovePositionByDistance(2e-8)}),500)}),500),s.viewFollow&&(u.viewFollow=!0)),"AttackArrowObject"!==s.type&&"StraightArrowObject"!==s.type||s.spreadState&&s.TweenAnimate&&s.TweenAnimate._object&&u.setSpreadProgressByTime(s.TweenAnimate._object.distance/s.TweenAnimate._valuesEnd.distance*s.spreadTime),"PincerArrowObject"===s.type&&s.spreadState&&s.TweenAnimate&&s.TweenAnimate._object&&u.setSpreadProgressByTime(s.TweenAnimate._object.distance1/s.TweenAnimate._valuesEnd.distance1*s.spreadTime),!u.on||"glb"===u.type){e.next=31;break}return"vector"===u.type&&(u.data=s.data,u.load((function(){if(u.entity)for(var e=0;e<u.entity.entities.values.length;e++)u.entity.entities.values[e].show=!1!==s.entity.entities.values[e]._customShow}))),e.next=31,u.on();case 31:e.next=37;break;case 33:if(!(p=lt.entityMap.get(i))){e.next=37;break}return e.next=37,p.remove();case 37:e.next=74;break;case 39:d=bt(lt.entityMap),e.prev=40,d.s();case 42:if((m=d.n()).done){e.next=50;break}if(f=y()(m.value,2),v=f[0],f[1],!(g=lt.entityMap.get(v))){e.next=48;break}return e.next=48,g.remove();case 48:e.next=42;break;case 50:e.next=55;break;case 52:e.prev=52,e.t0=e.catch(40),d.e(e.t0);case 55:return e.prev=55,d.f(),e.finish(55);case 58:b=bt(o),e.prev=59,w=a.a.mark((function e(){var t,i,n,o,s,r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=y()(C.value,2),t[0],"BillboardObject"===(i=t[1]).type&&(i.options.heightReference=1),n=wt.tools.deepCopyObj(i.options),i.type&&("tileset"===i.type||"bim"===i.type||"glb"===i.type||"layer"===i.type||"wallStereoscopic"===i.type)){e.next=25;break}return 3==i.showView&&(n.show=!1),e.next=7,lt.entityMap.get(n.id);case 7:if(!(o=e.sent)){e.next=11;break}return e.next=11,o.remove();case 11:return"TextBox"===i.type&&(s=i.callback),e.next=14,new i.constructor(lt,n,s);case 14:if((o=e.sent).onClick=i.onClick,o.onRightClick=i.onRightClick,o.onMouseMove=i.onMouseMove,"TrajectoryMotion"===i.type&&(i.firstPersonView=!1,i.TweenAnimate?((r=i.state)&&(i.state=!1),o.state?o.setMovePositionByDistance(Number(i.TweenAnimate._object.distance.toFixed(8))):setTimeout((function(){o.setMovePositionByDistance(Number(i.TweenAnimate._object.distance.toFixed(8))+1e-9),setTimeout((function(){o.setMovePositionByDistance(Number(i.TweenAnimate._object.distance.toFixed(8))+2e-9)}),1500)}),1500),i.state=r):setTimeout((function(){o.setMovePositionByDistance(1e-9),setTimeout((function(){o.setMovePositionByDistance(2e-9)}),1500)}),1500),i.viewFollow&&(o.viewFollow=!0)),"AttackArrowObject"!==i.type&&"StraightArrowObject"!==i.type||i.spreadState&&i.TweenAnimate&&i.TweenAnimate._object&&o.setSpreadProgressByTime(i.TweenAnimate._object.distance/i.TweenAnimate._valuesEnd.distance*i.spreadTime),"PincerArrowObject"===i.type&&i.spreadState&&i.TweenAnimate&&i.TweenAnimate._object&&o.setSpreadProgressByTime(i.TweenAnimate._object.distance1/i.TweenAnimate._valuesEnd.distance1*i.spreadTime),!o.on||"glb"===i.type){e.next=25;break}return"vector"===o.type&&(o.data=i.data,o.load((function(){if(o.entity)for(var e=0;e<o.entity.entities.values.length;e++)o.entity.entities.values[e].show=!1!==i.entity.entities.values[e]._customShow}))),e.next=25,o.on();case 25:case"end":return e.stop()}}),e)})),b.s();case 62:if((C=b.n()).done){e.next=66;break}return e.delegateYield(w(),"t1",64);case 64:e.next=62;break;case 66:e.next=71;break;case 68:e.prev=68,e.t2=e.catch(59),b.e(e.t2);case 71:return e.prev=71,b.f(),e.finish(71);case 74:case"end":return e.stop()}}),e,null,[[40,52,55,58],[59,68,71,74]])})))).apply(this,arguments)}function Mt(e,t,i){return Tt.apply(this,arguments)}function Tt(){return(Tt=o()(a.a.mark((function e(t,i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Pt(t,i,n);case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ot(e,t){lt.viewer.imageryLayers.addImageryProvider(e.imageryProvider,t)}function Nt(e,t,i){var n=lt.viewer.imageryLayers._layers[i];n&&(0===t?lt.viewer.imageryLayers.lowerToBottom(n):t===ct.viewer.imageryLayers._layers.length-1?lt.viewer.imageryLayers.raiseToTop(n):t<i?lt.viewer.imageryLayers.lower(n):lt.viewer.imageryLayers.raise(n))}function Bt(e,t){var i=lt.viewer.imageryLayers._layers[t];i&<.viewer.imageryLayers.remove(i)}function At(e,t,i){}function Lt(){return(Lt=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ct){e.next=2;break}return e.abrupt("return");case 2:if(lt){for(i=lt.viewer.scene.primitives._primitives,n=ct.viewer.scene.primitives._primitives,o=i.length-1;o>=1;o--){for(s=!1,r=n.length-1;r>=1;r--)n[r].id&&i[r].id&&n[r].id===i[o].id&&(s=!0);s||lt.viewer.scene.primitives.remove(i[o])}for(l=n.length-1;l>=1;l--){for(c=!1,u=i.length-1;u>=1;u--)n[l].id&&i[l].id&&n[l].id===i[u].id&&(c=!0,i[u].show=n[l].show,i[u].startColor=n[l].startColor,i[u].endColor=n[l].endColor,i[u].minimumSpeed=n[l].minimumSpeed,i[u].maximumSpeed=n[l].maximumSpeed,i[u].minimumParticleLife=n[l].minimumParticleLife,i[u].maximumParticleLife=n[l].maximumParticleLife,i[u].startScale=n[l].startScale,i[u].endScale=n[l].endScale,i[u].emissionRate=n[l].emissionRate,i[u].particleSize=n[l].particleSize,i[u].modelMatrix=n[l].modelMatrix);c||lt.viewer.scene.primitives.add(n[l])}}case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function It(e,t,i){var n=new Cesium.ScreenSpaceEventHandler(e.viewer.canvas);n.setInputAction((function(){ut=t}),Cesium.ScreenSpaceEventType.LEFT_DOWN),n.setInputAction((function(){ut=t}),Cesium.ScreenSpaceEventType.RIGHT_DOWN),n.setInputAction((function(){ut=t}),Cesium.ScreenSpaceEventType.WHEEL),kt.push(n)}function jt(){var e,t=this.sdks[ut];if(0===ut?e=this.sdks[1]:1===ut&&(e=this.sdks[0]),2===t.viewer.scene.mode)if(this.sdks[0].viewer.trackedEntity){var i=t.viewer.camera.positionCartographic.height;e.viewer.camera.lookAt(Cesium.Cartesian3.fromRadians(t.viewer.camera.positionCartographic.longitude,t.viewer.camera.positionCartographic.latitude,0),new Cesium.HeadingPitchRange(0,Cesium.Math.toRadians(-90),i))}else{this.sdks[1].viewer.trackedEntity&&(this.sdks[1].viewer.entities.remove(this.sdks[1].viewer.trackedEntity),this.sdks[1].viewer.trackedEntity=null);var n=this.tools.cartesian3Towgs84(Cesium.Cartesian3.fromRadians(t.viewer.camera.positionCartographic.longitude,t.viewer.camera.positionCartographic.latitude,t.viewer.camera.positionCartographic.height),t.viewer);e.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt)})}else{var o=t.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(t.viewer.canvas.clientWidth/2,t.viewer.canvas.clientHeight/(2-(90+t.viewer.camera.pitch/(Cesium.Math.PI/180))/110)));o||(o=t.viewer.camera.positionWC);var s=this.tools.cartesian3Towgs84(t.viewer.camera.positionWC,t.viewer).alt,a=this.tools.cartesian3Towgs84(o,t.viewer);e.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(a.lng,a.lat,s)})}}function Rt(){return lt}function Ft(){return ct}function zt(){lt&<.viewer.entities.add({show:!1,polygon:{hierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray([100,50,100.0001,50,100.0001,50.0001]))}})}function Ht(){return{sdkP:ct,sdkD:lt}}function Vt(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Gt(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)?Gt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Gt(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}var Wt,Ut="EPSG:4326",Yt=!0,Jt={},qt={},Xt={};function Zt(e,t){return Kt.apply(this,arguments)}function Kt(){return(Kt=o()(a.a.mark((function e(t,i){var n,o,s,r,l,c,u=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=u.length>2&&void 0!==u[2]?u[2]:3,o=new vi(t),r=i.orientation,!i.position){e.next=13;break}if(0===i.position.alt||i.position.alt){e.next=8;break}return e.next=7,o.getClampToHeight(i.position);case 7:i.position.alt=e.sent;case 8:l=0,r||(l=500),s=Cesium.Cartesian3.fromDegrees(i.position.lng,i.position.lat,i.position.alt+l),e.next=15;break;case 13:c=o.cal_envelope(i.positions),s=new Cesium.Rectangle(Cesium.Math.toRadians(c[3][0]),Cesium.Math.toRadians(c[3][1]),Cesium.Math.toRadians(c[1][0]),Cesium.Math.toRadians(c[1][1]));case 15:ni(t),t.viewer.camera.flyTo({destination:s,duration:n,orientation:r,complete:i.complete});case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Qt(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&e.viewer){var i=e.viewer;i.scene.screenSpaceCameraController.enableRotate=t,i.scene.screenSpaceCameraController.enableTranslate=t,i.scene.screenSpaceCameraController.enableZoom=t,i.scene.screenSpaceCameraController.enableTilt=t,i.scene.screenSpaceCameraController.enableLook=t}}function $t(e,t){if(e&&e.viewer){qt[e.viewer._element.className]||(qt[e.viewer._element.className]={}),qt[e.viewer._element.className].event&&qt[e.viewer._element.className].event.destroy();var i=new vi(e),n=e.viewer._element,s=e.proj,r=function(){switch(l){case"compass":var r=n.getElementsByClassName("compass")[0],c=n.getElementsByClassName("navigation-controls")[0];t[l]?(r&&(r.style.display="block"),c&&(c.style.display="flex")):(r&&(r.style.display="none"),c&&(c.style.display="none"));break;case"legend":var u=n.getElementsByClassName("distance-legend")[0];t[l]?u&&(u.parentNode.style.display="block"):u&&(u.parentNode.style.display="none");break;case"info":var h=n.getElementsByClassName("cesium-info")[0];if(t[l]){var p=function(){var t=o()(a.a.mark((function t(){var n,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Wt){t.next=2;break}return t.abrupt("return");case 2:n=i.cartesian3Towgs84(Wt,e.viewer),"EPSG:4326"===Ut?h.innerHTML="\n <span>经度:</span><span>".concat(Number(n.lng.toFixed(6)),"° </span>\n <span>纬度:</span><span>").concat(Number(n.lat.toFixed(6)),"° </span>\n <span>海拔高度:</span><span>").concat(Number(n.alt.toFixed(2)),"米</span>\n "):(o=s.convert([{x:n.lng,y:n.lat,z:n.alt}],"EPSG:4326",Ut),h.innerHTML="\n <span>x:</span><span>".concat(Number(o.points[0].x.toFixed(6)),'</span>\n <span style="margin-left: 5px;">y:</span><span>').concat(Number(o.points[0].y.toFixed(6)),'</span>\n <span style="margin-left: 5px;">z:</span><span>').concat(Number(o.points[0].z.toFixed(6)),"</span>\n "));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();h?(p(),h.style.display="block"):((h=document.createElement("div")).className="cesium-info",h.style.position="absolute",h.style.bottom="32px",h.style.right="240px",h.style["font-size"]="14px",h.style["background-color"]="rgba(47,53,60,.8)",h.style.color="#fff",h.style.padding="4px 10px",h.style["border-radius"]="18px",h.innerHTML="EPSG:4326"===Ut?"\n <span>经度:</span><span>-</span>\n <span>纬度:</span><span>-</span>\n <span>海拔高度:</span><span>-</span>\n ":"\n <span>x:</span><span>-</span>\n <span>y:</span><span>-</span>\n <span>z:</span><span>-</span>\n ",e.viewer._element.appendChild(h));var d=new K(e);qt[e.viewer._element.className].event=d;d.mouse_move((function(e,t){Wt=t,p()}))}else h&&(h.style.display="none");break;case"frame":t[l]?(e.viewer.scene.debugShowFramesPerSecond=!0,setTimeout((function(){var t=e.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0],i=t.getElementsByClassName("cesium-performanceDisplay-defaultContainer")[0];i&&t.appendChild(i)}),50)):e.viewer.scene.debugShowFramesPerSecond=!1}};for(var l in t)r()}}function ei(e,t){t=t?"billboard_default_url_"+t:"billboard_default_url";var i=p();e.startsWith("http")||(e.includes(":")||i&&(e=new URL(e,i).href));localStorage.setItem(t,e)}function ti(e){return e=e?"billboard_default_url_"+e:"billboard_default_url",localStorage.getItem(e)}function ii(){return Yt}function ni(e){e&&e.viewer&&Xt[e.viewer._element.className]&&(Xt[e.viewer._element.className].animate&&TWEEN.remove(Xt[e.viewer._element.className].animate),Xt[e.viewer._element.className].event&&Xt[e.viewer._element.className].event.destroy(),Qt(e,!0),e.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY))}function oi(e){if(e&&e.entityMap){var t,i=Vt(e.entityMap);try{for(i.s();!(t=i.n()).done;){var n=y()(t.value,2),o=(n[0],n[1]);"TrajectoryMotion"===o.type&&o.viewFollow&&(o.viewFollow=!1)}}catch(e){i.e(e)}finally{i.f()}}}function si(e,t){if(e){var i,n=rt().sdkD;n&&e!==n&&si(n,t);for(var o=0;o<e.viewer.imageryLayers._layers.length;o++)if(e.viewer.imageryLayers._layers[o]._imageryProvider&&e.viewer.imageryLayers._layers[o]._imageryProvider._type&&"flw"===e.viewer.imageryLayers._layers[o]._imageryProvider._type){i=e.viewer.imageryLayers._layers[o];break}i&&e.viewer.imageryLayers.remove(i),t&&e.viewer.imageryLayers.addImageryProvider(new Cesium.TileCoordinatesImageryProviderFlw({tileWidth:128,tileHeight:128}))}}function ai(e){for(var t=!1,i=0;i<e.viewer.imageryLayers._layers.length;i++)if(e.viewer.imageryLayers._layers[i]._imageryProvider&&e.viewer.imageryLayers._layers[i]._imageryProvider._type&&"flw"===e.viewer.imageryLayers._layers[i]._imageryProvider._type){t=!0;break}return t}function ri(e,t){if(e){var i,n=rt().sdkD;n&&e!==n&&ri(n,t);for(var o=0;o<e.viewer.imageryLayers._layers.length;o++)if(e.viewer.imageryLayers._layers[o]._imageryProvider&&e.viewer.imageryLayers._layers[o]._imageryProvider._type&&"jww"===e.viewer.imageryLayers._layers[o]._imageryProvider._type){i=e.viewer.imageryLayers._layers[o];break}i&&e.viewer.imageryLayers.remove(i),t&&e.viewer.imageryLayers.addImageryProvider(new Cesium.TileCoordinatesImageryProviderJww)}}function li(e){for(var t=!1,i=0;i<e.viewer.imageryLayers._layers.length;i++)if(e.viewer.imageryLayers._layers[i]._imageryProvider&&e.viewer.imageryLayers._layers[i]._imageryProvider._type&&"jww"===e.viewer.imageryLayers._layers[i]._imageryProvider._type){t=!0;break}return t}function ci(){return Ut}function ui(){var e=localStorage.getItem("ManageIndexexDBState");return"false"!==e&&Boolean(e)}function hi(e){"boolean"==typeof e?(Cesium.ManageIndexedDB&&Cesium.ManageIndexedDB.SetManageIndexexDBState(e),localStorage.setItem("ManageIndexexDBState",e)):console.error("参数必须为boolean")}function pi(e){!function(e){ut=e}(e),function(e){Ge=e}(e)}function di(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return mi(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)?mi(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function mi(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 fi(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}var vi=function(){return x()((function e(t,i){k()(this,e),this.sdk=t,this.sdk&&(this.name_map=this.sdk.proj.name_map,this.epsg_map=this.sdk.proj.epsg_map,this.convert=this.sdk.proj.convert,this.getAllProjection=this.sdk.proj.getAllProjection,this.projectionIsExists=this.sdk.proj.projectionIsExists,this.degreesToDMS=this.sdk.proj.degreesToDMS,this.dmsToDecimal=this.sdk.proj.dmsToDecimal),this.options=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?fi(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):fi(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},i)}),[{key:"POST",get:function(){return"POST"}},{key:"GET",get:function(){return"GET"}},{key:"degreesToRadians",value:function(e){return turf.degreesToRadians(Number(e))}},{key:"radiansToDegrees",value:function(e){return turf.radiansToDegrees(Number(e))}},{key:"randomString",value:function(e){return Cesium.createGuid()}},{key:"getSourceRootPath",value:function(){var e=document.querySelectorAll("script"),t="";return e.forEach((function(e){if(e.src&&e.src.indexOf("YJEarth.min.js")>-1){var i=e.src.split("/");i.pop(),t=i.join("/")}})),t}},{key:"cartesian3Towgs84",value:function(e,t){var i=t.scene.globe.ellipsoid,n=new Cesium.Cartesian3(e.x,e.y,e.z),o=i.cartesianToCartographic(n),s=Cesium.Math.toDegrees(o.latitude),a=Cesium.Math.toDegrees(o.longitude),r=o.height<0?0:o.height;return{lng:Number(a.toFixed(8)),lat:Number(s.toFixed(8)),alt:Number(r.toFixed(2))}}},{key:"computeDistance",value:(i=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w,k,_,x,E,S,P,D,M,T=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=T.length>0&&void 0!==T[0]?T[0]:[],i=T.length>1&&void 0!==T[1]?T[1]:2,n=T.length>2&&void 0!==T[2]?T[2]:0,!(t.length<2)){e.next=7;break}return e.abrupt("return",0);case 7:o=0,e.t0=n,e.next="0"===e.t0||0===e.t0?11:"1"===e.t0||1===e.t0?13:"2"===e.t0||2===e.t0?15:48;break;case 11:for(s=0;s<t.length-1;s++)r=Cesium.Cartesian3.fromDegrees(t[s].lng,t[s].lat,t[s].alt),l=Cesium.Cartesian3.fromDegrees(t[s+1].lng,t[s+1].lat,t[s+1].alt),c=Cesium.Cartesian3.distance(r,l),o+=c;return e.abrupt("break",49);case 13:for(u=0;u<t.length-1;u++)h=Cesium.Cartesian3.fromDegrees(t[u].lng,t[u].lat,0),p=Cesium.Cartesian3.fromDegrees(t[u+1].lng,t[u+1].lat,0),d=Cesium.Cartesian3.distance(h,p),o+=d;return e.abrupt("break",49);case 15:f=[],t.forEach((function(e){f.push([e.lng,e.lat,e.alt])})),v=turf.lineString(f),g=1e3*turf.length(v),m=g>20?g/20:g,y=this.chunkLine(t,m),b=[],y.forEach((function(e,t){0===t?b=A()(e.geometry.coordinates):b.push(e.geometry.coordinates[1])})),C=[],w=di(b),e.prev=25,w.s();case 27:if((k=w.n()).done){e.next=37;break}return _=k.value,x=b.indexOf(_),e.next=32,this.sampleHeight({lng:_[0],lat:_[1],alt:0},x);case 32:(E=e.sent).position.alt=E.position.alt<0?0:E.position.alt,C.push(E);case 35:e.next=27;break;case 37:e.next=42;break;case 39:e.prev=39,e.t1=e.catch(25),w.e(e.t1);case 42:return e.prev=42,w.f(),e.finish(42);case 45:for(C.length,S=0;S<C.length-1;S++)P=Cesium.Cartesian3.fromDegrees(C[S].position.lng,C[S].position.lat,0),D=Cesium.Cartesian3.fromDegrees(C[S+1].position.lng,C[S+1].position.lat,0),M=Cesium.Cartesian3.distance(P,D),o+=M;return e.abrupt("break",49);case 48:return e.abrupt("break",49);case 49:return e.abrupt("return",o.toFixed(i));case 50:case"end":return e.stop()}}),e,this,[[25,39,42,45]])}))),function(){return i.apply(this,arguments)})},{key:"computeDistance2",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e.length<2)return 0;var n=0;if(i){var o=[];e.forEach((function(e){o.push([e.lng,e.lat,e.alt])}));var s=turf.lineString(o);n=1e3*turf.length(s)}else for(var a=0;a<e.length-1;a++){var r=Cesium.Cartesian3.fromDegrees(e[a].lng,e[a].lat,e[a].alt),l=Cesium.Cartesian3.fromDegrees(e[a+1].lng,e[a+1].lat,e[a+1].alt),c=Cesium.Cartesian3.distance(r,l);n+=c}return n.toFixed(t)}},{key:"sampleHeight",value:(t=o()(a.a.mark((function e(t,i){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sampleHeightMostDetailed([t]);case 2:return n=e.sent,t.alt=n[0].height,e.abrupt("return",{position:t,index:i});case 5:case"end":return e.stop()}}),e,this)}))),function(e,i){return t.apply(this,arguments)})},{key:"computeArea",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(e.length<3)return 0;var i=[];e.forEach((function(e){i.push([e.lng,e.lat])})),i.push(i[0]);var n=turf.polygon([i]),o=turf.tesselate(n);return Number(turf.area(o).toFixed(t))}},{key:"computeSignedArea",value:function(e,t){for(var i=[],n=[],o=0;o<t.length;o++)i.push(t[o].lng,t[o].lat),n.push([t[o].lng,t[o].lat]);var s,a=turf.lineString(n),r=turf.bbox(a),l=Cesium.Math.toRadians(r[2]-r[0]),c=Cesium.Math.toRadians(r[3]-r[1]);s=l>c?l/10:c/10;var u=new Cesium.PolygonGeometry.fromPositions({positions:Cesium.Cartesian3.fromDegreesArray(i),vertexFormat:Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:s}),h=new Cesium.PolygonGeometry.createGeometry(u);if(!h||!h.attributes||!h.attributes.position)return 0;var p=h.indices,d=h.attributes.position.values;function m(t,i){var n=new Cesium.Cartesian3(d[3*i],d[3*i+1],d[3*i+2]);return e.scene.clampToHeight(n)||n}for(var f=0,v=0;v<p.length;v+=3){var g=m(0,p[v]),y=m(0,p[v+1]),b=m(0,p[v+2]),C=Cesium.Cartesian3.subtract(g,y,new Cesium.Cartesian3),w=Cesium.Cartesian3.subtract(b,y,new Cesium.Cartesian3),k=Cesium.Cartesian3.cross(C,w,C);f+=.5*Cesium.Cartesian3.magnitude(k)}return Number(f.toFixed(2))}},{key:"createCircle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{steps:360};Number(t)<=0&&(t=.01);var n=[Number(e.lng),Number(e.lat)],o=turf.circle(n,t/1e3,i).geometry.coordinates[0],s=[];return o.forEach((function(e){s=s.concat(e)})),s}},{key:"createEllipse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{granularity:.1,semiMinorAxis:10,semiMajorAxis:20,bearing:0,height:0};t.granularity||(t.granularity=.1),t.height||(t.height=0),t.semiMinorAxis||(t.semiMinorAxis=1e-5),t.semiMajorAxis||(t.semiMajorAxis=1e-5);var i=new Cesium.EllipseOutlineGeometry({center:Cesium.Cartesian3.fromDegrees(Number(e.lng),Number(e.lat)),semiMajorAxis:Number(t.semiMajorAxis),semiMinorAxis:Number(t.semiMinorAxis),height:Number(t.height),granularity:Cesium.Math.toRadians(t.granularity),rotation:Cesium.Math.toRadians(t.bearing)}),n=Cesium.EllipseOutlineGeometry.createGeometry(i);if(!n||!n.attributes||!n.attributes.position)return[];for(var o=n.attributes.position.values,s=[],a=0;a<o.length;a+=3){var r=new Cesium.Cartesian3(o[a],o[a+1],o[a+2]);s.push(r)}return s}},{key:"rhumbBearing",value:function(e,t){var i=turf.point([e.lng,e.lat]),n=turf.point([t.lng,t.lat]);return turf.rhumbBearing(i,n)}},{key:"computeCenter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[];e.forEach((function(e){t.push(turf.point([e.lng,e.lat]))}));var i=turf.featureCollection(t),n=turf.center(i).geometry.coordinates;return{lng:n[0],lat:n[1]}}},{key:"computeMidpoint",value:function(e,t){var i=turf.point([e.lng,e.lat]),n=turf.point([t.lng,t.lat]),o=turf.midpoint(i,n).geometry.coordinates;return{lng:o[0],lat:o[1]}}},{key:"computeAttackArrow",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.computeArrow(e,0)}},{key:"computePincerArrow",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.computeArrow(e)}},{key:"computeArrow",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(e.length<3)return[];for(var i,n=[],o=0;o<e.length;o++)n.push([e[o].lng,e[o].lat]);i=t?xp.algorithm.doubleArrow(n):xp.algorithm.tailedAttackArrow(n);var s=JSON.stringify(i.polygonalPoint).indexOf("null"),a=[];return-1===s&&(a=i.polygonalPoint),a}},{key:"computeAssemble",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.length<2)return[];e.length;var i=new Array;if(e.forEach((function(e){i.push([e.lng,e.lat])})),2===i.length){var n=P.PlotUtils.mid(i[0],i[1]),o=P.PlotUtils.distance(i[0],n)/.9,s=P.PlotUtils.getThirdPoint(i[0],n,P.Constants.HALF_PI,o,!0);i=[i[0],s,i[1]]}var a=P.PlotUtils.mid(i[0],i[2]);i.push(a,i[0],i[1]);for(var r=[],l=void 0,c=void 0,u=void 0,h=[],p=0;p<i.length-2;p++){l=i[p],c=i[p+1],u=i[p+2];var d=P.PlotUtils.getBisectorNormals(.4,l,c,u);r=r.concat(d)}var m=r.length;r=[r[m-1]].concat(r.slice(0,m-1));for(var f=0;f<i.length-2;f++){l=i[f],c=i[f+1],h=h.concat(A()(l));for(var v=0;v<=P.Constants.FITTING_COUNT;v++){var g=P.PlotUtils.getCubicValue(v/P.Constants.FITTING_COUNT,l,r[2*f],r[2*f+1],c);h=h.concat(A()(g))}h=h.concat(A()(c))}return t?h:Cesium.Cartesian3.fromDegreesArray(h)}},{key:"computeStraightArrow",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.length<2)return[];var i=[e[0].lng,e[0].lat],n=[e[1].lng,e[1].lat];if(e[0].lng===e[1].lng&&e[0].lat===e[1].lat){if(t)return[e[0],e[0],e[0]];var o=Cesium.Cartesian3.fromDegrees(e[0].lng,e[0].lat);return[o,o,o]}for(var s,a=[],r=0;r<e.length;r++)a.push([e[r].lng,e[r].lat]);if(s=xp.algorithm.fineArrow(i,n),t){for(var l=[],c=0;c<s.length;c++){var u=this.cartesian3Towgs84(s[c],this.sdk.viewer);l.push(u.lng,u.lat)}return l}return s}},{key:"getMaterial",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#2ab0c2",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o="",s={7:10,8:3,9:4,10:4,11:4,12:2};switch(i&&(s[t+""]?i.polyline.width=i.polyline.oriWidth+s[t+""]:i.polyline.width=i.polyline.oriWidth),Number(t)){case 1:o=new Cesium.PolylineDashMaterialProperty({color:Cesium.Color.fromCssColorString(e),dashLength:10});break;case 2:o=new Cesium.PolylineGlowMaterialProperty({glowPower:.2,color:Cesium.Color.fromCssColorString(e)});break;case 3:o=new Cesium.PolylineFlowMaterialProperty({color:e,speed:n.rotate?n.speed:0-n.speed,rotate:n.rotate});break;case 4:o=new Cesium.PolylineFlowMultMaterialProperty({color:e,speed:n.rotate?n.speed:0-n.speed,rotate:n.rotate});break;case 5:case 6:var a,r=this;o=new Cesium.FlowDashedLineFlowMaterialProperty({color:e,uType:5==t?0:1,speed:n.rotate?n.speed:0-n.speed,space:n.space,scale:new Cesium.CallbackProperty((function(){if(r.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D){var e=i.polyline.positions.getValue();if(!Cesium.defined(e))return 1;for(var t=0,n=0;n<e.length-1;++n)t+=Cesium.Cartesian3.distance(e[n],e[n+1]);var o=new Cesium.Cartesian2(0,r.sdk.viewer.canvas.clientHeight),s=new Cesium.Cartesian2(r.sdk.viewer.canvas.clientWidth/2,r.sdk.viewer.canvas.clientHeight),l=r.sdk.viewer.scene.pickPosition(o),c=r.sdk.viewer.scene.pickPosition(s);if(l&&c){var u=Cesium.Cartesian3.distance(l,c);a=2*u/t}return a}var h=Ft(),p=h.viewer.entities.getById(r.options.id).polyline.positions.getValue();if(!Cesium.defined(p))return 1;for(var d=0,m=0;m<p.length-1;++m)d+=Cesium.Cartesian3.distance(p[m],p[m+1]);var f=new Cesium.Cartesian2(0,h.viewer.canvas.clientHeight),v=new Cesium.Cartesian2(h.viewer.canvas.clientWidth/2,h.viewer.canvas.clientHeight),g=h.viewer.scene.pickPosition(f),y=h.viewer.scene.pickPosition(v);if(g&&y){var b=Cesium.Cartesian3.distance(g,y);a=2*b/d}return a}))});break;case 7:case 8:case 9:case 10:case 11:case 12:var l={color:e,image:this.getSourceRootPath()+"/img/arrow/".concat(t-6,".png"),space:n.space,speed:n.speed};l.speed=n.rotate?l.speed:0-l.speed,this.getFlowTexture(this,l,i);break;default:o=Cesium.Color.fromCssColorString(e)}return o}},{key:"getFlowTexture",value:function(e,t,i){var n=document.createElement("canvas"),o=n.getContext("2d"),s=new Image;s.src=t.image,s.onload=function(){t.space=Math.max(.1,t.space),t.speed>0||0==t.speed?(n.width=s.width*(t.space+1),n.height=s.height,o.drawImage(s,s.width*(t.space/2),0)):(o.clearRect(0,0,n.width,n.height),n.width=s.width*(t.space+1),n.height=s.height,o.save(),o.translate(n.width/2,n.height/2),o.rotate(Math.PI),o.translate(-n.width/2,-n.height/2),o.drawImage(s,s.width*(t.space/2),0),o.restore());var a=0,r=0;i.polyline.material=new Cesium.LineTextureMaterialProperty({color:t.color,image:n,speed:t.speed,repeat:new Cesium.CallbackProperty((function(){if(e.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D){var o=i.polyline.positions.getValue(e.sdk.viewer.clock.currentTime);if(!Cesium.defined(o))return new Cesium.Cartesian2(1,1);for(var s=0,l=0;l<o.length-1;++l)s+=Cesium.Cartesian3.distance(o[l],o[l+1]);var c,u=s/i.polyline.width.getValue(),h=e.sdk.viewer.camera.positionCartographic.height,p=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),d=e.sdk.viewer.canvas.clientWidth,m=e.sdk.viewer.canvas.clientHeight,f=e.sdk.viewer.scene.camera.getPixelSize(p,d,m);if(f>700){var v=(u*=f/h/(t.space*(n.width/n.height*5)+1))/i.polyline.oriRepeat;i.polyline.oriSpeed=v,i.polyline.oriRepeatX=u,a=v,r=u,c=new Cesium.Cartesian2(u,v||1)}else c=new Cesium.Cartesian2(r||i.polyline.oriRepeatX,a||i.polyline.oriSpeed);return c}var g=Ft(),y=g.viewer.entities.getById(e.options.id),b=y.polyline.positions.getValue(g.viewer.clock.currentTime);if(!Cesium.defined(b))return new Cesium.Cartesian2(1,1);for(var C=0,w=0;w<b.length-1;++w)C+=Cesium.Cartesian3.distance(b[w],b[w+1]);var k,_=C/y.polyline.width.getValue(),x=g.viewer.camera.positionCartographic.height,E=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),S=g.viewer.canvas.clientWidth,P=g.viewer.canvas.clientHeight,D=g.viewer.scene.camera.getPixelSize(E,S,P);if(D>700){var M=(_*=D/x/(t.space*(n.width/n.height*5)+1))/y.polyline.oriRepeat;y.polyline.oriSpeed=M,y.polyline.oriRepeatX=_,a=M,r=_,k=new Cesium.Cartesian2(_,M||1)}else k=new Cesium.Cartesian2(r||y.polyline.oriRepeatX,a||y.polyline.oriSpeed);return k}))});var l=e.getSceenLine(i,t,n);l&&(i.polyline.oriRepeat=l)}}},{key:"getSceenLine",value:function(e,t,i){var n=new Cesium.Cartesian2(0,this.sdk.viewer.canvas.clientHeight),o=new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth/2,this.sdk.viewer.canvas.clientHeight),s=this.sdk.viewer.camera.getPickRay(n),a=this.sdk.viewer.scene.globe.pick(s,this.sdk.viewer.scene),r=this.sdk.viewer.camera.getPickRay(o),l=this.sdk.viewer.scene.globe.pick(r,this.sdk.viewer.scene);if(a&&l){var c=Cesium.Cartesian3.distance(a,l)/e.polyline.width.getValue(),u=this.sdk.viewer.camera.positionCartographic.height,h=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),p=this.sdk.viewer.canvas.clientWidth,d=this.sdk.viewer.canvas.clientHeight,m=this.sdk.viewer.scene.camera.getPixelSize(h,p,d);return m>700?c*=m/u/(t.space*(i.width/i.height*5)+1):c=void 0,this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D?c:Ft().viewer.entities.getById(this.options.id).polyline.oriRepeatX}}},{key:"create_arrow1_picture",value:function(e){var t=new fabric.Canvas("canvas");t.width=150,t.height=75;var i=e,n=new fabric.Polygon([{x:t.width,y:t.height/2},{x:t.width-35,y:t.height},{x:t.width-35,y:t.height-20},{x:t.width/2,y:t.height-20},{x:t.width/2,y:20},{x:t.width-35,y:20},{x:t.width-35,y:0}],{fill:i});return t.add(n),t.toDataURL()}},{key:"create_arrow2_picture",value:function(e){var t=new fabric.Canvas("canvas");t.width=75,t.height=75;var i=e,n=new fabric.Polygon([{x:t.width,y:t.height/2},{x:t.width-35,y:t.height},{x:t.width-35-40,y:t.height},{x:t.width-40,y:t.height/2},{x:t.width-35-40,y:0},{x:t.width-35,y:0}],{fill:i});return t.add(n),t.toDataURL()}},{key:"sampleHeightMostDetailed",value:function(e,t){var i=[];return e.forEach((function(e){i.push(new Cesium.Cartographic.fromDegrees(e.lng,e.lat))})),t?t.viewer.scene.sampleHeightMostDetailed(i):this.sdk.viewer.scene.sampleHeightMostDetailed(i)}},{key:"flyHome",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(pi(0),ni(this.sdk),oi(this.sdk),this.sdk.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE){var t=this.sdk.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE.destination,i=this.sdk.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE.orientation;this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt),orientation:{heading:Cesium.Math.toRadians(i.heading||0),pitch:Cesium.Math.toRadians(i.pitch||0),roll:Cesium.Math.toRadians(i.roll||0)},duration:e})}else this.sdk.viewer.camera.flyHome(e)}},{key:"setPickStatus",value:function(){}},{key:"create_point_buffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{steps:10},n=turf.point([Number(e.lng),Number(e.lat)]),o=turf.buffer(n,Number(t)/1e3,i);return o.geometry.coordinates}},{key:"create_line_buffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(1===e.length)return this.create_point_buffer(e[0],t);if(0===e.length)return!1;var i=[];e.forEach((function(e){i.push([Number(e.lng),Number(e.lat)])}));var n=turf.lineString(i),o=turf.buffer(n,Number(t)/1e3);return o.geometry.coordinates}},{key:"create_area_buffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(1===e.length)return this.create_point_buffer(e[0],t);if(0===e.length)return!1;if(2===e.length)return this.create_line_buffer(e,t);var i=[];e.forEach((function(e){i.push([Number(e.lng),Number(e.lat)])})),i.push(i[0]);var n=turf.polygon([i]),o=turf.buffer(n,Number(t)/1e3);return o.geometry.coordinates}},{key:"cal_envelope",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!(e.length<2)){var t=[];e.forEach((function(e){t.push(turf.point([e.lng,e.lat]))}));var i=turf.featureCollection(t);return turf.envelope(i).geometry.coordinates[0]}console.error("坐标数量不能少于2个")}},{key:"chunkLine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if(e.length<2)return[];var i=[];e.forEach((function(e){i.push([e.lng,e.lat])}));var n=turf.lineString(i),o=turf.lineChunk(n,t/1e3),s=new Map;return o.features.forEach((function(e){e.geometry.coordinates.forEach((function(e){var t=e.join(","),i={lng:e[0],lat:e[1]};s.set(t,i)}))})),o.features}},{key:"billboardAnimation",value:function(e,t){var i=t.id,n=t.offset,o=void 0===n?10:n,s=(t.times,e.entities.getById(i));if(s){var a=Math.PI,r=a/60,l=0,c=this.cartesian3Towgs84(s.position.getValue(),e),u=setInterval((function(){l+=r;var e=o*Math.sin(l)+c.alt;l>a&&(l=0),s.position=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,e)}),30);setTimeout((function(){clearInterval(u),s.position=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt)}),3e3)}}},{key:"calSector",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:25,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:45,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:360,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=turf.point([e.lng,e.lat]),r=turf.sector(a,t/1e3,i,n,{steps:o}).geometry.coordinates,l=[];return r.forEach((function(e){e.forEach((function(e){var t;t=s?{lng:e[0],lat:e[1]}:Cesium.Cartesian3.fromDegrees(e[0],e[1]),l.push(t)}))})),l}},{key:"getClampToHeight",value:(e=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=c.length>1&&void 0!==c[1]?c[1]:[],this.sdk&&this.sdk.viewer){e.next=3;break}return e.abrupt("return",0);case 3:return n=new Cesium.Cartesian3.fromDegrees(t.lng,t.lat),e.prev=4,e.next=7,this.sdk.viewer.scene.clampToHeight(n,i);case 7:if(e.t0=e.sent,e.t0){e.next=10;break}e.t0=n;case 10:o=e.t0,e.next=16;break;case 13:e.prev=13,e.t1=e.catch(4),o=n;case 16:return e.next=18,this.cartesian3Towgs84(o,this.sdk.viewer).alt;case 18:if(s=e.sent,r=0,e.prev=20,!this.sdk.viewer.scene.terrainProvider.availability){e.next=26;break}return e.next=24,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(t.lng,t.lat)]);case 24:(l=e.sent)[0].height&&(r=l[0].height);case 26:e.next=31;break;case 28:e.prev=28,e.t2=e.catch(20),r=0;case 31:if(!(s>r)){e.next=35;break}return e.abrupt("return",Number(s.toFixed(2)));case 35:return e.abrupt("return",Number(r.toFixed(2)));case 36:case"end":return e.stop()}}),e,this,[[4,13],[20,28]])}))),function(t){return e.apply(this,arguments)})},{key:"deepCopyObj",value:function(e){var t=null;if(Array.isArray(e)){t=[];for(var i=0;i<e.length;i++)t[i]=this.deepCopyObj(e[i]);return t}if(e&&"object"===N()(e)){for(var n in t={},e)"earth"!==n&&"Dialog"!==n&&"function"!=typeof e[n]&&(t[n]=this.deepCopyObj(e[n]));return t}return t=e}},{key:"projConvert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};e?X(this.sdk,t):Z()}},{key:"projectionConvert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};e?$(this.sdk,t):ee()}},{key:"exportExcel",value:function(e){var t="<Row>";for(var i in e[0])t+='<Cell><Data ss:Type="String">'.concat(i,"</Data></Cell>");t+="</Row>";for(var n,o='<Worksheet ss:Name="{nameWS}"><Table><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="240"/>{rows}</Table></Worksheet>',s=function(e,t){return e.replace(/{(\w+)}/g,(function(e,i){return t[i]}))},a="",r="",l=0;l<e.length;l++){for(var c in 0==l&&(r+=t),r+="<Row>",e[l])r+=s('<Cell><Data ss:Type="{nameType}">{data}</Data></Cell>',{nameType:"String",data:e[l][c]});r+="</Row>",l>0&&l/6e4%1==0&&(a+=s(o,{rows:r,nameWS:"Sheet"+l}),r="",r+=t)}a+=s(o,{rows:r,nameWS:"Sheet"}),r="",n=s('<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"><DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"><Author>Axel Richter</Author><Created>{created}</Created></DocumentProperties><Styles><Style ss:ID="Currency"><NumberFormat ss:Format="Currency"></NumberFormat></Style><Style ss:ID="Date"><NumberFormat ss:Format="Medium Date"></NumberFormat></Style></Styles>{worksheets}</Workbook>',{created:(new Date).getTime(),worksheets:a});var u,h=document.createElement("A");h.href="data:application/vnd.ms-excel;base64,"+(u=n,window.btoa(unescape(encodeURIComponent(u)))),h.download="矢量数据导出.xls",h.target="_blank",document.body.appendChild(h),h.click(),document.body.removeChild(h)}},{key:"decompressGzip",value:function(e){var t=pako.inflate(e);return(new TextDecoder).decode(t)}},{key:"cmykToRgb",value:function(e){var t=e.c,i=e.m,n=e.y,o=e.k,s={r:0,g:0,b:0};return s.c=t/100,s.m=i/100,s.y=n/100,s.k=o/100,s.r=1-Math.min(1,s.c*(1-s.k)+s.k),s.g=1-Math.min(1,s.m*(1-s.k)+s.k),s.b=1-Math.min(1,s.y*(1-s.k)+s.k),s.r=Math.round(255*s.r),s.g=Math.round(255*s.g),s.b=Math.round(255*s.b),"rgb(".concat(s.r,", ").concat(s.g,", ").concat(s.b,")")}},{key:"convertPxToRem",value:function(e,t){var i=parseFloat(getComputedStyle(document.documentElement).fontSize),n=[],o=[];if(t){n=document.getElementById(e.div_id).querySelectorAll(t);for(var s=0;s<n.length;s++){var a;(a=o).push.apply(a,[n[s]].concat(A()(n[s].querySelectorAll("*"))))}}else o=document.getElementById(e.div_id).querySelectorAll("*");o.forEach((function(e){var t=e.style;Array.from(t).filter((function(e){return"string"==typeof e&&e.endsWith("px")})).forEach((function(n){var o=parseFloat(t[n])/i;e.style[n]="".concat(o,"rem")}))}))}},{key:"isConvex",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.length,i=0,n=0,o=0;o<t;++o){var s=e[(o+1)%t].lng-e[o].lng,a=e[(o+2)%t].lng-e[(o+1)%t].lng,r=e[(o+1)%t].lat-e[o].lat,l=e[(o+2)%t].lat-e[(o+1)%t].lat;if(0!=(n=s*l-a*r)){if(n>0&&i<0||n<0&&i>0)return!1;i=n}}return!0}},{key:"getDateTimeString",value:function(){var e=new Date,t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0"),o=String(e.getHours()).padStart(2,"0"),s=String(e.getMinutes()).padStart(2,"0"),a=String(e.getSeconds()).padStart(2,"0"),r=String(e.getMilliseconds()).padStart(3,"0");return"".concat(t).concat(i).concat(n).concat(o).concat(s).concat(a).concat(r)}},{key:"replaceHost",value:function(e,t){var i=e;if(!e||!t)return e;try{if(e.startsWith("http")){var n=/^[^@]+@/;n.test(e)&&(e=e.replace(n,"")),/^[a-z]+:\/\//i.test(e)||(e="http://"+e);var o=new URL(e),s=new URL(t),a=o.hostname,r=o.port;return a.startsWith("[")&&a.endsWith("]")&&(a=a.slice(1,-1)),"localhost"!==a&&"127.0.0.1"!==a||55110===parseInt(r,10)||(o.port=s.port,o.protocol=s.protocol,i=o.toString()),i}return e.includes(":")||this.options.host&&(i=new URL(e,this.options.host).href),i}catch(e){return i}}},{key:"message",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.type||"success",i=e.text||"",n=(e.duration,document.getElementById("YJ-custom-message"));n&&document.body.removeChild(n),n=document.createElement("div"),n.id="YJ-custom-message","success"==t?n.innerHTML='\n <i><?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755929961282" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5064" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M874.119618 149.859922A510.816461 510.816461 0 0 0 511.997 0.00208a509.910462 509.910462 0 0 0-362.119618 149.857842c-199.817789 199.679789-199.817789 524.581447 0 724.260236a509.969462 509.969462 0 0 0 362.119618 149.857842A508.872463 508.872463 0 0 0 874.119618 874.120158c199.836789-199.679789 199.836789-524.581447 0-724.260236zM814.94268 378.210681L470.999043 744.132295a15.359984 15.359984 0 0 1-5.887994 4.095996c-1.751998 1.180999-2.913997 2.362998-5.276994 2.913997a34.499964 34.499964 0 0 1-13.469986 2.914997 45.547952 45.547952 0 0 1-12.897986-2.303998l-4.095996-2.363997a45.291952 45.291952 0 0 1-7.009992-4.095996l-196.902793-193.789796a34.126964 34.126964 0 0 1-10.555989-25.186973c0-9.37399 3.583996-18.74698 9.98399-25.186974a36.429962 36.429962 0 0 1 50.372947 0l169.98382 167.423824L763.389735 330.220732a37.059961 37.059961 0 0 1 50.371947-1.732998 33.647965 33.647965 0 0 1 11.165988 25.186973 35.544963 35.544963 0 0 1-9.98399 24.575974v-0.04z m0 0" fill="#52C41A" p-id="5065"></path></svg></i>'.concat(i,"\n "):"warning"==t&&(n.innerHTML='\n <i><?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1756093599258" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1648" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M512.002558 64.24521c-247.292176 0-447.75786 200.464661-447.75786 447.756837 0 247.287059 200.464661 447.752744 447.75786 447.752744 247.286036 0 447.75172-200.464661 447.75172-447.752744C959.754279 264.710894 759.288594 64.24521 512.002558 64.24521zM512.010745 735.87586c-20.602224 0-37.319977-16.718777-37.319977-37.323047 0-20.597107 16.717753-37.319977 37.319977-37.319977 20.60427 0 37.297464 16.72287 37.297464 37.319977C549.308209 719.158107 532.613992 735.87586 512.010745 735.87586zM549.308209 567.969733c0 20.600177-16.693194 37.293371-37.297464 37.293371-20.602224 0-37.319977-16.693194-37.319977-37.293371L474.690768 325.420581c0-20.605294 16.717753-37.297464 37.319977-37.297464 20.60427 0 37.297464 16.693194 37.297464 37.297464L549.308209 567.969733z" fill="#e98f36" p-id="1649"></path></svg></i>'.concat(i,"\n ")),document.body.appendChild(n),n.classList.add(t)}},{key:"pointDistance",value:function(e,t){var i=Cesium.Cartesian3.fromDegrees(e.lng,e.lat),n=Cesium.Cartesian3.fromDegrees(t,t);return Cesium.Cartesian3.distance(n,i)}}],[{key:"_md5",value:function(e){return I()(e).toUpperCase()}}]);var e,t,i}();function gi(e,t){var i=e.viewer;if(i)for(var n=0;n<i.dataSources._dataSources.length;n++)if("sdk-dataSource1"===i.dataSources._dataSources[n].name){i.dataSources._dataSources[n].entities.add(t);break}}function yi(e,t){for(var i=0;i<e.dataSources._dataSources.length;i++)if("sdk-dataSource1"===e.dataSources._dataSources[i].name){e.dataSources._dataSources[i].entities.remove(t);break}}function bi(){function e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e.color,this.duration=e.duration,this.fltr=e.fltr,this.image=e.image,this._time=(new Date).getTime()}Object.defineProperties(e.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:Cesium.createPropertyDescriptor("repeat"),color:Cesium.createPropertyDescriptor("color")}),e.prototype.getType=function(e){return"PolylineTrailLink"},e.prototype.getValue=function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.BROWN,t.color),this.image?t.image=this.image:t.image=Cesium.Material.PolylineTrailLinkImage,this.duration&&(t.time=((new Date).getTime()-this._time)%this.duration/this.duration),!1===this.fltr?t.fltr=this.fltr:t.fltr=!0,t},e.prototype.equals=function(t){return this===t||t instanceof e&&Cesium.Property.equals(this._color,t._color)},Cesium.PolylineTrailLinkMaterialProperty=e,Cesium.Material.PolylineTrailLinkType="PolylineTrailLink",Cesium.Material.PolylineTrailLinkImage=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#fa2020",t=512,i=32,n=new fabric.Canvas("canvas",{width:t,height:i}),o=new fabric.Rect({width:t,height:i}),s=new fabric.Gradient({type:"linear",gradientUnits:"pixels",coords:{x1:0,y1:0,x2:t,y2:0},colorStops:[{offset:.01,color:"rgba(246,241,241,0)"},{offset:1,color:e}]});return o.set("fill",s),n.add(o),n.toDataURL()}(),Cesium.Material.PolylineTrailLinkSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material =czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec4 colorImage = texture(image,vec2(fract(st.t - time), st.t));\n vec4 fragColor;\n fragColor.rgb = color.rgb / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.alpha = colorImage.a * color.a;\n material.diffuse = color.rgb/20.0;\n material.emission = fragColor.rgb;\n return material;\n }",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineTrailLinkType,{fabric:{type:Cesium.Material.PolylineTrailLinkType,uniforms:{color:new Cesium.Color(1,1,1,1),image:Cesium.Material.PolylineTrailLinkImage,time:0},source:Cesium.Material.PolylineTrailLinkSource},translucent:function(e){return!0}})}function Ci(){var e,t,i,n,o,s,a,r;bi(),e=new vi,"undefined"!=typeof Cesium&&function(t){t.CustomMaterialSource=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(t.Color,t.defaultValue),o=Object.defineProperties,s=t.Event,a=t.createPropertyDescriptor,r=t.Property,l=t.Material,c=i.MaterialType||"wallType"+parseInt(1e3*Math.random()),u={color:new t.Color(1,1,1,1),image:i.image||e.getSourceRootPath()+"/img/material/arrow.png",time:i.time||0,repeat:new t.Cartesian2(100,100),fltr:!i.fltr&&!1!==i.fltr||i.fltr,is2D:!!i.is2D,isTranslucent:!i.isTranslucent&&!1!==i.isTranslucent||i.isTranslucent};if(this.code="",i.repeats)for(var h=t.Property.getValueOrDefault(i.repeats),p=0;p<h.length;p++)0!==p&&(this.code+="else "),u["repeat"+(p+1)]=new t.Cartesian2(h[p][1]*(h.length+3*(h.length-1)),h[p][2]),this.code+="if(materialInput.st.s < ".concat(h[p][0],") {\n repeat0 = repeat").concat(p+1,";\n }");function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=n(e,n.EMPTY_OBJECT),this._definitionChanged=new s,this._color=void 0,this._colorSubscription=void 0,this._repeat=void 0,this._repeats=void 0,this._repeatSubscription=void 0,this.image=e.image,this.is2D=!!e.is2D,this.color=new t.Color.fromCssColorString(e.color||"rgba(4,253,231,0.87)"),this.repeat=e.repeat,this.repeats=e.repeats,this.duration=e.duration||0===e.duration?e.duration:1e3,this.fltr=!e.fltr&&!1!==e.fltr||e.fltr,this._time=(new Date).getTime()}return o(d.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:t.createPropertyDescriptor("repeat"),color:a("color")}),d.prototype.getType=function(e){return c},d.prototype.getValue=function(e,i){if(t.defined(i)||(i={}),i.color=t.Property.getValueOrClonedDefault(this._color,e,t.Color.WHITE,i.color),i.time=this.duration?t.getTimestamp()%this.duration/this.duration:0,i.image=this.image,i.is2D=!!this.is2D,this.repeat&&(i.repeat=t.Property.getValueOrDefault(this.repeat)),this.repeats)for(var n=t.Property.getValueOrDefault(this.repeats),o=0;o<n.length;o++)i["repeat"+(o+1)]=new t.Cartesian2(n[o][1]*(n.length+3*(n.length-1)),n[o][2]);return i},d.prototype.equals=function(e){return this===e||e instanceof d&&r.equals(this._color,e._color)&&r.equals(this.repeat,e._repeat)&&r.equals(this.repeats,e._repeats)},l._materialCache.addMaterial(c,{fabric:{type:c,uniforms:u,source:"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n // vec2 repeat1 = materialInput.st.s < 0.5 ? vec2(100.0, 1.0) : vec2(200.0, 1.0);\n vec2 repeat0 = repeat;\n "+this.code+";\n vec2 st = repeat0 * materialInput.st;\n float f = -1.0;\n if(fltr==true) { f = 1.0; } \n vec4 colorImage = texture(image, vec2(fract(st.s - (time * f)), st.t));\n if(isTranslucent) {\n material.alpha = colorImage.a * color.a;\n }\n else {\n material.alpha = 1.0;\n }\n material.diffuse = colorImage.rgb * color.rgb*0.0;\n material.emission = colorImage.rgb * color.rgb * 1.0;\n return material;\n }",components:{specular:10,diffuse:"vec3(1.0)"}},translucent:function(e){return e.uniforms.isTranslucent}}),new d(i)}}(Cesium),t=function(){function e(t){k()(this,e),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this.color=t.color,this.speed=t.speed,this.transparency=t.transparency}return x()(e,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(e){return Cesium.Material.RadarScanMaterialType}},{key:"getValue",value:function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrDefault(this._color,e,Cesium.Color.RED,t.color),t.speed=Cesium.Property.getValueOrDefault(this._speed,e,10,t.speed),t.transparency=this.transparency,t.frameNumber=Cesium.getTimestamp(),t}},{key:"equals",value:function(t){return this===t||t instanceof e&&Cesium.Property.equals(this._color,t._color)&&Cesium.Property.equals(this._speed,t._speed)&&Cesium.Property.equals(this.transparency,t.transparency)}}])}(),Object.defineProperties(t.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),transparency:Cesium.createPropertyDescriptor("transparency")}),Cesium.RadarScanMaterialProperty=t,Cesium.Material.RadarScanMaterialProperty="RadarScanMaterialProperty",Cesium.Material.RadarScanMaterialType="RadarScanMaterialType",Cesium.Material.RadarScanMaterialSource="\n uniform vec4 color;\n uniform float speed;\n uniform float transparency;\n uniform float frameNumber;\n \n #define PI 3.14159265359\n \n czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec2 scrPt = st * 2.0 - 1.0;\n float time = frameNumber * speed / 30000.0 ;\n vec3 col = vec3(0.0);\n mat2 rot;\n float theta = -time * 1.0 * PI - 2.2;\n float cosTheta, sinTheta;\n cosTheta = cos(theta);\n sinTheta = sin(theta);\n rot[0][0] = cosTheta;\n rot[0][1] = -sinTheta;\n rot[1][0] = sinTheta;\n rot[1][1] = cosTheta;\n vec2 scrPtRot = rot * scrPt;\n float angle = 1.0 - (atan(scrPtRot.y, scrPtRot.x) / 6.2831 + 0.5);\n float falloff = length(scrPtRot);\n material.alpha = pow(length(col + vec3(.5)),5.0) * transparency * 0.6;\n material.diffuse = (0.5 + pow(angle, 2.0) * falloff ) * color.rgb ;\n return material;\n }\n \n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.RadarScanMaterialType,{fabric:{type:Cesium.Material.RadarScanMaterialType,uniforms:{color:new Cesium.Color(1,0,0,1),speed:10,transparency:1,frameNumber:Cesium.getTimestamp()},source:Cesium.Material.RadarScanMaterialSource},translucent:function(e){return!0}}),new vi,"undefined"!=typeof Cesium&&function(e){e.CustomColorMaterialSource=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=(e.Color,e.defaultValue),n=Object.defineProperties,o=e.Event,s=e.createPropertyDescriptor,a=e.Property,r=e.Material,l=t.MaterialType||"wallType"+parseInt(1e3*Math.random());function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=i(t,i.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this.color=new e.Color.fromCssColorString(t.color||"rgba(4,253,231,0.87)")}return n(c.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:s("color")}),c.prototype.getType=function(e){return l},c.prototype.getValue=function(t,i){return e.defined(i)||(i={}),i.color=e.Property.getValueOrClonedDefault(this._color,t,e.Color.WHITE,i.color),i},c.prototype.equals=function(e){return this===e||e instanceof c&&a.equals(this._color,e._color)},r._materialCache.addMaterial(l,{fabric:{type:l,uniforms:{color:new e.Color(1,1,1,1)},source:"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.alpha = color.a;\n \n material.diffuse = color.rgb*0.0;\n material.emission = color.rgb;\n return material;\n }",components:{specular:1,diffuse:"vec3(0.0)"}},translucent:function(e){return!0}}),new c(t)}}(Cesium),function(){var e=new vi;"undefined"!=typeof Cesium&&function(t){t.CustomImageMaterialSource=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(t.Color,t.defaultValue),o=Object.defineProperties,s=t.Event,a=t.createPropertyDescriptor,r=t.Property,l=t.Material,c=i.MaterialType||"wallType"+parseInt(1e3*Math.random());function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=n(e,n.EMPTY_OBJECT),this._definitionChanged=new s,this._color=void 0,this._colorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.image=e.image,this.color=new t.Color.fromCssColorString(e.color||"rgba(4,253,231,0.87)"),this.repeat=e.repeat}return o(u.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:t.createPropertyDescriptor("repeat"),color:a("color")}),u.prototype.getType=function(e){return c},u.prototype.getValue=function(e,i){return t.defined(i)||(i={}),i.color=t.Property.getValueOrClonedDefault(this._color,e,t.Color.WHITE,i.color),i.image=this.image,i.repeat=t.Property.getValueOrDefault(this.repeat),i},u.prototype.equals=function(e){return this===e||e instanceof u&&r.equals(this._color,e._color)&&r.equals(this.repeat,e._repeat)},l._materialCache.addMaterial(c,{fabric:{type:c,uniforms:{color:new t.Color(1,1,1,1),image:i.image||e.getSourceRootPath()+"/img/material/arrow.png",repeat:new t.Cartesian2(100,100)},source:"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = repeat * materialInput.st;\n vec4 colorImage = texture(image, st);\n \n material.diffuse = colorImage.rgb * 0.0;\n material.emission = colorImage.rgb * 0.3;\n return material;\n }"}}),new u(i)}}(Cesium)}(),i=function(){function e(t){k()(this,e),this._definitionChanged=new Cesium.Event,this._color=void 0,this._duration=void 0,this.color=new Cesium.Color.fromCssColorString(t.color||"rgba(255,255,255,1)"),this.duration=t.duration||10,this.lineBackAlpha=t.lineBackAlpha||.05}return x()(e,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(e){return Cesium.Material.FlowLineMaterialType}},{key:"getValue",value:function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrDefault(this._color,e,Cesium.Color.RED,t.color),t.duration=Cesium.Property.getValueOrDefault(this._duration,e,10,t.duration),t.lineBackAlpha=this.lineBackAlpha,t.frameNumber=Cesium.getTimestamp(),t}},{key:"equals",value:function(t){return this===t||t instanceof e&&Cesium.Property.equals(this._color,t._color)&&Cesium.Property.equals(this._duration,t.duration)&&Cesium.Property.equals(this.lineBackAlpha,t.lineBackAlpha)}}])}(),Object.defineProperties(i.prototype,{color:Cesium.createPropertyDescriptor("color"),duration:Cesium.createPropertyDescriptor("duration"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha")}),Cesium.FlowLineMaterialProperty=i,Cesium.Material.FlowLineMaterialProperty="FlowLineMaterialProperty",Cesium.Material.FlowLineMaterialType="FlowLineMaterialType",Cesium.Material.FlowLineMaterialSource="\n uniform vec4 color;\n uniform float duration;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n //生成默认的基础材质\n czm_material material = czm_getDefaultMaterial(materialInput);\n //获取st(uv)\n vec2 st = materialInput.st;\n //获取当前帧数,10秒内变化0-1\n float time = fract(czm_frameNumber / (60.0*duration));\n //长度1/10\n time = time * (1.0 + 0.1);\n //平滑过渡函数\n float alpha = smoothstep(time-0.1,time,st.s) * step(-time,-st.s);\n //光带轨迹(不会完全透明)\n alpha += lineBackAlpha;\n material.alpha = alpha;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.FlowLineMaterialType,{fabric:{type:Cesium.Material.FlowLineMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),duration:10,lineBackAlpha:.05},source:Cesium.Material.FlowLineMaterialSource},translucent:function(e){return!0}}),n=function(){function e(t){k()(this,e),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this._rotate=void 0,this.color=new Cesium.Color.fromCssColorString(t.color||"rgba(255,255,255,1)"),this.speed=null!=t.speed?t.speed:1,this.lineBackAlpha=t.lineBackAlpha||.05,this.rotate=t.rotate}return x()(e,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(e){return Cesium.Material.PolylineFlowMaterialType}},{key:"getValue",value:function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrDefault(this._color,e,Cesium.Color.RED,t.color),t.speed=Cesium.Property.getValueOrDefault(this._speed,e,10,t.speed),t.rotate=Cesium.Property.getValueOrDefault(this._rotate,e,!0,t.rotate),t.lineBackAlpha=this.lineBackAlpha,t.frameTime=Cesium.getTimestamp(),t}},{key:"equals",value:function(t){return this===t||t instanceof e&&Cesium.Property.equals(this._color,t._color)&&Cesium.Property.equals(this._speed,t.speed)&&Cesium.Property.equals(this.lineBackAlpha,t.lineBackAlpha)}}])}(),Object.defineProperties(n.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),rotate:Cesium.createPropertyDescriptor("rotate"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha")}),Cesium.PolylineFlowMaterialProperty=n,Cesium.Material.PolylineFlowMaterialProperty="PolylineFlowMaterialProperty",Cesium.Material.PolylineFlowMaterialType="PolylineFlowMaterialType",Cesium.Material.PolylineFlowMaterialSource="\n uniform vec4 color;\n uniform float speed;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n //生成默认的基础材质\n czm_material material = czm_getDefaultMaterial(materialInput);\n //获取st(uv)\n vec2 st = materialInput.st;\n //获取当前帧数,10秒内变化0-1\n // float time = fract(czm_frameNumber * speed / 60.0);\n // float time = fract(abs(speed) * czm_frameNumber * 0.01);\n float time = fract(frameTime / 1000.0 / abs(speed));\n //长度1/10\n // time = time * (1.0 + 0.1);\n float staticAlpha = rotate?smoothstep(0.0,1.0, 1.0-st.s) * step(-1.0,-(1.0-st.s)):smoothstep(0.0,1.0, st.s) * step(-1.0,-st.s);\n\n //平滑过渡函数\n float alpha1 = smoothstep(time-0.1,time,1.0-st.s) * step(-time,- (1.0-st.s));\n float alpha2 = smoothstep(time-0.1,time,st.s) * step(-time,- st.s);\n float alpha =(speed== 0.0)? staticAlpha:(speed < 0.0)?alpha2:alpha1;\n //光带轨迹(不会完全透明)\n alpha += lineBackAlpha;\n material.alpha = alpha;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineFlowMaterialType,{fabric:{type:Cesium.Material.PolylineFlowMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),speed:.1,rotate:!0,frameTime:Cesium.getTimestamp(),lineBackAlpha:.05},source:Cesium.Material.PolylineFlowMaterialSource},translucent:function(e){return!0}}),o=function(){function e(t){k()(this,e),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this._rotate=void 0,this.color=new Cesium.Color.fromCssColorString(t.color||"rgba(255,255,255,1)"),this.speed=null!=t.speed?t.speed:1,this.lineBackAlpha=t.lineBackAlpha||.05,this.rotate=t.rotate}return x()(e,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(e){return Cesium.Material.PolylineFlowMultMaterialType}},{key:"getValue",value:function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrDefault(this._color,e,Cesium.Color.RED,t.color),t.speed=Cesium.Property.getValueOrDefault(this._speed,e,10,t.speed),t.rotate=Cesium.Property.getValueOrDefault(this._rotate,e,!0,t.rotate),t.lineBackAlpha=this.lineBackAlpha,t.frameTime=Cesium.getTimestamp(),t}},{key:"equals",value:function(t){return this===t||t instanceof e&&Cesium.Property.equals(this._color,t._color)&&Cesium.Property.equals(this._speed,t.speed)&&Cesium.Property.equals(this._rotate,t.rotate)&&Cesium.Property.equals(this.lineBackAlpha,t.lineBackAlpha)}}])}(),Object.defineProperties(o.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),rotate:Cesium.createPropertyDescriptor("rotate"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha")}),Cesium.PolylineFlowMultMaterialProperty=o,Cesium.Material.PolylineFlowMultMaterialProperty="PolylineFlowMultMaterialProperty",Cesium.Material.PolylineFlowMultMaterialType="PolylineFlowMultMaterialType",Cesium.Material.PolylineFlowMaterialSource="\n uniform vec4 color;\n uniform float speed;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n\n // 基础时间轴(控制主光带)\n float baseTime = fract(czm_frameNumber * speed / 60.0) * 1.1;\n\n // 高频时间轴(控制高光点)\n // float highlightTime = fract(czm_frameNumber * speed * 3.0 / 60.0);\n // float highlightTime = fract(abs(speed) * czm_frameNumber * 0.01);\n float highlightTime = fract(frameTime / 1000.0 / abs(speed));\n float highlightSpacing = 0.3; // 高光点间隔\n\n // 主光带透明度计算\n float mainAlpha = smoothstep(baseTime-0.1, baseTime, st.s) * step(-baseTime, -st.s);\n\n // 多高光点计算(3个周期性光斑)\n float highlight11 = smoothstep(highlightTime-0.05, highlightTime, st.s) *\n step(-highlightTime, -st.s) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(st.s - highlightTime)));\n\n float highlight21 = smoothstep(highlightTime+highlightSpacing-0.05,\n highlightTime+highlightSpacing, st.s) *\n step(-(highlightTime+highlightSpacing), -st.s) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(st.s - (highlightTime+highlightSpacing))));\n\n float highlight31 = smoothstep(highlightTime+2.0*highlightSpacing-0.05,\n highlightTime+2.0*highlightSpacing, st.s) *\n step(-(highlightTime+2.0*highlightSpacing), -st.s) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(st.s - (highlightTime+2.0*highlightSpacing))));\n\n\n float highlight12 = smoothstep(highlightTime-0.05, highlightTime, 1.0 - st.s) *\n step(-highlightTime, -(1.0-st.s)) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(1.0 - st.s - highlightTime)));\n\n float highlight22 = smoothstep(highlightTime+highlightSpacing-0.05,\n highlightTime+highlightSpacing, 1.0 - st.s) *\n step(-(highlightTime+highlightSpacing),-(1.0 - st.s)) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(1.0-st.s - (highlightTime+highlightSpacing))));\n\n float highlight32 = smoothstep(highlightTime+2.0*highlightSpacing-0.05,\n highlightTime+2.0*highlightSpacing, 1.0 - st.s) *\n step(-(highlightTime+2.0*highlightSpacing), -(1.0-st.s)) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(1.0 - st.s - (highlightTime+2.0*highlightSpacing))));\n\n\n float highlight1 = !rotate?highlight11:highlight12;\n float highlight2 = !rotate?highlight21:highlight22;\n float highlight3 = !rotate?highlight31:highlight32;\n // 合并效果\n // material.alpha = mainAlpha * 0.7 +\n // (highlight1 + highlight2 + highlight3) * 0.5 +\n // lineBackAlpha;\n material.alpha = (highlight1 + highlight2 + highlight3) * 0.5 +\n lineBackAlpha;\n material.diffuse = color.rgb; // 高光区变亮\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineFlowMultMaterialType,{fabric:{type:Cesium.Material.PolylineFlowMultMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),speed:.1,rotate:!0,frameTime:Cesium.getTimestamp(),lineBackAlpha:.05},source:Cesium.Material.PolylineFlowMaterialSource},translucent:function(e){return!0}}),s=function(){function e(t){k()(this,e),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this._uType=void 0,this._space=void 0,this._dashSize=void 0,this._scale=void 0,this.color=new Cesium.Color.fromCssColorString(t.color||"rgba(255,255,255,1)"),this.speed=null!=t.speed?t.speed:1,this.space=t.space||0,this.dashSize=t.dashSize||.03,this.uType=void 0===t.uType?1:t.uType,this.lineBackAlpha=t.lineBackAlpha||.05,this.scale=t.scale||1}return x()(e,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(e){return Cesium.Material.FlowDashedLineMaterialType}},{key:"getValue",value:function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrDefault(this._color,e,Cesium.Color.RED,t.color),t.speed=Cesium.Property.getValueOrDefault(this._speed,e,10,t.speed),t.space=Cesium.Property.getValueOrDefault(this._space,e,10,t.space),t.dashSize=Cesium.Property.getValueOrDefault(this._dashSize,e,10,t.dashSize),t.uType=Cesium.Property.getValueOrDefault(this._uType,e,1,t.uType),t.scale=Cesium.Property.getValueOrDefault(this._scale,e,1,t.scale),t.lineBackAlpha=this.lineBackAlpha,t.frameNumber=Cesium.getTimestamp(),t}},{key:"equals",value:function(t){return this===t||t instanceof e&&Cesium.Property.equals(this._color,t._color)&&Cesium.Property.equals(this._speed,t.speed)&&Cesium.Property.equals(this._uType,t.uType)&&Cesium.Property.equals(this._lineBackAlpha,t.lineBackAlpha)&&Cesium.Property.equals(this._scale,t.scale)}}])}(),Object.defineProperties(s.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),space:Cesium.createPropertyDescriptor("space"),dashSize:Cesium.createPropertyDescriptor("dashSize"),uType:Cesium.createPropertyDescriptor("uType"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha"),scale:Cesium.createPropertyDescriptor("scale")}),Cesium.FlowDashedLineFlowMaterialProperty=s,Cesium.Material.FlowDashedLineFlowMaterialProperty="FlowDashedLineFlowMaterialProperty",Cesium.Material.FlowDashedLineMaterialType="FlowDashedLineMaterialType",Cesium.Material.FlowDashedLineMaterialSource="\n uniform vec4 color;\n uniform float speed;\n // uniform int uType;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n\n float dashSize = 0.1;\n float gapSize = space;\n // speed现在表示完成一次完整动画循环的秒数\n float progress = speed==0.0 ? 0.0 : fract(frameNumber / 1000.0 / speed * scale);\n float pattern = fract(st.x / dashSize * (1.0 + gapSize) + progress / dashSize * (1.0 + gapSize));\n float dash1 = step(0.0, pattern) - step(1.0/(1.0 + gapSize), pattern);\n float dash2 = smoothstep(0.0, 0.2, pattern) -\n smoothstep(1.0/(1.0 + gapSize),\n 1.0/(1.0 + gapSize) + 0.2,\n pattern);\n float dash = (float(uType) != 1.0)?dash1:dash2;\n material.alpha = dash;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.FlowDashedLineMaterialType,{fabric:{type:Cesium.Material.FlowDashedLineMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),speed:1,space:0,scale:1,dashSize:.03,frameNumber:Cesium.getTimestamp(),uType:1,lineBackAlpha:.05},source:Cesium.Material.FlowDashedLineMaterialSource},translucent:function(e){return!0}}),a=function(){function e(t){k()(this,e),this._definitionChanged=new Cesium.Event,this._image=void 0,this._color=void 0,this._speed=void 0,this._repeat=void 0,this.image=t.image||"",this.color=new Cesium.Color.fromCssColorString(t.color||"rgba(255,255,255,1)"),this.speed=null!=t.speed?t.speed:1,this.repeat=t.repeat||new Cesium.Cartesian2(1,1)}return x()(e,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(e){return Cesium.Material.LineTextureMaterialType}},{key:"getValue",value:function(e,t){return Cesium.defined(t)||(t={}),t.image=Cesium.Property.getValueOrDefault(this._image,e,"",t.image),t.color=Cesium.Property.getValueOrDefault(this._color,e,Cesium.Color.RED,t.color),t.speed=Cesium.Property.getValueOrDefault(this._speed,e,1,t.speed),t.repeat=Cesium.Property.getValueOrDefault(this._repeat,e,new Cesium.Cartesian2(1,1),t.repeat),t.frameNumber=Cesium.getTimestamp(),t}},{key:"equals",value:function(t){return this===t||t instanceof e&&Cesium.Property.equals(this._image,t._image)&&Cesium.Property.equals(this._color,t._color)&&Cesium.Property.equals(this._imageW,t._imageW)&&Cesium.Property.equals(this._speed,t._speed)}}])}(),Object.defineProperties(a.prototype,{image:Cesium.createPropertyDescriptor("image"),color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),repeat:Cesium.createPropertyDescriptor("repeat")}),Cesium.LineTextureMaterialProperty=a,Cesium.Material.LineTextureMaterialProperty="LineTextureMaterialProperty",Cesium.Material.LineTextureMaterialType="LineTextureMaterialType",Cesium.Material.LineTextureMaterialSource="\n uniform vec4 color;\n uniform sampler2D image;\n uniform float speed;\n // uniform float repeat;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n st.s *= repeat.x; // 关键:通过repeat控制纹理密度\n // vec4 colorImage = texture2D(image, vec2(fract(st.s + speed*czm_frameNumber* 0.01), st.t));\n vec4 colorImage = speed==0.0?texture2D(image, vec2(fract(st.s), st.t)):texture2D(image, vec2(fract(st.s + frameNumber / 1000.0 / speed * repeat.x / repeat.y ), st.t));\n material.alpha = colorImage.a * color.a;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.LineTextureMaterialType,{fabric:{type:Cesium.Material.LineTextureMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),image:"",repeat:new Cesium.Cartesian2(1,1),speed:1,frameNumber:Cesium.getTimestamp(),uTime:1},source:Cesium.Material.LineTextureMaterialSource},translucent:function(e){return!0}}),r=function(){function e(t){k()(this,e),this._definitionChanged=new Cesium.Event,this._image=void 0,this._repeat=void 0,this._stRotation=void 0,this._repeatLength=void 0,this.image=t.image||"",this.repeat=t.repeat||1,this.stRotation=t.stRotation||0}return x()(e,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(e){return Cesium.Material.RoadTextureMaterialType}},{key:"getValue",value:function(e,t){return Cesium.defined(t)||(t={}),t.image=Cesium.Property.getValueOrDefault(this._image,e,"",t.image),t.repeat=Cesium.Property.getValueOrDefault(this._repeat,e,1,t.repeat),t.stRotation=Cesium.Property.getValueOrDefault(this._stRotation,e,0,t.stRotation),console.log(t,"result"),t}},{key:"equals",value:function(t){return this===t||t instanceof e&&Cesium.Property.equals(this._image,t._image)&&Cesium.Property.equals(this._repeat,t._repeat)&&Cesium.Property.equals(this._stRotation,t._stRotation)}}])}(),Object.defineProperties(r.prototype,{image:Cesium.createPropertyDescriptor("image"),repeat:Cesium.createPropertyDescriptor("repeat"),repeatLength:Cesium.createPropertyDescriptor("stRotation")}),Cesium.RoadTextureMaterialProperty=r,Cesium.Material.RoadTextureMaterialProperty="RoadTextureMaterialProperty",Cesium.Material.RoadTextureMaterialType="RoadTextureMaterialType",Cesium.Material.RoadTextureMaterialSource="\n uniform sampler2D image;\n uniform float repeat;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n st.s *= repeat;\n mat2 rot = mat2(cos(stRotation), -sin(stRotation), sin(stRotation), cos(stRotation));\n vec2 newSt = rot * (st - 0.5) + 0.5;\n\n vec4 colorImage = texture2D(image, newSt);\n material.diffuse = colorImage.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.RoadTextureMaterialType,{fabric:{type:Cesium.Material.RoadTextureMaterialType,uniforms:{image:"",repeat:1,stRotation:0},source:Cesium.Material.RoadTextureMaterialSource},translucent:function(e){return!0}})}var wi=function(){return x()((function e(t,i){k()(this,e),this.dom=t,this.playerUrl=i.url,this.init()}),[{key:"init",value:function(){this.flvPlayer=flvjs.createPlayer({type:"flv",url:this.playerUrl,isLive:!0,hasAudio:!1,hasVideo:!0},{enableWorker:!0,enableStashBuffer:!1,stashInitialSize:128}),this.flvPlayer.attachMediaElement(this.dom),this.flvPlayer.load()}},{key:"on",value:function(e,t,i){this.flvPlayer.on(flvjs[e][t],i)}},{key:"destroy",value:function(){this.flvPlayer.destroy(),this.flvPlayer=null}}])}(),ki=function(){return x()((function e(t,i){k()(this,e),this.dom=t,this.url=i.url,this.init()}),[{key:"init",value:function(){this.player=new Jessibuca({container:this.dom,decoder:this.getSourceRootPath()+"/3rdparty/jessibuca/decoder.js",timeout:30,heartTimeout:30,heartTimeoutReplay:!1,loadingTimeout:30,loadingTimeoutReplay:!1,wasmDecodeErrorReplay:!1,videoBuffer:.2,isResize:!1,text:"",loadingText:"",useMSE:!1,debug:!0,showBandwidth:!1,operateBtns:{fullscreen:!1,screenshot:!1,play:!1,audio:!1,recorder:!1},forceNoOffscreen:!1,isNotMute:!1}),this.player.play(this.url)}},{key:"on",value:function(e,t){this.player.on(e,t)}},{key:"destroy",value:function(){this.player.destroy(),this.player=null}},{key:"getSourceRootPath",value:function(){var e=document.querySelectorAll("script"),t="";return e.forEach((function(e){if(e.src&&e.src.indexOf("YJEarth.min.js")>-1){var i=e.src.split("/");i.pop(),t=i.join("/")}})),t}}])}();function _i(e,t,i){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,i)}function xi(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var Ei=/^[og]\s*(.+)?/,Si=/^mtllib /,Pi=/^usemtl /,Di=/^usemap /,Mi=/\s+/,Ti={red:1,green:1,blue:1,alpha:1};function Oi(){var e={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=e,void(this.object.fromDeclaration=!1!==t);var i=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:!1!==t,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(e,t){var i=this._finalize(!1);i&&(i.inherited||i.groupCount<=0)&&this.materials.splice(i.index,1);var n={index:this.materials.length,name:e||"",mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:void 0!==i?i.smooth:this.smooth,groupStart:void 0!==i?i.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){var t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(n),n},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){var t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var i=this.materials.length-1;i>=0;i--)this.materials[i].groupCount<=0&&this.materials.splice(i,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},i&&i.name&&"function"==typeof i.clone){var n=i.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){var i=parseInt(e,10);return 3*(i>=0?i-1:i+t/3)},parseNormalIndex:function(e,t){var i=parseInt(e,10);return 3*(i>=0?i-1:i+t/3)},parseUVIndex:function(e,t){var i=parseInt(e,10);return 2*(i>=0?i-1:i+t/2)},addVertex:function(e,t,i){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[e+0],n[e+1],n[e+2]),o.push(n[t+0],n[t+1],n[t+2]),o.push(n[i+0],n[i+1],n[i+2])},addVertexPoint:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,i){var n=this.normals,o=this.object.geometry.normals;o.push(n[e+0],n[e+1],n[e+2]),o.push(n[t+0],n[t+1],n[t+2]),o.push(n[i+0],n[i+1],n[i+2])},addFaceNormal:function(e,t,i){console.warn("addFaceNormal")},addColor:function(e,t,i){var n=this.colors,o=this.object.geometry.colors;void 0!==n[e]&&o.push(n[e+0],n[e+1],n[e+2]),void 0!==n[t]&&o.push(n[t+0],n[t+1],n[t+2]),void 0!==n[i]&&o.push(n[i+0],n[i+1],n[i+2])},addUV:function(e,t,i){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[e+0],n[e+1]),o.push(n[t+0],n[t+1]),o.push(n[i+0],n[i+1])},addDefaultUV:function(){var e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){var t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,i,n,o,s,a,r,l){var c=this.vertices.length,u=this.parseVertexIndex(e,c),h=this.parseVertexIndex(t,c),p=this.parseVertexIndex(i,c);if(this.addVertex(u,h,p),this.addColor(u,h,p),void 0!==a&&""!==a){var d=this.normals.length;u=this.parseNormalIndex(a,d),h=this.parseNormalIndex(r,d),p=this.parseNormalIndex(l,d),this.addNormal(u,h,p)}else this.addFaceNormal(u,h,p);if(void 0!==n&&""!==n){var m=this.uvs.length;u=this.parseUVIndex(n,m),h=this.parseUVIndex(o,m),p=this.parseUVIndex(s,m),this.addUV(u,h,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";for(var t=this.vertices.length,i=0,n=e.length;i<n;i++){var o=this.parseVertexIndex(e[i],t);this.addVertexPoint(o),this.addColor(o)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";for(var i=this.vertices.length,n=this.uvs.length,o=0,s=e.length;o<s;o++)this.addVertexLine(this.parseVertexIndex(e[o],i));for(var a=0,r=t.length;a<r;a++)this.addUVLine(this.parseUVIndex(t[a],n))}};return e.startObject("",!1),e}var Ni=function(){return x()((function e(t){k()(this,e),this.context=t}),[{key:"Load",value:function(e,t,i){var n=this;this.host=i,this.videoId=t;var o=e.substr(e.lastIndexOf("/")+1);return o=o.substring(0,o.lastIndexOf(".")),Cesium.Resource.fetchText(e).then((function(t){return n.Parse(t,e.substring(0,e.lastIndexOf("/")+1),o)}))}},{key:"Parse",value:function(e,t,i){var n=new Oi;-1!==e.indexOf("\r\n")&&(e=e.replace(/\r\n/g,"\n")),-1!==e.indexOf("\\\n")&&(e=e.replace(/\\\n/g,""));for(var o=e.split("\n"),s=[],a=0,r=o.length;a<r;a++){var l=o[a].trimStart();if(0!==l.length){var c=l.charAt(0);if("#"!==c)if("v"===c){var u=l.split(Mi);switch(u[0]){case"v":n.vertices.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3])),u.length>=7?(Cesium.Color.fromBytes(parseFloat(u[4]),parseFloat(u[5]),parseFloat(u[6]),1,Ti),n.colors.push(Ti.red,Ti.green,Ti.blue)):n.colors.push(void 0,void 0,void 0);break;case"vn":n.normals.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3]));break;case"vt":n.uvs.push(parseFloat(u[1]),parseFloat(u[2]))}}else if("f"===c){for(var h=l.slice(1).trim().split(Mi),p=[],d=0,m=h.length;d<m;d++){var f=h[d];if(f.length>0){var v=f.split("/");p.push(v)}}for(var g=p[0],y=1,b=p.length-1;y<b;y++){var C=p[y],w=p[y+1];n.addFace(g[0],C[0],w[0],g[1],C[1],w[1],g[2],C[2],w[2])}}else if("l"===c){var k=l.substring(1).trim().split(" "),_=[],x=[];if(-1===l.indexOf("/"))_=k;else for(var E=0,S=k.length;E<S;E++){var P=k[E].split("/");""!==P[0]&&_.push(P[0]),""!==P[1]&&x.push(P[1])}n.addLineGeometry(_,x)}else if("p"===c){var D=l.slice(1).trim().split(" ");n.addPointGeometry(D)}else if(null!==(s=Ei.exec(l))){(" "+s[0].slice(1).trim()).slice(1);n.startObject(i)}else if(Pi.test(l))n.object.startMaterial(l.substring(7).trim(),n.materialLibraries);else if(Si.test(l))n.materialLibraries.push(l.substring(7).trim());else if(Di.test(l))console.warn('Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if("s"===c){if((s=l.split(" ")).length>1){var M=s[1].trim().toLowerCase();n.object.smooth="0"!==M&&"off"!==M}else n.object.smooth=!0;var T=n.object.currentMaterial();T&&(T.smooth=n.object.smooth)}else{if("\0"===l)continue;console.warn('Unexpected line: "'+l+'"')}}}n.finalize();var O=new Ii(this.context,this.hls,this.videoId,this.host,i);if(!0===!(1===n.objects.length&&0===n.objects[0].geometry.vertices.length))for(var N=0,B=n.objects.length;N<B;N++){var A=n.objects[N],L=A.geometry,I=A.materials;if(0!==L.vertices.length){for(var j=new Ai(this.context,L),R=0,F=I.length;R<F;R++){var z=I[R],H=z.name+"_"+z.smooth+"_",V=n.materials[H];z.mtllib=i+".mtl",void 0===V&&((V=new Bi(this.context,L,t,z.mtllib)).name=z.name,V.flatShading=!z.smooth,n.materials[H]=V),j.setMaterial(V)}j.name=A.name,O.add(j)}}return O}}])}(),Bi=function(){return x()((function e(t,i,n,s){var r=this;k()(this,e),this.context=t,this.ready=!1;var l=document.createElement("canvas");l.width=512,l.height=512,this.canvas=l;var c=Cesium.Resource.fetchText(n+s).then(function(){var e=o()(a.a.mark((function e(t){var i,o,l,c,u,h;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=[],o=t.split("\n"),l=0,c=o.length;case 3:if(!(l<c)){e.next=20;break}if(0!==(u=o[l].trimStart()).length){e.next=7;break}return e.abrupt("continue",17);case 7:if("map_Kd"!==u.split(" ")[0]){e.next=17;break}return u.split(" ")[1],h=s.replace(".mtl","_result.jpg"),e.t0=i,e.next=14,r.loadTexture(n+h);case 14:e.t1=e.sent,e.t2={diffusemap:e.t1},e.t0.push.call(e.t0,e.t2);case 17:l++,e.next=3;break;case 20:return e.abrupt("return",Promise.all(i));case 21:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u="attribute vec3 position;\n",h="",p="",d=!1,m=!1,f=!1;i.normals.length>0&&(d=!0),i.colors.length>0&&(m=!0),!0===i.hasUVIndices&&(f=!0),d&&(u+="attribute vec3 normal;\n",u+="varying vec3 v_normal;\n",h+="varying vec3 v_normal;\n",p+="v_normal = normal;\n"),m&&(u+="attribute vec3 color;\n",u+="varying vec2 v_color;\n",h+="varying vec2 v_color;\n",p+="v_color = color;\n"),f&&(u+="attribute vec2 uv;\n",u+="varying vec2 v_uv;\n",h+="varying vec2 v_uv;\n",p+="v_uv = uv;\n"),u+="\n void main() {\n gl_Position = czm_modelViewProjection * vec4(position, 1.);\n ".concat(p,"\n }\n "),h+="\n\t\tuniform sampler2D colorTexture;\n void main() {\n\t\t\t vec4 color = texture2D(colorTexture, v_uv);\n\t\t\t\t\t\tgl_FragColor = color;\n }\n ",this.program=Cesium.ShaderProgram.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:h}),this.uniformMap={};var v=this;c.then((function(e){for(var t=function(){var t=e[i].diffusemap;r.uniformMap.colorTexture=function(){return t}},i=0;i<e.length;i++)t();v.ready=!0}))}),[{key:"updateColorTexture",value:function(e,t,i){if(this.ready){var n=this.uniformMap.colorTexture();if(e.playing&&e.timeupdate&&(t!==n.width||i!==n.height)){n.destroy(),this.canvas.width=1280,this.canvas.height=960,this.canvas.getContext("2d").drawImage(e.dom,0,0,1280,960,0,0,this.canvas.width,this.canvas.height);var o=new Cesium.Texture({context:this.context,source:this.canvas});this.uniformMap.colorTexture=function(){return o}}}}},{key:"setCommand",value:function(e){e.shaderProgram=this.program,e.uniformMap=this.uniformMap}},{key:"loadTexture",value:function(e){var t=this;return Cesium.Resource.fetchImage(e).then((function(e){return t.canvas.width=e.width,t.canvas.height=e.height,t.canvas.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.canvas.width,t.canvas.height),new Cesium.Texture({context:t.context,source:t.canvas,sampler:Cesium.Sampler.NEAREST})}))}}])}(),Ai=function(){return x()((function e(t,i){k()(this,e),this.lastState=!1,this.name=void 0,this.geometry=i;var n=[],o=0;this.material=void 0;var s=Cesium.Buffer.createVertexBuffer({context:t,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.vertices),usage:Cesium.BufferUsage.STATIC_DRAW});if(n.push({index:o,enabled:!0,vertexBuffer:s,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1}),i.normals.length>0){o++;var a=Cesium.Buffer.createVertexBuffer({context:t,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.normals),usage:Cesium.BufferUsage.STATIC_DRAW});n.push({index:o,enabled:!0,vertexBuffer:a,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1})}if(i.colors.length>0){o++;var r=Cesium.Buffer.createVertexBuffer({context:t,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.colors),usage:Cesium.BufferUsage.STATIC_DRAW});n.push({index:o,enabled:!0,vertexBuffer:r,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1})}if(!0===i.hasUVIndices){o++;var l=Cesium.Buffer.createVertexBuffer({context:t,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.uvs),usage:Cesium.BufferUsage.STATIC_DRAW});n.push({index:o,enabled:!0,vertexBuffer:l,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:2,normalize:!1})}var c=new Cesium.VertexArray({context:t,attributes:n}),u=Cesium.RenderState.fromCache({cull:{enabled:!1},depthMask:!0,depthTest:{enabled:!0}});this.drawCommand=new Cesium.DrawCommand({owner:this,primitiveType:Cesium.PrimitiveType.TRIANGLES,vertexArray:c,renderState:u,pass:Cesium.Pass.OPAQUE})}),[{key:"setMaterial",value:function(e){this.material=e,e.setCommand(this.drawCommand)}},{key:"update",value:function(e){Cesium.defined(this.material)&&this.material.ready&&e.commandList.push(this.drawCommand)}},{key:"updateVideo",value:function(e,t,i){var n=!1;if(Cesium.defined(this.material)&&this.material.ready)if(i.computeVisibility(this.drawCommand.boundingVolume)>=0&&this.material.ready){var o=e.distanceToBoundingSphere(this.drawCommand.boundingVolume),s=t.width,a=t.height;o>=20&&o<100?(s=t.width/2,a=t.height/2):o>=100&&(s=t.width/10,a=t.height/10),n=!0,this.material.updateColorTexture(t,Math.floor(s),Math.floor(a))}else n=!1;this.lastState=n}}])}(),Li=new WeakMap,Ii=function(){return x()((function e(t,i,n,o,s){k()(this,e),_i(this,Li,!0),this.context=t,this.videoId=n,this.host=o,this._modelMatrix=Cesium.Matrix4.IDENTITY,this.parent=null,this.children=[],this.video={dom:null,playing:!1,timeupdate:!1,width:0,height:0,tracks:null},this.time=0,this.name=s}),[{key:"show",get:function(){return t=this,(e=Li).get(xi(e,t));var e,t},set:function(e){var t,i,n;"boolean"==typeof e?(i=this,n=e,(t=Li).set(xi(t,i),n),e?this.video.player&&this.video.player.getVueInstance().play():this.video.player&&this.video.player.getVueInstance().pause()):console.error("参数必须为boolean")}},{key:"requestVideoResource",value:function(){var e=this,t="",i=(t=this.host.endsWith("yjearth4.0")?this.host:this.host+"/yjearth4.0")+"/videoFusion/"+this.videoId;return fetch(i,{method:"get",headers:{"Content-Type":"application/json"}}).then(function(){var i=o()(a.a.mark((function i(n){var s;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,n.text();case 2:if(s=i.sent,s=JSON.parse(s),![0,200].includes(s.code)){i.next=13;break}if(!s.data.deviceCode.length){i.next=9;break}return i.abrupt("return",fetch(t+"/videoFusion/vide/stream",{method:"post",body:JSON.stringify({type:"flv",deviceCode:s.data.deviceCode}),headers:{"Content-Type":"application/json"}}).then(function(){var t=o()(a.a.mark((function t(i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.text();case 2:if(n=t.sent,n=JSON.parse(n),![0,200].includes(n.code)){t.next=9;break}return n.data.url.length?(e.video.player.url=n.data.url,e.setFlvVideo(n.data.url)):console.warn("地址不存在"),t.abrupt("return");case 9:return console.warn(n.msg||n.message),t.abrupt("return");case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 9:console.warn("设备不存在");case 10:return i.abrupt("return");case 13:return console.warn(s.msg||s.message),i.abrupt("return");case 15:case"end":return i.stop()}}),i)})));return function(e){return i.apply(this,arguments)}}())}},{key:"modelMatrix",get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=e.clone(),this.updateModelMatrix()}},{key:"updateModelMatrix",value:function(){for(var e=0;e<this.children.length;e++){var t=this.children[e];t.drawCommand.modelMatrix=this._modelMatrix;var i=Cesium.BoundingSphere.fromVertices(t.geometry.vertices),n=Cesium.Matrix4.multiplyByTranslation(this._modelMatrix,i.center,new Cesium.Matrix4);i.center=Cesium.Matrix4.getTranslation(n,new Cesium.Cartesian3),t.drawCommand.boundingVolume=i}}},{key:"setPosition",value:function(e){Cesium.Matrix4.multiplyByTranslation(this._modelMatrix,e,this._modelMatrix),this.updateModelMatrix()}},{key:"add",value:function(e){e.parent=this,this.children.push(e)}},{key:"update",value:function(e){if(this.show)for(var t=0;t<this.children.length;t++){this.children[t].update(e)}}},{key:"setVideo",value:function(e){var t=this;if(this.video.playing=!1,this.video.timeupdate=!1,e){/^.+\.m3u8$/.test(e);var i="video_"+Cesium.createGuid(),n=document.createElement("div");n.setAttribute("id",i),n.style.display="none",this.video.parentDom=n;var o=this,s=new WasmPlayer(null,n,(function(e){if("play"===e){var t=n.getElementsByTagName("video")[0],i=n.getElementsByTagName("canvas")[0];if(t&&i)setTimeout((function(){s.play()}),1e3);else if(t){o.video.dom=t,o.video.width=t.videoWidth,o.video.height=t.videoHeight,o.video.playing=!0;for(var a=new Cesium.Texture({context:o.context,source:t}),r=0;r<o.children.length;r++){o.children[r].material.uniformMap.colorTexture=function(){return o.video.width=t.videoWidth,o.video.height=t.videoHeight,a.destroy(),a=new Cesium.Texture({context:o.context,source:t})}}}else if(i){o.video.dom=i,o.video.width=i.width,o.video.height=i.height,o.video.playing=!0;for(var l=new Cesium.Texture({context:o.context,source:i}),c=0;c<o.children.length;c++){o.children[c].material.uniformMap.colorTexture=function(){return i.width==o.video.width&&i.height==o.video.height||(console.log("resize texture"),l.destroy(),l=new Cesium.Texture({context:o.context,source:i})),o.video.width=i.width,o.video.height=i.height,l.destroy(),l=new Cesium.Texture({context:o.context,source:i})}}}}}));s.play(e,1),this.video.player=s,n.getElementsByTagName("video")[0].addEventListener("loadeddata",(function(){t.loaded=!0}))}}},{key:"setFlvVideo3",value:function(e){if(this.video.playing=!1,this.video.timeupdate=!1,this.video.url=e,e){var t="video_"+Cesium.createGuid(),i=document.createElement("video");i.setAttribute("id",t);var n=this,o=new wi(i,{url:e});this.video.player=o,o.on("Events","MEDIA_INFO",(function(e){})),o.flvPlayer.play().then((function(){n.video.dom=i,n.video.width=i.videoWidth,n.video.height=i.videoHeight,n.video.playing=!0;for(var e=new Cesium.Texture({context:n.context,source:i}),t=0;t<n.children.length;t++){n.children[t].material.uniformMap.colorTexture=function(){return n.video.width=i.videoWidth,n.video.height=i.videoHeight,e.destroy(),e=new Cesium.Texture({context:n.context,source:i})}}}))}}},{key:"setFlvVideo2",value:function(e){if(this.video.playing=!1,this.video.timeupdate=!1,this.video.url=e,e){var t="video_"+Cesium.createGuid(),i=document.createElement("div");i.setAttribute("id",t),i.style.display="none";var n=this,o=new ki(i,{url:e});this.video.player=o,this.video.player.player.on("play",(function(e){console.log("1111111111");var t=i.getElementsByTagName("canvas")[0];i.innerHTML="",n.video.dom=t,n.video.width=t.width,n.video.height=t.height,n.video.playing=!0;for(var o=new Cesium.Texture({context:n.context,source:t}),s=0;s<n.children.length;s++){n.children[s].material.uniformMap.colorTexture=function(){return n.video.width=t.width,n.video.height=t.height,o.copyFrom({source:t}),o}}}))}}},{key:"setFlvVideo",value:function(e){var t=this;if(this.video.playing=!1,this.video.timeupdate=!1,this.video.url=e,e){var i=this,n="video_"+Cesium.createGuid(),o=document.getElementById("yj-sdk-live-player-box");o||((o=document.createElement("div")).setAttribute("id","yj-sdk-live-player-box"),o.style.display="none",document.body.appendChild(o));var s=document.createElement("live-player");s.setAttribute("id",n),s.setAttribute("video-url",this.video.url),s.setAttribute("live",!0),s.style.display="none",o.appendChild(s),this.video.player=s,s.addEventListener("play",(function(e){console.log("播放成功",t.video.url,t.name);var n=s.getElementsByTagName("video")[0];i.video.dom=n,i.video.width=n.width,i.video.height=n.height,i.video.playing=!0;for(var o=new Cesium.Texture({context:i.context,source:n}),a=0;a<i.children.length;a++){i.children[a].material.uniformMap.colorTexture=function(){return i.video.width=n.width,i.video.height=n.height,o.copyFrom({source:n}),o}}}))}}},{key:"isDestroyed",value:function(){return!1}},{key:"destroy",value:function(){this.video.player&&(this.video.player.setAttribute("video-url",null),document.getElementById("yj-sdk-live-player-box").removeChild(this.video.player),this.video.player=null)}}])}(),ji=Ni,Ri=["icon-py","icon-edit","icon-add","icon-add2","icon-minus","icon-play","icon-pause","icon-updateheight","icon-draw","icon-positions","icon-reset","icon-xj","icon-yj","icon-zj","icon-close","icon-query","icon-route","icon-copy","icon-load","icon-rubric","icon-pen","icon-cross","icom-confirm"];function Fi(){var e=document.createElement("svg");e.xmlns="http://www.w3.org/2000/svg",e.style.width=0,e.style.height=0,e.style.position="absolute",e.style.overflow="hidden",document.body.appendChild(e);for(var t=new DOMParser,i=function(){var i=Ri[n];fetch(Cesium.buildModuleUrl("../custom/img/".concat(i,".svg"))).then((function(e){return e.text()})).then((function(n){var o=t.parseFromString(n,"text/xml").getElementsByTagName("svg")[0];o&&(o.id="yj-"+i,e.appendChild(o))}))},n=0;n<Ri.length;n++)i()}var zi=x()((function e(){var t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};k()(this,e);var n,o,s,a,r,l=this,c={el:i.el,size:"mini",isLog:!1,disabled:i.disabled||!1,alpha:!1,clickDefineColor:h,hasClear:!0,openPickerAni:"opacity",defaultColor:i.defaultColor,pickerInputChange:v,startMainCallback:function(e){l.colorPicker&&(l.colorPicker.picker.style.opacity=0),setTimeout((function(){u()}),0)}};function u(){if(l.colorPicker&&l.colorPicker.picker){var e=!1,t=l.colorPicker.box,c=l.colorPicker.picker,u=t.getBoundingClientRect().x,m=t.getBoundingClientRect().y,g=0;c.style.left=u+"px",c.style.minWidth="325px";var y=c.getElementsByClassName("ew-alpha-slider-bar")[0];y&&(y.parentNode.style.width="16px",y.parentNode.removeChild(y));var b=document.createElement("div");b.className="icon-pen-box",b.innerHTML='<svg class="icon-pen"><use xlink:href="#yj-icon-pen"></use></svg>',b.style.display="none",b.style.cursor="unset";var C=l.colorPicker.pickerInput;C.parentNode.insertBefore(b,C),C.style.width="188px",C.style.display="none";var w=document.createElement("div"),k=document.createElement("div");k.className="row",k.style.margin="6px 0 0 0",k.innerHTML='\n <div class="col">R</div>\n <div class="col">G</div>\n <div class="col">B</div>\n <div class="col" style="flex: 0 0 92px;"></div>\n ';var _=document.createElement("div");_.className="row",_.innerHTML='\n <div class="col">\n <input type="number" step="1" min="0" max="255">\n </div>\n <div class="col">\n <input type="number" step="1" min="0" max="255">\n </div>\n <div class="col">\n <input type="number" step="1" min="0" max="255">\n </div>\n ',w.appendChild(k),w.appendChild(_);var x=_.getElementsByTagName("input");x[0].style.width="72px",x[1].style.width="72px",x[2].style.width="72px",n=x[0],o=x[1],s=x[2];var E=c.getElementsByClassName("ew-color-dropbtns")[0];if(c.insertBefore(w,E),n.addEventListener("blur",(function(e){var t=e.target.value;(e.target.value||"undefined"!==e.target.dataset.null&&""!==e.target.dataset.null&&!Boolean(e.target.dataset.null))&&(t=Number(t),e.target.max&&t>Number(e.target.max)&&(t=Number(e.target.max)),e.target.min&&t<Number(e.target.min)&&(t=Number(e.target.min)),e.target.dataset.min&&t<Number(e.target.dataset.min)&&(t=Number(e.target.dataset.min)),n.value=parseInt(t),l.colorPicker.hsba=f("rgb(".concat(n.value,", ").concat(o.value,", ").concat(s.value,")")),l.colorPicker.changeColor(l.colorPicker,l.colorPicker.pickerPanel.offsetWidth,l.colorPicker.pickerPanel.offsetHeight))})),o.addEventListener("blur",(function(e){var t=e.target.value;(e.target.value||"undefined"!==e.target.dataset.null&&""!==e.target.dataset.null&&!Boolean(e.target.dataset.null))&&(t=Number(t),e.target.max&&t>Number(e.target.max)&&(t=Number(e.target.max)),e.target.min&&t<Number(e.target.min)&&(t=Number(e.target.min)),e.target.dataset.min&&t<Number(e.target.dataset.min)&&(t=Number(e.target.dataset.min)),o.value=parseInt(t),l.colorPicker.hsba=f("rgb(".concat(n.value,", ").concat(o.value,", ").concat(s.value,")")),l.colorPicker.changeColor(l.colorPicker,l.colorPicker.pickerPanel.offsetWidth,l.colorPicker.pickerPanel.offsetHeight))})),s.addEventListener("blur",(function(e){var t=e.target.value;(e.target.value||"undefined"!==e.target.dataset.null&&""!==e.target.dataset.null&&!Boolean(e.target.dataset.null))&&(t=Number(t),e.target.max&&t>Number(e.target.max)&&(t=Number(e.target.max)),e.target.min&&t<Number(e.target.min)&&(t=Number(e.target.min)),e.target.dataset.min&&t<Number(e.target.dataset.min)&&(t=Number(e.target.dataset.min)),s.value=parseInt(t),l.colorPicker.hsba=f("rgb(".concat(n.value,", ").concat(o.value,", ").concat(s.value,")")),l.colorPicker.changeColor(l.colorPicker,l.colorPicker.pickerPanel.offsetWidth,l.colorPicker.pickerPanel.offsetHeight))})),i.alpha){x[0].style.width="52px",x[1].style.width="52px",x[2].style.width="52px";var S=document.createElement("div");S.className="input-number input-number-unit color-alpha",S.innerHTML='\n <input class="input" type="number" title="" step="0.01" min="0" max="1">\n <span class="arrow"></span>',C.parentNode.insertBefore(S,C.nextSibling),S.style.width="66px",S.style.margin="0 6px 0 0",a=S.getElementsByClassName("input")[0],k.innerHTML='\n <div class="col">R</div>\n <div class="col">G</div>\n <div class="col">B</div>\n <div class="col">A</div>\n <div class="col" style="flex: 0 0 106px;"></div>\n ',_.appendChild(S),a.addEventListener("blur",(function(e){var t=e.target.value;(e.target.value||"undefined"!==e.target.dataset.null&&""!==e.target.dataset.null&&!Boolean(e.target.dataset.null))&&(t=Number(t),e.target.max&&t>Number(e.target.max)&&(t=Number(e.target.max)),e.target.min&&t<Number(e.target.min)&&(t=Number(e.target.min)),e.target.dataset.min&&t<Number(e.target.dataset.min)&&(t=Number(e.target.dataset.min)),a.value=parseInt(100*t)/100)})),l.pickAlphaInputValue||0===l.pickAlphaInputValue||"0"===l.pickAlphaInputValue?a.value=parseInt(100*l.pickAlphaInputValue)/100:a.value=r?parseInt(100*Number(r.alpha.toFixed(2)))/100:1,l.pickAlphaInputValue=a.value,t.style.background=Cesium.Color.fromCssColorString(l.colorPicker.config.defaultColor||"#ffffff").withAlpha(a.value).toCssColorString()}else r=r?r.withAlpha(1):"",t.style.background=Cesium.Color.fromCssColorString(l.colorPicker.config.defaultColor||"#ffffff").toCssColorString();var P=c.getElementsByClassName("ew-color-dropbtngroup")[0];_.appendChild(P);var D=c.getElementsByClassName("ew-pre-define-color-container")[0];if(D){var M=localStorage.getItem("custom-color");M=M?JSON.parse(M):{};var T=document.createElement("span");T.className="custom-divider",T.style.margin="10px 0";var O=document.createElement("span");O.className="custom-divider",D.parentNode.insertBefore(T,D),D.parentNode.insertBefore(O,D.nextSibling);var N=document.createElement("div");N.className="yj-pre-collect-color-container",O.parentNode.insertBefore(N,O.nextSibling);var B=document.createElement("div");B.innerHTML='<svg class="icon-add2"><use xlink:href="#yj-icon-add2"></use></svg>',B.className="yj-pre-collect-color add";var A=document.createElement("div");A.innerHTML='<svg class="icon-minus" style="display: unset;"><use xlink:href="#yj-icon-minus"></use></svg><svg class="icon-confirm" style="display: none;"><use xlink:href="#yj-icom-confirm"></use></svg>',A.className="yj-pre-collect-color subtract";var L=A.getElementsByClassName("icon-minus")[0],I=A.getElementsByClassName("icon-confirm")[0];N.appendChild(B),N.appendChild(A);var j=[],R=function(e){var t=document.createElement("div");t.className="yj-pre-collect-color",t.setAttribute("tabindex","0"),t.setAttribute("color-box-id",l.colorPicker.uid);var i=document.createElement("div");i.className="yj-pre-define-color-item",t.appendChild(i),i.className="yj-pre-define-color-item";var n=Cesium.Color.fromCssColorString(M[e]).toCssHexString();i.style.backgroundColor=n,i.addEventListener("click",(function(e){l.colorPicker.updateColor(e),t.className="yj-pre-collect-color yj-pre-collect-color-active",h(n)})),t.addEventListener("blur",(function(e){t.className="yj-pre-collect-color"}));var o=document.createElement("div");o.className="yj-pre-define-color-item subtract-btn",o.innerHTML='<svg class="icon-cross"><use xlink:href="#yj-icon-cross"></use></svg>',o.style.display="none",t.appendChild(o),N.appendChild(t),o.addEventListener("click",(function(){delete M[e],localStorage.setItem("custom-color",JSON.stringify(M)),N.removeChild(t)})),j.push(o)};for(var F in M)R(F);B.addEventListener("click",(function(){if(e){e=!1;for(var t=0;t<j.length;t++)j[t].style.display="none"}var i=document.createElement("div");i.className="yj-pre-collect-color",i.setAttribute("tabindex","0"),i.setAttribute("color-box-id",l.colorPicker.uid);var n=document.createElement("div");n.className="yj-pre-define-color-item",i.appendChild(n);var o=d(p(l.colorPicker.hsba)),s=Cesium.Color.fromCssColorString(o||"#ffffff");a&&(s=s.withAlpha(a.value));var r=s.toCssHexString();n.style.backgroundColor=r,n.addEventListener("click",(function(e){l.colorPicker.updateColor(e),i.className="yj-pre-collect-color yj-pre-collect-color-active",h(r)})),i.addEventListener("blur",(function(e){i.className="yj-pre-collect-color"})),N.appendChild(i);var c=document.createElement("div");c.className="yj-pre-define-color-item subtract-btn",c.innerHTML='<svg class="icon-cross"><use xlink:href="#yj-icon-cross"></use></svg>',c.style.display="none",i.appendChild(c),j.push(c);var u=Cesium.createGuid();M[u]=r,localStorage.setItem("custom-color",JSON.stringify(M)),c.addEventListener("click",(function(){delete M[u],localStorage.setItem("custom-color",JSON.stringify(M)),N.removeChild(i)}))})),A.addEventListener("click",(function(){if(e=!e){L.style.display="none",I.style.display="unset";for(var t=0;t<j.length;t++)j[t].style.display="block"}else{L.style.display="unset",I.style.display="none";for(var i=0;i<j.length;i++)j[i].style.display="none"}}))}g=c.offsetHeight,"none"===c.style.display&&(c.style.display="block",g=c.offsetHeight,c.style.display="none"),m+t.offsetHeight+4+g>window.innerHeight?c.style.top=m-g+"px":c.style.top=m+t.offsetHeight+4+"px",l.colorPicker.pancelTop=parseFloat(c.style.top)-2,v(Cesium.Color.fromCssColorString(l.colorPicker.config.defaultColor||"#ffffff").toCssHexString())}}function h(e){if(a){var t=Cesium.Color.fromCssColorString(e);a.value=parseInt(100*Number(t.alpha.toFixed(2)))/100}}function p(e){var t,i,n,o=e.a,s=Math.round(e.h),a=Math.round(255*e.s/100),r=Math.round(255*e.b/100);if(0===a)t=i=n=r;else{var l=(255-a)*r/255,c=s%60*(r-l)/60;360===s?(t=r,i=n=0):s<60?(t=r,i=l+c,n=l):s<120?(t=r-c,i=r,n=l):s<180?(t=l,i=r,n=l+c):s<240?(t=l,i=r-c,n=r):s<300?(t=l+c,i=l,n=r):s<360?(t=r,i=l,n=r-c):t=i=n=0}return"rgba("+Math.round(t)+","+Math.round(i)+","+Math.round(n)+","+o+")"}function d(e){var t={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"};if(/rgba?/.test(e)){var i=e.replace(/rgba?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n="";return i[3],i.map((function(e,i){i<=2&&(n+=function(e){e=Math.min(Math.round(e),255);var i=Math.floor(e/16),n=e%16;return""+(t[i]||i)+(t[n]||n)}(e))})),"#"+n}}function m(e,t){var i=e.toLowerCase(),n=e.length,o=[];i=Cesium.Color.fromCssColorString(i).toCssHexString().substring(0,7);if(e&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(i)){if(4===n){for(var s="#",a=1;a<n;a++){var r=i.slice(a,a+1);s+=r.concat(r)}i=s}for(var l=1,c=i.length;l<c;l+=2)o.push(parseInt("0X"+i.slice(l,l+2),16));return o}}function f(e){var t=e.slice(e.indexOf("(")+1,e.lastIndexOf(")")).split(","),i=t.length<4?1:Number(t[3]),n=Number(t[0])/255,o=Number(t[1])/255,s=Number(t[2])/255,a=void 0,r=void 0,l=void 0,c=Math.min(n,o,s),u=l=Math.max(n,o,s),h=u-c;if(u===c)a=0;else{switch(u){case n:a=(o-s)/h+(o<s?6:0);break;case o:a=2+(s-n)/h;break;case s:a=4+(n-o)/h}a=Math.round(60*a)}return r=0===u?0:1-c/u,{h:a,s:r=Math.round(100*r),b:l=Math.round(100*l),a:i}}function v(e){if(l.colorPicker&&l.colorPicker.pickerInput){var t=m(e||l.colorPicker.pickerInput.value);n.value=t[0],o.value=t[1],s.value=t[2]}}this.el=i.el,i.sure&&(c.sure=function(e){var n=Cesium.Color.fromCssColorString(e);a&&(n=n.withAlpha(a.value),t.pickAlphaInputValue=a.value),e=n.toCssHexString(),"function"==typeof i.sure&&i.sure(e),u()}),i.clear&&(c.clear=function(){a&&(a.value=t.pickAlphaInputValue=1),t.colorPicker.config.defaultColor="",u(),"function"==typeof i.clear&&i.clear()}),c.defaultColor&&(r=Cesium.Color.fromCssColorString(c.defaultColor)),c.predefineColor=["rgba(255, 255, 255, 1)","rgba(255, 0, 0, 1)","rgba(208, 132, 209, 1)","rgba(100, 182, 217, 1)","rgba(42, 130, 228, 1)","rgba(214, 36, 36, 1)","rgba(252, 222, 111, 1)","rgba(67, 207, 124, 1)","rgba(176, 243, 143, 1)","rgba(121, 72, 234, 1)","rgba(255, 195, 0, 1)","rgba(0, 186, 173, 1)","rgba(165, 214, 63, 1)","rgba(0, 0, 0, 1)","rgba(46, 47, 51, 1)","rgba(172, 51, 193, 1)","rgba(130, 21, 21, 1)","rgba(255, 87, 51, 1)","rgba(255, 140, 0, 1)","rgba(125, 191, 255, 1)"],this.colorPicker=new ewPlugins("colorpicker",c),u()}));window.YJColorPicker=zi;var Hi=zi;function Vi(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Gi(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)?Gi(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Gi(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 Wi(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 Ui(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Wi(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Wi(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Yi(e,t,i){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,i)}function Ji(e,t){return e.get(Xi(e,t))}function qi(e,t,i){return e.set(Xi(e,t),i),i}function Xi(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var Zi=new WeakMap,Ki=new WeakMap,Qi=new WeakMap,$i=function(){return x()((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,e),Yi(this,Zi,void 0),Yi(this,Ki,void 0),Yi(this,Qi,void 0),this.div_id=t,this.entityMap=new Map,this._entityZIndex=0,this.viewer=null,this.options=Ui({},i),hi(ui()),this.proj=new R,this.clickTextDom=void 0,this.isLeftClick=!1,this.init(),Fi()}),[{key:"addIncetance",value:function(e,t){this.entityMap.set(e+"",t)}},{key:"getIncetance",value:function(e){return this.entityMap.get(e+"")}},{key:"removeIncetance",value:function(e){this.entityMap.delete(e),function(e){le.delete(e)}(this),function(e){ce.delete(e)}(this),function(e){ue.delete(e)}(this),at(this,e)}},{key:"setDefaultView",value:function(e){e?(this.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE={destination:e.destination||{},orientation:e.orientation||{}},ni(this),oi(this),this.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(e.destination.lng,e.destination.lat,e.destination.alt),orientation:{heading:Cesium.Math.toRadians(e.orientation.heading||0),pitch:Cesium.Math.toRadians(e.orientation.pitch||0),roll:Cesium.Math.toRadians(e.orientation.roll||0)},duration:0})):(this.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE=void 0,Cesium.Camera.DEFAULT_VIEW_RECTANGLE=Cesium.Rectangle.fromDegrees(89.5,10.4,110.4,61.2),this.viewer.camera.setView({destination:Cesium.Camera.DEFAULT_VIEW_RECTANGLE}))}},{key:"init",value:function(){var e=this,t=new Cesium.Ellipsoid(6378137,6378137,6356752.314140356),i=new Cesium.GeographicProjection(t),n=this;this.options={imageryProvider:new Cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII")}),baseLayerPicker:!1,geocoder:!1,animation:!1,fullscreenButton:!1,navigationHelpButton:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,shouldAnimate:!0,mapProjection:i},Number(Cesium.VERSION.split(".")[1])>=107?this.options.baseLayer=Cesium.ImageryLayer.fromProviderAsync(Cesium.TileMapServiceImageryProvider.fromUrl(Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"))):this.options.imageryProvider=new Cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII")}),this.options.contextOptions={webgl:{depth:!0,stencil:!0,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,failIfMajorPerformanceCaveat:!0},requestWebgl2:!0},Cesium.RequestScheduler.maximumRequests=500,this.viewer=new Cesium.Viewer(this.div_id,this.options),this.viewer.scene.imageryLayers._layers[0].notes="default-base-map",this.viewer._shadows=this.viewer.shadows,this.viewer.scene.screenSpaceCameraController.maximumZoomDistance=5e7,this.viewer.scene.globe.translucency.enabled=!0;var o=new vi;this.viewer.scene.skyBox=new Cesium.SkyBox({sources:{negativeX:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_mx.jpg",negativeY:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_my.jpg",negativeZ:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_mz.jpg",positiveX:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_px.jpg",positiveY:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_py.jpg",positiveZ:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_pz.jpg"}}),Ci();for(var s=[{name:"思源黑体",value:"SourceHanSansTi",url:o.getSourceRootPath()+"/custom/fonts/SourceHanSansCN-Medium.otf",format:"opentype"},{name:"庞门正道标题体",value:"PMZDBTTi",url:o.getSourceRootPath()+"/custom/fonts/PangMenZhengDaoBiaoTiTi-1.ttf",format:"truetype"},{name:"数黑体",value:"AlimamaShuHeiTi",url:o.getSourceRootPath()+"/custom/fonts/AlimamaShuHeiTi-Bold.ttf",format:"truetype"}],a=0;a<s.length;a++){var r=new FontFace(s[a].value,"url('".concat(s[a].url,"') format('").concat(s[a].format,"')"));r.load(),document.fonts.add(r)}document.fonts.ready.then((function(){var t,i=Vi(e.entityMap);try{for(i.s();!(t=i.n()).done;){var n=y()(t.value,2),o=(n[0],n[1]);"labelFontFamily"in o&&(o.labelFontFamily=o.labelFontFamily)}}catch(e){i.e(e)}finally{i.f()}})),this.setDefaultView(),Cesium.Ion.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhZmM5ODNkYy0yMTIzLTQxNzktOTE1Yy1mN2QxNmFkMjgyMTUiLCJpZCI6Mjk0NzIsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1OTIyMjkxMTJ9.9oYggi4kZgcapD2BkEGF8kG8tTuVkF33FdwxB2JKXeA",this.viewer.scene.globe.depthTestAgainstTerrain=!0,this.viewer.scene.screenSpaceCameraController.zoomEventTypes=[Cesium.CameraEventType.WHEEL,Cesium.CameraEventType.PINCH],this.viewer.scene.screenSpaceCameraController.tiltEventTypes=[Cesium.CameraEventType.PINCH,Cesium.CameraEventType.RIGHT_DRAG],this.viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),Cesium.FeatureDetection.supportsImageRenderingPixelated()&&(this.viewer.resolutionScale=window.devicePixelRatio),this.viewer.scene.fxaa=!0,this.viewer.scene.postProcessStages.fxaa.enabled=!0,this.viewer.scene.screenSpaceCameraController.enableCollisionDetection=!0;var l=this.viewer.scene.primitives.add(new Cesium.BillboardCollection({scene:this.viewer.scene})),c=this.viewer.scene.primitives.add(new Cesium.LabelCollection({scene:this.viewer.scene}));qi(Ki,this,l),qi(Qi,this,c),function(e){var t=new vi,i=new Cesium.CustomDataSource("sdk-dataSource1");e.dataSources.add(i).then((function(e){var i;e.clustering.enabled=!1,e.clustering.pixelRange=15,e.clustering.minimumClusterSize=2;for(var n=new Cesium.PinBuilder,o=(n.fromText("50+",Cesium.Color.RED,48).toDataURL(),n.fromText("40+",Cesium.Color.ORANGE,48).toDataURL(),n.fromText("30+",Cesium.Color.YELLOW,48).toDataURL(),n.fromText("20+",Cesium.Color.GREEN,48).toDataURL(),n.fromText("10+",Cesium.Color.BLUE,48).toDataURL(),new Array(8)),s=0;s<o.length;++s)o[s]=n.fromText(""+(s+2),Cesium.Color.VIOLET,48).toDataURL();!function(){Cesium.defined(i)?(i(),i=void 0):i=e.clustering.clusterEvent.addEventListener((function(e,i){i.billboard.show=!0,i.billboard.id=i.label.id,i.billboard.verticalOrigin=Cesium.VerticalOrigin.BOTTOM,i.billboard.image=t.getSourceRootPath()+"/img/cluster.png",i.billboard.disableDepthTestDistance=ii()?void 0:Number.POSITIVE_INFINITY,i.label.verticalOrigin=Cesium.VerticalOrigin.CENTER,i.label.font="18px Arial,sans-serif",i.label.disableDepthTestDistance=ii()?void 0:Number.POSITIVE_INFINITY,i.label.style=Cesium.LabelStyle.FILL,i.label.showBackground=!0,i.label.backgroundColor=Cesium.Color.WHITE.withAlpha(0),e.length>=1e3?(i.billboard.scale=1.5,i.label.pixelOffset=new Cesium.Cartesian2(-28,-46)):e.length>=100?(i.billboard.scale=1.25,i.label.pixelOffset=new Cesium.Cartesian2(-21,-40)):e.length>=50?(i.billboard.scale=1.1,i.label.pixelOffset=new Cesium.Cartesian2(-16,-36)):e.length>=40?(i.billboard.scale=1.05,i.label.pixelOffset=new Cesium.Cartesian2(-16,-34)):e.length>=30?(i.billboard.scale=1,i.label.pixelOffset=new Cesium.Cartesian2(-16,-32)):e.length>=20?(i.billboard.scale=.95,i.label.pixelOffset=new Cesium.Cartesian2(-16,-30)):e.length>=10?(i.billboard.scale=.9,i.label.pixelOffset=new Cesium.Cartesian2(-16,-28)):(i.billboard.scale=.8,i.label.pixelOffset=new Cesium.Cartesian2(-11,-25))}));var n=e.clustering.pixelRange;e.clustering.pixelRange=0,e.clustering.pixelRange=n}();var a={pixelRange:15,minimumClusterSize:2};function r(t){Cesium.knockout.getObservable(a,t).subscribe((function(i){e.clustering[t]=i}))}Cesium.knockout.track(a),r("pixelRange"),r("minimumClusterSize")}))}(this.viewer),E(this.viewer);Cesium.viewerCesiumNavigationMixin(this.viewer,{resetTooltip:"重置视图",zoomInTitle:"缩小",zoomOutTitle:"放大"});function u(e){var t=e.indexOf("px");return Number(e.slice(0,t))}setTimeout((function(){var t=document.getElementsByClassName("compass-outer-ring")[0],i=document.getElementsByClassName("navigation-controls")[0];t.addEventListener("mousedown",(function(){ni(e),oi(e)})),i.addEventListener("mousedown",(function(){ni(e),oi(e)}))}),0),this.viewer.imageryLayers.layerAdded.addEventListener((function(){for(var t=0;t<e.viewer.imageryLayers._layers.length;t++)e.viewer.imageryLayers._layers[t]._imageryProvider&&e.viewer.imageryLayers._layers[t]._imageryProvider._type&&("flw"===e.viewer.imageryLayers._layers[t]._imageryProvider._type||"jww"===e.viewer.imageryLayers._layers[t]._imageryProvider._type)&&e.viewer.imageryLayers.raiseToTop(e.viewer.imageryLayers._layers[t])})),function e(){qi(Zi,n,requestAnimationFrame(e)),t=1,n.viewer&&2===n.viewer.scene.mode&&(t=10),n.viewer.shadows?n.viewer.scene.light=new Cesium.SunLight:n.viewer.trackedEntity&&n.viewer.trackedEntity.position?(t=1,n.viewer.scene.light=new Cesium.DirectionalLight({direction:Cesium.Cartesian3.negate(n.viewer.trackedEntity.position._value,new Cesium.Cartesian3(-1,-1,-1)),intensity:t})):(t=n.viewer&&2===n.viewer.scene.mode?30:1,n.viewer.scene.light=new Cesium.DirectionalLight({direction:Cesium.Cartesian3.negate(n.viewer.scene.camera.position,new Cesium.Cartesian3(-1,-1,-1)),intensity:t})),TWEEN.update();var t}(),n.viewer.entities.add(new Cesium.Entity({name:"solve-bug",position:{x:0,y:0,z:0},billboard:{scale:0,image:o.getSourceRootPath()+"/img/point.png",color:Cesium.Color.WHITE.withAlpha(0)}})),n.viewer.entities.add(new Cesium.Entity({name:"solve-bug",position:{x:0,y:0,z:1e8},billboard:{scale:0,image:o.getSourceRootPath()+"/img/point.png",color:Cesium.Color.WHITE.withAlpha(0)}})),new Cesium.ScreenSpaceEventHandler(n.viewer.canvas).setInputAction((function(e){console.log("111111111");var t=n.viewer._element.getElementsByClassName("popup-textarea");n.isLeftClick=!1;for(var i=t.length-1;i>-1;i--){var o=u(t[i].style.left),s=u(t[i].style.top),a=1*t[i].clientWidth,r=1*t[i].clientHeight,l=e.position.x,c=e.position.y;if(l>o&&l<o+a&&c>s&&c<s+r){n.clickTextDom&&(n.clickTextDom.style["pointer-events"]="none",n.clickTextDom.querySelector("textarea").removeEventListener("blur",n.blurFun)),n.clickTextDom=t[i],t[i].style["pointer-events"]="all",t[i].querySelector("textarea").focus(),n.isLeftClick=!0,n.entityMap.get(n.clickTextDom.id).isClick(e.position,n.clickTextDom.id),n.blurFun=function(){n.entityMap.get(n.clickTextDom.id).isClick(e&&e.position||null,n.clickTextDom.id),n.entityMap.get(n.clickTextDom.id).getwords(n.clickTextDom.getElementsByTagName("textarea")[0].value)},n.clickTextDom.querySelector("textarea").addEventListener("blur",n.blurFun);break}}var h=void 0,p=void 0,d=void 0;if(n.isLeftClick){var m=!1,f=0,v=0;h=function(e){f=e.layerX,v=e.layerY,m=!0},p=function(e){if(m){var t=1*n.clickTextDom.clientWidth,i=1*n.clickTextDom.clientHeight,o={x:e.clientX-f+t/2,y:e.clientY-v+i},s=Ht().sdkP;if(n!=s&&s){var a=s.viewer._element.clientWidth;o.x=o.x-a}n.entityMap.get(n.clickTextDom.id).setHandeler(o)}},d=function(e){m&&(m=!1)},n.clickTextDom.addEventListener("mousedown",h),n.viewer._element.addEventListener("mousemove",p),n.viewer._element.addEventListener("mouseup",d)}!n.isLeftClick&&n.clickTextDom&&(n.clickTextDom.removeEventListener("mousedown",h),n.viewer._element.removeEventListener("mousemove",p),n.viewer._element.removeEventListener("mouseup",d),n.entityMap.get(n.clickTextDom.id).getwords(n.clickTextDom.getElementsByTagName("textarea")[0].value),n.clickTextDom.style["pointer-events"]="none",n.clickTextDom=void 0)}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}},{key:"collection",get:function(){return{billboard:Ji(Ki,this),label:Ji(Qi,this)}}},{key:"destroy",value:function(){cancelAnimationFrame(Ji(Zi,this));var e,t=Vi(this.entityMap);try{for(t.s();!(e=t.n()).done;){var i=y()(e.value,2);i[0];i[1].remove()}}catch(e){t.e(e)}finally{t.f()}this.viewer&&(this.viewer.entities&&this.viewer.entities.removeAll(),this.viewer.destroy&&this.viewer.destroy()),this.viewer=null}}])}();function en(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 tn(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?en(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):en(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var nn=function(){return x()((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,e),this.sdk=t,this.primitives={building:[],unit:[],dth:[]},this.options=tn({},i),this.options.host=this.options.host||p(),this.temporaryDth=[],this.dth={},this.PickBuildingEvent=new Cesium.Event,this.initEvents(),this.activeBuilding}),[{key:"PickCallback",value:function(e,t){this.PickBuildingEvent.addEventListener(t,e)}},{key:"initEvents",value:function(){var e=this;new Cesium.ScreenSpaceEventHandler(this.sdk.viewer.scene.canvas).setInputAction((function(t){if(!YJ.Measure.GetMeasureStatus()&&e.isActivate){var i=e.sdk.viewer.scene.pick(t.position);if(i){if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&("yj-dth-dth"==i.id.type||"yj-dth-highlight"==i.id.type))return void e.getIDBypickFeature(i);if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&"yj-dth-unit"==i.id.type)return e.highlightPrimitive&&e.sdk.viewer.scene.primitives.remove(e.highlightPrimitive),void e.handlePickEvent(i.id)}e.highlightPrimitive&&e.sdk.viewer.scene.primitives.remove(e.highlightPrimitive);var n=e.sdk.viewer.scene.pickPosition(t.position);if(n){var o=Cesium.Cartographic.fromCartesian(n),s=[Cesium.Math.toDegrees(o.longitude),Cesium.Math.toDegrees(o.latitude)];e.queryByPoint(s,o.height)}}}),Cesium.ScreenSpaceEventType.LEFT_CLICK);var t=this.sdk.viewer.entities.getOrCreateEntity("yj-dth-cover-label");t.show=!1;var i,n=0,o=this;function s(e){var i=o.sdk.viewer.scene.pick(e.endPosition);if(i){var n="";if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&("yj-dth-dth"===i.id.type||"yj-dth-highlight"===i.id.type))n=i.id.build_info.name+" - "+i.id.unit_info.name+" - "+i.id.room_num;else if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&"yj-dth-unit"===i.id.type)i.id.build_info.name&&(n=i.id.build_info.name+" - "+i.id.name);else{if(!(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&"yj-dth-build"===i.id.type))return i.primitive&&i.primitive.id&&i.primitive.id.id&&"yj-dth-cover-label"===i.primitive.id.id?void(t.position=o.sdk.viewer.scene.pickPosition(e.endPosition)):void(t.show=!1);i.id.name&&(n=i.id.name)}n&&(t.position=o.sdk.viewer.scene.pickPosition(e.endPosition),t.label=new Cesium.LabelGraphics({text:n,font:"20px Helvetica",pixelOffset:{x:0,y:-30},fillColor:Cesium.Color.fromCssColorString("#ffffff"),outlineColor:Cesium.Color.BLACK,outlineWidth:1,showBackground:!0,backgroundColor:Cesium.Color.fromCssColorString("#000000").withAlpha(.8),style:Cesium.LabelStyle.FILL_AND_OUTLINE,disableDepthTestDistance:Number.POSITIVE_INFINITY}),t.show=!0)}}new Cesium.ScreenSpaceEventHandler(this.sdk.viewer.scene.canvas).setInputAction((function(e){if(!YJ.Measure.GetMeasureStatus())try{var t=Date.now();if(t-n<100)return clearTimeout(i),void(i=setTimeout((function(){s(e)}),100));clearTimeout(i),n=t,s(e)}catch(e){}}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}},{key:"queryByUserInfo",value:function(e){this.queryByPoint([e.position.lng,e.position.lat],e.position.alt,e.id)}},{key:"queryByPoint",value:(s=o()(a.a.mark((function e(t){var i,n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i="",i=this.options.host.endsWith("yjearth4.0")?this.options.host+"/api/v1/dth/build/query_by_point":this.options.host+"/yjearth4.0/api/v1/dth/build/query_by_point",i+="?point="+JSON.stringify({lng:t[0],lat:t[1]}),e.next=5,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 5:if(200!==(n=e.sent).status){e.next=11;break}return e.next=9,n.json();case 9:200===(o=e.sent).code||0===o.code?this.processQueryByPointResults(o.data):window.ELEMENT&&window.ELEMENT.Message({message:o.msg||o.message,type:"warning",duration:1500});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"processQueryByPointResults",value:(n=o()(a.a.mark((function e(t,i){var n,o,s,r,l,c,u,h=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=h.length>2&&void 0!==h[2]?h[2]:{heading:0,pitch:-90,roll:0},t.build_info&&this.handlePickEvent(t),this.clearAllDthPrimitive(),this.clearAllUnitPrimitive(),this.activeBuilding&&(this.clearBuildingPrimitive(this.activeBuilding),this.activeBuilding=null),!t.build_info){e.next=26;break}if(o=JSON.parse(t.build_info.range),t.dan_yuan.length>0)for(s=0;s<t.dan_yuan.length;s++)t.dan_yuan[s].children.length>0?this.addDthPrimitive(t.dan_yuan[s].children,t.build_info,t.dan_yuan[s]):this.addUnitPrimitive([t.dan_yuan[s]],t.build_info,t.dan_yuan[s]);else this.activeBuilding=t.build_info.ID||t.build_info.id,this.addBuildingPrimitive([t.build_info]);if(!i){e.next=26;break}if(t.info&&t.info.dan_yuan&&(o=JSON.parse(t.info.dan_yuan.range)),!t.info||!t.info.hu){e.next=25;break}for(o=JSON.parse(t.info.hu.range),r=0;r<o.length;r++)o[r].alt=t.info.hu.bottom;l=0;case 14:if(!(l<this.primitives.dth.length)){e.next=25;break}return e.next=17,this.primitives.dth[l].readyPromise;case 17:if((c=this.primitives.dth[l]._primitiveOptions.geometryInstances[0].id).ID!==t.info.hu.ID||c.room_num!==t.info.hu.room_num){e.next=22;break}return u={id:tn(tn({},t.info.hu),{},{build_info:tn({},t.build_info),unit_info:t.info.dan_yuan}),primitive:this.primitives.dth[l]},this.getIDBypickFeature(u),e.abrupt("break",25);case 22:l++,e.next=14;break;case 25:this.flyTo(o,n);case 26:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"addBuildingPrimitive",value:(i=o()(a.a.mark((function e(t){var i,n,o,s,r,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(i=0;i<t.length;i++){for(n=[],o=0,s=JSON.parse(t[i].range),r=0;r<s.length;r++)o<s[r].alt&&(o=s[r].alt),n.push(s[r].lng,s[r].lat,0);l=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(n)),extrudedHeight:1e8}),this.primitives.building.push(this.sdk.viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:new Cesium.GeometryInstance({id:tn({type:"yj-dth-build"},t[i]),geometry:Cesium.PolygonGeometry.createGeometry(l),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("rgb(255, 235, 59, 0.4)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}}),classificationType:Cesium.ClassificationType.CESIUM_3D_TILE})))}case 1:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"clearBuildingPrimitive",value:function(e){for(var t=this.primitives.building.length-1;t>=0;t--)if(e===this.primitives.building[t]._primitiveOptions.geometryInstances[0].id.ID||e===this.primitives.building[t]._primitiveOptions.geometryInstances[0].id.id){this.sdk.viewer.scene.primitives.remove(this.primitives.building[t]),this.primitives.building.splice(t,1);break}}},{key:"clearAllBuildingPrimitive",value:function(){for(var e=this.primitives.building.length-1;e>=0;e--)this.sdk.viewer.scene.primitives.remove(this.primitives.building[e]);this.primitives.building=[]}},{key:"addUnitPrimitive",value:(t=o()(a.a.mark((function e(t,i,n){var o,s,r,l,c,u;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(o=0;o<t.length;o++){for(s=[],r=0,l=JSON.parse(t[o].range),c=0;c<l.length;c++)r<l[c].alt&&(r=l[c].alt),s.push(l[c].lng,l[c].lat,0);u=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(s)),extrudedHeight:1e8}),this.primitives.unit.push(this.sdk.viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:new Cesium.GeometryInstance({id:tn(tn({type:"yj-dth-unit"},t[o]),{},{build_info:tn({},i),unit_info:tn({},n)}),geometry:Cesium.PolygonGeometry.createGeometry(u),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("rgb(255, 235, 59, 0.4)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}}),classificationType:Cesium.ClassificationType.CESIUM_3D_TILE}))),this.primitives.unit.push(this.sdk.viewer.scene.primitives.add(new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.GroundPolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArrayHeights(s),width:2}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("#00ff0a").withAlpha(.8))}}),appearance:new Cesium.PolylineColorAppearance})))}case 1:case"end":return e.stop()}}),e,this)}))),function(e,i,n){return t.apply(this,arguments)})},{key:"clearUnitPrimitive",value:function(e){for(var t=this.primitives.building.length-1;t>=0;t--)if(e===this.primitives.building[t]._primitiveOptions.geometryInstances[0].id.ID||e===this.primitives.building[t]._primitiveOptions.geometryInstances[0].id.id){this.sdk.viewer.scene.primitives.remove(this.primitives.unit[t]),this.primitives.unit.splice(t,1);break}}},{key:"clearAllUnitPrimitive",value:function(){for(var e=this.primitives.unit.length-1;e>=0;e--)this.sdk.viewer.scene.primitives.remove(this.primitives.unit[e]);this.primitives.unit=[]}},{key:"addDthPrimitive",value:function(e,t,i){for(var n=0;n<e.length;n++){for(var o=JSON.parse(e[n].range),s=[],a=0;a<o.length;a++)s.push(o[a].lng,o[a].lat,e[n].bottom+.3);var r=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(s)),perPositionHeight:!0,extrudedHeight:e[n].height+e[n].bottom}),l=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(s)),perPositionHeight:!0,extrudedHeight:e[n].bottom});this.primitives.dth.push(this.sdk.viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:new Cesium.GeometryInstance({id:tn(tn({type:"yj-dth-dth"},e[n]),{},{build_info:tn({},t),unit_info:tn({},i)}),geometry:Cesium.PolygonGeometry.createGeometry(r),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("rgb(0, 64, 255, 0.4)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}}),classificationType:Cesium.ClassificationType.CESIUM_3D_TILE}))),this.primitives.dth.push(this.sdk.viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:new Cesium.GeometryInstance({id:tn({type:"yj-dth-dth-border"},e[n]),geometry:Cesium.PolygonGeometry.createGeometry(l),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("rgb(0, 0, 0, 1)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}}),classificationType:Cesium.ClassificationType.CESIUM_3D_TILE})))}}},{key:"clearDthPrimitive",value:function(e){for(var t=this.primitives.dth.length-1;t>=0;t--)e!==this.primitives.dth[t]._primitiveOptions.geometryInstances[0].id.ID&&e!==this.primitives.dth[t]._primitiveOptions.geometryInstances[0].id.id||(this.sdk.viewer.scene.primitives.remove(this.primitives.dth[t]),this.primitives.dth.splice(t,1))}},{key:"clearAllDthPrimitive",value:function(){this.highlightPrimitive&&this.sdk.viewer.scene.primitives.remove(this.highlightPrimitive);for(var e=this.primitives.dth.length-1;e>=0;e--)this.sdk.viewer.scene.primitives.remove(this.primitives.dth[e]);this.primitives.dth=[]}},{key:"getIDBypickFeature",value:function(e){this.clickHighlightPrimitive&&(this.clickHighlightPrimitive.show=!0),this.highlightPrimitive&&this.sdk.viewer.scene.primitives.remove(this.highlightPrimitive),this.highlightPrimitive=this.sdk.viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:new Cesium.GeometryInstance({id:tn(tn({},e.id),{},{type:"yj-dth-highlight"}),geometry:e.primitive._primitiveOptions.geometryInstances[0].geometry,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("#ff9800").withAlpha(.8)),show:new Cesium.ShowGeometryInstanceAttribute(!0)}}),classificationType:Cesium.ClassificationType.CESIUM_3D_TILE})),this.highlightPrimitive.readyPromise.then((function(){e.primitive.show=!1})),this.clickHighlightPrimitive=e.primitive;var t=e.id.range;"string"==typeof e.id.range&&(t=JSON.parse(e.id.range)),this.getHilightArea(t),this.handlePickEvent(e.id)}},{key:"handlePickEvent",value:function(e){this.PickBuildingEvent.raiseEvent(e)}},{key:"getHilightArea",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=[];e.forEach((function(e){i.push([e.lng,e.lat])})),i.push(i[0]);var n=turf.polygon([i]),o=turf.buffer(n,Number(t)/1e3);return o.geometry.coordinates}},{key:"flyTo",value:(e=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=u.length>1&&void 0!==u[1]?u[1]:{heading:0,pitch:-90,roll:0},n=new YJ.Tools(this.sdk),o=0,s=[],r=0;case 5:if(!(r<t.length)){e.next=18;break}if(!t[r].alt){e.next=10;break}o=t[r].alt,e.next=13;break;case 10:return e.next=12,n.getClampToHeight(t[r]);case 12:o=e.sent;case 13:l=Cesium.Cartesian3.fromDegrees(t[r].lng,t[r].lat,o),s.push(l.x,l.y,l.z);case 15:r++,e.next=5;break;case 18:return e.next=20,Cesium.BoundingSphere.fromVertices(s);case 20:c=e.sent,this.sdk.viewer.camera.flyToBoundingSphere(c,{offset:{heading:Cesium.Math.toRadians(i.heading||0),pitch:Cesium.Math.toRadians(i.pitch||0===i.pitch?i.pitch:-90),roll:Cesium.Math.toRadians(i.roll||0)}});case 22:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})},{key:"activate",value:function(){this.isActivate=!0}},{key:"deactivate",value:function(){this.isActivate=!1}}]);var e,t,i,n,s}(),on=function(){return x()((function e(){k()(this,e),this.start()}),[{key:"start",value:function(){var e=this;navigator.mediaDevices.getDisplayMedia({video:!0}).then((function(t){e.mediaRecorder=new MediaRecorder(t,{mimeType:"video/webm"});var i=[];e.mediaRecorder.addEventListener("dataavailable",(function(e){i.push(e.data)})),e.mediaRecorder.addEventListener("stop",o()(a.a.mark((function e(){var t,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=new Blob(i,{type:"video/mp4"}),n={suggestedName:"视频录制.mp4",types:[{description:"文件类型",accept:{"video/mp4":[".mp4"]}}],excludeAcceptAllOption:!0},e.next=5,window.showSaveFilePicker(n);case 5:return o=e.sent,e.next=8,o.createWritable();case 8:return(s=e.sent).write(t),e.next=12,s.close();case 12:YJ.Global.ScreenRecord.screenRecord=null,e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),console.info("文件保存失败:",e.t0);case 18:case"end":return e.stop()}}),e,null,[[0,15]])})))),e.mediaRecorder.start()})).catch((function(e){console.info("取消录屏"),console.info(e),YJ.Global.ScreenRecord.screenRecord=null}))}}])}();var sn=i(7),an=i.n(sn),rn=i(5),ln=i.n(rn),cn=i(4),un=i.n(cn);function hn(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var pn=function(e){function t(e,i,n,o){var s;return k()(this,t),(s=hn(this,t,[e.viewer._container,n,o])).sdk=e,s.viewer=e.viewer,s.info=i,s._init(),s}return un()(t,e),x()(t,[{key:"_init",value:(i=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.init();case 2:return e.next=4,this._attribute();case 4:if(this.options.confirmCallBack&&((t=document.createElement("button")).className="confirm",t.innerHTML="确认",this.footAppChild(t),t.addEventListener("click",(function(){h.options.confirmCallBack&&h.options.confirmCallBack(h.info)}))),this.options.removeCallBack&&((i=document.createElement("button")).className="delete",i.innerHTML="删除",this.footAppChild(i),i.addEventListener("click",(function(){h.close(),h.options.removeCallBack&&h.options.removeCallBack()}))),this.options.rotateCallBack&&((n=document.createElement("button")).className="rotate",n.innerHTML="旋转",this.footAppChild(n),n.addEventListener("click",(function(){h.options.rotateCallBack&&h.options.rotateCallBack()}))),(this.options.translationalCallBack||this.options.updateHeightCallBack||this.options.secondaryEditCallBack)&&((o=document.createElement("div")).style.position="absolute",o.style.left="24px",o.style.flet="0",o.style.display="flex",this.footAppChild(o),this.options.updateHeightCallBack&&((s=document.createElement("button")).innerHTML='<svg class="icon-updateheigh"><use xlink:href="#yj-icon-updateheight"></use></svg>更新高程',s.style.width="auto",s.addEventListener("click",(function(){h.options.updateHeightCallBack()})),o.appendChild(s)),this.options.secondaryEditCallBack&&((r=document.createElement("button")).className="secondaryEdit",r.innerHTML='<svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>二次编辑',this.options.updateHeightCallBack&&(r.style.marginLeft="10px"),o.appendChild(r),r.addEventListener("click",(function(){h.options.secondaryEditCallBack&&h.options.secondaryEditCallBack()}))),this.options.translationalCallBack&&((l=document.createElement("button")).className="translational",l.innerHTML='<svg class="icon-py"><use xlink:href="#yj-icon-py"></use></svg>平移',(this.options.updateHeightCallBack||this.options.secondaryEditCallBack)&&(l.style.marginLeft="10px"),o.appendChild(l),l.addEventListener("click",(function(){h.options.translationalCallBack&&h.options.translationalCallBack()})))),this.options.addFootElm)for(c=0;c<this.options.addFootElm.length;c++)(u=document.createElement(this.options.addFootElm[c].tagName)).className=this.options.addFootElm[c].className,u.innerHTML=this.options.addFootElm[c].innerHTML,this.options.addFootElm[c].event&&2==this.options.addFootElm[c].event.length&&u.addEventListener(this.options.addFootElm[c].event[0],this.options.addFootElm[c].event[1]),this.footAppChild(u);case 9:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"_attribute",value:function(){var e=this._element.content.getElementsByClassName("attribute")[0];if(e&&0!==e.length)for(var t=e.getElementsByClassName("attribute-select")[0].getElementsByTagName("option"),i=t.length-1;i>=0;i--)for(var n in this.info.attribute)if(t[i].value===n){this.info.attribute[n].disabled&&(t[i].disabled=!0);break}}}]);var i}(J);function dn(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 mn(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?dn(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):dn(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var fn=new vi;function vn(){return(vn=o()(a.a.mark((function e(t,i,n,s){var r,l,c,u,h,p,d,m,f,v,g,y,b,C,w,k,_,x,E,S,P,D,M,T,O,N,B,A,L,I,j,R,F,z,H,V,G,W,U,Y,J,X,Z,K,Q,$,ee,te,ie,ne,oe,se,ae,re,le,ce,ue,he,pe,de,me,fe,ve,ge,ye;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ye=function(){var e,t=document.createElement("canvas"),i=t.getContext("2d"),o=new Image;o.src=s,o.onload=function(){if(!p){var s=mn({},v),a=JSON.parse(JSON.stringify(y)),l=mn({},b),c=mn({},g);c.width=g.width/A.width*o.width;var u=m/A.width*o.width,h=u;if(c.show&&d&&d.complete&&(h+=c.width),t.width=o.width+2*h,t.height=o.height+2*h,i.clearRect(0,0,t.width,t.height),i.rect(0,0,t.width,t.height),i.fillStyle="#ffffff",i.fill(),i.drawImage(o,h,h,o.width,o.height),s.show){var f=s.text,C=Math.max(5,s.height*o.height*.5);i.font="".concat(C,"px serif"),i.fillStyle=s.bgColor||"#5d5d5d",i.fillRect(h,h,t.width-2*h,s.height*o.height),i.fillStyle=s.color||"white",i.textAlign="center",i.textBaseline="middle",i.fillText(f,t.width/2,s.height*o.height/2+h)}for(var w=function(e){if(a[e].show)if("text"in a[e])i.font="".concat(o.height*a[e].height,"px serif"),i.fillStyle=a[e].color||"white",i.textAlign="left",i.textBaseline="bottom",a[e].width=i.measureText(a[e].text).width/o.height,i.fillText(a[e].text,o.width*a[e].x+h,o.height*a[e].y+h);else if("url"in a[e])if(y[e].svg&&y[e].svg.complete)i.drawImage(y[e].svg,o.width*a[e].x+h,o.height*a[e].y+h,o.height*a[e].width,o.height*a[e].height);else{var t=new Image;t.src=fn.getSourceRootPath()+a[e].url,t.onload=function(){a[e].svg=t,i.drawImage(t,o.width*a[e].x+h,o.height*a[e].y+h,o.height*a[e].width,o.height*a[e].height)}}},k=0;k<a.length;k++)w(k);if(l.show){!function(){if(!n)return;var t=Cesium.Math.toDegrees(n.west),i=Cesium.Math.toDegrees(n.east),s=Cesium.Math.toDegrees(n.north),a=(Cesium.Math.toDegrees(n.south),turf.point([t,s])),r=turf.point([i,s]),l=turf.distance(a,r,{units:"kilometers"});e=1e3*l/o.width}();var _=o.width*l.x+h,x=o.height*l.y+h,E="m",S=.08*o.width*.12,P=.08*o.width/l.cell,D=Math.round(e*P),M=D+"";if(D<10);else{D=Number(M[0]);for(var T=0;T<M.length-1;T++)D*=10;P=D/e}l.width=P*l.cell,l.height=.2*l.width,D>=1e3&&(E="㎞",D=Math.round(D/1e3));var O=x;i.beginPath(),i.moveTo(_,O),i.lineTo(_+l.width,O),i.strokeStyle=l.color,i.lineWidth=.01*l.width,i.stroke();for(var N=0,B=0;B<=l.cell;B++)N=_+B*P,i.beginPath(),i.moveTo(N,O-.1*l.width),i.lineTo(N,O),i.strokeStyle=l.color,i.lineWidth=.01*l.width,i.stroke(),i.font="".concat(S,"px Arial"),i.fillStyle=l.color,i.textAlign="center",i.textBaseline="bottom",i.fillText(B*D,N,O-.1*l.width);i.font="".concat(S,"px Arial"),i.fillStyle=l.color,i.textAlign="left",i.textBaseline="bottom",i.fillText(E,N+1.2*S,O-.1*l.width)}c.show&&d&&d.complete&&(L(i,d,u,u,c.width,"top",1),L(i,d,t.width-c.width-u,u,c.width,"right",1),L(i,d,t.width-c.width-u,t.height-c.width-u,c.width,"bottom",1),L(i,d,u,t.height-c.width-u,c.width,"left",1)),t.toBlob((function(e){var t=URL.createObjectURL(e),i=document.createElement("a");i.href=t,i.download="高清出图-".concat(ge(),".png"),document.body.appendChild(i),i.click(),document.body.removeChild(i)}),"image/png",.95),r=!1,G.innerHTML="打印"}function L(e,i,n,o,s,a){var r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;switch(e.save(),e.translate(n+s/2,o+s/2),a){case"right":e.rotate(Math.PI/2);break;case"bottom":e.rotate(Math.PI);break;case"left":e.rotate(3*Math.PI/2)}e.beginPath(),e.moveTo(-s*r/2,-s/2),"top"===a||"bottom"===a?(e.lineTo(t.width-2*u-s/2,-s/2),e.lineTo(t.width-2*(u+s)+s/2,s/2)):(e.lineTo(t.height-2*u-s/2,-s/2),e.lineTo(t.height-2*(u+s)+s/2,s/2)),e.lineTo(s*r/2,s/2),e.closePath(),e.clip();var l,h=i.width/i.height*s;e.drawImage(i,-s/2,-s/2,h,s),l="top"===a||"bottom"===a?Math.ceil((t.width-2*u-2*c.width)/c.width):Math.ceil((t.height-2*u-2*c.width)/c.width),l++;for(var p=1;p<=l;p++)e.drawImage(i,-s/2+h*p,-s/2,h,s);e.restore()}}},ge=function(){var e=new Date,t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0"),o=String(e.getHours()).padStart(2,"0"),s=String(e.getMinutes()).padStart(2,"0"),a=String(e.getSeconds()).padStart(2,"0"),r=String(e.getMilliseconds()).padStart(3,"0");return"".concat(t).concat(i).concat(n).concat(o).concat(s).concat(a).concat(r)},ve=function(){if(n){var e=Cesium.Math.toDegrees(n.west),t=Cesium.Math.toDegrees(n.east),i=Cesium.Math.toDegrees(n.north),o=(Cesium.Math.toDegrees(n.south),turf.point([e,i])),s=turf.point([t,i]),a=turf.distance(o,s,{units:"kilometers"});h=1e3*a/A.width}},fe=function(e){var t=m;g.show&&d&&d.complete&&(t+=g.width);var i=.005*N.height;if(B.strokeStyle="red",B.lineWidth=.002*N.height,"text"in e)B.strokeRect(A.width*e.x+t,A.height*e.y+t-A.height*e.height,A.height*e.width,A.height*e.height);else if("url"in e)B.strokeRect(A.width*e.x+t,A.height*e.y+t,A.height*e.width,A.height*e.height);else if(e===b)return void B.strokeRect(A.width*e.x+t-.2*b.width,A.height*e.y+t-e.height-.5*b.height,e.width+.6*b.width,e.height+b.height);var n=pe(e,t);B.fillStyle="red",n.forEach((function(e){B.beginPath(),B.arc(e.x,e.y,i,0,2*Math.PI),B.fill()}))},me=function(e,t,i,n,o,s){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;switch(e.save(),e.translate(i+o/2,n+o/2),s){case"right":e.rotate(Math.PI/2);break;case"bottom":e.rotate(Math.PI);break;case"left":e.rotate(3*Math.PI/2)}e.beginPath(),e.moveTo(-o*a/2,-o/2),"top"===s||"bottom"===s?(e.lineTo(N.width-2*m-o/2,-o/2),e.lineTo(N.width-2*(m+o)+o/2,o/2)):(e.lineTo(N.height-2*m-o/2,-o/2),e.lineTo(N.height-2*(m+o)+o/2,o/2)),e.lineTo(o*a/2,o/2),e.closePath(),e.clip();var r,l=t.width/t.height*o;e.drawImage(t,-o/2,-o/2,l,o),r="top"===s||"bottom"===s?Math.ceil((N.width-2*m-2*g.width)/g.width):Math.ceil((N.height-2*m-2*g.width)/g.width),r++;for(var c=1;c<=r;c++)e.drawImage(t,-o/2+l*c,-o/2,l,o);e.restore()},de=function(){if(!p){var e=m;if(g.show&&d&&d.complete&&(e+=g.width),N.width=A.width+2*e,N.height=A.height+2*e,B.clearRect(0,0,N.width,N.height),B.rect(0,0,N.width,N.height),B.fillStyle="#ffffff",B.fill(),B.drawImage(A,e,e,A.width,A.height),v.show){var t=v.text,i=Math.max(5,v.height*A.height*.5);B.font="".concat(i,"px serif"),B.fillStyle=v.bgColor||"#5d5d5d",B.fillRect(e,e,N.width-2*e,v.height*A.height),B.fillStyle=v.color||"white",B.textAlign="center",B.textBaseline="middle",B.fillText(t,N.width/2,v.height*A.height/2+e)}for(var n=function(t){if(y[t].show)if("text"in y[t])B.font="".concat(A.height*y[t].height,"px serif"),B.fillStyle=y[t].color||"white",B.textAlign="left",B.textBaseline="bottom",y[t].width=B.measureText(y[t].text).width/A.height,B.fillText(y[t].text,A.width*y[t].x+e,A.height*y[t].y+e),y[t].isSelected&&fe(y[t]);else if("url"in y[t])if(y[t].svg&&y[t].svg.complete)B.drawImage(y[t].svg,A.width*y[t].x+e,A.height*y[t].y+e,A.height*y[t].width,A.height*y[t].height),y[t].isSelected&&fe(y[t]);else{var i=new Image;i.src=fn.getSourceRootPath()+y[t].url,i.onload=function(){y[t].svg=i,B.drawImage(i,A.width*y[t].x+e,A.height*y[t].y+e,A.height*y[t].width,A.height*y[t].height),y[t].isSelected&&fe(y[t])}}},o=0;o<y.length;o++)n(o);if(b.show){var s=m;g.show&&d&&d.complete&&(s+=g.width);var a=A.width*b.x+s,r=A.height*b.y+s,l="m",c=.08*A.width*.12,u=.08*A.width/b.cell,f=Math.round(h*u),C=f+"";if(f<10);else{f=Number(C[0]);for(var w=0;w<C.length-1;w++)f*=10;u=f/h}b.width=u*b.cell,b.height=.2*b.width,f>=1e3&&(l="㎞",f=Math.round(f/1e3));var k=r;B.beginPath(),B.moveTo(a,k),B.lineTo(a+b.width,k),B.strokeStyle=b.color,B.lineWidth=.01*b.width,B.stroke();for(var _=0,x=0;x<=b.cell;x++)_=a+x*u,B.beginPath(),B.moveTo(_,k-.1*b.width),B.lineTo(_,k),B.strokeStyle=b.color,B.lineWidth=.01*b.width,B.stroke(),B.font="".concat(c,"px Arial"),B.fillStyle=b.color,B.textAlign="center",B.textBaseline="bottom",B.fillText(x*f,_,k-.1*b.width);B.font="".concat(c,"px Arial"),B.fillStyle=b.color,B.textAlign="left",B.textBaseline="bottom",B.fillText(l,_+1.2*c,k-.1*b.width),b.isSelected&&fe(b)}g.show&&d&&d.complete&&(me(B,d,m,m,g.width,"top",1),me(B,d,N.width-g.width-m,m,g.width,"right",1),me(B,d,N.width-g.width-m,N.height-g.width-m,g.width,"bottom",1),me(B,d,m,N.height-g.width-m,g.width,"left",1))}},pe=function(e,t){var i=e.x*A.width+t,n=e.y*A.height+t,o=e.width*A.height,s=e.height*A.height;return"text"in e?[{x:i,y:n-s},{x:i+o,y:n-s},{x:i,y:n},{x:i+o,y:n}]:[{x:i,y:n},{x:i+o,y:n},{x:i,y:n+s},{x:i+o,y:n+s}]},he=function(e){var t,i=N.getBoundingClientRect(),n=i.width,o=i.height,s=N.width,a=N.height,r=(n-s*(t=s/a>n/o?n/s:o/a))/2;return(e.clientX-i.left-r)/t},ue=function(e){var t,i=N.getBoundingClientRect(),n=i.width,o=i.height,s=N.width,a=N.height,r=(t=s/a>n/o?n/s:o/a,(o-a*t)/2);return(e.clientY-i.top-r)/t},J=function(e){var t,i;if(g.color=e||"#000000",new YJColorPicker({el:w.getElementsByClassName("border-color")[0],size:"mini",alpha:!1,defaultColor:g.color,disabled:!1,openPickerAni:"opacity",sure:function(e){J(e)},clear:function(){J("rgba(0,0,0,1)")}}),e){t=f.replace(/fill="[^"]+"/g,'fill="'.concat(e,'"'))}else t=f;i="data:image/svg+xml;base64,"+btoa(Array.from((new TextEncoder).encode(t),(function(e){return String.fromCharCode(e)})).join("")),(d=new Image).setAttribute("crossOrigin","anonymous"),d.src=i,d.onload=function(){g.show&&de()}},Y=function(e){g.url=e,g.url&&((d=new Image).setAttribute("crossOrigin","anonymous"),g.url.endsWith("svg")?fetch(fn.getSourceRootPath()+g.url).then(function(){var e=o()(a.a.mark((function e(t){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.ok){e.next=5;break}return e.next=3,t.text();case 3:f=e.sent,J(g.color);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()):(d.src=fn.getSourceRootPath()+g.url,d.onload=function(){g.show&&de()}))},U=function(e){u=e,l=[{name:"模板一",value:"模板一",id:"1",margin:.03,title:{text:"标题一",height:.05,bgColor:"#5d5d5d",color:"#ffffff",show:!0},border:{show:!1,url:"/custom/img/map-border1.svg",width:.01,color:""},plottingScale:{cell:2,color:"#ffffff",show:!0,isSelected:!1,x:.87,y:.97},data:[{text:"",x:.02,y:.93,isSelected:!1,show:!0,color:"#ffffff",height:.03},{text:"",x:.02,y:.97,isSelected:!1,show:!0,color:"#ffffff",height:.03},{x:.02,y:.1,show:!1,isSelected:!1,url:"/custom/img/icon-compass1.svg",width:.1,height:.1}]},{name:"模板二",value:"模板二",id:"2",margin:.03,border:{show:!0,url:"/custom/img/map-border2.svg",width:.01},title:{text:"标题二",height:.05,bgColor:"#5d5d5d",color:"#ffffff",show:!0},plottingScale:{cell:2,color:"#ffffff",show:!0,isSelected:!1,x:.02,y:.97},data:[{text:"",x:.88,y:.93,isSelected:!1,show:!0,color:"#ffffff",height:.03},{text:"",x:.87,y:.97,isSelected:!1,show:!0,color:"#ffffff",height:.03},{x:.91,y:.1,show:!0,isSelected:!1,url:"/custom/img/icon-compass4.svg",width:.1,height:.1}]}];for(var t=0;t<l.length;t++)if(l[t].id===u){v=l[t].title||v,m=l[t].margin||0==l[t].margin?l[t].margin:m,y=l[t].data||y,(g=l[t].border||g).color=g.color||"#000000",b=l[t].plottingScale||b;break}W(),de()},W=function(){if(!p){m*=A.width,Z=A.height/140,x.value=v.text,E.checked=v.show,S.value=y[1].text,P.checked=y[1].show,D.checked=y[2].show;for(var e=0;e<C.length;e++)C[e]===y[2].url&&(M[e].checked=!0);T.checked=b.show,g.width=A.width*g.width;var t=m;g.show&&d&&d.complete&&(t+=g.width),N.width=A.width+2*t,N.height=A.height+2*t,R&&(R.checked=y[0].show),j&&(y[0].text?j.setValue(y[0].text):(j.nowBtn&&j.nowBtn(),y[0].text=j.getValue())),z&&F&&H&&(F.value=g.url,z.legp_searchActive(g.url),H.style.backgroundImage="url(".concat(fn.getSourceRootPath()+g.url,")")),O.checked=g.show,d=null,g&&g.url&&Y(g.url)}},r=!1,l=[{name:"模板一",value:"模板一",id:"1",margin:.03,title:{text:"标题一",height:.05,bgColor:"#5d5d5d",color:"#ffffff",show:!0},border:{show:!1,url:"/custom/img/map-border1.svg",width:.01,color:""},plottingScale:{cell:2,color:"#ffffff",show:!0,isSelected:!1,x:.87,y:.97},data:[{text:"",x:.02,y:.93,isSelected:!1,show:!0,color:"#ffffff",height:.03},{text:"",x:.02,y:.97,isSelected:!1,show:!0,color:"#ffffff",height:.03},{x:.02,y:.1,show:!1,isSelected:!1,url:"/custom/img/icon-compass1.svg",width:.1,height:.1}]},{name:"模板二",value:"模板二",id:"2",margin:.03,border:{show:!0,url:"/custom/img/map-border2.svg",width:.01},title:{text:"标题二",height:.05,bgColor:"#5d5d5d",color:"#ffffff",show:!0},plottingScale:{cell:2,color:"#ffffff",show:!0,isSelected:!1,x:.02,y:.97},data:[{text:"",x:.88,y:.93,isSelected:!1,show:!0,color:"#ffffff",height:.03},{text:"",x:.87,y:.97,isSelected:!1,show:!0,color:"#ffffff",height:.03},{x:.91,y:.1,show:!0,isSelected:!1,url:"/custom/img/icon-compass4.svg",width:.1,height:.1}]}],u="1",p=!0,m=0,v={text:"标题",height:40,bgColor:"#5d5d5d",color:"#ffffff",show:!0},g={show:!0,url:fn.getSourceRootPath()+"/custom/img/map-border1.svg",width:20},y=[{text:"",x:10,y:100,height:24,fontSize:24,isSelected:!1,show:!0,color:"#ffffff"},{text:"-",x:10,y:100,height:24,fontSize:24,isSelected:!1,show:!0,color:"#ffffff"},{x:10,y:100,width:100,height:100,show:!1,isSelected:!1,url:fn.getSourceRootPath()+"/custom/img/icon-compass1.svg"}],b={cell:2,color:"#ffffff",show:!0,isSelected:!1,x:10,y:100,width:100},C=["/custom/img/icon-compass1.svg","/custom/img/icon-compass2.svg","/custom/img/icon-compass3.svg","/custom/img/icon-compass4.svg"],c&&(c.close(),c=null),e.next=26,new pn(t,{},{title:"地图打印",left:"5%",top:"10%",ismove:!1});case 26:(c=e.sent)._element.body.className=c._element.body.className+" map-print",(w=document.createElement("div")).innerHTML='\n <div class="left">\n <div class="div-item">\n <div class="title">图件信息</div>\n <div class="row" style="align-items: flex-start;">\n <div class="col template-box">\n <span class="label" style="flex: 0 0 56px;">模板</span>\n <div class="template" style="width: 213px;"></div>\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">标题</span>\n <input class="title-input" type="text">\n <input class="title-checkbox" type="checkbox" style="margin-left: 15px;">\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">制图日期</span>\n <input class="print-date" type="text" placeholder="YYYY-MM-DD" readonly>\n <input class="print-date-checkbox" type="checkbox" style="margin-left: 15px;">\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">制图单位</span>\n <input class="unit-input" type="text">\n <input class="unit-checkbox" type="checkbox" style="margin-left: 15px;">\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col map-border-box">\n <span class="label" style="flex: 0 0 56px;">图框</span>\n <div class="map-border" style="width: 173px;"></div>\n <div class="border-color" style="margin-top: 3px;margin-left: 12px;"></div>\n <input class="map-border-checkbox" type="checkbox" style="margin-left: 15px;">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="title">地图要素</div>\n <div class="row" style="align-items: flex-start;">\n <div class="col" style="align-items: flex-start;">\n <span class="label" style="flex: 0 0 56px;margin-top: 9px;">指北针</span>\n <input class="compass-checkbox" type="checkbox" style="margin-top: 11px;">\n <div class="row">\n <div class="col" style="margin-left: 10px;flex-wrap: wrap;">\n '.concat(function(){for(var e="",t=0;t<C.length;t++){var i=fn.getSourceRootPath()+C[t];e+='<div style="display: flex;align-items: center;">\n <input class="compass-radio" type="radio" name="option">\n <img src="'.concat(i,'" alt="" style="width: 38px; height: 38px; margin: 0 5px;">\n </div>')}return e}(),'\n </div>\n </div>\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col" style="align-items: flex-start;">\n <span class="label" style="flex: 0 0 56px;margin-top: 9px;">比例尺</span>\n <input class="plotting-scale-checkbox" type="checkbox" style="margin-top: 11px;">\n </div>\n </div>\n </div>\n </div>\n <div class="right">\n <div class="map-img-box">\n\n </div>\n </div>\n '),c.contentAppChild(w),k=w.getElementsByClassName("left")[0],_=w.getElementsByClassName("right")[0],x=k.getElementsByClassName("title-input")[0],E=k.getElementsByClassName("title-checkbox")[0],S=k.getElementsByClassName("unit-input")[0],P=k.getElementsByClassName("unit-checkbox")[0],D=k.getElementsByClassName("compass-checkbox")[0],M=k.getElementsByClassName("compass-radio"),T=k.getElementsByClassName("plotting-scale-checkbox")[0],O=k.getElementsByClassName("map-border-checkbox")[0],N=document.createElement("canvas"),B=N.getContext("2d"),_.appendChild(N),(A=new Image).src=i,A.onload=function(){p=!1,ve(),U(u)},x.value=v.text,E.checked=v.show,x.addEventListener("input",(function(){v.text=this.value,A.complete&&de()})),E.addEventListener("change",(function(){v.show=this.checked,A.complete&&de()})),S.value=y[1].text,P.checked=y[1].show,S.addEventListener("input",(function(){y[1].text=this.value,A&&A.complete&&de()})),P.addEventListener("change",(function(){y[1].show=this.checked,A&&A.complete&&de()})),D.checked=y[2].show,D.addEventListener("change",(function(){y[2].show=this.checked,A&&A.complete&&de()})),L=a.a.mark((function e(t){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:M[t].addEventListener("change",(function(){this.checked&&(y[2].svg=null,y[2].url=C[t],A&&A.complete&&de())}));case 1:case"end":return e.stop()}}),e)})),I=0;case 59:if(!(I<M.length)){e.next=64;break}return e.delegateYield(L(I),"t0",61);case 61:I++,e.next=59;break;case 64:T.checked=b.show,T.addEventListener("change",(function(){b.show=this.checked,A&&A.complete&&de()})),O.checked=g.show,O.addEventListener("change",(function(){g.show=this.checked,d&&d.complete&&de()})),new YJColorPicker({el:w.getElementsByClassName("border-color")[0],size:"mini",alpha:!1,defaultColor:g.color,disabled:!1,openPickerAni:"opacity",sure:function(e){J(e)},clear:function(){J("rgba(0,0,0,1)")}}),setTimeout((function(){V=c._element.foot.getElementsByClassName("close")[0],(G=document.createElement("button")).className="export",G.innerHTML="打印",k.appendChild(V),k.appendChild(G),G.addEventListener("click",(function(){r||(r=!0,G.innerHTML='<span style="position: absolute;width:100%;height:100%;top: 0;left: 0;border-radius: 3px;background-color: #6f89848f;"><svg class="icon-load"><use xlink:href="#yj-icon-load"></use></svg></span>打印',ye())}));var e=w.getElementsByClassName("print-date")[0];(R=w.getElementsByClassName("print-date-checkbox")[0]).checked=y[0].show,R.addEventListener("change",(function(){y[0].show=this.checked,A.complete&&de()})),j=jeDate(e,{format:"YYYY-MM-DD",isinitVal:!0,isClear:!1,donefun:function(e){y[0].text=e.val,A.complete&&de()}}),y[0].text?j.setValue(y[0].text):(j.nowBtn&&j.nowBtn(),y[0].text=j.getValue(),de());var t=q(c._element.content.getElementsByClassName("template-box")[0],".template");if(t){t.legp_search(l);for(var i=c._element.content.getElementsByClassName("template")[0].getElementsByTagName("input")[0],n=0;n<l.length;n++)if(l[n].id==u){i.value=l[n].value,t.legp_searchActive(l[n].value);break}i.addEventListener("input",(function(){for(var e=0;e<l.length;e++)if(l[e].value===i.value){U(l[e].id);break}}))}var o=[{name:'<span style="background-image: url('.concat(fn.getSourceRootPath(),'/custom/img/map-border1.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border1.svg",key:0},{name:'<span style="background-image: url('.concat(fn.getSourceRootPath(),'/custom/img/map-border2.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border2.svg",key:1},{name:'<span style="background-image: url('.concat(fn.getSourceRootPath(),'/custom/img/map-border3.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border3.svg",key:2},{name:'<span style="background-image: url('.concat(fn.getSourceRootPath(),'/custom/img/map-border4.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border4.svg",key:3},{name:'<span style="background-image: url('.concat(fn.getSourceRootPath(),'/custom/img/map-border5.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border5.svg",key:4},{name:'<span style="background-image: url('.concat(fn.getSourceRootPath(),'/custom/img/map-border6.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border6.svg",key:5}];if(z=q(c._element.content.getElementsByClassName("map-border-box")[0],".map-border")){z.legp_search(o),(H=document.createElement("span")).className="icon icon-active",H.style.width="calc(100% - 40px)",H.style.height="calc(100% - 12px)",H.style.position="absolute",H.style.top="6px",H.style.left="10px",H.style.pointerEvents="none",H.style.backgroundImage="url(".concat(fn.getSourceRootPath()+g.url,")"),H.style.backgroundSize="auto 100%",H.style.backgroundRepeat="repeat-x",c._element.content.getElementsByClassName("map-border")[0].getElementsByClassName("cy_datalist")[0].appendChild(H),(F=c._element.content.getElementsByClassName("map-border")[0].getElementsByTagName("input")[0]).style.fontSize=0,F.style.color="transparent";for(var s=0;s<o.length;s++)if(o[s].value==g.url){F.value=o[s].value,z.legp_searchActive(o[s].value);break}F.addEventListener("input",(function(){for(var e=0;e<o.length;e++)if(o[e].value===F.value){H.style.backgroundImage="url(".concat(fn.getSourceRootPath()+o[e].value,")"),Y(o[e].value);break}}))}}),0),X=!1,Z=5,K=null,Q=!1,$=!1,ee=null,N.addEventListener("mousedown",(function(e){var t=he(e),i=ue(e),n=m;if(g.show&&d&&d.complete&&(n+=g.width),v.show&&i>=v.height*A.height+n-Z&&i<=v.height*A.height+n+Z){X=!0;for(var o=0;o<y.length;o++)y[o].isSelected=!1;return K=null,Q=!1,$=!1,void(ee=null)}if(K&&K!==b){var s=.005*N.height;pe(K,n).forEach((function(e,n){t>=e.x-s&&t<=e.x+s&&i>=e.y-s&&i<=e.y+s&&($=!0,Q=!1,ee=n,te=t,ie=i,re=K.width*A.height,le=K.height*A.height,"text"in K&&(re=K.width*A.height,ce=K.height))}))}if(!$){for(var a=0;a<y.length;a++)y[a].isSelected=!1;b.isSelected=!1,K=null,Q=!1,$=!1,ee=null;for(var r=y.length-1;r>=0;r--)if(y[r].show){if("text"in y[r]&&t>=A.width*y[r].x+n&&t<=A.width*y[r].x+n+A.height*y[r].width&&i>=A.height*y[r].y+n-A.height*y[r].height&&i<=A.height*y[r].y+n){K=y[r],y[r].isSelected=!0,Q=!0,te=t,ie=i,ne=A.height*y[r].y-A.height*y[r].height,oe=A.width*y[r].x+A.height*y[r].width,se=A.width*y[r].x+n,ae=A.height*y[r].y+n,de();break}if("url"in y[r]&&y[r].svg&&y[r].svg.complete&&y[r].show&&t>=A.width*y[r].x+n&&t<=A.width*y[r].x+n+A.height*y[r].width&&i>=A.height*y[r].y+n&&i<=A.height*y[r].y+n+A.height*y[r].height){K=y[r],y[r].isSelected=!0,Q=!0,te=t,ie=i,ne=A.height*y[r].y+A.height*y[r].height,oe=A.width*y[r].x+A.height*y[r].width,se=A.width*y[r].x+n,ae=A.height*y[r].y+n,de();break}}b.show&&t>=A.width*b.x+n-.2*b.width&&t<=A.width*b.x+n-.2*b.width+b.width+.6*b.width&&i>=A.height*b.y+n-b.height-.5*b.height&&i<=A.height*b.y+n-.5*b.height+b.height&&(K=b,b.isSelected=!0,Q=!0,te=t,ie=i,ne=A.height*b.y+n+b.height,oe=A.width*b.x+n+b.width,se=A.width*b.x+n,ae=A.height*b.y+n,de()),K||de()}})),N.addEventListener("mousemove",(function(e){var t=m;g.show&&d&&d.complete&&(t+=g.width);var i=he(e),n=ue(e);if(!(i<0||n<0||i>N.width||n>N.height)){if(v.show){var o=m;g.show&&d&&d.complete&&(o+=g.width),n>=v.height*A.height+o-Z&&n<=v.height*A.height+o+Z?N.style.cursor="n-resize":N.style.cursor="default",X&&(v.height=Math.min(Math.max(n-o,30)/A.height,1),de())}if(Q){var s=i-te,a=n-ie;K.x=(se+s-t)/A.width,K.y=(ae+a-t)/A.height,de()}if($){var r,l=i-te,c=n-ie;switch(ee){case 0:"text"in K?(r=(re-l)/re,K.height=Math.max(10/A.height,ce*r),K.x=(oe-K.width*A.height)/A.width):"url"in K&&(K.x=(oe-K.width*A.height)/A.width,K.y=(ne-K.height*A.height)/A.height,K.width=Math.max(10,re-l)/A.height,K.height=Math.max(10,le-c)/A.height);break;case 1:"text"in K?(r=(re+l)/re,K.height=Math.max(10/A.height,ce*r)):"url"in K&&(K.width=Math.max(10,re+l)/A.height,K.height=Math.max(10,le-c)/A.height,K.y=(ne-K.height*A.height)/A.height);break;case 2:"text"in K?(r=(re-l)/re,K.height=Math.max(10/A.height,ce*r),K.x=(oe-K.width*A.height)/A.width,K.y=(ne+K.height*A.height)/A.height):"url"in K&&(K.x=(oe-K.width*A.height)/A.width,K.width=Math.max(10,re-l)/A.height,K.height=Math.max(10,le+c)/A.height);break;case 3:"text"in K?(r=(re+l)/re,K.height=Math.max(10/A.height,ce*r),K.y=(ne+K.height*A.height)/A.height):"url"in K&&(K.width=Math.max(10,re+l)/A.height,K.height=Math.max(10,le+c)/A.height)}de()}}})),document.addEventListener("mouseup",(function(){X=!1;g.show&&d&&d.complete&&g.width;for(var e=0;e<y.length;e++)y[e].show&&y[e].isSelected&&(ne=A.height*y[e].y-A.height*y[e].height,oe=A.width*y[e].x+A.height*y[e].width,"url"in y[e]&&(ne=A.height*y[e].y+A.height*y[e].height,oe=A.width*y[e].x+A.height*y[e].width),se=y[e].x,ae=y[e].y);b.show&&b.isSelected&&(ne=b.y+b.height,oe=b.x+b.width,se=b.x,ae=b.y),Q=!1,$=!1,ee=null}));case 79:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var gn=function(e,t,i,n){return vn.apply(this,arguments)};var yn;function bn(){return(bn=o()(a.a.mark((function e(t){var i,n,o=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=o.length>1&&void 0!==o[1]?o[1]:function(){},n=t.viewer.canvas.toDataURL(),i&&i(n);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Cn(){return(Cn=o()(a.a.mark((function e(t){var i,n,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w,_,E,S=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(S.length>1&&void 0!==S[1]?S[1]:{},S.length>2&&void 0!==S[2]?S[2]:function(){},t){e.next=4;break}return e.abrupt("return");case 4:return Xe(),St(t),yn&&(yn.close(),yn=null),i=t.viewer.scene.screenSpaceCameraController.enableTranslate,n=t.viewer.scene.screenSpaceCameraController.enableTilt,s=t.viewer.scene.screenSpaceCameraController.enableLook,r=1,m=new vi,e.next=14,new pn(t,{},{title:"高清出图",left:"180px",top:"100px",confirmCallBack:function(e){d&&(d.desist(),d=null),c&&(c.style.width="0%"),h&&(h.style.left="0%"),u&&(u.style.width="0%"),p&&(p.innerHTML="0%"),d=new E},closeCallBack:function(){t.viewer.scene.screenSpaceCameraController.enableTranslate=i,t.viewer.scene.screenSpaceCameraController.enableTilt=n,t.viewer.scene.screenSpaceCameraController.enableLook=s,t.viewer._element.getElementsByClassName("compass")[0].style.pointerEvents="auto",d&&(d.desist(),d=null),yn=void 0}});case 14:for((yn=e.sent)._element.body.className=yn._element.body.className+" screenShotHD",(f=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row text" style="align-items: flex-start;">\n <div class="col">\n <span>当前窗口长宽:<span class="input-width">'.concat(t.viewer.canvas.width,'</span>*<span class="input-height">').concat(t.viewer.canvas.height,'</span>像素</span>\n </div>\n </div>\n <div class="row scale-box" style="align-items: flex-start;">\n <div class="col">\n <span class="label">图片大小</span>\n <div class="input input-select scale"></div>\n <span>倍窗口</span>\n </div>\n </div>\n <div class="row text" style="align-items: flex-start;">\n <div class="col">\n <span>输出图片长宽:<span class="output-width">').concat(t.viewer.canvas.width*r,'</span>*<span class="output-height">').concat(t.viewer.canvas.height*r,'</span>像素</span>\n </div>\n </div>\n <div class="row" style="align-items: flex-start; margin-bottom: 20px;">\n <div class="col">\n <span class="label">输出进度</span>\n <div class="range-box">\n <div class="range-bg">\n <div class="range-process-box">\n <div class="range-process"></div>\n </div>\n </div>\n <div class="range-node-box">\n <span class="range-node-text">0%</span>\n <span class="range-node-text">100%</span>\n <div class="range-node-active"><span class="range-node-active-text">0%</span></div>\n </div>\n <input class="progress-input" type="range" max="100" min="0" step="0.01">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n '),yn.contentAppChild(f),t.viewer.scene.screenSpaceCameraController.enableTranslate=!1,t.viewer.scene.screenSpaceCameraController.enableTilt=!1,t.viewer.scene.screenSpaceCameraController.enableLook=!1,t.viewer._element.getElementsByClassName("compass")[0].style.pointerEvents="none",(v=t.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(t.viewer.canvas.clientWidth/2,t.viewer.canvas.clientHeight/2)))||(v=t.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(t.viewer.canvas.clientWidth/2,t.viewer.canvas.clientHeight/(2-(90+t.viewer.camera.pitch/(Cesium.Math.PI/180))/110))))||(v=t.viewer.camera.position),g=m.cartesian3Towgs84(t.viewer.camera.position,t.viewer).alt,y=m.cartesian3Towgs84(v,t.viewer),t.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(y.lng,y.lat,g),orientation:{heading:0,pitch:Cesium.Math.toRadians(-90),roll:0},duration:1}),b=[],C=1;C<=10;C++)b.push({name:C,value:C});c=document.getElementsByClassName("progress-input")[0],u=document.getElementsByClassName("range-process")[0],h=f.getElementsByClassName("range-node-active")[0],p=f.getElementsByClassName("range-node-active-text")[0],(w=q(yn._element.content.getElementsByClassName("scale-box")[0],".scale"))&&(w.legp_search(b),_=yn._element.content.getElementsByClassName("scale")[0].getElementsByTagName("input")[0],r=b[0].value,w.legp_searchActive(b[0].value),_.value=b[0].value,_.addEventListener("input",(function(){for(var e=0;e<b.length;e++)if(b[e].value==_.value){r=b[e].value,yn._element.content.getElementsByClassName("output-width")[0].innerHTML=t.viewer.canvas.width*r,yn._element.content.getElementsByClassName("output-height")[0].innerHTML=t.viewer.canvas.height*r;break}}))),E=function(){return x()((function e(){k()(this,e),this.state=!1,this.start()}),[{key:"start",value:function(){if(t.viewer.scene.imageryLayers._layers.length<=1)return this.error="未加载底图!",m.message({type:"warning",text:this.error}),void console.warn(this.error);for(var e=!1,i=0;i<t.viewer.scene.imageryLayers._layers.length;i++){var n=t.viewer.scene.imageryLayers._layers[i];!n||!n.show||n.notes&&"default-base-map"===n.notes||(e=!0)}if(!e)return this.error="未加载底图!",m.message({type:"warning",text:this.error}),void console.warn(this.error);var s=0;this.state=!0;var c=this;!function e(t){var i=2*t;i<=r&&(s++,e(i))}(1),s+=1;var d=t.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(t.viewer.canvas.width/2,t.viewer.canvas.height/(2-(90+t.viewer.camera.pitch/(Cesium.Math.PI/180))/110)));d||(d=t.viewer.camera.position);for(var f,v,g=m.cartesian3Towgs84(t.viewer.camera.position,t.viewer).alt,y=(f=g,v=-40467.74,Math.round(v+80955.31/(1+Math.pow(f/91610.74,7096758e-11)))+1),b=t.viewer.camera.computeViewRectangle(),C={},w=0,k=0,_=0;_<t.viewer.scene.imageryLayers._layers.length;_++){var x=t.viewer.scene.imageryLayers._layers[_];x&&x.show&&x.imageryProvider&&x.imageryProvider.url&&Cesium.Rectangle.intersection(b,x.imageryProvider.rectangle)&&(!x.notes||"default-base-map"!==x.notes)&&w++}var E=100/w,S=!1;!function e(i,n){var d=t.viewer.scene.imageryLayers._layers[i];if(!d)return void(S||(c.error="当前范围内未找到底图数据!",m.message({type:"warning",text:c.error}),console.warn(c.error)));if(!d.show||!d.imageryProvider||!d.imageryProvider.url||!Cesium.Rectangle.intersection(b,d.imageryProvider.rectangle)||d.notes&&"default-base-map"===d.notes){var f=i+=1;return void e(f,n)}S=!0,k++,C[i]={value:0};var v,g=0,_=d.imageryProvider;l||0===l?v=l:((v=y+s-1)>_.maximumLevel&&(v=_.maximumLevel),v<_.minimumLevel&&(v=_.minimumLevel));function x(){var s=_.tilingScheme.positionToTileXY(Cesium.Rectangle.northwest(b),v),l=_.tilingScheme.positionToTileXY(Cesium.Rectangle.southeast(b),v);if(!s||!l){return m.message({type:"warning",text:"超出地球范围!"}),void console.warn("超出地球范围!")}var d=_.tilingScheme.getNumberOfXTilesAtLevel(v),f=(_.tilingScheme.getNumberOfYTilesAtLevel(v),s.x),y=s.y,x=l.x,S=l.y,P=(x-f+1)*(S-y+1),D=document.createElement("canvas");D.width=256*(x-f+1),D.height=256*(S-y+1);var M=D.getContext("2d"),T=_.tilingScheme.tileXYToRectangle(x,S,v),O=_.tilingScheme.tileXYToRectangle(f,y,v),N=new Cesium.Rectangle(O.west,T.south,T.east,O.north),B=b,A=B.west-N.west,L=N.east-B.east,I=N.north-B.north,j=B.south-N.south,R=A/(N.east-N.west);R===1/0&&(R=0);var F=L/(N.east-N.west);F===1/0&&(F=0);var z=I/(N.north-N.south);z===1/0&&(z=0);var H=j/(N.north-N.south);H===1/0&&(H=0);var V=D.width*R,G=D.height*z,W=D.width*F,U=D.height*H;D.width=D.width-V-W,D.height=D.height-G-U,0==D.width&&(D.width=1),0==D.height&&(D.height=1);for(var Y=S,J=[],q=S;q>=y;q--)for(var X=x;X>=f;X--)J.push({x:X,y:q});var Z={count:0},K=0,Q=-1,$={count:0},ee=0;function te(){$.count=0,ee=0;for(var e=30*++Q;e<30*(Q+1);e++){if(e>=J.length)return;ie(e)}}function ie(e){if(c.state)try{var t=J[e].x;t<0&&(t+=d);var i,n=new Image;n.setAttribute("crossOrigin","anonymous"),n.onload=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:M.drawImage(n,256*(J[e].x-f)-parseFloat(V.toFixed(0)),256*(J[e].y-y)-parseFloat(G.toFixed(0)),256,256),g++,Z.count++,$.count++;case 4:case"end":return t.stop()}}),t)}))),n.onerror=function(){g++,Z.count++,$.count++},i=-1!==_.url.indexOf("{x}")&&-1!==_.url.indexOf("{y}")&&-1!==_.url.indexOf("{z}")?_.url.replace(/\{x\}/g,t).replace(/\{y\}/g,J[e].y).replace(/\{z\}/g,v):-1!==_.url.indexOf("{TileMatrix}")&&-1!==_.url.indexOf("{TileRow}")&&-1!==_.url.indexOf("{TileCol}")?_.url.replace(/\{TileCol\}/g,t).replace(/\{TileRow\}/g,J[e].y).replace(/\{TileMatrix\}/g,v):_._layer&&_._style&&_._tileMatrixSetID&&_._format?_.url+"&tilematrix=".concat(v,"&layer=").concat(_._layer,"&style=").concat(_._style,"&tilerow=").concat(Y,"&tilecol=").concat(t,"&tilematrixset=").concat(_._tileMatrixSetID,"&format=").concat(_._format):_.url+"tile/".concat(v,"/").concat(J[e].y,"/").concat(t),n.src=i}catch(e){g++,Z.count++,$.count++}}Object.defineProperty($,"count",{get:function(){return ee},set:function(e){(ee=e)>=30&&te()}}),Object.defineProperty(Z,"count",{get:function(){return K},set:function(o){K=o,C[i].value=g/P*E;var s=0;for(var a in C)s+=C[a].value;if(u.style.width=.99*s+"%",h.style.left=.99*s+"%",p.innerHTML=Math.floor(.99*s*100)/100+"%",K===(x-f+1)*(S-y+1)){var l=D.getContext("2d"),d=D.cloneNode(!0),m=d.getContext("2d"),v=l.getImageData(0,0,D.width,D.height);if(m.putImageData(v,0,0),D.width=t.viewer.canvas.width*r,D.height=t.viewer.canvas.height*r,l.drawImage(d,0,0,D.width,D.height),n){if(n.getContext("2d").drawImage(D,0,0),k!=w){var _=i+=1;return void e(_,n)}var M=n.toDataURL("image/jpeg",.95),T=document.createElement("canvas"),O=T.getContext("2d");T.width=n.width/r,T.height=n.height/r,O.drawImage(n,0,0,T.width,T.height),gn(t,T.toDataURL("image/jpeg",.95),b,M),u.style.width="100%",h.style.left="100%",p.innerHTML="100%",c.state=!1}else{if(k!=w){var N=i+=1;return void e(N,D)}var B=D.toDataURL("image/jpeg",.95),A=document.createElement("canvas"),L=A.getContext("2d");A.width=D.width/r,A.height=D.height/r,L.drawImage(D,0,0,A.width,A.height),gn(t,A.toDataURL("image/jpeg",.95),b,B),u.style.width="100%",h.style.left="100%",p.innerHTML="100%",c.state=!1}}}}),_._readyError?Z.count=(x-f+1)*(S-y+1):te()}if(_._readyError)return C[i]={value:E},void x();_.readyPromise.then((function(){x()})).catch((function(e){_._readyError=!0,C[i]={value:E},x()}))}(0)}},{key:"desist",value:function(){this.state=!1}}])}();case 37:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var wn=i(13),kn=i.n(wn);var _n=function(){function e(){k()(this,e),this.element={}}return x()(e,[{key:"getEvent",value:function(t){return e.event[t]}},{key:"getEventAll",value:function(){return e.event}},{key:"setEvent",value:function(t,i){e.event[t]=i}},{key:"on",value:function(e,t){}}])}();C()(_n,"event",{});var xn=_n,En=function(){return x()((function e(t,i,n){var o;k()(this,e);for(var s=(o="string"==typeof t?document.getElementById(t):t).getElementsByTagName("DIV-cy-tab-pane"),a='<div class="DIV-cy-tab-top">',r='<div class="DIV-cy-tab-content">',l=0,c=0;c<s.length;c++){var u=!1;if(n&&n.tabHide&&Array.isArray(n.tabHide))for(var h=0;h<n.tabHide.length;h++)if(s[c].getAttribute("label")===n.tabHide[h]){u=!0;break}if(!u){var p="display: none;",d="";0==l&&(p="",d="is-active"),a=a+'\n <div class="DIV-cy-tab-pane-title">\n <div class="DIV-cy-tab-pane-title-p '+d+'" tabindex="'+l+'"><span>'+s[c].getAttribute("label")+"</span></div>\n </div>\n ",r=r+'<div class="DIV-cy-tab-content-pane '.concat(s[c].className,'" style="')+p+'">'+s[c].innerHTML+"</div>",l++}}a+="</div>",r+="</div>";var m=document.createElement("div");"string"==typeof t&&m.setAttribute("id",t),m.setAttribute("class","DIV-cy-tabs"),m.innerHTML=a+r,o.parentNode.insertBefore(m,o),o.parentNode.removeChild(o);for(var f=m.getElementsByClassName("DIV-cy-tab-pane-title-p"),v=0;v<f.length;v++)f[v].addEventListener("click",(function(e){var t=e.target.getAttribute("tabindex"),n=m.getElementsByClassName("DIV-cy-tab-content-pane");i&&i(t);for(var o=0;o<n.length;o++)o===parseInt(t)?(n[o].style.display="",f[o].className="DIV-cy-tab-pane-title-p is-active"):(n[o].style.display="none",f[o].className="DIV-cy-tab-pane-title-p");n[parseInt(t)].style.display=""}));this.clickTabCallBack=i}),[{key:"clickTabCallBack",value:function(){this.clickTabCallBack&&this.clickTabCallBack()}}])}();function Sn(e,t,i){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,i)}function Pn(e,t,i){return e.set(Mn(e,t),i),i}function Dn(e,t){return e.get(Mn(e,t))}function Mn(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var Tn=new WeakMap,On=new WeakMap,Nn=new WeakMap,Bn=new(function(){return x()((function e(){k()(this,e),Sn(this,Tn,void 0),Sn(this,On,void 0),Sn(this,Nn,void 0),this.richTextBox=document.createElement("div"),this.richTextBox.className="richText-box",this.richTextBox.style.position="absolute",this.richTextBox.style.width="60%",this.richTextBox.style.height="70%",this.richTextBox.style.backgroundColor="#ffffff",this.richTextBox.style.zIndex="999999",this.richTextBox.style.left="20%",this.richTextBox.style.top="15%",this.richTextBox.style.display="flex",this.richTextBox.style.flexDirection="column",this.uploadImageServer,this.uploadVideoServer}),[{key:"open",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=this;this.title=i,this.objectId=e,document.body.getElementsByClassName("richText-box")[0]&&document.body.removeChild(this.richTextBox),this.editor=null;var r='\n <div class="richText-box-mask"></div>\n <div class="richText-content">\n <div class="richText-header">\n <p>'.concat(i,'</P>\n <i class="close">✕</i>\n </div>\n <div id="toolbar-container"></div>\n <div id="editor-container"></div>\n <div class="richText-footer">\n <button class="primary">确认</button>\n <button class="cancel">取消</button>\n </div>\n </div>\n ');this.richTextBox.innerHTML=r,document.body.appendChild(this.richTextBox);var l=window.wangEditor,c=l.createEditor,u=l.createToolbar,h={placeholder:"请输入正文...",MENU_CONF:{uploadImage:{fieldName:"file",server:this.uploadImageServer,customUpload:function(e,t){return o()(a.a.mark((function i(){var n;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,s.upload(e);case 2:n=i.sent,t((s.host=s.host||p())+"/"+n);case 4:case"end":return i.stop()}}),i)})))()}},uploadVideo:{server:this.uploadVideoServer,allowedFileTypes:["video/mp4","video/mp3","video/ogg","video/webm","video/avi"],customUpload:function(e,t){return o()(a.a.mark((function i(){var n;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,s.upload(e);case 2:n=i.sent,t((s.host=s.host||p())+"/"+n);case 4:case"end":return i.stop()}}),i)})))()}}},onChange:function(e){e.getHtml()}};this.editor=c({selector:"#editor-container",html:"<p><br></p>",config:h,mode:"default"});var d={excludeKeys:["emotion","insertImage","insertVideo"]};u({editor:this.editor,selector:"#toolbar-container",config:d,mode:"default"});this.editor.on("fullScreen",(function(){console.log("fullScreen")})),this.editor.setHtml(n);var m=this.richTextBox.getElementsByClassName("close")[0],f=this.richTextBox.getElementsByClassName("primary")[0],v=this.richTextBox.getElementsByClassName("cancel")[0];m.addEventListener("click",(function(){t.close()})),f.addEventListener("click",(function(){var e=t.editor.getHtml();t.primaryCallBack(e),t.close()})),v.addEventListener("click",(function(){t.close()}))}},{key:"close",value:function(){document.body.getElementsByClassName("richText-box")[0]&&document.body.removeChild(this.richTextBox),this.editor=null}},{key:"upload",value:(e=o()(a.a.mark((function e(t){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i="",this.host=this.host||p(),i=this.host.endsWith("yjearth4.0")?this.host+"/api/v1/richText/upload":this.host+"/yjearth4.0/api/v1/richText/upload",(n=new FormData).append("file",t),e.next=7,fetch(i,{method:"post",body:n,headers:{token:m(),Authorization:"Bearer "+m()}});case 7:if(200!==(o=e.sent).status){e.next=14;break}return e.next=11,o.json();case 11:if(200!==(s=e.sent).code&&0!==s.code){e.next=14;break}return e.abrupt("return",s.data.url);case 14:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})},{key:"customUploadVideo",get:function(){return Dn(Tn,this)},set:function(e){Pn(Tn,this,e)}},{key:"customUploadContent",get:function(){return Dn(On,this)},set:function(e){Pn(On,this,e)}},{key:"primaryCallBack",get:function(){return Dn(Nn,this)},set:function(e){Pn(Nn,this,e)}}]);var e}());function An(e,t,i,n,o){var s=Math.ceil(t/i)||1;!function i(){var a,r="<li class='list-items' pagenumber=1>1</li>",l="<li class='list-items' pagenumber=".concat(s,">").concat(s,"</li>"),c="<li class='list-items btnGoLeft'>...</li>",u="<li class='list-items btnGoRight'>...</li>",h="<div style='line-height:20px;' class='pageTips'>共 ".concat(t," 条</div > ");if(a="<li class='list-items lbl btnPrev'>‹</li>",s<=6)for(var p=1;p<=s;p++)a+="<li class='list-items' pagenumber=".concat(p,">").concat(p,"</li>");else if(n<=4){for(var d=1;d<=5;d++)a+="<li class='list-items' pagenumber=".concat(d,">").concat(d,"</li>");a+=u,a+=l}else if(n>s-3){a+=r,a+=c;for(var m=s-4;m<=s;m++)a+="<li class='list-items' pagenumber=".concat(m,">").concat(m,"</li>")}else{a+=r,a+=c;for(var f=n-1;f<=n+1;f++)a+="<li class='list-items' pagenumber=".concat(f,">").concat(f,"</li>");a+=u,a+=l}a+="<li class='list-items lbr btnNext'>›</li>",a+=h,e.innerHTML=a,e.querySelector("li[pagenumber='"+n+"']").classList.add("active"),e.querySelectorAll("li[pagenumber]").forEach((function(t){t.onclick=function(){n=Number(this.innerHTML),e.querySelector("li[pagenumber='"+n+"']").classList.add("active"),a="",i(),o&&o(n)}})),e.getElementsByClassName("btnPrev")[0].addEventListener("click",(function(){n>1&&(n--,a="",i(),o&&o(n))})),e.getElementsByClassName("btnNext")[0].addEventListener("click",(function(){n<s&&(n++,a="",i(),o&&o(n))}));var v=e.getElementsByClassName("btnGoLeft")[0];v&&(v.addEventListener("mouseenter",(function(){this.innerHTML="<"})),v.addEventListener("mouseleave",(function(){this.innerHTML="..."})),v.addEventListener("click",(function(){n>10&&(n-=10,a="",i(),o&&o(n))})));var g=e.getElementsByClassName("btnGoRight")[0];g&&(g.addEventListener("mouseenter",(function(){this.innerHTML=">"})),g.addEventListener("mouseleave",(function(){this.innerHTML="..."})),g.addEventListener("click",(function(){n<s-10&&(n+=10,a="",i(),o&&o(n))})))}()}function Ln(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 In(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ln(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ln(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function jn(e){var t=p();e.cameraSelect=function(n){if(!e.attributeSelect)return;for(var o=!1,s=0;s<e.attributeSelect.length;s++)if("camera"===e.attributeSelect[s].key){o=!0;break}if(!o)return;var a,r=n;if(n=n&&"object"!==N()(n)?n:1,!(e._DialogObject&&e._DialogObject._element&&e._DialogObject._element.content))return;var l=e._DialogObject._element.content.getElementsByClassName("pagination")[0];if(a=e._DialogObject._element.content.getElementsByClassName("attribute-content-camera")[0],!l)return;if(!a)return;An(l,1,10,1);var c="",u={cameraName:e.cameraName,page:n,pageSize:5},h=new URLSearchParams(u).toString();c=t.endsWith("yjearth4.0")?"".concat(t,"/api/v1/cameraData/list?").concat(h):"".concat(t,"/yjearth4.0/api/v1/cameraData/list?").concat(h);if(fetch(c,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(t){200===t.status&&t.json().then((function(t){if(200===t.code||0===t.code){if(!(e._DialogObject&&e._DialogObject._element&&e._DialogObject._element.content&&a))return;var o=a.getElementsByClassName("pagination")[0],s=e._DialogObject._element.content.getElementsByClassName("camera-table")[0],r=s.getElementsByClassName("table-body")[0];if(r.innerHTML="",t.rows&&(t.data={list:A()(t.rows),total:t.total}),t.data){if(t.data.list&&t.data.list.length>0){An(o,t.data.total,5,1,(function(t){e.cameraSelect(t)})),s.getElementsByClassName("table-empty")[0].style.display="none",r.style.display="inline-flex";for(var l=[],c=function(n){var o='\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="'.concat(t.data.list[n].deviceId,'">\n <span>绑定</span>\n </div>\n <div class="td">').concat(t.data.list[n].cameraName,'</div>\n <div class="td center" style="width: 80px; flex: 0 80px; min-width: 80px;">').concat(i[t.data.list[n].type],'</div>\n <div class="td center" style="width: 126px; flex: 0 126px;min-width: 126px;">').concat(t.data.list[n].ip,'</div>\n <div class="td center" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(t.data.list[n].port,'</div>\n <div class="td center" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(t.data.list[n].userName,'</div>\n <div class="td center">').concat(t.data.list[n].passWord||t.data.list[n].password,"</div>\n </div>"),s=document.createRange().createContextualFragment(o),a=s.querySelector('input[type="checkbox"]');l.push(a),a.addEventListener("change",(function(){if(a.checked){e.attributeCamera=[],e.attributeCamera.push(t.data.list[n]);for(var i=0;i<l.length;i++)l[i]!==a&&(l[i].checked=!1)}else{var o=e.attributeCamera.filter((function(e){if("deviceId"in t.data.list[n])return e.deviceId!==t.data.list[n].deviceId}));e.attributeCamera=o}})),r.appendChild(s);for(var c=0;c<e.attributeCamera.length;c++)if("deviceId"in t.data.list[n]&&e.attributeCamera[c].deviceId===t.data.list[n].deviceId){a.checked=!0;break}},u=0;u<t.data.list.length;u++)c(u)}t.data&&t.data.total&&An(o,t.data.total,5,n,(function(t){e.cameraSelect(t)}))}else An(o,1,5,1),s.getElementsByClassName("table-empty")[0].style.display="flex",r.style.display="none"}else console.error(t.message)}))})),!r){var p=new URLSearchParams({page:1,pageSize:99999999}).toString();c=t.endsWith("yjearth4.0")?"".concat(t,"/api/v1/cameraData/list?").concat(p):"".concat(t,"/yjearth4.0/api/v1/cameraData/list?").concat(p),fetch(c,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(t){200===t.status&&t.json().then((function(t){if(200===t.code||0===t.code){if(!(e._DialogObject&&e._DialogObject._element&&e._DialogObject._element.content&&a))return;if(t.rows&&(t.data={list:A()(t.rows),total:t.total}),t.data)if(t.data.list)for(var i=e.attributeCamera.length-1;i>=0;i--){for(var n=!1,o=0;o<t.data.list.length;o++)if(e.attributeCamera[i].deviceId===t.data.list[o].deviceId){n=!0;break}n||e.attributeCamera.splice(i,1)}else e.attributeCamera=[];else e.attributeCamera=[]}else console.error(t.message)}))}))}},e.ISCSelect=function(i){if(!e.attributeSelect)return;for(var n=!1,o=0;o<e.attributeSelect.length;o++)if("isc"===e.attributeSelect[o].key){n=!0;break}if(!n)return;var s;if(i=i&&"object"!==N()(i)?i:1,!(e._DialogObject&&e._DialogObject._element&&e._DialogObject._element.content))return;var a=e._DialogObject._element.content.getElementsByClassName("pagination")[0];if(s=e._DialogObject._element.content.getElementsByClassName("attribute-content-isc")[0],!a)return;if(!s)return;An(a,1,10,1);var r="",l=new URLSearchParams({page:i,page_size:5}).toString();r=t.endsWith("yjearth4.0")?"".concat(t,"/api/v1/isc/list?").concat(l):"".concat(t,"/yjearth4.0/api/v1/isc/list?").concat(l);fetch(r,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(t){200===t.status&&t.json().then((function(t){if(200===t.code||0===t.code){if(!(e._DialogObject&&e._DialogObject._element&&e._DialogObject._element.content&&s))return;var n=s.getElementsByClassName("pagination")[0],o=e._DialogObject._element.content.getElementsByClassName("isc-table")[0],a=o.getElementsByClassName("table-body")[0];if(a.innerHTML="",t.rows&&(t.data={list:A()(t.rows),total:t.total}),t.data){if(t.data.list&&t.data.list.length>0){An(n,t.data.total,5,1,(function(t){e.ISCSelect(t)})),o.getElementsByClassName("table-empty")[0].style.display="none",a.style.display="flex";for(var r=function(i){var n='\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="'.concat("ID"in t.data.list[i]?t.data.list[i].ID:t.data.list[i].id,'">\n <span>绑定</span>\n </div>\n <div class="td">').concat(t.data.list[i].name,'</div>\n <div class="td center" style="width: 180px; flex: 0 180px; min-width: 180px;">').concat(t.data.list[i].status?"在线":"离线","</div>\n </div>"),o=document.createRange().createContextualFragment(n),s=o.querySelector('input[type="checkbox"]');s.addEventListener("change",(function(){if(s.checked)e.attributeISC.push(t.data.list[i]);else{var n=e.attributeISC.filter((function(e){return"ID"in t.data.list[i]?e.ID!==t.data.list[i].ID:e.id!==t.data.list[i].id}));e.attributeISC=n}})),a.appendChild(o);for(var r=0;r<e.attributeISC.length;r++)if("ID"in t.data.list[i]?e.attributeISC[r].ID===t.data.list[i].ID:e.attributeISC[r].id===t.data.list[i].id){s.checked=!0;break}},l=0;l<t.data.list.length;l++)r(l)}t.data&&t.data.total&&An(n,t.data.total,5,i,(function(t){e.ISCSelect(t)}))}else An(n,1,5,1),o.getElementsByClassName("table-empty")[0].style.display="flex",a.style.display="none"}else console.error(t.message)}))}))},e.goodsSelect=function(i){if(!e.attributeSelect)return;for(var n=!1,o=0;o<e.attributeSelect.length;o++)if("goods"===e.attributeSelect[o].key){n=!0;break}if(!n)return;var s;if(i=i&&"object"!==N()(i)?i:1,!(e._DialogObject&&e._DialogObject._element&&e._DialogObject._element.content))return;var a=e._DialogObject._element.content.getElementsByClassName("pagination")[0];if(s=e._DialogObject._element.content.getElementsByClassName("attribute-content-goods")[0],!a)return;if(!s)return;var r="",l=new URLSearchParams({page:i,page_size:999999}).toString();r=t.endsWith("yjearth4.0")?"".concat(t,"/api/v1/goods/list?").concat(l):"".concat(t,"/yjearth4.0/api/v1/goods/list?").concat(l);fetch(r,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(t){200===t.status&&t.json().then((function(t){if(200===t.code||0===t.code){if(!(e._DialogObject&&e._DialogObject._element&&e._DialogObject._element.content&&s))return;s.getElementsByClassName("pagination")[0];var i=e._DialogObject._element.content.getElementsByClassName("goods-table")[0],n=i.getElementsByClassName("table-body")[0];if(n.innerHTML="",t.rows&&(t.data={list:A()(t.rows),total:t.total}),t.data){if(t.data.list&&t.data.list.length>0){e._allGoodsList=t.data.list;for(var o=e.attributeGoods.length-1;o>=0;o--){for(var a=!1,r=0;r<t.data.list.length;r++)if("ID"in t.data.list[r]){if(t.data.list[r].ID===e.attributeGoods[o].ID){a=!0;break}}else if("id"in t.data.list[r]&&t.data.list[r].id===e.attributeGoods[o].id){a=!0;break}a||e.attributeGoods.splice(o,1)}i.getElementsByClassName("table-empty")[0].style.display="none",n.style.display="block",n.style.maxHeight="150px";for(var l=function(i){var o='\n <div class="tr">\n <div class="td" style="width: 60px; flex: 0 60px;min-width: 60px;">\n '.concat(i+1,'\n </div>\n <div class="td" style="flex: 0 0 280px;">').concat(t.data.list[i].name,'</div>\n <div class="td"><input class="input" type="number" title="" min="0" max="999999999"></div>\n </div>'),s=document.createRange().createContextualFragment(o),a=s.querySelector('input[type="number"]');a.value=0;for(var r=0;r<e.attributeGoods.length;r++)"ID"in t.data.list[i]?t.data.list[i].ID===e.attributeGoods[r].ID&&(a.value=e.attributeGoods[r].cnt,e.attributeGoods[r].name=t.data.list[i].name):"id"in t.data.list[i]&&t.data.list[i].id===e.attributeGoods[r].id&&(a.value=e.attributeGoods[r].cnt);a.addEventListener("blur",(function(n){var o=Number(n.target.value);a.value=o;for(var s=!1,r=e.attributeGoods.length-1;r>=0;r--)if("ID"in t.data.list[i]){if(t.data.list[i].ID===e.attributeGoods[r].ID){s=!0,o?e.attributeGoods[r].cnt=o:e.attributeGoods.splice(r,1);break}}else if("id"in t.data.list[i]&&t.data.list[i].id===e.attributeGoods[r].id){s=!0,o?e.attributeGoods[r].cnt=o:e.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:t.data.list[i].name,cnt:o};"ID"in t.data.list[i]?l.ID=t.data.list[i].ID:"id"in t.data.list[i]&&(l.id=t.data.list[i].id),e.attributeGoods.push(In({},l))}})),a.addEventListener("input",(function(n){if(n.data&&isNaN(Number(n.data)))"."!=n.data&&(a.value=Number(a.value));else{var o=Number(n.target.value);n.target.max&&o>Number(n.target.max)&&(o=Number(n.target.max)),n.target.min&&o<Number(n.target.min)&&(o=Number(n.target.min)),a.value=o;for(var s=!1,r=e.attributeGoods.length-1;r>=0;r--)if("ID"in t.data.list[i]){if(t.data.list[i].ID===e.attributeGoods[r].ID){s=!0,o?e.attributeGoods[r].cnt=o:e.attributeGoods.splice(r,1);break}}else if("id"in t.data.list[i]&&t.data.list[i].id===e.attributeGoods[r].id){s=!0,o?e.attributeGoods[r].cnt=o:e.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:t.data.list[i].name,cnt:o};"ID"in t.data.list[i]?l.ID=t.data.list[i].ID:"id"in t.data.list[i]&&(l.id=t.data.list[i].id),e.attributeGoods.push(In({},l))}}})),n.appendChild(s)},c=0;c<t.data.list.length;c++)l(c)}t.data&&t.data.total}else i.getElementsByClassName("table-empty")[0].style.display="flex",n.style.display="none"}else console.error(t.message)}))}))},e.goodsFilter=function(){var t=[];if(e._allGoodsList&&e._allGoodsList.length){var i=e._DialogObject._element.content.getElementsByClassName("goods-select-input")[0].value;t=e._allGoodsList.filter((function(e){return-1!==e.name.indexOf(i)}))}var n=e._DialogObject._element.content.getElementsByClassName("goods-table")[0],o=n.getElementsByClassName("table-body")[0];if(o.innerHTML="",t.length>0){n.getElementsByClassName("table-empty")[0].style.display="none",o.style.display="block",o.style.maxHeight="150px";for(var s=function(i){var n='\n <div class="tr">\n <div class="td" style="width: 60px; flex: 0 60px;min-width: 60px;">\n '.concat(i+1,'\n </div>\n <div class="td" style="flex: 0 0 280px;">').concat(t[i].name,'</div>\n <div class="td"><input class="input" type="number" title="" min="0" max="999999999"></div>\n </div>'),s=document.createRange().createContextualFragment(n),a=s.querySelector('input[type="number"]');a.value=0;for(var r=0;r<e.attributeGoods.length;r++)"ID"in t[i]?t[i].ID===e.attributeGoods[r].ID&&(a.value=e.attributeGoods[r].cnt):"id"in t[i]&&t[i].id===e.attributeGoods[r].id&&(a.value=e.attributeGoods[r].cnt);a.addEventListener("blur",(function(n){var o=Number(n.target.value);a.value=o;for(var s=!1,r=e.attributeGoods.length-1;r>=0;r--)if("ID"in t[i]){if(t[i].ID===e.attributeGoods[r].ID){s=!0,o?e.attributeGoods[r].cnt=o:e.attributeGoods.splice(r,1);break}}else if("id"in t[i]&&t[i].id===e.attributeGoods[r].id){s=!0,o?e.attributeGoods[r].cnt=o:e.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:t[i].name,cnt:o};"ID"in t[i]?l.ID=t[i].ID:"id"in t[i]&&(l.id=t[i].id),e.attributeGoods.push(In({},l))}})),a.addEventListener("input",(function(n){if(n.data&&isNaN(Number(n.data)))"."!=n.data&&(a.value=Number(a.value));else{var o=Number(n.target.value);n.target.max&&o>Number(n.target.max)&&(o=Number(n.target.max)),n.target.min&&o<Number(n.target.min)&&(o=Number(n.target.min)),a.value=o;for(var s=!1,r=e.attributeGoods.length-1;r>=0;r--)if("ID"in t[i]){if(t[i].ID===e.attributeGoods[r].ID){s=!0,o?e.attributeGoods[r].cnt=o:e.attributeGoods.splice(r,1);break}}else if("id"in t[i]&&t[i].id===e.attributeGoods[r].id){s=!0,o?e.attributeGoods[r].cnt=o:e.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:t[i].name,cnt:o};"ID"in t[i]?l.ID=t[i].ID:"id"in t[i]&&(l.id=t[i].id),e.attributeGoods.push(In({},l))}}})),o.appendChild(s)},a=0;a<t.length;a++)s(a)}else n.getElementsByClassName("table-empty")[0].style.display="flex",o.style.display="none"},e.cameraName="",e.ISCName="";var i={1:"海康",2:"大华"};return'<div class="attribute">\n <div class="row">\n <div class="col attribute-select-box">\n <span class="label" style="line-height: 32px;">内容类型</span>\n <div class="input input-select attribute-select"></div>\n </div>\n </div>\n <div class="attribute-content attribute-content-richText">\n <div class="row">\n <div class="col">\n <span class="label">编辑内容</span>\n <button @click="openRichTextEditor">打开文本编辑器</button>\n </div>\n </div>\n </div>\n <div class="row attribute-content attribute-content-link">\n <div class="col">\n <span class="label">添加链接</span>\n <div style="flex: 1;position: relative;">\n <input class="input link_add" type="text">\n <i class="link_add_btn" @click="_addLink"></i>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-link">\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">名称</div>\n <div class="th">链接</div>\n <div class="th">操作</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-camera">\n <div class="row">\n <div class="col">\n <span class="label">编辑内容</span>\n <input class="input" type="text" @model="cameraName" style="width: 100px;">\n <button class="select btn" @click="cameraSelect">搜索</button>\n </div>\n </div>\n <div>\n <div class="table camera-table">\n <div class="table-head">\n <div class="tr">\n <div class="th">操作</div>\n <div class="th">设备名称</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备类型</div>\n <div class="th" style="width: 126px; flex: 0 126px;min-width: 126px;">设备IP</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备端口</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">用户名</div>\n <div class="th">密码</div>\n </div>\n </div>\n <div class="table-body" style="display:none;">\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="2">\n <span>绑定</span>\n </div>\n <div class="td">设备名称</div>\n <div class="td">设备类型</div>\n <div class="td">设备IP</div>\n <div class="td">设备端口</div>\n <div class="td">用户名</div>\n <div class="td">密码</div>\n </div>\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class=""row>\n <ul class="pagination"></ul>\n </div>\n </div>\n <div class="attribute-content attribute-content-isc">\n \x3c!-- <div class="row">\n <div class="col">\n <span class="label">编辑内容</span>\n <input class="input" type="text" @model="ISCName" style="width: 100px;">\n <button class="select btn" @click="ISCSelect">搜索</button>\n </div>\n </div> --\x3e\n <div>\n <div class="table isc-table">\n <div class="table-head">\n <div class="tr">\n <div class="th" style="width: 74px; flex: 0 74px;min-width: 74px;">操作</div>\n <div class="th">设备名称</div>\n <div class="th" style="width: 180px; flex: 0 180px; min-width: 180px;">设备状态</div>\n </div>\n </div>\n <div class="table-body" style="display:none;">\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="2">\n <span>绑定</span>\n </div>\n <div class="td">设备名称</div>\n <div class="td" style="width: 180px; flex: 0 180px; min-width: 180px;">设备状态</div>\n </div>\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class=""row>\n <ul class="pagination"></ul>\n </div>\n </div>\n <div class="row attribute-content attribute-content-vr">\n <div class="col">\n <span class="label">添加链接</span>\n <div style="flex: 1;position: relative;">\n <input class="input vr_add" type="text">\n <i class="vr_add_btn" @click="_addRr"></i>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-vr">\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">名称</div>\n <div class="th">链接</div>\n <div class="th">操作</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-goods">\n <div>\n <div class="row">\n <div class="col">\n <span class="label">编辑内容</span>\n <input class="input goods-select-input" type="text" style="width: 180px;margin-right: 10px;">\n <button class="select btn" @click="goodsFilter">搜索</button>\n </div>\n </div>\n <div class="table goods-table">\n <div class="table-head">\n <div class="tr">\n <div class="th" style="width: 60px; flex: 0 60px;min-width: 60px;">序号</div>\n <div class="th" style="flex: 0 0 280px;">名称</div>\n <div class="th">数量</div>\n </div>\n </div>\n <div class="table-body" style="display:none;">\n <div class="tr">\n <div class="td" style="width: 60px; flex: 0 60px;min-width: 60px;">序号</div>\n <div class="td" style="flex: 0 0 280px;">名称</div>\n <div class="td">数量</div>\n </div>\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n </div>\n </div>'}function Rn(e){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: unset;">名称</span>\n <input class="input" type="text" @model="labelText">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div style="width: 46%;">\n <div class="row">\n <p class="lable-left-line">WGS84坐标</p>\n </div>\n <div class="row" style="margin-bottom: 5px;">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n </div>\n <div class="row" style="margin-bottom: 5px;">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">海拔高度</span>\n <div class="input-number input-number-unit-1 alt-box">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div style="width: 50%;">\n <div class="row coordinate-select-box">\n <div class="lable-left-line">转换坐标选择\n <div class="input input-select coordinate-select" style="margin-left: 20px;"></div>\n </div>\n </div>\n <div class="row" style="margin-bottom: 5px;">\n <div class="col">\n <span class="label">X轴:</span>\n <input style="border: none;background: none;" class="input convert-x" readonly="readonly">\n </div>\n </div>\n <div class="row" style="margin-bottom: 5px;">\n <div class="col">\n <span class="label">Y轴:</span>\n <input style="border: none;background: none;" class="input convert-y" readonly="readonly">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">Z轴:</span>\n <input style="border: none;background: none;" class="input convert-z" readonly="readonly">\n </div>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col" style="flex: 0 0 120px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="scaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="near">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="far">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <DIV-cy-tabs id="point-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col height-box">\n <span class="label" style="flex: 0 0 56px;">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="YJ-custom-checkbox-box" style="display: flex;align-items: center;cursor: pointer;">\n <input type="checkbox" class="YJ-custom-checkbox">\n <span style="margin-left: 10px; margin-bottom: 1px;user-select: none;">小数格式</span>\n </div>\n </div>\n <div class="col">\n <div class="YJ-custom-checkbox-box" style="display: flex;align-items: center;cursor: pointer;">\n <input type="checkbox" class="YJ-custom-checkbox">\n <span style="margin-left: 10px; margin-bottom: 1px;user-select: none;">度分格式</span>\n </div>\n </div>\n <div class="col">\n <div class="YJ-custom-checkbox-box" style="display: flex;align-items: center;cursor: pointer;">\n <input type="checkbox" class="YJ-custom-checkbox">\n <span style="margin-left: 10px; margin-bottom: 1px;user-select: none;">度分秒格式</span>\n </div>\n </div>\n <div class="col">\n </div>\n </div>\n <div class="row">\n <div style="flex: 1;">\n <div class="proj-input-box">\n <div class="row">\n <div class="col">\n <span style="flex: 0 0 40px;">经度</span>\n <input class="input lng" readonly="readonly">\n </div>\n <div class="col">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span style="flex: 0 0 40px;">纬度</span>\n <input class="input lat" readonly="readonly">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <div class="proj-input-box" style="width: 56%;">\n <div class="row">\n <div class="col" style="flex-direction: column;">\n <div class="row" style="margin-bottom: 15px;">\n <span style="flex: 0 0 40px;">经度</span>\n <input class="input lng-dm-d" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lng-dm-m" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <span class="top-line"></span>\n </div>\n <div class="row">\n <span style="flex: 0 0 40px;">纬度</span>\n <input class="input lat-dm-d" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lat-dm-m" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <span class="bottom-line"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="proj-input-box" style="width: 70%;">\n <div class="row">\n <div class="col" style="flex-direction: column;">\n <div class="row" style="margin-bottom: 15px;">\n <span style="flex: 0 0 40px;">经度</span>\n <input class="input lng-dms-d" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lng-dms-m" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <input class="input lng-dms-s" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">秒</span>\n <span class="top-line"></span>\n </div>\n <div class="row">\n <span style="flex: 0 0 40px;">纬度</span>\n <input class="input lat-dms-d" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lat-dms-m" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <input class="input lat-dms-s" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">秒</span>\n <span class="bottom-line"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n <div>\n <h4>图标设置</h4>\n <div class="row" style="margin-bottom: 10px;">\n <div class="col" style="flex: 0 0 80px;">\n <span class="label" style="flex: none;">显隐</span>\n <input class="btn-switch" type="checkbox" @model="billboardShow">\n </div>\n <div class="col" style="flex: 0 0 90px;">\n <span class="label" style="flex: none;">图标</span>\n <div class="image-box" @click="clickChangeImage">\n <img class="image" src="" alt="" @model="billboardImage">\n </div>\n </div>\n <div class="col" style="flex: 0 0 90px;">\n <span class="label" style="flex: none;">默认图标</span>\n <div class="image-box" @click="clickChangeDefaultImage">\n <img class="image" src="" alt="" @model="billboardDefaultImage">\n </div>\n </div>\n <div class="col">\n <span class="label">图标倍数</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0.1" max="99" @model="billboardScale">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <h4>文字设置</h4>\n <div class="row">\n <div class="col" style="flex: 0 0 80px;">\n <span class="label" style="flex: none;">显隐</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">文字大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize" style="width: 70px;">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">文字颜色</span>\n <div class="labelColor"></div>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n \x3c!-- <DIV-cy-tab-pane label="效果">\n <div>\n <div class="row">\n <div class="col">\n <span class="label">扩散</span>\n <input class="btn-switch" type="checkbox" @model="diffuseShow">\n </div>\n <div class="col">\n <span class="label">半径</span>\n <input class="input" type="number" title="" min="0" max="9999999" @model="diffuseRadius">\n </div>\n <div class="col">\n <span class="label">时间</span>\n <input class="input" type="number" title="" min="100" max="99999" @model="diffuseDuration">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="diffuseColor"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">雷达</span>\n <input class="btn-switch" type="checkbox" @model="scanShow">\n </div>\n <div class="col">\n <span class="label">半径</span>\n <input class="input" type="number" title="" min="0" max="9999999" @model="scanRadius">\n </div>\n <div class="col">\n <span class="label">时间</span>\n <input class="input" type="number" title="" min="100" max="99999" @model="scanDuration">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="scanColor"></div>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>--\x3e\n\x3c!-- <DIV-cy-tab-pane label="灯光控制">--\x3e\n\x3c!-- <div>--\x3e\n\x3c!-- <div class="row">--\x3e\n\x3c!-- <div class="col">--\x3e\n\x3c!-- <span class="label">指令</span>--\x3e\n\x3c!-- <input class="input" type="text" @model="instruct">--\x3e\n\x3c!-- <button class="primary" @click="instructSubmit">提交</button>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </DIV-cy-tab-pane>--\x3e\n\x3c!-- <DIV-cy-tab-pane label="设置操作点">--\x3e\n\x3c!-- <div>--\x3e\n\x3c!-- <div class="row">--\x3e\n\x3c!-- <div class="col">--\x3e\n\x3c!-- <span class="label">设置操作点</span>--\x3e\n\x3c!-- <input class="input" type="text" @model="operatingPoint">--\x3e\n\x3c!-- <button class="primary" @click="operatingPointSubmit">提交</button>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </DIV-cy-tab-pane>--\x3e\n </DIV-cy-tabs>\n </div>\n <span class="custom-divider"></span>\n ')}function Fn(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 zn(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Fn(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Fn(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Hn(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Vn=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),i=Hn(this,t,[e,n]),e&&e.viewer?(i.sdk=e,i.viewer=e.viewer,i.options=zn({},n),i.options.id=n.id||i.randomString(),i.entity=null,i.clickCallBack=null,i.rightClickCallBack=null,i.picking=!0,i.options.host=i.options.host||p(),i.options.customView=n.customView,i.setDefaultValue(),i._showView,i):an()(i)}return un()(t,e),x()(t,[{key:"showView",get:function(){return this._showView},set:function(e){var t=Ht().sdkD;if(!t)return this._showView=e,void(this.entity&&(this.entity._showView=e));this.sdk!==t?(this._showView||this.show)&&(this.sdk!==t?(this._showView=2!=e&&3!=e?0:e,this.isShowView=!0,this._showView?this.show=2!=e:this.show=!0):this._showView=0):this._showView=0}},{key:"name",get:function(){return this.options.name},set:function(e){this.options.name=e,this.label&&(this.label.text=e),this._elms.name&&this._elms.name.forEach((function(t){t.value=e}))}},{key:"show",get:function(){return this.options.show},set:function(e){if("boolean"==typeof e){var t=Ht().sdkD;if(this.isShowView&&t||(this.options.show=e,this.originalOptions&&(this.originalOptions.show=e)),this.entity&&(this.entity._showView=this.showView),"layer"==this.type&&this.entity&&(this.entity._objectState=this.options.show),this.showView&&3!=this.showView&&t?(this.entity&&(this.entity.show=!1),this.options.label&&this.options.label.show&&this.label&&(this.label.show=!1)):(this.entity&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&this.label&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=this.options.show),Mt(this.sdk,this.options.id),at(this.sdk,this.options.id),this.isShowView=!1,"layer"==this.type&&t){var i=t.viewer.imageryLayers._layers[this.layerIndex],n=this.entity;if(!i)return;n._objectState?(n._showView&&2!=n._showView||(i.show=!0),3==n._showView&&(i.show=!1)):i.show=this.options.show}}else console.error("参数必须为boolean")}},{key:"attributeSelect",get:function(){return[{name:"富文本",value:"富文本",key:"richText"},{name:"链接",value:"链接",key:"link"}]}},{key:"display",value:function(){this.show=!0}},{key:"hide",value:function(){this.show=!1}},{key:"flicker",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500,i=arguments.length>1?arguments[1]:void 0;this.flickerAnimate&&TWEEN.remove(this.flickerAnimate),this.flickerAnimate=new TWEEN.Tween({degree:1}).to({degree:0},t/2).easing(TWEEN.Easing.Linear.None).repeat(i||0===i?2*i-1:1/0).yoyo(!0).onUpdate(function(){var t=o()(a.a.mark((function t(i,n){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.sdk.viewer){t.next=3;break}return TWEEN.remove(e.flickerAnimate),t.abrupt("return");case 3:e.show&&(1===i.degree&&(e.entity&&(e.entity.show=!0),e.labelShow&&e.label&&(e.label.show=!0),e.text&&e.text&&(e.text.show=!0)),0===i.degree&&(e.entity&&(e.entity.show=!1),e.labelShow&&e.label&&(e.label.show=!1),e.text&&e.text&&(e.text.show=!1)));case 4:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}()).onComplete((function(t){TWEEN.remove(e.flickerAnimate),e.flickerAnimate=void 0})).start()}},{key:"flyTo",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:{},!this._error){e.next=3;break}return e.abrupt("return");case 3:if(pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position&&"[object Object]"===Object.prototype.toString.call(this.options.position)?l=zn({},this.options.position):this.options.positions?l=zn({},this.options.positions[0]):this.options.line&&this.options.line.positions?l=zn({},this.options.line.positions[0]):this.options.center?l=zn({},this.options.center):this.options.start?l=zn({},this.options.start):this.geojson?(c=turf.bbox(this.geojson),l={lng:c[0],lat:c[1]}):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(l);case 17:l.alt=e.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=26;break;case 25:this.sdk.viewer.flyTo(this.entity,{offset:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"remove",value:(n=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sdk.removeIncetance(this.options.id);case 2:this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),Mt(this.sdk,this.options.id),at(this.sdk,this.options.id);case 6:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"onClick",get:function(){return this.clickCallBack},set:function(e){if(e&&"function"!=typeof e)console.error("val:",e,"不是一个function");else{var t=rt().sdkD,i=Ht().sdkD;t&&this.sdk===t?null==this.clickCallBack&&this.options&&this.options.id&&function(e,t,i){ke.set(e,{callback:t,that:i})}(this.options.id,this.leftClickCB,this):i&&this.sdk===i?null==this.clickCallBack&&this.options&&this.options.id&&function(e,t,i){ht.set(e,{callback:t,that:i})}(this.options.id,this.leftClickCB,this):null==this.clickCallBack&&this.options&&this.options.id&&fe(this.options.id,this.leftClickCB,this),this.clickCallBack=e}}},{key:"onRightClick",get:function(){return this.rightClickCallBack},set:function(e){if(e&&"function"!=typeof e)console.error("val:",e,"不是一个function");else{var t=rt().sdkD,i=Ht().sdkD;t&&this.sdk===t?null==this.rightClickCallBack&&this.entity&&this.entity.id&&function(e,t,i){_e.set(e,{callback:t,that:i})}(this.entity.id,this.rightClickCB,this):i&&this.sdk===i?null==this.clickCallBack&&this.options&&this.options.id&&function(e,t,i){pt.set(e,{callback:t,that:i})}(this.options.id,this.leftClickCB,this):null==this.rightClickCallBack&&this.entity&&this.entity.id&&ve(this.entity.id,this.rightClickCB,this),this.rightClickCallBack=e}}},{key:"onMouseMove",get:function(){return this.mouseMoveCallBack},set:function(e){if(e&&"function"!=typeof e)console.error("val:",e,"不是一个function");else{var t=rt().sdkD,i=Ht().sdkD;t&&this.sdk===t?null==this.mouseMoveCallBack&&this.entity&&this.entity.id&&function(e,t,i){xe.set(e,{callback:t,that:i})}(this.entity.id,this.mouseMoveCB,this):i&&this.sdk===i?null==this.clickCallBack&&this.options&&this.options.id&&function(e,t,i){dt.set(e,{callback:t,that:i})}(this.options.id,this.leftClickCB,this):null==this.mouseMoveCallBack&&this.entity&&this.entity.id&&ge(this.entity.id,this.mouseMoveCB,this),this.mouseMoveCallBack=e}}},{key:"customView",get:function(){return this.options.customView}},{key:"setCustomView",value:(i=o()(a.a.mark((function e(t){var i,n,o,s,r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=4;break}this.options.customView=t,e.next=16;break;case 4:if(i=this.sdk.viewer.camera,n=this.cartesian3Towgs84(i.position,this.sdk.viewer),o={lng:0,lat:0},s=zn({},n),this.options.position&&"[object Object]"===Object.prototype.toString.call(this.options.position)?o=zn({},this.options.position):this.options.positions?o=zn({},this.options.positions[0]):this.options.line&&this.options.line.positions?o=zn({},this.options.line.positions[0]):this.options.center?o=zn({},this.options.center):this.options.start?o=zn({},this.options.start):this.geojson?(r=turf.bbox(this.geojson),o={lng:r[0],lat:r[1]}):(this.options.hasOwnProperty("lng")&&(o.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(o.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(o.alt=this.options.alt)),o.hasOwnProperty("alt")){e.next=13;break}return e.next=12,this.getClampToHeight(o);case 12:o.alt=e.sent;case 13:s={lng:n.lng-o.lng,lat:n.lat-o.lat,alt:n.alt-o.alt},this.options.customView={orientation:{heading:Cesium.Math.toDegrees(i.heading),pitch:Cesium.Math.toDegrees(i.pitch),roll:Cesium.Math.toDegrees(i.roll)},relativePosition:s},this.originalOptions&&(this.originalOptions.customView=this.options.customView);case 16:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"resetCustomView",value:function(){this.options.customView={relativePosition:void 0,orientation:void 0}}},{key:"edit",value:function(){}},{key:"leftClickCB",value:function(e,t,i,n){n.clickCallBack&&"function"==typeof n.clickCallBack&&n.clickCallBack(e,t,i)}},{key:"rightClickCB",value:function(e,t,i,n){n.rightClickCallBack&&"function"==typeof n.rightClickCallBack&&n.rightClickCallBack(e,t,i)}},{key:"mouseMoveCB",value:function(e,t,i,n){n.mouseMoveCallBack&&"function"==typeof n.mouseMoveCallBack&&n.mouseMoveCallBack(e,t,i)}},{key:"getGuid",value:function(){return Cesium.createGuid()}},{key:"setDefaultValue",value:function(){var e,t,i;this.options.id=null!==(e=this.options.id)&&void 0!==e?e:this.getGuid(),this.options.show=null===(t=this.options.show)||void 0===t||t,this.options.name=null!==(i=this.options.name)&&void 0!==i?i:"未命名对象"}},{key:"start",value:function(){}},{key:"end",value:function(){}}]);var i,n,s}(vi);function Gn(e){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">透明度</span>\n <input type="range" min="0" max="1" step="0.01" @model="transparency">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">波纹层数</span>\n <div class="input-number input-number-unit">\n <input class="input" type="number" title="" min="1" max="10" @model="count">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lat">\n </div>\n <div class="col">\n <span class="label">扩散速度</span>\n <div class="input-number input-number-unit">\n <input class="input" type="number" title="" min="0" max="20" @model="speed">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col input-radius-unit-box" style="margin: 0;">\n <span class="label">半径单位</span>\n <div class="input-radius-unit"></div>\n </div>\n <div class="col" style="margin: 0;">\n </div>\n <div class="col" style="margin: 0;">\n </div>\n </div>\n <div class="row circle-content-box">\n <div class="col">\n <span class="label"></span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lat">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="circle-diffuse-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}var Wn=[{name:"黑体",value:"黑体",font:"SimHei",key:"0"},{name:"思源黑体",value:"思源黑体",font:"SourceHanSansTi",key:"1"},{name:"庞门正道标题体",value:"庞门正道标题体",font:"PMZDBTTi",key:"2"},{name:"数黑体",value:"数黑体",font:"AlimamaShuHeiTi",key:"3"}];function Un(){return Wn}function Yn(e){for(var t=0;t<Wn.length;t++)if(Wn[t].key==e)return Wn[t].font}function Jn(e){for(var t=0;t<Wn.length;t++)if(Wn[t].key==e)return Wn[t].name}function qn(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Xn=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;k()(this,t),(i=qn(this,t,[e,n])).model=o,i._canvas=document.createElement("canvas"),i._canvas2=document.createElement("canvas"),i.options.near=n.near||0===n.near?n.near:2e3,i.options.far=n.far||0===n.far?n.far:1e5,i.options.scaleByDistance=n.scaleByDistance||!1,i.options.show=!n.show&&!1!==n.show||n.show,i.options.text=n.text;for(var s=i.options.text.split("\n"),a=0;a<s.length;a++)s[a].length>40&&(s[a]=s[a].slice(0,40-s[a].length));return s.length>10&&s.splice(10-s.length),i.options.text=s.join("\n"),i.options.fontFamily=n.fontFamily||0,i.font=Yn(i.options.fontFamily)||"SimHei",i.options.fontSize=n.fontSize||20,i.options.lineWidth=n.lineWidth||4,i.options.lineColor=n.lineColor||"#00ffff80",i.options.color=n.color||"#ffffff",i.options.ground=!n.ground&&!1!==n.ground||n.ground,i.options.pixelOffset=n.pixelOffset||0===n.pixelOffset?n.pixelOffset:20,i.options.backgroundColor=n.backgroundColor||["#00ffff80","#00ffff80"],i.event=new K(i.sdk),i.entity,i.create(i.options.position),i.picking=!0,i}return un()(t,e),x()(t,[{key:"create",value:(i=o()(a.a.mark((function e(){var t,i,n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this,this.options.position[2]||0===this.options.position[2]){e.next=5;break}return e.next=4,this.getClampToHeight({lng:this.options.position[0],lat:this.options.position[1]});case 4:this.options.position[2]=e.sent;case 5:this.originalOptions=Zn(this.options),i=this.options.id+"-label",(n=this.sdk.viewer.entities.getById(i))&&this.sdk.viewer.entities.remove(n),this.entity=this.sdk.viewer.entities.add({show:this.options.show,id:this.options.id+"-label",position:new Cesium.CallbackProperty((function(){if(t.model){if(t.model.isMove){var e=t.model.customScale.x;t.model.customScale.y>e&&(e=t.model.customScale.y),t.model.customScale.z>e&&(e=t.model.customScale.z);for(var i=Cesium.Cartesian3.fromDegrees(t.options.position[0],t.options.position[1],t.options.position[2]+2*(t.model.originalBoundingSphereRadius||1)*(e||.01)),n=Cesium.Cartesian3.fromDegrees(t.options.position[0],t.options.position[1],t.options.position[2]-2*(t.model.originalBoundingSphereRadius||1)*(e||.01)),o=Cesium.Cartesian3.subtract(n,i,new Cesium.Cartesian3),s=Cesium.Cartesian3.normalize(o,o),a=new Cesium.Ray(i,s),r=t.viewer.scene.drillPickFromRay(a,5),l=0;l<r.length;l++)if(r[l].object&&r[l].object.id&&r[l].object.id===t.model.id){var c=t.cartesian3Towgs84(r[l].position,t.sdk.viewer);t.options.position[0]=c.lng,t.options.position[1]=c.lat,t.options.position[2]=c.alt;break}}return Cesium.Cartesian3.fromDegrees(t.options.position[0],t.options.position[1],t.options.position[2])}var u;return(u=Cesium.Cartesian3).fromDegrees.apply(u,A()(t.options.position))}),!1),billboard:{image:this.getcanvas(),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ii()?void 0:Number.POSITIVE_INFINITY}),!1),scaleByDistance:this.options.scaleByDistance?new Cesium.NearFarScalar(this.options.near,1,this.options.far,0):void 0,pixelOffsetScaleByDistance:this.options.scaleByDistance?new Cesium.NearFarScalar(this.options.near,1,this.options.far,0):void 0}});case 10:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"position",get:function(){return this.options.position},set:function(e){var t=this;if(this.options.position=e,e[2]||0===e[2])this.options.position=A()(e);else{var i=A()(this.sdk.viewer.entities.values);this.getClampToHeight({lng:e[0],lat:e[1]},i).then((function(i){e[2]=i,t.options.position=A()(e)}))}}},{key:"show",get:function(){return this.options.show},set:function(e){var t=this;if(this.options.show=e,this.entity)if(this.entity.show=e,this.model){var i=this.model.customScale.x;this.model.customScale.y>i&&(i=this.model.customScale.y),this.model.customScale.z>i&&(i=this.model.customScale.z);for(var n=Cesium.Cartesian3.fromDegrees(this.options.position[0],this.options.position[1],this.options.position[2]+2*(this.model.originalBoundingSphereRadius||1)*(i||.01)),o=Cesium.Cartesian3.fromDegrees(this.options.position[0],this.options.position[1],this.options.position[2]-2*(this.model.originalBoundingSphereRadius||1)*(i||.01)),s=Cesium.Cartesian3.subtract(o,n,new Cesium.Cartesian3),a=Cesium.Cartesian3.normalize(s,s),r=new Cesium.Ray(n,a),l=this.viewer.scene.drillPickFromRay(r,5),c=0;c<l.length;c++)if(l[c].object&&l[c].object.id&&l[c].object.id===this.model.id){var u=this.cartesian3Towgs84(l[c].position,this.sdk.viewer);this.options.position[0]=u.lng,this.options.position[1]=u.lat,this.options.position[2]=u.alt;break}}else if(this.options.ground){var h=A()(this.sdk.viewer.entities.values);this.getClampToHeight({lng:this.options.position[0],lat:this.options.position[1]},h).then((function(e){t.options.position[2]=e}))}}},{key:"text",get:function(){return this.options.text},set:function(e){this.options.text=e;for(var t=this.options.text.split("\n"),i=0;i<t.length;i++)t[i].length>40&&(t[i]=t[i].slice(0,40-t[i].length));t.length>10&&t.splice(10-t.length),this.options.text=t.join("\n"),this.entity&&this.updateBillboardImage()}},{key:"color",get:function(){return this.options.color},set:function(e){this.options.color=e,this.entity&&(this.entity.billboard.image=this.getcanvas())}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(e){this.options.scaleByDistance=e,this.entity&&(this.options.scaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0))}},{key:"near",get:function(){return this.options.near},set:function(e){var t=e;t>this.far&&(t=this.far),this.options.near=t,this.entity&&(this.options.scaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0))}},{key:"far",get:function(){return this.options.far},set:function(e){var t=e;t<this.near&&(t=this.near),this.options.far=t,this.entity&&(this.options.scaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0))}},{key:"fontSize",get:function(){return this.options.fontSize},set:function(e){this.options.fontSize=Number(e),this.entity&&this.updateBillboardImage()}},{key:"fontFamily",get:function(){return this.options.fontFamily},set:function(e){this.options.fontFamily=e||0,this.font=Yn(this.options.fontFamily)||"SimHei",this.updateBillboardImage()}},{key:"lineWidth",get:function(){return this.options.lineWidth},set:function(e){this.options.lineWidth=Number(e)||0===Number(e)?Number(e):4,this.entity&&this.updateBillboardImage()}},{key:"pixelOffset",get:function(){return this.options.pixelOffset},set:function(e){this.options.pixelOffset=Number(e),this.entity&&this.updateBillboardImage()}},{key:"updateBillboardImage",value:function(){this.entity.billboard.image=this.getcanvas()}},{key:"lineColor",get:function(){return this.options.pixelOffset},set:function(e){this.options.lineColor=e||"#00ffff80",this.entity&&(this.entity.billboard.image=this.getcanvas())}},{key:"backgroundColor",get:function(){return this.options.backgroundColor},set:function(e){this.options.backgroundColor=e,this.entity&&(this.entity.billboard.image=this.getcanvas())}},{key:"ground",get:function(){return this.options.ground},set:function(e){this.options.ground=e}},{key:"getcanvas",value:function(){var e=this._canvas.getContext("2d");e.clearRect(0,0,this._canvas.width,this._canvas.height),e.font=this.options.fontSize+"px "+this.font;for(var t=this.options.text.split("\n"),i=0,n=0,o=0;o<t.length;o++){var s=t[o],a=e.measureText(s).width;a>i&&(i=a),n+=this.options.fontSize}n=n+20+5*(t.length-1),(i+=30)<this.options.lineWidth&&(i=this.options.lineWidth),this._canvas.width=i,this._canvas.height=this.options.pixelOffset+n;var r=e.createLinearGradient(0,0,i,n+20);r.addColorStop(0,this.options.backgroundColor[0]),r.addColorStop(1,this.options.backgroundColor[1]),e.fillStyle=r,e.fillRect(0,0,i,n),e.fillStyle=this.options.color,e.font=this.options.fontSize+"px "+this.font;for(var l=0,c=0;c<t.length;c++){var u=e.measureText(t[c]).width;l<u&&(l=u)}for(var h=(i-(l+=30))/2,p=0;p<t.length;p++){var d=t[p];this.options.fontSize<10?e.fillText(d,15+h,this.options.fontSize*(p+1)+10+5*p):e.fillText(d,15+h,this.options.fontSize*(p+1)+100/this.options.fontSize+5*p)}e.strokeStyle=this.options.lineColor,e.setLineDash([4,4]),e.lineWidth=this.options.lineWidth,e.beginPath(),e.moveTo(i/2,n),e.lineTo(i/2,n+this.options.pixelOffset),e.stroke(),e.closePath();var m=this._canvas2.getContext("2d");return this._canvas2.width=this._canvas.width+10,this._canvas2.height=this._canvas.height+10,m.drawImage(this._canvas,5,5),this._canvas2.toDataURL("image/png")}},{key:"remove",value:function(){this.sdk.viewer.entities.remove(this.entity),this.entity=null}},{key:"flicker",value:function(){}}]);var i}(Vn),Zn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=null;if("object"==N()(e)&&null!==e)for(var i in t=e instanceof Array?[]:{},e)t[i]=Zn(e[i]);else t=e;return t},Kn=function(){return x()((function e(t){k()(this,e),e.prototype.hasOwnProperty("color")||Object.defineProperties(e.prototype,{color:Cesium.createPropertyDescriptor("color")}),e.prototype.hasOwnProperty("speed")||Object.defineProperties(e.prototype,{speed:Cesium.createPropertyDescriptor("speed")}),e.prototype.hasOwnProperty("transparency")||Object.defineProperties(e.prototype,{transparency:Cesium.createPropertyDescriptor("transparency")}),e.prototype.hasOwnProperty("count")||Object.defineProperties(e.prototype,{count:Cesium.createPropertyDescriptor("count")}),e.prototype.hasOwnProperty("gradient")||Object.defineProperties(e.prototype,{gradient:Cesium.createPropertyDescriptor("gradient")}),this._definitionChanged=new Cesium.Event,this._speed=void 0,this.id=t.id,this.color=t.color||new Cesium.Color(1,1,1,1),this.colors=t.colors||{},this.speed=t.speed,this.transparency=t.transparency,this.count=t.count,this.gradient=t.gradient;var i="",n=[];for(var o in this.colors)Object.hasOwnProperty.call(this.colors,o)&&n.push(o);n.sort((function(e,t){return t-e}));for(var s=0;s<n.length;s++){var a=this.colors[n[s]];i+="\n if(dis < float(".concat(Number(n[s])/2,")) {\n material.diffuse = vec4(0.0,0.0,0.0,0.0).rgb;\n material.emission = 1.0 * vec4(").concat(a.red,",").concat(a.green,",").concat(a.blue,",").concat(a.alpha,").rgb;\n }\n ")}this._source="\n uniform vec4 color;\n uniform float speed;\n uniform float count;\n uniform float gradient;\n uniform float transparency;\n uniform float frameNumber;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n float per = fract(frameNumber * speed / 30000.0);\n vec3 str = materialInput.str;\n if(abs(str.z) > 0.001){\n discard;\n }\n if(dis > 0.5){\n discard;\n }else {\n ".concat(i,"\n float perDis = 0.5 / count;\n float disNum;\n float bl = 0.0;\n for(int i = 0; i <= 99; i++){\n if(float(i) <= count){\n disNum = perDis * float(i) - dis + per / count;\n if(disNum > 0.0){\n if(disNum < perDis){\n bl = 1.0 - disNum / perDis;\n }\n else if(disNum - perDis < perDis){\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = pow(bl,(1.0 + 10.0 * (1.0 - gradient))) * transparency;\n }\n }\n }\n }\n return material;\n }\n "),this._CircleRippleMaterialType="CircleRippleMaterialType"+this.id,Cesium.Material._materialCache.addMaterial(this._CircleRippleMaterialType,{fabric:{type:this._CircleRippleMaterialType,uniforms:{color:new Cesium.Color(1,0,0,1),speed:3,transparency:1,count:4,gradient:.2,frameNumber:Cesium.getTimestamp()},source:this._source},translucent:function(e){return!0}})}),[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(e){return this._CircleRippleMaterialType}},{key:"getValue",value:function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrDefault(this._color,e,Cesium.Color.RED,t.color),t.speed=Cesium.Property.getValueOrDefault(this._speed,e,10,t.speed),t.transparency=this.transparency,t.count=this.count,t.gradient=this.gradient,t.frameNumber=Cesium.getTimestamp(),t}},{key:"equals",value:function(e){return this===e||e instanceof CircleRippleMaterialProperty&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._speed,e._speed)&&Cesium.Property.equals(this.count,e.count)&&Cesium.Property.equals(this.transparency,e.transparency)&&Cesium.Property.equals(this.gradient,e.gradient)}}])}();function Qn(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 $n(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Qn(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Qn(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function eo(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function to(e,t,i){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,i)}function io(e,t,i){return e.set(oo(e,t),i),i}function no(e,t){return e.get(oo(e,t))}function oo(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var so=new WeakMap,ao=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,t),to(i=eo(this,t,[e,n]),so,null),i.options.lng=n.lng,i.options.lat=n.lat,i.options.color=n.color||"#ff0000",i.options.transparency=n.transparency||0===n.transparency?n.transparency:1,i.options.transparency>1&&(i.options.transparency=1),i.options.speed=n.speed||0===n.speed?n.speed:5,i.options.count=n.count||0===n.count?n.count:3,n.count||0===n.count?(i.options.count=n.count,n.count>99&&(i.options.count=99)):i.options.count=3,i.options.circle=n.circle||[{radius:10,color:i.options.color}];for(var s=0;s<i.options.circle.length;s++)i.options.circle[s].radius>999999&&(i.options.circle[s].radius=999999);i.options.show=!n.show&&!1!==n.show||n.show,i.event=new K(i.sdk),n.label=n.label||{},i._elms={},i.options.label={show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],delete i.options.attribute.camera,delete i.options.attribute.vr,delete i.options.attribute.goods,i.options.richTextContent=n.richTextContent||"";for(var a=0,r=0;r<i.options.circle.length;r++)Number(i.options.circle[r].radius)>a&&(a=Number(i.options.circle[r].radius));return i._radius=a,i.operate={},i.Dialog=o,i._EventBinding=new xn,i.sdk.addIncetance(i.options.id,i),t.create(i),i}return un()(t,e),x()(t,[{key:"type",get:function(){return"CircleDiffuse"}},{key:"show",get:function(){return this.options.show},set:function(e){if("boolean"==typeof e){var t=Ht().sdkD;this.isShowView&&t||(this.options.show=e),this.showView&&3!=this.showView&&t?(this.entity.show=!1,this.options.label.show&&(this.label.show=!1)):(this.entity.show=this.options.show,this.options.label.show&&(this.label.show=this.options.show)),this.isShowView=!1,Mt(this.sdk,this.options.id),at(this.sdk,this.options.id),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=e)}else console.error("参数必须为boolean")}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;this.sdk&&this.sdk.viewer&&this.entity&&(this.operate.positionEditing=e,!0===e?(this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.lastOptions={lng:this.options.lng,lat:this.options.lat},this.event.mouse_move((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=n.lng,t.lat=n.lat,t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=n.lng,t.lat=n.lat,t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),no(so,t)&&(no(so,t).call(t),io(so,t,null)),t.lastOptions=void 0,t.positionEditing=!1})),this.event.mouse_right((function(e,i){t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.positionEditing=!1;else{var e=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=e.lng,t.lat=e.lat,t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.lastOptions=void 0,t.positionEditing=!1}}))}))):(setTimeout((function(){t.picking=!0}),500),this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){}))),this.tip&&this.tip.destroy(),this.lastOptions&&(this.lng=this.lastOptions.lng,this.lat=this.lastOptions.lat),this.lastOptions=void 0))}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,io(so,this,e)}},{key:"lng",get:function(){return this.options.lng},set:function(e){this.options.lng=e,this.label.position=[e,this.lat],this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e}))}},{key:"lat",get:function(){return this.options.lat},set:function(e){this.options.lat=e,this.label.position=[this.lng,e],this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e}))}},{key:"radius",get:function(){return this._radius}},{key:"circle",get:function(){return this.options.circle},set:function(e){this.options.circle=e||[{radius:10,color:this.options.color}];for(var i=0,n=0;n<this.options.circle.length;n++)Number(this.options.circle[n].radius)>999999&&(this.options.circle[n].radius=999999),Number(this.options.circle[n].radius)>i&&(i=Number(this.options.circle[n].radius));this._radius=i,t.create(this)}},{key:"speed",get:function(){return this.options.speed},set:function(e){this.options.speed=e,t.create(this),this._elms.speed&&this._elms.speed.forEach((function(t){t.value=e}))}},{key:"transparency",get:function(){return this.options.transparency},set:function(e){this.options.transparency=e>1?1:Number(e),t.create(this),this._elms.transparency&&this._elms.transparency.forEach((function(t){t.value=e}))}},{key:"count",get:function(){return this.options.count},set:function(e){this.options.count=e>99?99:e,t.create(this),this._elms.count&&this._elms.count.forEach((function(t){t.value=e}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){var t=Ht().sdkD;this.options.label.show=e,!this.show||this.showView&&3!=this.showView&&t?this.label.show=!1:this.label.show=e,this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label.color=e,this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label.fontSize=e,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label.scaleByDistance=e,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(e){this.options.label.lineWidth=e,this.label.lineWidth=e,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(t){t.value=e}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(e){this.options.label.pixelOffset=e,this.label.pixelOffset=e,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(t){t.value=e}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(e){var t=this;this.options.label.lineColor=e,this.label.lineColor=e,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelLineColor=e},clear:function(){t.labelLineColor="rgba(0,255,255,0.5)"}});t._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label.backgroundColor=[e,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label.backgroundColor=[this.label.backgroundColor[0],e],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"flyTo",value:(r=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:{},pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=$n({},this.options.position):this.options.positions?l=$n({},this.options.positions[0]):this.options.center?l=$n({},this.options.center):this.options.start?l=$n({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=16;break}return e.next=15,this.getClampToHeight(l);case 15:l.alt=e.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=27;break;case 23:return e.next=25,this.getClampToHeight({lng:this.options.lng,lat:this.options.lat});case 25:c=e.sent,this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,6*this.radius+c),orientation:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},duration:1});case 27:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"edit",value:(s=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 7:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" circle-ciffuse",(i=document.createElement("div")).innerHTML=Gn(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,this._createCircleElm(),new En("circle-diffuse-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){c.labelColor=e},clear:function(){c.labelColor="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){c.labelLineColor=e},clear:function(){c.labelLineColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){c.labelBackgroundColorStart=e},clear:function(){c.labelBackgroundColorStart="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){c.labelBackgroundColorEnd=e},clear:function(){c.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),l=i.getElementsByTagName("*"),this._EventBinding.on(this,l),this._elms=this._EventBinding.element,this._elms.labelColor=[n],this._elms.labelLineColor=[o],this._elms.labelBackgroundColorStart=[s],this._elms.labelBackgroundColorEnd=[r],setTimeout((function(){c.attributeLink=c.options.attribute.link.content,c.attributeVr=c.options.attribute.vr.content,c.ISCSelect&&c.ISCSelect(),c.goodsSelect&&c.goodsSelect(),c.cameraSelect&&c.cameraSelect();var e=q(c._DialogObject._element.content.getElementsByClassName("input-radius-unit-box")[0],".input-radius-unit");if(e){e.legp_search([{name:"米",value:"米"},{name:"千米",value:"千米"}]);var t=c._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0];t.value="米",t.addEventListener("input",(function(){var e=c._DialogObject._element.content.getElementsByClassName("circle-content-box")[0].getElementsByClassName("input-number");switch(t.value){case"米":for(var i=0;i<e.length;i++){var n=e[i].getElementsByClassName("unit")[0],o=e[i].getElementsByTagName("input")[0];"km"===n.innerHTML&&(n.innerHTML="m",o.value=Math.floor(1e3*o.value*100)/100)}break;case"千米":for(var s=0;s<e.length;s++){var a=e[s].getElementsByClassName("unit")[0],r=e[s].getElementsByTagName("input")[0];"m"===a.innerHTML&&(a.innerHTML="km",r.value=Math.floor(1e5*Number((r.value/1e3).toFixed(5)))/1e5)}}}))}var i=c.attributeSelect,n=c._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(n){var o=q(n,".attribute-select");o.legp_search(i);for(var s=c._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],a=0;a<i.length;a++)if(i[a].key===c.options.attributeType){s.value=i[a].value,o.legp_searchActive(i[a].value);break}s.addEventListener("input",(function(){for(var e=0;e<i.length;e++)if(i[e].value===s.value){c.attributeType=i[e].key;break}}))}var r=Un(),l=q(c._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(l){l.legp_search(r);var u=c._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];u.value=r[c.labelFontFamily].value;for(var h=0;h<r.length;h++)if(r[h].value==u.value){l.legp_searchActive(r[h].value);break}u.addEventListener("input",(function(){for(var e=0;e<r.length;e++)if(r[e].value===u.value){c.labelFontFamily=r[e].key;break}})),c._elms.labelFontFamily=[u]}}),0);case 29:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"reset",value:function(){if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.duration=this.originalOptions.duration,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1];for(var e=0,i=0;i<this.options.circle.length;i++)Number(this.options.circle[i].radius)>e&&(e=Number(this.options.circle[i].radius));this._radius=e,t.create(this)}}},{key:"remove",value:(n=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.label&&this.label.remove(),this.entity&&this.sdk.viewer.entities.remove(this.entity),this.entity2&&this.sdk.viewer.entities.remove(this.entity2),this.entity=null,this.entity2=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),e.next=10,this.sdk.removeIncetance(this.options.id);case 10:return e.next=12,Mt(this.sdk,this.options.id);case 12:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"setDIV",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};t.x=t.x||0===t.x?t.x:10,t.y=t.y||0===t.y?t.y:10;var i=document.getElementById(t.domid),n=Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=e.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+t.x).toFixed(0)+"px",i.style.top=(s.y+t.y).toFixed(0)+"px")}}))}}],[{key:"create",value:function(e){for(var i={},n=0;n<e.options.circle.length;n++)i[e.options.circle[n].radius/e.radius]=Cesium.Color.fromCssColorString(e.options.circle[n].color||e.options.color);var o=e.sdk._entityZIndex;e.entity?(o=e.entity.ellipse.zIndex._value,e.sdk.viewer.entities.remove(e.entity),e.entity=e.sdk.viewer.entities.add({id:e.options.id,show:e.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(e.options.lng,e.options.lat)}),!1),name:"波纹圆",ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(){return e.radius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(){return e.radius}),!1),material:new Kn({id:e.options.id,colors:i,transparency:e.options.transparency,speed:e.options.speed,count:e.options.count,gradient:.2}),zIndex:o}})):(e.entity=e.sdk.viewer.entities.add({id:e.options.id,show:e.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(e.options.lng,e.options.lat)}),!1),name:"波纹圆",ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(){return e.radius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(){return e.radius}),!1),material:new Kn({id:e.options.id,colors:i,transparency:e.options.transparency,speed:e.options.speed,count:e.options.count,gradient:.2}),zIndex:o}}),e.options.show&&Qe(0,e.options.id),e.sdk._entityZIndex++,"cesium-viewer 2d"===e.sdk.viewer._element.className&&(e.entity.ellipse.height=1),t.createLabel(e),Mt(e.sdk,e.options.id))}},{key:"createLabel",value:(i=o()(a.a.mark((function e(t){var i;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getClampToHeight({lng:t.options.lng,lat:t.options.lat});case 2:i=e.sent,t.options.label.position={lng:t.options.lng,lat:t.options.lat,alt:i},t.label=new Xn(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.label.position.lng,t.options.label.position.lat,t.options.label.position.alt],text:t.options.name,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far,ground:!0});case 5:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}]);var i,n,s,r}(Vn);function ro(e){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">扫描颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">扫描半径</span>\n <div class="input-number input-number-unit-2 input-radius">\n <input class="input" type="number" title="" data-min="0.1" max="999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <div class="input-radius-unit-box" style="flex: 0 0 60px;">\n <div class="input-radius-unit"></div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label">扫描速度</span>\n <input class="input" type="number" title="" min="0" max="100" @model="speed">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="radar-scan-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function lo(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 co(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?lo(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):lo(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function uo(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function ho(e,t,i){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,i)}function po(e,t,i){return e.set(fo(e,t),i),i}function mo(e,t){return e.get(fo(e,t))}function fo(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var vo=new WeakMap,go=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),ho(i=uo(this,t,[e,n]),vo,null),i.options.lng=n.lng,i.options.lat=n.lat,i.options.color=n.color||"#ff0000",i.options.radius=n.radius||10,i.options.radius>999999&&(i.options.radius=999999),i.options.speed=n.speed||0===n.speed?n.speed:20,i.options.show=!n.show&&!1!==n.show||n.show,i.event=new K(i.sdk),i.operate={},n.label=n.label||{},i._elms={},i.options.label={show:n.label.show||!1,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.richTextContent=n.richTextContent||"",i.Dialog=o,i._EventBinding=new xn,i.sdk.addIncetance(i.options.id,i),t.create(i),i}return un()(t,e),x()(t,[{key:"show",get:function(){return this.options.show},set:function(e){if("boolean"==typeof e){var t=Ht().sdkD;this.isShowView&&t||(this.options.show=e),this.showView&&3!=this.showView&&t?(this.entity.show=!1,this.options.label.show&&this.label&&(this.label.show=!1)):(this.entity.show=this.options.show,this.options.label.show&&this.label&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=e),Mt(this.sdk,this.options.id),at(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity&&(this.operate.positionEditing=e,!0===e?(this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.lastOptions={lng:this.options.lng,lat:this.options.lat},this.event.mouse_move((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=n.lng,t.lat=n.lat,t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=n.lng,t.lat=n.lat,t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),mo(vo,t)&&(mo(vo,t).call(t),po(vo,t,null)),t.lastOptions=void 0,t.positionEditing=!1})),this.event.mouse_right((function(e,i){t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.positionEditing=!1;else{var e=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=e.lng,t.lat=e.lat,t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.lastOptions=void 0,t.positionEditing=!1}}))}))):(setTimeout((function(){t.picking=!0}),500),this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),this.lastOptions&&(this.lng=this.lastOptions.lng,this.lat=this.lastOptions.lat),this.lastOptions=void 0))}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,po(vo,this,e)}},{key:"lng",get:function(){return this.options.lng},set:function(e){this.options.lng=e,this.label.position=[e,this.lat],this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e}))}},{key:"lat",get:function(){return this.options.lat},set:function(e){this.options.lat=e,this.label.position=[this.lng,e],this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e}))}},{key:"radius",get:function(){return this.options.radius},set:function(e){var t=Number(e.toFixed(2));(t>999999&&(t=999999),t<.1&&(t=.1),this.options.radius=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content)&&("千米"===this._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value&&(t=Number((t/1e3).toFixed(5))));this._elms.radius&&this._elms.radius.forEach((function(e){e.value=t}))}},{key:"speed",get:function(){return this.options.speed},set:function(e){this.options.speed=e,this.changeMaterial(),this._elms.speed&&this._elms.speed.forEach((function(t){t.value=e}))}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;this.options.color=e,this.changeMaterial(),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,255,255,1)"}});t._elms.color[n]=o}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){var t=Ht().sdkD;this.options.label.show=e,!this.show||this.showView&&3!=this.showView&&t?this.label.show=!1:this.label.show=e,this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label.color=e,this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label.fontSize=e,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label.scaleByDistance=e,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(e){this.options.label.lineWidth=e,this.label.lineWidth=e,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(t){t.value=e}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(e){this.options.label.pixelOffset=e,this.label.pixelOffset=e,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(t){t.value=e}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(e){var t=this;this.options.label.lineColor=e,this.label.lineColor=e,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelLineColor=e},clear:function(){t.labelLineColor="rgba(0,255,255,0.5)"}});t._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label.backgroundColor=[e,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label.backgroundColor=[this.label.backgroundColor[0],e],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"flyTo",value:(r=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:{},pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=co({},this.options.position):this.options.positions?l=co({},this.options.positions[0]):this.options.center?l=co({},this.options.center):this.options.start?l=co({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=16;break}return e.next=15,this.getClampToHeight(l);case 15:l.alt=e.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=27;break;case 23:return e.next=25,this.getClampToHeight({lng:this.options.lng,lat:this.options.lat});case 25:c=e.sent,this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,6*this.options.radius+c),orientation:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},duration:1});case 27:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"edit",value:(s=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 7:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" radar-scan",(i=document.createElement("div")).innerHTML=ro(this),this._DialogObject.contentAppChild(i),new En("radar-scan-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){h.color=e},clear:function(){h.color="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){h.labelColor=e},clear:function(){h.labelColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){h.labelLineColor=e},clear:function(){h.labelLineColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){h.labelBackgroundColorStart=e},clear:function(){h.labelBackgroundColorStart="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){h.labelBackgroundColorEnd=e},clear:function(){h.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),c=i.getElementsByTagName("*"),this._EventBinding.on(this,c),this._elms=this._EventBinding.element,this._elms.color=[n],this._elms.labelColor=[o],this._elms.labelLineColor=[s],this._elms.labelBackgroundColorStart=[r],this._elms.labelBackgroundColorEnd=[l],(u=this._DialogObject._element.content.getElementsByClassName("input-radius")[0].getElementsByTagName("input")[0]).value=this.options.radius,this._elms.radius=[u],u.addEventListener("input",(function(e){var t=h._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(e.target.value||0===e.target.value){var i=e.target.value;i=Number(i),"."==e.data||"-"==e.data&&!e.target.value||(!e.target.max&&!e.target.min||i<=Number(e.target.max)/("米"===t?1:1e3)&&i>=Number(e.target.min))&&(h.radius=i*("米"===t?1:1e3))}})),u.addEventListener("blur",(function(e){var t=h._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(e.target.value||0===e.target.value){var i=e.target.value;i=Number(i),e.target.max&&i>Number(e.target.max)/("米"===t?1:1e3)&&(i=Number(e.target.max)/("米"===t?1:1e3)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),h.radius=Number((i*("米"===t?1:1e3)).toFixed(2))}})),setTimeout((function(){h.attributeLink=h.options.attribute.link.content,h.attributeVr=h.options.attribute.vr.content,h.ISCSelect&&h.ISCSelect(),h.goodsSelect&&h.goodsSelect(),h.cameraSelect&&h.cameraSelect();var e=h.attributeSelect,t=h._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(t){var i=q(t,".attribute-select");i.legp_search(e);for(var n=t.getElementsByTagName("input")[0],o=0;o<e.length;o++)if(e[o].key===h.options.attributeType){n.value=e[o].value,i.legp_searchActive(e[o].value);break}n.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===n.value){h.attributeType=e[t].key;break}}))}var s=[{name:"米",value:"米"},{name:"千米",value:"千米"}],a=h._DialogObject._element.content.getElementsByClassName("input-radius-unit-box")[0];if(a){q(a,".input-radius-unit").legp_search(s);var r=h._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0];r.value=s[0].value,r.addEventListener("input",(function(){var e=h._DialogObject._element.content.getElementsByClassName("input-radius")[0],t=e.getElementsByClassName("unit")[0],i=e.getElementsByClassName("input")[0];switch(r.value){case"米":"km"===t.innerHTML&&(t.innerHTML="m",i.value=Number((1e3*i.value).toFixed(2)));break;case"千米":"m"===t.innerHTML&&(t.innerHTML="km",i.value=Number((i.value/1e3).toFixed(5)))}}))}var l=Un(),c=q(h._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(c){c.legp_search(l);var u=h._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];u.value=l[h.labelFontFamily].value;for(var p=0;p<l.length;p++)if(l[p].value==u.value){c.legp_searchActive(l[p].value);break}u.addEventListener("input",(function(){for(var e=0;e<l.length;e++)if(l[e].value===u.value){h.labelFontFamily=l[e].key;break}})),h._elms.labelFontFamily=[u]}}),0);case 32:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.color=this.originalOptions.color,this.radius=this.originalOptions.radius,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1])}},{key:"remove",value:(n=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.label&&this.label.remove(),this.entity&&this.sdk.viewer.entities.remove(this.entity),this.entity2&&this.sdk.viewer.entities.remove(this.entity2),this.entity=null,this.entity2=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),e.next=10,this.sdk.removeIncetance(this.options.id);case 10:return e.next=12,Mt(this.sdk,this.options.id);case 12:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"changeMaterial",value:function(){var e=function(e){if(/^#/.test(e)){var t=e.replace("#",""),i=parseInt(t.substring(0,2),16),n=parseInt(t.substring(2,4),16),o=parseInt(t.substring(4,6),16),s=parseInt(t.substring(6,8),16);s||0===s?s/=255:s=1,e="rgba(".concat(i,",").concat(n,",").concat(o,",").concat(s,")")}var a=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);return a?[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),a[4]?parseFloat(a[4]):1]:null}(this.options.color),t="rgba(".concat(e[0],",").concat(e[1],",").concat(e[2],",1)");this.entity&&(this.entity.ellipse.material=new Cesium.RadarScanMaterialProperty({color:Cesium.Color.fromCssColorString(t),transparency:e[3],speed:this.options.speed}))}},{key:"setDIV",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};t.x=t.x||0===t.x?t.x:10,t.y=t.y||0===t.y?t.y:10;var i=document.getElementById(t.domid),n=Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=e.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+t.x).toFixed(0)+"px",i.style.top=(s.y+t.y).toFixed(0)+"px")}}))}}],[{key:"create",value:function(e){var i=function(e){if(/^#/.test(e)){var t=e.replace("#",""),i=parseInt(t.substring(0,2),16),n=parseInt(t.substring(2,4),16),o=parseInt(t.substring(4,6),16),s=parseInt(t.substring(6,8),16);s||0===s?s/=255:s=1,e="rgba(".concat(i,",").concat(n,",").concat(o,",").concat(s,")")}var a=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);return a?[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),a[4]?parseFloat(a[4]):1]:null}(e.options.color),n="rgba(".concat(i[0],",").concat(i[1],",").concat(i[2],",1)");e.entity=e.sdk.viewer.entities.add({id:e.options.id,show:e.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(e.options.lng,e.options.lat)}),!1),name:"雷达扫描",ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(){return e.options.radius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(){return e.options.radius}),!1),material:new Cesium.RadarScanMaterialProperty({color:Cesium.Color.fromCssColorString(n),transparency:i[3],speed:e.options.speed}),zIndex:e.sdk._entityZIndex}}),e.sdk._entityZIndex++,"cesium-viewer 2d"===e.sdk.viewer._element.className&&(e.entity.ellipse.height=1),t.createLabel(e),Mt(e.sdk,e.options.id),e.options.show&&Qe(0,e.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function e(t){var i;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getClampToHeight({lng:t.options.lng,lat:t.options.lat});case 2:i=e.sent,t.options.label.position={lng:t.options.lng,lat:t.options.lat,alt:i},t.label=new Xn(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.label.position.lng,t.options.label.position.lat,t.options.label.position.alt],text:t.options.name,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far,ground:!0});case 5:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"createBy2D",value:function(e){e.entity=new Cesium.EntityCollection;var i=0,n=r(e.options,e.options.radius,i),o=(new Date).getTime();e.viewer.clock.onTick.addEventListener((function(){var t=(new Date).getTime(),s=0*(t-o);o=t,i+=s,n=r(e.options,e.options.radius,i)}));var s=e.sdk.viewer.entities.add({show:e.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){var t=e.createCircle({lng:e.options.lng,lat:e.options.lat},e.options.radius);return Cesium.Cartesian3.fromDegreesArray(t)}),!1),width:2,material:Cesium.Color.fromCssColorString(e.options.color),clampToGround:!0}}),a=e.sdk.viewer.entities.add({show:e.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArray(n)}),!1),width:2,material:Cesium.Color.fromCssColorString(e.options.color),clampToGround:!0}});function r(e,t,i){var n=e.lng,o=e.lat,s=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(n,o,0)),a=t*Math.cos(i*Math.PI/180),r=t*Math.sin(i*Math.PI/180),l=Cesium.Cartesian3.fromElements(a,r,0),c=Cesium.Matrix4.multiplyByPoint(s,l,new Cesium.Cartesian3),u=Cesium.Cartographic.fromCartesian(c);return[n,o,Cesium.Math.toDegrees(u.longitude),Cesium.Math.toDegrees(u.latitude)]}e.entity.add(s),e.entity.add(a),e.sdk.viewer.entities.add(e.entity),t.createLabel(e),Mt(e.sdk,e.options.id)}}]);var i,n,s,r}(Vn);function yo(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return bo(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)?bo(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function bo(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 Co(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 wo(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Co(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Co(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function ko(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function _o(e,t,i){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,i)}function xo(e,t,i){return e.set(So(e,t),i),i}function Eo(e,t){return e.get(So(e,t))}function So(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var Po=new WeakMap,Do=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),_o(i=ko(this,t,[e,n]),Po,null),i.options.near=n.near||0===n.near?n.near:2e3,i.options.far=n.far||0===n.far?n.far:1e5,i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:3,i.options.billboard=n.billboard=n.billboard||{},i.options.billboard.show=!n.billboard.show&&!1!==n.billboard.show||n.billboard.show,i.options.billboard.image=n.billboard.image||ti(n.billboard.defaultImage)||i.getSourceRootPath()+"/img/A-ablu-blank.png",i.options.billboard.defaultImage=n.billboard.defaultImage,i.options.billboard.scale=n.billboard.scale||0===n.billboard.scale?n.billboard.scale:3,n.label=n.label||{},i.options.label=n.label||{},i.options.label.text=n.label.text||i.options.name,i.options.name=i.options.label.text,i.options.label.show=!n.label.show&&!1!==n.label.show||n.label.show,i.options.label.fontFamily=n.label.fontFamily||0,i.options.label.fontSize=n.label.fontSize||39,i.options.label.color=n.label.color||"#00ffff",i.options.position=n.position=n.position||{},i.options.position.lng=Number(Number(n.position.lng||0).toFixed(8)),i.options.position.lat=Number(Number(n.position.lat||0).toFixed(8)),i.options.position.alt=Number(Number(n.position.alt||0).toFixed(2)),i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.isc=i.options.attribute.isc||{},i.options.attribute.isc.content=i.options.attribute.isc.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.richTextContent=n.richTextContent||"",i.operate={},i._elms={},i.previous={position:wo({},i.options.position)},i.entity,i._proj=i.sdk.proj,i.sdk.addIncetance(i.options.id,i),t.create(i),i.picking=!0,i.Dialog=o,i._EventBinding=new xn,i}return un()(t,e),x()(t,[{key:"type",get:function(){return"BillboardObject"}},{key:"selectBillboard",value:function(){var e=this;this.sdk.viewer.screenSpaceEventHandler.setInputAction((function(t){var i=e.sdk.viewer.scene.pick(t.position);Cesium.defined(i)&&i.id&&"airportBillboard"===i.id.id?e.entity.billboard&&(e.entity.billboard.color=Cesium.Color.YELLOW):e.entity.billboard&&(e.entity.billboard.color=Cesium.Color.WHITE)}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}},{key:"attributeSelect",get:function(){return[{name:"富文本",value:"富文本",key:"richText"},{name:"链接",value:"链接",key:"link"},{name:"IP摄像头",value:"IP摄像头",key:"camera"},{name:"全景图",value:"全景图",key:"vr"},{name:"物资",value:"物资",key:"goods"}]}},{key:"show",get:function(){return this.options.show},set:function(e){this.isShowView||(this.options.show=e,this.originalOptions.show=e),this.showView&&3!=this.showView?this.entity&&(this.entity.show=!1):this.entity&&(this.entity.show=this.options.show),Mt(this.sdk,this.options.id),at(this.sdk,this.options.id),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=this.options.show),this.isShowView=!1}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(e){var t,i=this;this.options.heightMode=e||0,this.options.heightMode=e||0==e?e:3;switch(this.options.heightMode){case"0":case 0:t=Cesium.HeightReference.NONE;break;case"1":case 1:t=Cesium.HeightReference.NONE;break;case"2":case 2:t=Cesium.HeightReference.CLAMP_TO_GROUND;break;case"3":case 3:t=Cesium.HeightReference.NONE;var n,o=[],s=yo(this.sdk.entityMap);try{for(s.s();!(n=s.n()).done;){var a=y()(n.value,2),r=(a[0],a[1]);"RadarScanStereoscopic"===r.type&&r.entity&&o.push(r.entity)}}catch(e){s.e(e)}finally{s.f()}this.getClampToHeight(this.options.position,o).then((function(e){i.alt=Number(e.toFixed(2))}))}this.entity&&(this.entity.billboard.heightReference=t,this.entity.label.heightReference=t)}},{key:"labelText",get:function(){return this.options.label.text},set:function(e){this.options.label.text=e,this.options.name=e,this.entity&&(this.entity.label.text=e+""),this._elms.labelText&&this._elms.labelText.forEach((function(t){t.value=e}))}},{key:"lng",get:function(){return this.options.position.lng},set:function(e){this.options.position.lng=Number(Number(e).toFixed(8)),this.renewPoint(),this.coordinate=this.options.coordinate,this._projConvert&&this._projConvert(),this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e}))}},{key:"lat",get:function(){return this.options.position.lat},set:function(e){this.options.position.lat=Number(Number(e).toFixed(8)),this.renewPoint(),this.coordinate=this.options.coordinate,this._projConvert&&this._projConvert(),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e}))}},{key:"alt",get:function(){return this.options.position.alt},set:function(e){this.options.position.alt=Number(Number(e).toFixed(2)),this.renewPoint(),this.coordinate=this.options.coordinate}},{key:"near",get:function(){return this.options.near},set:function(e){var t=e;t>this.far&&(t=this.far),this.options.near=t,this.renewPoint(),this._elms.near&&this._elms.near.forEach((function(e){e.value=t}))}},{key:"far",get:function(){return this.options.far},set:function(e){var t=e;t<this.near&&(t=this.near),this.options.far=t,this.renewPoint(),this._elms.far&&this._elms.far.forEach((function(e){e.value=t}))}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(e){this.options.scaleByDistance=e,this.renewPoint(),this._elms.scaleByDistance&&this._elms.scaleByDistance.forEach((function(t){t.checked=e}))}},{key:"billboardShow",get:function(){return this.options.billboard.show},set:function(e){this.options.billboard.show=e,this.entity&&(this.entity.billboard.color=this.options.billboard.show?void 0:new Cesium.Color(1,1,1,0)),this._elms.billboardShow&&this._elms.billboardShow.forEach((function(t){t.value=e}))}},{key:"billboardImage",get:function(){var e=this.options.billboard.image;e&&!e.startsWith("http")&&(e.includes(":")||this.options.host&&(e=new URL(e,this.options.host).href));return e},set:function(e){var t=this;this.options.billboard.image=this.replaceHost(e,this.options.host);var i=this.options.billboard.image||ti(this.options.billboard.defaultImage)||this.getSourceRootPath()+"/img/A-ablu-blank.png";this._elms.billboardImage&&this._elms.billboardImage.forEach((function(e){e.src=i}));var n;if(t.entity.billboard.image&&t.entity.billboard.image.getVa,i&&i.endsWith("gif")){!0;var o=document.createElement("img");o.setAttribute("rel:animated_src",i),o.setAttribute("rel:auto_play","1"),document.createElement("div").appendChild(o);var s=Cesium.createGuid();n=new SuperGif({gif:o}),this._superGif=n,this._superGif.id=s;var a=36,r=0;t._frameImages=[],n.load((function(e){if(404==e){return document.createElement("canvas"),kn()("canvas"),l.width=0,l.height=0,a=0,t.entity.billboard.imgWidth=0,t.entity.billboard.imgHeight=0,t.entity&&(t.entity.billboard.image=l),t.entity.billboard.height=new Cesium.CallbackProperty((function(){return 0}),!1),t.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return new Cesium.Cartesian2(0,0)}),!1),void(a=36)}if(t._superGif.id==s){for(var i=n.get_length(),o=1;o<=i;o++)n.move_to(o),t._frameImages.push(n.get_canvas().toDataURL());var l=n.get_canvas(),c=l.width,u=l.height;a=u*(31/c),t.entity.billboard.imgWidth=c,t.entity.billboard.imgHeight=u,t.entity&&(t.entity.billboard.image=new Cesium.CallbackProperty((function(){var e=t._frameImages[r];return r=r>=t._frameImages.length-1?0:r+1,e}),!1)),t.entity.billboard.height=new Cesium.CallbackProperty((function(){return a}),!1),t.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return t.options.billboard.show?new Cesium.Cartesian2(0,-a*t.options.billboard.scale-t.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-t.options.label.fontSize/2-5)}),!1)}}))}else{var l=new Image;l.src=i;var c=36,u=document.createElement("canvas");l.onload=function(){var e=l.width/l.height;l.width=100,l.height=100/e;var i=l.width,n=l.height,o=u.getContext("2d",{willReadFrequently:!0});u.width=i,u.height=n,o.drawImage(l,0,0,i,n),c=n*(31/i),t.entity.billboard.imgWidth=i,t.entity.billboard.imgHeight=n,t.entity&&(t.entity.billboard.image=u),t.entity.billboard.height=new Cesium.CallbackProperty((function(){return c}),!1),t.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return t.options.billboard.show?new Cesium.Cartesian2(0,-c*t.options.billboard.scale-t.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-t.options.label.fontSize/2-5)}),!1),c=n*(31/i)},l.onerror=function(e){u.width=0,u.height=0,c=0,t.entity.billboard.imgWidth=0,t.entity.billboard.imgHeight=0,t.entity&&(t.entity.billboard.image=u),t.entity.billboard.height=new Cesium.CallbackProperty((function(){return 0}),!1),t.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return new Cesium.Cartesian2(0,0)}),!1),c=36}}}},{key:"billboardScale",get:function(){return this.options.billboard.scale},set:function(e){this.options.billboard.scale=e,this.renewPoint(),this._elms.billboardScale&&this._elms.billboardScale.forEach((function(t){t.value=e}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){this.options.label.show=e,this.entity&&(this.entity.label.show=e),this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.value=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.renewPoint();var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.renewPoint(),this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e||"#00ffff",this.renewPoint(),this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.label.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(0,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(e){var t=this;if(this.options.attribute.link.content=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),h={linkEdit:(c=o()(a.a.mark((function e(i){var n,o,s,r,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.options.attribute.link.content;case 2:t.attributeLink=e.sent,n=t._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function e(n){var o,r,l,c,u,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==n){e.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){e.next=35;break}if(l[c]&&l[c].attributes){e.next=14;break}return e.abrupt("continue",32);case 14:u=yo(l[c].attributes),e.prev=15,d=a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("@click"!==(t=p.value).name){e.next=5;break}return l[c].addEventListener("click",(function(e){"function"==typeof h[t.value]&&h[t.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(t.name),e.abrupt("return",1);case 5:case"end":return e.stop()}}),e)})),u.s();case 18:if((p=u.n()).done){e.next=24;break}return e.delegateYield(d(),"t0",20);case 20:if(!e.t0){e.next=22;break}return e.abrupt("break",24);case 22:e.next=18;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(15),u.e(e.t1);case 29:return e.prev=29,u.f(),e.finish(29);case 32:c++,e.next=11;break;case 35:return e.abrupt("return",1);case 36:case"end":return e.stop()}}),e,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){e.next=15;break}return e.delegateYield(r(l),"t0",10);case 10:if(!e.t0){e.next=12;break}return e.abrupt("break",15);case 12:l++,e.next=8;break;case 15:case"end":return e.stop()}}),e)}))),function(e){return c.apply(this,arguments)}),linkDelete:function(e){t.options.attribute.link.content.splice(e,1),t.attributeLink=t.options.attribute.link.content},confirmEdit:function(e,i){var n=e.name&&e.name.replace(/\s/g,""),o=e.url&&e.url.replace(/\s/g,"");n&&o?t.options.attribute.link.content[i]=e:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),t.attributeLink=t.options.attribute.link.content},cancelEdit:function(){t.attributeLink=t.options.attribute.link.content},fileSelect:function(e,t){var i=u[t].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",p),i.addEventListener("change",p)}},p=function(e){e.target.value&&(u[e.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=e.target.value,e.target.value=null)},d=function(e){for(var t=u[e].getElementsByTagName("button"),i=0;i<t.length;i++)if(t[i]&&t[i].attributes){var n,o=yo(t[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return t[i].addEventListener("click",(function(t){"function"==typeof h[o.value]&&h[o.value](e)})),t[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(e){o.e(e)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(e){this.options.attribute.camera.content=e}},{key:"attributeISC",get:function(){return this.options.attribute.isc.content},set:function(e){this.options.attribute.isc.content=e}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(e){var t=this;if(this.options.attribute.vr.content=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),h={vrEdit:(c=o()(a.a.mark((function e(i){var n,o,s,r,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.options.attribute.vr.content;case 2:t.attributeVr=e.sent,n=t._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function e(n){var o,r,l,c,u,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==n){e.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=t.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=t.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){e.next=35;break}if(l[c]&&l[c].attributes){e.next=14;break}return e.abrupt("continue",32);case 14:u=yo(l[c].attributes),e.prev=15,d=a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("@click"!==(t=p.value).name){e.next=5;break}return l[c].addEventListener("click",(function(e){"function"==typeof h[t.value]&&h[t.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(t.name),e.abrupt("return",1);case 5:case"end":return e.stop()}}),e)})),u.s();case 18:if((p=u.n()).done){e.next=24;break}return e.delegateYield(d(),"t0",20);case 20:if(!e.t0){e.next=22;break}return e.abrupt("break",24);case 22:e.next=18;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(15),u.e(e.t1);case 29:return e.prev=29,u.f(),e.finish(29);case 32:c++,e.next=11;break;case 35:return e.abrupt("return",1);case 36:case"end":return e.stop()}}),e,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){e.next=15;break}return e.delegateYield(r(l),"t0",10);case 10:if(!e.t0){e.next=12;break}return e.abrupt("break",15);case 12:l++,e.next=8;break;case 15:case"end":return e.stop()}}),e)}))),function(e){return c.apply(this,arguments)}),vrDelete:function(e){t.options.attribute.vr.content.splice(e,1),t.attributeVr=t.options.attribute.vr.content},confirmEdit:function(e,i){var n=e.name&&e.name.replace(/\s/g,""),o=e.url&&e.url.replace(/\s/g,"");n&&o?t.options.attribute.vr.content[i]=e:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),t.attributeVr=t.options.attribute.vr.content},cancelEdit:function(){t.attributeVr=t.options.attribute.vr.content},fileSelect:function(e,t){var i=u[t].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",p),i.addEventListener("change",p)}},p=function(e){e.target.value&&(u[e.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=e.target.value,e.target.value=null)},d=function(e){for(var t=u[e].getElementsByTagName("button"),i=0;i<t.length;i++)if(t[i]&&t[i].attributes){var n,o=yo(t[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return t[i].addEventListener("click",(function(t){"function"==typeof h[o.value]&&h[o.value](e)})),t[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(e){o.e(e)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(e){this.options.attribute.goods.content=e}},{key:"billboardDefaultImage",get:function(){return ti(this.options.billboard.defaultImage)||this.getSourceRootPath()+"/img/A-ablu-blank.png"},set:function(e){var t=this.replaceHost(e,this.options.host);ei(t,this.options.billboard.defaultImage),this._elms.billboardDefaultImage&&this._elms.billboardDefaultImage.forEach((function(e){e.src=t}))}},{key:"coordinate",get:function(){return this.options.coordinate},set:function(e){}},{key:"edit",value:(l=o()(a.a.mark((function e(){var t,i,n,s,r,l,c,u,h,p=this,d=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d.length>0&&void 0!==d[0]&&d[0],e.abrupt("return");case 8:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" billboard-object",(i=document.createElement("div")).innerHTML=Rn(this),this._DialogObject.contentAppChild(i),this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.isc.content,new En("point-object-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){p.labelColor=e},clear:function(){p.labelColor="rgba(255,255,255,1)"}}),s=i.getElementsByTagName("*"),this._EventBinding.on(this,s),this._elms=this._EventBinding.element,this._elms.labelColor=[n],setTimeout(o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,d,m,f,v,g,b,C,w,k,_,x,E,S,P,D,M;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p.attributeLink=p.options.attribute.link.content,p.attributeVr=p.options.attribute.vr.content,p.cameraSelect&&p.cameraSelect(),p.ISCSelect&&p.ISCSelect(),p.goodsSelect&&p.goodsSelect(),(t=document.createElement("div")).className="col",t.style.flex="0 0 110px",t.innerHTML='\n <span class="label">属性框</span>\n <input class="btn-switch" type="checkbox">\n ',p._DialogObject._element.content.getElementsByClassName("attribute")[0].getElementsByClassName("row")[0].appendChild(t),i=p.attributeSelect,!(n=p._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0])){e.next=27;break}(o=q(n,".attribute-select")).legp_search(i),s=p._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],r=0;case 18:if(!(r<i.length)){e.next=26;break}if(i[r].key!==p.options.attributeType){e.next=23;break}return s.value=i[r].value,o.legp_searchActive(i[r].value),e.abrupt("break",26);case 23:r++,e.next=18;break;case 26:s.addEventListener("input",(function(){for(var e=0;e<i.length;e++)if(i[e].value===s.value){p.attributeType=i[e].key;break}}));case 27:if(l=[],p.epsg_map.forEach((function(e,t){l.push({name:"".concat(e.name,"(").concat(e.epsg,")"),value:t})})),!(c=q(p._DialogObject._element.content.getElementsByClassName("coordinate-select-box")[0],".coordinate-select"))){e.next=44;break}c.legp_search(l),u=p._DialogObject._element.content.getElementsByClassName("coordinate-select")[0].getElementsByTagName("input")[0],p.coordinate?p.coordinate=p.coordinate:p.coordinate=l[0].value,u.value=p.coordinate,h=0;case 36:if(!(h<l.length)){e.next=43;break}if(l[h].value!==l.value){e.next=40;break}return c.legp_searchActive(l[h].value),e.abrupt("break",43);case 40:h++,e.next=36;break;case 43:u.addEventListener("input",(function(){for(var e=0;e<l.length;e++)if(l[e].value===u.value){p.coordinate=l[e].value;break}}));case 44:d=document.getElementsByClassName("height-box")[0],m=d.getElementsByClassName("height")[0],f=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附地表",value:"依附地表",key:"2"},{name:"依附模型",value:"依附模型",key:"3"}],v=p.heightMode,e.t0=v,e.next=0===e.t0||"0"===e.t0?51:1===e.t0||"1"===e.t0?53:2===e.t0||"2"===e.t0||3===e.t0||"3"===e.t0?55:60;break;case 51:return m.value=p.alt,e.abrupt("break",60);case 53:return p.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(p.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(p.options.position.lng,p.options.position.lat)]).then((function(e){m.value=Number((p.alt-Number(e[0].height.toFixed(2))).toFixed(2))})):m.value=Number(p.alt.toFixed(2)),e.abrupt("break",60);case 55:g=[],b=yo(p.sdk.entityMap);try{for(b.s();!(C=b.n()).done;)(w=y()(C.value,2))[0],"RadarScanStereoscopic"===(k=w[1]).type&&k.entity&&g.push(k.entity)}catch(e){b.e(e)}finally{b.f()}return p.getClampToHeight(p.options.position,g).then((function(e){p.alt=Number(e.toFixed(2)),m.value=p.alt})),e.abrupt("break",60);case 60:if(!(_=q(p._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){e.next=78;break}_.legp_search(f),(x=p._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0]).value=f[p.heightMode].value,E=0;case 66:if(!(E<f.length)){e.next=73;break}if(f[E].value!=x.value){e.next=70;break}return _.legp_searchActive(f[E].value),e.abrupt("break",73);case 70:E++,e.next=66;break;case 73:x.addEventListener("input",(function(){for(var e=0;e<f.length;e++)if(f[e].value===x.value){switch(v=f[e].key){case 0:case"0":p.alt=Number(m.value),d.style.display="flex",p.heightMode=0;break;case 1:case"1":p.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(p.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(p.options.position.lng,p.options.position.lat)]).then((function(e){p.alt=Number(m.value)+Number(e[0].height.toFixed(2))})):p.alt=Number(m.value),d.style.display="flex",p.heightMode=1;break;case 2:case"2":p.heightMode=2;break;case 3:case"3":var t,i=[],n=yo(p.sdk.entityMap);try{for(n.s();!(t=n.n()).done;){var o=y()(t.value,2),s=(o[0],o[1]);"RadarScanStereoscopic"===s.type&&s.entity&&i.push(s.entity)}}catch(e){n.e(e)}finally{n.f()}p.getClampToHeight(p.options.position,i).then((function(e){p.alt=Number(e.toFixed(2))})),p.heightMode=3}break}})),m.addEventListener("input",(function(){switch(v){case 0:case"0":p.options.position.alt=Number(Number(m.value).toFixed(2));break;case 1:case"1":p.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(p.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(p.options.position.lng,p.options.position.lat)]).then((function(e){p.alt=Number(m.value)+Number(e[0].height.toFixed(2))})):p.alt=Number(m.value)}p.renewPoint(),p.coordinate=p.options.coordinate,p._elms.alt&&p._elms.alt.forEach((function(e){e.value=p.options.position.alt}))})),p._elms.height=d,p._elms.heightMode=x,p.heightMode=p.heightMode;case 78:if(S=Un(),!(P=q(p._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select"))){e.next=94;break}P.legp_search(S),(D=p._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0]).value=S[p.labelFontFamily].value,M=0;case 85:if(!(M<S.length)){e.next=92;break}if(S[M].value!=D.value){e.next=89;break}return P.legp_searchActive(S[M].value),e.abrupt("break",92);case 89:M++,e.next=85;break;case 92:D.addEventListener("input",(function(){for(var e=0;e<S.length;e++)if(S[e].value===D.value){p.labelFontFamily=S[e].key;break}})),p._elms.labelFontFamily=[D];case 94:case"end":return e.stop()}}),e)}))),0),r=i.getElementsByClassName("lng")[0],l=i.getElementsByClassName("lat")[0],r.value=this.lng,l.value=this.lat,this._elms.lng.push(r),this._elms.lat.push(l),c=this._DialogObject._element.content.getElementsByClassName("YJ-custom-checkbox-box"),u=this._DialogObject._element.content.getElementsByClassName("YJ-custom-checkbox"),h=this._DialogObject._element.content.getElementsByClassName("proj-input-box"),u[0].checked=!0,h[1].style.display="none",h[2].style.display="none",c[0].addEventListener("click",(function(){u[0].checked=!0,h[0].style.display="block",u[1].checked=!1,h[1].style.display="none",u[2].checked=!1,h[2].style.display="none"})),c[1].addEventListener("click",(function(){u[1].checked=!0,h[1].style.display="block",u[0].checked=!1,h[0].style.display="none",u[2].checked=!1,h[2].style.display="none"})),c[2].addEventListener("click",(function(){u[2].checked=!0,h[2].style.display="block",u[0].checked=!1,h[0].style.display="none",u[1].checked=!1,h[1].style.display="none"})),t._projConvert=function(){var e,n,o,s,a,r,l,c,u,h,d,m,f,v,g,y;p._DialogObject&&!p._DialogObject.isDestroy&&(e=t.lng,n=t.lat,o=t._proj.degreesToDMS(e,!0),s=t._proj.degreesToDMS(n,!0),c=(l=o.split("°"))[1].split("'"),h=(u=s.split("°"))[1].split("'"),i.getElementsByClassName("lng-dm-d")[0].value=l[0],i.getElementsByClassName("lng-dm-m")[0].value=c[0],i.getElementsByClassName("lat-dm-d")[0].value=u[0],i.getElementsByClassName("lat-dm-m")[0].value=h[0],a=t._proj.degreesToDMS(e),r=t._proj.degreesToDMS(n),f=(m=(d=a.split("°"))[1].split("'"))[1].split('"'),y=(g=(v=r.split("°"))[1].split("'"))[1].split('"'),i.getElementsByClassName("lng-dms-d")[0].value=d[0],i.getElementsByClassName("lng-dms-m")[0].value=m[0],i.getElementsByClassName("lng-dms-s")[0].value=f[0],i.getElementsByClassName("lat-dms-d")[0].value=v[0],i.getElementsByClassName("lat-dms-m")[0].value=g[0],i.getElementsByClassName("lat-dms-s")[0].value=y[0])},t._projConvert(),e.next=41;break;case 41:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"renewPoint",value:function(){var e=this,t=Yn(this.labelFontFamily)||"Helvetica";this.entity&&(this.entity.position=Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt),this.options.scaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.label.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.label.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0,this.entity.label.scaleByDistance=void 0,this.entity.label.pixelOffsetScaleByDistance=void 0),this.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){if(e.options.billboard.show){var t=e.entity.billboard.imgHeight?e.entity.billboard.imgHeight*(31/e.entity.billboard.imgWidth):0;return new Cesium.Cartesian2(0,-t*e.options.billboard.scale-e.options.label.fontSize/2-5)}return new Cesium.Cartesian2(0,-e.options.label.fontSize/2-5)}),!1),this.entity.label.font=this.options.label.fontSize+"px "+t,this.entity.label.fillColor=Cesium.Color.fromCssColorString(this.options.label.color),this.entity.billboard.scale=this.options.billboard.scale)}},{key:"reset",value:function(){this.entity&&(this.options=this.deepCopyObj(this.originalOptions),this.near=this.originalOptions.near,this.far=this.originalOptions.far,this.scaleByDistance=this.originalOptions.scaleByDistance,this.billboardShow=this.originalOptions.billboard.show,this.billboardImage=this.originalOptions.billboard.image,this.billboardScale=this.originalOptions.billboard.scale,this.labelText=this.originalOptions.label.text,this.labelShow=this.originalOptions.label.show,this.labelFontSize=this.originalOptions.label.fontSize,this.labelColor=this.originalOptions.label.color,this.lng=this.originalOptions.position.lng,this.lat=this.originalOptions.position.lat,this.alt=this.originalOptions.position.alt,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.isc.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect())}},{key:"remove",value:(r=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,yi(this.sdk.viewer,this.entity);case 2:if(this.entity=null,this.sdk.viewer&&this.sdk.viewer.entities){e.next=5;break}return e.abrupt("return");case 5:return this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),e.next=10,this.sdk.removeIncetance(this.options.id);case 10:return e.next=12,Mt(this.sdk,this.options.id);case 12:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"clickChangeImage",value:function(){this.Dialog.clickChangeImage&&this.Dialog.clickChangeImage()}},{key:"clickChangeDefaultImage",value:function(){this.Dialog.clickChangeDefaultImage&&this.Dialog.clickChangeDefaultImage()}},{key:"updateHeight",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,b;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.sdk&&this.sdk.viewer&&this.sdk.viewer.scene){e.next=2;break}return e.abrupt("return");case 2:n=new Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,0),o=new Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,1e13),s=[],r=yo(this.sdk.entityMap);try{for(r.s();!(l=r.n()).done;)(c=y()(l.value,2))[0],"RadarScanStereoscopic"===(u=c[1]).type&&u.entity&&s.push(u.entity)}catch(e){r.e(e)}finally{r.f()}return e.next=9,this.sdk.viewer.scene.clampToHeightMostDetailed([n],s);case 9:(h=e.sent)&&h[0]&&(t=this.cartesian3Towgs84(h[0],this.sdk.viewer).alt),p=Cesium.Cartesian3.subtract(n,o,new Cesium.Cartesian3),d=Cesium.Cartesian3.normalize(p,new Cesium.Cartesian3),m=new Cesium.Ray(o,d),f={},v=this.sdk.viewer.scene.drillPickFromRay(m),g=v.length-1;case 17:if(!(g>=0)){e.next=24;break}if(!v[g].position){e.next=21;break}return f=v[g],e.abrupt("break",24);case 21:g--,e.next=17;break;case 24:return f&&f.position&&(i=this.cartesian3Towgs84(f.position,this.sdk.viewer).alt),e.prev=25,e.next=28,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.position.lng,this.options.position.lat)]);case 28:b=e.sent,e.next=33;break;case 31:e.prev=31,e.t0=e.catch(25);case 33:if((void 0===i||i<b[0].height)&&b&&(i=b[0].height),(void 0===t||t<i)&&(t=i),void 0===t){e.next=40;break}return this.options.position.alt=Number(Number(t).toFixed(2)),this.renewPoint(),this.coordinate=this.options.coordinate,e.abrupt("return",!0);case 40:case"end":return e.stop()}}),e,this,[[25,31]])}))),function(){return s.apply(this,arguments)})},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,b,C,w=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=w.length>0&&void 0!==w[0]?w[0]:{},pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=26;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position||this.options.position?l=wo({},this.options.position):this.options.center?l=wo({},this.options.center):this.options.start?l=wo({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=19;break}c=[],u=yo(this.sdk.entityMap);try{for(u.s();!(h=u.n()).done;)(p=y()(h.value,2))[0],"RadarScanStereoscopic"===(d=p[1]).type&&d.entity&&c.push(d.entity)}catch(e){u.e(e)}finally{u.f()}return e.next=18,this.getClampToHeight(l,c);case 18:l.alt=e.sent;case 19:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=33;break;case 26:m=[],f=yo(this.sdk.entityMap);try{for(f.s();!(v=f.n()).done;)(g=y()(v.value,2))[0],"RadarScanStereoscopic"===(b=g[1]).type&&b.entity&&m.push(b.entity)}catch(e){f.e(e)}finally{f.f()}return e.next=31,this.getClampToHeight(this.options.position,m);case 31:C=e.sent,this.sdk.viewer.camera.flyTo({orientation:t.orientation,destination:Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,C+(t.height||500))});case 33:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"setPosition",value:function(e){this.options.position.lng=e.position.lng,this.options.position.lat=e.position.lat,this.options.position.alt=e.position.alt,this.renewPoint()}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=e,this.event&&this.event.destroy(),this.event=new K(this.sdk),!0===e){this.picking=!1,this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.previous={position:wo({},this.options.position)};var i=function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=n.lng,t.lat=n.lat,t.alt=n.alt,t.previous={position:wo({},t.options.position)},t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.entity.position=new Cesium.CallbackProperty((function(){return i}),!1),Eo(Po,t)&&(Eo(Po,t).call(t),xo(Po,t,null)),t.positionEditing=!1};this.event.mouse_move((function(e,i){t.entity.position=new Cesium.CallbackProperty((function(){return i}),!1),t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left(i),this.event.mouse_right((function(e,i){t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,n){var o=new Date;t.event.gesture_pinck_end((function(){var s=new Date;e.position1.x,e.position2.x,e.position1.y,e.position2.y;s-o>=500?t.positionEditing=!1:i(0,n)}))}))}else xo(Po,this,null),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){})),this.event.destroy(),this.event=null),this.tip&&this.tip.destroy(),this.lng=this.previous.position.lng,this.lat=this.previous.position.lat,this.alt=this.previous.position.alt,this.renewPoint()}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,xo(Po,this,e)}},{key:"setDIV",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};t.x=t.x||0===t.x?t.x:10,t.y=t.y||0===t.y?t.y:10;var i=document.getElementById(t.domid),n=Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=e.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+t.x).toFixed(0)+"px",i.style.top=(s.y+t.y).toFixed(0)+"px")}}))}},{key:"setCustomView",value:(i=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=4;break}this.options.customView=t,e.next=19;break;case 4:if(i=this.sdk.viewer.camera,n=this.cartesian3Towgs84(i.position,this.sdk.viewer),o={lng:0,lat:0},s=wo({},n),this.options.position?o=wo({},this.options.position):(this.options.hasOwnProperty("lng")&&(o.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(o.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(o.alt=this.options.alt)),o.hasOwnProperty("alt")){e.next=16;break}r=[],l=yo(this.sdk.entityMap);try{for(l.s();!(c=l.n()).done;)(u=y()(c.value,2))[0],"RadarScanStereoscopic"===(h=u[1]).type&&h.entity&&r.push(h.entity)}catch(e){l.e(e)}finally{l.f()}return e.next=15,this.getClampToHeight(o,r);case 15:o.alt=e.sent;case 16:s={lng:n.lng-o.lng,lat:n.lat-o.lat,alt:n.alt-o.alt},this.options.customView={orientation:{heading:Cesium.Math.toDegrees(i.heading),pitch:Cesium.Math.toDegrees(i.pitch),roll:Cesium.Math.toDegrees(i.roll)},relativePosition:s},this.originalOptions&&(this.originalOptions.customView=this.options.customView);case 19:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})}],[{key:"create",value:function(e){var t,i,n=36,o=e.options.position;e.originalOptions=e.deepCopyObj(e.options);var s,a=!1,r=0,l=Yn(e.labelFontFamily)||"Helvetica",c=e.replaceHost(e.options.billboard.image,e.options.host);if(e._frameImages=[],c&&c.endsWith("gif")){switch(a=!0,e.options.heightMode){case 2:case"2":i=Cesium.HeightReference.CLAMP_TO_GROUND}var u=document.createElement("img");u.setAttribute("rel:animated_src",c),u.setAttribute("rel:auto_play","1"),document.createElement("div").appendChild(u);var h=Cesium.createGuid();s=new SuperGif({gif:u}),e._superGif=s,e._superGif.id=h,s.load((function(i){if(404==i)return(t=document.createElement("canvas")).width=0,t.height=0,n=0,void(e.entity&&(e.entity.billboard.imgWidth=0,e.entity.billboard.imgHeight=0,e.entity.billboard.image=t,gi(e.sdk,e.entity)));if(e._superGif.id==h){for(var o=s.get_length(),a=1;a<=o;a++)s.move_to(a),e._frameImages.push(s.get_canvas().toDataURL());var l=(t=s.get_canvas()).width,c=t.height;n=c*(31/l),e.entity&&(e.entity.billboard.imgWidth=l,e.entity.billboard.imgHeight=c,e.entity.billboard.image=new Cesium.CallbackProperty((function(){var t=e._frameImages[r];return r=r>=e._frameImages.length-1?0:r+1,t}),!1),gi(e.sdk,e.entity))}}))}else{var p=new Image;switch(p.src=c||e.getSourceRootPath()+"/img/A-ablu-blank.png",e.options.heightMode){case 2:case"2":i=Cesium.HeightReference.CLAMP_TO_GROUND}t=document.createElement("canvas"),p.onload=function(){var i=p.width/p.height;p.width=100,p.height=100/i;var o=p.width,s=p.height,a=t.getContext("2d",{willReadFrequently:!0});t.width=o,t.height=s,a.drawImage(p,0,0,o,s),n=s*(31/o),e.entity&&(e.entity.billboard.imgWidth=o,e.entity.billboard.imgHeight=s,e.entity.billboard.image=t,gi(e.sdk,e.entity))},p.onerror=function(i){t.width=0,t.height=0,n=0,e.entity&&(e.entity.billboard.imgWidth=0,e.entity.billboard.imgHeight=0,e.entity.billboard.image=t,gi(e.sdk,e.entity))}}e.entity=new Cesium.Entity({show:e.options.show,id:e.options.id,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),billboard:{image:a?new Cesium.CallbackProperty((function(){var t=e._frameImages[r];return r=r>=e._frameImages.length-1?0:r+1,t}),!1):t,scale:e.options.billboard.scale,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ii()?void 0:Number.POSITIVE_INFINITY}),!1),heightReference:i,color:e.options.billboard.show?void 0:new Cesium.Color(1,1,1,0),width:31,height:new Cesium.CallbackProperty((function(){return n}),!1),verticalOrigin:Cesium.VerticalOrigin.BOTTOM},label:{show:e.options.label.show,text:e.options.label.text,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ii()?void 0:Number.POSITIVE_INFINITY}),!1),heightReference:i,font:e.options.label.fontSize+"px "+l,fillColor:Cesium.Color.fromCssColorString(e.options.label.color),pixelOffset:new Cesium.CallbackProperty((function(){return e.options.billboard.show?new Cesium.Cartesian2(0,-n*e.options.billboard.scale-e.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-e.options.label.fontSize/2-5)}),!1),outlineColor:Cesium.Color.BLACK,outlineWidth:1,style:Cesium.LabelStyle.FILL_AND_OUTLINE}}),e.entity.billboard.imgWidth=31,e.entity.billboard.imgHeight=36,e.entity.position=Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),3==e.options.heightMode&&e.updateHeight(),e.renewPoint(),Mt(e.sdk,e.options.id),e.options.show&&Qe(0,e.options.id),e.options.billboard.isSelect&&e.selectBillboard()}}]);var i,n,s,r,l}(Vn);function Mo(e){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="polygon-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">描边颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">描边宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function To(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 Oo(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?To(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):To(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function No(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Bo=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,t),(i=No(this,t,[e,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"rgba(255, 0, 0, 0.5)",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.positions=n.positions||[],i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.entity,i.event=new K(i.sdk),i.operate={},i._elms={},i.Dialog=o,i.nodePoints=[],n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],delete i.options.attribute.camera,delete i.options.attribute.vr,delete i.options.attribute.goods,i.options.richTextContent=n.richTextContent||"",!i.options.positions||i.options.positions.length<3)i._error="多边形最少需要三个坐标!",console.warn(i._error);else{if(!i.options.height&&0!==i.options.height){for(var s=i.options.positions[0].alt,a=1;a<i.options.positions.length;a++)s<i.options.positions[a].alt&&(s=i.options.positions[a].alt);i.options.height=s}i.sdk.addIncetance(i.options.id,i),i._zIndex=i.sdk.entityMap.size,t.create(i)}return i}return un()(t,e),x()(t,[{key:"type",get:function(){return"PolygonObject"}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;if(this.options.color=e||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon&&this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(this.heightMode=0,i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,0,0,0.5)"}});t._elms.color[i]=n}))}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(e){var t=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(t.options.heightMode=e||0==e?e:2,t.positionEditing=!1,t.entity){t.options.positions;var i="";t.closeNodeEdit();var n=!1;switch(t.renewPositions(),t.entity.polyline.positions=[].concat(A()(t.positions),[t.positions[0],t.positions[1]]),t.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(t.positions),t.options.heightMode){case"0":case 0:i="海拔高度";break;case"1":case 1:i="相对地表";break;case"2":case 2:n=!0,!0,i="依附模型"}t.label.ground=n,t.entity.polyline.clampToGround=n,t.entity.polyline.arcType=n?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,t.entity.polygon.perPositionHeight=!n,t._elms.heightMode&&(t._elms.heightMode.value=i),t._elms.heightModeObject&&t._elms.heightModeObject.legp_searchActive(i)}}),50)}},{key:"height",get:function(){return this.options.height},set:function(e){var t,i=this;!e||isNaN(Number(e))?this.options.height=0:this.options.height=Number(Number(e).toFixed(2)),t=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.entity.polygon.perPositionHeight=!t,i.entity.polyline.positions=[].concat(A()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polyline.clampToGround=!!t,i.entity.polyline.arcType=t?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(e){e.innerHTML=i.options.height}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(e){var t=this;this.options.line.color=e||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.lineColor=e},clear:function(){t.lineColor="rgba(255,0,0,0.5)"}});t._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(e){this.options.line.width=e||0===e?e:3,this.entity.polyline.width=this.options.line.width,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(t){t.value=e}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){this.options.label.show=e,this.show&&!this.showView||3==this.showView?this.label.show=e:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label.color=e,this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label.fontSize=e,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label.scaleByDistance=e,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(e){this.options.label.lineWidth=e,this.label.lineWidth=e,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(t){t.value=e}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(e){this.options.label.pixelOffset=e,this.label.pixelOffset=e,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(t){t.value=e}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(e){var t=this;this.options.label.lineColor=e,this.label.lineColor=e,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelLineColor=e},clear:function(){t.labelLineColor="rgba(0,255,255,0.5)"}});t._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label.backgroundColor=[e,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label.backgroundColor=[this.label.backgroundColor[0],e],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"edit",value:(l=o()(a.a.mark((function e(i){var n,o,s,r,l,c,u,h,p=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 8:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" polygon",(n=document.createElement("div")).innerHTML=Mo(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new En("polygon-object-edit-tabs",void 0,this.sdk),o=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){p.color=e},clear:function(){p.color="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:n.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){p.lineColor=e},clear:function(){p.lineColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){p.labelColor=e},clear:function(){p.labelColor="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){p.labelLineColor=e},clear:function(){p.labelLineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){p.labelBackgroundColorStart=e},clear:function(){p.labelBackgroundColorStart="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){p.labelBackgroundColorEnd=e},clear:function(){p.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),h=n.getElementsByTagName("*"),t.EventBinding(this,h),this._elms.color=[o],this._elms.lineColor=[s],this._elms.labelColor=[r],this._elms.labelLineColor=[l],this._elms.labelBackgroundColorStart=[c],this._elms.labelBackgroundColorEnd=[u],setTimeout((function(){p.attributeLink=p.options.attribute.link.content,p.attributeVr=p.options.attribute.vr.content,p.cameraSelect&&p.cameraSelect(),p.goodsSelect&&p.goodsSelect();var e=p.attributeSelect,i=p._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(i){var n=q(i,".attribute-select");n.legp_search(e);for(var o=p._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<e.length;s++)if(e[s].key===p.options.attributeType){o.value=e[s].value,n.legp_searchActive(e[s].value);break}o.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===o.value){p.attributeType=e[t].key;break}}))}var a=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],r=q(p._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=p._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];l.value=p.options["area-unit"];for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var e=0;e<a.length;e++)if(a[e].value===l.value){p.areaUnit=a[e].value;break}}))}var u=p._DialogObject._element.content.getElementsByClassName("height-box")[0],h=u.getElementsByClassName("height")[0],d=p._DialogObject._element.content.getElementsByClassName("height-confirm")[0];h.value=10,2==p.heightMode?(u&&(u.className="input-number input-number-unit-1 height-box disabled"),d&&d.setAttribute("disabled","disabled")):(u&&(u.className="input-number input-number-unit-1 height-box"),d&&d.removeAttribute("disabled"));var m=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],f=q(p._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode");if(f){f.legp_search(m);for(var v=p._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],g=0;g<m.length;g++)if(m[g].key==p.heightMode){v.value=m[g].value,f.legp_searchActive(m[g].value);break}v.addEventListener("input",(function(){for(var e=0;e<m.length;e++)if(m[e].value===v.value){p.heightMode=m[e].key;break}})),h.addEventListener("input",(function(){p.heightMode})),p._elms.height=h,p._elms.heightBox=u,p._elms.heightMode=v,p._elms.heightConfirm=d,p._elms.heightModeObject=f,d.addEventListener("click",(function(){p.operate.positionEditing?(p.positionEditing=!1,p.height=p.height+Number(h.value)):(t.closeNodeEdit(p),p.heightMode=p.heightMode,setTimeout((function(){p.height=p.height+Number(h.value)}),100))}))}var y=Un(),b=q(p._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(b){b.legp_search(y);var C=p._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];C.value=y[p.labelFontFamily].value;for(var w=0;w<y.length;w++)if(y[w].value==C.value){b.legp_searchActive(y[w].value);break}C.addEventListener("input",(function(){for(var e=0;e<y.length;e++)if(y[e].value===C.value){p.labelFontFamily=y[e].key;break}})),p._elms.labelFontFamily=[C]}(void 0)()}),0),e.next=34;break;case 33:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 34:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"reset",value:function(){if(this.entity||this._DialogObject){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineColor=this.originalOptions.line.color,this.lineWidth=this.originalOptions.line.width,this.height=this.originalOptions.height,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.heightMode=this.options.heightMode;var e=this.options.positions,t=[[]],i=[];if(this.options.height||0===this.options.height){for(var n=0;n<e.length;n++)i.push(e[n].lng,e[n].lat,this.options.height),t[0].push([e[n].lng,e[n].lat]);t[0].push([e[0].lng,e[0].lat]),this.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i)}else{for(var o=0;o<e.length;o++)i.push(e[o].lng,e[o].lat),t[0].push([e[o].lng,e[o].lat]);t[0].push([e[0].lng,e[0].lat]),this.positions=Cesium.Cartesian3.fromDegreesArray(i)}this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positions),this.entity.polyline.positions=[].concat(A()(this.positions),[this.positions[0],this.positions[1]])}}},{key:"flyTo",value:(r=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=v.length>0&&void 0!==v[0]?v[0]:{},!this._error){e.next=3;break}return e.abrupt("return");case 3:if(pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Oo({},this.options.position):this.options.positions?l=Oo({},this.options.positions[0]):this.options.center?l=Oo({},this.options.center):this.options.start?l=Oo({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(l);case 17:l.alt=e.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=51;break;case 25:c=[],e.t0=this.heightMode,e.next=0===e.t0||"0"===e.t0?29:1===e.t0||"1"===e.t0?31:2===e.t0||"2"===e.t0?33:35;break;case 29:case 31:return u=!1,e.abrupt("break",35);case 33:return u=!0,e.abrupt("break",35);case 35:if(!u){e.next=48;break}h=0;case 37:if(!(h<this.options.positions.length)){e.next=46;break}return e.next=40,this.getClampToHeight(this.options.positions[h]);case 40:p=e.sent,d=Cesium.Cartesian3.fromDegrees(this.options.positions[h].lng,this.options.positions[h].lat,p),c.push(d.x,d.y,d.z);case 43:h++,e.next=37;break;case 46:e.next=49;break;case 48:if(this.positions)for(m=0;m<this.positions.length;m++)c.push(this.positions[m].x,this.positions[m].y,this.positions[m].z);case 49:f=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(f,{offset:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 51:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"remove",value:(s=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.entities.remove(this.entity),this.label&&this.label.remove(),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=8,this.sdk.removeIncetance(this.options.id);case 8:return e.next=10,Mt(this.sdk,this.options.id);case 10:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;if(this.closeNodeEdit(),!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){var i=this;if(this.event&&this.event.destroy(),this.event=new K(this.sdk),this.operate.positionEditing=e,!0===e){var n;this.previous={positions:A()(this.positions)},this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;for(var o=[],s=A()(this.positions),a=this.deepCopyObj(this.options.positions),r=[],l=[],c=0;c<s.length;c++){var u=this.cartesian3Towgs84(s[c],this.sdk.viewer);o.push([u.lng,u.lat])}var h=this.cartesian3Towgs84(s[0],this.sdk.viewer);o.push([h.lng,h.lat]);for(var p=turf.polygon([o]),d=turf.centroid(p),m=(n=Cesium.Cartesian3).fromDegrees.apply(n,A()(d.geometry.coordinates)),f=0;f<s.length;f++)l.push({x:m.x-s[f].x,y:m.y-s[f].y,z:m.z-s[f].z});var v=[],g=function(e,n){t.cartesian3Towgs84(n,t.sdk.viewer);t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),v=[];for(var o=0;o<l.length;o++){var s={x:n.x-l[o].x,y:n.y-l[o].y,z:n.z-l[o].z};v.push(s),t.options.positions[o]=t.cartesian3Towgs84(s,t.sdk.viewer),i._elms.lng&&i._elms.lng[o]&&(i._elms.lng[o].innerHTML=t.options.positions[o].lng.toFixed(8)),i._elms.lat&&i._elms.lat[o]&&(i._elms.lat[o].innerHTML=t.options.positions[o].lat.toFixed(8))}t.previous=null,r=[],t.heightMode=t.heightMode,t._positionEditingCallback&&(t._positionEditingCallback(),t._positionEditingCallback=null)};this.event.mouse_move((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);v=[];for(var o=0;o<l.length;o++){var s={x:i.x-l[o].x,y:i.y-l[o].y,z:i.z-l[o].z};v.push(s),a[o]=t.cartesian3Towgs84(s,t.sdk.viewer)}for(var c=!1,u=[],h=0;h<a.length;h++)u.push([a[h].lng,a[h].lat]);u.push([a[0].lng,a[0].lat]);var p=0,d=turf.polygon([u]),m=turf.centroid(d);switch(t.options.heightMode){case"0":case 0:c=!1;break;case"1":case 1:p=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(m.geometry.coordinates[0],m.geometry.coordinates[1])),c=!1;break;case"2":case 2:c=!0}if(r=[],c){for(var f=0;f<a.length;f++)r.push(a[f].lng,a[f].lat);t.positions=Cesium.Cartesian3.fromDegreesArray(r);var g=A()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:n.lng,lat:n.lat},g).then((function(e){t.label.position=[n.lng,n.lat,e]}))}else{for(var y=0;y<a.length;y++)r.push(a[y].lng,a[y].lat,t.height+p);t.positions=Cesium.Cartesian3.fromDegreesArrayHeights(r),t.label.position=[n.lng,n.lat,t.height+p]}t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left(g),this.event.mouse_right((function(e,i){t.heightMode=t.heightMode})),this.event.gesture_pinck_start((function(e,i){var n=new Date;e.position1.x,e.position2.x,e.position1.y,e.position2.y;t.event.gesture_pinck_end((function(){new Date-n>=500?t.positionEditing=!1:g(0,i)}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positions)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(i.positions),[i.positions[0],i.positions[1]])}),!1)}else{this.previous?this.positions=A()(this.previous.positions):this.previous={positions:A()(this.positions)},this.sdk&&this.sdk.viewer&&this.label&&this.label.entity||(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.destroy()),this.tip&&this.tip.destroy();for(var y=[[]],b=0;b<this.previous.positions.length;b++){var C=this.cartesian3Towgs84(this.previous.positions[b],this.sdk.viewer);y[0].push([C.lng,C.lat])}var w=this.cartesian3Towgs84(this.previous.positions[0],this.sdk.viewer);y[0].push([w.lng,w.lat]);var k=turf.polygon(y),_=turf.centroid(k),x=!1,E=0;switch(this.options.heightMode){case"0":case 0:x=!1;break;case"1":case 1:E=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(_.geometry.coordinates[0],_.geometry.coordinates[1])),x=!1;break;case"2":case 2:x=!0}this.label.position=x?[_.geometry.coordinates[0],_.geometry.coordinates[1]]:[_.geometry.coordinates[0],_.geometry.coordinates[1],this.height+E],this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.previous.positions),this.entity.polyline.positions=[].concat(A()(i.previous.positions),[i.previous.positions[0],i.previous.positions[1]])}}}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"areaChangeCallBack",get:function(){return this._areaChangeCallBack},set:function(e){this._areaChangeCallBack=e}},{key:"nodeEdit",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};this.positionEditing=!1,setTimeout((function(){if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var i=function(){var e=o()(a.a.mark((function e(){var t,i,n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=A()(r.sdk.viewer.entities.values),i=0;case 2:if(!(i<r.options.positions.length)){e.next=11;break}return e.next=5,r.getClampToHeight(r.options.positions[i],t);case 5:n=e.sent,o=r.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:i,position:Cesium.Cartesian3.fromDegrees(r.options.positions[i].lng,r.options.positions[i].lat,n),billboard:{image:r.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),r.nodePoints.push(o);case 8:i++,e.next=2;break;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();YJ.Measure.SetMeasureStatus(!0),e.picking=!1,e.tip=new Q("请选择一个顶点,右键取消",e.sdk),e.event=new K(e.sdk),e.nodePoints=[];for(var n,s,r=e,l=[],c=[],u=0;u<e.options.positions.length;u++)c.push(e.options.positions[u].lng,e.options.positions[u].lat);l=Cesium.Cartesian3.fromDegreesArray(c);var h=!1,p=function(){var i=o()(a.a.mark((function i(o,r){var c,u,p,d,m,f,v,g,y,b,C;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!n){i.next=22;break}return e.options.positions[n.index]=e.cartesian3Towgs84(r,e.sdk.viewer),s=e.options.positions[n.index],h=!0,i.next=6,e.getClampToHeight(e.options.positions[n.index]);case 6:for(c=i.sent,u=e.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(e.options.positions[n.index].lng,e.options.positions[n.index].lat,c),billboard:{image:e.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),e.nodePoints.splice(n.index,0,u),e.options.positions.splice(n.index,0,e.options.positions[n.index]),p=e.options.positions,d=[],m=0;m<p.length;m++)d.push(p[m].lng,p[m].lat);if(e.positions=Cesium.Cartesian3.fromDegreesArray(d),l=Cesium.Cartesian3.fromDegreesArray(d),f=A()(e.sdk.viewer.entities.values),e.options.positions.length<3)e.getClampToHeight({lng:e.options.positions[0].lng,lat:e.options.positions[0].lat},f).then((function(t){e.label.position=[e.options.positions[0].lng,e.options.positions[0].lat,t]}));else{for(v=[[]],g=0;g<e.options.positions.length;g++)v[0].push([e.options.positions[g].lng,e.options.positions[g].lat]);v[0].push([e.options.positions[0].lng,e.options.positions[0].lat]),y=turf.polygon(v),b=turf.centroid(y),e.getClampToHeight({lng:b.geometry.coordinates[0],lat:b.geometry.coordinates[1]},f).then((function(t){e.label.position=[b.geometry.coordinates[0],b.geometry.coordinates[1],t]}))}e.areaByMeter=e.computeArea(e.options.positions),e.areaChangeCallBack&&e.areaChangeCallBack(),t(null,e.options.positions,e.areaByMeter),i.next=24;break;case 22:(C=e.sdk.viewer.scene.pick(o.position))&&C.id&&C.id.name&&"node-secondary-edit-point"===C.id.name&&(n=C.id,e.nodePoints.splice(C.id.index,1),e.sdk.viewer.entities.remove(C.id),e.tip.set_text("左键开始,右键结束,CTRL+右键撤销"),s=e.cartesian3Towgs84(n.position.getValue(),e.sdk.viewer));case 24:case"end":return i.stop()}}),i)})));return function(e,t){return i.apply(this,arguments)}}(),d=function(i,o){n&&(e.options.positions[n.index]=s,h&&e.options.positions.splice(n.index,1),t(null,e.options.positions)),YJ.Measure.SetMeasureStatus(!1),e.event.destroy(),e.tip.destroy(),e.heightMode=e.heightMode};e.entity.polyline.clampToGround=!0,e.entity.polyline.arcType=Cesium.ArcType.GEODESIC,e.entity.polygon.perPositionHeight=!1,e.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(l)}),!1),e.entity.polyline.positions=new Cesium.CallbackProperty((function(){return l.length>=3?[].concat(A()(l),[l[0],l[1],l[2]]):l}),!1);var m=A()(e.sdk.viewer.entities.values);if(e.options.positions.length<3)e.getClampToHeight({lng:e.options.positions[0].lng,lat:e.options.positions[0].lat},m).then((function(t){e.label.position=[e.options.positions[0].lng,e.options.positions[0].lat,t]}));else{for(var f=[[]],v=0;v<e.options.positions.length;v++)f[0].push([e.options.positions[v].lng,e.options.positions[v].lat]);f[0].push([e.options.positions[0].lng,e.options.positions[0].lat]);var g=turf.polygon(f),y=turf.centroid(g);e.getClampToHeight({lng:y.geometry.coordinates[0],lat:y.geometry.coordinates[1]},m).then((function(t){e.label.position=[y.geometry.coordinates[0],y.geometry.coordinates[1],t]}))}setTimeout((function(){e.event.mouse_left(p),e.event.mouse_right(d),e.event.mouse_move((function(t,i){if(n){e.options.positions[n.index]=e.cartesian3Towgs84(i,e.sdk.viewer);for(var o=e.options.positions,s=[],a=0;a<o.length;a++)s.push(o[a].lng,o[a].lat);e.positions=Cesium.Cartesian3.fromDegreesArray(s),l=Cesium.Cartesian3.fromDegreesArray(s);var r=A()(e.sdk.viewer.entities.values);if(e.options.positions.length<3)e.getClampToHeight({lng:e.options.positions[0].lng,lat:e.options.positions[0].lat},r).then((function(t){e.label.position=[e.options.positions[0].lng,e.options.positions[0].lat,t]}));else{for(var c=[[]],u=0;u<e.options.positions.length;u++)c[0].push([e.options.positions[u].lng,e.options.positions[u].lat]);c[0].push([e.options.positions[0].lng,e.options.positions[0].lat]);var h=turf.polygon(c),p=turf.centroid(h);e.getClampToHeight({lng:p.geometry.coordinates[0],lat:p.geometry.coordinates[1]},r).then((function(t){e.label.position=[p.geometry.coordinates[0],p.geometry.coordinates[1],t]}))}}e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),e.event.mouse_right_keyboard_ctrl((function(t,i){n&&(e.options.positions.pop(),e.sdk.viewer.entities.remove(e.nodePoints[e.nodePoints.length-1]),n.index===e.options.positions.length&&(e.nodePoints[n.index-1]?n=e.nodePoints[n.index-1]:n.index=0),e.nodePoints.pop())})),e.event.gesture_pinck_start((function(t,i){var n=new Date,o={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};e.event.gesture_pinck_end((function(){new Date-n>=500?d():p(o,i)}))})),i()}),200)}}),50)}},{key:"closeNodeEdit",value:function(){if(this.sdk&&this.sdk.viewer){YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=null;for(var e=0;e<this.nodePoints.length;e++)this.sdk.viewer.entities.remove(this.nodePoints[e]);this.nodePoints=[],this.picking=!0}}},{key:"setPosition",value:function(e){for(var t,i=this,n=Cesium.Cartesian3.fromDegrees(e.position.lng,e.position.lat,e.position.alt),o=A()(this.positions),s=[],a=[],r=0;r<o.length;r++){var l=this.cartesian3Towgs84(o[r],this.sdk.viewer);s.push([l.lng,l.lat])}var c=this.cartesian3Towgs84(o[0],this.sdk.viewer);s.push([c.lng,c.lat]);for(var u=turf.polygon([s]),h=turf.centroid(u),p=(t=Cesium.Cartesian3).fromDegrees.apply(t,A()(h.geometry.coordinates)),d=0;d<o.length;d++)a.push({x:p.x-o[d].x,y:p.y-o[d].y,z:p.z-o[d].z});for(var m=[],f=0;f<a.length;f++)m.push({x:n.x-a[f].x,y:n.y-a[f].y,z:n.z-a[f].z});var v=!1,g=0;switch(this.options.heightMode){case"0":case 0:v=!1;break;case"1":case 1:g=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(h.geometry.coordinates[0],h.geometry.coordinates[1])),v=!1;break;case"2":case 2:v=!0}if(v){var y=A()(this.sdk.viewer.entities.values);this.getClampToHeight({lng:e.position.lng,lat:e.position.lat},y).then((function(t){i.label.position=[e.position.lng,e.position.lat,t]}))}else this.label.position=[e.position.lng,e.position.lat,e.position.alt+g];this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return m.length>0?new Cesium.PolygonHierarchy(m):new Cesium.PolygonHierarchy(o)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return m.length>0?[].concat(m,[m[0],m[1]]):[].concat(A()(o),[o[0],o[1]])}),!1)}},{key:"renewPositions",value:function(){var e=this;if(!this._error){for(var t=!1,i=[],n=this.options.positions,o=0;o<n.length;o++)i.push([n[o].lng,n[o].lat]);i.push([n[0].lng,n[0].lat]);var s=0,a=turf.polygon([i]),r=turf.centroid(a);switch(this.options.heightMode){case"0":case 0:t=!1;break;case"1":case 1:s=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(r.geometry.coordinates[0],r.geometry.coordinates[1]))||0,t=!1;break;case"2":case 2:t=!0}var l=[];if(t||0!=this.nodePoints.length){for(var c=0;c<n.length;c++)l.push(n[c].lng,n[c].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(l),setTimeout((function(){if(e.sdk.viewer){var t=A()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:r.geometry.coordinates[0],lat:r.geometry.coordinates[1]},t).then((function(t){e.label&&(e.label.position=[r.geometry.coordinates[0],r.geometry.coordinates[1],t])}))}}),100)}else{for(var u=0;u<n.length;u++)l.push(n[u].lng,n[u].lat,this.height+s);this.positions=Cesium.Cartesian3.fromDegreesArrayHeights(l),this.label&&(this.label.position=[r.geometry.coordinates[0],r.geometry.coordinates[1],this.height+s])}return this.areaByMeter=this.computeArea(n),this.areaChangeCallBack&&this.areaChangeCallBack(),l}}},{key:"setDIV",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h=this,p=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for((t=p.length>0&&void 0!==p[0]?p[0]:{domid:"",x:10,y:10}).x=t.x||0===t.x?t.x:10,t.y=t.y||0===t.y?t.y:10,i=[[]],n=0;n<this.options.positions.length;n++)i[0].push([this.options.positions[n].lng,this.options.positions[n].lat]);if(i[0].push([this.options.positions[0].lng,this.options.positions[0].lat]),o=turf.polygon(i),s=turf.pointOnFeature(o),ground){e.next=12;break}r=this.options.height,e.next=16;break;case 12:return l=A()(this.sdk.viewer.entities.values),e.next=15,this.getClampToHeight({lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1]},l);case 15:r=e.sent;case 16:c=document.getElementById(t.domid),u=Cesium.Cartesian3.fromDegrees(s.geometry.coordinates[0],s.geometry.coordinates[1],r),this.sdk.viewer.scene.postRender.addEventListener((function(e){if("block"===c.style.display||""===c.style.display){var i=h.sdk.viewer.scene.cartesianToCanvasCoordinates(u);i&&(c.style.left=(i.x+t.x).toFixed(0)+"px",c.style.top=(i.y+t.y).toFixed(0)+"px")}}));case 19:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})}],[{key:"create",value:function(e){var i;i=2==e.heightMode,e.renewPositions();var n=Cesium.Color.fromCssColorString(e.options.color);2===e.sdk.viewer.scene.mode&&(e.options.heightMode=0,i=!1,n=new Cesium.CustomColorMaterialSource({color:e.options.color})),e.entity=e.sdk.viewer.entities.add({show:e.options.show,id:e.options.id,polygon:{hierarchy:new Cesium.PolygonHierarchy(e.positions),perPositionHeight:!i,material:n,zIndex:e.sdk._entityZIndex},polyline:C()(C()({positions:[].concat(A()(e.positions),[e.positions[0],e.positions[1]]),width:e.options.line.width,arcType:Cesium.ArcType.NONE,material:Cesium.Color.fromCssColorString(e.options.line.color),clampToGround:!!i},"arcType",i?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE),"zIndex",e.sdk._entityZIndex)}),e.sdk._entityZIndex++,t.createLabel(e),Mt(e.sdk,e.options.id),e.options.show&&Qe(0,e.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(i=[[]],n=0;n<t.options.positions.length;n++)i[0].push([t.options.positions[n].lng,t.options.positions[n].lat]);i[0].push([t.options.positions[0].lng,t.options.positions[0].lat]),o=turf.polygon(i),s=turf.pointOnFeature(o),r=0,e.t0=t.heightMode,e.next=0===e.t0||"0"===e.t0?9:1===e.t0||"1"===e.t0?11:2===e.t0||"2"===e.t0?14:16;break;case 9:return l=!1,e.abrupt("break",16);case 11:for(c=0;c<i.length;c++)r=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(i[c].lng,i[c].lat));return l=!1,e.abrupt("break",16);case 14:return l=!0,e.abrupt("break",16);case 16:if(l){e.next=20;break}r=t.options.height+r,e.next=24;break;case 20:return u=A()(t.sdk.viewer.entities.values),e.next=23,t.getClampToHeight({lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1]},u);case 23:r=e.sent;case 24:t.options.label.position={lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1],alt:r},t.label=new Xn(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.label.position.lng,t.options.label.position.lat,t.options.label.position.alt],text:t.options.name,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far,ground:l});case 26:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}]);var i,n,s,r,l}(Vn);function Ao(e){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 56%;">\n <div>\n <div class="row">\n <div class="col input-select-unit-box">\n <div class="input-select-unit"></div>\n <input class="input input-text" readonly="readonly" type="text" style="flex: 0 0 130px;" @model="length">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="polyline-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">应用</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="线条风格">\n <div class="row">\n <div class="col">\n <span class="label">线条颜色</span>\n <div class="color"></div>\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">线条宽度</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="1" max="999" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col input-select-line-type-box" style="flex: 0 0 37%;">\n <span class="label">线条形式</span>\n <div class="input-select-line-type"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">首尾相连</span>\n <input class="btn-switch" type="checkbox" @model="noseToTail">\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">线段圆滑</span>\n <input class="btn-switch" type="checkbox" @model="smooth">\n </div>\n <div class="col" style="flex: 0 0 37%;">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">线段缓冲</span>\n <input class="btn-switch" type="checkbox" @model="extend">\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">缓冲宽度</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="0" data-min="0.01" max="999999" @model="extendWidth">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 37%;">\n <span class="label">缓冲颜色</span>\n <div class="extendColor"></div>\n </div>\n </div>\n <div class="row" id="dashTextureDom">\n <div class="col">\n <span class="label">首尾反向</span>\n <input class="btn-switch" type="checkbox" @model="rotate">\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">流动速率</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="999999" step="1" @model="speed">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 37%;">\n <span class="label lineSpace">线条间距</span>\n <div class="input-number input-number-unit-1 lineSpace" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="4.5" step="0.1" @model="space">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n \x3c!-- <DIV-cy-tab-pane label="灯光控制">--\x3e\n \x3c!-- <div>--\x3e\n \x3c!-- <div class="row">--\x3e\n \x3c!-- <div class="col">--\x3e\n \x3c!-- <span class="label">指令</span>--\x3e\n \x3c!-- <input class="input" type="text" @model="instruct">--\x3e\n \x3c!-- <button class="primary" @click="instructSubmit">提交</button>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </DIV-cy-tab-pane>--\x3e\n \x3c!-- <DIV-cy-tab-pane label="设置操作点">--\x3e\n \x3c!-- <div>--\x3e\n \x3c!-- <div class="row">--\x3e\n \x3c!-- <div class="col">--\x3e\n \x3c!-- <span class="label">设置操作点</span>--\x3e\n \x3c!-- <input class="input" type="text" @model="operatingPoint">--\x3e\n \x3c!-- <button class="primary" @click="operatingPointSubmit">提交</button>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </DIV-cy-tab-pane>--\x3e\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Lo(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Io(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)?Io(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Io(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}var jo=function(){function e(){k()(this,e),this.element={}}return x()(e,[{key:"getEvent",value:function(t){return e.event[t]}},{key:"getEventAll",value:function(){return e.event}},{key:"setEvent",value:function(t,i){e.event[t]=i}},{key:"on",value:function(e,t){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!t[o]||!t[o].attributes)return 1;var r,l=Lo(t[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==t[o].type?(n.push((function(t){e[l.value]=t.target.checked})),t[o].checked=e[l.value]):(n.push((function(t){var i=t.target.value;"number"==t.target.type?"."==t.data||"-"==t.data&&!t.target.value||(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max),t.target.value=i),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min),t.target.value=i),t.target.dataset.min&&i<Number(t.target.dataset.min)&&(i=Number(t.target.dataset.min)),e[l.value]=i):e[l.value]=i})),"IMG"==t[o].nodeName?t[o].src=e[l.value]:t[o].value=e[l.value]),i.element[l.value]?i.element[l.value].push(t[o]):i.element[l.value]=[t[o]],a.push(l.name);break;case"@click":t[o].addEventListener("click",(function(t){"function"==typeof e[l.value]&&e[l.value](t)})),a.push(l.name);break;case"@change":s=!0,n.push((function(t){var i=t.target.value;"number"==t.target.type&&""!=i&&(i=Number(i),t.target.value=i),"function"==typeof e[l.value]&&e[l.value](t,i)}))}};for(l.s();!(r=l.n()).done;)c()}catch(e){l.e(e)}finally{l.f()}for(var u=0;u<a.length;u++)t[o].attributes.removeNamedItem(a[u]);if(s){var h="input";"INPUT"==t[o].tagName&&"checkbox"!=t[o].type||(h="change"),t[o].addEventListener(h,(function(e){for(var t=0;t<n.length;t++)n[t](e)}))}},o=0;o<t.length;o++)n()}}])}();C()(jo,"event",{});var Ro=new jo;function Fo(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 zo(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Fo(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Fo(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Ho=function(){return x()((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,e),this.sdk=t,this.viwer=this.sdk.viewer,this.options=i,this.options.position=i.position||{},this.options.rotate=i.rotate||{},this.options.position.lng=this.options.position.lng||0,this.options.position.lat=this.options.position.lat||0,this.options.position.alt=this.options.position.alt||0,this.options.rotate.x=this.options.rotate.x||0,this.options.rotate.y=this.options.rotate.y||0,this.options.rotate.z=this.options.rotate.z||0,this.activeAxis,this.activeCircle,this.activeModelParam,this.origin,this.rayX,this.rayY,this.rayZ,this.arrow={},this.activeState,this.coordArrows=[],this.coordCircles=[],this.MapEvent=new K(this.sdk)}),[{key:"position",get:function(){return this.options.position},set:function(e){this.options.position=e,this.againArrow(),this.againCircle()}},{key:"rotate",get:function(){return this.options.rotate},set:function(e){this.options.rotate=e}},{key:"initParam",value:function(){return this._params={tx:this.options.position.lng,ty:this.options.position.lat,tz:this.options.position.alt,rx:this.options.rotate.x,ry:this.options.rotate.y,rz:this.options.rotate.z},zo(zo({},this.options.position),this.options.rotate)}},{key:"editTranslational",value:(i=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w,k=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:w=function(e){if(t.activeAxis){var i=e.startPosition.y-e.endPosition.y,n={x:e.endPosition.x-y.x,y:e.endPosition.y-y.y},o=r.camera.getPickRay(n),s=r.scene.globe.pick(o,r.scene),a=new Cesium.Cartesian3,l=Cesium.Transforms.eastNorthUpToFixedFrame(r.camera.position);Cesium.Matrix4.inverse(l,l),Cesium.Matrix4.multiplyByPoint(l,s,a),Cesium.Cartesian3.normalize(a,a);var c=t.initParam(),u=90+Cesium.Math.toDegrees(Math.asin(a.z)),h=Cesium.Cartographic.fromCartesian(r.camera.position).height,p=t.activeModelParam.alt,d=h/Math.cos(Cesium.Math.toRadians(u));new Cesium.EllipsoidGeodesic(Cesium.Cartographic.fromCartesian(s),Cesium.Cartographic.fromCartesian(r.camera.position)),s=Cesium.Ray.getPoint(o,d*(1-p/h));var m=Cesium.Cartographic.fromCartesian(s),f=Cesium.Math.toDegrees(m.longitude),v=Cesium.Math.toDegrees(m.latitude);switch(t.activeAxis._name){case"model_edit_xAxis":t._params.tx=f,t._params.ty=t.activeModelParam.lat,t._params.tz=p,t.origin=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt);var g=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(c.lng-.001,c.lat,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),k=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat-.001,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),_=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);t.rayX=new Cesium.Ray(t.origin,g),t.rayY=new Cesium.Ray(t.origin,k),t.rayZ=new Cesium.Ray(t.origin,_);break;case"model_edit_yAxis":t._params.tx=t.activeModelParam.lng,t._params.ty=v,t._params.tz=p,t.origin=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt);var x=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(c.lng-.001,c.lat,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),E=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat-.001,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),S=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);t.rayX=new Cesium.Ray(t.origin,x),t.rayY=new Cesium.Ray(t.origin,E),t.rayZ=new Cesium.Ray(t.origin,S);break;case"model_edit_zAxis":t.activeModelParam.alt+=Cesium.Cartesian3.distance(r.camera.position,Cesium.Cartesian3.fromDegrees(t.options.position.lng,t.options.position.lat,t.options.position.alt))/4300*i*3,t._params.tx=t.activeModelParam.lng,t._params.ty=t.activeModelParam.lat,t._params.tz=t.activeModelParam.alt,t.origin=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,t.activeModelParam.alt);var P=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(c.lng-.001,c.lat,t.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),D=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat-.001,t.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),M=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat,t.activeModelParam.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);t.rayX=new Cesium.Ray(t.origin,P),t.rayY=new Cesium.Ray(t.origin,D),t.rayZ=new Cesium.Ray(t.origin,M)}t.updateModel(t._params.tx,t._params.ty,t._params.tz,t._params.rx,t._params.ry,t._params.rz),t.againArrow()}else{var T=Date.now();if(T-b<100)return clearTimeout(C),void(C=setTimeout((function(){w(e)}),100));clearTimeout(C),b=T;for(var O=t.coordArrows,N=0;N<O.length;N++)if(O[N].getGeometryInstanceAttributes)switch(O[N]._name){case"model_edit_xAxis":O[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.RED}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_yAxis":O[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.LIME}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_zAxis":O[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.BLUE}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}})}for(var B=t.viwer.scene.drillPick(e.endPosition,10),A=B.length-1;A>=0;A--){var L=B[A];if(L&&L.primitive&&L.id)switch(L.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return void(L.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}}},this.destroy(),this.activeState="translational",this.MapEvent=new K(this.sdk),t=this,i=this.initParam(),n=i.lng,o=i.lat,s=i.alt,r=this.viwer,this.origin=Cesium.Cartesian3.fromDegrees(n,o,s),l=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n-.001,o,s),new Cesium.Cartesian3),new Cesium.Cartesian3),c=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n,o-.001,s),new Cesium.Cartesian3),new Cesium.Cartesian3),u=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n,o,s-1),new Cesium.Cartesian3),new Cesium.Cartesian3),this.rayX=new Cesium.Ray(this.origin,l),this.rayY=new Cesium.Ray(this.origin,c),this.rayZ=new Cesium.Ray(this.origin,u),this.arrow.positionX=Cesium.Ray.getPoint(this.rayX,0),this.arrow.positionY=Cesium.Ray.getPoint(this.rayY,0),this.arrow.positionZ=Cesium.Ray.getPoint(this.rayZ,0),h=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(n,o,s)),p=r.camera.position,d=Cesium.Cartesian3.distance(p,this.origin),m=d/15,Cesium.Matrix4.multiplyByScale(h,new Cesium.Cartesian3(m,m,m),h),f=this.createAxisArrow("model_edit_xAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(1,0,0)],h,Cesium.Color.RED),v=this.createAxisArrow("model_edit_yAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,1,0)],h,Cesium.Color.LIME),g=this.createAxisArrow("model_edit_zAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,0,1)],h,Cesium.Color.BLUE),this.viwer.scene.primitives.add(f),this.viwer.scene.primitives.add(v),this.viwer.scene.primitives.add(g),this.againArrow(),this.viwer.camera.percentageChanged=.001,this.viwer.camera.changed.addEventListener(this.againArrow,{_that:this}),y={x:0,y:0},b=0,this.MapEvent.mouse_move((function(e,t){w(e)})),this.MapEvent.mouse_left_down((function(e,i){var n=r.scene.cartesianToCanvasCoordinates(k.origin);y.x=e.position.x-Math.floor(n.x),y.y=e.position.y-Math.floor(n.y);for(var o=r.scene.drillPick(e.position,10),s=o.length-1;s>=0;s--){var a=o[s];if(a&&a.primitive&&a.primitive._name)if(t.activeAxis)t.activeAxis=null,t.activeModelParam=null,t.controllerCallBack;else switch(a.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return r.scene.screenSpaceCameraController.enableRotate=!1,t.activeAxis=a.primitive,t.activeModelParam=t.initParam(),void(a.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}})),this.MapEvent.mouse_left_up((function(e){r.scene.screenSpaceCameraController.enableRotate=!0;for(var i=0;i<t.coordArrows.length;i++)switch(t.coordArrows[i]._name){case"model_edit_xAxis":t.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.RED}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_yAxis":t.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.LIME}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_zAxis":t.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.BLUE}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}})}t.activeAxis&&(t.activeAxis=null,t.activeModelParam=null,t.controllerCallBack)}));case 42:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"againArrow",value:function(){var e=this._that||this;if(e.origin){e.initParam(),e.origin=new Cesium.Cartesian3.fromDegrees(e._params.tx,e._params.ty,e._params.tz);for(var t=e.viwer.camera.position,i=Cesium.Cartesian3.distance(t,e.origin)/15,n=Cesium.Transforms.eastNorthUpToFixedFrame(e.origin),o=e.coordArrows,s=0;s<o.length;s++)switch(o[s]._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":Cesium.Matrix4.multiplyByScale(n,new Cesium.Cartesian3(i,i,i),o[s].modelMatrix)}}}},{key:"againCircle",value:function(){var e=this._that||this;if(e.origin){e.initParam(),e.origin=new Cesium.Cartesian3.fromDegrees(e._params.tx,e._params.ty,e._params.tz);for(var t=e.viwer.camera.position,i=Cesium.Cartesian3.distance(t,e.origin)/15,n=Cesium.Transforms.eastNorthUpToFixedFrame(e.origin),o=e.coordCircles,s=0;s<o.length;s++)switch(o[s]._name){case"model_edit_zCircle":case"model_edit_yCircle":case"model_edit_xCircle":var a=i/20;Cesium.Matrix4.multiplyByScale(n,new Cesium.Cartesian3(a,a,a),o[s].modelMatrix),o[s]._radius=i}}}},{key:"editRtation",value:(t=o()(a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.destroy(),this.activeState="rtation",this.MapEvent=new K(this.sdk),t=this.initParam(),this.origin=Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt),this.createCircle(t.lng,t.lat,t.alt,20),this.viwer.camera.percentageChanged=.001,this.viwer.camera.changed.addEventListener(this.againCircle,{_that:this});case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"createCircle",value:(e=o()(a.a.mark((function e(t,i,n,o){var s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w,k,_,x,E,S,P,D,M;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(M=function(e){if(r.activeCircle){var t=0,i=0,n=0;if(!Cesium.SceneTransforms.wgs84ToWindowCoordinates(l.scene,s.ciclkPosition))return;var o=e.startPosition.y-e.endPosition.y,a=e.startPosition.x-e.endPosition.x;switch(r.activeCircle._name){case"model_edit_xCircle":i=1*a;break;case"model_edit_yCircle":t=1*o;break;case"model_edit_zCircle":n=1*a}r._params.rx-=t,r._params.rx>360&&(r._params.rx=1),r._params.rx<0&&(r._params.rx=360),Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(r._params.rx)),r._params.ry-=i,r._params.ry>360&&(r._params.ry=1),r._params.ry<0&&(r._params.ry=360),r._params.rz-=n,r._params.rz>360&&(r._params.rz=1),r._params.rz<0&&(r._params.rz=360),r.updateModel(r._params.tx,r._params.ty,r._params.tz,r._params.rx,r._params.ry,r._params.rz)}else{var c=Date.now();if(c-P<100)return clearTimeout(D),void(D=setTimeout((function(){M(e)}),100));clearTimeout(D),P=c;for(var u=s.coordCircles,h=0;h<u.length;h++)if(u[h].getGeometryInstanceAttributes){var p=u[h].getGeometryInstanceAttributes(u[h]._name);switch(u[h]._name){case"model_edit_zCircle":p.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED).value;break;case"model_edit_yCircle":p.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE).value;break;case"model_edit_xCircle":p.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.LIME).value}}for(var d=l.scene.drillPick(e.endPosition,10),m=0;m<d.length;m++){var f=d[m];if(f&&f.primitive&&f.id){var v=f.primitive.getGeometryInstanceAttributes(f.id);switch(f.primitive._name){case"model_edit_zCircle":case"model_edit_yCircle":case"model_edit_xCircle":return void(v.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW).value)}}}}},s=this._that||this,r=this,l=this.viwer,c=[],u=0;u<=360;u+=3)h=Math.sin(Cesium.Math.toRadians(u)),p=Math.cos(Cesium.Math.toRadians(u)),d=o*p,m=o*h,c.push(new Cesium.Cartesian3(d,m,0));return f=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,i,n)),v=l.camera.position,g=Cesium.Cartesian3.distance(v,this.origin),b=(y=g/15)/o,Cesium.Matrix4.multiplyByScale(f,new Cesium.Cartesian3(b,b,b),f),e.next=14,this.createAxisSphere("model_edit_zCircle",c,f,Cesium.Color.RED,y);case 14:return C=e.sent,l.scene.primitives.add(C),e.next=18,this.createAxisSphere("model_edit_yCircle",c,f,Cesium.Color.BLUE,y);case 18:return w=e.sent,l.scene.primitives.add(w),k=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(90)),_=Cesium.Matrix4.fromRotationTranslation(k),Cesium.Matrix4.multiply(w.geometryInstances.modelMatrix,_,w.geometryInstances.modelMatrix),e.next=25,this.createAxisSphere("model_edit_xCircle",c,f,Cesium.Color.LIME,y);case 25:x=e.sent,l.scene.primitives.add(x),E=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(90)),S=Cesium.Matrix4.fromRotationTranslation(E),Cesium.Matrix4.multiply(x.geometryInstances.modelMatrix,S,x.geometryInstances.modelMatrix),P=0,this.MapEvent.mouse_move((function(e){M(e)})),this.MapEvent.mouse_left_down((function(e){var t=l.scene.pickPosition(e.position);s.ciclkPosition=t;for(var i=l.scene.drillPick(e.position,10),n=0;n<i.length;n++){var o=i[n];if(o&&o.primitive&&o.id)switch(o.primitive._name){case"model_edit_xCircle":case"model_edit_yCircle":case"model_edit_zCircle":return l.scene.screenSpaceCameraController.enableRotate=!1,o.primitive.getGeometryInstanceAttributes(o.primitive._name).color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW).value,r.activeCircle=o.primitive,void(r.activeModelParam=r.initParam())}}r.activeCircle=null,r.activeModelParam=null,l.scene.screenSpaceCameraController.enableRotate=!0})),this.MapEvent.mouse_left_up((function(e){l.scene.screenSpaceCameraController.enableRotate=!0;var t=r.coordCircles;r.activeCircle=null,r.activeModelParam=null;for(var i=0;i<t.length;i++)if(t[i].getGeometryInstanceAttributes){var n=t[i].getGeometryInstanceAttributes(t[i]._name);switch(t[i]._name){case"model_edit_zCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED).value;break;case"model_edit_yCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE).value;break;case"model_edit_xCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.LIME).value}}}));case 34:case"end":return e.stop()}}),e,this)}))),function(t,i,n,o){return e.apply(this,arguments)})},{key:"updateModel",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this._params.tx=e=parseFloat(parseFloat(e).toFixed(8)),this._params.ty=t=parseFloat(parseFloat(t).toFixed(8)),this._params.tz=i=parseFloat(parseFloat(i).toFixed(2)),this._params.rx=n=parseFloat(n),this._params.ry=o=parseFloat(o),this._params.rz=s=parseFloat(s),this.options.position.lng=e,this.options.position.lat=t,this.options.position.alt=i,this.options.rotate={x:n,y:o,z:s},this.controllerCallBack}},{key:"controllerCallBack",get:function(){this._controllerCallBack&&this._controllerCallBack(this.options,!this.activeAxis)},set:function(e){this._controllerCallBack=e}},{key:"createAxisArrow",value:function(e,t,i,n){var o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:e,geometry:new Cesium.PolylineGeometry({positions:t,width:20}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:n}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return o._name=e,this.coordArrows.push(o),o}},{key:"createAxisCircular",value:function(e,t,i,n){var o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.EllipseGeometry({center:{x:1,y:1,z:1},semiMinorAxis:5e5,semiMajorAxis:1e6,rotation:Cesium.Math.PI_OVER_FOUR,vertexFormat:Cesium.VertexFormat.POSITION_AND_ST})}),releaseGeometryInstances:!1,appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.YELLOW}}})}),modelMatrix:i});return o._name=e,this.coordArrows.push(o),o}},{key:"createAxisSphere",value:function(e,t,i,n,o){var s=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:e,geometry:new Cesium.PolylineGeometry({positions:t,width:5}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineColorAppearance({translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return s._radius=o,s._name=e,this.coordCircles.push(s),s}},{key:"removeCoordArrows",value:function(){for(var e=0;e<this.coordArrows.length;e++)this.viwer.scene.primitives.remove(this.coordArrows[e]);this.coordArrows=[]}},{key:"removeCoordCircle",value:function(){for(var e=0;e<this.coordCircles.length;e++)this.viwer.scene.primitives.remove(this.coordCircles[e]);this.coordCircles=[]}},{key:"removeAllTools",value:function(){this.removeCoordArrows(),this.removeCoordCircle()}},{key:"destroy",value:function(){this.removeAllTools(),this.activeAxis=void 0,this.activeState=void 0,this.MapEvent&&this.MapEvent.destroy(),this.viwer.camera.changed.removeEventListener(this.againArrow),this.viwer.camera.changed.removeEventListener(this.againCircle)}},{key:"getActiveState",value:function(){return this.activeState}},{key:"update",value:function(){this.againArrow(),this.againCircle()}}]);var e,t,i}();function Vo(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 Go(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Vo(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Vo(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Wo(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Uo=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,t),(i=Wo(this,t,[e,n])).options.name=n.name||"未命名对象",i.options.width=n.width||0===n.width?n.width:3,i.options.color=n.color||"#ff0000",i.options.type=n.type?Number(n.type):0,i.options.noseToTail=n.noseToTail||!1,i.options.smooth=n.smooth||!1,i.options.extend=n.extend||!1,i.options.rotate=!n.rotate&&!1!==n.rotate||n.rotate,i.options.space=n.space||1,i.options.speed=n.speed||10,i.options.wordsName=n.wordsName||0,i.options.extendWidth=n.extendWidth||0===n.extendWidth?n.extendWidth:10,i.options.extendColor=n.extendColor||"rgba(255,255,80,0.3)",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i._elms=[],n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],delete i.options.attribute.camera,delete i.options.attribute.vr,delete i.options.attribute.goods,i.options.richTextContent=n.richTextContent||"",i.operate={},i.nodePoints=[],i.unitNum=0,i.inputSpeed=n.speed&&100*Math.pow(n.speed,-1)||10,i.Dialog=o,!i.options.positions||i.options.positions.length<2)i._error="线段最少需要两个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{for(var s=0;s<i.options.positions.length;s++)i.options.positions[s].lng=Number(Number(i.options.positions[s].lng).toFixed(8)),i.options.positions[s].lat=Number(Number(i.options.positions[s].lat).toFixed(8)),i.options.positions[s].alt=Number(Number(i.options.positions[s].alt).toFixed(2));i.sdk.addIncetance(i.options.id,i),t.create(i)}return i}return un()(t,e),x()(t,[{key:"color",get:function(){return this.options.color},set:function(e){var t=this;this.options.color=e||"#ff0000";var i=Go({},this.options);i.speed=this.inputSpeed,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,i),this._elms.color&&this._elms.color.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,0,0,1)"}});t._elms.color[i]=n}))}},{key:"speed",get:function(){return this.options.speed},set:function(e){this.options.speed=e,this.inputSpeed=0!==e?100*Math.pow(e,-1):0;var t=Go({},this.options);t.speed=this.inputSpeed,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,t)}},{key:"rotate",get:function(){return this.options.rotate},set:function(e){this.options.rotate=e,this.closeNodeEdit(),this._elms.rotate&&this._elms.rotate.forEach((function(t){t.checked=e})),this.options.rotate=e;var t=Go({},this.options);t.speed=this.inputSpeed,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,t)}},{key:"space",get:function(){return this.options.space},set:function(e){this.options.space=e;var t=Go({},this.options);t.speed=this.inputSpeed,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,t)}},{key:"wordsName",get:function(){return this.options.wordsName},set:function(e){var t=this;this.options.wordsName=Number(e);var i=this;if(this.noseToTail)this.renewPositions(this.options.positions);else this.computeDistance(this.options.positions,2,e).then((function(e){i.lengthByMeter=e,t.lengthChangeCallBack&&t.lengthChangeCallBack()}))}},{key:"lineWidth",get:function(){return this.options.width},set:function(e){var t=this;this.options.width=e||0==e?e:3,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(e){e.value=t.options.width})),this.entity&&this.entity.polyline&&(this.entity.polyline.width=this.entity.polyline.width+e-this.entity.polyline.oriWidth,this.entity.polyline.oriWidth=this.options.width)}},{key:"lineType",get:function(){return this.options.type},set:function(e){var t=this,i=[{name:'<i class="icon line"></i>实线',value:"实线",key:0,icon:"line"},{name:'<i class="icon dash-line"></i>虚线',value:"虚线",key:1,icon:"dash-line"},{name:'<i class="icon light-line"></i>泛光',value:"泛光",key:2,icon:"light-line"},{name:'<i class="icon tail-line"></i>尾迹光线',value:"尾迹光线",key:3,icon:"tail-line"},{name:'<i class="icon mult-tail-line"></i>多尾迹光线',value:"多尾迹光线",key:4,icon:"mult-tail-line"},{name:'<i class="icon flow-dash-line1"></i>流动虚线1',value:"流动虚线1",key:5,icon:"flow-dash-line1"},{name:'<i class="icon flow-dash-line2"></i>流动虚线2',value:"流动虚线2",key:6,icon:"flow-dash-line2"},{name:'<i class="icon pic-line1"></i>流动箭头1',value:"流动箭头1",key:7,icon:"pic-line1"},{name:'<i class="icon pic-line2"></i>流动箭头2',value:"流动箭头2",key:8,icon:"pic-line2"},{name:'<i class="icon pic-line3"></i>流动箭头3',value:"流动箭头3",key:9,icon:"pic-line3"},{name:'<i class="icon pic-line4"></i>流动箭头4',value:"流动箭头4",key:10,icon:"pic-line4"},{name:'<i class="icon pic-line5"></i>流动箭头5',value:"流动箭头5",key:11,icon:"pic-line5"},{name:'<i class="icon pic-line6"></i>流动箭头6',value:"流动箭头6",key:12,icon:"pic-line6"}];this.options.type=Number(e);for(var n=function(n){if(i[n].key===Number(e))return t._elms.lineType&&t._elms.lineType.forEach((function(e){e.value=i[n].value,2<e.value&&e.value<13?document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="flex"):document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="none"),2<e.value&&e.value<5?(document.getElementsByClassName("lineSpace")[0]&&(document.getElementsByClassName("lineSpace")[0].style.display="none"),document.getElementsByClassName("lineSpace")[1]&&(document.getElementsByClassName("lineSpace")[1].style.display="none")):(document.getElementsByClassName("lineSpace")[0]&&(document.getElementsByClassName("lineSpace")[0].style.display="flex"),document.getElementsByClassName("lineSpace")[1]&&(document.getElementsByClassName("lineSpace")[1].style.display="flex"))})),1},o=0;o<i.length&&!n(o);o++);var s=Go({},this.options);s.speed=this.inputSpeed,this.entity&&this.entity.polyline&&(this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,s))}},{key:"noseToTail",get:function(){return this.options.noseToTail},set:function(e){if(this.options.noseToTail=e,this.closeNodeEdit(),this._elms.noseToTail&&this._elms.noseToTail.forEach((function(t){t.checked=e})),this.entity){var t=this.renewPositions(this.options.positions);this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(t),this.renewPolygon(t)}}},{key:"smooth",get:function(){return this.options.smooth},set:function(e){if(this.options.smooth=e,this.closeNodeEdit(),this._elms.smooth&&this._elms.smooth.forEach((function(t){t.checked=e})),this.entity){var t=this.renewPositions(this.options.positions);this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(t),this.renewPolygon(t)}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(e){var t=this;this.positionEditing=!1,this.options.heightMode=e||0==e?e:2;this.closeNodeEdit();var i=!1,n=this.renewPositions(this.options.positions);switch(this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(n),this.renewPolygon(n),this.options.heightMode){case"0":case 0:this.entity.polyline.clampToGround=i,this.extend=!1,"海拔高度";break;case"1":case 1:this.entity.polyline.clampToGround=i,this.extend=!1,"相对地表";break;case"2":case 2:i=!0,!0,this.entity.polyline.clampToGround=i,"依附模型"}setTimeout((function(){i?(t.label.ground=i,t._elms.heightMode&&(t._elms.heightMode.value="依附模型"),t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat]):(t.label.ground=i,t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,n[2]],t.options.label.position={lng:t.options.positions[0].lng,lat:t.options.positions[0].lat,alt:n[2]})}),0)}},{key:"extend",get:function(){return this.options.extend},set:function(e){if(this.options.extend=e,this.closeNodeEdit(),e&&(this.heightMode=2),this._elms.extend&&this._elms.extend.forEach((function(t){t.checked=e})),this.entity)if(this.options.extend){var t=this.renewPositions(this.options.positions);this.renewPolygon(t)}else this.entity.polygon=void 0}},{key:"extendWidth",get:function(){return this.options.extendWidth},set:function(e){this.options.extendWidth=e,this.heightMode=this.heightMode,this._elms.extendWidth&&this._elms.extendWidth.forEach((function(t){t.value=e}));var t=this.renewPositions(this.options.positions);this.renewPolygon(t)}},{key:"extendColor",get:function(){return this.options.extendColor},set:function(e){var t=this;this.options.extendColor=e,this._elms.extendColor&&this._elms.extendColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.extendColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.extendColor=e},clear:function(){t.extendColor="rgba(255,255,255,1)"}});t._elms.extendColor[i]=n})),this.entity&&this.entity.polygon&&(this.entity.polygon.material=Cesium.Color.fromCssColorString(this.options.extendColor))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){var t=this;this.options.label.show=e,this.show&&!this.showView||3==this.showView?(this.label.show=e,setTimeout((function(){t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt]}),0)):this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label.color=e,this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label.fontSize=e,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label.scaleByDistance=e,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(e){this.options.label.lineWidth=e,this.label.lineWidth=e,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(t){t.value=e}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(e){this.options.label.pixelOffset=e,this.label.pixelOffset=e,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(t){t.value=e}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(e){var t=this;this.options.label.lineColor=e,this.label.lineColor=e,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelLineColor=e},clear:function(){t.labelLineColor="rgba(0,255,255,0.5)"}});t._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label.backgroundColor=[e,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label.backgroundColor=[this.label.backgroundColor[0],e],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"positions",get:function(){return this.options.positions}},{key:"judgeLine",value:function(e,t){if(!e.polyline.oriRepeat){var i={color:t.color,image:this.getSourceRootPath()+"/img/arrow/1.png",space:t.space,speed:t.speed};i.speed=t.rotate?i.speed:0-i.speed;var n=document.createElement("canvas"),o=(n.getContext("2d"),new Image);o.src=i.image;var s=this;o.onload=function(){n.width=o.width*(i.space+1),n.height=o.height;var t=s.getSceenLine(e,i,n);t&&(e.polyline.oriRepeat=t);var a=e.polyline.positions.getValue(s.sdk.viewer.clock.currentTime);if(!Cesium.defined(a))return new Cesium.Cartesian2(1,1);for(var r=0,l=0;l<a.length-1;++l)r+=Cesium.Cartesian3.distance(a[l],a[l+1]);var c=r/e.polyline.width.getValue(),u=s.sdk.viewer.camera.positionCartographic.height,h=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),p=s.sdk.viewer.canvas.clientWidth,d=s.sdk.viewer.canvas.clientHeight;if(c*=s.sdk.viewer.scene.camera.getPixelSize(h,p,d)/u/(i.space*(n.width/n.height*5)+1),s.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D){var m=c/e.polyline.oriRepeat;e.polyline.oriSpeed=m,e.polyline.oriRepeatX=c}else{var f=Ft().viewer.entities.getById(s.options.id);e.polyline.oriSpeed=f.polyline.oriSpeed,e.polyline.oriRepeatX=f.polyline.oriRepeatX}}}}},{key:"getSceenLine",value:function(e,t,i){var n=new Cesium.Cartesian2(0,this.sdk.viewer.canvas.clientHeight),o=new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth/2,this.sdk.viewer.canvas.clientHeight),s=this.sdk.viewer.camera.getPickRay(n),a=this.sdk.viewer.scene.globe.pick(s,this.sdk.viewer.scene),r=this.sdk.viewer.camera.getPickRay(o),l=this.sdk.viewer.scene.globe.pick(r,this.sdk.viewer.scene);if(a&&l){var c=Cesium.Cartesian3.distance(a,l)/e.polyline.width.getValue(),u=this.sdk.viewer.camera.positionCartographic.height,h=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),p=this.sdk.viewer.canvas.clientWidth,d=this.sdk.viewer.canvas.clientHeight,m=this.sdk.viewer.scene.camera.getPixelSize(h,p,d);return m>700?c*=m/u/(t.space*(i.width/i.height*5)+1):c=void 0,this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D?c:Ft().viewer.entities.getById(this.options.id).polyline.oriRepeatX}}},{key:"edit",value:(l=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 8:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" polyline",(i=document.createElement("div")).innerHTML=Ao(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,new En("polyline-object-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){u.color=e},clear:function(){u.color="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){u.labelColor=e},clear:function(){u.labelColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("extendColor")[0],size:"mini",alpha:!0,defaultColor:this.extendColor,disabled:!1,openPickerAni:"opacity",sure:function(e){u.extendColor=e},clear:function(){u.extendColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){u.labelLineColor=e},clear:function(){u.labelLineColor="rgba(255,255,255,1)"}}),(void 0).labelBackgroundColorStartPicker=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){u.labelBackgroundColorStart=e},clear:function(){u.labelBackgroundColorStart="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){u.labelBackgroundColorEnd=e},clear:function(){u.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),c=i.getElementsByTagName("*"),Ro.on(this,c),this._elms=Ro.element,this._elms.color=[n],this._elms.labelColor=[o],this._elms.extendColor=[s],this._elms.labelLineColor=[r],this._elms.labelBackgroundColorStart=[(void 0).labelBackgroundColorStartPicker],this._elms.labelBackgroundColorEnd=[l],setTimeout((function(){u.attributeLink=u.options.attribute.link.content;var e=u.attributeSelect,t=u._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(t){var n=q(t,".attribute-select");n.legp_search(e);for(var o=u._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<e.length;s++)if(e[s].key===u.options.attributeType){o.value=e[s].value,n.legp_searchActive(e[s].value);break}o.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===o.value){u.attributeType=e[t].key;break}}))}var a=[{name:"空间长度",value:"空间长度"},{name:"投影长度",value:"投影长度"},{name:"地表长度",value:"地表长度"}],r=q(u._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=u._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];u._elms.wordsName=[l],l.value=u.options.wordsName;for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var e=0;e<a.length;e++)if(a[e].value===l.value){u.wordsName=a[e].value;break}}))}var h=[{name:"米",value:"米"},{name:"千米",value:"千米"}],p=q(u._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit",1);if(p){p.legp_search(h);var d=u._DialogObject._element.content.getElementsByClassName("input-select-unit")[1].getElementsByTagName("input")[0];u._elms.lengthUnit=[d],d.value=u.options.lengthUnit;for(var m=0;m<h.length;m++)if(h[m].value===d.value){p.legp_searchActive(h[m].value);break}d.addEventListener("input",(function(){for(var e=0;e<h.length;e++)if(h[e].value===d.value){u.lengthUnit=h[e].value;break}}))}var f=[{name:'<i class="icon line"></i>实线',value:"实线",key:0,icon:"line"},{name:'<i class="icon dash-line"></i>虚线',value:"虚线",key:1,icon:"dash-line"},{name:'<i class="icon light-line"></i>泛光',value:"泛光",key:2,icon:"light-line"},{name:'<i class="icon tail-line"></i>尾迹光线',value:"尾迹光线",key:3,icon:"tail-line"},{name:'<i class="icon mult-tail-line"></i>多尾迹光线',value:"多尾迹光线",key:4,icon:"mult-tail-line"},{name:'<i class="icon flow-dash-line1"></i>流动虚线1',value:"流动虚线1",key:5,icon:"flow-dash-line1"},{name:'<i class="icon flow-dash-line2"></i>流动虚线2',value:"流动虚线2",key:6,icon:"flow-dash-line2"},{name:'<i class="icon pic-line1"></i>流动箭头1',value:"流动箭头1",key:7,icon:"pic-line1"},{name:'<i class="icon pic-line2"></i>流动箭头2',value:"流动箭头2",key:8,icon:"pic-line2"},{name:'<i class="icon pic-line3"></i>流动箭头3',value:"流动箭头3",key:9,icon:"pic-line3"},{name:'<i class="icon pic-line4"></i>流动箭头4',value:"流动箭头4",key:10,icon:"pic-line4"},{name:'<i class="icon pic-line5"></i>流动箭头5',value:"流动箭头5",key:11,icon:"pic-line5"},{name:'<i class="icon pic-line6"></i>流动箭头6',value:"流动箭头6",key:12,icon:"pic-line6"}],v=q(u._DialogObject._element.content.getElementsByClassName("input-select-line-type-box")[0],".input-select-line-type");if(v){v.legp_search(f);var g=document.createElement("i");g.className="icon icon-active",u._DialogObject._element.content.getElementsByClassName("input-select-line-type")[0].getElementsByClassName("cy_datalist")[0].appendChild(g);var y=u._DialogObject._element.content.getElementsByClassName("input-select-line-type")[0].getElementsByTagName("input")[0];u._elms.lineType=[y];for(var b=0;b<f.length;b++)if(f[b].key===u.options.type){v.legp_searchActive(f[b].value),y.value=f[b].value,g.className="icon icon-active ".concat(f[b].icon);break}y.addEventListener("input",(function(){for(var e=0;e<f.length;e++)if(f[e].value===y.value){u.lineType=f[e].key,g.className="icon icon-active ".concat(f[e].icon),2<u.lineType&&u.lineType<13?document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="flex"):document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="none"),2<u.lineType&&u.lineType<5?(document.getElementsByClassName("lineSpace")[0]&&(document.getElementsByClassName("lineSpace")[0].style.display="none"),document.getElementsByClassName("lineSpace")[1]&&(document.getElementsByClassName("lineSpace")[1].style.display="none")):(document.getElementsByClassName("lineSpace")[0]&&(document.getElementsByClassName("lineSpace")[0].style.display="flex"),document.getElementsByClassName("lineSpace")[1]&&(document.getElementsByClassName("lineSpace")[1].style.display="flex"));break}}))}var C=u._DialogObject._element.content.getElementsByClassName("height-box")[0],w=C.getElementsByClassName("height")[0],k=u._DialogObject._element.content.getElementsByClassName("height-confirm")[0];w.value=10,2==u.heightMode?(C&&(C.className="input-number input-number-unit-1 height-box disabled"),k&&k.setAttribute("disabled","disabled")):(C&&(C.className="input-number input-number-unit-1 height-box"),k&&k.removeAttribute("disabled"));var _=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],x=q(u._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode");if(x){x.legp_search(_);for(var E=u._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],S=0;S<_.length;S++)if(_[S].key==u.heightMode){E.value=_[S].value,x.legp_searchActive(_[S].value);break}E.addEventListener("input",(function(){for(var e=0;e<_.length;e++)if(_[e].value===E.value){u.heightMode=_[e].key;break}})),w.addEventListener("input",(function(){u.heightMode})),u._elms.height=w,u._elms.heightBox=C,u._elms.heightMode=E,u._elms.heightConfirm=k,u._elms.heightModeObject=x,k.addEventListener("click",(function(){u.positionEditing=!1;for(var e=0;e<u.options.positions.length;e++)u.options.positions[e].alt=Number((u.options.positions[e].alt+Number(w.value)).toFixed(2)),u._elms.alt[e].innerHTML=u.options.positions[e].alt;var t=u.renewPositions(u.options.positions);u.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(t),u.positionEditing=!1,u.closeNodeEdit()}))}var P=i.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];u._elms.lng=[],u._elms.lngInput=[],u._elms.lat=[],u._elms.latInput=[],u._elms.alt=[],u._elms.altInput=[];for(var D=function(e){var t=document.createElement("div");t.className="tr",t.innerHTML='\n <div class="td">'.concat(e+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var i=t.getElementsByClassName("lng")[0],n=document.createElement("span");n.innerHTML=u.options.positions[e].lng.toFixed(8),i.appendChild(n);var o=document.createElement("input");o.className="input",o.type="number",o.title="",o.min=-180,o.max=180,o.value=u.options.positions[e].lng.toFixed(8);var s=t.getElementsByClassName("lat")[0],a=document.createElement("span");a.innerHTML=u.options.positions[e].lat.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-90,r.max=90,r.value=u.options.positions[e].lat.toFixed(8);var l=t.getElementsByClassName("alt")[0],c=document.createElement("span");c.innerHTML=u.options.positions[e].alt.toFixed(2),l.appendChild(c);var h=document.createElement("input");h.className="input",h.type="number",h.title="",h.min=-9999999,h.max=999999999,h.value=u.options.positions[e].alt.toFixed(2),i.addEventListener("dblclick",(function(){i.innerHTML="",o.value=Number(u.options.positions[e].lng.toFixed(8)),i.appendChild(o),o.focus(),u.positionEditing=!1,u.closeNodeEdit()})),o.addEventListener("blur",(function(){o.value=Number(u.options.positions[e].lng.toFixed(8)),i.innerHTML="",i.appendChild(n)})),o.addEventListener("input",(function(){u.options.positions[e].lng=Number(Number(o.value).toFixed(8)),n.innerHTML=u.options.positions[e].lng.toFixed(8);var t=u.renewPositions(u.options.positions);u.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(t),u.label.position=[u.options.positions[0].lng,u.options.positions[0].lat,t[2]]})),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(u.options.positions[e].lat.toFixed(8)),s.appendChild(r),r.focus(),u.positionEditing=!1,u.closeNodeEdit()})),r.addEventListener("blur",(function(){r.value=Number(u.options.positions[e].lat.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){u.options.positions[e].lat=Number(Number(r.value).toFixed(8)),a.innerHTML=u.options.positions[e].lat.toFixed(8);var t=u.renewPositions(u.options.positions);u.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(t),u.label.position=[u.options.positions[0].lng,u.options.positions[0].lat,t[2]]})),l.addEventListener("dblclick",(function(){2!=u.heightMode&&(l.innerHTML="",h.value=Number(u.options.positions[e].alt.toFixed(2)),l.appendChild(h),h.focus(),u.positionEditing=!1,u.closeNodeEdit())})),h.addEventListener("blur",(function(){h.value=Number(u.options.positions[e].alt.toFixed(2)),l.innerHTML="",l.appendChild(c)})),h.addEventListener("input",(function(){u.options.positions[e].alt=Number(Number(h.value).toFixed(2)),c.innerHTML=u.options.positions[e].alt.toFixed(2);var t=u.renewPositions(u.options.positions);u.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(t),u.label.position=[u.options.positions[0].lng,u.options.positions[0].lat,t[2]]})),u._elms.lng.push(n),u._elms.lngInput.push(o),u._elms.lat.push(a),u._elms.latInput.push(r),u._elms.alt.push(c),u._elms.altInput.push(h),P.appendChild(t)},M=0;M<u.options.positions.length;M++)D(M);var T=Un(),O=q(u._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(O){O.legp_search(T);var N=u._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];N.value=T[u.labelFontFamily].value;for(var B=0;B<T.length;B++)if(T[B].value==N.value){O.legp_searchActive(T[B].value);break}N.addEventListener("input",(function(){for(var e=0;e<T.length;e++)if(T[e].value===N.value){u.labelFontFamily=T[e].key;break}})),u._elms.labelFontFamily=[N]}}),0),e.next=34;break;case 33:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 34:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"smoothHandle",value:function(e){for(var t=[],i=[],n=[],o=0;o<e.length;o++)n.push(e[o].lng,e[o].lat,e[o].alt),i.push(o/(e.length-1));for(var s=new Cesium.CatmullRomSpline({times:i,points:Cesium.Cartesian3.fromDegreesArrayHeights(n)}),a=20*e.length,r=0;r<=a;r++){var l=s.evaluate(r/a);t.push(this.cartesian3Towgs84(l,this.sdk.viewer))}return t}},{key:"renewPositions",value:function(e,t){var i=this;if(!this._error){var n,o=JSON.parse(JSON.stringify(e));switch(this.heightMode){case 0:case"0":!1;break;case 1:case"1":for(var s=0;s<o.length;s++){var a=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(o[s].lng,o[s].lat));o[s].alt=Number(a?(o[s].alt+Number(a)).toFixed(2):o[s].alt.toFixed(2))}!1;break;case 2:case"2":!0}var r=[];if(n=this.options.noseToTail&&"false"!==this.options.noseToTail?[].concat(A()(o),[o[0]]):A()(o),this.options.smooth&&"false"!==this.options.smooth){n=this.smoothHandle(n);for(var l=0;l<n.length;l++)r.push(n[l].lng,n[l].lat,n[l].alt)}else for(var c=0;c<n.length;c++)r.push(n[c].lng,n[c].lat,n[c].alt);if(this.options.noseToTail&&"false"!==this.options.noseToTail||this.options.smooth&&"false"!==this.options.smooth){for(var u=[],h=0;h<r.length;h+=3)u.push({lng:r[h],lat:r[h+1],alt:r[h+2]});var p=this;this.computeDistance(u,2,this.options.wordsName).then((function(e){p.lengthByMeter=e,i.lengthChangeCallBack&&i.lengthChangeCallBack(),t&&t()}))}else{var d=this;this.computeDistance(o,2,this.options.wordsName).then((function(e){d.lengthByMeter=e,i.lengthChangeCallBack&&i.lengthChangeCallBack(),t&&t()}))}return r}}},{key:"renewPolygon",value:function(e){var t=[];if(this.options.extend&&"false"!==this.options.extend){for(var i=[],n=0;n<e.length;n+=3)t.push([e[n],e[n+1]]);for(var o=turf.lineString(t),s=turf.buffer(o,this.options.extendWidth/1e3,{units:"kilometers"}),a=0;a<s.geometry.coordinates[0].length;a++)i.push(s.geometry.coordinates[0][a][0],s.geometry.coordinates[0][a][1]);for(var r=[],l=1;l<s.geometry.coordinates.length;l++){for(var c=[],u=0;u<s.geometry.coordinates[l].length;u++)c.push(s.geometry.coordinates[l][u][0],s.geometry.coordinates[l][u][1]);r.push({positions:Cesium.Cartesian3.fromDegreesArray(c)})}this.entity.polygon=new Cesium.PolygonGraphics({hierarchy:{positions:Cesium.Cartesian3.fromDegreesArray(i),holes:r},material:Cesium.Color.fromCssColorString(this.options.extendColor)})}else this.entity.polygon=void 0}},{key:"reset",value:(r=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.entity){e.next=2;break}return e.abrupt("return");case 2:this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineWidth=this.originalOptions.width,this.lineType=this.originalOptions.type,this.noseToTail=this.originalOptions.noseToTail,this.smooth=this.originalOptions.smooth,this.extend=this.originalOptions.extend,this.extendWidth=this.originalOptions.extendWidth,this.extendColor=this.originalOptions.extendColor,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.rotate=this.originalOptions.rotate,this.speed=this.originalOptions.speed,this.space=this.originalOptions.space,this.heightMode=this.options.heightMode;case 25:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=y.length>0&&void 0!==y[0]?y[0]:{},!this._error){e.next=3;break}return e.abrupt("return");case 3:if(pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Go({},this.options.position):this.options.positions?l=Go({},this.options.positions[0]):this.options.center?l=Go({},this.options.center):this.options.start?l=Go({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(l);case 17:l.alt=e.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=43;break;case 25:c=[],e.t0=this.options.heightMode,e.next="0"===e.t0||0===e.t0?29:"1"===e.t0||1===e.t0?31:"2"===e.t0||2===e.t0?36:41;break;case 29:for(h=0;h<this.options.positions.length;h++)p=Cesium.Cartesian3.fromDegrees(this.options.positions[h].lng,this.options.positions[h].lat,this.options.positions[h].alt),c.push(p.x,p.y,p.z);return e.abrupt("break",41);case 31:return e.next=33,this.getClampToHeight(this.options.positions[0]);case 33:for(u=e.sent,d=0;d<this.options.positions.length;d++)m=Cesium.Cartesian3.fromDegrees(this.options.positions[d].lng,this.options.positions[d].lat,u+this.options.positions[d].alt),c.push(m.x,m.y,m.z);return e.abrupt("break",41);case 36:return e.next=38,this.getClampToHeight(this.options.positions[0]);case 38:for(u=e.sent,f=0;f<this.options.positions.length;f++)v=Cesium.Cartesian3.fromDegrees(this.options.positions[f].lng,this.options.positions[f].lat,u),c.push(v.x,v.y,v.z);return e.abrupt("break",41);case 41:g=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(g,{offset:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 43:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"nodeEdit",value:function(e){var t=this;if(this.positionEditing=!1,this.noseToTail=!1,this.heightMode=0,YJ.Measure.GetMeasureStatus());else{var i;this.closeNodeEdit(),YJ.Measure.SetMeasureStatus(!0),this._nodeEditCallback=e,this.tip=new Q("请选择一个顶点,右键取消",this.sdk),this.event=new K(this.sdk),this.ControllerObject=new Ho(this.sdk),this.event.mouse_left((function(e,n){var o=t.sdk.viewer.scene.pick(e.position);o&&o.id&&o.id.name&&"node-secondary-edit-point"===o.id.name&&(i=o.id,t.ControllerObject.position=t.options.positions[i.index],t.ControllerObject.editTranslational(),t.tip&&t.tip.destroy(),t.ControllerObject.controllerCallBack=function(e){0===i.index&&(t.label.position=[e.position.lng,e.position.lat,e.position.alt],t.options.label.position={lng:e.position.lng,lat:e.position.lat,alt:e.position.alt}),t.options.positions[i.index]=e.position,t._elms.lng&&(t._elms.lng[i.index].innerHTML=e.position.lng.toFixed(8)),t._elms.lngInput&&(t._elms.lngInput[i.index].value=e.position.lng.toFixed(8)),t._elms.lat&&(t._elms.lat[i.index].innerHTML=e.position.lat.toFixed(8)),t._elms.latInput&&(t._elms.latInput[i.index].value=e.position.lat.toFixed(8)),t._elms.alt&&(t._elms.alt[i.index].innerHTML=e.position.alt.toFixed(2)),t._elms.altInput&&(t._elms.altInput[i.index].value=e.position.alt.toFixed(2)),i.position=Cesium.Cartesian3.fromDegrees(e.position.lng,e.position.lat,e.position.alt)})})),this.event.mouse_right((function(e,i){for(var n=0;n<t.nodePoints.length;n++)t.sdk.viewer.entities.remove(t.nodePoints[n]);t.nodePoints=[],t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,t.ControllerObject.destroy();var o=t.renewPositions(t.options.positions);t.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(o),YJ.Measure.SetMeasureStatus(!1),t._nodeEditCallback=null})),this.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){var e=t.renewPositions(t.options.positions);return t._nodeEditCallback(t.options.positions,t.lengthByMeter),Cesium.Cartesian3.fromDegreesArrayHeights(e)}),!1);for(var n=0;n<this.options.positions.length;n++){var o=this.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:n,position:Cesium.Cartesian3.fromDegrees(this.options.positions[n].lng,this.options.positions[n].lat,this.options.positions[n].alt),billboard:{image:this.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});this.nodePoints.push(o)}}}},{key:"closeNodeEdit",value:function(){YJ.Measure.SetMeasureStatus(!1),this.ControllerObject&&this.ControllerObject.destroy(),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=null;for(var e=0;e<this.nodePoints.length;e++)this.sdk.viewer.entities.remove(this.nodePoints[e]);this.nodePoints=[],this._nodeEditCallback=null}},{key:"remove",value:(n=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label&&this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=8,this.sdk.removeIncetance(this.options.id);case 8:return e.next=10,Mt(this.sdk,this.options.id);case 10:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=e,!0===e){this.closeNodeEdit(),this.event&&this.event.destroy(),this.event=new K(this.sdk),this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;var i=JSON.parse(JSON.stringify(this.options.positions));this.previous={positions:A()(this.options.positions)};for(var n=0;n<i.length;n++)i[n]=Cesium.Cartesian3.fromDegrees(i[n].lng,i[n].lat,i[n].alt);for(var o=i[Math.floor(i.length/2)],s=[],a=0;a<i.length;a++)o.x,i[a].x,s.push({x:o.x-i[a].x,y:o.y-i[a].y,z:o.z-i[a].z});var r=[];this.event.mouse_move((function(e,i){r=[];for(var n=0;n<s.length;n++){var o={x:i.x-s[n].x,y:i.y-s[n].y,z:i.z-s[n].z};r.push(o)}var a=t.cartesian3Towgs84(r[0],t.sdk.viewer);t.label.position=[a.lng,a.lat,a.alt],t.options.label.position={lng:a.lng,lat:a.lat,alt:a.alt},t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,i){t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),r=[];for(var n=0;n<s.length;n++)r.push({x:i.x-s[n].x,y:i.y-s[n].y,z:i.z-s[n].z});for(var o=[],a=0;a<r.length;a++){var l=t.cartesian3Towgs84(r[a],t.sdk.viewer);l.alt=t.options.positions[a].alt,o.push(l),t._elms.lng&&(t._elms.lng[a].innerHTML=l.lng.toFixed(8)),t._elms.lngInput&&(t._elms.lngInput[a].value=l.lng.toFixed(8)),t._elms.lat&&(t._elms.lat[a].innerHTML=l.lat.toFixed(8)),t._elms.latInput&&(t._elms.latInput[a].value=l.lat.toFixed(8)),t._elms.alt&&(t._elms.alt[a].innerHTML=l.alt.toFixed(2)),t._elms.altInput&&(t._elms.altInput[a].value=l.alt.toFixed(2))}t.options.positions=o,t.previous.positions=o;var c=t.renewPositions(t.options.positions,(function(){t._positionEditingCallback&&(t._positionEditingCallback(),t._positionEditingCallback=null)}));t.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(c),t.renewPolygon(c),t.positionEditing=!1})),this.event.mouse_right((function(e,i){t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){var o=new Date,s={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};o-n>=500?(t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.positionEditing=!1):leftEvent(s,i)}))})),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return r.length>0?r:i}),!1)}else{this.sdk&&this.sdk.viewer&&this.label&&this.label.entity||(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.destroy()),this.tip&&this.tip.destroy();var l=this.renewPositions(this.options.positions);switch(this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(l),this.renewPolygon(l),this.heightMode){case 0:case"0":case 1:case"1":this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat,l[2]],this.options.label.position={lng:this.options.positions[0].lng,lat:this.options.positions[0].lat,alt:l[2]};break;case 2:case"2":this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat],this.options.label.position={lng:this.options.positions[0].lng,lat:this.options.positions[0].lat,alt:l[2]}}}}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"lengthChangeCallBack",get:function(){return this._lengthChangeCallBack},set:function(e){this._lengthChangeCallBack=e}},{key:"setDIV",value:function(){var e,t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};i.x=i.x||0===i.x?i.x:10,i.y=i.y||0===i.y?i.y:10;for(var n=[],o=0;o<this.options.positions.length;o++)n.push([this.options.positions[o].lng,this.options.positions[o].lat]);var s=turf.lineString(n),a=turf.length(s,{units:"kilometers"}),r=turf.lineSliceAlong(s,0,a/2,{units:"kilometers"}),l=document.getElementById(i.domid),c=(e=Cesium.Cartesian3).fromDegrees.apply(e,A()(r.geometry.coordinates[r.geometry.coordinates.length-1]));this.sdk.viewer.scene.postRender.addEventListener((function(e){if("block"===l.style.display||""===l.style.display){var n=t.sdk.viewer.scene.cartesianToCanvasCoordinates(c);n&&(l.style.left=(n.x+i.x).toFixed(0)+"px",l.style.top=(n.y+i.y).toFixed(0)+"px")}}))}}],[{key:"createLabel",value:(i=o()(a.a.mark((function e(t){var i,n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.options.heightMode,e.next="0"===e.t0||0===e.t0?3:"1"===e.t0||1===e.t0?6:"2"===e.t0||2===e.t0?13:18;break;case 3:return n=!1,i=t.options.positions[0].alt,e.abrupt("break",18);case 6:return n=!1,e.next=9,t.getClampToHeight({lng:t.options.positions[0].lng,lat:t.options.positions[0].lat});case 9:return e.t1=e.sent,e.t2=t.options.positions[0].alt,i=e.t1+e.t2,e.abrupt("break",18);case 13:return n=!0,e.next=16,t.getClampToHeight({lng:t.options.positions[0].lng,lat:t.options.positions[0].lat});case 16:return i=e.sent,e.abrupt("break",18);case 18:t.options.label.position||(t.options.label.position={lng:t.options.positions[0].lng,lat:t.options.positions[0].lat,alt:i}),t.label=new Xn(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.label.position.lng,t.options.label.position.lat,t.options.label.position.alt],text:t.options.name,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far,ground:n});case 20:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"create",value:function(e){var i;i=2==e.heightMode;var n=e.options.positions,o=e.renewPositions(n);e.entity=e.sdk.viewer.entities.add({id:e.options.id,show:e.options.show,polyline:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(o),width:e.options.width,clampToGround:i,zIndex:e.sdk._entityZIndex}}),e.entity.polyline.oriWidth=e.options.width,e.judgeLine(e.entity,e.options);var s=Go({},e.options);s.speed=e.inputSpeed,e.entity.polyline.material=e.getMaterial(e.options.color,e.options.type,e.entity,s),e.sdk._entityZIndex++,t.createLabel(e),e.renewPolygon(o),e.computeDistance(n,2,e.options.wordsName).then((function(t){e.lengthByMeter=t,e.lengthChangeCallBack&&e.lengthChangeCallBack(),Mt(e.sdk,e.options.id)})),e.options.show&&Qe(0,e.options.id);e.sdk.viewer.scene}}]);var i,n,s,r,l}(Vn);function Yo(e,t){var i=document.createElement("a");i.download=t,i.style.display="none";var n=new Blob([e]);i.href=URL.createObjectURL(n),document.body.appendChild(i),i.click(),document.body.removeChild(i)}var Jo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=new Cesium.EntityCollection;if(e.forEach((function(e){(e instanceof Do||e instanceof Bo||e instanceof ao||e instanceof Uo)&&t.add(e.entity)})),t.values.length){var i=Cesium.exportKml({entities:t});i.then((function(e){Yo(e.kml,(new Date).getTime()+".kml")}))}else console.error("允许导出为kml的对象为空")},qo={yingguangse:new Map,gonganlan:new Map,hong:new Map};qo.yingguangse.set("--color-sdk-base","#00ffff"),qo.yingguangse.set("--color-sdk-auxiliary","#004242"),qo.yingguangse.set("--color-sdk-auxiliary-public","#ffffff"),qo.yingguangse.set("--color-sdk-warning-0","#1BF8C3"),qo.yingguangse.set("--color-sdk-warning-1","#F16C55"),qo.yingguangse.set("--color-sdk-warning-2","#FFA145"),qo.yingguangse.set("--color-sdk-warning-3","#FFDF53"),qo.yingguangse.set("--color-sdk-text-head","#FFFFFF"),qo.yingguangse.set("--color-sdk-text-head-1","#E6F7FF"),qo.yingguangse.set("--color-sdk-text-head-2","#ADF1FF"),qo.yingguangse.set("--color-sdk-gradual","#00ffff 6.25%, #00ffff 100%"),qo.yingguangse.set("--color-sdk-bg-gradual","#00ffff33 0%, #00ffff00 100%");var Xo,Zo,Ko,Qo=0,$o=0,es=function(){var e=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(C=function(e){var i=h.getElementsByClassName("tr");i.length>0&&(i[i.length-1].querySelector("input[name='time']").disabled=void 0);var n=h.getElementsByClassName("tr active")[0];n&&(n.className="tr");var o=document.createElement("div");o.className="tr active",o.innerHTML='\n <div class="td" style="justify-content: center;">视点'.concat(m+1,'</div>\n <div class="td">\n <input class="input time" type="number" title="" min="0" max="999.99" step="0.01" name="time" value="').concat(e.duration,'">\n </div>\n <div class="td action">\n <button class="play">播放</span>\n <button class="delete">删除</span>\n </div>\n '),o.addEventListener("click",(function(e){if(e.target.parentNode===o){var t=h.getElementsByClassName("tr active")[0];t&&(t.className="tr"),o.className="tr active";for(var n=0;n<i.length;n++)if(i[n]===o){c=n+1;break}}})),o.addEventListener("dblclick",(function(e){if(e.target.parentNode===o)for(var t=0;t<i.length;t++)if(i[t]===o){r.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(f[t].position.lng,f[t].position.lat,f[t].position.alt),orientation:f[t].orientation,duration:1});break}}));var s=o.getElementsByClassName("play")[0],a=o.getElementsByClassName("delete")[0],l=o.querySelector("input[name='time']");s.addEventListener("click",(function(){for(var e=0;e<i.length;e++)i[e]===a.parentNode.parentNode&&is(t,f,e)})),a.addEventListener("click",(function(e){for(var t=0;t<i.length;t++)if(i[t]===a.parentNode.parentNode){if(f.splice(t,1),f[f.length-1]&&(f[f.length-1].duration=0),h.removeChild(o),c>t+1?(c--,i[c-1].className="tr active"):c==t+1&&(i.length==t&&(c-=1),0!=i.length&&(i[c-1].className="tr active")),i.length>0){var n=i[i.length-1].querySelector("input[name='time']");n.disabled="disabled",n.value=0}break}})),l.addEventListener("input",(function(t){console.log(y,"isTotalTimeElm"),y.checked=!1,e.duration=Number(l.value),e.duration<0&&(e.duration=0),console.log(e.duration,"duration")})),l.addEventListener("blur",(function(){l.value=Number(Number(l.value).toFixed(2)),l.value<0&&(l.value=0)})),h.insertBefore(o,i[c]),c++,i[i.length-1].querySelector("input[name='time']").disabled="disabled"},i=w.length>1&&void 0!==w[1]?w[1]:{},n=w.length>2&&void 0!==w[2]?w[2]:{},o=w.length>3?w[3]:void 0,s=i.name||"漫游路径",i.points||(i.points=[]),i.repeat&&(Qo=Number(i.repeat)),r=t.viewer,l=new vi(t),c=0,u=document.getElementsByClassName("fly-roam")[0],u.getElementsByTagName("*"),h=u.getElementsByClassName("table-body")[0],p=u.getElementsByClassName("table-empty")[0],d={set:function(e,t,i){return e[t]=i,e.length>0?p.style.display="none":p.style.display="flex",!0}},m=0,f=new Proxy([],d),m=0;m<i.points.length;m++)f.push(i.points[m]),C(i.points[m]);(v=u.querySelector("input[name='name']")).value=s,v.addEventListener("input",(function(){s=v.value})),document.getElementsByClassName("saveRoam")[0].addEventListener("click",(function(){s||(s="漫游路径",v.value=s);var e=[];f.map((function(t){e.push(t)})),o({name:s,points:e,repeat:Qo+""})})),u.getElementsByClassName("cease")[0].addEventListener("click",(function(){r.camera.cancelFlight()})),u.getElementsByClassName("afreshPlay")[0].addEventListener("click",(function(){f.length>0&&is(t,f,0)})),u.getElementsByClassName("add-point")[0].addEventListener("click",(function(){var e={duration:0,position:l.cartesian3Towgs84(r.camera.position,r),orientation:{heading:r.camera.heading,pitch:r.camera.pitch,roll:r.camera.roll}};f.splice(c,0,e),C(e),m++})),g=u.querySelector("input[name='totalTime']"),y=u.querySelector("input[name='isTotalTime']"),b=u.querySelector("input[name='repeat']"),y.addEventListener("change",(function(){var e=h.getElementsByClassName("tr");if(y.checked&&e.length>0){for(var t=Number((Number(g.value)/(e.length-1)).toFixed(2)),i=0;i<e.length-1;i++)f[i].duration=t,e[i].querySelector("input[name='time']").value=t;e[e.length-1].querySelector("input[name='time']").value=0}})),g.addEventListener("blur",(function(){var e=h.getElementsByClassName("tr");if(g.value=Number(g.value),g.value<0&&(g.value=0),y.checked&&e.length>0){for(var t=Number((Number(g.value)/(e.length-1)).toFixed(2)),i=0;i<e.length-1;i++)f[i].duration=t,e[i].querySelector("input[name='time']").value=t;e[e.length-1].querySelector("input[name='time']").value=0}})),b.checked=Qo===1/0,b.addEventListener("change",(function(){Qo=b.checked?1/0:0,$o=Qo,n.changeRepeatStateCallBack&&n.changeRepeatStateCallBack(b.checked)}));case 36:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ts=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;console.log(n,t,"noStart"),Xo&&Xo.destroy(),(Xo=new Cesium.ScreenSpaceEventHandler(e.viewer.canvas)).setInputAction((function(t){ns(e)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK);var s,r=e.viewer;r.camera.cancelFlight(),ni(e),oi(e),r.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(t[i].position.lng,t[i].position.lat,t[i].position.alt),orientation:t[i].orientation,duration:n?t[i-1].duration:.5,maximumHeight:t[i].position.alt,complete:(s=o()(a.a.mark((function n(){return a.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:++i<=t.length-1?ts(e,t,i,!0):$o&&t.length>1?($o--,ts(e,t,0)):Xo&&Xo.destroy();case 3:case"end":return n.stop()}}),n)}))),function(){return s.apply(this,arguments)}),easingFunction:n?Cesium.EasingFunction.LINEAR_NONE:Cesium.EasingFunction.EXPONENTIAL_OUT})},is=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;$o=Qo,ts(e,t,i,n)},ns=function(e){e&&e.viewer&&e.viewer.camera.cancelFlight(),Xo&&Xo.destroy()},os=null,ss=null,as=null,rs=null,ls="uniform sampler2D colorTexture;//输入的场景渲染照片\n varying vec2 v_textureCoordinates;\n uniform float tiltAngle;\n uniform float rainSize;\n uniform float rainWidth;\n uniform float rainSpeed;\n\n float hash(float x){\n return fract(sin(x*133.3)*13.13);\n }\n void main(void){\n float time = czm_frameNumber / rainSpeed;\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 c=vec3(.6,.7,.8);\n float a= tiltAngle;\n float si=sin(a),co=cos(a);\n uv*=mat2(co,-si,si,co);\n uv*=length(uv+vec2(0,4.9))*rainSize+1.;\n float v=1.-sin(hash(floor(uv.x*rainWidth))*2.);\n float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\n c*=v*b; //屏幕上雨的颜色\n gl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(c,1), 0.5); //将雨和三维场景融合\n }",cs="uniform sampler2D colorTexture;\n varying vec2 v_textureCoordinates;\n uniform float snowSize;\n uniform float snowSpeed;\n \n float snow(vec2 uv,float scale)\n {\n float time = czm_frameNumber / snowSpeed;\n float w=smoothstep(1.,0.,-uv.y*(scale/10.));if(w<.1)return 0.;\n uv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale;\n uv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d;\n p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k);\n k=smoothstep(0.,k,sin(f.x+f.y)*0.01*snowSize);\n return k*w;\n }\n void main(void){\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 finalColor=vec3(0);\n //float c=smoothstep(1.,0.3,clamp(uv.y*.3+.8,0.,.75));\n float c = 0.0;\n c+=snow(uv,30.)*.0;\n c+=snow(uv,20.)*.0;\n c+=snow(uv,15.)*.0;\n c+=snow(uv,10.);\n c+=snow(uv,8.);\n c+=snow(uv,6.);\n c+=snow(uv,5.);\n finalColor=(vec3(c));\n gl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.5);\n }\n ",us="\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n uniform float visibility;\n uniform vec4 fogColor;\n varying vec2 v_textureCoordinates;\n void main(void)\n {\n vec4 origcolor = texture2D(colorTexture, v_textureCoordinates);\n float depth = czm_readDepth(depthTexture, v_textureCoordinates);\n vec4 depthcolor = texture2D(depthTexture, v_textureCoordinates);\n float f = visibility * (depthcolor.r - 0.3) / 0.2;\n if (f < 0.0) f = 0.0;\n else if (f > 1.0) f = 1.0;\n gl_FragColor = mix(origcolor, fogColor, f);\n }\n ";var hs,ps,ds,ms,fs,vs,gs,ys={},bs=void 0,Cs=void 0,ws=!1,ks={};function _s(){if(this.sdk&&this.sdk.viewer){(Cs=this.sdk.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth/2,this.sdk.viewer.canvas.clientHeight/(2-(90+this.sdk.viewer.camera.pitch/(Cesium.Math.PI/180))/110))))||(Cs=this.sdk.viewer.camera.position);var e=Zo.cartesian3Towgs84(this.sdk.viewer.camera.position,this.sdk.viewer).alt,t=Zo.cartesian3Towgs84(Cs,this.sdk.viewer);e>9e6&&(e=9e6),e<4e5?(this.entity.billboard.show=!0,this.entity.rectangle.show=!1):(this.entity.billboard.show=!1,this.entity.rectangle.show=!0),bs=new Cesium.Rectangle(Cesium.Math.toRadians(t.lng-e/12e4),Cesium.Math.toRadians(t.lat-e/28e4),Cesium.Math.toRadians(t.lng+e/12e4),Cesium.Math.toRadians(t.lat+e/28e4))}}function xs(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}var Es,Ss,Ps=null,Ds=null,Ms=null,Ts=19,Os=!0,Ns=10,Bs="#ffd000",As=!0,Ls=2.5,Is="#43cf7c",js=!0,Rs=1.8,Fs="#ff0000",zs=!1,Hs=1,Vs="#64b6d9",Gs=!1,Ws=1,Us="#d084d1",Ys={};function Js(){if(Ss){var e=Ss.viewer.camera.positionCartographic;Cesium.Math.toDegrees(e.height)<1e6?Ss.viewer.scene.globe.material||!0!==Os||Xs(Ss):Zs(Ss)}}function qs(){return(qs=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d=function(e){var t=e.target.value;return(e.target.value||"undefined"!==e.target.dataset.null&&""!==e.target.dataset.null&&!Boolean(e.target.dataset.null))&&(t=Number(t),e.target.max&&t>Number(e.target.max)&&(t=Number(e.target.max)),e.target.min&&t<Number(e.target.min)&&(t=Number(e.target.min)),e.target.dataset.min&&t<Number(e.target.dataset.min)&&(t=Number(e.target.dataset.min))),t},Ss=t,t){e.next=4;break}return e.abrupt("return");case 4:Ps||Ks(),Es||(Es=new vi(t)),i=document.getElementsByClassName("contour")[0],t.viewer.scene.postRender.removeEventListener(Js),t.viewer.scene.postRender.addEventListener(Js),(n=i.getElementsByClassName("equal-height-distance")[0]).value=Ns,n.addEventListener("blur",(function(e){var t=d(e);Ns=t,n.value=t,Ps&&(Ys.spacing=5*Ns)})),new Hi({el:i.getElementsByClassName("active-color")[0],size:"mini",alpha:!0,defaultColor:Bs,disabled:!1,openPickerAni:"opacity",sure:function(e){Bs=e,Ps&&(Ys.activeColor=Cesium.Color.fromCssColorString(Bs))},clear:function(){Bs="rgba(255,255,255,1)",Ps&&(Ys.activeColor=Cesium.Color.fromCssColorString(Bs))}}),(o=i.getElementsByClassName("index-contour-switch")[0]).checked=As,o.addEventListener("change",(function(e){As=e.target.checked,Ps&&(Ys.indexContourShow=As)})),new Hi({el:i.getElementsByClassName("index-contour-color")[0],size:"mini",alpha:!0,defaultColor:Is,disabled:!1,openPickerAni:"opacity",sure:function(e){Is=e,Ps&&(Ys.indexContourColor=Cesium.Color.fromCssColorString(Is))},clear:function(){Is="rgba(255,255,255,1)",Ps&&(Ys.indexContourColor=Cesium.Color.fromCssColorString(Is))}}),(s=i.getElementsByClassName("index-contour-width")[0]).value=Ls,s.addEventListener("blur",(function(e){var t=d(e);Ls=t,s.value=t,Ps&&(Ys.indexContourWidth=Ls)})),(r=i.getElementsByClassName("intermediate-contour-switch")[0]).checked=js,r.addEventListener("change",(function(e){js=e.target.checked,Ps&&(Ys.intermediateContourShow=js)})),new Hi({el:i.getElementsByClassName("intermediate-contour-color")[0],size:"mini",alpha:!0,defaultColor:Fs,disabled:!1,openPickerAni:"opacity",sure:function(e){Fs=e,Ps&&(Ys.intermediateContourColor=Cesium.Color.fromCssColorString(Fs))},clear:function(){Fs="rgba(255,255,255,1)",Ps&&(Ys.intermediateContourColor=Cesium.Color.fromCssColorString(Fs))}}),(l=i.getElementsByClassName("intermediate-contour-width")[0]).value=Rs,l.addEventListener("blur",(function(e){var t=d(e);Rs=t,l.value=t,Ps&&(Ys.intermediateContourWidth=Rs)})),(c=i.getElementsByClassName("halfInterval-contour-switch")[0]).checked=zs,c.addEventListener("change",(function(e){zs=e.target.checked,Ps&&(Ys.halfIntervalContourShow=zs)})),new Hi({el:i.getElementsByClassName("halfInterval-contour-color")[0],size:"mini",alpha:!0,defaultColor:Vs,disabled:!1,openPickerAni:"opacity",sure:function(e){Vs=e,Ps&&(Ys.halfIntervalContourColor=Cesium.Color.fromCssColorString(Vs))},clear:function(){Vs="rgba(255,255,255,1)",Ps&&(Ys.halfIntervalContourColor=Cesium.Color.fromCssColorString(Vs))}}),(u=i.getElementsByClassName("halfInterval-contour-width")[0]).value=Hs,u.addEventListener("blur",(function(e){var t=d(e);Hs=t,u.value=t,Ps&&(Ys.halfIntervalContourWidth=Hs)})),(h=i.getElementsByClassName("supplementary-contour-switch")[0]).checked=Gs,h.addEventListener("change",(function(e){Gs=e.target.checked,Ps&&(Ys.supplementaryContourShow=Gs)})),new Hi({el:i.getElementsByClassName("supplementary-contour-color")[0],size:"mini",alpha:!0,defaultColor:Us,disabled:!1,openPickerAni:"opacity",sure:function(e){Us=e,Ps&&(Ys.supplementaryContourColor=Cesium.Color.fromCssColorString(Us))},clear:function(){Us="rgba(255,255,255,1)",Ps&&(Ys.supplementaryContourColor=Cesium.Color.fromCssColorString(Us))}}),(p=i.getElementsByClassName("supplementary-contour-width")[0]).value=Ws,p.addEventListener("blur",(function(e){var t=d(e);Ws=t,p.value=t,Ps&&(Ys.supplementaryContourWidth=Ws)}));case 41:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xs(e){var t=e.viewer.camera.positionCartographic;Cesium.Math.toDegrees(t.height)>1e6||(Ds&&Ds.destroy(),e.viewer.container.getElementsByClassName("YJ-customize-active-height-elm")[0]||e.viewer.container.appendChild(Ms),(Ds=new Cesium.ScreenSpaceEventHandler(e.viewer.canvas)).setInputAction((function(t){var i=e.viewer.scene.pickPosition(t.endPosition);if(i){var n=0,o=0;if(e.viewer&&e.viewer._element){var s=e.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0];n=s.getBoundingClientRect().top+window.scrollY,o=s.getBoundingClientRect().left+window.scrollX}Ms.style.left=t.endPosition.x-50+o+"px",Ms.style.top=t.endPosition.y-40+n+"px",Ms.style.display="block";var a=Es.cartesian3Towgs84(i,e.viewer),r=Math.floor(a.alt/Ps.uniforms.spacing)*Ps.uniforms.spacing,l=a.alt-r,c=Ps.uniforms.spacing/(Ps.uniforms.secondaryLinesCount+1),u=Math.floor(l/c)*c+r;a.alt<0&&(a.alt=0),a.alt-u>c/2&&(u+=c),Ps.uniforms.mouseHeight=a.alt,Ps.uniforms.mousePosition=i,Ms.innerHTML="".concat(u.toFixed(0))}else Ms.style.display="none"}),Cesium.ScreenSpaceEventType.MOUSE_MOVE),e.viewer.scene.globe.material=Ps)}function Zs(e){Ds&&(Ds.destroy(),Ds=null),e.viewer.container.getElementsByClassName("YJ-customize-active-height-elm")[0]&&(Ms.style.display="none",e.viewer.container.removeChild(Ms)),e.viewer.scene.globe.material=null}function Ks(){Cesium.Material._materialCache._materials.ElevationContour.fabric.source="\nuniform vec4 activeColor; // 选中颜色\nuniform float spacing; // 等高距\n\n// 计曲线\nuniform bool indexContourShow;\nuniform float indexContourWidth;\nuniform vec4 indexContourColor;\n// 首曲线\nuniform bool intermediateContourShow;\nuniform float intermediateContourWidth;\nuniform vec4 intermediateContourColor;\n// 间曲线\nuniform bool halfIntervalContourShow;\nuniform float halfIntervalContourWidth;\nuniform vec4 halfIntervalContourColor;\n// 助曲线\nuniform bool supplementaryContourShow;\nuniform float supplementaryContourWidth;\nuniform vec4 supplementaryContourColor;\n\nuniform float mouseHeight;\n\nuniform float secondaryLinesCount; // 0=无次线, 1=1条次线, 2=2条次线...\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n // 主等高线计算\n float distanceToMainContour = mod(materialInput.height, spacing);\n\n // 抗锯齿计算\n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n float dxc = abs(dFdx(materialInput.height));\n float dyc = abs(dFdy(materialInput.height));\n float dFMain = max(dxc, dyc) * czm_pixelRatio * indexContourWidth;\n#else\n float dFMain = czm_pixelRatio * indexContourWidth;\n#endif\n\n bool isMainContour = distanceToMainContour < dFMain;\n bool isSecondaryContour = false;\n float dFSecondary = 0.0;\n float secondarySpacing = 0.0;\n bool isHalfInterval = false;\n bool isIntermediate= false;\n\n // 计算当前高度所属的等高线高度\n float mainContourHeight = floor(materialInput.height / spacing) * spacing;\n float secondaryContourHeight = floor(materialInput.height / spacing * (secondaryLinesCount + 1.0)) * spacing / (secondaryLinesCount + 1.0);\n\n // 计算次线在两条主等高线之间的相对位置\n float relativeHeight = materialInput.height - mainContourHeight;\n float normalizedPosition = relativeHeight / spacing;\n\n // 计算次线索引(从主等高线开始计数)\n float lineIndex = floor(normalizedPosition * (secondaryLinesCount + 1.0));\n\n // 只有当存在次线时才计算次线\n if(secondaryLinesCount > 0.0) {\n float secondaryLinesWidth = supplementaryContourWidth;\n secondarySpacing = spacing / (secondaryLinesCount + 1.0);\n float distanceToSecondaryContour = mod(materialInput.height, secondarySpacing);\n\n // 确保次线不会与主线重叠\n float minDistanceToMain = min(distanceToMainContour, spacing - distanceToMainContour);\n bool notCloseToMain = minDistanceToMain > dFMain * 2.0; // 2倍线宽缓冲\n\n\n if (lineIndex > 0.0 && lineIndex < secondaryLinesCount) {\n // 使用mod函数检查余数是否接近0(考虑浮点数精度问题)\n isHalfInterval = abs(mod(lineIndex, 2.0)) < 0.01;\n if(isHalfInterval) {\n secondaryLinesWidth = halfIntervalContourWidth;\n }\n // 使用mod函数检查余数是否接近0(考虑浮点数精度问题)\n isIntermediate = abs(mod(lineIndex, 4.0)) < 0.01;\n if(isIntermediate) {\n secondaryLinesWidth = intermediateContourWidth;\n }\n }\n\n\n\n\n\n\n\n\n\n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n dFSecondary = max(dxc, dyc) * czm_pixelRatio * secondaryLinesWidth;\n#else\n dFSecondary = czm_pixelRatio * secondaryLinesWidth;\n#endif\n\n isSecondaryContour = (distanceToSecondaryContour < dFSecondary) && notCloseToMain;\n }\n\n // 高亮判断\n bool shouldHighlight = false;\n if(isMainContour && abs(mainContourHeight - mouseHeight) < 0.5 * (spacing/(secondaryLinesCount+1.0))) {\n shouldHighlight = true;\n } else if(isSecondaryContour && abs(secondaryContourHeight - mouseHeight) < 0.5 * (spacing/(secondaryLinesCount+1.0))) {\n shouldHighlight = true;\n }\n\n // 颜色输出\n vec4 outColor;\n if(shouldHighlight) {\n outColor = czm_gammaCorrect(vec4(activeColor.rgb, activeColor.a));\n } else if(isMainContour) {\n float a = indexContourColor.a;\n if(!indexContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(indexContourColor.rgb, a));\n } else if(isSecondaryContour) {\n float a = supplementaryContourColor.a;\n if(!supplementaryContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(supplementaryContourColor.rgb, a));\n if(isHalfInterval) {\n float a = halfIntervalContourColor.a;\n if(!halfIntervalContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(halfIntervalContourColor.rgb, a));\n }\n if(isIntermediate) {\n float a = intermediateContourColor.a;\n if(!intermediateContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(intermediateContourColor.rgb, a));\n }\n } else {\n outColor = vec4(0.0);\n }\n\n if(materialInput.height<0.0) {\n outColor = vec4(0.0);\n }\n\n material.diffuse = outColor.rgb;\n material.alpha = outColor.a;\n return material;\n}\n",Ps=new Cesium.Material({fabric:{type:"ElevationContour",uniforms:{spacing:50,activeColor:Cesium.Color.fromCssColorString(Bs),mouseHeight:-1e5,mousePosition:new Cesium.Cartesian3(0,0,0),secondaryLinesCount:Ts,cameraHeight:0,indexContourShow:As,indexContourWidth:Ls,indexContourColor:Cesium.Color.fromCssColorString(Is),intermediateContourShow:js,intermediateContourWidth:Rs,intermediateContourColor:Cesium.Color.fromCssColorString(Fs),halfIntervalContourShow:zs,halfIntervalContourWidth:Hs,halfIntervalContourColor:Cesium.Color.fromCssColorString(Vs),supplementaryContourShow:Gs,supplementaryContourWidth:Ws,supplementaryContourColor:Cesium.Color.fromCssColorString(Us)}}})}function Qs(e,t,i){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,i)}function $s(e,t,i){return e.set(ta(e,t),i),i}function ea(e,t){return e.get(ta(e,t))}function ta(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}(Ms=document.createElement("div")).className="YJ-customize-active-height-elm",Ms.style.position="absolute",Ms.style.left="10px",Ms.style.top="10px",Ms.style.width="100px",Ms.style.textAlign="center",Ms.style.pointerEvents="none",Ms.style.color="#ff0000",Ms.style.display="none";var ia=new WeakMap,na=new WeakMap,oa=function(){return x()((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;k()(this,e),Qs(this,ia,null),Qs(this,na,{bgimg:null,img1:null,img2:null,img3:null,img4:null}),this.sdk=t,this.options=i,this.data={},this._webSocketCallback=n,this._tools=new vi(this.sdk),this.requestResource()}),[{key:"requestResource",value:function(){var e=this;this.options.host=this.options.host||p();var t;t=this.options.host+"/yjearth4.0/api/v1/gps/state",this.reconnecting=new ReconnectingWebSocket("ws://"+t,[],{maxReconnectAttempts:8}),this.reconnecting.onopen=function(t){e.reconnecting.onmessage=function(){var t=o()(a.a.mark((function t(i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.data=JSON.parse(i.data),!e.data||!e.data.rmc){t.next=7;break}return t.next=4,e._tools.getClampToHeight(e.data.rmc);case 4:n=t.sent,e.position=new Cesium.Cartesian3.fromDegrees(e.data.rmc.lng,e.data.rmc.lat,n),e.create();case 7:e._webSocketCallback&&e._webSocketCallback(e.data);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}}},{key:"create",value:function(){var e=this;if(this.getcanvas(),this.data&&this.data.rmc&&!this.entity){this.entity=new Cesium.CustomDataSource,this.sdk.viewer.dataSources.add(this.entity);var t=new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return e.position}),!1),billboard:{image:this._tools.getSourceRootPath()+"/img/locate2.png",scale:1,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ii()?void 0:1e8}),!1),width:31,height:36,pixelOffset:new Cesium.Cartesian2(0,-15)}}),i=new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return e.position}),!1),billboard:{image:new Cesium.CallbackProperty((function(){return e.lableCanvas})),scale:1,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ii()?void 0:1e8}),!1),width:220,height:140,pixelOffset:new Cesium.Cartesian2(0,-110)}});this.entity.entities.add(t),this.entity.entities.add(i)}}},{key:"loaded",value:function(e){var t;Object.defineProperty(this,"data",{get:function(){return t},set:function(i){t=i,e&&(e(),e=void 0)}})}},{key:"getcanvas",value:function(){var e=this,t=[{images:this._tools.getSourceRootPath()+"/img/bubble/lng.png",text:"经度:"+parseFloat(this.data.rmc.lng.toFixed(10))},{images:this._tools.getSourceRootPath()+"/img/bubble/lat.png",text:"纬度:"+parseFloat(this.data.rmc.lat.toFixed(10))},{images:this._tools.getSourceRootPath()+"/img/bubble/h.png",text:"海拔:"+parseFloat(this.data.rmc.alt.toFixed(10))},{images:this._tools.getSourceRootPath()+"/img/bubble/satellite.png",text:"卫星:"+this.data.satellites||!1}];if(ea(ia,this)){var i=ea(ia,this).getContext("2d");i.clearRect(0,0,ea(ia,this).width,ea(ia,this).height),i.drawImage(ea(na,this).bgimg,0,0,ea(ia,this).width,ea(ia,this).height);var n=0;t.forEach((function(o,s){i.drawImage(ea(na,e)["img"+(s+1)],12,12+26*s),i.fillStyle="#fff",i.font="16px Arial",i.fillText(o.text,44,28+26*s),++n===t.length&&(e.lableCanvas=ea(ia,e).toDataURL())}))}else{$s(ia,this,document.createElement("canvas"));var o=ea(ia,this).getContext("2d");ea(ia,this).width=220,ea(ia,this).height=140;var s=new Image;ea(na,this).bgimg=s,s.src=this._tools.getSourceRootPath()+"/img/bubble/bubble.png";var a=0;s.onload=function(){o.drawImage(s,0,0,ea(ia,e).width,ea(ia,e).height),t.forEach((function(i,n){var s=new Image;ea(na,e)["img"+(n+1)]=s,s.src=i.images,s.onload=function(){o.drawImage(s,12,12+26*n),o.fillStyle="#fff",o.font="16px Arial",o.fillText(i.text,44,28+26*n),++a===t.length&&(e.lableCanvas=ea(ia,e).toDataURL())}}))}}}},{key:"flyTo",value:(e=o()(a.a.mark((function e(){var t,i,n=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.length>0&&void 0!==n[0]?n[0]:{},!this.data||!this.data.rmc){e.next=9;break}return e.next=4,this._tools.getClampToHeight(this.data.rmc);case 4:i=e.sent,pi(0),ni(this.sdk),oi(this.sdk),this.sdk.viewer.camera.flyTo({orientation:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},destination:Cesium.Cartesian3.fromDegrees(this.data.rmc.lng,this.data.rmc.lat,i+(t.height||500))});case 9:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"remove",value:function(){$s(ia,this,null),$s(na,this,{}),this.reconnecting&&this.reconnecting.close(),this.sdk.viewer.dataSources.remove(this.entity),this.entity=null}},{key:"flicker",value:function(){}}]);var e}();var sa=i(9),aa=i.n(sa);function ra(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var la=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return k()(this,t),(i=ra(this,t,[e,n])).viewer=e.viewer,i.entityHasCreated=!1,i.event=null,i.tip=null,i.points_ids=[],i.color=n.color||"rgba(185,14,14,0.58)",i._is2D=o,i._sdk2D=Rt(),i}return un()(t,e),x()(t,[{key:"create_point",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.viewer,i=this.randomString();return t.entities.add(new Cesium.Entity({id:i,position:e,billboard:{image:this.getSourceRootPath()+"/img/point.png",color:Cesium.Color.WHITE.withAlpha(.99)}})),i}},{key:"remove_entity",value:function(e){this.viewer.entities.removeById(e),!this._is2D&&this._sdk2D&&this._sdk2D.viewer&&this._sdk2D.viewer.entities&&this._sdk2D.viewer.entities.removeById(e)}},{key:"start",value:function(){}},{key:"end",value:function(){var e=this;YJ.Measure.SetMeasureStatus(!1),this.entityHasCreated=!1,this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy(),this.tip&&this.tip.destroy(),this.points_ids.forEach((function(t){e.remove_entity(t)}))}}])}(vi);function ca(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 ua(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ca(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ca(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function ha(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var pa=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=ha(this,t,[e,n])).color=n.color||"rgba(255,0,0,0.5)",i.polygonHasCreated=!1,i}return un()(t,e),x()(t,[{key:"start",value:function(e){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var l;this.polygonHasCreated=!1,(i=t,n="start",o=this,s=3,a=aa()(ln()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(e){return a.apply(o,e)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Q("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new K(this.sdk),this.positions=[],this.points_ids=[];var c=[],u=[];this.event.mouse_left((function(e,i){if("2D"!==l){if(l="3D",r.positions=c.concat(ua({},i)),r.tip.setPosition(i,e.position.x,e.position.y),!r.polygonHasCreated){var n=t.create_polygon(r);r.points_ids.push(n)}c.push(i),u.push(r.cartesian3Towgs84(i,r.viewer)),r.points_ids.push(r.create_point(i))}})),this.event.mouse_right((function(t,i){"2D"!==l&&(e(null,u),r.end())})),this.event.mouse_move((function(e,t){"2D"!==l&&(r.positions=c.concat(ua({},t)),r.tip.setPosition(t,e.endPosition.x,e.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(e,t){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop(),r.positions=c.concat(cartesian))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)e(null,u),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=t.create_polygon(r);r.points_ids.push(s)}c.push(n),u.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n)),r.positions=c.concat(n)}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new K(this._sdk2D),this.event2D.mouse_left((function(e,i){if("3D"!==l){if(l="2D",r.positions=c.concat(ua({},i)),r.tip.setPosition(i,e.position.x+r.viewer.canvas.width,e.position.y),!r.polygonHasCreated){var n=t.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(n)}c.push(i),u.push(r.cartesian3Towgs84(i,r.viewer)),r.points_ids.push(r.create_point(i,r._sdk2D.viewer))}})),this.event2D.mouse_right((function(t,i){"3D"!==l&&(e(null,u),r.end())})),this.event2D.mouse_move((function(e,t){"3D"!==l&&(r.positions=c.concat(ua({},t)),r.tip.setPosition(t,e.endPosition.x+r.viewer.canvas.width,e.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(e,t){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop(),r.positions=c.concat(cartesian))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)e(null,u),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=t.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(s)}c.push(n),u.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),r.positions=c.concat(n)}}))}})))}}}],[{key:"create_polygon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.viewer;e.polygonHasCreated=!0;var i=e.randomString();return t.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(t){return new Cesium.PolygonHierarchy(e.positions)})),material:Cesium.Color.fromCssColorString(e.color),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(t){return e.positions.concat(e.positions[0])})),width:3,material:Cesium.Color.fromCssColorString(e.color).withAlpha(1),clampToGround:!0,zIndex:99999999}})),i}}])}(la),da=function(){return x()((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,e),this.sdk=t,this.viewer=t.viewer,this.height=i.height||70,this.maxHeigh=-1e6,this.precision=i.precision||125,this.Dialog=n,this.result={allArea:"",cutArea:"",cutVolume:"",fillArea:"",fillVolume:"",noArea:""},this.entities=[],this.tools=new vi(this.sdk),this.Draw=new pa(this.sdk),YJ.Analysis.AnalysesResults.push(this)}),[{key:"create",value:function(){var e=this;this.clean(),this.Draw.start((function(t,i){if(!i||i.length<3){e.tools.message({text:"最少需要三个坐标!",type:"warning"})}else{for(var n=[],o=0;o<i.length;o++)n.push(i[o].lng,i[o].lat,i[o].alt);e.positions=Cesium.Cartesian3.fromDegreesArrayHeights(n),e.createPolygonGeo(e.positions),e.result=e.VolumeAnalysis(),e.viewer.scene.screenSpaceCameraController.enableCollisionDetection=!1,e.clickCallBack()}}))}},{key:"createPolygonGeo",value:function(e){var t=Math.PI/Math.pow(2,11);t/=this.precision;var i=new Cesium.PolygonGeometry.fromPositions({positions:e,vertexFormat:Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:t});this.geom=new Cesium.PolygonGeometry.createGeometry(i)}},{key:"VolumeAnalysis",value:function(){var e=0,t=0,i=0,n=0,o=0,s=this.geom.indices;if(this.geom&&this.geom.attributes&&this.geom.attributes.position){for(var a=this.geom.attributes.position.values,r=0;r<s.length;r+=3){var l=this.returnPosition(a,s[r]),c=this.returnPosition(a,s[r+1]),u=this.returnPosition(a,s[r+2]),h=this.viewer.entities.add({name:"三角面",polygon:{hierarchy:[l.heightPos,c.heightPos,u.heightPos],perPositionHeight:!0,material:Cesium.Color.fromRandom(),extrudedHeight:this.height,outline:!0,outlineColor:Cesium.Color.BLACK}});this.entities.push(h);var p=this.computeArea4Triangle(l.noHeightPos,c.noHeightPos,u.noHeightPos),d=(l.height+c.height+u.height)/3;if(d<this.height)i+=p,n+=p*(this.height-d);else if(d==this.height)o+=p;else{e+=p,t+=p*(d-this.height)}}var m=e+i+o;return this.result.allArea=m,this.result.cutArea=e,this.result.cutVolume=t,this.result.fillArea=i,this.result.fillVolume=n,this.result.noArea=o,this.result}}},{key:"computeCentroid4Polygon",value:function(e){for(var t=[],i=[],n=0,o=0,s=0;s<e.length;s++){var a=Cesium.Cartographic.fromCartesian(e[s]);n+=a.longitude,o+=a.latitude,t.push(a.longitude),i.push(a.latitude)}var r=n/e.length,l=o/e.length,c=new Cesium.Cartographic(r,l);return Cesium.Cartesian3.fromRadians(c.longitude,c.latitude,this.maxHeigh+30)}},{key:"computeArea4Triangle",value:function(e,t,i){var n=Cesium.Cartesian3.distance(e,t),o=Cesium.Cartesian3.distance(t,i),s=Cesium.Cartesian3.distance(i,e),a=(n+o+s)/2;return Math.sqrt(a*(a-n)*(a-o)*(a-s))}},{key:"returnPosition",value:function(e,t){var i=new Cesium.Cartesian3(e[3*t],e[3*t+1],e[3*t+2]),n=Cesium.Cartographic.fromCartesian(i),o=this.viewer.scene.sampleHeightSupported?this.viewer.scene.sampleHeight(n):this.viewer.scene.globe.getHeight(n);return o>this.maxHeigh&&(this.maxHeigh=o),{heightPos:Cesium.Cartesian3.fromRadians(n.longitude,n.latitude,o),noHeightPos:Cesium.Cartesian3.fromRadians(n.longitude,n.latitude,0),height:o}}},{key:"heights",get:function(){return this.height},set:function(e){this.height=e}},{key:"precisions",get:function(){return this.precision},set:function(e){this.precision=e}},{key:"allArea",get:function(){return Number(this.result.allArea.toFixed(4))},set:function(e){this.result.allArea=e}},{key:"fillArea",get:function(){return Number(this.result.fillArea.toFixed(4))},set:function(e){this.result.fillArea=e}},{key:"fillVolume",get:function(){return Number(this.result.fillVolume.toFixed(4))},set:function(e){this.result.fillVolume=e}},{key:"cutArea",get:function(){return Number(this.result.cutArea.toFixed(4))},set:function(e){this.result.cutArea=e}},{key:"cutVolume",get:function(){return Number(this.result.cutVolume.toFixed(4))},set:function(e){this.result.cutVolume=e}},{key:"noArea",get:function(){return Number(this.result.noArea.toFixed(4))},set:function(e){this.result.noArea=e}},{key:"onEnd",get:function(){return this.clickCallBack},set:function(e){e&&"function"!=typeof e?console.error("val:",e,"不是一个function"):this.clickCallBack=e}},{key:"clean",value:function(){this.Draw&&this.Draw.end();for(var e=0;e<this.entities.length;e++)this.viewer.entities.remove(this.entities[e])}},{key:"destroy",value:function(){this.clean(),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null)}}],[{key:"EditBox",value:(e=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t._DialogObject&&t._DialogObject.close&&(t._DialogObject.close(),t._DialogObject=null),e.next=3,new J(t.sdk.viewer._container,{title:"土方分析",left:"180px",top:"100px",closeCallBack:function(){t.clean(),t.Dialog.closeCallBack&&t.Dialog.closeCallBack()}});case 3:return t._DialogObject=e.sent,e.next=6,t._DialogObject.init();case 6:(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">绘制分析区域</span>\n <button class="draw-btn"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>开始绘制</button>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">基准高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-999999" max="999999" name="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">精度</span>\n <div class="input-number input-number-unit">\n <input class="input" type="number" title="" min="1" max="1250" name="precision">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 74px;">总分析面积:</span>\n <span class="text-number" name="allArea">0</span>\n <span class="unit text-number">m²</span>\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 90px;">无须填挖面积:</span>\n <span class="text-number" name="noArea">0</span>\n <span class="unit text-number">m²</span>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 74px;">填方面积:</span>\n <span class="text-number" name="fillArea">0</span>\n <span class="unit text-number">m²</span>\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 90px;">挖方面积:</span>\n <span class="text-number" name="cutArea">0</span>\n <span class="unit text-number">m²</span>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 74px;">填方体积:</span>\n <span class="text-number" name="fillVolume">0</span>\n <span class="unit text-number">m³</span>\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 90px;">挖方体积:</span>\n <span class="text-number" name="cutVolume">0</span>\n <span class="unit text-number">m³</span>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',t._DialogObject.contentAppChild(i),t._DialogObject._element.body.className=t._DialogObject._element.body.className+" cut-fill",(n=i.querySelector("input[name='height']")).value=t.height,n.addEventListener("blur",(function(e){var i=e.target.value;"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),n.value=i,t.height=n.value)})),(o=i.querySelector("input[name='precision']")).value=t.precision,o.addEventListener("blur",(function(e){var i=Number(e.target.value);e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),o.value=i,t.precision=o.value})),(s=i.querySelector("span[name='allArea']")).innerHTML=t.result.allArea||0,Object.defineProperty(t.result,"allArea",{get:function(){return s.innerHTML},set:function(e){s.innerHTML=Number(e.toFixed(4))}}),(r=i.querySelector("span[name='fillArea']")).innerHTML=t.result.fillArea||0,Object.defineProperty(t.result,"fillArea",{get:function(){return r.innerHTML},set:function(e){r.innerHTML=Number(e.toFixed(4))}}),(l=i.querySelector("span[name='fillVolume']")).innerHTML=t.result.fillVolume||0,Object.defineProperty(t.result,"fillVolume",{get:function(){return l.innerHTML},set:function(e){l.innerHTML=Number(e.toFixed(4))}}),(c=i.querySelector("span[name='cutArea']")).innerHTML=t.result.cutArea||0,Object.defineProperty(t.result,"cutArea",{get:function(){return c.innerHTML},set:function(e){c.innerHTML=Number(e.toFixed(4))}}),(u=i.querySelector("span[name='cutVolume']")).innerHTML=t.result.cutVolume||0,Object.defineProperty(t.result,"cutVolume",{get:function(){return u.innerHTML},set:function(e){u.innerHTML=Number(e.toFixed(4))}}),(h=i.querySelector("span[name='noArea']")).innerHTML=t.result.noArea||0,Object.defineProperty(t.result,"noArea",{get:function(){return h.innerHTML},set:function(e){h.innerHTML=Number(e.toFixed(4))}}),i.getElementsByClassName("draw-btn")[0].addEventListener("click",(function(){t.create()}));case 36:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)})}]);var e}();function ma(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return fa(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)?fa(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function fa(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 va(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var ga=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(i=va(this,t,[e,n])).sdk=e,i.options={},i.options.name=n.name,i.options.risingSpeed=1,i.options.minWaterLevel=0,i.options.maxWaterLevel=0,i.options.waterVolume=0,i.currentWaterLaver,i.color="#00d9ff66",i.Dialog=o,i.Draw=new pa(i.sdk),i.positions,i.status=!0,i.area=0,i._elms={},i.tools=new vi(i.sdk),YJ.Analysis.AnalysesResults.push(i),i}return un()(t,e),x()(t,[{key:"draw",value:function(){t.create(this)}},{key:"onEnd",get:function(){return this.clickCallBack},set:function(e){e&&"function"!=typeof e?console.error("val:",e,"不是一个function"):this.clickCallBack=e}},{key:"waterLevels",get:function(){return this.waterLevel},set:function(e){this.waterLevel=e}},{key:"waterVolume",get:function(){return this.options.waterVolume},set:function(e){this.options.waterVolume=e}},{key:"minWaterLevel",get:function(){return this.options.minWaterLevel},set:function(e){this.options.minWaterLevel=e,this.currentWaterLaver=this.options.minWaterLevel}},{key:"maxWaterLevel",get:function(){return this.options.maxWaterLevel},set:function(e){this.options.maxWaterLevel=e}},{key:"risingSpeed",get:function(){return this.options.risingSpeed},set:function(e){this.options.risingSpeed=e}},{key:"areas",get:function(){return this.area},set:function(e){this.area=e}},{key:"move",value:function(){var e=this;this.TweenAnimate&&TWEEN.remove(this.TweenAnimate);var t=(this.options.maxWaterLevel-this.options.minWaterLevel)/this.options.risingSpeed*1e3;this.TweenAnimate=new TWEEN.Tween({waterLevel:this.options.minWaterLevel}).to({waterLevel:this.options.maxWaterLevel},t).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(function(){var t=o()(a.a.mark((function t(i,n){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.currentWaterLaver=i.waterLevel;case 1:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}()).start()}},{key:"restart",value:function(){var e=this;this.currentWaterLaver=this.options.minWaterLevel;var t=!1;this.TweenAnimate&&(t=this.TweenAnimate._isPaused,TWEEN.remove(this.TweenAnimate));var i=(this.options.maxWaterLevel-this.options.minWaterLevel)/this.options.risingSpeed*1e3;this.TweenAnimate=new TWEEN.Tween({waterLevel:this.options.minWaterLevel}).to({waterLevel:this.options.maxWaterLevel},i).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(function(){var t=o()(a.a.mark((function t(i,n){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.currentWaterLaver=i.waterLevel;case 1:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}()).start(),t&&this.pause()}},{key:"start",value:function(){this.TweenAnimate&&this.TweenAnimate.resume()}},{key:"pause",value:function(){this.TweenAnimate&&this.TweenAnimate.pause()}},{key:"calculateVolumeHeight",value:function(){that.options.maxWaterLevel}},{key:"flyTo",value:function(){if(this.positions&&0!==this.positions.length){ni(this.sdk),oi(this.sdk);for(var e=[],t=0;t<this.positions.length;t++){var i=Cesium.Cartesian3.fromDegrees(this.positions[t].lng,this.positions[t].lat,this.options.maxWaterLevel);e.push(i.x,i.y,i.z)}var n=Cesium.BoundingSphere.fromVertices(e);this.sdk.viewer.camera.flyToBoundingSphere(n,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}})}}},{key:"destroy",value:function(){this.TweenAnimate&&TWEEN.remove(this.TweenAnimate),this.Draw&&this.Draw.end(),this.sdk.viewer.entities.remove(this.entity),this.entity=null}}],[{key:"create",value:function(e){e.Draw.start((function(t,i){if(!i||i.length<3){e.tools.message({text:"至少需要三个坐标!",type:"warning"})}else{if(e.destroy(),!i||0==i.length)return e.positions=[],e._positions=[],e.options.minWaterLevel=0,e.options.maxWaterLevel=0,e.options.waterVolume=0,void(e.area=0);var n=[];e.positions=i,e._positions=i,e.options.minWaterLevel=i[0].alt;for(var o=0;o<i.length;o++)e.options.minWaterLevel>i[o].alt&&(e.options.minWaterLevel=i[o].alt),n.push(i[o].lng,i[o].lat);e.options.maxWaterLevel=i[0].alt;for(var s=0;s<i.length;s++)e.options.minWaterLevel<i[s].alt&&(e.options.maxWaterLevel=i[s].alt);var a=Cesium.Cartesian3.fromDegreesArray(n);e.currentWaterLaver=e.options.minWaterLevel,e.entity=e.sdk.viewer.entities.add({polygon:{hierarchy:new Cesium.PolygonHierarchy(a),height:new Cesium.CallbackProperty((function(){return e.options.minWaterLevel}),!1),extrudedHeight:new Cesium.CallbackProperty((function(){return e.currentWaterLaver}),!1),material:Cesium.Color.fromCssColorString(e.color)}}),e.area=e.computeArea(i),e.TweenAnimate&&(TWEEN.remove(e.TweenAnimate),e.TweenAnimate=null),e.waterLevel=e.options.maxWaterLevel-e.options.minWaterLevel,e.options.waterVolume=Number((e.waterLevel*e.area).toFixed(4)),e.clickCallBack(e.area,e._positions)}}))}},{key:"EditBox",value:(i=o()(a.a.mark((function e(i){var n,o,s,r,l,c,u,h,p,d,m;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),e.next=3,new J(i.sdk.viewer._container,{title:"淹没分析",left:"180px",top:"100px",closeCallBack:function(){i.destroy(),i.Dialog.closeCallBack&&i.Dialog.closeCallBack()}});case 3:return i._DialogObject=e.sent,e.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" submerge",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">水量</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" name="waterVolume">\n <span class="unit">m³</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最小水位</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" name="minWaterLevel">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">水面面积</span>\n <div class="input-number input-number-unit-3">\n <input class="input area" type="number" readonly="readonly" type="text">\n <span class="unit">㎡</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最大水位</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" name="maxWaterLevel">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row subtitle-box">\n <span class="subtitle">上升速度</span>\n </div>\n <div class="row">\n <div class="col">\n <input type="range" max="50" min="0" step="0.01" name="risingSpeed">\n <div class="input-number input-number-unit-3" style="flex: 0 0 110px;margin-left: 10px;">\n <input class="input" type="number" title="" name="risingSpeed">\n <span class="unit">m/s</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col operate-btn-box">\n <button class="draw"><svg class="icon-draw"><use xlink:href="#yj-icon-draw"></use></svg>绘制范围</button>\n <button class="flyto"><svg class="icon-positions"><use xlink:href="#yj-icon-positions"></use></svg>定位</button>\n <button class="reset"><svg class="icon-reset"><use xlink:href="#yj-icon-reset"></use></svg>重置</button>\n <button class="analog"><svg class="icon-play"><use xlink:href="#yj-icon-play"></use></svg>开始模拟</button>\n <button class="pause" style="margin-right: 0px;"><svg class="icon-pause"><use xlink:href="#yj-icon-pause"></use></svg>暂停</button>\n <button class="start" style="display: none;margin-right: 0px;"><svg class="icon-play"><use xlink:href="#yj-icon-play"></use></svg>播放</button>\n </div>\n </div>\n </div>\n \n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">序号</div>\n <div class="th">经度</div>\n <div class="th">纬度</div>\n <div class="th">高程</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n <span class="custom-divider" style="margin-top: 20px;"></span>\n ',i._DialogObject.contentAppChild(n),(o=document.createElement("button")).className="el-button",o.innerHTML="暂停",o.style.width="80px",n.getElementsByClassName("draw")[0].addEventListener("click",(function(){t.create(i)})),n.getElementsByClassName("analog")[0].addEventListener("click",(function(){i.move()})),n.getElementsByClassName("flyto")[0].addEventListener("click",(function(){i.flyTo()})),n.getElementsByClassName("reset")[0].addEventListener("click",(function(){i.restart()})),s=n.getElementsByClassName("pause")[0],r=n.getElementsByClassName("start")[0],s.addEventListener("click",(function(){i.pause(),s.style.display="none",r.style.display="flex"})),r.addEventListener("click",(function(){i.start(),r.style.display="none",s.style.display="flex"})),(l=n.querySelectorAll("input[name='risingSpeed']"))[0].value=i.options.risingSpeed,l[1].value=i.options.risingSpeed,l[0].addEventListener("input",(function(e){i.options.risingSpeed=Number(e.target.value)})),l[1].addEventListener("input",(function(e){if("."!=e.data){var t=Number(e.target.value),n=Number(l[0].max),o=Number(l[0].min);i.options.risingSpeed=t>n?n:t<o?o:Math.floor(100*t)/100}})),Object.defineProperty(i.options,"risingSpeed",{get:function(){return l[0].value},set:function(e){l[0].value=e,l[1].value=e}}),i.waterLevel=i.options.maxWaterLevel-i.options.minWaterLevel,(c=n.querySelector("input[name='minWaterLevel']")).value=i.options.minWaterLevel,c.addEventListener("input",(function(e){if("."!=e.data){var t=Number(e.target.value);t>999999999&&(t=999999999),t<0&&(t=0),i.options.minWaterLevel=Math.floor(1e4*t)/1e4,i.options.maxWaterLevel=i.options.minWaterLevel+i.waterLevel}})),Object.defineProperty(i.options,"minWaterLevel",{get:function(){return Number(c.value)},set:function(e){c.value=Math.floor(1e4*Number(e))/1e4}}),(u=n.querySelector("input[name='maxWaterLevel']")).value=i.options.maxWaterLevel,u.addEventListener("input",(function(e){if("."!=e.data){var t=Number(e.target.value);t>999999999&&(t=999999999),t<0&&(t=0),t<i.options.minWaterLevel?i.options.maxWaterLevel=i.options.minWaterLevel:i.options.maxWaterLevel=Math.floor(1e4*t)/1e4,i.waterLevel=i.options.maxWaterLevel-i.options.minWaterLevel,i.options.waterVolume=Number((i.waterLevel*i.area).toFixed(4))}})),Object.defineProperty(i.options,"maxWaterLevel",{get:function(){return Number(u.value)},set:function(e){isNaN(e)&&(e=0),u.value=Math.floor(1e4*Number(e))/1e4}}),(h=n.querySelector("input[name='waterVolume']")).value=i.options.waterVolume,h.addEventListener("input",(function(e){if("."!=e.data){var t=Number(e.target.value);t>99999999999999&&(t=99999999999999),t<0&&(t=0),i.options.waterVolume=Math.floor(1e4*t)/1e4,i.area&&(i.waterLevel=Number((i.options.waterVolume/i.area).toFixed(4)),i.options.maxWaterLevel=i.options.minWaterLevel+i.waterLevel)}})),Object.defineProperty(i.options,"waterVolume",{get:function(){return Number(h.value)},set:function(e){h.value=e}}),(p=n.getElementsByClassName("area")[0]).value=i.area,Object.defineProperty(i,"area",{get:function(){return Number(p.value)},set:function(e){p.value=e,i.waterLevel=Number((i.options.waterVolume/i.area).toFixed(4)),i.options.maxWaterLevel=i.options.minWaterLevel+i.waterLevel}}),d=n.getElementsByClassName("table-body")[0],m=n.getElementsByClassName("table-empty")[0],Object.defineProperty(i,"positions",{get:function(){return i._positions},set:function(e){if(e&&e.length>0){m.style.display="none";for(var t="",i=0;i<e.length;i++)t+='<div class="tr">\n <div class="td">'.concat(i+1,'</div>\n <div class="td">').concat(Number(e[i].lng.toFixed(10)),'</div>\n <div class="td">').concat(Number(e[i].lat.toFixed(10)),'</div>\n <div class="td">').concat(Number(e[i].alt.toFixed(4)),"</div>\n </div>");d.innerHTML=t}else d.innerHTML="",m.style.display="flex"}});case 51:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"EventBinding",value:function(e,t){for(var i=function(){var i=[],o=!1,s=[];if(!t[n]||!t[n].attributes)return 1;var a,r=ma(t[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==t[n].type?(i.push((function(t){e[r.value]=t.target.checked})),t[n].checked=e[r.value]):(i.push((function(t){var i=t.target.value;"number"==t.target.type&&(i=Number(i)),e[r.value]=i})),"IMG"==t[n].nodeName?t[n].src=e[r.value]:t[n].value=e[r.value]),e._elms[r.value]?e._elms[r.value].push(t[n]):e._elms[r.value]=[t[n]],s.push(r.name);break;case"@click":t[n].addEventListener("click",(function(t){"function"==typeof e[r.value]&&e[r.value](t)})),s.push(r.name);break;case"@change":o=!0,i.push((function(t){var i=t.target.value;"number"==t.target.type&&""!=i&&(i=Number(i),t.target.value=i),"function"==typeof e[r.value]&&e[r.value](t,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(e){r.e(e)}finally{r.f()}for(var c=0;c<s.length;c++)t[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==t[n].tagName&&"checkbox"!=t[n].type||(u="change"),t[n].addEventListener(u,(function(e){for(var t=0;t<i.length;t++)i[t](e)}))}},n=0;n<t.length;n++)i()}}]);var i}(vi);function ya(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 ba(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ya(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ya(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Ca(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var wa=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(i=Ca(this,t,[e,n])).viewer=e.viewer,i.options={},i.options.viewPosition=n.viewPosition,i.options.viewPositionEnd=n.viewPositionEnd,i.options.horizontalViewAngle=n.horizontalViewAngle||0===n.horizontalViewAngle?n.horizontalViewAngle:90,i.options.verticalViewAngle=n.verticalViewAngle||0===n.verticalViewAngle?n.verticalViewAngle:60,i.options.visibleAreaColor=n.visibleAreaColor||"#008000",i.options.invisibleAreaColor=n.invisibleAreaColor||"#FF0000",i._elms={},i.viewPointHeight=n.viewPointHeight,i.ids=[],i.Dialog=o,i.tools=new vi(i.sdk),i._EventBinding=new xn,i.html=null,YJ.Analysis.AnalysesResults.push(i),i}return un()(t,e),x()(t,[{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(e){var t=Math.floor(10*Number(e))/10;isNaN(t)&&(t=1.8),t<0&&(t=0),this.options.viewPointHeight=t,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(e){e.value=t}))}},{key:"viewPosition",get:function(){return this.options.viewPosition},set:function(e){this.options.viewPosition=e,this.ids[0]&&(this.viewer.entities.getById(this.ids[0]).position=new Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt)),this.update()}},{key:"viewPositionEnd",get:function(){return this.options.viewPositionEnd},set:function(e){this.options.viewPositionEnd=e,this.ids[1]&&(this.viewer.entities.getById(this.ids[1]).position=new Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt)),this.update()}},{key:"horizontalViewAngle",get:function(){return this.options.horizontalViewAngle},set:function(e){if(this.options.horizontalViewAngle=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content){var t=this._DialogObject._element.content;t.querySelector("input[name='horizontalViewAngle']").value=e,t.getElementsByClassName("range-node-active")[0].getElementsByClassName("range-node-active-text")[0].innerHTML=e+"°",t.getElementsByClassName("range-process")[0].style.width=e/180*100+"%"}this.update()}},{key:"horizontalViewAngles",get:function(){return this.horizontalViewAngle},set:function(e){this.horizontalViewAngle=e}},{key:"visibleAreaColor",get:function(){return this.options.visibleAreaColor},set:function(e){this.options.visibleAreaColor=e,this.update()}},{key:"invisibleAreaColor",get:function(){return this.options.invisibleAreaColor},set:function(e){this.options.invisibleAreaColor=e,this.update()}},{key:"verticalViewAngle",get:function(){return this.options.verticalViewAngle},set:function(e){this.options.verticalViewAngle=e,this.update()}},{key:"viewDistance",get:function(){if(this.options.viewPosition){var e=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),t=Cesium.Cartesian3.fromDegrees(this.options.viewPositionEnd.lng,this.options.viewPositionEnd.lat,this.options.viewPositionEnd.alt);return Cesium.Cartesian3.distance(e,t)}}},{key:"viewHeading",get:function(){var e,t,i,n,o=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),s=Cesium.Cartesian3.fromDegrees(this.options.viewPositionEnd.lng,this.options.viewPositionEnd.lat,this.options.viewPositionEnd.alt);return e=o,t=s,i=new Cesium.Cartesian3,n=Cesium.Transforms.eastNorthUpToFixedFrame(e),Cesium.Matrix4.inverse(n,n),Cesium.Matrix4.multiplyByPoint(n,t,i),Cesium.Cartesian3.normalize(i,i),Cesium.Math.toDegrees(Math.atan2(i.x,i.y))}},{key:"viewPitch",get:function(){var e,t,i,n,o=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),s=Cesium.Cartesian3.fromDegrees(this.options.viewPositionEnd.lng,this.options.viewPositionEnd.lat,this.options.viewPositionEnd.alt);return e=o,t=s,i=new Cesium.Cartesian3,n=Cesium.Transforms.eastNorthUpToFixedFrame(e),Cesium.Matrix4.inverse(n,n),Cesium.Matrix4.multiplyByPoint(n,t,i),Cesium.Cartesian3.normalize(i,i),Cesium.Math.toDegrees(Math.asin(i.z))}},{key:"end",value:function(){var e=this;this.ids.forEach((function(t){var i=e.viewer.entities.getById(t);i&&(i.show=!1)})),YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=null,this.event=null}},{key:"draw",value:function(){t.create(this)}},{key:"add",value:function(){this.options.viewPositionEnd&&(this.createLightCamera(),this.createShadowMap(),this.createPostStage(),this.drawSketch(),t.getcanvas(this))}},{key:"update",value:function(){this.clear(),this.add()}},{key:"clear",value:function(){YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=null,this.event=null,this.sketch&&(this.viewer.entities.removeById(this.sketch.id),this.sketch=null),this.frustumOutline&&(this.viewer.entities.removeById(this.frustumOutline.id),this.frustumOutline=null),this.postStage&&(this.viewer.scene.postProcessStages.remove(this.postStage),this.postStage=null)}},{key:"destroy",value:function(){var e=this;this.clear(),this.editevent&&this.editevent.destroy(),this.ControllerObject&&this.ControllerObject.destroy(),this.ids.forEach((function(t){e.viewer.entities.removeById(t)})),this.ids=[],this.viewBillboardPrimitive&&this.viewer.scene.primitives.remove(this.viewBillboardPrimitive),this.viewBillboardPrimitive=null,this.options.viewPosition=null,this.options.viewPositionEnd=null,YJ.Measure.SetMeasureStatus(!1),this._originalShadowMap&&(this.viewer.scene.shadowMap=this._originalShadowMap,this._originalShadowMap=null),this.viewer.shadows=this.viewer._shadows}},{key:"close",value:function(){var e=this;YJ.Measure.SetMeasureStatus(!1),this.end(),this.editevent&&this.editevent.destroy(),this.ControllerObject&&this.ControllerObject.destroy(),this.ids.forEach((function(t){e.viewer.entities.removeById(t)}))}},{key:"nodeEdit",value:function(){var e,t=this;YJ.Measure.GetMeasureStatus()?this.tools.message({text:"上一次测量未结束",type:"warning"}):(this.editevent&&this.editevent.destroy(),this.ids.forEach((function(e){t.viewer.entities.getById(e).show=!0})),YJ.Measure.SetMeasureStatus(!0),this.editevent=new K(this.sdk),this.editevent.mouse_left((function(i,n){var o=t.viewer.scene.pick(i.position);o&&o.id&&o.id.id&&-1!=t.ids.indexOf(o.id.id)&&(!e||e.id!=o.id.id)&&(e=o.id,t.viewer.entities.getById(t.ids[0]).position=new Cesium.Cartesian3.fromDegrees(t.viewPosition.lng,t.viewPosition.lat,t.viewPosition.alt),t.viewer.entities.getById(t.ids[1]).position=new Cesium.Cartesian3.fromDegrees(t.viewPositionEnd.lng,t.viewPositionEnd.lat,t.viewPositionEnd.alt),t.ControllerObject&&t.ControllerObject.destroy(),t.ControllerObject=new Ho(t.sdk,{position:ba({},t.cartesian3Towgs84(e.position._value,t.sdk.viewer))}),t.ControllerObject.controllerCallBack=function(i,n){i.position.alt<0&&(i.position.alt=0),e.position=new Cesium.Cartesian3.fromDegrees(i.position.lng,i.position.lat,i.position.alt),n&&(0==t.ids.indexOf(o.id.id)?t.viewPosition=i.position:t.viewPositionEnd=i.position,YJ.Measure.SetMeasureStatus(!0))},t.ControllerObject.editTranslational())})),this.editevent.mouse_right((function(i,n){YJ.Measure.SetMeasureStatus(!1),t.editevent&&t.editevent.destroy(),t.ControllerObject&&t.ControllerObject.destroy(),t.ids.forEach((function(e){t.viewer.entities.getById(e).show=!1})),e=null})),this.editevent.mouse_move((function(e,t){})),this.editevent.gesture_pinck_start((function(i,n){var o=new Date;t.editevent.gesture_pinck_end((function(){new Date-o>=500&&(YJ.Measure.SetMeasureStatus(!1),t.editevent&&t.editevent.destroy(),t.ControllerObject&&t.ControllerObject.destroy(),t.ids.forEach((function(e){t.viewer.entities.getById(e).show=!1})),e=null)}))})))}},{key:"createLightCamera",value:function(){if(this.options.viewPosition){this.lightCamera=new Cesium.Camera(this.viewer.scene),this.lightCamera.position=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),this.lightCamera.frustum.near=.001*this.viewDistance,this.lightCamera.frustum.far=this.viewDistance;var e=Cesium.Math.toRadians(this.horizontalViewAngle),t=Cesium.Math.toRadians(this.verticalViewAngle),i=this.viewDistance*Math.tan(e/2)*2/(this.viewDistance*Math.tan(t/2)*2);this.lightCamera.frustum.aspectRatio=i,this.lightCamera.frustum.fov=e>t?e:t,this.lightCamera.setView({destination:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:{heading:Cesium.Math.toRadians(this.viewHeading||0),pitch:Cesium.Math.toRadians(this.viewPitch||0),roll:0}})}}},{key:"createShadowMap",value:function(){this.shadowMap=new Cesium.ShadowMap({context:this.viewer.scene.context,lightCamera:this.lightCamera,enabled:!0,isPointLight:!0,pointLightRadius:this.viewDistance,cascadesEnabled:!1,size:2048,softShadows:!0,normalOffset:!1,fromLightSource:!1}),this._originalShadowMap||(this._originalShadowMap=this.viewer.scene.shadowMap),this.viewer.scene.shadowMap=this.shadowMap}},{key:"createPostStage",value:function(){var e=this;Number(Cesium.VERSION.split(".")[1])>=102&&kn()("fs");var t=new Cesium.PostProcessStage({fragmentShader:"\n #define USE_CUBE_MAP_SHADOW true\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n varying vec2 v_textureCoordinates;\n uniform mat4 camera_projection_matrix;\n uniform mat4 camera_view_matrix;\n uniform samplerCube shadowMap_textureCube;\n uniform mat4 shadowMap_matrix;\n uniform vec4 shadowMap_lightPositionEC;\n uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness;\n uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth;\n uniform float helsing_viewDistance;\n uniform vec4 helsing_visibleAreaColor;\n uniform vec4 helsing_invisibleAreaColor;\n\n struct zx_shadowParameters\n {\n vec3 texCoords;\n float depthBias;\n float depth;\n float nDotL;\n vec2 texelStepSize;\n float normalShadingSmooth;\n float darkness;\n };\n\n float czm_shadowVisibility(samplerCube shadowMap, zx_shadowParameters shadowParameters)\n {\n float depthBias = shadowParameters.depthBias;\n float depth = shadowParameters.depth;\n float nDotL = shadowParameters.nDotL;\n float normalShadingSmooth = shadowParameters.normalShadingSmooth;\n float darkness = shadowParameters.darkness;\n vec3 uvw = shadowParameters.texCoords;\n depth -= depthBias;\n float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\n return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n }\n\n vec4 getPositionEC(){\n return czm_windowToEyeCoordinates(gl_FragCoord);\n }\n\n vec3 getNormalEC(){\n return vec3(1.);\n }\n\n vec4 toEye(in vec2 uv,in float depth){\n vec2 xy=vec2((uv.x*2.-1.),(uv.y*2.-1.));\n vec4 posInCamera=czm_inverseProjection*vec4(xy,depth,1.);\n posInCamera=posInCamera/posInCamera.w;\n return posInCamera;\n }\n\n vec3 pointProjectOnPlane(in vec3 planeNormal,in vec3 planeOrigin,in vec3 point){\n vec3 v01=point-planeOrigin;\n float d=dot(planeNormal,v01);\n return(point-planeNormal*d);\n }\n\n float getDepth(in vec4 depth){\n float z_window=czm_unpackDepth(depth);\n z_window=czm_reverseLogDepth(z_window);\n float n_range=czm_depthRange.near;\n float f_range=czm_depthRange.far;\n return(2.*z_window-n_range-f_range)/(f_range-n_range);\n }\n\n float shadow(in vec4 positionEC){\n vec3 normalEC=getNormalEC();\n zx_shadowParameters shadowParameters;\n shadowParameters.texelStepSize=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;\n shadowParameters.depthBias=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;\n shadowParameters.normalShadingSmooth=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;\n shadowParameters.darkness=shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;\n vec3 directionEC=positionEC.xyz-shadowMap_lightPositionEC.xyz;\n float distance=length(directionEC);\n directionEC=normalize(directionEC);\n float radius=shadowMap_lightPositionEC.w;\n if(distance>radius)\n {\n return 2.0;\n }\n vec3 directionWC=czm_inverseViewRotation*directionEC;\n shadowParameters.depth=distance/radius-0.0003;\n shadowParameters.nDotL=clamp(dot(normalEC,-directionEC),0.,1.);\n shadowParameters.texCoords=directionWC;\n float visibility=czm_shadowVisibility(shadowMap_textureCube,shadowParameters);\n return visibility;\n }\n\n bool visible(in vec4 result)\n {\n result.x/=result.w;\n result.y/=result.w;\n result.z/=result.w;\n return result.x>=-1.&&result.x<=1.\n &&result.y>=-1.&&result.y<=1.\n &&result.z>=-1.&&result.z<=1.;\n }\n\n void main(){\n // 釉色 = 结构二维(颜色纹理, 纹理坐标)\n gl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n // 深度 = 获取深度(结构二维(深度纹理, 纹理坐标))\n float depth = getDepth(texture2D(depthTexture, v_textureCoordinates));\n // 视角 = (纹理坐标, 深度)\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n // 世界坐标\n vec4 wordPos = czm_inverseView * viewPos;\n // 虚拟相机中坐标\n vec4 vcPos = camera_view_matrix * wordPos;\n float near = .001 * helsing_viewDistance;\n float dis = length(vcPos.xyz);\n if(dis > near && dis < helsing_viewDistance){\n // 透视投影\n vec4 posInEye = camera_projection_matrix * vcPos;\n // 可视区颜色\n // vec4 helsing_visibleAreaColor=vec4(0.,1.,0.,.5);\n // vec4 helsing_invisibleAreaColor=vec4(1.,0.,0.,.5);\n if(visible(posInEye)){\n float vis = shadow(viewPos);\n if(vis > 0.3){\n gl_FragColor = mix(gl_FragColor,helsing_visibleAreaColor,.5);\n } else{\n gl_FragColor = mix(gl_FragColor,helsing_invisibleAreaColor,.5);\n }\n }\n }\n }",uniforms:{shadowMap_textureCube:function(){return e.shadowMap.update(Reflect.get(e.viewer.scene,"_frameState")),Reflect.get(e.shadowMap,"_shadowMapTexture")},shadowMap_matrix:function(){return e.shadowMap.update(Reflect.get(e.viewer.scene,"_frameState")),Reflect.get(e.shadowMap,"_shadowMapMatrix")},shadowMap_lightPositionEC:function(){return e.shadowMap.update(Reflect.get(e.viewer.scene,"_frameState")),Reflect.get(e.shadowMap,"_lightPositionEC")},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){e.shadowMap.update(Reflect.get(e.viewer.scene,"_frameState"));var t=e.shadowMap._pointBias;return Cesium.Cartesian4.fromElements(t.normalOffsetScale,e.shadowMap._distance,e.shadowMap.maximumDistance,0,new Cesium.Cartesian4)},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){e.shadowMap.update(Reflect.get(e.viewer.scene,"_frameState"));var t=e.shadowMap._pointBias,i=new Cesium.Cartesian2;return i.x=1/e.shadowMap._textureSize.x,i.y=1/e.shadowMap._textureSize.y,Cesium.Cartesian4.fromElements(i.x,i.y,t.depthBias,t.normalShadingSmooth,new Cesium.Cartesian4)},camera_projection_matrix:this.lightCamera.frustum.projectionMatrix,camera_view_matrix:this.lightCamera.viewMatrix,helsing_viewDistance:function(){return e.viewDistance},helsing_visibleAreaColor:Cesium.Color.fromCssColorString(this.visibleAreaColor),helsing_invisibleAreaColor:Cesium.Color.fromCssColorString(this.invisibleAreaColor)}});this.postStage=this.viewer.scene.postProcessStages.add(t)}},{key:"drawFrustumOutline",value:function(){var e=new Cesium.Cartesian3,t=new Cesium.Matrix3,i=new Cesium.Quaternion,n=(this.lightCamera.positionWC,this.lightCamera.directionWC),o=this.lightCamera.upWC,s=this.lightCamera.rightWC;s=Cesium.Cartesian3.negate(s,e);var a=t;Cesium.Matrix3.setColumn(a,0,s,a),Cesium.Matrix3.setColumn(a,1,o,a),Cesium.Matrix3.setColumn(a,2,n,a);var r=Cesium.Quaternion.fromRotationMatrix(a,i),l=new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({frustum:this.lightCamera.frustum,origin:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:r}),id:Math.random().toString(36).substr(2),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOWGREEN),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});this.frustumOutline=this.viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:[l],appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!1})}))}},{key:"drawSketch",value:function(){this.sketch=this.viewer.entities.add({name:"sketch",position:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),Cesium.HeadingPitchRoll.fromDegrees(this.viewHeading-90,this.viewPitch,0)),ellipsoid:{radii:new Cesium.Cartesian3(this.viewDistance,this.viewDistance,this.viewDistance),minimumClock:Cesium.Math.toRadians(-this.horizontalViewAngle/2),maximumClock:Cesium.Math.toRadians(this.horizontalViewAngle/2),minimumCone:Cesium.Math.toRadians(90-this.verticalViewAngle/2),maximumCone:Cesium.Math.toRadians(90+this.verticalViewAngle/2),fill:!1,outline:!0,subdivisions:256,stackPartitions:64,slicePartitions:64,outlineColor:Cesium.Color.YELLOWGREEN}}),this.frustumOutline=this.viewer.entities.add({name:"sketch",position:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),Cesium.HeadingPitchRoll.fromDegrees(this.viewHeading-90,this.viewPitch,0)),ellipsoid:{radii:new Cesium.Cartesian3(this.viewDistance,this.viewDistance,this.viewDistance),innerRadii:new Cesium.Cartesian3(1e-4,1e-4,1e-4),minimumClock:Cesium.Math.toRadians(-this.horizontalViewAngle/2),maximumClock:Cesium.Math.toRadians(this.horizontalViewAngle/2),minimumCone:Cesium.Math.toRadians(90-this.verticalViewAngle/2),maximumCone:Cesium.Math.toRadians(90+this.verticalViewAngle/2),fill:!1,outline:!0,subdivisions:256,stackPartitions:1,slicePartitions:1,outlineColor:Cesium.Color.YELLOWGREEN}})}}],[{key:"create",value:function(e){e.destroy();var i=0;YJ.Measure.GetMeasureStatus()?this.tools.message({text:"上一次测量未结束",type:"warning"}):(e.event=new K(e.sdk),e.tip=new Q("左键选择观测点位置,右键取消",e.sdk),YJ.Measure.SetMeasureStatus(!0),e.event.mouse_left((function(n,o){e.viewPosition||(e.options.viewPosition=e.cartesian3Towgs84(o,e.viewer),e.ids.push(t.create_point(e,o)),e.tip.set_text("左键选择最远观测点位置,右键取消")),2===++i&&(e.options.viewPositionEnd=e.cartesian3Towgs84(o,e.viewer),e.ids.push(t.create_point(e,o)),e.end(),e.update())})),e.event.mouse_move((function(t,i){e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),e.event.mouse_right((function(t,i){e.ids.forEach((function(t){e.viewer.entities.removeById(t)})),e.ids=[],e.end()})),e.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){new Date-n>=500&&(e.ids.forEach((function(t){e.viewer.entities.removeById(t)})),e.ids=[],e.end())}))})))}},{key:"create_point",value:function(e,t){var i=e.randomString(),n=e.cartesian3Towgs84(t,e.viewer),o={id:i,position:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),billboard:{image:e.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}};return e.viewer.entities.add(new Cesium.Entity(o)),i}},{key:"edit",value:(i=o()(a.a.mark((function e(i){var n,o,s,r,l,c,u,h,p;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),e.next=3,new J(i.sdk.viewer._container,{title:"可视域分析",left:"180px",top:"100px",closeCallBack:function(){i.Dialog.closeCallBack&&i.Dialog.closeCallBack(),YJ.Measure.SetMeasureStatus(!1),i.editevent&&i.editevent.destroy(),i.ControllerObject&&i.ControllerObject.destroy(),i.ids.forEach((function(e){i.viewer.entities.removeById(e)}))}});case 3:return i._DialogObject=e.sent,e.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" view-shed",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">位置拾取(起点、终点)</span>\n <button class="edit"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>拾取</button>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="margin-bottom: 25px;">\n <div class="col">\n <span class="label">视点高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999" step="0.1" @model="viewPointHeight">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n </div>\n </div>\n <div class="row subtitle-box">\n <span class="subtitle">视域夹角</span>\n </div>\n <div class="row"> \n <div class="col">\n <div class="range-box">\n <div class="range-bg">\n <div class="range-process-box">\n <div class="range-process"></div>\n </div>\n </div>\n <div class="range-node-box">\n <span class="range-node-text">0°</span>\n <span class="range-node-text">45°</span>\n <span class="range-node-text">90°</span>\n <span class="range-node-text">135°</span>\n <span class="range-node-text">180°</span>\n <div class="range-node-active"><span class="range-node-active-text">0°</span></div>\n </div>\n <input type="range" max="180" min="0" step="1" name="horizontalViewAngle">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',i._DialogObject.contentAppChild(n),i._DialogObject._element.body.getElementsByClassName("edit")[0].addEventListener("click",(function(){i.nodeEdit()})),(o=document.createElement("button")).innerHTML="绘制",o.addEventListener("click",(function(){t.create(i)})),i._DialogObject.footAppChild(o),i.html=n,s=n.getElementsByTagName("*"),i._EventBinding.on(i,s),i._elms=i._EventBinding.element,(r=n.querySelector("input[name='horizontalViewAngle']")).value=i.options.horizontalViewAngle,l=n.getElementsByClassName("range-node-active")[0],c=l.getElementsByClassName("range-node-active-text")[0],u=n.getElementsByClassName("range-process")[0],h=i.horizontalViewAngle/180*100,l.style.left=h+"%",u.style.width=h+"%",c.innerHTML=i.horizontalViewAngle+"°",r.addEventListener("input",(function(){var e=r.value/180*100;l.style.left=e+"%",u.style.width=e+"%",c.innerHTML=r.value+"°"})),r.addEventListener("change",(function(){clearTimeout(p),p=setTimeout((function(){i.horizontalViewAngle=r.value}),300)}));case 31:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"getcanvas",value:function(e){if(e.viewPosition){e.viewBillboardPrimitive&&(e.viewer.scene.primitives.remove(e.viewBillboardPrimitive),e.viewBillboardPrimitive=null);var t=document.createElement("canvas"),i=t.getContext("2d");t.width=220,t.height=180,t.style.background="#000000";var n=new Image,o=[{images:e.getSourceRootPath()+"/img/bubble/lng.png",text:"经度:"+parseFloat(e.viewPosition.lng.toFixed(10))+"°"},{images:e.getSourceRootPath()+"/img/bubble/lat.png",text:"纬度:"+parseFloat(e.viewPosition.lat.toFixed(10))+"°"},{images:e.getSourceRootPath()+"/img/bubble/h.png",text:"高度:"+Number((parseFloat(e.viewPosition.alt.toFixed(2))+Number(e.viewPointHeight)).toFixed(2))+" m"},{images:e.getSourceRootPath()+"/img/bubble/heading.png",text:"偏航角:"+parseFloat(e.viewHeading.toFixed(10))+"°"},{images:e.getSourceRootPath()+"/img/bubble/pitch.png",text:"俯仰角:"+parseFloat(e.viewPitch.toFixed(10))+"°"}];n.src=e.getSourceRootPath()+"/img/bubble/bubble.png";var s=0;n.onload=function(){i.drawImage(n,0,0,t.width,t.height),o.forEach((function(n,a){var r=new Image;r.src=n.images,r.onload=function(){i.drawImage(r,12,12+26*a),i.fillStyle="#fff",i.font="12px Arial",i.fillText(n.text,44,28+26*a),++s===o.length&&(e.viewBillboardPrimitive=e.viewer.scene.primitives.add(new Cesium.BillboardCollection),e.viewBillboardPrimitive.add({position:Cesium.Cartesian3.fromDegrees(e.viewPosition.lng,e.viewPosition.lat,e.viewPosition.alt+e.viewPointHeight),image:t,width:200,height:180,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}))}}))}}}}]);var i}(vi);function ka(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return _a(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)?_a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function _a(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 xa(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function Ea(e,t,i){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,i)}function Sa(e,t){return e.get(Pa(e,t))}function Pa(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var Da=new WeakMap,Ma=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,t),Ea(i=xa(this,t,[e,n]),Da,new Map),i.viewer=e.viewer,i.options={},i.options.visibleAreaColor=n.visibleAreaColor||"#008000",i.options.invisibleAreaColor=n.invisibleAreaColor||"#FF0000",i.ids=[],i.primitives=[],i.viewpointPrimitive=null,i._elms={},i.precision=n.precision,i.viewPointHeight=n.viewPointHeight,i.Dialog=o,i._EventBinding=new xn,i.html=null,i.tools=new vi(e),YJ.Analysis.AnalysesResults.push(i);var s=i.viewer.terrainProvider.availability;return s?i:(i.tools.message({type:"warning",text:"未加载地形数据!"}),an()(i))}return un()(t,e),x()(t,[{key:"draw",value:function(){t.create(this)}},{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(e){var t=Math.floor(10*Number(e))/10;isNaN(t)&&(t=1.8),t<0&&(t=0),this.options.viewPointHeight=t,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(e){e.value=t}))}},{key:"viewPointHeights",get:function(){return this.viewPointHeight},set:function(e){var t=Math.floor(10*Number(e))/10;isNaN(t)&&(t=1.8),t<0&&(t=0),this.viewPointHeight=t}},{key:"precision",get:function(){return this.options.precision},set:function(e){var t=Math.floor(Number(e));isNaN(t)?t=20:t<1&&(t=1),this.options.precision=t,this._elms.precision&&this._elms.precision.forEach((function(e){e.value=t}))}},{key:"precisions",get:function(){return this.precision},set:function(e){this.precision=e}},{key:"analyse",value:function(){var e=this,i=[this.center.lng,this.center.lat],n=this.radius/1e3,o=turf.circle(i,n,{steps:180,units:"kilometers",properties:{foo:"bar"}});this.viewpointPrimitive||(this.viewpointPrimitive=this.viewer.scene.primitives.add(new Cesium.PointPrimitiveCollection)),this.viewBillboardPrimitive||(this.viewBillboardPrimitive=this.viewer.scene.primitives.add(new Cesium.BillboardCollection));for(var s=[],a=n/this.precision,r=1;r<o.geometry.coordinates[0].length;r++){for(var l=turf.lineString([i,o.geometry.coordinates[0][r]]),c=[],u=1;u<=this.precision;u++){var h=turf.lineSliceAlong(l,0,a*u,{units:"kilometers"});c.push([h.geometry.coordinates[1][0],h.geometry.coordinates[1][1]])}s.push(c)}var p=Cesium.Cartesian3.fromDegrees(this.center.lng,this.center.lat,this.center.alt+this.viewPointHeight);t.getcanvas(this).then((function(t){return e.viewBillboardPrimitive.add({position:p,image:t,width:200,height:140,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY})})),this.viewpointPrimitive.add({position:p,color:Cesium.Color.AQUA.withAlpha(1),pixelSize:6});var d=0,m=this,f=this.randomString(),v=setInterval((function(){if(d>=s.length){var t=Sa(Da,e).get(f);t&&clearInterval(t.event)}else!function(e){for(var t=[],n=e,o=0;o<s[n].length;o++){var a=s[n][o],r=void 0,l=void 0,c=s[n][o-1];n==s.length-1?(r=s[0][o],l=s[0][o-1]):(r=s[n+1][o],l=s[n+1][o-1]),0==o&&(l=[].concat(i),c=[]);for(var u=[(a[0]+l[0])/2,(a[1]+l[1])/2],h=Cesium.Cartographic.fromDegrees(u[0],u[1]),d=m.viewer.scene.globe.getHeight(h),f=Cesium.Cartesian3.fromDegrees(u[0],u[1],d),v=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(f,p,new Cesium.Cartesian3),new Cesium.Cartesian3),g=new Cesium.Ray(p,v),y=m.viewer.scene.drillPickFromRay(g,m.primitives),b=void 0,C=0;C<y.length;C++)if(y[C].position){b=y[C];break}var w=Cesium.Color.LIME;b&&Math.abs(b.position.x-f.x)>.01&&Math.abs(b.position.y-f.y)>.01&&Math.abs(b.position.z-f.z)>.01&&(w=Cesium.Color.RED);var k=new Cesium.GroundPolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArray([].concat(A()(a),A()(r),A()(l),A()(c),A()(a))),width:2}),_=new Cesium.GeometryInstance({geometry:k,name:"ViewershedPolygon",attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(w),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});t.push(_)}m.primitives.push(m.viewer.scene.primitives.add(new Cesium.GroundPolylinePrimitive({geometryInstances:t,appearance:new Cesium.PolylineColorAppearance})))}(d),d+=1}),0);Sa(Da,this).set(f,{event:v})}},{key:"destroy",value:function(){var e,t,i,n,o=ka(Sa(Da,this));try{for(o.s();!(e=o.n()).done;){var s=y()(e.value,2),a=(s[0],s[1]);clearInterval(a.event)}}catch(e){o.e(e)}finally{o.f()}t=Da,i=this,n=new Map,t.set(Pa(t,i),n);for(var r=0;r<this.primitives.length;r++)this.viewer.scene.primitives.remove(this.primitives[r]);this.primitives=[],this.viewpointPrimitive&&(this.viewer.scene.primitives.remove(this.viewpointPrimitive),this.viewpointPrimitive=null),this.viewBillboardPrimitive&&(this.viewer.scene.primitives.remove(this.viewBillboardPrimitive),this.viewBillboardPrimitive=null),YJ.Measure.SetMeasureStatus(!1)}}],[{key:"create",value:function(e){if(e.viewer.terrainProvider.availability){if(YJ.Measure.GetMeasureStatus())console.log("上一次测量未结束");else e._DialogObject&&e._DialogObject.close&&(e._DialogObject.close(),e._DialogObject=null),new YJ.Draw.DrawCircle(e.sdk).start(function(){var t=o()(a.a.mark((function t(i,n){var o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n){t.next=2;break}return t.abrupt("return");case 2:return e.radius=n.radius,t.next=5,Cesium.sampleTerrainMostDetailed(e.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(n.center.lng,n.center.lat)]);case 5:return o=t.sent,e.center={lng:n.center.lng,lat:n.center.lat,alt:o[0].height},t.next=9,e.analyse();case 9:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}())}else e.tools.message({type:"warning",text:"未加载地形数据!"})}},{key:"edit",value:(i=o()(a.a.mark((function e(i){var n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),e.next=3,new J(i.sdk.viewer._container,{title:"圆形视域分析",left:"180px",top:"100px",closeCallBack:function(){i.Dialog.closeCallBack&&i.Dialog.closeCallBack(),YJ.Measure.SetMeasureStatus(!1)}});case 3:return i._DialogObject=e.sent,e.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" circle-view-shed",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">视点高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999" step="0.1" @model="viewPointHeight">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">采样精度</span>\n <input class="input" type="number" title="" min="1" max="100" step="1" @model="precision">\n </div>\n </div>\n </div>\n ',i._DialogObject.contentAppChild(n),(o=document.createElement("button")).innerHTML="绘制",o.addEventListener("click",(function(){i.viewer.terrainProvider.availability?t.create(i):window.ELEMENT&&window.ELEMENT.Message({message:"未加载地形数据!",type:"warning",duration:1500})})),i._DialogObject.footAppChild(o),s=n.getElementsByTagName("*"),i._EventBinding.on(i,s),i._elms=i._EventBinding.element;case 17:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"getcanvas",value:function(e){var t=document.createElement("canvas"),i=t.getContext("2d");t.width=220,t.height=140,t.style.background="#000000";var n=new Image,s=[{images:e.getSourceRootPath()+"/img/bubble/lng.png",text:"经度:"+parseFloat(e.center.lng.toFixed(10))+"°"},{images:e.getSourceRootPath()+"/img/bubble/lat.png",text:"纬度:"+parseFloat(e.center.lat.toFixed(10))+"°"},{images:e.getSourceRootPath()+"/img/bubble/h.png",text:"视高:"+e.viewPointHeight+" m"},{images:e.getSourceRootPath()+"/img/bubble/radius.png",text:"半径:"+e.radius+" m"}];n.src=e.getSourceRootPath()+"/img/bubble/bubble.png";var r=0;return new Promise(function(){var e=o()(a.a.mark((function e(o,l){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.onload=function(){i.drawImage(n,0,0,t.width,t.height),s.forEach((function(e,n){var a=new Image;a.src=e.images,a.onload=function(){i.drawImage(a,12,12+26*n),i.fillStyle="#fff",i.font="12px Arial",i.fillText(e.text,44,28+26*n),++r===s.length&&o(t)}}))};case 1:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}())}}]);var i}(vi);function Ta(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 Oa(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ta(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ta(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Na(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Ba=function(e){function t(e){var i;return k()(this,t),(i=Na(this,t,[e])).viewer=e.viewer,i.event,i.result=[],i.handler=void 0,i.toolTip="",i.tools=new vi(e),i.viewer.terrainProvider.availability?(YJ.Analysis.AnalysesResults.push(i),i.Draw=new pa(i.sdk),i.createNew4Num(50),i):(i.error="未加载地形数据!",i.tools.message({type:"warning",text:i.error}),an()(i))}return un()(t,e),x()(t,[{key:"createNew4Distance",value:function(e){var t=this,i=200*(e=e||.1)>35?35:200*e;this.arrowWidth=i<15?15:i;this.viewer;this.Draw.start((function(i,n){if(!n||n.length<=2)t.tools.message({type:"warning",text:"至少拥有三个坐标位置!"});else{for(var o=[],s=1e4,a=1e4,r=-1e4,l=-1e3,c=0;c<n.length;c++){var u=n[c],h=u.lng,p=u.lat;o.push([h,p]),s=h<s?h:s,a=p<a?p:a,r=h>r?h:r,l=p>l?p:l}o.push(o[0]);var d=[s,a,r,l],m=turf.polygon([o]),f=turf.squareGrid(d,e,{mask:m});t.createEllipse(f)}}))}},{key:"createNew4Num",value:function(e){var t=this,i=e;this.Draw.start((function(e,n){if(!n||n.length<=2)t.tools.message({type:"warning",text:"至少拥有三个坐标位置!"});else{for(var o=[],s=1e4,a=1e4,r=-1e4,l=-1e3,c=0;c<n.length;c++){var u=n[c],h=u.lng,p=u.lat;o.push([h,p]),s=h<s?h:s,a=p<a?p:a,r=h>r?h:r,l=p>l?p:l}o.push(o[0]);var d=[s,a,r,l],m=r-s,f=l-a;f=f>m?f:m;var v=turf.polygon([o]),g=turf.area(v);g>5e12?i-=25:g>1e12?i-=20:g>5e11?i-=15:g>1e11?i-=10:g>6e10&&(i-=5);var y=f/i,b=2e3*y>35?35:2e3*y;t.arrowWidth=b<15?15:b;var C=turf.squareGrid(d,y,{units:"degrees",mask:v});t.createEllipse(C)}}))}},{key:"createEllipse",value:function(e){for(var t=[],i=0;i<e.features.length;i++){var n=e.features[i].geometry.coordinates[0],o=[(n[0][0]+n[2][0])/2,(n[0][1]+n[2][1])/2],s=Cesium.Cartographic.fromDegrees(o[0],o[1]);t.push(s);for(var a=0;a<n.length;a++){var r=n[a],l=Cesium.Cartographic.fromDegrees(r[0],r[1]);t.push(l);var c=n[a+1];if(c){var u=[(r[0]+c[0])/2,(r[1]+c[1])/2],h=Cesium.Cartographic.fromDegrees(u[0],u[1]);t.push(h)}}}var p=this,d=Math.floor(t.length/3)+"";d=10*Number(d.substring(0,d.length-1));var m=0,f=t.slice(m*d,(m+1)*d);f.length>0&&function e(i){Cesium.sampleTerrainMostDetailed(p.viewer.scene.terrainProvider,i).then((function(i){m++;var n=t.slice(m*d,(m+1)*d);n.length>0&&e(n);var o=[],s=i.reduce((function(e,t,i,n){var s=10*i,a=s+10,r=n.slice(s,a);return 0!=r.length&&(o[i]=r),o}),[]);p.calculateSlope(s)}))}(f)}},{key:"createPolygonInsrance",value:function(e,t,i){for(var n=[],o=1;o<e.length-1;o++){var s=e[o];n.push(Cesium.Cartographic.toCartesian(s))}var a=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(n)});return new Cesium.GeometryInstance({id:{type:"SlopeAspect",value:i},geometry:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(t)),show:new Cesium.ShowGeometryInstanceAttribute(!0)}})}},{key:"createArrowInstance",value:function(e,t,i,n,o){var s=new Cesium.Cartographic((e.longitude+t.longitude)/2,(e.latitude+t.latitude)/2,(e.height+t.height)/2),a=new Cesium.Cartographic((i.longitude+t.longitude)/2,(i.latitude+t.latitude)/2,(i.height+t.height)/2),r=n>0?[Cesium.Cartographic.toCartesian(s),Cesium.Cartographic.toCartesian(a)]:[Cesium.Cartographic.toCartesian(a),Cesium.Cartographic.toCartesian(s)];return new Cesium.GeometryInstance({id:{type:"SlopeAspect",value:o},geometry:new Cesium.GroundPolylineGeometry({positions:r,width:this.arrowWidth}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE.withAlpha(.6)),show:new Cesium.ShowGeometryInstanceAttribute(!0)}})}},{key:"calculateSlope",value:function(e){for(var t=this,i=[],n=[],o=0;o<e.length;o++){for(var s=e[o],a=s[0],r=0,l=0,c=1;c<s.length-1;c++){var u=s[c].height-a.height;Math.abs(u)>r&&(r=u,l=c)}var h=new Cesium.Cartographic(a.longitude,a.latitude,0),p=new Cesium.Cartographic(s[l].longitude,s[l].latitude,0),d=Cesium.Cartesian3.distance(Cesium.Cartographic.toCartesian(h),Cesium.Cartographic.toCartesian(p)),m=Math.abs(r/d),f=this.calculateSlopeColor(m,.4),v=this.createPolygonInsrance(s,f,m);n.push(v);var g=l>4?s[l-4]:s[l+4],y=s[l],b=this.createArrowInstance(y,a,g,r,m);i.push(b)}var C=this.viewer.scene.primitives.add(new Cesium.GroundPrimitive({geometryInstances:n,appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,closed:!1})})),w=this.viewer.scene.primitives.add(new Cesium.GroundPolylinePrimitive({geometryInstances:i,appearance:new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"PolylineArrow",uniforms:{color:new Cesium.Color(1,1,0,.8)}}})})}));this.result.push(w,C),this.event=new K(this.sdk);var k=function(e,i){var n=document.getElementById("SlopeAspect-box");n||((n=document.createElement("div")).id="SlopeAspect-box",n.style.pointerEvents="none",n.style.display="none",n.style.position="absolute",n.style.background="#333333",n.style.color="#fff",n.style.color="#fff",n.style.padding="5px",n.style.fontSize="12px",n.style.borderRadius="5px",n.style.transform="translate(-50%, -10px)",n.innerHTML='\n <div class="value">坡度:</div>\n <span style="\n position: absolute;\n border: 4px solid;\n border-color: #fff0 #fff0 #333333 #333333;\n transform: rotate(-45deg);\n left: calc(50% - 5px);\n "></span>\n ',document.body.appendChild(n));var o=n.getElementsByClassName("value")[0],s=Oa({},e.position),a=t.sdk.viewer.scene.pick(s);if(a&&a.id&&a.id.type&&"SlopeAspect"===a.id.type){var r=0,l=0;if(t.sdk.viewer&&t.sdk.viewer._element){var c=t.sdk.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0];r=c.getBoundingClientRect().top+window.scrollY,l=c.getBoundingClientRect().left+window.scrollX}n.style.display="block",n.style.left=s.x+2+l+"px",n.style.top=s.y-20+r+"px",o.innerHTML="坡度:"+Number(Cesium.Math.toDegrees(a.id.value||0).toFixed(2))+"°"}else n.style.display="none"};this.event.mouse_move((function(e,t){var i={position:Oa({},e.endPosition)};k(i)})),this.event.mouse_left(k),this._camera={position:this.sdk.viewer.camera.position,heading:this.sdk.viewer.camera.heading,pitch:this.sdk.viewer.camera.pitch,roll:this.sdk.viewer.camera.roll},this.sdk.viewer.scene.preRender.addEventListener(this._watchEvent,this)}},{key:"_watchEvent",value:function(){if(this._camera.position.x.toFixed(8)!==this.sdk.viewer.camera.position.x.toFixed(8)||this._camera.position.y.toFixed(8)!==this.sdk.viewer.camera.position.y.toFixed(8)||this._camera.position.z.toFixed(8)!==this.sdk.viewer.camera.position.z.toFixed(8)||this._camera.heading.toFixed(8)!==this.sdk.viewer.camera.heading.toFixed(8)||this._camera.pitch.toFixed(8)!==this.sdk.viewer.camera.pitch.toFixed(8)||this._camera.roll.toFixed(8)!==this.sdk.viewer.camera.roll.toFixed(8)){var e=document.getElementById("SlopeAspect-box");e&&(e.style.display="none")}this._camera={position:this.sdk.viewer.camera.position,heading:this.sdk.viewer.camera.heading,pitch:this.sdk.viewer.camera.pitch,roll:this.sdk.viewer.camera.roll}}},{key:"calculateSlopeColor",value:function(e,t){return e<.00872686779075879?"rgba(85,182,43,"+t+")":e<.03492076949174773?"rgba(135,211,43,"+t+")":e<.08748866352592401?"rgba(204,244,44,"+t+")":e<.2679491924311227?"rgba(245,233,44,"+t+")":e<.7002075382097097?"rgba(255,138,43,"+t+")":e<1.4281480067421144?"rgba(255,84,43,"+t+")":"rgba(255,32,43,"+t+")"}},{key:"destroy",value:function(){var e=this;this.result&&this.result.forEach((function(t){e.viewer.scene.primitives.remove(t)})),this.result=[],this.sdk.viewer.scene.preRender.removeEventListener(this._watchEvent,this)}}])}(vi);function Aa(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var La=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),window.addEventListener("resize",(function(){i.echartsObject&&i.echartsObject.resize()})),(i=Aa(this,t,[e])).viewer=e.viewer,i.Dialog=n,YJ.Analysis.AnalysesResults.push(i),t.create(i),i}return un()(t,e),x()(t,[{key:"reDraw",value:function(){t.create(this)}},{key:"onEnd",get:function(){return this.clickCallBack},set:function(e){e&&"function"!=typeof e?console.error("val:",e,"不是一个function"):this.clickCallBack=e}},{key:"formatter",value:function(e,t){if(this.polyline){var i={show:!0,pixelSize:10,color:Cesium.Color.GREEN,outlineColor:Cesium.Color.SKYBLUE,outlineWidth:3,disableDepthTestDistance:Number.POSITIVE_INFINITY};this.tipEntity?this.tipEntity.position=Cesium.Cartesian3.fromDegrees(e[0],e[1],Number(t[1])):this.tipEntity=this.sdk.viewer.entities.add({position:Cesium.Cartesian3.fromDegrees(e[0],e[1],Number(t[1])),point:i})}}},{key:"clean",value:function(){this.end(),this._currentId=null,this.entityHasCreated=!1,this.polyline&&this.viewer.entities.remove(this.polyline),this.tipEntity&&this.viewer.entities.remove(this.tipEntity),this.polyline=null,this.tipEntity=null}},{key:"destroy",value:function(){this.clean(),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null)}}],[{key:"create",value:function(e){var i=this;this._currentId=Cesium.createGuid();var n=this._currentId;if(e.clean(),YJ.Measure.GetMeasureStatus())console.warn("上一次测量未结束");else{YJ.Measure.SetMeasureStatus(!0),e.tip=new Q("左键确定,右键取消",e.sdk),e.event=new K(e.sdk),e.positions=[],e.points_ids=[];var s=[];e.event.mouse_left(function(){var r=o()(a.a.mark((function o(r,l){var c;return a.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:try{e.entityHasCreated||t.create_polyline(e),s.push(l),e.points_ids.push(e.create_point(l)),2==s.length&&(e.end(),c=[],s.forEach((function(t){c.push(e.cartesian3Towgs84(t,e.viewer))})),t.interPoints(e).then((function(t){i._currentId&&i._currentId===n&&e.clickCallBack(t)})))}catch(e){console.log(e)}case 1:case"end":return o.stop()}}),o)})));return function(e,t){return r.apply(this,arguments)}}()),e.event.mouse_right((function(t,i){s=[],e.clean()})),e.event.mouse_move((function(t,i){e.positions=s.concat(i),e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),e.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500){s=[],e.end()}}))}))}}},{key:"create_polyline",value:function(e){e.entityHasCreated=!0;var t=e.randomString();return e.polyline=e.viewer.entities.add(new Cesium.Entity({id:t,polyline:{positions:new Cesium.CallbackProperty((function(){return e.positions}),!1),width:5,material:Cesium.Color.fromCssColorString(e.color),clampToGround:!0,zIndex:99999999}})),t}},{key:"interPoints",value:(n=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w,k,_,x,E,S,P,D;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(i=t.viewer,n=t.positions,o=[],s=[],r=0;r<n.length;r++)l=n[r],c=i.scene.globe.ellipsoid.cartesianToCartographic(l),o.push(c),u=t.cartesian3Towgs84(l,i),s.push(u);return h=[],e.next=8,t.getClampToHeight({lng:s[0].lng,lat:s[0].lat});case 8:p=e.sent,h.push({position:{lng:s[0].lng,lat:s[0].lat,height:p},distance:0}),d=0;case 11:if(!(d<o.length-1)){e.next=42;break}m=turf.lineString([[s[d].lng,s[d].lat],[s[d+1].lng,s[d+1].lat]]),f=turf.length(m,{units:"kilometers"}),v=o[d],g=o[d+1],y=1e7*Math.abs(v.longitude-g.longitude),b=1e7*Math.abs(v.latitude-g.latitude),y>b&&(b=y),(C=parseInt(b/2))>150&&(C=150),C<2&&(C=2),w=f/(C-1),k=0;case 24:if(!(k<C-1)){e.next=39;break}return _=k*w,x=(k+1)*w,e.next=29,turf.lineSliceAlong(m,_,x,{units:"kilometers"});case 29:return E=e.sent,S=E.geometry.coordinates[E.geometry.coordinates.length-1][0],P=E.geometry.coordinates[E.geometry.coordinates.length-1][1],e.next=34,t.getClampToHeight({lng:S,lat:P});case 34:D=e.sent,h.push({position:{lng:S,lat:P,height:D},distance:1e3*x});case 36:k++,e.next=24;break;case 39:d++,e.next=11;break;case 42:return e.abrupt("return",h);case 43:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"edit",value:(i=o()(a.a.mark((function e(i,n){var o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),e.next=3,new J(i.sdk.viewer._container,{title:"剖面分析",left:"180px",top:"100px",closeCallBack:function(){i.clean(),i.Dialog.closeCallBack&&i.Dialog.closeCallBack()}});case 3:return i._DialogObject=e.sent,e.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" profile",(o=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="profile-echarts"></div>\n ',i._DialogObject.contentAppChild(o),(s=document.createElement("button")).innerHTML='<svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>重新绘制',s.style.width="auto",s.addEventListener("click",(function(){t.create(i),t.initEcharts(i)})),i._DialogObject.footAppChild(s),t.initEcharts(i,n);case 16:case"end":return e.stop()}}),e)}))),function(e,t){return i.apply(this,arguments)})},{key:"initEcharts",value:function(e,t){var i,n=[],o=[],s=t;if(s){for(var a=s[s.length-1].distance,r=Math.ceil(a),l=0;l<s.length;l++){var c=s[l];if(void 0!==c.position.height){var u=[c.distance.toFixed(2),c.position.height.toFixed(2)];n.push(u);var h=[c.position.lng,c.position.lat];o.push(h)}}var p={show:!0,pixelSize:10,color:Cesium.Color.GREEN,outlineColor:Cesium.Color.SKYBLUE,outlineWidth:3,disableDepthTestDistance:Number.POSITIVE_INFINITY},d=document.getElementsByClassName("profile-echarts")[0];e.echartsObject=echarts.init(d),i={tooltip:{trigger:"axis",textStyle:{align:"left"},formatter:function(t){var i=o[t[0].dataIndex],n=t[0].data;return e.tipEntity?e.tipEntity.position=Cesium.Cartesian3.fromDegrees(i[0],i[1],Number(n[1])):e.tipEntity=e.sdk.viewer.entities.add({position:Cesium.Cartesian3.fromDegrees(i[0],i[1],Number(n[1])),point:p}),"距离:"+n[0]+"m<br>高度:"+n[1]+"m<br>坐标:"+i[0].toFixed(5)+","+i[1].toFixed(5)}},grid:{top:40,bottom:20,left:55,right:30},calculable:!0,xAxis:[{type:"value",max:r,scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],yAxis:[{type:"value",scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],series:[{name:"ProfileLine",type:"line",data:n,smooth:!0,itemStyle:{normal:{color:"#39FDA1"}},lineStyle:{normal:{width:3,color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"rgba(85,254,139,1)"},{offset:.5,color:"rgba(7,252,202,1)"},{offset:1,color:"rgba(14,245,210,1)"}],globalCoord:!1}}},areaStyle:{normal:{color:new echarts.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(102,153,255,1)"},{offset:.8,color:"rgba(102,153,255,0.08)"},{offset:1,color:"rgba(9,173,208,0.15)"}],!1),shadowColor:"rgba(14,245,210,1)",shadowBlur:20}},markPoint:{data:[{type:"max",name:"最高点",label:{color:"#ffffff"}},{type:"min",name:"最低点",label:{color:"#ffffff"}}]}}]}}else{var m=document.getElementsByClassName("profile-echarts")[0];e.echartsObject=echarts.init(m),i={tooltip:{trigger:"axis",textStyle:{align:"left"}},grid:{top:40,bottom:20,left:55,right:30},calculable:!0,xAxis:[{type:"value",scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],yAxis:[{type:"value",scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],series:[{name:"ProfileLine",type:"line",data:[],smooth:!0,itemStyle:{normal:{color:"#39FDA1"}},lineStyle:{normal:{width:3,color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"rgba(85,254,139,1)"},{offset:.5,color:"rgba(7,252,202,1)"},{offset:1,color:"rgba(14,245,210,1)"}],globalCoord:!1}}},areaStyle:{normal:{color:new echarts.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(102,153,255,1)"},{offset:.8,color:"rgba(102,153,255,0.08)"},{offset:1,color:"rgba(9,173,208,0.15)"}],!1),shadowColor:"rgba(14,245,210,1)",shadowBlur:20}},markPoint:{data:[{type:"max",name:"最高点",label:{color:"#ffffff"}},{type:"min",name:"最低点",label:{color:"#ffffff"}}]}}]}}e.echartsObject.setOption(i)}}]);var i,n}(la);function Ia(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var ja=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(i=Ia(this,t,[e,n])).viewer=e.viewer,i.resultObject={viewPoint:void 0,targetPoints:[],targetPoint:void 0,objectExclude:[],entities:[]},i.options={},i._elms={},i.viewPointHeight=n.viewPointHeight,i.Dialog=o,i._EventBinding=new xn,i.tools=new vi(i.sdk),YJ.Analysis.AnalysesResults.push(i),t.create(i),i}return un()(t,e),x()(t,[{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(e){var t=Math.floor(10*Number(e))/10;isNaN(t)&&(t=1.8),t<0&&(t=0),this.options.viewPointHeight=t,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(e){e.value=t}))}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=null,this.event=null}},{key:"destroy",value:function(){var e=this;this.resultObject.entities.forEach((function(t){e.viewer.entities.remove(t)})),this.resultObject={viewPoint:void 0,targetPoints:[],targetPoint:void 0,objectExclude:[],entities:[]},this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=null,this.event=null,YJ.Measure.SetMeasureStatus(!1)}}],[{key:"create",value:function(e){if(YJ.Measure.GetMeasureStatus())e.tools.message({text:"上一次测量未结束",type:"warning"});else{e._DialogObject&&e._DialogObject.close&&(e._DialogObject.close(),e._DialogObject=null),e.event=new K(e.sdk),e.tip=new Q("左键点击创建视角起点",e.sdk),YJ.Measure.SetMeasureStatus(!0);e.event.mouse_left(function(){var i=o()(a.a.mark((function i(n,o){var s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(e.tip.set_text("左键创建视角终点,右键结束通视分析"),e.resultObject.viewPoint){i.next=16;break}if(s=e.cartesian3Towgs84(o,e.viewer),!e.sdk.viewer.terrainProvider.availability){i.next=7;break}return i.next=6,Cesium.sampleTerrainMostDetailed(e.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(s.lng,s.lat)]);case 6:r=i.sent;case 7:r&&r[0].height>s.alt&&(s.alt=r[0].height),s.alt=s.alt+e.viewPointHeight,l=Cesium.Cartesian3.fromDegrees(s.lng,s.lat,s.alt),e.resultObject.viewPoint=l,c=e.viewer.entities.add({position:l,point:{color:Cesium.Color.YELLOW,pixelSize:5}}),e.resultObject.objectExclude.push(c),e.resultObject.entities.push(c),i.next=33;break;case 16:e.resultObject.targetPoint=o,u=e.viewer.entities.add({position:o,point:{color:Cesium.Color.YELLOW,pixelSize:5}}),e.resultObject.objectExclude.push(u),e.resultObject.entities.push(u),h=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.resultObject.targetPoint,e.resultObject.viewPoint,new Cesium.Cartesian3),new Cesium.Cartesian3),p=new Cesium.Ray(e.resultObject.viewPoint,h),d=e.viewer.scene.drillPickFromRay(p),m={},f=0;case 25:if(!(f<d.length)){i.next=32;break}if(!d[f].position){i.next=29;break}return m=d[f],i.abrupt("break",32);case 29:f++,i.next=25;break;case 32:m&&(v=t.distance(e.resultObject.viewPoint,e.resultObject.targetPoint),g=t.distance(e.resultObject.viewPoint,m.position||o),y=t.distance(m.position||o,e.resultObject.targetPoint),v>g?(b=e.viewer.entities.add({polyline:{positions:[e.resultObject.viewPoint,m.position],material:Cesium.Color.GREEN,width:3,zIndex:99999999}}),e.resultObject.entities.push(b),C=e.viewer.entities.add({polyline:{positions:[m.position,e.resultObject.targetPoint],material:Cesium.Color.RED,width:3,zIndex:99999999}}),e.resultObject.entities.push(C),e.resultObject.targetPoints.push({targetPoint:o,visual:!1,distance:[v,g,y]})):(w=e.viewer.entities.add({polyline:{positions:[e.resultObject.viewPoint,e.resultObject.targetPoint],material:Cesium.Color.GREEN,width:3,zIndex:99999999}}),e.resultObject.entities.push(w),e.resultObject.targetPoints.push({targetPoint:o,visual:!0,distance:[v,g,y]})));case 33:case"end":return i.stop()}}),i)})));return function(e,t){return i.apply(this,arguments)}}()),e.event.mouse_move((function(t,i){e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),e.event.mouse_right((function(t,i){e.end()})),e.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){new Date-n>=500&&e.end()}))}))}}},{key:"edit",value:(i=o()(a.a.mark((function e(i){var n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),e.next=3,new J(i.sdk.viewer._container,{title:"多点视线分析",left:"180px",top:"100px",closeCallBack:function(){i.Dialog.closeCallBack&&i.Dialog.closeCallBack(),YJ.Measure.SetMeasureStatus(!1)}});case 3:return i._DialogObject=e.sent,e.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" visibility",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">视点高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999" step="0.1" @model="viewPointHeight">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n ',i._DialogObject.contentAppChild(n),(o=document.createElement("button")).innerHTML="绘制",o.addEventListener("click",(function(){t.create(i)})),i._DialogObject.footAppChild(o),s=n.getElementsByTagName("*"),i._EventBinding.on(i,s),i._elms=i._EventBinding.element;case 17:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"distance",value:function(e,t){var i=Cesium.Cartographic.fromCartesian(e),n=Cesium.Cartographic.fromCartesian(t),o=new Cesium.EllipsoidGeodesic;o.setEndPoints(i,n);var s=o.surfaceDistance;return s=Math.sqrt(Math.pow(s,2)+Math.pow(n.height-i.height,2))}}]);var i}(vi),Ra=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,e),this.viewer=t.viewer,this.tools=new vi(t);var n=this.viewer.terrainProvider.availability;if(!n)return this.error="未加载地形数据!",void this.tools.message({type:"warning",text:this.error});this.positions=i.positions,this.interfaceNum=i.interfaceNum||25,this.colorFill=i.colorFill||["#8CEA00","#B7FF4A","#FFFF37","#FFE66F","#FFD1A4","#FFCBB3","#FFBD9D","#FFAD86","#FF9D6F","#FF8F59","#FF8040","#FF5809","#F75000","#D94600","#BB3D00","#A23400","#842B00","#642100","#4D0000","#2F0000"],this.countorLineList=Cesium.defaultValue(i.countorLineList,[]),YJ.Analysis.AnalysesResults.push(this),this.createNewLine()}return x()(e,[{key:"type",get:function(){return"ContourAnalysis"}},{key:"createNewLine",value:function(){e.interpolatePoint(this)}},{key:"getObjectIndex",value:function(e,t){for(var i=0;i<e.length;i++)if(e[i]>t)return i}},{key:"clear",value:function(e){if(e){this.viewer.dataSources.remove(e);var t=this.countorLineList.indexOf(e);this.countorLineList.splice(t,1)}}},{key:"destroy",value:function(){var e=this;this.countorLineList.forEach((function(t){e.viewer.dataSources.remove(t)})),this.countorLineList=[]}}],[{key:"interpolatePoint",value:function(e){for(var t=e.positions,i=[],n={minX:360,maxX:-360,minY:180,maxY:-180},o=0;o<t.length;o++){var s=Cesium.Cartesian3.fromDegrees(t[o].lng,t[o].lat,t[o].alt),a=e.viewer.scene.globe.ellipsoid.cartesianToCartographic(s),r=Cesium.Math.toDegrees(a.latitude),l=Cesium.Math.toDegrees(a.longitude);n.maxY=Math.max(r,n.maxY),n.minY=Math.min(r,n.minY),n.maxX=Math.max(l,n.maxX),n.minX=Math.min(l,n.minX);var c={type:"Feature",properties:{},geometry:{type:"Point",coordinates:[l,r]}};i.push(c)}var u={type:"FeatureCollection",features:i};turf.featureEach(u,(function(e){e.properties.height=0}));var h=turf.point([n.minX,n.minY]),p=turf.point([n.maxX,n.maxY]),d=turf.rhumbDistance(h,p,{units:"kilometers"}),m=turf.interpolate(u,d/e.interfaceNum,{gridType:"points",property:"height",units:"kilometers"}),f=1e7,v=-1e8;turf.featureEach(m,(function(t){var i=t.geometry.coordinates,n=Cesium.Cartographic.fromDegrees(i[0],i[1]),o=e.viewer.scene.globe.getHeight(n);v=Math.max(o,v),f=Math.min(o,f),t.properties.height=o}));for(var g=[],y=e.colorFill.length-1,b=(v-f)/y,C=0;C<y+1;C++)g.push(Math.ceil(f+b*C));var w=turf.isolines(m,g,{zProperty:"height"});function k(t){for(var i=new vi,n=t.positions,o=n._value.length,s=[],a=0;a<o;a++){var r=i.cartesian3Towgs84(n._value[a],e.viewer);s.push([r.lng,r.lat])}var l=turf.lineString(s),c=turf.length(l,{units:"kilometers"}),u=turf.along(l,c/2,{units:"kilometers"});return Cesium.Cartesian3.fromDegrees(u.geometry.coordinates[0],u.geometry.coordinates[1],0)}Cesium.GeoJsonDataSource.load(w,{clampToGround:!0}).then((function(t){console.log(t),e.countorLine=t,e.countorLineList.push(t),e.viewer.dataSources.add(t);for(var i=t.entities.values,n=0;n<i.length;n++){var o=i[n],s=k(o.polyline);o.position=s;var a=e.getObjectIndex(g,o.properties.height._value);a&&(o.polyline.material=Cesium.Color.fromCssColorString(e.colorFill[a-1]))}}))}}])}();function Fa(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 za(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Fa(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Fa(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Ha(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Va=function(e){function t(e,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(n=Ha(this,t,[e,o])).viewer=e.viewer,n.tiles3d=i,n.options=za({},o),n.options.regionsType=n.options.regionsType||!1,YJ.Analysis.SectionResults.push(n),n.Planes=[],n.tools=new vi,t.start(n),n}return un()(t,e),x()(t,[{key:"regionsType",get:function(){return this.options.regionsType},set:function(e){this.options.regionsType=e,this.Planes.length>0&&(this.Planes=[],t.planeCollection(this))}},{key:"destroy",value:function(){this.Planes=[],this.tiles3d.clippingPlanes&&(this.tiles3d.clippingPlanes.enabled=!1,this.tiles3d.clippingPlanes.removeAll())}}],[{key:"start",value:function(e){var i=e.options.positions||[];if(!e.isConvex(i))return e.tools.message({type:"warning",text:"不支持凹多边形"}),void console.log("不支持凹多边形");e.inverseTransform=function(e){var t,i=e.root.transform;t=i&&i.equals(Cesium.Matrix4.IDENTITY)||!i?Cesium.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center):Cesium.Matrix4.fromArray(e.root.transform);return Cesium.Matrix4.inverseTransformation(t,new Cesium.Matrix4)}(e.tiles3d),e.Planes=[];var n=[];if(i.length>0){for(var o=0;o<i.length;o++)n.push([i[o].lng,i[o].lat]);n.push([i[0].lng,i[0].lat]),e.isClockwise=turf.booleanClockwise(turf.lineString(n))}t.planeCollection(e)}},{key:"planeCollection",value:function(e){var t=e.options.positions||[];if(e.regionsType==e.isClockwise)for(var i=0;i<t.length;i++)i===t.length-1?e.Planes.push(a(t[i],t[0],e.inverseTransform)):e.Planes.push(a(t[i],t[i+1],e.inverseTransform));else for(var n=t.length-1;n>=0;n--)0===n?e.Planes.push(a(t[n],t[t.length-1],e.inverseTransform)):e.Planes.push(a(t[n],t[n-1],e.inverseTransform));if(e.tiles3d.clippingPlanes){e.tiles3d.clippingPlanes.removeAll();for(var o=0;o<e.Planes.length;o++)e.tiles3d.clippingPlanes.add(e.Planes[o]);e.tiles3d.clippingPlanes.enabled=!0}else{var s=new Cesium.ClippingPlaneCollection({planes:e.Planes,enabled:!0,unionClippingRegions:e.regionsType,edgeColor:Cesium.Color.WHITE,edgeWidth:1});e.tiles3d.clippingPlanes=s}function a(e,t,i){var n=r(e,i),o=r(t,i),s=new Cesium.Cartesian3(0,0,10),a=Cesium.Cartesian3.subtract(o,n,new Cesium.Cartesian3),l=Cesium.Cartesian3.cross(a,s,new Cesium.Cartesian3);l=Cesium.Cartesian3.normalize(l,l);var c=Cesium.Plane.fromPointNormal(n,l);return Cesium.ClippingPlane.fromPlane(c)}function r(e,t){var i=Cesium.Cartesian3.fromDegrees(e.lng,e.lat);return Cesium.Matrix4.multiplyByPoint(t,i,new Cesium.Cartesian3(0,0,0))}}}])}(vi);function Ga(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Wa=[],Ua=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),(i=Ga(this,t,[e])).viewer=e.viewer,i.options=n||{},i.options.height=i.options.height||0===i.options.height?i.options.height:10,i.options.show=!i.options.show&&!1!==i.options.show||i.options.show,i.bottomImg=i.getSourceRootPath()+"/img/excavationregion_top.jpg",i.wallImg=i.getSourceRootPath()+"/img/excavationregion_side.jpg",i.splitNum=Cesium.defaultValue(n.splitNum,50),i.Draw=new pa(i.sdk),i.bottomMaterial=Cesium.Material.fromType("Color",{color:Cesium.Color.fromAlpha(Cesium.Color.fromCssColorString("#735d4f"))}),i.wallMaterial=Cesium.Material.fromType("Color",{color:Cesium.Color.fromAlpha(Cesium.Color.fromCssColorString("#976b4e"))}),i.tools=new vi(i.sdk);var o=new Image,s=new Image;return o.src=i.bottomImg,s.src=i.wallImg,o.crossOrigin="Anonymous",s.crossOrigin="Anonymous",o.onload=function(){var e=document.createElement("canvas");e.width=o.width,e.height=o.height,e.getContext("2d").drawImage(o,0,0,o.width,o.height);var t=e.toDataURL("image/jpg");i.bottomMaterial=new Cesium.Material({fabric:{type:"Image",uniforms:{image:t}}}),i.bottomSurface&&(i.bottomSurface.appearance.material=i.bottomMaterial)},s.onload=function(){var e=document.createElement("canvas");e.width=s.width,e.height=s.height,e.getContext("2d").drawImage(s,0,0,s.width,s.height);var t=e.toDataURL("image/jpg");i.wallMaterial=new Cesium.Material({fabric:{type:"Image",uniforms:{image:t}}}),i.wellWall&&(i.wellWall.appearance.material=i.wallMaterial)},i}return un()(t,e),x()(t,[{key:"show",get:function(){return this.options.show},set:function(e){this.options.show=e,this.switchExcavate(e)}},{key:"height",get:function(){return this.options.height},set:function(e){this.options.height=e}},{key:"init",value:function(){t.edit(this,!0)}},{key:"startCreate",value:function(){var e=this;this.Draw.start((function(t,i){if(i&&!(i.length<=2))return e.isConvex(i)?void e.updateData(i):(e.tools.message({type:"warning",text:"不支持凹多边形"}),void console.log("不支持凹多边形"));e.tools.message({type:"warning",text:"至少拥有三个坐标位置!"})}))}},{key:"updateData",value:function(e){var t=this.viewer;this.clear();for(var i=[],n=[],o=0;o<e.length;o++)n.push([e[o].lng,e[o].lat]);n.push([e[0].lng,e[0].lat]);var s=turf.lineString(n),a=turf.booleanClockwise(s);this.excavateMinHeight=9999;for(var r=0;r<e.length;++r){var l=(r+1)%e.length,c=Cesium.Cartesian3.fromDegrees(e[r].lng,e[r].lat,e[r].alt),u=Cesium.Cartesian3.fromDegrees(e[l].lng,e[l].lat,e[l].alt),h=Cesium.Cartesian3.midpoint(c,u,new Cesium.Cartesian3),p=Cesium.Cartographic.fromCartesian(c),d=t.scene.globe.getHeight(p)||p.height;d<this.excavateMinHeight&&(this.excavateMinHeight=d);var m=Cesium.Cartesian3.normalize(h,new Cesium.Cartesian3),f=a?Cesium.Cartesian3.subtract(c,h,new Cesium.Cartesian3):Cesium.Cartesian3.subtract(u,h,new Cesium.Cartesian3);f=Cesium.Cartesian3.normalize(f,f);var v=Cesium.Cartesian3.cross(f,m,new Cesium.Cartesian3);v=Cesium.Cartesian3.normalize(v,v);var g=new Cesium.Plane(v,0),y=Cesium.Plane.getPointDistance(g,h);i.push(new Cesium.ClippingPlane(v,y))}this.viewer.scene.globe.clippingPlanes=new Cesium.ClippingPlaneCollection({planes:i,edgeWidth:1,edgeColor:Cesium.Color.WHITE,enabled:!0}),this.prepareWell(e),this.createWell(this.wellData)}},{key:"clear",value:function(){this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.removeAll(),this.viewer.scene.primitives.remove(this.bottomSurface),this.viewer.scene.primitives.remove(this.wellWall),this.viewer.scene.render());for(var e=Wa.length-1;e>=0;e--)this.viewer.scene.primitives.remove(Wa[e]);Wa=[],this.Draw&&this.Draw.end()}},{key:"destroy",value:function(){this.clear()}},{key:"prepareWell",value:function(e){for(var t=e.length,i=this.excavateMinHeight-this.height,n=[],o=[],s=[],a=0;a<t;a++){var r=a==t-1?0:a+1,l=[Cesium.Cartographic.fromDegrees(e[a].lng,e[a].lat,e[a].alt).longitude,Cesium.Cartographic.fromDegrees(e[a].lng,e[a].lat,e[a].alt).latitude],c=[Cesium.Cartographic.fromDegrees(e[r].lng,e[r].lat,e[r].alt).longitude,Cesium.Cartographic.fromDegrees(e[r].lng,e[r].lat,e[r].alt).latitude];0==a&&(s.push(new Cesium.Cartographic(l[0],l[1])),o.push(Cesium.Cartesian3.fromRadians(l[0],l[1],i)),n.push(Cesium.Cartesian3.fromRadians(l[0],l[1],0)));for(var u=1;u<=this.splitNum;u++){var h=Cesium.Math.lerp(l[0],c[0],u/this.splitNum),p=Cesium.Math.lerp(l[1],c[1],u/this.splitNum);a==t-1&&u==this.splitNum||(s.push(new Cesium.Cartographic(h,p)),o.push(Cesium.Cartesian3.fromRadians(h,p,i)),n.push(Cesium.Cartesian3.fromRadians(h,p,0)))}}this.wellData={lerp_pos:s,bottom_pos:o,no_height_top:n}}},{key:"createWell",value:function(e){var t=this;this.viewer.terrainProvider._layers?(this.createBottomSurface(e.bottom_pos),Cesium.sampleTerrainMostDetailed(this.viewer.terrainProvider,e.lerp_pos).then((function(i){for(var n=[],o=0;o<i.length;o++){var s=i[o],a=Cesium.Cartesian3.fromRadians(s.longitude,s.latitude,s.height);n.push(a)}t.createWellWall(e.bottom_pos,n)}))):(this.createBottomSurface(e.bottom_pos),this.createWellWall(e.bottom_pos,e.no_height_top))}},{key:"ellipsoidToDegree",value:function(e){var t=new Cesium.Cartesian3(e.x,e.y,e.z),i=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t);return{longitude:Cesium.Math.toDegrees(i.longitude),latitude:Cesium.Math.toDegrees(i.latitude),altitude:i.height}}},{key:"createBottomSurface",value:function(e){if(e.length){for(var t=this.getMinHeight(e),i=[],n=0;n<e.length;n++){var o=this.ellipsoidToDegree(e[n]);i.push(o.longitude,o.latitude,t)}var s=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(i)),perPositionHeight:!0}),a=new Cesium.MaterialAppearance({translucent:!1,flat:!0,material:this.bottomMaterial});this.bottomSurface=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:Cesium.PolygonGeometry.createGeometry(s)}),appearance:a,asynchronous:!1}),Wa.push(this.bottomSurface),this.viewer.scene.primitives.add(this.bottomSurface)}}},{key:"createWellWall",value:function(e,t){for(var i=this.getMinHeight(e),n=[],o=[],s=0;s<t.length;s++)n.push(this.ellipsoidToDegree(t[s]).altitude),o.push(i);var a=new Cesium.WallGeometry({positions:t,maximumHeights:n,minimumHeights:o}),r=Cesium.WallGeometry.createGeometry(a),l=new Cesium.MaterialAppearance({translucent:!1,flat:!0,material:this.wallMaterial});this.wellWall=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:r,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.GREY)},id:"PitWall"}),appearance:l,asynchronous:!1}),Wa.push(this.wellWall),this.viewer.scene.primitives.add(this.wellWall)}},{key:"getMinHeight",value:function(e){for(var t=5e6,i=null,n=0;n<e.length;n++){var o=e[n].z;o<t&&(t=o,i=this.ellipsoidToDegree(e[n]))}return i.altitude}},{key:"switchExcavate",value:function(e){e?(this.viewer.scene.globe.material=null,this.wellWall.show=!0,this.bottomSurface.show=!0):(this.viewer.scene.globe.material=null,this.wellWall.show=!1,this.bottomSurface.show=!1)}},{key:"updateExcavateDepth",value:function(e){if(this.viewer.scene.primitives.remove(this.bottomSurface),this.viewer.scene.primitives.remove(this.wellWall),this.wellData){for(var t=this.wellData.lerp_pos,i=[],n=0;n<t.length;n++)i.push(Cesium.Cartesian3.fromRadians(t[n].longitude,t[n].latitude,this.excavateMinHeight-e));this.wellData.bottom_pos=i,this.createWell(this.wellData)}}}],[{key:"edit",value:(i=o()(a.a.mark((function e(t,i){var n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t._DialogObject&&t._DialogObject.close&&(t._DialogObject.close(),t._DialogObject=null),!i){e.next=21;break}return e.next=4,new J(t.sdk.viewer._container,{title:"地形开挖",closeCallBack:function(){}});case 4:return t._DialogObject=e.sent,e.next=7,t._DialogObject.init();case 7:t._DialogObject._element.body.className=t._DialogObject._element.body.className+" terrain-excavation",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">挖掘高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="5000000" name="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">绘制开挖区域</span>\n <button class="start-excavation"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>绘制</button>\n </div>\n <div class="col">\n <span class="label">清除开挖区域</span>\n <button class="clean-excavation"><svg class="icon-close"><use xlink:href="#yj-icon-close"></use></svg>清除</button>\n </div>\n </div>\n </div>\n ',t._DialogObject.contentAppChild(n),n.getElementsByClassName("start-excavation")[0].addEventListener("click",(function(){t.startCreate()})),n.getElementsByClassName("clean-excavation")[0].addEventListener("click",(function(){t.clear()})),(o=n.querySelector("input[name='height']")).value=t.height,o.addEventListener("change",(function(e){var i=e.target.value;(i=Number(i))<.01&&(i=.01,e.target.value=i,t.height=i)})),o.addEventListener("blur",(function(e){var i=e.target.value;i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),i<.01&&(i=.01),e.target.value=i,t.height=i})),e.next=22;break;case 21:t._DialogObject&&t._DialogObject.close&&(t._DialogObject.close(),t._DialogObject=null);case 22:case"end":return e.stop()}}),e)}))),function(e,t){return i.apply(this,arguments)})}]);var i}(vi);function Ya(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 Ja(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ya(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ya(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function qa(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Xa={},Za=function(e){function t(e,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(k()(this,t),n=qa(this,t,[e]),C()(n,"getUniqueArray",(function(e){return e.filter((function(e,t,i){return i.indexOf(e,0)===t}))})),!i||!n.sdk||!n.sdk.viewer)return an()(n);if(n.options=Ja({},o),n.options.id=o.id||n.randomString(),n.options.name=o.name||"压平面",n.options.positions=o.positions||[],n.options.show=!o.show&&!1!==o.show||o.show,n.tileset=i,n.Dialog=s,!n.options.height&&0!==n.options.height){for(var a=n.options.positions[0].alt,r=0;r<n.options.positions.length;r++)a>n.options.positions[r].alt&&(a=n.options.positions[r].alt);n.options.height=a}return Xa[n.tileset.id]?Xa[n.tileset.id].push(Ja({},n.options)):Xa[n.tileset.id]=[Ja({},n.options)],n.center=i.boundingSphere.center.clone(),n.center84=n.cartesian3Towgs84(n.center,n.sdk.viewer),n.matrix=Cesium.Transforms.eastNorthUpToFixedFrame(n.center.clone()),n.localMatrix=Cesium.Matrix4.inverse(n.matrix,new Cesium.Matrix4),n.addFlat(),n}return un()(t,e),x()(t,[{key:"show",get:function(){return this.options.show},set:function(e){this.options.show=e;for(var t=0;t<Xa[this.tileset.id].length;t++)Xa[this.tileset.id][t].id==this.options.id&&(Xa[this.tileset.id][t].show=e);this.addFlat()}},{key:"height",get:function(){return this.options.height},set:function(e){this.options.height=Number(e);for(var t=0;t<Xa[this.tileset.id].length;t++)Xa[this.tileset.id][t].id==this.options.id&&(Xa[this.tileset.id][t].height=Number(e));this.addFlat()}},{key:"name",get:function(){return this.options.name},set:function(e){this.options.name=e;for(var t=0;t<Xa[this.tileset.id].length;t++)Xa[this.tileset.id][t].id==this.options.id&&(Xa[this.tileset.id][t].name=e)}},{key:"addFlat",value:function(){for(var e=this,t=[],i=0;i<Xa[this.tileset.id].length;i++){var n=Xa[this.tileset.id][i];if(n.show){for(var o=n.positions,s=n.height,a=[],r=0;r<o.length;r++)a.push(o[r].lng,o[r].lat);Xa[this.tileset.id][i].flatHeight=s-this.center84.alt;var l=this.cartesiansToLocal(Cesium.Cartesian3.fromDegreesArray(a));t.push(l)}}for(var c=this.getIsinPolygonFun(t),u="",h=function(){var i=t[p],n=i.length,o="";i.forEach((function(e,t){o+="points_".concat(n,"[").concat(t,"] = vec2(").concat(e[0],", ").concat(e[1],");\n")})),u+="\n ".concat(o,"\n if(isPointInPolygon_").concat(n,"(position2D)){\n vec4 tileset_local_position_transformed = vec4(tileset_local_position.x, tileset_local_position.y, ground_z + ").concat(Xa[e.tileset.id][p].flatHeight,", 1.0);\n vec4 model_local_position_transformed = czm_inverseModel * u_tileset_localToWorldMatrix * tileset_local_position_transformed;\n\n vsOutput.positionMC.xy = model_local_position_transformed.xy;\n vsOutput.positionMC.z = model_local_position_transformed.z+ modelMC.z*0.002;\n return;\n }")},p=0;p<t.length;p++)h();this.updateShader(c,u)}},{key:"remove",value:function(){var e=this;Xa[this.tileset.id]=Xa[this.tileset.id].filter((function(t){return t.id!=e.options.id}));for(var t=[],i=0;i<Xa[this.tileset.id].length;i++){var n=Xa[this.tileset.id][i];if(n.show){for(var o=n.positions,s=n.height,a=[],r=0;r<o.length;r++)a.push(o[r].lng,o[r].lat);Xa[this.tileset.id][i].flatHeight=s-this.center84.alt;var l=this.cartesiansToLocal(Cesium.Cartesian3.fromDegreesArray(a));t.push(l)}}for(var c=this.getIsinPolygonFun(t),u="",h=function(){var i=t[p],n=i.length,o="";i.forEach((function(e,t){o+="points_".concat(n,"[").concat(t,"] = vec2(").concat(e[0],", ").concat(e[1],");\n")})),u+="\n ".concat(o,"\n if(isPointInPolygon_").concat(n,"(position2D)){\n vec4 tileset_local_position_transformed = vec4(tileset_local_position.x, tileset_local_position.y, ground_z + ").concat(Xa[e.tileset.id][p].flatHeight,", 1.0);\n vec4 model_local_position_transformed = czm_inverseModel * u_tileset_localToWorldMatrix * tileset_local_position_transformed;\n vsOutput.positionMC.xy = model_local_position_transformed.xy;\n vsOutput.positionMC.z = model_local_position_transformed.z+ modelMC.z*0.002;\n return;\n }")},p=0;p<t.length;p++)h();this.updateShader(c,u)}},{key:"getIsinPolygonFun",value:function(e){var t=e.map((function(e){return e.length})),i=this.getUniqueArray(t),n="";return i.forEach((function(e){n+="\n vec2 points_".concat(e,"[").concat(e,"];\n bool isPointInPolygon_").concat(e,"(vec2 point){\n int nCross = 0; // 交点数\n const int n = ").concat(e,";\n for(int i = 0; i < n; i++){\n vec2 p1 = points_").concat(e,"[i];\n vec2 p2 = points_").concat(e,"[int(mod(float(i+1),float(n)))];\n if(p1[1] == p2[1]){\n continue;\n }\n if(point[1] < min(p1[1], p2[1])){\n continue;\n }\n if(point[1] >= max(p1[1], p2[1])){\n continue;\n }\n float x = p1[0] + ((point[1] - p1[1]) * (p2[0] - p1[0])) / (p2[1] - p1[1]);\n if(x > point[0]){\n nCross++;\n }\n }\n return int(mod(float(nCross), float(2))) == 1;\n }\n ")})),n}},{key:"updateShader",value:function(e,t){var i=new Cesium.CustomShader({uniforms:{u_tileset_localToWorldMatrix:{type:Cesium.UniformType.MAT4,value:this.matrix},u_tileset_worldToLocalMatrix:{type:Cesium.UniformType.MAT4,value:this.localMatrix},u_flatHeight:{type:Cesium.UniformType.FLOAT,value:this.flatHeight}},vertexShaderText:"\n // 所有isPointInPolygon函数\n ".concat(e,"\n void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput){\n vec3 modelMC = vsInput.attributes.positionMC;\n vec4 model_local_position = vec4(modelMC.x, modelMC.y, modelMC.z, 1.0);\n vec4 tileset_local_position = u_tileset_worldToLocalMatrix * czm_model * model_local_position;\n vec2 position2D = vec2(tileset_local_position.x,tileset_local_position.y);\n float ground_z = 0.0;\n // 多个多边形区域\n ").concat(t,"\n }")});this.tileset.customShader=i,this.sdk.viewer.scene.requestRender()}},{key:"cartesiansToLocal",value:function(e){for(var t=[],i=0;i<e.length;i++){var n=e[i],o=Cesium.Matrix4.multiplyByPoint(this.localMatrix,n.clone(),new Cesium.Cartesian3);t.push([o.x,o.y])}return t}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=22;break}if(t={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Ja({},this.options.position):this.options.positions?r=Ja({},this.options.positions[0]):this.options.line&&this.options.line.positions?r=Ja({},this.options.line.positions[0]):this.options.center?r=Ja({},this.options.center):this.options.start?r=Ja({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),r.hasOwnProperty("alt")){e.next=15;break}return e.next=14,this.getClampToHeight(r);case 14:r.alt=e.sent;case 15:i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:t}),e.next=26;break;case 22:for(l=[],c=0;c<this.options.positions.length;c++)u=Cesium.Cartesian3.fromDegrees(this.options.positions[c].lng,this.options.positions[c].lat,this.center84.alt),l.push(u.x,u.y,u.z);h=Cesium.BoundingSphere.fromVertices(l),this.sdk.viewer.camera.flyToBoundingSphere(h,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"edit",value:(i=o()(a.a.mark((function e(t){var i,n,o,s=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t?(this.originalOptions=this.deepCopyObj(this.options),i=document.getElementsByClassName("flatPlane")[0],(n=i.getElementsByClassName("input-name")[0]).value=this.options.name,n.addEventListener("input",(function(){s.name=n.value})),(o=i.getElementsByClassName("flat-height")[0]).value=this.options.height,o.addEventListener("input",(function(){s.height=Number(o.value),s.addFlat()}))):this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 1:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"sure",value:function(){this.options.name||(this.options.name="压平面"),this.originalOptions=this.deepCopyObj(this.options)}},{key:"reset",value:function(){this.options=this.deepCopyObj(this.originalOptions),this.name=this.options.name,this.height=this.options.height,this.addFlat()}},{key:"flatEdit",value:function(e){if(e){for(var t=that.options.positions,i=[],n=0;n<t.length;n++)i.push(t[n].lng,t[n].lat,Xa[this.tileset.id]);that.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i)}}},{key:"flicker",value:function(){}}]);var i,n}(Vn);function Ka(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 Qa(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ka(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ka(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function $a(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var er=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{text:"左键开始,右键结束;"};return k()(this,t),(i=$a(this,t,[e,n])).options=Qa({},n),i.event=new K(e),i.tip=new Q(n.text,e),i.viewer=e.viewer,i.defaultColor="rgba(246,49,49,0.55)",i.ids=[],YJ.Measure.Measures.push(i),i._isDestroy=!1,i}return un()(t,e),x()(t,[{key:"start",value:function(){this.setPickStatus(!1),YJ.Measure.SetMeasureStatus(!0)}},{key:"destroy",value:function(){var e=this;this._isDestroy=!0,this.end(),this.ids.forEach((function(t){e.remove_entity(t)}))}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=null,this.event=null}},{key:"create_point",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.randomString(),n=this.cartesian3Towgs84(e,this.viewer);return this.viewer.entities.add(new Cesium.Entity({id:i,position:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),billboard:{show:t,image:this.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}})),i}},{key:"remove_entity",value:function(e){this.viewer.entities.removeById(e)}}])}(vi);function tr(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return ir(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)?ir(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function ir(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 nr(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function or(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var sr=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=nr(this,t,[e,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i}return un()(t,e),x()(t,[{key:"clampToGroundMeasure",value:(r=o()(a.a.mark((function e(t,i){var n,o,s,r,l,c,u,h,p,d=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],this.ids.forEach((function(e,t){var i=d.viewer.entities.getById(e).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,t),s=[],o.forEach((function(e,t){0===t?s=A()(e.geometry.coordinates):s.push(e.geometry.coordinates[1])})),r=s.length,l=tr(s),e.prev=7,l.s();case 9:if((c=l.n()).done){e.next=18;break}return u=c.value,h=s.indexOf(u),e.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},h,r);case 14:p=e.sent,i(null,p);case 16:e.next=9;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(7),l.e(e.t0);case 23:return e.prev=23,l.f(),e.finish(23);case 26:case"end":return e.stop()}}),e,this,[[7,20,23,26]])}))),function(e,t){return r.apply(this,arguments)})},{key:"computeDisByTowPoint",value:(s=o()(a.a.mark((function e(i,n){var s,r,l,c,u=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=this.computeDistance2([i,n]),r=10,l=function(e){if(!u._isDestroy){var i=u.getLabel("贴地距离:"+Number(e).toFixed(2)+"米");i.pixelOffset=new Cesium.Cartesian2(0,-32),u.ids.push(t.create_point(Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),{label:i},u))}},c=function(){var e=o()(a.a.mark((function e(t){var o,s,r,c,h,p,d,m,f,v;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u.chunkLine([i,n],t),s=[],o.forEach((function(e,t){0===t?s=A()(e.geometry.coordinates):s.push(e.geometry.coordinates[1])})),r=[],c=tr(s),e.prev=5,c.s();case 7:if((h=c.n()).done){e.next=16;break}return p=h.value,d=s.indexOf(p),e.next=12,u.sampleHeight({lng:p[0],lat:p[1],alt:0},d);case 12:m=e.sent,r.push(m);case 14:e.next=7;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(5),c.e(e.t0);case 21:return e.prev=21,c.f(),e.finish(21);case 24:f=0,v=r.length-1,r.forEach((function(e,t){if(t!==v){var i=u.computeDistance2([e.position,r[t+1].position]),n=Math.abs(e.position.alt-r[t+1].position.alt),o=Math.sqrt(i*i+n*n);f+=o}})),l(f);case 28:case"end":return e.stop()}}),e,null,[[5,18,21,24]])})));return function(t){return e.apply(this,arguments)}}(),!(s>2)){e.next=10;break}return r=s/20,e.next=8,c(r);case 8:e.next=17;break;case 10:if(!(s<1)){e.next=14;break}l(s),e.next=17;break;case 14:return r=1,e.next=17,c(r);case 17:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"sampleHeight",value:(n=o()(a.a.mark((function e(t,i){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getClampToHeight(t,A()(this.sdk.viewer.entities.values));case 2:return n=e.sent,t.alt=n,e.abrupt("return",{position:t,index:i});case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getHeight",value:(i=o()(a.a.mark((function e(t,i,n){var o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sampleHeightMostDetailed([t]);case 2:if(o=e.sent,t.alt=o[0].height,this.clampPositions.push({position:t,index:i}),n!==this.clampPositions.length){e.next=8;break}return s=this.startCompute(),e.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return e.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var e=this;this.clampPositions.sort((function(e,t){return e.index<t.index}));var t=0,i=this.clampPositions.length-1;return this.clampPositions.forEach((function(n,o){if(o!==i){var s=e.computeDistance2([n.position,e.clampPositions[o+1].position]),a=Math.abs(n.position.alt-e.clampPositions[o+1].position.alt),r=Math.sqrt(s*s+a*a);t+=r}})),Number(t.toFixed(2))}},{key:"getLabel",value:function(e){return{text:e||"",font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#f1e605"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}}},{key:"start",value:function(){var e=this;if(!YJ.Measure.GetMeasureStatus()){or(t,"start",this,3)([]),this.positions=[],this.cachePositions=[];var i=function(){var i=o()(a.a.mark((function i(n,o){var s,r,l;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(0===e.ids.length&&(e.polyline_id=t.createPolyline(e),e.start_id=t.create_point(o,{image:"start1.png",width:30,height:38,label:e.getLabel("")},e)),e.tip.setPosition(o,n.position.x,n.position.y),e.positions=e.cachePositions.concat(o),0===e.ids.length){i.next=11;break}return s=e.cartesian3Towgs84(o,e.viewer),r=e.cartesian3Towgs84(e.cachePositions[e.cachePositions.length-1],e.viewer),e.cachePositions.push(o),i.next=9,e.computeDisByTowPoint(r,s);case 9:i.next=15;break;case 11:e.cachePositions.push(o),e.ids.push(t.create_point(o,{},e)),(l=e.viewer.entities.getById(e.ids[0]))&&(l.billboard.show=!1);case 15:case"end":return i.stop()}}),i)})));return function(e,t){return i.apply(this,arguments)}}(),n=function(i,n){if(e.cachePositions.length){e.positions=e.cachePositions,e.end_id=t.create_point(e.cachePositions[e.cachePositions.length-1],{image:"end1.png",width:30,height:38},e);var o=e.viewer.entities.getById(e.ids[e.ids.length-1]);o&&(o.billboard.show=!1)}e.cachePositions.length<2&&(e.destroy(),YJ.Measure.Measures.pop()),e.end()};this.event.mouse_left(i),this.event.mouse_move((function(t,i){e.tip.setPosition(i,t.endPosition.x,t.endPosition.y),e.positions=e.cachePositions.concat(i)})),this.event.mouse_right(n),this.event.gesture_pinck_start((function(t,o){var s=new Date,a={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};e.event.gesture_pinck_end((function(){new Date-s>=500?n():i(a,o)}))}))}}},{key:"destroy",value:function(){var e=this;[this.polyline_id,this.end_id,this.start_id].concat(A()(this.ids)).forEach((function(t){e.remove_entity(t)})),or(t,"destroy",this,3)([])}},{key:"end",value:function(){or(t,"end",this,3)([])}}],[{key:"createPolyline",value:function(e){var t=e.randomString();return e.viewer.entities.add(new Cesium.Entity({id:t,polyline:{positions:new Cesium.CallbackProperty((function(){return e.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(e.options.color||e.defaultColor),dashLength:20}),zIndex:99999999}})),t}},{key:"create_point",value:function(e,t,i){var n=t.label,o=t.image,s=void 0===o?"point.png":o,a=t.width,r=t.height,l=i.randomString(),c=i.cartesian3Towgs84(e,i.viewer);return n&&(n.pixelOffset=new Cesium.Cartesian2(0,-(r||32))),i.viewer.entities.add(new Cesium.Entity({id:l,label:n,position:Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt),billboard:{image:i.getSourceRootPath()+"/img/"+s,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:a,height:r}})),l}}]);var i,n,s,r}(er);function ar(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return rr(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)?rr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function rr(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 lr(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function cr(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var ur=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=lr(this,t,[e,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i}return un()(t,e),x()(t,[{key:"clampToGroundMeasure",value:(s=o()(a.a.mark((function e(t,i){var n,o,s,r,l,c,u,h,p,d=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],this.ids.forEach((function(e,t){var i=d.viewer.entities.getById(e).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,t),s=[],o.forEach((function(e,t){0===t?s=A()(e.geometry.coordinates):s.push(e.geometry.coordinates[1])})),r=s.length,l=ar(s),e.prev=7,l.s();case 9:if((c=l.n()).done){e.next=18;break}return u=c.value,h=s.indexOf(u),e.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},h,r);case 14:p=e.sent,i(null,p);case 16:e.next=9;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(7),l.e(e.t0);case 23:return e.prev=23,l.f(),e.finish(23);case 26:case"end":return e.stop()}}),e,this,[[7,20,23,26]])}))),function(e,t){return s.apply(this,arguments)})},{key:"sampleHeight",value:(n=o()(a.a.mark((function e(t,i){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sampleHeightMostDetailed([t]);case 2:return n=e.sent,t.alt=n[0].height,e.abrupt("return",{position:t,index:i});case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getHeight",value:(i=o()(a.a.mark((function e(t,i,n){var o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sampleHeightMostDetailed([t]);case 2:if(o=e.sent,t.alt=o[0].height,this.clampPositions.push({position:t,index:i}),n!==this.clampPositions.length){e.next=8;break}return s=this.startCompute(),e.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return e.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var e=this;this.clampPositions.sort((function(e,t){return e.index<t.index}));var t=0,i=this.clampPositions.length-1;return this.clampPositions.forEach((function(n,o){if(o!==i){var s=e.computeDistance2([n.position,e.clampPositions[o+1].position]),a=Math.abs(n.position.alt-e.clampPositions[o+1].position.alt),r=Math.sqrt(s*s+a*a);t+=r}})),Number(t.toFixed(2))}},{key:"getLabel",value:function(e){return{text:e||"",font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#f1e605"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}}},{key:"start",value:function(){var e=this;if(!YJ.Measure.GetMeasureStatus()){cr(t,"start",this,3)([]),this.positions=[],this.cachePositions=[];var i=function(){var i=o()(a.a.mark((function i(n,o){var s,r,l,c,u;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:0===e.ids.length&&(e.polyline_id=t.createPolyline(e),e.start_id=t.create_point(o,{image:"start1.png",width:30,height:38,label:e.getLabel("")},e)),e.positions=e.cachePositions.concat(o),e.tip.setPosition(o,n.position.x,n.position.y),0!==e.ids.length?(s=e.cartesian3Towgs84(o,e.viewer),r=e.cartesian3Towgs84(e.cachePositions[e.cachePositions.length-1],e.viewer),l=e.computeDistance2([s,r]),c="投影距离:"+l+" 米",e.ids.push(t.create_point(o,{label:e.getLabel(c)},e)),e.cachePositions.push(o)):(e.cachePositions.push(o),e.ids.push(t.create_point(o,{show:!1},e)),(u=e.viewer.entities.getById(e.ids[0]))&&(u.billboard.show=!1));case 4:case"end":return i.stop()}}),i)})));return function(e,t){return i.apply(this,arguments)}}(),n=function(i,n){if(e.cachePositions.length){e.positions=e.cachePositions,e.end_id=t.create_point(e.cachePositions[e.cachePositions.length-1],{image:"end1.png",width:30,height:38},e);var o=e.viewer.entities.getById(e.ids[e.ids.length-1]);o&&(o.billboard.show=!1)}e.cachePositions.length<2&&(e.destroy(),YJ.Measure.Measures.pop()),e.end()};this.event.mouse_left(i),this.event.mouse_move((function(t,i){if(e.tip.setPosition(i,t.endPosition.x,t.endPosition.y),e.positions=e.cachePositions.concat(i),e.cachePositions.length){var n=e.cartesian3Towgs84(i,e.viewer),o=e.cartesian3Towgs84(e.cachePositions[e.cachePositions.length-1],e.viewer),s="当前投影距离:"+e.computeDistance2([n,o])+" 米";e.tip.set_text(s)}})),this.event.mouse_right(n),this.event.mouse_right_keyboard_ctrl((function(t,i){e.cachePositions.length&&(e.cachePositions.pop(),e.remove_entity(e.ids.pop()))})),this.event.gesture_pinck_start((function(t,o){var s=new Date,a={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};e.event.gesture_pinck_end((function(){new Date-s>=500?n():i(a,o)}))}))}}},{key:"destroy",value:function(){var e=this;[this.polyline_id,this.end_id,this.start_id].concat(A()(this.ids)).forEach((function(t){e.remove_entity(t)})),cr(t,"destroy",this,3)([])}},{key:"end",value:function(){cr(t,"end",this,3)([])}}],[{key:"createPolyline",value:function(e){var t=e.randomString();return e.viewer.entities.add(new Cesium.Entity({id:t,polyline:{positions:new Cesium.CallbackProperty((function(){return e.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(e.options.color||e.defaultColor),dashLength:20})},zIndex:99999999})),t}},{key:"create_point",value:function(e,t,i){var n=t.label,o=t.image,s=void 0===o?"point.png":o,a=t.width,r=t.height,l=i.randomString(),c=i.cartesian3Towgs84(e,i.viewer);return n&&(n.pixelOffset=new Cesium.Cartesian2(0,-(r||32))),i.viewer.entities.add(new Cesium.Entity({id:l,label:n,position:Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt),billboard:{image:i.getSourceRootPath()+"/img/"+s,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:a,height:r}})),l}}]);var i,n,s}(er);function hr(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return pr(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)?pr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function pr(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 dr(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function mr(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var fr=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=dr(this,t,[e,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i.event=new K(e),i}return un()(t,e),x()(t,[{key:"clampToGroundMeasure",value:(s=o()(a.a.mark((function e(t,i){var n,o,s,r,l,c,u,h,p,d=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],this.ids.forEach((function(e,t){var i=d.viewer.entities.getById(e).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,t),s=[],o.forEach((function(e,t){0===t?s=A()(e.geometry.coordinates):s.push(e.geometry.coordinates[1])})),r=s.length,l=hr(s),e.prev=7,l.s();case 9:if((c=l.n()).done){e.next=18;break}return u=c.value,h=s.indexOf(u),e.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},h,r);case 14:p=e.sent,i(null,p);case 16:e.next=9;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(7),l.e(e.t0);case 23:return e.prev=23,l.f(),e.finish(23);case 26:case"end":return e.stop()}}),e,this,[[7,20,23,26]])}))),function(e,t){return s.apply(this,arguments)})},{key:"sampleHeight",value:(n=o()(a.a.mark((function e(t,i){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sampleHeightMostDetailed([t]);case 2:return n=e.sent,t.alt=n[0].height,e.abrupt("return",{position:t,index:i});case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getHeight",value:(i=o()(a.a.mark((function e(t,i,n){var o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sampleHeightMostDetailed([t]);case 2:if(o=e.sent,t.alt=o[0].height,this.clampPositions.push({position:t,index:i}),n!==this.clampPositions.length){e.next=8;break}return s=this.startCompute(),e.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return e.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var e=this;this.clampPositions.sort((function(e,t){return e.index<t.index}));var t=0,i=this.clampPositions.length-1;return this.clampPositions.forEach((function(n,o){if(o!==i){var s=e.computeDistance2([n.position,e.clampPositions[o+1].position]),a=Math.abs(n.position.alt-e.clampPositions[o+1].position.alt),r=Math.sqrt(s*s+a*a);t+=r}})),Number(t.toFixed(2))}},{key:"getLabel",value:function(e){return{text:e||"",font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#f1e605"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}}},{key:"start",value:function(){var e=this;if(!YJ.Measure.GetMeasureStatus()){mr(t,"start",this,3)([]),this.positions=[],this.cachePositions=[];var i=function(i,n){if(0===e.ids.length&&(e.polyline_id=t.createPolyline(e),e.start_id=t.create_point(n,{image:"start1.png",width:30,height:38,label:e.getLabel("")},e)),e.tip.setPosition(n,i.position.x,i.position.y),e.positions=e.cachePositions.concat(n),0!==e.ids.length){var o=e.cartesian3Towgs84(n,e.viewer),s=e.cartesian3Towgs84(e.cachePositions[e.cachePositions.length-1],e.viewer);o.lng===s.lng&&o.lat===s.lat&&o.alt===s.alt||(e.cachePositions.push(n),e.computeAngle(s,o))}else{e.cachePositions.push(n),e.ids.push(t.create_point(n,{},e));var a=e.viewer.entities.getById(e.ids[0]);a&&(a.billboard.show=!1)}},n=function(i,n){if(0!==e.ids.length||e.ids.push(t.create_point(n,{},e)),e.cachePositions.length){e.positions=e.cachePositions,e.end_id=t.create_point(e.cachePositions[e.cachePositions.length-1],{image:"end1.png",width:30,height:38},e);var o=e.viewer.entities.getById(e.ids[e.ids.length-1]);o&&(o.billboard.show=!1)}e.cachePositions.length<2&&(e.destroy(),YJ.Measure.Measures.pop()),e.end()};this.event.mouse_left(i),this.event.mouse_move((function(t,i){t.endPosition.y+=2;var n=t.endPosition,o=e.viewer.scene.pickPosition(n);if(!o){var s=e.viewer.camera.getPickRay(n);o=e.viewer.scene.globe.pick(s,e.viewer.scene)}if(e.tip.setPosition(i,t.endPosition.x,t.endPosition.y),e.positions=e.cachePositions.concat(o),e.cachePositions.length){var a=e.cartesian3Towgs84(o,e.viewer),r=e.cartesian3Towgs84(e.cachePositions[e.cachePositions.length-1],e.viewer),l=e.computeDistance2([r,a]),c=Math.abs(r.alt-a.alt),u=l/Math.sqrt(l*l+c*c),h=Math.acos(u),p="坡度:"+e.radiansToDegrees(h).toFixed(2)+"°";e.tip.set_text(p)}})),this.event.mouse_right(n),this.event.mouse_right_keyboard_ctrl((function(t,i){e.cachePositions.length&&(e.cachePositions.pop(),e.remove_entity(e.ids.pop()))})),this.event.gesture_pinck_start((function(t,o){var s=new Date,a={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};e.event.gesture_pinck_end((function(){new Date-s>=500?n(0,o):i(a,o)}))}))}}},{key:"computeAngle",value:function(e,i){var n=this.computeDistance2([e,i]),o=Math.abs(e.alt-i.alt),s=n/Math.sqrt(n*n+o*o),a=Math.acos(s),r=this.radiansToDegrees(a),l=this.getLabel("坡度:"+r.toFixed(2)+"°");l.pixelOffset=new Cesium.Cartesian2(0,-32),this.ids.push(t.create_point(Cesium.Cartesian3.fromDegrees(i.lng,i.lat,i.alt),{label:l},this))}},{key:"destroy",value:function(){var e=this;[this.polyline_id,this.end_id,this.start_id].concat(A()(this.ids)).forEach((function(t){e.remove_entity(t)})),mr(t,"destroy",this,3)([])}},{key:"end",value:function(){mr(t,"end",this,3)([])}}],[{key:"createPolyline",value:function(e){var t=e.randomString();return e.viewer.entities.add(new Cesium.Entity({id:t,polyline:{positions:new Cesium.CallbackProperty((function(){return e.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(e.options.color||e.defaultColor),dashLength:20}),zIndex:99999999}})),t}},{key:"create_point",value:function(e,t,i){var n=t.label,o=t.image,s=void 0===o?"point.png":o,a=t.width,r=t.height,l=i.randomString(),c=i.cartesian3Towgs84(e,i.viewer);return n&&(n.pixelOffset=new Cesium.Cartesian2(0,-(r||32))),i.viewer.entities.add(new Cesium.Entity({id:l,label:n,position:Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt),billboard:{image:i.getSourceRootPath()+"/img/"+s,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:a,height:r}})),l}}]);var i,n,s}(er);function vr(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 gr(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?vr(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):vr(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function yr(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function br(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var Cr=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=yr(this,t,[e,n])).options.lineColor="#ffdf53",i.polygon_id="",i}return un()(t,e),x()(t,[{key:"start",value:function(){var e=this;if(!YJ.Measure.GetMeasureStatus()){br(t,"start",this,3)([]),this.ids=[],this.positions=[],this.text="",this.center=new Cesium.Cartesian3,this.cachePositions=[];var i,n=0,o=0,s=function(s,a){0===e.ids.length&&(e.polygon_id=t.create_polygon(e)),e.cachePositions.push(gr({},a)),e.ids.push(e.create_point(gr({},a),!1));var r=e.cartesian3Towgs84(gr({},a),e.viewer);if(r.alt>n&&(n=r.alt),e.positions=e.cachePositions.concat(gr({},a)),e.tip.setPosition(gr({},a),s.position.x,s.position.y),e.positions.length>2){var l=[];e.positions.forEach((function(t){var i=e.cartesian3Towgs84(t,e.viewer);l.push({lng:i.lng,lat:i.lat})}));var c=e.computeCenter(l),u=e.computeArea(l);o=u,e.center=new Cesium.Cartesian3.fromDegrees(c.lng,c.lat,n),i=e.center,e.text="投影面积:"+u+" ㎡"}};this.event.mouse_left(s),this.event.mouse_move((function(t,i){if(e.tip.setPosition(gr({},i),t.endPosition.x,t.endPosition.y),e.positions=e.cachePositions.concat(gr({},i)),e.positions.length>2){var o=[];e.positions.forEach((function(t){var i=e.cartesian3Towgs84(t,e.viewer);o.push({lng:i.lng,lat:i.lat})}));var s=e.computeCenter(o),a=e.computeArea(o);e.center=new Cesium.Cartesian3.fromDegrees(s.lng,s.lat,n),e.text="投影面积:"+a+" ㎡"}})),this.event.mouse_right((function(t,n){if(e.positions=e.cachePositions,e.center=i,e.positions.length<3){e.text="";console.warn("面积计算至少需要三个坐标!"),window.ELEMENT&&window.ELEMENT.Message({message:"面积计算至少需要三个坐标!",type:"warning",duration:1500}),e.destroy()}else e.text="投影面积:"+o+" ㎡";e.end()})),this.event.gesture_pinck_start((function(t,i){var n=new Date,o={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};e.event.gesture_pinck_end((function(){new Date-n>=500?(e.positions=e.cachePositions,e.end()):s(o,i)}))}))}}},{key:"destroy",value:function(){var e=this;[this.polygon_id].concat(A()(this.ids)).forEach((function(t){e.remove_entity(t)})),br(t,"destroy",this,3)([])}},{key:"end",value:function(){br(t,"end",this,3)([])}}],[{key:"create_polygon",value:function(e){var t=e.randomString();new Cesium.NearFarScalar(2e3,1,1e5,0),e.viewer.entities.add(new Cesium.Entity({id:t,label:{text:new Cesium.CallbackProperty((function(){return e.text}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#ffffff"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM},position:new Cesium.CallbackProperty((function(){return e.center}),!1),polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(t){return new Cesium.PolygonHierarchy(e.positions)}),!1),material:new Cesium.Color.fromCssColorString(e.options.color||e.defaultColor),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(){return e.positions.length?e.positions.concat(e.positions[0]):e.positions}),!1),width:2,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(e.options.lineColor||e.defaultColor),dashLength:20}),clampToGround:!0,zIndex:99999999}}));return t}}])}(er);function wr(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 kr(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?wr(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):wr(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function _r(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function xr(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var Er=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=_r(this,t,[e,n])).options.lineColor="#ffdf53",i.polygon_id="",i}return un()(t,e),x()(t,[{key:"start",value:function(){var e=this;if(!YJ.Measure.GetMeasureStatus()){xr(t,"start",this,3)([]),this.ids=[],this.positions=[],this.text="",this.center=new Cesium.Cartesian3,this.cachePositions=[];var i=0,n=function(n,o){0===e.ids.length&&(e.polygon_id=t.create_polygon(e)),e.cachePositions.push(kr({},o)),e.ids.push(e.create_point(kr({},o),!1));var s=e.cartesian3Towgs84(kr({},o),e.viewer);s.alt>i&&(i=s.alt),e.positions=e.cachePositions.concat(kr({},o)),e.tip.setPosition(kr({},o),n.position.x,n.position.y)},o=function(t,n){if(e.positions=e.cachePositions,e.positions.length>2){var o=[];e.positions.forEach((function(t){var i=e.cartesian3Towgs84(t,e.viewer);o.push({lng:i.lng,lat:i.lat})})),setTimeout((function(){var t=e.computeCenter(o),n=e.computeSignedArea(e.viewer,o);e.center=new Cesium.Cartesian3.fromDegrees(t.lng,t.lat,i),e.text="贴地面积:"+n+" ㎡"}),0)}else{console.warn("面积计算至少需要三个坐标!"),window.ELEMENT&&window.ELEMENT.Message({message:"面积计算至少需要三个坐标!",type:"warning",duration:1500}),e.destroy()}e.end()};this.event.mouse_left(n),this.event.mouse_move((function(t,i){e.tip.setPosition(kr({},i),t.endPosition.x,t.endPosition.y),e.positions=e.cachePositions.concat(kr({},i))})),this.event.mouse_right(o),this.event.gesture_pinck_start((function(t,i){var s=new Date,a={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};e.event.gesture_pinck_end((function(){new Date-s>=500?o():n(a,i)}))}))}}},{key:"destroy",value:function(){var e=this;[this.polygon_id].concat(A()(this.ids)).forEach((function(t){e.remove_entity(t)})),xr(t,"destroy",this,3)([])}},{key:"end",value:function(){xr(t,"end",this,3)([])}}],[{key:"create_polygon",value:function(e){var t=e.randomString();new Cesium.NearFarScalar(2e3,1,1e5,0),e.viewer.entities.add(new Cesium.Entity({id:t,label:{text:new Cesium.CallbackProperty((function(){return e.text}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#ffffff"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM},position:new Cesium.CallbackProperty((function(){return e.center}),!1),polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(t){return new Cesium.PolygonHierarchy(e.positions)}),!1),material:new Cesium.Color.fromCssColorString(e.options.color||e.defaultColor),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(){return e.positions.length?e.positions.concat(e.positions[0]):e.positions}),!1),width:2,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(e.options.lineColor||e.defaultColor),dashLength:20}),clampToGround:!0,zIndex:99999999}}));return t}}])}(er);function Sr(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function Pr(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var Dr=function(e){function t(e){return k()(this,t),Sr(this,t,[e])}return un()(t,e),x()(t,[{key:"cal_center",value:function(e){var t=this.cartesian3Towgs84(e[0],this.viewer),i=this.cartesian3Towgs84(e[1],this.viewer),n=this.computeCenter([t,i]);return Cesium.Cartesian3.fromDegrees(n.lng,n.lat,(t.alt+i.alt)/2)}},{key:"cal_distance",value:function(e){var t=this.cartesian3Towgs84(e[0],this.viewer),i=this.cartesian3Towgs84(e[1],this.viewer),n=this.computeDistance2([t,i]);return t.alt=t.alt.toFixed(2),i.alt=i.alt.toFixed(2),t.alt===i.alt?n:0===Number(n)?Math.abs(t.alt-i.alt).toFixed(2):Math.sqrt(n*n+Math.pow(Math.abs(t.alt-i.alt).toFixed(2),2)).toFixed(2)}},{key:"createPolyline",value:function(e){var t=this,i=this.id_map.get(e);this.viewer.entities.add(new Cesium.Entity({id:e,position:new Cesium.CallbackProperty((function(){return 2===i.positions.length?t.cal_center(i.positions):Cesium.Cartesian3()}),!1),label:{text:new Cesium.CallbackProperty((function(){return 2===i.positions.length?t.cal_distance(i.positions)+"米":"0米"}),!1),scale:1,fillColor:Cesium.Color.RED,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(0,-10),disableDepthTestDistance:Number.POSITIVE_INFINITY},polyline:{positions:new Cesium.CallbackProperty((function(){return i.positions}),!1),width:2,material:Cesium.Color.YELLOW,zIndex:99999999}})),this.ids.push(e)}},{key:"create_angle_label",value:function(e,t,i,n){var o=this,s=new Cesium.Entity({id:i,position:new Cesium.CallbackProperty((function(){return 2===e.length?o.cal_point(e,t):Cesium.Cartesian3()})),label:{text:new Cesium.CallbackProperty((function(){return 2===e.length?o.cal_angle(e,t,n)+"°":"0°"}),!1),scale:1,fillColor:Cesium.Color.RED,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(15,-10)}});this.viewer.entities.add(s)}},{key:"cal_point",value:function(e,t){for(var i=0;i<e.length;i++)for(var n=0;n<t.length;n++)if(e[i].x===t[n].x&&e[i].y===t[n].y&&e[i].z===t[n].z)return e[i]}},{key:"cal_angle",value:function(e,t,i){if(1===i)return 90;if(2===i||3===i){var n=this.id_map.get(e).positions,o=this.id_map.get(t).positions,s=this.cartesian3Towgs84(n[0],this.viewer),a=this.cartesian3Towgs84(n[1],this.viewer),r=this.computeDistance2([a,s]),l=this.cartesian3Towgs84(o[0],this.viewer),c=this.cartesian3Towgs84(o[1],this.viewer),u=this.computeDistance2([l,c]),h=Math.abs(l.alt-c.alt),p=Math.sqrt(Math.pow(h,2)+Math.pow(u,2));return 0==r&&(r=Math.abs(a.alt-s.alt)),(180*Math.acos(r/p)/Math.PI).toFixed(2)}}},{key:"start",value:function(){var e=this;if(!YJ.Measure.GetMeasureStatus()){Pr(t,"start",this,3)([]),this.positions=[],this.cachePositions=[];var i=this.randomString(),n=this.randomString(),o=this.randomString(),s=(this.randomString(),this.randomString(),this.randomString(),[]);this.id_map=new Map;var a={};this.id_map.set(o,{positions:[]}),this.id_map.set(i,{positions:[]}),this.id_map.set(n,{positions:[]});var r=function(t,r){if(s.push(r),0===e.ids.length&&(a=e.cartesian3Towgs84(r,e.viewer),e.createPolyline(i),e.createPolyline(n),e.createPolyline(o)),e.ids.push(e.create_point(r)),e.tip.setPosition(r,t.position.x,t.position.y),s.length){var l=e.cartesian3Towgs84(r,e.viewer),c=e.id_map.get(n),u=e.id_map.get(i);l.alt<a.alt?(c.positions[0]=r,c.positions[1]=Cesium.Cartesian3.fromDegrees(l.lng,l.lat,a.alt),u.positions[0]=Cesium.Cartesian3.fromDegrees(l.lng,l.lat,a.alt),u.positions[1]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,a.alt)):(c.positions[0]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,l.alt),c.positions[1]=r,u.positions[0]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,l.alt),u.positions[1]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,a.alt))}2===s.length&&e.end()};this.event.mouse_left(r),this.event.mouse_move((function(t,r){e.tip.setPosition(r,t.endPosition.x,t.endPosition.y);var l=e.id_map.get(o);if(s.length){l.positions=s.concat(r);var c=e.cartesian3Towgs84(r,e.viewer),u=e.id_map.get(n),h=e.id_map.get(i);c.alt<a.alt?(u.positions[0]=r,u.positions[1]=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,a.alt),h.positions[0]=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,a.alt),h.positions[1]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,a.alt)):(u.positions[0]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,c.alt),u.positions[1]=r,h.positions[0]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,c.alt),h.positions[1]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,a.alt))}})),this.event.mouse_right((function(t,i){e.end()})),this.event.gesture_pinck_start((function(t,i){var n=new Date,o={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};e.event.gesture_pinck_end((function(){new Date-n>=500?e.end():r(o,i)}))}))}}},{key:"end",value:function(){Pr(t,"end",this,3)([])}},{key:"destroy",value:function(){Pr(t,"destroy",this,3)([])}}])}(er);function Mr(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function Tr(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var Or=function(e){function t(e){var i;return k()(this,t),(i=Mr(this,t,[e,{text:""}])).defaultColor="#f11515",i.locationID=i.randomString(),i.position=new Cesium.Cartesian3,i.text="",i}return un()(t,e),x()(t,[{key:"start",value:function(){var e=this;if(!YJ.Measure.GetMeasureStatus()){Tr(t,"start",this,3)([]),this.cache_id=t.create_point(this),t.createLocation(this);var i=function(t,i){e.position=i;var n=e.viewer.entities.getById(e.locationID);n&&(n.show=!0);var o=e.cartesian3Towgs84(i,e.viewer),s=ci();if("EPSG:4326"===s)e.text="经度:".concat(Number(o.lng.toFixed(8)),"\n纬度:").concat(Number(o.lat.toFixed(8)),"\n海拔:").concat(Number(o.alt.toFixed(2)));else{var a=e.convert([{x:o.lng,y:o.lat,z:o.alt}],"EPSG:4326",s);e.text="x:".concat(Number(a.points[0].x.toFixed(8)),"\ny:").concat(Number(a.points[0].y.toFixed(8)),"\nz:").concat(Number(a.points[0].z.toFixed(2)))}e.end()};this.event.mouse_left(i),this.event.mouse_right((function(t,i){e.destroy(),e.end()})),this.event.mouse_move((function(t,i){e.tip.setPosition(i,t.endPosition.x,t.endPosition.y);var n=e.viewer.entities.getById(e.locationID);n&&(n.show=!0),e.position=i;var o=e.cartesian3Towgs84(i,e.viewer),s=ci();if("EPSG:4326"===s)e.text="经度:".concat(Number(o.lng.toFixed(8)),"\n纬度:").concat(Number(o.lat.toFixed(8)),"\n海拔:").concat(Number(o.alt.toFixed(2)));else{var a=e.convert([{x:o.lng,y:o.lat,z:o.alt}],"EPSG:4326",s);e.text="x:".concat(Number(a.points[0].x.toFixed(8)),"\ny:").concat(Number(a.points[0].y.toFixed(8)),"\nz:").concat(Number(a.points[0].z.toFixed(2)))}})),this.event.gesture_pinck_start((function(t,n){var o=new Date;t.position1.x,t.position2.x,t.position1.y,t.position2.y;e.event.gesture_pinck_end((function(){new Date-o>=500?(e.destroy(),e.end()):i(0,n)}))}))}}},{key:"destroy",value:function(){this.remove_entity(this.locationID),this.remove_entity(this.cache_id),Tr(t,"destroy",this,3)([])}},{key:"end",value:function(){Tr(t,"end",this,3)([])}}],[{key:"createLocation",value:function(e){e.viewer.entities.add(new Cesium.Entity({id:e.locationID,show:!1,position:new Cesium.CallbackProperty((function(){return e.position}),!1),label:{text:new Cesium.CallbackProperty((function(){return e.text}),!1),font:"22px Microsoft YaHei",fillColor:new Cesium.Color.fromCssColorString(e.defaultColor),style:Cesium.LabelStyle.FILL_AND_OUTLINE,horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,pixelOffset:new Cesium.Cartesian2(-100,-50)},billboard:{image:e.getSourceRootPath()+"/img/location.png",color:Cesium.Color.fromCssColorString("rgba(255,255,255,0.99)"),disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,width:48,height:48}}))}},{key:"create_point",value:function(e){var t=e.randomString();return e.viewer.entities.add(new Cesium.Entity({id:t,position:new Cesium.CallbackProperty((function(){return e.position}),!1),billboard:C()({image:e.getSourceRootPath()+"/img/point.png",color:Cesium.Color.fromCssColorString("rgba(255,255,255,0.99)"),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY},"color",Cesium.Color.WHITE.withAlpha(.99))})),t}}])}(er);function Nr(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function Br(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var Ar=function(e){function t(e){return k()(this,t),Nr(this,t,[e,{text:"左键开始,右键取消"}])}return un()(t,e),x()(t,[{key:"start",value:function(){var e=this;if(!YJ.Measure.GetMeasureStatus()){Br(t,"start",this,3)([]),this.positions=[],this.position=new Cesium.Cartesian3,this.height=0,this.text="",this.circleRadius=0;var i=0;this.firstpoint=null;var n=function(n,o){if(null===e.firstpoint&&(e.positions.push(o),e.firstpoint=e.cartesian3Towgs84(o,e.viewer),e.ids.push(t.create_polygon(e)),e.ids.push(t.create_point(e,o))),i++,e.tip.setPosition(o,n.position.x,n.position.y),2===i){if(e.firstpoint){var s=e.cartesian3Towgs84(o,e.viewer);e.positions[1]=Cesium.Cartesian3.fromDegrees(e.firstpoint.lng,e.firstpoint.lat,s.alt),e.positions[2]=o,e.position=e.positions[1],e.circleRadius=e.computeDistance2([e.firstpoint,s]),e.height=Number((s.alt-e.firstpoint.alt).toFixed(2)),e.text="相对高度:"+e.height+" 米",e.tip.set_text("左键完成,右键取消;半径:"+e.circleRadius+" 米")}e.ids.push(t.create_point(e,o,{label:{text:"半径:"+e.circleRadius+" 米"}})),e.end()}};this.event.mouse_left(n),this.event.mouse_move((function(t,i){if(e.tip.setPosition(i,t.endPosition.x,t.endPosition.y),e.firstpoint){var n=e.cartesian3Towgs84(i,e.viewer);e.positions[1]=Cesium.Cartesian3.fromDegrees(e.firstpoint.lng,e.firstpoint.lat,n.alt),e.positions[2]=i,e.position=e.positions[1],e.circleRadius=e.computeDistance2([e.firstpoint,n]),e.height=Number((n.alt-e.firstpoint.alt).toFixed(2)),e.text="相对高度:"+e.height+" 米",e.tip.set_text("左键完成,右键取消;半径:"+e.circleRadius+" 米")}})),this.event.mouse_right((function(t,i){e.end(),e.destroy()})),this.event.gesture_pinck_start((function(t,i){var o=new Date,s={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};e.event.gesture_pinck_end((function(){new Date-o>=500?(e.end(),e.destroy()):n(s,i)}))}))}}},{key:"end",value:function(){Br(t,"end",this,3)([])}},{key:"destroy",value:function(){Br(t,"destroy",this,3)([])}}],[{key:"create_polygon",value:function(e){var t=e.randomString();e.viewer.entities.add(new Cesium.Entity({id:t,billboard:{image:e.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)},position:new Cesium.CallbackProperty((function(){return e.position}),!1),label:{text:new Cesium.CallbackProperty((function(){return e.text}),!1),scale:1,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(0,-15),disableDepthTestDistance:Number.POSITIVE_INFINITY},polyline:{positions:new Cesium.CallbackProperty((function(t){return e.positions}),!1),width:2,material:Cesium.Color.YELLOW,zIndex:99999999},ellipse:{height:new Cesium.CallbackProperty((function(){return e.height+e.firstpoint.alt}),!1),semiMinorAxis:new Cesium.CallbackProperty((function(t){return e.circleRadius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(t){return e.circleRadius}),!1),material:new Cesium.Color.fromCssColorString(e.defaultColor)}}));return t}},{key:"create_point",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=e.randomString(),o=e.cartesian3Towgs84(t,e.viewer),s={id:n,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),billboard:{image:e.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}};return i.label&&(s.label={text:i.label.text,scale:1,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(0,-15)}),e.viewer.entities.add(new Cesium.Entity(s)),n}}])}(er);function Lr(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function Ir(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var jr=function(e){function t(e){var i;return k()(this,t),(i=Lr(this,t,[e,{text:"左键开始,右键取消"}])).cachePositions=[],i.positions=[],i.arcPositions=[],i.line_id="",i.label_id="",i.arc_id="",i.bearing=0,i}return un()(t,e),x()(t,[{key:"createPolyline",value:function(){var e=this,t=e.randomString();return e.viewer.entities.add(new Cesium.Entity({id:t,polyline:{positions:new Cesium.CallbackProperty((function(){return e.positions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(e.options.color||e.defaultColor),zIndex:99999999}})),t}},{key:"end",value:function(){Ir(t,"end",this,3)([])}},{key:"destroy",value:function(){var e=this;Ir(t,"destroy",this,3)([]),[this.line_id,this.label_id,this.arc_id].forEach((function(t){t&&e.remove_entity(t)}))}},{key:"cancel",value:function(){this.end(),this.destroy()}},{key:"caculateAngle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this.cartesian3Towgs84(e[0],this.viewer),i=this.cartesian3Towgs84(e[1],this.viewer),n=this.cartesian3Towgs84(e[2],this.viewer),o=turf.point([t.lng,t.lat]),s=turf.point([i.lng,i.lat]),a=turf.point([n.lng,n.lat]),r={units:"kilometers"},l=turf.rhumbDistance(o,s,r),c=turf.rhumbDistance(a,s,r),u=l;l>c&&(u=c);var h=turf.rhumbBearing(o,s),p=turf.rhumbBearing(a,s),d=Math.abs((h-p+360)%360);this.bearing=d>180?360-d:d,this.bearing=this.bearing.toFixed(2);var m=h-180,f=p-180,v=turf.lineArc(s,u/3,f,m);d>180&&(v=turf.lineArc(s,u/3,m,f));for(var g=[],y=0;y<v.geometry.coordinates.length;y++)g.push(Cesium.Cartesian3.fromDegrees(v.geometry.coordinates[y][0],v.geometry.coordinates[y][1]));this.arcPositions=g}},{key:"start",value:function(){var e=this;if(!YJ.Measure.GetMeasureStatus()){Ir(t,"start",this,3)([]);var i=function(t,i){if(0===e.ids.length&&(e.line_id=e.createPolyline()),e.ids.push(e.create_point(i)),e.tip.setPosition(i,t.position.x,t.position.y),e.cachePositions.push(i),e.cachePositions.length&&(e.positions=e.cachePositions.concat(i)),2===e.ids.length){e.label_id=Cesium.createGuid(),e.arc_id=Cesium.createGuid();var n=e.cartesian3Towgs84(i,e.viewer);e.sampleHeightMostDetailed([n]).then((function(t){e.viewer.entities.add({id:e.arc_id,polyline:{positions:new Cesium.CallbackProperty((function(){return e.arcPositions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(e.options.color||e.defaultColor),zIndex:99999999}}),e.viewer.entities.add({id:e.label_id,position:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,(t[0].height||0)+.1),label:{text:new Cesium.CallbackProperty((function(){return"夹角:"+e.bearing+"°"}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#f1e605"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}))}3===e.ids.length&&(e.caculateAngle([e.positions[0],e.positions[1],e.positions[2]]),e.end())};this.event.mouse_left(i),this.event.mouse_move((function(t,i){e.tip.setPosition(i,t.endPosition.x,t.endPosition.y),e.cachePositions.length&&(e.positions=e.cachePositions.concat(i)),e.positions.length>2&&e.caculateAngle([e.positions[0],e.positions[1],e.positions[2]])})),this.event.mouse_right((function(t,i){e.cancel()})),this.event.gesture_pinck_start((function(t,n){var o=new Date,s={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};e.event.gesture_pinck_end((function(){new Date-o>=500?e.cancel():i(s,n)}))}))}}}])}(er);function Rr(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function Fr(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var zr=function(e){function t(e){var i;return k()(this,t),(i=Rr(this,t,[e,{text:"左键开始,右键取消"}])).cachePositions=[],i.positions=[],i.arcPositions=[],i.line_id="",i.label_id="",i.arc_id="",i.bearing=0,i}return un()(t,e),x()(t,[{key:"createPolyline",value:function(){var e=this,t=e.randomString();return e.viewer.entities.add(new Cesium.Entity({id:t,polyline:{positions:new Cesium.CallbackProperty((function(){return e.positions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(e.options.color||e.defaultColor),zIndex:99999999}})),t}},{key:"end",value:function(){Fr(t,"end",this,3)([])}},{key:"destroy",value:function(){var e=this;Fr(t,"destroy",this,3)([]),[this.line_id,this.label_id,this.arc_id].forEach((function(t){t&&e.remove_entity(t)}))}},{key:"cancel",value:function(){this.end(),this.destroy()}},{key:"caculateAngle",value:function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=this.cartesian3Towgs84(e[1],this.viewer),i=this.cartesian3Towgs84(e[0],this.viewer),n=turf.point([t.lng,t.lat]),o=turf.point([i.lng,i.lat]),s=this.rhumbBearing(i,t);this.bearing=(180+s).toFixed(2);for(var a=turf.rhumbDistance(n,o,{units:"kilometers"}),r=turf.lineArc(n,a/3,0,this.bearing),l=[],c=0;c<r.geometry.coordinates.length;c++)l.push(Cesium.Cartesian3.fromDegrees(r.geometry.coordinates[c][0],r.geometry.coordinates[c][1]));this.arcPositions=l}},{key:"start",value:function(){var e=this;if(!YJ.Measure.GetMeasureStatus()){Fr(t,"start",this,3)([]);var i=function(){var t=o()(a.a.mark((function t(i,n){var o,s,r,l,c,u,h,p,d,m;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0===e.ids.length&&(e.line_id=e.createPolyline()),e.tip.setPosition(n,i.position.x,i.position.y),e.cachePositions.length&&(e.positions=e.cachePositions.concat(n),s=e.cartesian3Towgs84(n,e.viewer),r=e.cartesian3Towgs84(e.positions[1],e.viewer),l=turf.point([r.lng,r.lat]),c=turf.point([s.lng,s.lat]),u={units:"kilometers"},h=turf.rhumbDistance(l,c,u),0,p=turf.destination(l,h,0,u),e.positions[0]=(o=Cesium.Cartesian3).fromDegrees.apply(o,A()(p.geometry.coordinates))),e.cachePositions.push(n),e.cachePositions.push(n),e.positions.length>2&&e.caculateAngle([e.positions[0],e.positions[1]],[e.positions[2],e.positions[1]]),!(e.ids.length>=2)){t.next=9;break}return e.end(),t.abrupt("return");case 9:if(e.ids.push(e.create_point(n)),e.ids.push(e.create_point(n)),2!==e.ids.length){t.next=20;break}return e.label_id=Cesium.createGuid(),e.arc_id=Cesium.createGuid(),d=e.cartesian3Towgs84(n,e.viewer),t.next=17,e.sampleHeightMostDetailed([d]);case 17:m=t.sent,e.viewer.entities.add({id:e.arc_id,polyline:{positions:new Cesium.CallbackProperty((function(){return e.arcPositions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(e.options.color||e.defaultColor),zIndex:99999999}}),e.viewer.entities.add({id:e.label_id,position:Cesium.Cartesian3.fromDegrees(d.lng,d.lat,(m[0].height||0)+.1),label:{text:new Cesium.CallbackProperty((function(){return"方位夹角:"+e.bearing+"°"}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#f1e605"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}});case 20:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}();this.event.mouse_left(i),this.event.mouse_move((function(t,i){if(e.tip.setPosition(i,t.endPosition.x,t.endPosition.y),e.cachePositions.length){var n;e.positions=e.cachePositions.concat(i);var o=e.cartesian3Towgs84(i,e.viewer),s=e.cartesian3Towgs84(e.positions[1],e.viewer),a=turf.point([s.lng,s.lat]),r=turf.point([o.lng,o.lat]),l={units:"kilometers"},c=turf.rhumbDistance(a,r,l),u=turf.destination(a,c,0,l);e.positions[0]=(n=Cesium.Cartesian3).fromDegrees.apply(n,A()(u.geometry.coordinates))}e.positions.length>2&&e.caculateAngle([e.positions[0],e.positions[1]],[e.positions[2],e.positions[1]])})),this.event.mouse_right((function(t,i){e.cancel()})),this.event.gesture_pinck_start((function(t,n){var o=new Date,s={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};e.event.gesture_pinck_end((function(){new Date-o>=500?e.cancel():i(s,n)}))}))}}}])}(er);function Hr(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Vr=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),(i=Hr(this,t,[e,n])).options.curve=n.curve||!1;var o=Number(n.number);return isNaN(o)?i.options.number=1/0:i.options.number=o<2?2:o,i}return un()(t,e),x()(t,[{key:"smoothHandle",value:function(e){if(e.length>1){for(var t=[],i=[],n=0;n<e.length;n++)i.push(n/(e.length-1));for(var o=new Cesium.CatmullRomSpline({times:i,points:e}),s=20*e.length,a=0;a<=s;a++){var r=o.evaluate(a/s);t.push(r)}return t}return e}},{key:"start",value:function(e){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var l;(i=t,n="start",o=this,s=3,a=aa()(ln()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(e){return a.apply(o,e)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Q("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new K(this.sdk),this.positions=[],this.points_ids=[];var c=[];this.event.mouse_left((function(i,n){if("2D"!==l){if(l="3D",r.positions=c.concat(n),r.tip.setPosition(n,i.position.x,i.position.y),!r.entityHasCreated){var o=t.create_polyline(r,r.viewer);r.points_ids.push(o)}if(c.push(n),r.points_ids.push(r.create_point(n,r.viewer)),c.length>=r.options.number){var s,a=[];if(c.forEach((function(e){a.push(r.cartesian3Towgs84(e,r.viewer))})),r.options.curve){var u=r.smoothHandle(c);s=[];for(var h=0;h<u.length;h++)s[h]=r.cartesian3Towgs84(u[h],r.viewer)}e(null,a,s),r.end()}}})),this.event.mouse_right((function(t,i){if("2D"!==l){var n,o=[];if(c.forEach((function(e){o.push(r.cartesian3Towgs84(e,r.viewer))})),r.options.curve){var s=r.smoothHandle(c);n=[];for(var a=0;a<s.length;a++)n[a]=r.cartesian3Towgs84(s[a],r.viewer)}e(null,o,n),r.end()}})),this.event.mouse_move((function(e,t){"2D"!==l&&(r.positions=c.concat(t),r.tip.setPosition(t,e.endPosition.x,e.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(e,t){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(cartesian))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500){var s,a=[];if(c.forEach((function(e){a.push(r.cartesian3Towgs84(e,r.viewer))})),r.options.curve){var l=r.smoothHandle(c);s=[];for(var u=0;u<l.length;u++)s[u]=r.cartesian3Towgs84(l[u],r.viewer)}e(null,a,s),r.end()}else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),!r.entityHasCreated){var h=t.create_polyline(r,r.viewer);r.points_ids.push(h)}c.push(n),r.points_ids.push(r.create_point(n,r.viewer)),r.positions=c.concat(n)}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new K(this._sdk2D),this.event2D.mouse_left((function(e,i){if("3D"!==l){if(l="2D",r.positions=c.concat(i),r.tip.setPosition(i,e.position.x+r.viewer.canvas.width,e.position.y),!r.entityHasCreated){var n=t.create_polyline(r,r._sdk2D.viewer);r.points_ids.push(n)}c.push(i),r.points_ids.push(r.create_point(i,r._sdk2D.viewer))}})),this.event2D.mouse_right((function(t,i){if("3D"!==l){var n,o=[];if(c.forEach((function(e){o.push(r.cartesian3Towgs84(e,r.viewer))})),r.options.curve){var s=r.smoothHandle(c);n=[];for(var a=0;a<s.length;a++)n[a]=r.cartesian3Towgs84(s[a],r.viewer)}e(null,o,n),r.end()}})),this.event2D.mouse_move((function(e,t){"3D"!==l&&(r.positions=c.concat(t),r.tip.setPosition(t,e.endPosition.x+r.viewer.canvas.width,e.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(e,t){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(cartesian))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500){var s,a=[];if(c.forEach((function(e){a.push(r.cartesian3Towgs84(e,r.viewer))})),r.options.curve){var l=r.smoothHandle(c);s=[];for(var u=0;u<l.length;u++)s[u]=r.cartesian3Towgs84(l[u],r.viewer)}e(null,a,s),r.end()}else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),!r.entityHasCreated){var h=t.create_polyline(r,r._sdk2D.viewer);r.points_ids.push(h)}c.push(n),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),r.positions=c.concat(n)}}))}})))}}}],[{key:"create_polyline",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.viewer;e.entityHasCreated=!0;var i=e.randomString();return t.entities.add(new Cesium.Entity({id:i,polyline:{positions:new Cesium.CallbackProperty((function(){return e.options.curve?e.smoothHandle(e.positions):e.positions}),!1),width:5,material:Cesium.Color.fromCssColorString(e.color),clampToGround:!0,zIndex:99999999}})),i}}])}(la);function Gr(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 Wr(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Gr(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Gr(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Ur(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Yr=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=Ur(this,t,[e,n])).polygonHasCreated=!1,i.rectObject=[],i}return un()(t,e),x()(t,[{key:"computedLastPoint",value:function(e){var t=e[0],i=e[1],n=Cesium.Cartesian3.subtract(i,t,new Cesium.Cartesian3),o=Cesium.Cartesian3.subtract(e[2],t,new Cesium.Cartesian3),s=Cesium.Cartesian3.dot(o,n)/Cesium.Cartesian3.magnitudeSquared(n),a=Cesium.Cartesian3.multiplyByScalar(n,s,new Cesium.Cartesian3),r=Cesium.Cartesian3.add(t,a,new Cesium.Cartesian3),l=Cesium.Cartesian3.distance(e[2],r),c=Cesium.Cartesian3.subtract(e[2],r,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(c,c);var u=Cesium.Cartesian3.multiplyByScalar(c,l,new Cesium.Cartesian3),h=Cesium.Cartesian3.add(i,u,new Cesium.Cartesian3),p=Cesium.Cartesian3.add(t,u,new Cesium.Cartesian3);return[Wr({},h),Wr({},p)]}},{key:"start",value:function(e){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var l;this.polygonHasCreated=!1,(i=t,n="start",o=this,s=3,a=aa()(ln()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(e){return a.apply(o,e)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Q("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new K(this.sdk);var c=0;this.positions=[],this.positionsLine=[],this.points_ids=[];var u=[],h=[];this.event.mouse_left((function(i,n){if("2D"!==l){if(l="3D",c++,r.positions=u.concat(Wr({},n)),r.tip.setPosition(n,i.position.x,i.position.y),!r.polygonHasCreated){var o=t.create_polygon(r);r.points_ids.push(o)}u.push(n),h.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n)),3==c&&(r.end(),e(null,r.rectObject))}})),this.event.mouse_right((function(t,i){"2D"!==l&&(r.end(),e("取消",""))})),this.event.mouse_move((function(e,t){if("2D"!==l&&(r.tip.setPosition(t,e.endPosition.x,e.endPosition.y),2==c)){var i=JSON.parse(JSON.stringify(u)),n=i.concat(Wr({},t)),o=r.computedLastPoint(n);i=i.concat(o),r.positions=i;var s=i.map((function(e){return r.cartesian3Towgs84(e,r.viewer)}));r.rectObject=s}})),this.event.mouse_right_keyboard_ctrl((function(e,t){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),u.pop(),h.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),u.pop(),h.pop(),r.positions=u.concat(cartesian))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)e(null,h),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=t.create_polygon(r);r.points_ids.push(s)}u.push(n),h.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n)),r.positions=u.concat(n)}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new K(this._sdk2D),this.event2D.mouse_left((function(i,n){if("3D"!==l){if(l="2D",c++,r.positions=u.concat(Wr({},n)),r.tip.setPosition(n,i.position.x+r.viewer.canvas.width,i.position.y),!r.polygonHasCreated){var o=t.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(o)}u.push(n),h.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),3==c&&(r.end(),e(null,r.rectObject))}})),this.event2D.mouse_right((function(t,i){"3D"!==l&&(r.end(),e("取消",""))})),this.event2D.mouse_move((function(e,t){if("3D"!==l&&(r.tip.setPosition(t,e.endPosition.x+r.viewer.canvas.width,e.endPosition.y),2==c)){var i=JSON.parse(JSON.stringify(u)),n=i.concat(Wr({},t)),o=r.computedLastPoint(n);i=i.concat(o),r.positions=i;var s=i.map((function(e){return r.cartesian3Towgs84(e,r.viewer)}));r.rectObject=s}})),this.event2D.mouse_right_keyboard_ctrl((function(e,t){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),u.pop(),h.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),u.pop(),h.pop(),r.positions=u.concat(cartesian))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)e(null,h),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=t.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(s)}u.push(n),h.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),r.positions=u.concat(n)}}))}})))}}}],[{key:"create_polygon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.viewer;e.polygonHasCreated=!0;var i=e.randomString();return t.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(t){return new Cesium.PolygonHierarchy(e.positions)})),material:Cesium.Color.fromCssColorString(e.color),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(t){return e.positions.concat(e.positions[0])})),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:99999999}})),i}}])}(la);function Jr(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var qr=function(e){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return k()(this,t),Jr(this,t,[e,i,n])}return un()(t,e),x()(t,[{key:"start",value:function(e){var t=this;if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i=void 0;YJ.Measure.SetMeasureStatus(!0),this.tip=new Q("左键确定,右键结束;",this.sdk),this.event=new K(this.sdk),this.event.mouse_left((function(n,o){t.end();var s=t.cartesian3Towgs84(i||o,t.viewer);e(null,s,Cesium)})),this.event.mouse_right((function(i,n){t.end(),e(!1)})),this.event.mouse_move((function(e,n){i=n,t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),this.event.gesture_pinck_start((function(n,o){var s=new Date;t.event.gesture_pinck_end((function(){if(new Date-s>=500)t.end(),e(!1);else{t.end();var n=t.cartesian3Towgs84(i||o,t.viewer);e(null,n)}}))})),!this._is2D&&this._sdk2D&&(this.event2D=new K(this._sdk2D),this.event2D.mouse_left((function(n,o){t.end();var s=t.cartesian3Towgs84(i||o,t.viewer);e(null,s,Cesium)})),this.event2D.mouse_right((function(i,n){t.end(),e(!1)})),this.event2D.mouse_move((function(e,n){i=n,t.tip.setPosition(n,e.endPosition.x+t.viewer.canvas.width,e.endPosition.y)})),this.event2D.gesture_pinck_start((function(n,o){var s=new Date;t.event2D.gesture_pinck_end((function(){if(new Date-s>=500)t.end(),e(!1);else{t.end();var n=t.cartesian3Towgs84(i||o,t.viewer);e(null,n)}}))})))}}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy(),this.tip&&this.tip.destroy()}}])}(la);function Xr(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Zr=function(e){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),Xr(this,t,[e,i])}return un()(t,e),x()(t,[{key:"start",value:function(e){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var l,c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g.viewer;e.entities.add(new Cesium.Entity({id:g.circle_id,position:new Cesium.CallbackProperty((function(e){if(v){var t=g.computeMidpoint(f,v);return Cesium.Cartesian3.fromDegrees(t.lng,t.lat,v.alt)}return Cesium.Cartesian3()}),!1),label:{text:new Cesium.CallbackProperty((function(e){return d>1e3?"半径:"+(d/1e3).toFixed(2)+" 公里":"半径:"+d+" 米"}),!1),font:"20px Microsoft YaHei",distanceDisplayCondition:1e7,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,fillColor:Cesium.Color.fromCssColorString("#f5ce0a"),style:Cesium.LabelStyle.FILL_AND_OUTLINE},polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(m))}),!1),material:Cesium.Color.fromCssColorString(g.color),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(e){return h}),!1),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:99999999}}))};(i=t,n="start",o=this,s=3,a=aa()(ln()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(e){return a.apply(o,e)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Q("左键开始,右键取消",this.sdk),this.event=new K(this.sdk);var u=0;this.circle_id=this.randomString();var h=[],p=[],d=1,m=[],f={},v=null;this.event.mouse_left((function(t,i){"2D"!==l&&(l="3D",r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i),f=r.cartesian3Towgs84(i,r.viewer),m=r.createCircle(f,.01),p.push(i),c()),2===u&&(h=p.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),e(null,{center:f,radius:Number(d)})))})),this.event.mouse_right((function(t,i){"2D"!==l&&(r.end(),e(!1))})),this.event.mouse_move((function(e,t){"2D"!==l&&(r.tip.setPosition(t,e.endPosition.x,e.endPosition.y),u&&(h=p.concat(t),v=r.cartesian3Towgs84(t,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d)))})),this.event.gesture_pinck_start((function(t,i){if("2D"!==l){var n=new Date;r.event.gesture_pinck_end((function(){new Date-n>=500?(r.end(),e(!1)):(r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i),f=r.cartesian3Towgs84(i,r.viewer),p.push(i),c(),r.tip.setPosition(i,(t.position1.x+t.position2.x)/2,(t.position1.y+t.position2.y)/2)),2===u&&(h=p.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),e(null,{center:f,radius:Number(d)})))}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new K(this._sdk2D),this.event2D.mouse_left((function(t,i){"3D"!==l&&(l="2D",r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i,r._sdk2D.viewer),f=r.cartesian3Towgs84(i,r.viewer),m=r.createCircle(f,.01),p.push(i),c(r._sdk2D.viewer)),2===u&&(h=p.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),e(null,{center:f,radius:Number(d)})))})),this.event2D.mouse_right((function(t,i){"3D"!==l&&(r.end(),e(!1))})),this.event2D.mouse_move((function(e,t){"3D"!==l&&(r.tip.setPosition(t,e.endPosition.x+r.viewer.canvas.width,e.endPosition.y),u&&(h=p.concat(t),v=r.cartesian3Towgs84(t,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d)))})),this.event2D.gesture_pinck_start((function(t,i){if("3D"!==l){var n=new Date;r.event2D.gesture_pinck_end((function(){new Date-n>=500?(r.end(),e(!1)):(r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i,r._sdk2D.viewer),f=r.cartesian3Towgs84(i,r.viewer),p.push(i),c(r._sdk2D.viewer),r.tip.setPosition(i,(t.position1.x+t.position2.x)/2+r.viewer.canvas.width,(t.position1.y+t.position2.y)/2)),2===u&&(h=p.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),e(null,{center:f,radius:Number(d)})))}))}})));var g=this}}},{key:"end",value:function(){this.remove_entity(this.circle_id),this.remove_entity(this.point_id),YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy()}}])}(la);function Kr(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Qr=function(e){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),Kr(this,t,[e,i])}return un()(t,e),x()(t,[{key:"start",value:function(e){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var l,c=function(){var e=Cesium.Cartesian3.fromDegrees(m[0].lng,m[0].lat),t=Cesium.Cartesian3.fromDegrees(m[1].lng,m[1].lat),i=Cesium.Cartesian3.fromDegrees(m[2].lng,m[2].lat);if(1===h){g=Cesium.Cartesian3.distance(e,t),f=(v=g)/2;var n={x:p.lng,y:p.lat},o={x:m[1].lng,y:m[1].lat},s=Math.PI/180,a=n.y*s,r=o.y*s,l=n.x*s,c=o.x*s,u=Math.sin(c-l)*Math.cos(r),d=Math.cos(a)*Math.sin(r)-Math.sin(a)*Math.cos(r)*Math.cos(c-l),C=Math.atan2(u,d)%(2*Math.PI);b=450-(180*C/Math.PI<0?360+180*C/Math.PI:180*C/Math.PI)}if(2===h){Cesium.Cartesian3.distance(e,i),y=Cesium.Cartesian3.distance(t,i);var w=turf.point([m[0].lng,m[0].lat]),k=turf.point([m[1].lng,m[1].lat]),_=turf.point([m[2].lng,m[2].lat]),x=turf.rhumbBearing(w,k),E=turf.rhumbBearing(k,_),S=Math.abs(x-E),P=S>180?360-S:S;P=180-P,f=y*Math.sin(Cesium.Math.toRadians(P))}},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:C.viewer;e.entities.add(new Cesium.Entity({id:C.elliptic_id,position:Cesium.Cartesian3.fromDegrees(p.lng,p.lat),ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(e){return f}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(e){return v}),!1),granularity:Cesium.Math.toRadians(.1),rotation:new Cesium.CallbackProperty((function(e){return Cesium.Math.toRadians(b)}),!1),material:Cesium.Color.fromCssColorString(C.color),zIndex:99999999}}))};(i=t,n="start",o=this,s=3,a=aa()(ln()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(e){return a.apply(o,e)}:a)([]),this.entity_ids=[],YJ.Measure.SetMeasureStatus(!0),this.tip=new Q("左键开始,右键取消",this.sdk),this.event=new K(this.sdk);var h=0;this.elliptic_id=this.randomString();var p,d=[],m=[],f=0,v=0,g=0,y=0,b=0;this.event.mouse_left((function(t,i){if("2D"!==l){if(l="3D",r.tip.set_text("再次左键,完成绘制;右键取消"),h++,r.points_ids.push(r.create_point(i)),d.push(i),1===h){d=[i,i,i];var n=r.cartesian3Towgs84(i,r.viewer);p=n,m=[n,n,n],c(),u()}if(2===h){d[1]=i,d[2]=i;var o=r.cartesian3Towgs84(i,r.viewer);m[1]=o,m[2]=o}h>=3&&(r.end(),e(null,{center:p,bearing:b,semiMajorAxis:v,semiMinorAxis:f}))}})),this.event.mouse_right((function(t,i){"2D"!==l&&(r.end(),e(!1))})),this.event.mouse_move((function(e,t){"2D"!==l&&(r.tip.setPosition(t,e.endPosition.x,e.endPosition.y),d[h]=t,m[h]=r.cartesian3Towgs84(t,r.viewer),0!==h&&c())})),!this._is2D&&this._sdk2D&&(this.event2D=new K(this._sdk2D),this.event2D.mouse_left((function(t,i){if("3D"!==l){if(l="2D",r.tip.set_text("再次左键,完成绘制;右键取消"),h++,r.points_ids.push(r.create_point(i,r._sdk2D.viewer)),d.push(i),1===h){d=[i,i,i];var n=r.cartesian3Towgs84(i,r.viewer);p=n,m=[n,n,n],c(),u(r._sdk2D.viewer)}if(2===h){d[1]=i,d[2]=i;var o=r.cartesian3Towgs84(i,r.viewer);m[1]=o,m[2]=o}h>=3&&(r.end(),e(null,{center:p,bearing:b,semiMajorAxis:v,semiMinorAxis:f}))}})),this.event2D.mouse_right((function(t,i){"3D"!==l&&(r.end(),e(!1))})),this.event2D.mouse_move((function(e,t){"3D"!==l&&(r.tip.setPosition(t,e.endPosition.x+r.viewer.canvas.width,e.endPosition.y),d[h]=t,m[h]=r.cartesian3Towgs84(t,r.viewer),0!==h&&c())})));var C=this}}},{key:"end",value:function(){var e=this;this.remove_entity(this.elliptic_id),this.points_ids.forEach((function(t){e.remove_entity(t)})),YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy()}}])}(la);function $r(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var el=function(e){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),$r(this,t,[e,i])}return un()(t,e),x()(t,[{key:"start",value:function(e){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var l;(i=t,n="start",o=this,s=3,a=aa()(ln()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(e){return a.apply(o,e)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Q("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new K(this.sdk),this.positions=[],this.points_ids=[];var c=[],u=!1;this.event.mouse_left((function(e,i){if("2D"!==l){l="3D";var n=r.cartesian3Towgs84(i,r.viewer),o=c[c.length-1];if(!o||o.lng!==n.lng||o.lat!==n.lat){if(!r.entityHasCreated){var s=t.create_arrow_polygon(r);r.points_ids.push(s)}r.points_ids.push(r.create_point(i)),c.push(n),u=!1}}})),this.event.mouse_right((function(t,i){if("2D"!==l){var n=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(e){n.push(r.cartesian3Towgs84(e,r.viewer))}));r.end(),u&&r.positions.pop(),e(null,r.positions,n)}})),this.event.mouse_move((function(e,t){"2D"!==l&&(u=!0,r.positions=c.concat(r.cartesian3Towgs84(t,r.viewer)),r.tip.setPosition(t,e.endPosition.x,e.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(e,t){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500){var s=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(e){s.push(r.cartesian3Towgs84(e,r.viewer))}));r.end(),e(null,r.positions,s)}else{if(!r.entityHasCreated){var a=t.create_arrow_polygon(r);r.points_ids.push(a)}r.points_ids.push(r.create_point(n)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2)}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new K(this._sdk2D),this.event2D.mouse_left((function(e,i){if("3D"!==l){if(l="2D",!r.entityHasCreated){var n=t.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(n)}r.points_ids.push(r.create_point(i,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(i,r.viewer)),u=!1}})),this.event2D.mouse_right((function(t,i){if("3D"!==l){var n=[];if(r.points_ids.length>2)r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(e){n.push(r.cartesian3Towgs84(e,r.viewer))}));r.end(),u&&r.positions.pop(),e(null,r.positions,n)}})),this.event2D.mouse_move((function(e,t){"3D"!==l&&(u=!0,r.positions=c.concat(r.cartesian3Towgs84(t,r.viewer)),r.tip.setPosition(t,e.endPosition.x+r.viewer.canvas.width,e.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(e,t){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500){var s=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(e){s.push(r.cartesian3Towgs84(e,r.viewer))}));r.end(),e(null,r.positions,s)}else{if(!r.entityHasCreated){var a=t.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(a)}r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2)}}))}})))}}}],[{key:"create_arrow_polygon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.viewer;e.entityHasCreated=!0;var i=e.randomString();return t.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(t){for(var i=e.computeAttackArrow(e.positions),n=0;n<i.length;n++)if(isNaN(i[n].x)){i=[];break}return new Cesium.PolygonHierarchy(i)}),!1),material:Cesium.Color.fromCssColorString(e.color),zIndex:99999999}})),i}}])}(la);function tl(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var il=function(e){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),tl(this,t,[e,i])}return un()(t,e),x()(t,[{key:"start",value:function(e){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var l;(i=t,n="start",o=this,s=3,a=aa()(ln()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(e){return a.apply(o,e)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Q("左键确定,右键取消;CTRL+右键撤销",this.sdk),this.event=new K(this.sdk),this.positions=[],this.points_ids=[];var c=[];this.event.mouse_left((function(i,n){if("2D"!==l){if(l="3D",!r.entityHasCreated){var o=t.create_arrow_polygon(r);r.points_ids.push(o)}if(r.points_ids.push(r.create_point(n)),c.push(r.cartesian3Towgs84(n,r.viewer)),5===c.length){var s=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(e){s.push(r.cartesian3Towgs84(e,r.viewer))}));r.end(),e(null,c,s)}}})),this.event.mouse_right((function(t,i){"2D"!==l&&(r.end(),e("取消绘制"))})),this.event.mouse_move((function(e,t){"2D"!==l&&(r.positions=c.concat(r.cartesian3Towgs84(t,r.viewer)),r.tip.setPosition(t,e.endPosition.x,e.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(e,t){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(r.cartesian3Towgs84(cartesian,r.viewer)))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)r.end(),e("取消绘制");else{if(!r.entityHasCreated){var s=t.create_arrow_polygon(r);r.points_ids.push(s)}if(r.points_ids.push(r.create_point(n)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),5===c.length){var a=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(e){a.push(r.cartesian3Towgs84(e,r.viewer))}));r.end(),e(null,c,a)}}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new K(this._sdk2D),this.event2D.mouse_left((function(i,n){if("3D"!==l){if(l="2D",!r.entityHasCreated){var o=t.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(o)}if(r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(n,r.viewer)),5===c.length){var s=[];if(r.points_ids.length>2)r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(e){s.push(r.cartesian3Towgs84(e,r.viewer))}));r.end(),e(null,c,s)}}})),this.event2D.mouse_right((function(t,i){"3D"!==l&&(r.end(),e("取消绘制"))})),this.event2D.mouse_move((function(e,t){"3D"!==l&&(r.positions=c.concat(r.cartesian3Towgs84(t,r.viewer)),r.tip.setPosition(t,e.endPosition.x+r.viewer.canvas.width,e.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(e,t){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(r.cartesian3Towgs84(cartesian,r.viewer)))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)r.end(),e("取消绘制");else{if(!r.entityHasCreated){var s=t.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(s)}if(r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),5===c.length){var a=[];if(r.points_ids.length>2)r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(e){a.push(r.cartesian3Towgs84(e,r.viewer))}));r.end(),e(null,c,a)}}}))}})))}}}],[{key:"create_arrow_polygon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.viewer;e.entityHasCreated=!0;var i=e.randomString();return t.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(t){for(var i=e.computePincerArrow(e.positions),n=0;n<i.length;n++)if(isNaN(i[n].x)){i=[];break}return new Cesium.PolygonHierarchy(i)}),!1),material:Cesium.Color.fromCssColorString(e.color),zIndex:99999999}})),i}}])}(la);function nl(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function ol(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var sl=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=nl(this,t,[e,n])).points=null,i.polygonHasCreated=!1,i}return un()(t,e),x()(t,[{key:"start",value:function(e){var i=this;if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var n;ol(t,"start",this,3)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Q("左键确定,右键取消;",this.sdk),this.event=new K(this.sdk),this.positions=[],this.points_ids=[];var o=[];this.anchorpoints=[],this.event.mouse_left((function(t,s){if("2D"!==n&&(n="3D",s&&i.anchorpoints[0]!==s)){i.anchorpoints.push(s);var a=i.cartesian3Towgs84(s,i.viewer);if(a.lng=Number(a.lng.toFixed(8)),a.lat=Number(a.lat.toFixed(8)),(!o[0]||a.lng!==o[0].lng||a.lat!==o[0].lat)&&(o.push(a),i.positions.push(a),i.points_ids.push(i.create_point(s)),2===i.points_ids.length)){var r=[o[0],o[1]];e(null,r),i.end()}}})),this.event.mouse_move((function(e,o){if("2D"!==n&&(i.tip.setPosition(o,e.endPosition.x,e.endPosition.y),o&&0!==i.points_ids.length)){var s=i.cartesian3Towgs84(o,i.viewer);i.positions=[i.positions[0],s],1!==i.points_ids.length||Cesium.defined(i.arrowPolygon)||(i.arrowPolygon=t.polygon(i))}})),this.event.mouse_right((function(t,o){"2D"!==n&&(e(null),i.end())})),this.event.gesture_pinck_start((function(s,a){if("2D"!==n){var r=new Date;i.event.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),e(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),e(null,i.positions),i.end();else{if(!a||Cesium.defined(i.arrowPolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.arrowPolygon=t.polygon(i),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a))}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new K(this._sdk2D),this.event2D.mouse_left((function(t,s){if("3D"!==n&&(n="2D",s&&i.anchorpoints[0]!==s)){i.anchorpoints.push(s);var a=i.cartesian3Towgs84(s,i.viewer);if(a.lng=Number(a.lng.toFixed(8)),a.lat=Number(a.lat.toFixed(8)),(!o[0]||a.lng!==o[0].lng||a.lat!==o[0].lat)&&(o.push(a),i.positions.push(a),i.points_ids.push(i.create_point(s,i._sdk2D.viewer)),2===i.points_ids.length)){var r=[o[0],o[1]];e(null,r),i.end()}}})),this.event2D.mouse_move((function(e,o){if("3D"!==n&&(i.tip.setPosition(o,e.endPosition.x+i.viewer.canvas.width,e.endPosition.y),o&&0!==i.points_ids.length)){var s=i.cartesian3Towgs84(o,i.viewer);i.positions=[i.positions[0],s],1!==i.points_ids.length||Cesium.defined(i.arrowPolygon)||(i.arrowPolygon=t.polygon(i,i._sdk2D.viewer))}})),this.event2D.mouse_right((function(t,o){"3D"!==n&&(e(null),i.end())})),this.event2D.gesture_pinck_start((function(s,a){if("3D"!==n){var r=new Date;i.event2D.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),e(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),e(null,i.positions),i.end();else{if(!a||Cesium.defined(i.arrowPolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2+i.viewer.canvas.width,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.arrowPolygon=t.polygon(i,i._sdk2D.viewer),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a,i._sdk2D.viewer))}}))}})))}}},{key:"end",value:function(){ol(t,"end",this,3)([]),this.viewer.entities.remove(this.arrowPolygon),!this._is2D&&this._sdk2D&&this._sdk2D.viewer.entities.remove(this.arrowPolygon)}}],[{key:"polygon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.viewer,i=e.randomString();return t.entities.add(new Cesium.Entity({name:"ArrowPolygon",id:i,polygon:{hierarchy:new Cesium.CallbackProperty((function(t){for(var i=e.computeStraightArrow(e.positions),n=0;n<i.length;n++)if(isNaN(i[n].x)){i=[];break}return new Cesium.PolygonHierarchy(i)}),!1),material:Cesium.Color.fromCssColorString(e.color),outline:!0,outlineColor:Cesium.Color.GREEN,zIndex:99999999}}))}}])}(la);function al(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var rl=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=al(this,t,[e,n])).rhumb=n.rhumb,i.polygonHasCreated=!1,i.rect=[],i.rectObj=[],i.entity=null,i}return un()(t,e),x()(t,[{key:"start",value:function(e){var i,n,o,s,a,r=this,l=this;if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var c;(i=t,n="start",o=this,s=3,a=aa()(ln()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(e){return a.apply(o,e)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Q("左键确定,右键取消",l.sdk),this.event=new K(l.sdk),this.positions=[],this.points_ids=[];var u=0,h=null,p=null;this.event.mouse_left((function(i,n){if("2D"!==c){c="3D",u++;var o=r.cartesian3Towgs84(n,r.viewer);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var s=t.create_polygon(r);r.points_ids.push(s),h=o}2==u&&(p=o,r.end(),e(null,l.rectObj,[h,p]))}})),this.event.mouse_right((function(t,i){"2D"!==c&&(r.end(),e("取消",""))})),this.event.mouse_move((function(e,t){if("2D"!==c&&(r.tip.setPosition(t,e.endPosition.x,e.endPosition.y),1==u)){var i=r.cartesian3Towgs84(t,r.viewer);r.calrect(h,i)}})),this.event.gesture_pinck_start((function(i,n){if("2D"!==c){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)e("取消",""),r.end();else{r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),u++;var s=r.cartesian3Towgs84(n);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var a=t.create_polygon(r);r.points_ids.push(a),h=s}2==u&&(r.calrect(h,s),p=s,r.end(),e(null,l.rectObj,[h,p]))}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new K(this._sdk2D),this.event2D.mouse_left((function(i,n){if("3D"!==c){c="2D",u++;var o=r.cartesian3Towgs84(n,r.viewer);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var s=t.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(s),h=o}2==u&&(p=o,r.end(),e(null,l.rectObj,[h,p]))}})),this.event2D.mouse_right((function(t,i){"3D"!==c&&(r.end(),e("取消",""))})),this.event2D.mouse_move((function(e,t){if("3D"!==c&&(r.tip.setPosition(t,e.endPosition.x+r.viewer.canvas.width,e.endPosition.y),1==u)){var i=r.cartesian3Towgs84(t,r.viewer);r.calrect(h,i)}})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==c){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)e("取消",""),r.end();else{r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),u++;var s=r.cartesian3Towgs84(n);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var a=t.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(a),h=s}2==u&&(r.calrect(h,s),p=s,r.end(),e(null,l.rectObj,[h,p]))}}))}})))}}},{key:"calrect",value:function(e,t){var i,n=[],o=[],s=[];if(n.push([e.lng,e.lat,e.alt],[t.lng,t.lat,t.alt]),2===n.length){var a=turf.lineString(n),r=turf.bbox(a);i=turf.bboxPolygon(r)}i&&(i.geometry.coordinates[0].forEach((function(t){o.push(t[0]),o.push(t[1]);var i={lng:t[0],lat:t[1],alt:e.alt};s.push(i)})),this.rect=[].concat(o),this.rectObj=[].concat(s),this.rectObj.pop())}}],[{key:"create_polygon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.viewer,i=e.randomString();return t.entities.add(this.entity=new Cesium.Entity({id:i,polygon:{hierarchy:new Cesium.CallbackProperty((function(t){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(e.rect))}),!1),material:Cesium.Color.fromCssColorString(e.color),arcType:e.rhumb?Cesium.ArcType.RHUMB:Cesium.ArcType.GEODESIC,zIndex:99999999}})),i}}])}(la);function ll(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function cl(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var ul=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=ll(this,t,[e,n])).points=null,i.polygonHasCreated=!1,i}return un()(t,e),x()(t,[{key:"start",value:function(e){var i=this;if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var n;cl(t,"start",this,3)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Q("左键确定,右键取消;",this.sdk),this.event=new K(this.sdk),this.positions=[],this.points_ids=[];var o=[];this.anchorpoints=[],this.event.mouse_left((function(t,s){if("2D"!==n&&(n="3D",s&&(3===i.anchorpoints.length?i.anchorpoints[1]=s:i.anchorpoints.push(s),o.push(i.cartesian3Towgs84(s,i.viewer)),i.points_ids.push(i.create_point(s)),3===i.points_ids.length))){var a=[o[0],o[2],o[1]];e(null,a),i.end()}})),this.event.mouse_move((function(e,s){if("2D"!==n&&(i.tip.setPosition(s,e.endPosition.x,e.endPosition.y),s&&0!==i.points_ids.length))if(o.length>1?i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer),o[1]]:i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer)],1!==i.points_ids.length||Cesium.defined(i.assemblePolygon)||(i.assemblePolygon=t.polygon(i)),i.anchorpoints.length>=2){if(1===i.points_ids.length){var a=new Array;i.positions.forEach((function(e){a.push([e.lng,e.lat])}));var r=P.PlotUtils.mid(a[0],a[1]),l=P.PlotUtils.distance(a[0],r)/.9,c=P.PlotUtils.getThirdPoint(a[0],r,P.Constants.HALF_PI,l,!0);i.positions=[i.positions[0],{lng:c[0],lat:c[1]},i.positions[1]]}i.anchorpoints[1]=s}else i.anchorpoints.push(s)})),this.event.mouse_right((function(t,o){"2D"!==n&&(e(null),i.end())})),this.event.gesture_pinck_start((function(s,a){if("2D"!==n){var r=new Date;i.event.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),e(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),e(null,i.positions),i.end();else{if(!a||Cesium.defined(i.assemblePolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.assemblePolygon=t.polygon(i),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a))}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new K(this._sdk2D),this.event2D.mouse_left((function(t,s){if("3D"!==n&&(n="2D",s&&(3===i.anchorpoints.length?i.anchorpoints[1]=s:i.anchorpoints.push(s),o.push(i.cartesian3Towgs84(s,i.viewer)),i.points_ids.push(i.create_point(s,i._sdk2D.viewer)),3===i.points_ids.length))){var a=[o[0],o[2],o[1]];e(null,a),i.end()}})),this.event2D.mouse_move((function(e,s){if("3D"!==n&&(i.tip.setPosition(s,e.endPosition.x+i.viewer.canvas.width,e.endPosition.y),s&&0!==i.points_ids.length))if(o.length>1?i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer),o[1]]:i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer)],1!==i.points_ids.length||Cesium.defined(i.assemblePolygon)||(i.assemblePolygon=t.polygon(i,i._sdk2D.viewer)),i.anchorpoints.length>=2){if(1===i.points_ids.length){var a=new Array;i.positions.forEach((function(e){a.push([e.lng,e.lat])}));var r=P.PlotUtils.mid(a[0],a[1]),l=P.PlotUtils.distance(a[0],r)/.9,c=P.PlotUtils.getThirdPoint(a[0],r,P.Constants.HALF_PI,l,!0);i.positions=[i.positions[0],{lng:c[0],lat:c[1]},i.positions[1]]}i.anchorpoints[1]=s}else i.anchorpoints.push(s)})),this.event2D.mouse_right((function(t,o){"3D"!==n&&(e(null),i.end())})),this.event2D.gesture_pinck_start((function(s,a){if("3D"!==n){var r=new Date;i.event2D.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),e(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),e(null,i.positions),i.end();else{if(!a||Cesium.defined(i.assemblePolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2+i.viewer.canvas.width,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.assemblePolygon=t.polygon(i,i._sdk2D.viewer),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a,i._sdk2D.viewer))}}))}})))}}},{key:"end",value:function(){cl(t,"end",this,3)([]),this.viewer.entities.remove(this.assemblePolygon),!this._is2D&&this._sdk2D&&this._sdk2D.viewer.entities.remove(this.assemblePolygon)}},{key:"calculateVector",value:function(e,t,i){var n,o,s,a,r,l;t||(t=Math.PI/2),i||(i=1);var c=Math.sqrt(e.x*e.x+e.y*e.y);if(0==e.y)n=o=c*i*Math.cos(t)/e.x,e.x>0?a=-(s=Math.sqrt(i*i-n*n)):e.x<0&&(s=-(a=Math.sqrt(i*i-n*n))),r={x:n,y:s},l={x:o,y:a};else{var u=-e.x/e.y,h=i*c*Math.cos(t)/e.y,p=1+u*u,d=2*u*h,m=h*h-i*i;s=u*(n=(-d-Math.sqrt(d*d-4*p*m))/(2*p))+h,a=u*(o=(-d+Math.sqrt(d*d-4*p*m))/(2*p))+h,e.y>=0?(r={x:n,y:s},l={x:o,y:a}):e.y<0&&(r={x:o,y:a},l={x:n,y:s})}return[r,l]}},{key:"createCloseCardinal",value:function(e){if(null==e||e.length<3)return e;var t=e[0];e.push(t);for(var i=e,n=[],o=.4,s=i.length-1,a=0;a<=s-1;a++){var r=void 0,l=void 0,c=void 0;a==s-1?(r=i[s-1],l=i[0],c=i[1]):(r=i[a],l=i[a+1],c=i[a+2]);var u={x:void 0,y:void 0},h={x:void 0,y:void 0},p={x:l.x-r.x,y:l.y-r.y},d={x:c.x-l.x,y:c.y-l.y},m=Math.sqrt(p.x*p.x+p.y*p.y),f=Math.sqrt(d.x*d.x+d.y*d.y),v={x:p.x/m,y:p.y/m},g={x:d.x/f,y:d.y/f},y={x:v.x+g.x,y:v.y+g.y},b=Math.sqrt(y.x*y.x+y.y*y.y),C={x:y.x/b,y:y.y/b},w=(v.x*g.x+v.y*g.y)/1;Math.abs(1-w)<.005?(u.x=l.x-g.x*m*o,u.y=l.y-g.y*m*o,h.x=l.x+v.x*f*o,h.y=l.y+v.y*f*o):(u.x=l.x-C.x*m*o,u.y=l.y-C.y*m*o,h.x=l.x+C.x*f*o,h.y=l.y+C.y*f*o),a==s-1?(n[0]=l,n[1]=h,n[3*(s-2)+2+3]=u,n[3*(s-2)+2+4]=i[s]):(n[3*a+2+0]=u,n[3*a+2+1]=l,n[3*a+2+2]=h)}return n}},{key:"calculatePointsFBZ3",value:function(e,t){t||(t=20);var i=[],n=.05;t>0&&(n=1/t);for(var o=0;o<e.length-3;){var s=e[o],a=e[o+1],r=e[o+2],l=e[o+3];i.push(s);for(var c=0;c<1;){var u={x:(1-c)*(1-c)*(1-c)*s.x+3*c*(1-c)*(1-c)*a.x+3*c*c*(1-c)*r.x+c*c*c*l.x,y:(1-c)*(1-c)*(1-c)*s.y+3*c*(1-c)*(1-c)*a.y+3*c*c*(1-c)*r.y+c*c*c*l.y};i.push(u),c+=n}(o+=3)>=e.length&&i.push(s)}return i}}],[{key:"polygon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.viewer,i=e.randomString();return t.entities.add(new Cesium.Entity({name:"AssemblePolygon",id:i,polygon:{hierarchy:new Cesium.CallbackProperty((function(t){for(var i=e.computeAssemble(e.positions),n=0;n<i.length;n++)if(isNaN(i[n].x)){i=[];break}return new Cesium.PolygonHierarchy(i)}),!1),material:Cesium.Color.fromCssColorString(e.color),outline:!0,outlineColor:Cesium.Color.GREEN,zIndex:99999999}}))}}])}(la);function hl(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var pl=function(e){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),hl(this,t,[e,i])}return un()(t,e),x()(t,[{key:"start",value:function(e){var i,n,o,s,a,r,l=this,c=this;YJ.Measure.GetMeasureStatus()?e("上一次测量未结束"):((n=t,o="start",s=this,a=3,r=aa()(ln()(1&a?n.prototype:n),o,s),2&a&&"function"==typeof r?function(e){return r.apply(s,e)}:r)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Q("左键确认,右键取消",c.sdk),this.event=new K(c.sdk),this._sector_id=null,this._positions=[],this.points_ids=[],this._entities_sector=[],this._radius=0,this._startAngle=0,this._endAngle=0,this.event.mouse_left((function(t,n){if("2D"!==i&&(i="3D",l._positions.length<3?(l.points_ids.push(l.create_point(n)),l._positions.push(l.cartesian3Towgs84(n,l.viewer))):(l.end(),e(null,{center:l._positions[0],radius:l._radius,startAngle:l._startAngle,endAngle:l._endAngle})),2===l._positions.length)){var o=Cesium.Cartesian3.fromDegrees(l._positions[0].lng,l._positions[0].lat,l._positions[0].alt),s=n;l._radius=Cesium.Cartesian3.distance(o,s)}})),this.event.mouse_move((function(e,t){if("2D"!==i&&(l.tip.setPosition(t,e.endPosition.x,e.endPosition.y),!(l._positions.length<2)&&(2==l._positions.length&&l._positions.push(l.cartesian3Towgs84(t,l.viewer)),3==l._positions.length))){l._positions.pop(),l._positions.push(l.cartesian3Towgs84(t,l.viewer)),Cesium.defined(l._sector_id)||(l._sector_id=l.createsector(),l.points_ids.push(l._sector_id));var n=c.calculateAangle(c._positions);c._startAngle=n.angle1,c._endAngle=n.angle2}})),this.event.mouse_right((function(t,n){"2D"!==i&&(l.end(),e(null))})),!this._is2D&&this._sdk2D&&(this.event2D=new K(this._sdk2D),this.event2D.mouse_left((function(t,n){if("3D"!==i&&(i="2D",l._positions.length<3?(l.points_ids.push(l.create_point(n,l._sdk2D.viewer)),l._positions.push(l.cartesian3Towgs84(n,l.viewer))):(l.end(),e(null,{center:l._positions[0],radius:l._radius,startAngle:l._startAngle,endAngle:l._endAngle})),2===l._positions.length)){var o=Cesium.Cartesian3.fromDegrees(l._positions[0].lng,l._positions[0].lat,l._positions[0].alt),s=n;l._radius=Cesium.Cartesian3.distance(o,s)}})),this.event2D.mouse_move((function(e,t){if("3D"!==i&&(l.tip.setPosition(t,e.endPosition.x+l.viewer.canvas.width,e.endPosition.y),!(l._positions.length<2)&&(2==l._positions.length&&l._positions.push(l.cartesian3Towgs84(t,l.viewer)),3==l._positions.length))){l._positions.pop(),l._positions.push(l.cartesian3Towgs84(t,l.viewer)),Cesium.defined(l._sector_id)||(l._sector_id=l.createsector(l._sdk2D.viewer),l.points_ids.push(l._sector_id));var n=c.calculateAangle(c._positions);c._startAngle=n.angle1,c._endAngle=n.angle2}})),this.event2D.mouse_right((function(t,n){"3D"!==i&&(l.end(),e(null))}))))}},{key:"createsector",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.viewer,t=this,i=new Cesium.CallbackProperty((function(){var e=t.calSector(t._positions[0],t._radius,t._startAngle,t._endAngle);return new Cesium.PolygonHierarchy(e)})),n=t.randomString(),o=e.entities.add({id:n,position:Cesium.Cartesian3.fromDegrees(t._positions[0].lng,t._positions[0].lat),polygon:{hierarchy:i,show:!0,fill:!0,clampToGround:!0,material:Cesium.Color.fromCssColorString(t.color),zIndex:99999999}});return t._entities_sector.push(o),n}},{key:"cartesianToLatlng",value:function(e){var t=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),i=Cesium.Math.toDegrees(t.latitude);return[Cesium.Math.toDegrees(t.longitude),i]}},{key:"lonLatToMercator",value:function(e){var t=e[0],i=e[1],n=20037508.34*t/180,o=Math.log(Math.tan((90+i)*Math.PI/360))/(Math.PI/180);return[n,o=20037508.34*o/180]}},{key:"WebMercator2lonLat",value:function(e){var t=e[0]/20037508.34*180,i=e[1]/20037508.34*180;return[t,180/Math.PI*(2*Math.atan(Math.exp(i*Math.PI/180))-Math.PI/2)]}},{key:"calculateAangle",value:function(e){function t(e,t){var i=Math.PI/180,n=e.y*i,o=t.y*i,s=e.x*i,a=t.x*i,r=Math.sin(a-s)*Math.cos(o),l=Math.cos(n)*Math.sin(o)-Math.sin(n)*Math.cos(o)*Math.cos(a-s),c=Math.atan2(r,l)%(2*Math.PI);return 360-(450-(180*c/Math.PI<0?360+180*c/Math.PI:180*c/Math.PI)-90)%360}var i=e[0],n=e[1],o=e[2],s={x:i.lng,y:i.lat},a={x:n.lng,y:n.lat},r={x:o.lng,y:o.lat};return{angle1:t(s,a),angle2:t(s,r)}}}])}(la),dl=52.35987755982988,ml=3.141592653589793,fl=.006693421622965943,vl=function(){return x()((function e(){k()(this,e)}),null,[{key:"BD09ToGCJ02",value:function(e,t){var i=+e-.0065,n=+t-.006,o=Math.sqrt(i*i+n*n)-2e-5*Math.sin(n*dl),s=Math.atan2(n,i)-3e-6*Math.cos(i*dl);return[o*Math.cos(s),o*Math.sin(s)]}},{key:"GCJ02ToBD09",value:function(e,t){t=+t,e=+e;var i=Math.sqrt(e*e+t*t)+2e-5*Math.sin(t*dl),n=Math.atan2(t,e)+3e-6*Math.cos(e*dl);return[i*Math.cos(n)+.0065,i*Math.sin(n)+.006]}},{key:"WGS84ToGCJ02",value:function(e,t){if(t=+t,e=+e,this.out_of_china(e,t))return[e,t];var i=this.delta(e,t);return[e+i[0],t+i[1]]}},{key:"GCJ02ToWGS84",value:function(e,t){if(t=+t,e=+e,this.out_of_china(e,t))return[e,t];var i=this.delta(e,t);return[2*e-(e+i[0]),2*t-(t+i[1])]}},{key:"delta",value:function(e,t){var i=this.transformLng(e-105,t-35),n=this.transformLat(e-105,t-35),o=t/180*ml,s=Math.sin(o);s=1-fl*s*s;var a=Math.sqrt(s);return[i=180*i/(6378245/a*Math.cos(o)*ml),n=180*n/(6378245*(1-fl)/(s*a)*ml)]}},{key:"transformLng",value:function(e,t){var i=300+(e=+e)+2*(t=+t)+.1*e*e+.1*e*t+.1*Math.sqrt(Math.abs(e));return i+=2*(20*Math.sin(6*e*ml)+20*Math.sin(2*e*ml))/3,i+=2*(20*Math.sin(e*ml)+40*Math.sin(e/3*ml))/3,i+=2*(150*Math.sin(e/12*ml)+300*Math.sin(e/30*ml))/3}},{key:"transformLat",value:function(e,t){var i=2*(e=+e)-100+3*(t=+t)+.2*t*t+.1*e*t+.2*Math.sqrt(Math.abs(e));return i+=2*(20*Math.sin(6*e*ml)+20*Math.sin(2*e*ml))/3,i+=2*(20*Math.sin(t*ml)+40*Math.sin(t/3*ml))/3,i+=2*(160*Math.sin(t/12*ml)+320*Math.sin(t*ml/30))/3}},{key:"out_of_china",value:function(e,t){return t=+t,!((e=+e)>73.66&&e<135.05&&t>3.86&&t<53.55)}}])}();function gl(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var yl=function(e){function t(e,i){var n;return k()(this,t),(n=gl(this,t,[e,i])).sdk.addIncetance(n.options.id,n),n.options.show&&Qe(0,n.options.id),n}return un()(t,e),x()(t,[{key:"setDefaultValue",value:function(){var e,i,n,o,s;(e=t,i="setDefaultValue",n=this,o=3,s=aa()(ln()(1&o?e.prototype:e),i,n),2&o&&"function"==typeof s?function(e){return s.apply(n,e)}:s)([]),this.options.host=this.options.host||p()}},{key:"requestResource",value:function(){var e="";return e=this.options.host.endsWith("yjearth4.0")?this.options.host+"/data/service/load-compact-service":this.options.host+"/yjearth4.0/data/service/load-compact-service",fetch(e,{method:"post",body:JSON.stringify({source_id:this.options.id}),headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}})}}])}(Vn);function bl(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 Cl(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?bl(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):bl(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function wl(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function kl(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var _l=function(e){function t(e,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(n=wl(this,t,[e,i])).options.name=i.name||"未命名对象",n.Dialog=o,n._elms={},n}return un()(t,e),x()(t,[{key:"setDefaultValue",value:function(){var e,i;kl(t,"setDefaultValue",this,3)([]),this.options.alpha=null!==(e=this.options.alpha)&&void 0!==e?e:1,this.options.brightness=null!==(i=this.options.brightness)&&void 0!==i?i:1}},{key:"layerIndex",get:function(){return this.entity?this.entity._layerIndex:void 0}},{key:"layer_index",get:function(){return this.entity?this.entity._layerIndex:void 0}},{key:"brightness",get:function(){return this.options.brightness},set:function(e){this.options.brightness=Number(e),this.entity.brightness=Number(e)}},{key:"alpha",get:function(){return this.options.alpha},set:function(e){(e=Number(e))>1&&(e=1),e<0&&(e=0),this.entity.alpha=e,this.options.alpha=e,this._elms.alpha&&this._elms.alpha.forEach((function(t){t.value=e}))}},{key:"layerRaise",value:function(e){this.sdk.viewer.imageryLayers.raise(this.entity);for(var t=0;t<this.sdk.viewer.imageryLayers._layers.length;t++)if(this.sdk.viewer.imageryLayers._layers[t]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[t]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[t]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[t]._imageryProvider._type)){var i=this.sdk.viewer.imageryLayers._layers[t];this.sdk.viewer.imageryLayers.raiseToTop(i)}return this.options.layer_index=this.entity._layerIndex,this.entity._layerIndex}},{key:"layerLower",value:function(){return this.sdk.viewer.imageryLayers.lower(this.entity),this.options.layer_index=this.entity._layerIndex,this.entity._layerIndex}},{key:"layerToTop",value:function(){this.sdk.viewer.imageryLayers.raiseToTop(this.entity);for(var e=0;e<this.sdk.viewer.imageryLayers._layers.length;e++)if(this.sdk.viewer.imageryLayers._layers[e]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[e]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[e]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[e]._imageryProvider._type)){var t=this.sdk.viewer.imageryLayers._layers[e];this.sdk.viewer.imageryLayers.raiseToTop(t)}return this.options.layer_index=this.entity._layerIndex,this.entity._layerIndex}},{key:"layerToBottom",value:function(){return this.sdk.viewer.imageryLayers.lowerToBottom(this.entity),this.options.layer_index=this.entity._layerIndex,this.entity._layerIndex}},{key:"remove",value:function(){kl(t,"remove",this,3)([]),this.sdk.viewer.scene.imageryLayers.remove(this.entity),this.entity=null}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l.length>0&&void 0!==l[0]&&l[0],!this._error){e.next=3;break}return e.abrupt("return");case 3:if(pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(t={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Cl({},this.options.position):this.options.positions?r=Cl({},this.options.positions[0]):this.options.center?r=Cl({},this.options.center):this.options.start?r=Cl({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),r.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(r);case 17:r.alt=e.sent;case 18:i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:t}),e.next=26;break;case 25:this.sdk.viewer.flyTo(this.entity);case 26:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"amapMercatorTilingScheme",value:function(e){return new(function(e){function t(e){var i;k()(this,t),i=wl(this,t,[e]);var n=new Cesium.WebMercatorProjection;return i._projection.project=function(e,t){return t=vl.WGS84ToGCJ02(Cesium.Math.toDegrees(e.longitude),Cesium.Math.toDegrees(e.latitude)),t=n.project(new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]))),new Cesium.Cartesian2(t.x,t.y)},i._projection.unproject=function(e,t){var i=n.unproject(e);return t=vl.GCJ02ToWGS84(Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude)),new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]))},i}return un()(t,e),x()(t)}(Cesium.WebMercatorTilingScheme))(e)}},{key:"edit",value:(i=o()(a.a.mark((function e(){var t,i,n,o,s=this,r=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.length>0&&void 0!==r[0]&&r[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),e.next=5,new pn(this.sdk,this.options,{title:"底图属性",left:"180px",top:"100px",confirmCallBack:function(e){s.name=s.name.trim(),s.name||(s.name="未命名对象"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),at(s.sdk,s.options.id);var t=Rt();if(t&&t!=s.sdk)for(var i=0;i<t.viewer.imageryLayers._layers.length;i++){var n=t.viewer.imageryLayers._layers[i];if(n._id&&n._id==s.options.id){n.alpha=s.options.alpha;break}}},closeCallBack:function(){s.reset(),s.Dialog.closeCallBack&&s.Dialog.closeCallBack()},removeCallBack:function(){s.Dialog.removeCallBack&&s.Dialog.removeCallBack()}},!0);case 5:this._DialogObject=e.sent,(t=document.createElement("div")).style.width="300px",i='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 60px;">名称:</span>\n <input class="input name" type="text">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 60px;">透明度:</span>\n <input type="range" class="alpha" min="0" max="1" step="0.01">\n </div>\n </div>\n </div>\n ',t.innerHTML=i,n=t.getElementsByClassName("name")[0],o=t.getElementsByClassName("alpha")[0],n.value=this.name,o.value=this.alpha,n.addEventListener("input",(function(){s.name=n.value})),o.addEventListener("input",(function(){s.alpha=o.value})),this._DialogObject.contentAppChild(t),this._elms.name=[n],this._elms.alpha=[o];case 19:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"reset",value:function(){(this.entity||this._DialogObject)&&(this.options=this.deepCopyObj(this.originalOptions),this.name=this.options.name,this.alpha=this.options.alpha,this.brightness=this.options.brightness)}},{key:"flicker",value:function(){}}]);var i,n}(yl);function xl(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var El=function(e){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),xl(this,t,[e,i])}return un()(t,e),x()(t,[{key:"type",get:function(){return"layer"}},{key:"createArcGis",value:(i=o()(a.a.mark((function e(t){var i,n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(Number(Cesium.VERSION.split(".")[1])>=107)){e.next=6;break}return e.next=3,Cesium.ArcGisMapServerImageryProvider.fromUrl(t);case 3:i=e.sent,e.next=7;break;case 6:i=new Cesium.ArcGisMapServerImageryProvider({url:t});case 7:for(this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(i,this.options.layer_index):this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(i),this.entity._id=this.options.id,n=0;n<this.sdk.viewer.imageryLayers._layers.length;n++)this.sdk.viewer.imageryLayers._layers[n]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type)&&(o=this.sdk.viewer.imageryLayers._layers[n],this.sdk.viewer.imageryLayers.raiseToTop(o));this.show=this.options.show,this.alpha=this.options.alpha,this.brightness=this.options.brightness,this.options.show&&Qe(0,this.options.id);case 14:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})}]);var i}(_l),Sl=function(e){function t(e,i){var n;return k()(this,t),(n=xl(this,t,[e,i])).createArcGis("https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"),n}return un()(t,e),x()(t)}(El),Pl=function(e){function t(e,i){var n;return k()(this,t),(n=xl(this,t,[e,i])).createArcGis("https://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer"),n}return un()(t,e),x()(t)}(El),Dl=function(e){function t(e,i){var n;return k()(this,t),(n=xl(this,t,[e,i])).createArcGis("https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"),n}return un()(t,e),x()(t)}(El);function Ml(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Tl=function(e){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),Ml(this,t,[e,i])}return un()(t,e),x()(t,[{key:"type",get:function(){return"layer"}},{key:"createGD",value:function(e){var t=new Cesium.UrlTemplateImageryProvider({url:e,minimumLevel:3,maximumLevel:18,tilingScheme:this.amapMercatorTilingScheme()});this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(t,this.options.layer_index):this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(t),this.entity._id=this.options.id;for(var i=0;i<this.sdk.viewer.imageryLayers._layers.length;i++)if(this.sdk.viewer.imageryLayers._layers[i]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type)){var n=this.sdk.viewer.imageryLayers._layers[i];this.sdk.viewer.imageryLayers.raiseToTop(n)}this.show=this.options.show,this.alpha=this.options.alpha,this.brightness=this.options.brightness,this.options.show&&Qe(0,this.options.id)}}])}(_l),Ol=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=Ml(this,t,[e,n])).createGD("https://webst02.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8"),i}return un()(t,e),x()(t)}(Tl),Nl=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=Ml(this,t,[e,n])).createGD("https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}"),i}return un()(t,e),x()(t)}(Tl),Bl=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=Ml(this,t,[e,n])).createGD("https://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}"),i}return un()(t,e),x()(t)}(Tl);function Al(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Ll(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)?Ll(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ll(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 Il(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 jl(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Il(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Il(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Rl(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function Fl(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}function zl(e,t,i){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,i)}function Hl(e,t){return e.get(Vl(e,t))}function Vl(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var Gl=new WeakMap,Wl=function(e){function t(e,i){var n;return k()(this,t),zl(n=Rl(this,t,[e,i]),Gl,void 0),n._loadEvent=void 0,n._loaded=!1,n.setDefaultValue(),n.watchs=[],n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element_style=null,n.options.accuracy=i.accuracy?Number(i.accuracy.toFixed(1)):1,n.options.orientation=n.options.orientation||{},n.options.position=n.options.position||{},n.oldData={id:n.options.id,transparency:n.options.transparency||0===n.options.transparency?n.options.transparency:1,name:n.options.name,accuracy:n.options.accuracy,url:n.options.url,height:n.options.position.alt||0,lng:n.options.position.lng,lat:n.options.position.lat,scale:n.options.scale||0===n.options.scale?n.options.scale:1,roll:n.options.orientation.roll||0,heading:n.options.orientation.heading||0,pitch:n.options.orientation.pitch||0},n.newData={id:n.options.id,transparency:n.options.transparency||0===n.options.transparency?n.options.transparency:1,name:n.options.name,accuracy:n.options.accuracy,url:n.options.url,height:n.options.position.alt||0,lng:n.options.position.lng,lat:n.options.position.lat,scale:n.options.scale||0===n.options.scale?n.options.scale:1,roll:n.options.orientation.roll||0,heading:n.options.orientation.heading||0,pitch:n.options.orientation.pitch||0},n.tileset=void 0,n.editObj=new Ho(n.sdk),n.editObj.controllerCallBack=n.rotationEditingCallBack,n}return un()(t,e),x()(t,[{key:"loadSceneTree",value:function(){}},{key:"loadTileset",value:(n=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h,p,d,m=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=jl({},t),n="",i.url.startsWith("http")||i.url.includes(":")?n=i.url:this.options.host?(o=new URL(i.url,this.options.host),n=o.href):n=i.url,e.next=5,fetch(n,{method:"get",headers:{"Content-Type":"application/json"}});case 5:if(200!==(s=e.sent).status){e.next=10;break}return e.next=9,s.json();case 9:this.tileset=e.sent;case 10:if(r={show:this.options.show,skipLevelOfDetail:!0,baseScreenSpaceError:1024,maximumScreenSpaceError:32,skipScreenSpaceErrorFactor:16,skipLevels:1,immediatelyLoadDesiredLevelOfDetail:!1,loadSiblings:!0,cullWithChildrenBounds:!0,cullRequestsWhileMoving:!0,cullRequestsWhileMovingMultiplier:10,preloadWhenHidden:!1,preferLeaves:!0,maximumCacheOverflowBytes:128,progressiveResolutionHeightFraction:.5,dynamicScreenSpaceErrorDensity:.1,dynamicScreenSpaceErrorFactor:1,dynamicScreenSpaceError:!0},!(Number(Cesium.VERSION.split(".")[1])>=107)){e.next=19;break}return e.next=14,Cesium.Cesium3DTileset.fromUrl(n,r);case 14:l=e.sent,this.entity=l,this.entity.imageBasedLighting.luminanceAtZenith=.1,e.next=25;break;case 19:return r.url=n,l=new Cesium.Cesium3DTileset(r),e.next=23,l.readyPromise;case 23:this.entity=e.sent,this.entity.imageBasedLighting.luminanceAtZenith=.1;case 25:return e.next=27,this.loadSceneTree(n);case 27:if(c=function(e){if(e._contents)for(var t=0;t<e._contents.length;t++)c(e._contents[t]);else for(var i=0;i<e.featuresLength;i++){var n=e.getFeature(i),o=n.content.url,s=n.getProperty("id");if(m.features.has(s))if(m.features.get(s).features){if(m.features.get(s).features[o]){if(m.features.get(s).features[o].customColor&&(n.color=m.features.get(s).features[o].customColor,n.customColor=m.features.get(s).features[o].customColor),m.features.get(s).features[o].customAlpha){var a=n.color;n.color=Cesium.Color.fromCssColorString("rgba(".concat(Cesium.Color.floatToByte(a.red),",").concat(Cesium.Color.floatToByte(a.green),",").concat(Cesium.Color.floatToByte(a.blue),",").concat(m.features.get(s).features[o].customAlpha,")")),n.customAlpha=m.features.get(s).features[o].customAlpha}m.features.get(s).features[o].customShow&&(n.show=m.features.get(s).features[o].customShow,n.customShow=m.features.get(s).features[o].customShow)}m.features.get(s).features[o]=n}else{var r={};if(m.features.get(s).customColor&&(n.color=m.features.get(s).customColor,n.customColor=m.features.get(s).customColor),m.features.get(s).customAlpha){var l=n.color;n.color=Cesium.Color.fromCssColorString("rgba(".concat(Cesium.Color.floatToByte(l.red),",").concat(Cesium.Color.floatToByte(l.green),",").concat(Cesium.Color.floatToByte(l.blue),",").concat(m.features.get(s).customAlpha,")")),n.customAlpha=m.features.get(s).customAlpha}m.features.get(s).customShow&&(n.show=m.features.get(s).customShow,n.customShow=m.features.get(s).customShow),r[o]=n,m.features.get(s).features=r}else{var u={};u[o]=n,m.features.set(s,{features:u})}n.customColor||(n.customColor=Cesium.Color.fromCssColorString("#ffffff"))}},this.sdk&&this.sdk.viewer&&this.sdk.viewer.scene){e.next=30;break}return e.abrupt("return");case 30:l.tileLoad.addEventListener((function(e){var t,i,n;c(e._content),clearTimeout(Hl(Gl,m)),t=Gl,i=m,n=setTimeout((function(){clearTimeout(Hl(Gl,m));var e,t=m.cartesian3Towgs84(l.boundingSphere.center,m.sdk.viewer),i=turf.circle([t.lng,t.lat],l.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),n=Al(m.sdk.entityMap);try{for(n.s();!(e=n.n()).done;){var o=y()(e.value,2),s=(o[0],o[1]);if("BillboardObject"===s.type&&3==s.heightMode){var a=turf.point([s.lng,s.lat]);turf.booleanPointInPolygon(a,i)&&s.updateHeight()}else s.label&&(s.label.show=s.label.show)}}catch(e){n.e(e)}finally{n.f()}}),500),t.set(Vl(t,i),n)})),this.entity._root.originalTransform=jl({},this.entity._root.transform),this.entity.id=this.options.id||this.randomString(),this.entity.type=this.type,this.sdk.viewer.scene.primitives.add(l),!this.options.position||"{}"==JSON.stringify(this.options.position)||!this.options.position.lng&&0!==this.options.position.lng||!this.options.position.lat&&0!==this.options.position.lat?(this.options.position={},d=Cesium.Cartographic.fromCartesian(this.entity.boundingSphere.center),this.tileset.root.transform&&(d=Cesium.Cartographic.fromCartesian({x:this.tileset.root.transform[12],y:this.tileset.root.transform[13],z:this.tileset.root.transform[14]})),this.entity.original={lng:Cesium.Math.toDegrees(d.longitude),lat:this.oldData.lat=Cesium.Math.toDegrees(d.latitude),height:d.height},this.lng=this.oldData.lng=Cesium.Math.toDegrees(d.longitude),this.lat=this.oldData.lat=Cesium.Math.toDegrees(d.latitude),this.height=this.oldData.height=d.height):(this.options.position.alt,this.options.position.alt,u=Cesium.Cartographic.fromCartesian(this.entity.boundingSphere.center),this.tileset.root.transform&&(u=Cesium.Cartographic.fromCartesian({x:this.tileset.root.transform[12],y:this.tileset.root.transform[13],z:this.tileset.root.transform[14]})),this.entity.original={lng:Cesium.Math.toDegrees(u.longitude),lat:Cesium.Math.toDegrees(u.latitude),height:u.height},h=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt)),p=Cesium.Matrix4.fromUniformScale(this.oldData.scale),this.tileset.root.transform&&Cesium.Matrix4.multiply(h,p,this.entity._root.transform),this.lng=this.oldData.lng,this.lat=this.oldData.lat,this.height=this.oldData.height),this.scale=this.oldData.scale,this.roll=this.oldData.roll,this.heading=this.oldData.heading,this.pitch=this.oldData.pitch,this.transparency=this.oldData.transparency,this.loaded=!0,this._loaded=!0,this._loadEvent&&this._loadEvent(this.entity),at(this.sdk,this.options.id),ge(this.entity.id,this.mouseMoveCB,this);case 46:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"remove",value:function(){Fl(t,"remove",this,3)([]),this.editObj.destroy(),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"flyTo",value:function(){Fl(t,"flyTo",this,3)([])}},{key:"on",value:function(){return this.loadTileset(this.options)}},{key:"setDefaultValue",value:function(){Fl(t,"setDefaultValue",this,3)([]),this.options.host=this.options.host||p(),this.options.url=this.options.url||""}},{key:"position",get:function(){var e=Cesium.Cartographic.fromCartesian(this.entity.boundingSphere.center);this.tileset.root.transform&&(e=Cesium.Cartographic.fromCartesian({x:this.tileset.root.transform[12],y:this.tileset.root.transform[13],z:this.tileset.root.transform[14]}));var t=Cesium.Math.toDegrees(e.longitude+6.63814e-9),i=Cesium.Math.toDegrees(e.latitude+2.5137835e-7);return this.newData.lng&&this.newData.lat&&this.newData.height?{lng:this.newData.lng,lat:this.newData.lat,height:this.newData.height}:{lng:t,lat:i,height:e.height-2.19104611043234}},set:function(e){}},{key:"rotationEditing",get:function(){return"rtation"===this.editObj.getActiveState()},set:function(e){if(!this.tileset.root.transform)return window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500})),void console.warn("该模型不支持移动和旋转!");e?(this.editObj.position={lng:this.newData.lng,lat:this.newData.lat,alt:this.newData.height},this.editObj.update(),this.editObj.editRtation()):this.editObj.destroy()}},{key:"positionEditing",get:function(){return"translational"===this.editObj.getActiveState()},set:function(e){if(this.sdk&&this.sdk.viewer&&this.entity)return this.tileset.root.transform?void(e?(this.editObj.position={lng:this.newData.lng,lat:this.newData.lat,alt:this.newData.height},this.editObj.update(),this.editObj.editTranslational()):(this.editObj.destroy(),this._positionEditingCallback=null)):(window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500})),void console.warn("该模型不支持移动和旋转!"))}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"closePositionEditing",value:function(){this.positionEditing=!1,this._positionEditingCallback=null}},{key:"rotationEditingCallBack",get:function(){var e=this;return function(t,i){e.lng=t.position.lng,e.lat=t.position.lat,e.height=t.position.alt,e.roll=t.rotate.x,e.heading=t.rotate.y,e.pitch=t.rotate.z,e._positionEditingCallback&&e._positionEditingCallback()}},set:function(e){this._rotationEditingCallBack=e}},{key:"flicker",value:function(){}},{key:"edit",value:(i=o()(a.a.mark((function e(t){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"show",get:function(){return this.options.show},set:function(e){var t=this;"boolean"==typeof e?(this.options.show=e,this.entity&&(this.entity.show=e),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=e),this.options.label&&this.options.label.show&&this.label&&(this.label.show=e),setTimeout((function(){var e,i=t.cartesian3Towgs84(t.entity.boundingSphere.center,t.sdk.viewer),n=turf.circle([i.lng,i.lat],t.entity.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),o=Al(t.sdk.entityMap);try{for(o.s();!(e=o.n()).done;){var s=y()(e.value,2),a=(s[0],s[1]);if("BillboardObject"===a.type&&3==a.heightMode){var r=turf.point([a.lng,a.lat]);turf.booleanPointInPolygon(r,n)&&a.updateHeight()}else a.label&&(a.label.show=a.label.show)}}catch(e){o.e(e)}finally{o.f()}Mt(t.sdk,t.options.id),at(t.sdk,t.options.id)}),300)):console.error("参数必须为boolean")}},{key:"load",value:function(e){this._loaded?e():this._loadEvent=e}}]);var i,n}(yl);function Ul(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Yl(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)?Yl(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Yl(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 Jl(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var ql=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(i=Jl(this,t,[e,n])).picking=!1,i.on(),i.Dialog=o,i._elms={},i._EventBinding=new xn,i}return un()(t,e),x()(t,[{key:"type",get:function(){return"tileset"}},{key:"on",value:function(){return this.loadTileset(this.options)}},{key:"name",get:function(){return this.newData.name},set:function(e){this.newData.name=e,this._elms.name&&this._elms.name.forEach((function(t){t.value=e}))}},{key:"height",get:function(){return this.newData.height},set:function(e){this.newData.height=e,this.options.position.alt=e,this._elms.height&&this._elms.height.forEach((function(t){t.value=e})),this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch)}},{key:"accuracy",get:function(){return this.newData.accuracy},set:function(e){var t=this;this.newData.accuracy=Number(e.toFixed(1)),this.newData.accuracy<.1&&(this.newData.accuracy=.1),this.entity&&(this.entity.maximumScreenSpaceError=32/this.newData.accuracy),this._elms.accuracy&&this._elms.accuracy.forEach((function(e){e.value=t.newData.accuracy}))}},{key:"lng",get:function(){return this.newData.lng},set:function(e){this.newData.lng=e,this.options.position.lng=e,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch)}},{key:"lat",get:function(){return this.newData.lat},set:function(e){this.newData.lat=e,this.options.position.lat=e,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch)}},{key:"roll",get:function(){return this.newData.roll},set:function(e){this.newData.roll=e,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale)}},{key:"heading",get:function(){return this.newData.heading},set:function(e){this.newData.heading=e,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale)}},{key:"pitch",get:function(){return this.newData.pitch},set:function(e){this.newData.pitch=e,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale)}},{key:"transparency",get:function(){return this.newData.transparency},set:function(e){if(this.newData){this.newData.transparency=Number(e),this._elms.transparency&&this._elms.transparency.forEach((function(t){t.value=e}));var t=this.newData.transparency;this.entity.style=new Cesium.Cesium3DTileStyle({color:{conditions:[["Boolean(${SIZE})","${COLOR} * color('rgba(255,255,255)', "+t+")"],["true","color('rgba(255,255,255,"+t+")')"]]},show:!0})}}},{key:"edit",value:(i=o()(a.a.mark((function e(){var t,i,n=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.length>0&&void 0!==n[0]&&n[0],e.abrupt("return");case 12:this._DialogObject=e.sent,document.getElementsByTagName("head")[0].appendChild(this._element_style),(t=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" @model="name">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" @model="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">精度</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" min="0.1" max="10" step="0.1" @model="accuracy">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">透视</span>\n <input type="range" min="0" max="1" step="0.01" @model="transparency">\n </div>\n </div>\n </div>\n ',this._DialogObject.contentAppChild(t),i=t.getElementsByTagName("*"),this._EventBinding.on(this,i),this._elms=this._EventBinding.element,e.next=22;break;case 22:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateModel",value:function(e,t,i){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;if(!this.tileset.root.transform)return window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500})),void console.warn("该模型不支持移动和旋转!");if(!(!e&&0!==e||!t&&0!==t||!i&&0!==i)){var l=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(s)),u=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(a)),h=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(e,t,i)),p=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=Cesium.Matrix4.fromRotationTranslation(u),f=new Cesium.Matrix4;Cesium.Matrix4.multiply(h,p,f),Cesium.Matrix4.multiply(f,d,f),Cesium.Matrix4.multiply(f,m,f);var v=Cesium.Matrix4.fromUniformScale(r);Cesium.Matrix4.multiply(f,v,this.entity._root.transform),this.editObj.activeAxis||(this.editObj.position={lng:e,lat:t,alt:i}),this.editObj.activeCircle||(this.editObj.rotate={x:o,y:s,z:a}),this.editObj&&this.editObj.update(),clearTimeout(this._updateModelTimeout),this._updateModelTimeout=setTimeout((function(){clearTimeout(n._updateModelTimeout);var e,t=n.cartesian3Towgs84(n.entity.boundingSphere.center,n.sdk.viewer),i=turf.circle([t.lng,t.lat],n.entity.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),o=Ul(n.sdk.entityMap);try{for(o.s();!(e=o.n()).done;){var s=y()(e.value,2),a=(s[0],s[1]);if("BillboardObject"===a.type&&3==a.heightMode){var r=turf.point([a.lng,a.lat]);turf.booleanPointInPolygon(r,i)&&a.updateHeight()}else a.label&&(a.label.show=a.label.show)}}catch(e){o.e(e)}finally{o.f()}}),300)}}},{key:"reset",value:function(){this.editObj.destroy(),this.entity&&(this.transparency=this.oldData.transparency,this.name=this.oldData.name,this.height=this.oldData.height,this.lng=this.oldData.lng,this.lat=this.oldData.lat,this.roll=this.oldData.roll,this.heading=this.oldData.heading,this.pitch=this.oldData.pitch,this.scale=this.oldData.scale,this.accuracy=this.oldData.accuracy,this.entity.style=new Cesium.Cesium3DTileStyle({color:{conditions:[["Boolean(${SIZE})","${COLOR} * color('rgba(255,255,255)', "+this.transparency+")"],["true","color('rgba(255,255,255,"+this.transparency+")')"]]},show:!0}))}}]);var i}(Wl);function Xl(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Zl(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)?Zl(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Zl(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 Kl(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 Ql(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Kl(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Kl(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function $l(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function ec(e,t,i){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,i)}function tc(e,t,i){return e.set(nc(e,t),i),i}function ic(e,t){return e.get(nc(e,t))}function nc(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var oc=new WeakMap,sc=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),ec(i=$l(this,t,[e,n]),oc,void 0),i.picking=!1,i.features=n.features||[],i.exportStateArray=[],i.Dialog=o,i._elms={},i._EventBinding=new xn,i.Dialog.exportState=function(e){i.exportState(e)},i.Dialog.exportProperty=function(e){i.exportProperty(i.exportStateArray)},i.features=new Map,i.on(),i}return un()(t,e),x()(t,[{key:"type",get:function(){return"bim"}},{key:"name",get:function(){return this.newData.name},set:function(e){this.newData.name=e,this._elms.name&&this._elms.name.forEach((function(t){t.value=e}))}},{key:"lng",get:function(){return this.newData.lng},set:function(e){this.newData.lng=e,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e}))}},{key:"lat",get:function(){return this.newData.lat},set:function(e){this.newData.lat=e,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e}))}},{key:"height",get:function(){return this.newData.height},set:function(e){this.newData.height=e,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.height&&this._elms.height.forEach((function(t){t.value=e}))}},{key:"roll",get:function(){return this.newData.roll},set:function(e){this.newData.roll=e,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.roll&&this._elms.roll.forEach((function(t){t.value=e}))}},{key:"heading",get:function(){return this.newData.heading},set:function(e){this.newData.heading=e,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.heading&&this._elms.heading.forEach((function(t){t.value=e}))}},{key:"pitch",get:function(){return this.newData.pitch},set:function(e){this.newData.pitch=e,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.pitch&&this._elms.pitch.forEach((function(t){t.value=e}))}},{key:"scale",get:function(){return this.newData.scale},set:function(e){this.newData.scale=e,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.scale&&this._elms.scale.forEach((function(t){t.value=e}))}},{key:"loadSceneTree",value:(r=o()(a.a.mark((function e(t){var i,n=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(i=t.split("/"))[i.length-1]="scenetree.json",e.next=4,Cesium.Resource.fetchJson({url:i.join("/")}).then((function(e){n.scenetree=e;var t=function(e){e.forEach((function(e){n.features.has(e.id)?n.features.get(e.id).sphere=e.sphere:n.features.set(e.id,{sphere:e.sphere}),e.children&&t(e.children)}))};t(e.scenes[0].children)}));case 4:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"edit",value:(s=o()(a.a.mark((function e(t){var i,n,o=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=16;break}return e.next=6,new pn(this.sdk,this.newData,{title:"BIM模型属性",left:"180px",top:"100px",resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},confirmCallBack:function(e){o.name=o.name.trim(),o.name||(o.name="未命名对象"),o.oldData.name=o.newData.name,o.oldData.height=o.newData.height,o.oldData.lng=o.newData.lng,o.oldData.lat=o.newData.lat,o.oldData.scale=o.newData.scale,o.oldData.roll=o.newData.roll,o.oldData.heading=o.newData.heading,o.oldData.pitch=o.newData.pitch,o._DialogObject.close();var t=new Map;o.features.forEach((function(e,i){var n=Ql({},e);delete n.features,t.set(i,n)})),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(Ql(Ql({},o.oldData),{},{features:t,type:o.type})),at(o.sdk,o.oldData.id)},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()},closeCallBack:function(){o.reset(),o.editObj.destroy(),o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(e){o.newData.show=e,o.entity&&(o.entity.show=e),o.Dialog.showCallBack&&o.Dialog.showCallBack()},rotateCallBack:function(){o.rotationEditing?o.rotationEditing=!1:o.rotationEditing=!0},translationalCallBack:function(){o.positionEditing?o.positionEditing=!1:o.positionEditing=!0}});case 6:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" tileset-bim",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">x轴</span>\n <input type="number" title="" min="-180" max="180" @model="roll">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label">y轴</span>\n <input type="number" title="" min="-180" max="180" @model="heading">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">z轴</span>\n <input type="number" title="" min="-180" max="180" @model="pitch">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">大小</span>\n <input type="range" max="10" min="0.1" step="0.1" @model="scale">\n <div class="input-number" style="width: 100px;margin-left: 10px;">\n <input type="number" title="" min="0" max="10" step="0.1" @model="scale">\n <span class="arrow"></span>\n </div>\n \n </div>\n </div>\n </div>\n \n <div class="divide">\n <div class="line"></div>\n <p>BIM属性导出选项</p>\n <div class="line"></div>\n </div>\n <div class="row">\n <div style="display: flex;">\n <div class="checkbox-box" @click="exportState">\n <input type="checkbox" value="3">\n <span>修建中</span>\n </div>\n <div class="checkbox-box" @click="exportState">\n <input type="checkbox" value="2">\n <span>未完成</span>\n </div>\n <div class="checkbox-box" @click="exportState">\n <input type="checkbox" value="1">\n <span>已完成</span>\n </div>\n </div>\n <div class="col">\n <button @click="exportProperty">导 出</button>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,e.next=17;break;case 16:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"featureEdit",value:(n=o()(a.a.mark((function e(t,i){var n,o,s,r,l,c,u,h,p,d,m=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this,this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=46;break}o=function(e){var t='<div class="row property-item">\n <div class="col">\n <input class="input_lable" name="key" value="'.concat(e.key,'">\n <input class="input" name="value" value="').concat(e.value,'">\n <button class="btn add">+</button>\n <button class="btn delete">-</button>\n </div>\n </div>'),i=document.createElement("div");i.innerHTML=t;var s=i.getElementsByClassName("property-item")[0],a=s.querySelector("input[name='key']"),l=s.querySelector("input[name='value']"),c=s.getElementsByClassName("add")[0],h=s.getElementsByClassName("delete")[0];a.addEventListener("input",(function(t){e.key=t.target.value})),l.addEventListener("input",(function(t){e.value=t.target.value})),c.addEventListener("click",(function(){var e={id:n.randomString(),key:"点击此处可编辑",value:""};r.descriptions.push(e),o(e)})),h.addEventListener("click",(function(t){for(var i=0;i<r.descriptions.length;i++)if(r.descriptions[i].id===e.id){r.descriptions.splice(i,1);break}u.removeChild(s)})),u.appendChild(s)},s=i.getProperty("name"),r={id:i.getProperty("id"),name:s,state:i.getProperty("state")||0,descriptions:i.getProperty("descriptions")||[{id:this.randomString(),key:"点击此处可编辑",value:""}]},e.t0=i.getProperty("state"),e.next="0"===e.t0?10:"1"===e.t0?12:"2"===e.t0?14:"3"===e.t0?16:18;break;case 10:return r.stateCH="",e.abrupt("break",18);case 12:return r.stateCH="已完成",e.abrupt("break",18);case 14:return r.stateCH="未完成",e.abrupt("break",18);case 16:return r.stateCH="修建中",e.abrupt("break",18);case 18:return this._element_style=document.createElement("style"),this._element_style.type="text/css",this._element_style.setAttribute("data-name","YJ_style_dialog"),this._element_style.innerHTML="\n .YJ-custom-base-dialog>.content {\n width: 440px;\n }\n .YJ-custom-base-dialog>.content .row .label {\n flex: 0 0 110px;\n }\n .col:first-child {\n margin-right: 10px;\n }\n .col:last-child {\n margin-left: 10px;\n }\n .YJ-custom-base-dialog>.content .divide {\n position: relative;\n display: flex;\n align-items: center;\n margin: 20px 0;\n }\n .YJ-custom-base-dialog>.content .divide .line{\n height: 1px;\n background: #ddd;\n flex: 1;\n }\n .YJ-custom-base-dialog>.content .divide p{\n margin: 0 10px;\n }\n .YJ-custom-base-dialog>.content .property .property-item .btn{\n font-size: 24px;\n line-height: 20px;\n padding: 2px 0;\n }\n .YJ-custom-base-dialog>.content .property .property-item .input_lable {\n flex: 0 0 115px;\n border: none;\n margin-right: 15px;\n text-align: right;\n }\n .YJ-custom-base-dialog>.content .property .property-item:first-child .delete{\n display: none\n }\n .YJ-custom-base-dialog>.content .property .property-item .add{\n display: none;\n }\n .YJ-custom-base-dialog>.content .property .property-item:last-child .add{\n display: inline-block;\n }\n",e.next=24,new J(this.sdk.viewer._container,{title:this.oldData.name+"-----设置状态",left:"calc(50% - 200px)",top:"calc(50% - 200px)",closeCallBack:function(){m.Dialog.closeCallBack&&m.Dialog.closeCallBack()}});case 24:return this._DialogObject=e.sent,e.next=27,this._DialogObject.init();case 27:for(document.getElementsByTagName("head")[0].appendChild(this._element_style),(l=document.createElement("div")).innerHTML='\n <div class="row">\n <div class="col">\n <span class="label">构件名称</span>\n <input class="input" name="name" disabled="disabled">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">选择状态</span>\n <select class="input input-select" name="state-select">\n <option value="0" style="color: #000;">重置</option>\n <option value="1" style="color: #f00;">已完成</option>\n <option value="2" style="color: #0f0;">未完成</option>\n <option value="3" style="color: #00f;">修建中</option>\n </select>\n </div>\n </div>\n <div class="divide">\n <div class="line"></div>\n <p>自定义属性</p>\n <div class="line"></div>\n </div>\n <div class="property">\n </div>\n ',l.querySelector("input[name='name']").value=s,(c=l.querySelector("select[name='state-select']")).value=r.state,c.addEventListener("change",(function(e){switch(r.state=e.target.value,r.state){case"0":r.stateCH="";break;case"1":r.stateCH="已完成";break;case"2":r.stateCH="未完成";break;case"3":r.stateCH="修建中"}})),u=l.getElementsByClassName("property")[0],h=0;h<r.descriptions.length;h++)o(r.descriptions[h],h);p=this._DialogObject._element.foot.getElementsByClassName("translational")[0],this._DialogObject.contentAppChild(l),(d=document.createElement("button")).className="confirm",d.innerHTML="确认",this._DialogObject.footAppChild(d,p),d.addEventListener("click",(function(){for(var e=!1,t=0;t<m.features.length;t++)if(m.features[t].id==r.id){m.features[t]=r,e=!0;break}e||m.features.push(r),i.setProperty("state",r.state),i.setProperty("descriptions",r.descriptions);var n="#fff";switch(r.state){case"0":n="#fff";break;case"1":n="#f00";break;case"2":n="#0f0";break;case"3":n="#00f"}i.color=Cesium.Color.fromCssColorString(n),m._DialogObject.close(),m.Dialog.confirmCallBack&&m.Dialog.confirmCallBack(Ql(Ql({},m.newData),{},{features:m.features}))})),e.next=48;break;case 46:this._element_style&&(document.getElementsByTagName("head")[0].removeChild(this._element_style),this._element_style=null),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 48:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.oldData.name,this.height=this.oldData.height,this.lng=this.oldData.lng,this.lat=this.oldData.lat,this.roll=this.oldData.roll,this.heading=this.oldData.heading,this.pitch=this.oldData.pitch,this.scale=this.oldData.scale)}},{key:"updateModel",value:function(e,t,i){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;if(!this.tileset.root.transform)return window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500})),void console.warn("该模型不支持移动和旋转!");if(!(!e&&0!==e||!t&&0!==t||!i&&0!==i)){var l=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(s)),u=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(a)),h=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(e,t,i)),p=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=Cesium.Matrix4.fromRotationTranslation(u),f=new Cesium.Matrix4;Cesium.Matrix4.multiply(h,p,f),Cesium.Matrix4.multiply(f,d,f),Cesium.Matrix4.multiply(f,m,f);var v=Cesium.Matrix4.fromUniformScale(r);Cesium.Matrix4.multiply(f,v,this.entity._root.transform),this.editObj.activeAxis||(this.editObj.position={lng:e,lat:t,alt:i}),this.editObj.activeCircle||(this.editObj.rotate={x:o,y:s,z:a}),this.editObj&&this.editObj.update(),clearTimeout(ic(oc,this)),tc(oc,this,setTimeout((function(){clearTimeout(ic(oc,n));var e,t=n.cartesian3Towgs84(n.entity.boundingSphere.center,n.sdk.viewer),i=turf.circle([t.lng,t.lat],n.entity.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),o=Xl(n.sdk.entityMap);try{for(o.s();!(e=o.n()).done;){var s=y()(e.value,2),a=(s[0],s[1]);if("BillboardObject"===a.type&&3==a.heightMode){var r=turf.point([a.lng,a.lat]);turf.booleanPointInPolygon(r,i)&&a.updateHeight()}else a.label&&(a.label.show=a.label.show)}}catch(e){o.e(e)}finally{o.f()}}),300))}}},{key:"getScenetree",value:function(){return this.scenetree}},{key:"featureColor",value:function(e,t){if(this.features.has(e)){var i=this.features.get(e).features;for(var n in i)i[n].content._model&&(i[n].color=Cesium.Color.fromCssColorString(t)),i[n].customColor=Cesium.Color.fromCssColorString(t);this.features.get(e).customColor=Cesium.Color.fromCssColorString(t)}}},{key:"getFeatureColor",value:function(e){if(this.features.has(e)){if(this.features.get(e).customColor)return this.features.get(e).customColor;var t=this.features.get(e).features;for(var i in t)if(t[i].content._model)return t[i].customColor||t[i].color}}},{key:"featureShow",value:function(e,t){if(this.features.has(e)){var i=this.features.get(e).features;for(var n in i)i[n].content._model&&(i[n].show=t),i[n].customShow=t;this.features.get(e).customShow=t}}},{key:"featureFlyto",value:(i=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.features.has(t)?(i=this.features.get(t).sphere,n=new Cesium.Cartesian3(i[0],i[1],i[2]),o=this.entity._root.originalTransform,o=Cesium.Matrix4.inverse(o,new Cesium.Matrix4),s=this.entity._root.transform,r=Cesium.Matrix4.multiply(s,o,new Cesium.Matrix4),l=Cesium.Matrix4.multiplyByPoint(r,n,new Cesium.Cartesian3),c=this.cartesian3Towgs84(l,this.sdk.viewer),u=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt+i[3]),pi(0),ni(this.sdk),oi(this.sdk),this.sdk.viewer.camera.flyTo({destination:u}),this.features.forEach((function(e,i){if(i===t){var n=h.getFeatureColor(t);if(h.features.has(t)&&n){var o=h.features.get(t).features;for(var s in o)o[s].content._model&&(o[s].color=n),o[s].customAlpha=1;h.features.get(t).customAlpha=1}}else{var a=h.getFeatureColor(i);if(h.features.has(i)&&a){var r=h.features.get(i).features;for(var l in r)r[l].content._model&&(r[l].color=Cesium.Color.fromCssColorString("rgba(".concat(Cesium.Color.floatToByte(a.red),",").concat(Cesium.Color.floatToByte(a.green),",").concat(Cesium.Color.floatToByte(a.blue),",").concat(.2*a.alpha,")"))),r[l].customAlpha=.2*a.alpha;h.features.get(i).customAlpha=.2*a.alpha}}}))):this.features.forEach((function(e,t){var i=h.features.get(t).features,n=h.getFeatureColor(t);if(n){for(var o in i)i[o].content._model&&(i[o].color=n),i[o].customAlpha=1;h.features.get(t).customAlpha=.2*n.alpha}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"exportProperty",value:function(e){if(0!==this.exportStateArray.length){for(var t,i=["name","","","","","","","","","","","","stateCH","descriptions"],n='<Worksheet ss:Name="{nameWS}"><Table><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="240"/>{rows}</Table></Worksheet>',o=function(e,t){return e.replace(/{(\w+)}/g,(function(e,i){return t[i]}))},s="",a="",r="",l=0;l<this.features.length;l++)for(var c=0;c<e.length;c++)if(this.features[l].state==e[c]){for(var u in 0==l&&(r+='<Row><Cell><Data ss:Type="String">构件名称</Data></Cell><Cell><Data ss:Type="String">体积</Data></Cell><Cell><Data ss:Type="String">墩全高H</Data></Cell><Cell><Data ss:Type="String">墩身高h</Data></Cell><Cell><Data ss:Type="String">底部高程</Data></Cell><Cell><Data ss:Type="String">承台宽</Data></Cell><Cell><Data ss:Type="String">承台长</Data></Cell><Cell><Data ss:Type="String">承台高</Data></Cell><Cell><Data ss:Type="String">族</Data></Cell><Cell><Data ss:Type="String">桩径</Data></Cell><Cell><Data ss:Type="String">桩长</Data></Cell><Cell><Data ss:Type="String">结构材质</Data></Cell><Cell><Data ss:Type="String">完成情况</Data></Cell><Cell><Data ss:Type="String">自定义属性</Data></Cell></Row>'),r+="<Row>",i){if(Array.isArray(this.features[l][i[u]])){var h="";for(var p in this.features[l][i[u]])h+="".concat(this.features[l][i[u]][p].key+":"+this.features[l][i[u]][p].value," ");s={nameType:"String",data:h}}else s={nameType:"String",data:this.features[l][i[u]]||"0"};r+=o('<Cell><Data ss:Type="{nameType}">{data}</Data></Cell>',s)}r+="</Row>",l>0&&l/6e4%1==0&&(a+=o(n,s={rows:r,nameWS:"Sheet"+l}),r="",r+='<Row><Cell><Data ss:Type="String">构件名称</Data></Cell><Cell><Data ss:Type="String">体积</Data></Cell><Cell><Data ss:Type="String">墩全高H</Data></Cell><Cell><Data ss:Type="String">墩身高h</Data></Cell><Cell><Data ss:Type="String">底部高程</Data></Cell><Cell><Data ss:Type="String">承台宽</Data></Cell><Cell><Data ss:Type="String">承台长</Data></Cell><Cell><Data ss:Type="String">承台高</Data></Cell><Cell><Data ss:Type="String">族</Data></Cell><Cell><Data ss:Type="String">桩径</Data></Cell><Cell><Data ss:Type="String">桩长</Data></Cell><Cell><Data ss:Type="String">结构材质</Data></Cell><Cell><Data ss:Type="String">完成情况</Data></Cell><Cell><Data ss:Type="String">自定义属性</Data></Cell></Row>')}a+=o(n,s={rows:r,nameWS:"Sheet"}),r="",t=o('<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"><DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"><Author>Axel Richter</Author><Created>{created}</Created></DocumentProperties><Styles><Style ss:ID="Currency"><NumberFormat ss:Format="Currency"></NumberFormat></Style><Style ss:ID="Date"><NumberFormat ss:Format="Medium Date"></NumberFormat></Style></Styles>{worksheets}</Workbook>',s={created:(new Date).getTime(),worksheets:a});var d,m=document.createElement("A");m.href="data:application/vnd.ms-excel;base64,"+(d=t,window.btoa(unescape(encodeURIComponent(d)))),m.download=this.oldData.name+"--构件属性.xls",m.target="_blank",document.body.appendChild(m),m.click(),document.body.removeChild(m)}else window.ELEMENT&&window.ELEMENT.Message({message:"未选择属性导出选项!",type:"warning",duration:1500})}},{key:"exportState",value:function(e){var t=e.target.getElementsByTagName("input")[0];if(t.checked=!t.checked,t.checked)this.exportStateArray.push(t.value),this.exportStateArray=Array.from(new Set(this.exportStateArray));else for(var i=0;i<this.exportStateArray.length;i++)if(this.exportStateArray[i]==t.value){this.exportStateArray.splice(i,1);break}}}]);var i,n,s,r}(Wl);function ac(e){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 60px;">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 60px;">最大比例</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0.1" max="99999" step="0.1" @model="maximumScale">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 60px;">最小像素</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999" @model="minimumPixelSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-99999" max="9999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 60px;">固定大小</span>\n <input class="btn-switch" type="checkbox" @model="scaleByDistance">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="model-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="方向信息">\n <div>\n <div class="row">\n <p class="lable-left-line">旋转</p>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">x 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="360" min="0" step="0.01" @model="rotateX">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="360" @model="rotateX">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">y 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="360" min="0" step="0.01" @model="rotateY">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="360" @model="rotateY">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">z 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="360" min="0" step="0.01" @model="rotateZ">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="360" @model="rotateZ">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n\n <div class="row">\n <div class="lable-left-line">\n <span>缩放</span>\n <div class="checkbox-box">\n <input type="checkbox">\n <span>是否等比例缩放</span>\n </div>\n </div>\n </div>\n <div class="row no-equal" style="display: none;">\n <div class="row">\n <div class="col">\n <span class="label">x 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="99999" min="0" step="1" @model="scaleX">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="99999" @model="scaleX">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">y 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="99999" min="0" step="1" @model="scaleY">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="99999" @model="scaleY">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">z 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="99999" min="0" step="1" @model="scaleZ">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="99999" @model="scaleZ">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="row equal" style="display: none;">\n <div class="row">\n <div class="col">\n <span class="label">等比例缩放</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="99999" min="0" step="1">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="99999" step="1">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <p class="lable-left-line">高度</p>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="999999" min="-99999" step="0.01" @model="alt">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="-99999" max="999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function rc(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 lc(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?rc(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):rc(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var cc=function(){return x()((function e(t,i){k()(this,e),this.sdk=t,this.model=i,this.activeAxis,this.activeCircle,this.activeModelParam,this.origin,this.rayX,this.rayY,this.rayZ,this.arrow={},this.activeState,this.coordArrows=[],this.coordCircles=[],this.originalMatrix=lc({},i.modelMatrix),this.model.rotate||(this.model.rotate={x:0,y:0,z:0}),this.initParam(),this.MapEvent=new K(this.sdk)}),[{key:"initParam",value:function(){var e=Cesium.Cartographic.fromCartesian(this.model.position),t=Cesium.Math.toDegrees(e.longitude),i=Cesium.Math.toDegrees(e.latitude),n=e.height;return this._params={tx:t,ty:i,tz:n,rx:this.model.rotate.x,ry:this.model.rotate.y,rz:this.model.rotate.z},lc({lng:t,lat:i,alt:n,h:n},this.model.rotate)}},{key:"editTranslational",value:function(){var e=this;this.destroy(),this.activeState="translational",this.MapEvent=new K(this.sdk);var t=this,i=this.initParam(),n=i.lng,o=i.lat,s=i.h,a=this.sdk.viewer;this.origin=Cesium.Cartesian3.fromDegrees(n,o,s);var r=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n-.001,o,s),new Cesium.Cartesian3),new Cesium.Cartesian3),l=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n,o-.001,s),new Cesium.Cartesian3),new Cesium.Cartesian3),c=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n,o,s-1),new Cesium.Cartesian3),new Cesium.Cartesian3);this.rayX=new Cesium.Ray(this.origin,r),this.rayY=new Cesium.Ray(this.origin,l),this.rayZ=new Cesium.Ray(this.origin,c),this.arrow.positionX=Cesium.Ray.getPoint(this.rayX,0),this.arrow.positionY=Cesium.Ray.getPoint(this.rayY,0),this.arrow.positionZ=Cesium.Ray.getPoint(this.rayZ,0);var u=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(n,o,s)),h=a.camera.position,p=Cesium.Cartesian3.distance(h,this.origin)/15;Cesium.Matrix4.multiplyByScale(u,new Cesium.Cartesian3(p,p,p),u);var d=this.createAxisArrow("model_edit_xAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(1,0,0)],u,Cesium.Color.RED),m=this.createAxisArrow("model_edit_yAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,1,0)],u,Cesium.Color.LIME),f=this.createAxisArrow("model_edit_zAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,0,1)],u,Cesium.Color.BLUE);a.scene.primitives.add(d),a.scene.primitives.add(m),a.scene.primitives.add(f),this.againArrow(),this.sdk.viewer.camera.percentageChanged=.001,this.sdk.viewer.camera.changed.addEventListener(this.againArrow,this);var v,g={x:0,y:0},y=0;this.MapEvent.mouse_move((function(e,i){!function e(i){if(t.activeAxis){var n=i.startPosition.y-i.endPosition.y,o={x:i.endPosition.x-g.x,y:i.endPosition.y-g.y},s=a.camera.getPickRay(o),r=a.scene.globe.pick(s,a.scene),l=new Cesium.Cartesian3,c=Cesium.Transforms.eastNorthUpToFixedFrame(a.camera.position);Cesium.Matrix4.inverse(c,c),Cesium.Matrix4.multiplyByPoint(c,r,l),Cesium.Cartesian3.normalize(l,l);var u=t.initParam(),h=90+Cesium.Math.toDegrees(Math.asin(l.z)),p=Cesium.Cartographic.fromCartesian(a.camera.position).height,d=t.activeModelParam.alt,m=p/Math.cos(Cesium.Math.toRadians(h));new Cesium.EllipsoidGeodesic(Cesium.Cartographic.fromCartesian(r),Cesium.Cartographic.fromCartesian(a.camera.position));r=Cesium.Ray.getPoint(s,m*(1-d/p));var f=Cesium.Cartographic.fromCartesian(r),b=Cesium.Math.toDegrees(f.longitude),C=Cesium.Math.toDegrees(f.latitude);switch(t.activeAxis._name){case"model_edit_xAxis":t._params.tx=b,t._params.ty=t.activeModelParam.lat,t._params.tz=d,t.origin=Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt);var w=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(u.lng-.001,u.lat,u.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),k=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat-.001,u.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),_=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);t.rayX=new Cesium.Ray(t.origin,w),t.rayY=new Cesium.Ray(t.origin,k),t.rayZ=new Cesium.Ray(t.origin,_);break;case"model_edit_yAxis":t._params.tx=t.activeModelParam.lng,t._params.ty=C,t._params.tz=d,t.origin=Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt);var x=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(u.lng-.001,u.lat,u.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),E=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat-.001,u.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),S=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);t.rayX=new Cesium.Ray(t.origin,x),t.rayY=new Cesium.Ray(t.origin,E),t.rayZ=new Cesium.Ray(t.origin,S);break;case"model_edit_zAxis":t.activeModelParam.alt+=Cesium.Cartesian3.distance(a.camera.position,Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt))/4300*n*3,t._params.tx=t.activeModelParam.lng,t._params.ty=t.activeModelParam.lat,t._params.tz=t.activeModelParam.alt,t.origin=Cesium.Cartesian3.fromDegrees(u.lng,u.lat,t.activeModelParam.alt);var P=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(u.lng-.001,u.lat,t.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),D=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat-.001,t.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),M=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat,t.activeModelParam.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);t.rayX=new Cesium.Ray(t.origin,P),t.rayY=new Cesium.Ray(t.origin,D),t.rayZ=new Cesium.Ray(t.origin,M)}t.updateModel(t._params.tx,t._params.ty,t._params.tz,t._params.rx,t._params.ry,t._params.rz),t.againArrow()}else{var T=Date.now();if(T-y<100)return clearTimeout(v),void(v=setTimeout((function(){e(i)}),100));clearTimeout(v),y=T;for(var O=t.coordArrows,N=0;N<O.length;N++)if(O[N].getGeometryInstanceAttributes)switch(O[N]._name){case"model_edit_xAxis":O[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.RED}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_yAxis":O[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.LIME}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_zAxis":O[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.BLUE}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}})}for(var B=a.scene.drillPick(i.endPosition,10),A=B.length-1;A>=0;A--){var L=B[A];if(L&&L.primitive&&L.id)switch(L.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return void(L.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}}}(e)})),this.MapEvent.mouse_left_down((function(i){var n=a.scene.cartesianToCanvasCoordinates(e.origin);g.x=i.position.x-Math.floor(n.x),g.y=i.position.y-Math.floor(n.y);for(var o=a.scene.drillPick(i.position,10),s=o.length-1;s>=0;s--){var r=o[s];if(r&&r.primitive&&r.primitive._name)if(t.activeAxis)t.activeAxis=null,t.activeModelParam=null,t.controllerCallBack;else switch(r.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return a.scene.screenSpaceCameraController.enableRotate=!1,t.activeAxis=r.primitive,t.activeModelParam=t.initParam(),void(r.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}})),this.MapEvent.mouse_left_up((function(e){a.scene.screenSpaceCameraController.enableRotate=!0;for(var i=0;i<t.coordArrows.length;i++)switch(t.coordArrows[i]._name){case"model_edit_xAxis":t.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.RED}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_yAxis":t.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.LIME}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_zAxis":t.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.BLUE}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}})}t.activeAxis&&(t.activeAxis=null,t.activeModelParam=null,t.controllerCallBack)}))}},{key:"againArrow",value:function(){if(this.activeState&&"translational"==this.activeState&&this.origin){this.initParam(),this.origin=new Cesium.Cartesian3.fromDegrees(this._params.tx,this._params.ty,this._params.tz);for(var e=this.sdk.viewer.camera.position,t=Cesium.Cartesian3.distance(e,this.origin)/15,i=Cesium.Transforms.eastNorthUpToFixedFrame(this.origin),n=this.coordArrows,o=0;o<n.length;o++)switch(n[o]._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":Cesium.Matrix4.multiplyByScale(i,new Cesium.Cartesian3(t,t,t),n[o].modelMatrix)}}}},{key:"againCircle",value:function(){if(this.activeState&&"rtation"==this.activeState&&this.origin){this.initParam();for(var e=this.sdk.viewer.camera.position,t=Cesium.Cartesian3.distance(e,this.origin)/15,i=Cesium.Transforms.eastNorthUpToFixedFrame(this.origin),n=this.coordCircles,o=0;o<n.length;o++)switch(n[o]._name){case"model_edit_zCircle":case"model_edit_yCircle":case"model_edit_xCircle":var s=t/20;Cesium.Matrix4.multiplyByScale(i,new Cesium.Cartesian3(s,s,s),n[o].modelMatrix),n[o]._radius=t}}}},{key:"editRtation",value:function(){this.destroy(),this.activeState="rtation",this.MapEvent=new K(this.sdk);var e=this.initParam();this.origin=Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.h),this.createCircle(e.lng,e.lat,e.h,20),this.sdk.viewer.camera.percentageChanged=.001,this.sdk.viewer.camera.changed.addEventListener(this.againCircle,this)}},{key:"createCircle",value:function(e,t,i,n){for(var o=this,s=this.sdk.viewer,a=[],r=0;r<=360;r+=3){var l=Math.sin(Cesium.Math.toRadians(r)),c=n*Math.cos(Cesium.Math.toRadians(r)),u=n*l;a.push(new Cesium.Cartesian3(c,u,0))}var h=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(e,t,i)),p=s.camera.position,d=Cesium.Cartesian3.distance(p,this.origin)/15,m=d/n;Cesium.Matrix4.multiplyByScale(h,new Cesium.Cartesian3(m,m,m),h);var f=this.createAxisSphere("model_edit_zCircle",a,h,Cesium.Color.RED,d);s.scene.primitives.add(f);var v=this.createAxisSphere("model_edit_yCircle",a,h,Cesium.Color.BLUE,d);s.scene.primitives.add(v);var g=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(90)),y=Cesium.Matrix4.fromRotationTranslation(g);Cesium.Matrix4.multiply(v.geometryInstances.modelMatrix,y,v.geometryInstances.modelMatrix);var b=this.createAxisSphere("model_edit_xCircle",a,h,Cesium.Color.LIME,d);s.scene.primitives.add(b);var C=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(90)),w=Cesium.Matrix4.fromRotationTranslation(C);Cesium.Matrix4.multiply(b.geometryInstances.modelMatrix,w,b.geometryInstances.modelMatrix);var k,_=0;this.MapEvent.mouse_move((function(e){!function e(t){var i=lc({},t.endPosition);if(o.activeCircle){var n=Cesium.SceneTransforms.wgs84ToWindowCoordinates(s.scene,o.ciclkPosition),a=0,r=0,l=0;if(!n)return;var c=t.startPosition.y-i.y,u=t.startPosition.x-i.x;switch(o.activeCircle._name){case"model_edit_xCircle":r=1*u;break;case"model_edit_yCircle":a=1*c;break;case"model_edit_zCircle":l=1*u}o._params.rx-=a,o._params.rx>360&&(o._params.rx=1),o._params.rx<0&&(o._params.rx=360);Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o._params.rx));o._params.ry-=r,o._params.ry>360&&(o._params.ry=1),o._params.ry<0&&(o._params.ry=360);Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(o._params.ry));o._params.rz-=l,o._params.rz>360&&(o._params.rz=1),o._params.rz<0&&(o._params.rz=360),o.updateModel(o._params.tx,o._params.ty,o._params.tz,o._params.rx,o._params.ry,o._params.rz)}else{var h=Date.now();if(h-_<100)return clearTimeout(k),void(k=setTimeout((function(){e(t)}),100));clearTimeout(k),_=h;for(var p=o.coordCircles,d=0;d<p.length;d++)if(p[d].getGeometryInstanceAttributes){var m=p[d].getGeometryInstanceAttributes(p[d]._name);switch(p[d]._name){case"model_edit_zCircle":m.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED).value;break;case"model_edit_yCircle":m.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE).value;break;case"model_edit_xCircle":m.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.LIME).value}}for(var f=s.scene.drillPick(t.endPosition,10),v=0;v<f.length;v++){var g=f[v];if(g&&g.primitive&&g.id&&g.primitive.getGeometryInstanceAttributes){var y=g.primitive.getGeometryInstanceAttributes(g.id);switch(g.primitive._name){case"model_edit_zCircle":case"model_edit_yCircle":case"model_edit_xCircle":return void(y.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW).value)}}}}}(e)})),this.MapEvent.mouse_left_down((function(e){var t=s.scene.pickPosition(e.position);o.ciclkPosition=t;for(var i=s.scene.drillPick(e.position,10),n=0;n<i.length;n++){var a=i[n];if(a&&a.primitive&&a.id)switch(a.primitive._name){case"model_edit_xCircle":case"model_edit_yCircle":case"model_edit_zCircle":return a.primitive.getGeometryInstanceAttributes(a.primitive._name).color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW).value,o.activeCircle=a.primitive,o.activeModelParam=o.initParam(),void(s.scene.screenSpaceCameraController.enableRotate=!1)}}o.activeCircle=null,o.activeModelParam=null,s.scene.screenSpaceCameraController.enableRotate=!0})),this.MapEvent.mouse_left_up((function(e){o.activeCircle=null,o.activeModelParam=null,s.scene.screenSpaceCameraController.enableRotate=!0;for(var t=o.coordCircles,i=0;i<t.length;i++)if(t[i].getGeometryInstanceAttributes){var n=t[i].getGeometryInstanceAttributes(t[i]._name);switch(t[i]._name){case"model_edit_zCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED).value;break;case"model_edit_yCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE).value;break;case"model_edit_xCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.LIME).value}}}))}},{key:"updateModel",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this._params.tx=e=parseFloat(parseFloat(e).toFixed(8)),this._params.ty=t=parseFloat(parseFloat(t).toFixed(8)),this._params.tz=i=parseFloat(parseFloat(i).toFixed(2)),this._params.rx=n=parseFloat(n),this._params.ry=o=parseFloat(o),this._params.rz=s=parseFloat(s),this.model.position=new Cesium.Cartesian3.fromDegrees(e,t,i),this.model.rotate={x:n,y:o,z:s};var a=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(n)),r=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(o)),l=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(s)),c=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(e,t,i)),u=Cesium.Matrix4.fromRotationTranslation(a),h=Cesium.Matrix4.fromRotationTranslation(r),p=Cesium.Matrix4.fromRotationTranslation(l),d=new Cesium.Matrix4;Cesium.Matrix4.multiply(c,u,d),Cesium.Matrix4.multiply(d,h,d),Cesium.Matrix4.multiply(d,p,this.model.modelMatrix),this.transformCallBack}},{key:"transformCallBack",get:function(){this._transformCallBack&&this._transformCallBack(this._params)},set:function(e){this._transformCallBack=e}},{key:"createAxisArrow",value:function(e,t,i,n){var o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:e,geometry:new Cesium.PolylineGeometry({positions:t,width:20}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:n}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return o._name=e,this.coordArrows.push(o),o}},{key:"createAxisSphere",value:function(e,t,i,n,o){var s=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:e,geometry:new Cesium.PolylineGeometry({positions:t,width:5}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineColorAppearance({translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return s._radius=o,s._name=e,this.coordCircles.push(s),s}},{key:"removeCoordArrows",value:function(){for(var e=0;e<this.coordArrows.length;e++)this.sdk.viewer.scene.primitives.remove(this.coordArrows[e]);this.coordArrows=[]}},{key:"removeCoordCircle",value:function(){for(var e=0;e<this.coordCircles.length;e++)this.sdk.viewer.scene.primitives.remove(this.coordCircles[e]);this.coordCircles=[]}},{key:"update",value:function(){this.againArrow(),this.againCircle()}},{key:"removeAllTools",value:function(){this.removeCoordArrows(),this.removeCoordCircle()}},{key:"destroy",value:function(){this.removeAllTools(),this.activeState=void 0,this.MapEvent&&this.MapEvent.destroy(),this.sdk.viewer.camera.changed.removeEventListener(this.againArrow),this.sdk.viewer.camera.changed.removeEventListener(this.againCircle)}},{key:"getActiveState",value:function(){return this.activeState}},{key:"getModel",value:function(){return this.model}},{key:"setModel",value:function(e){this.model=model}}])}();function uc(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var hc=function(e){function t(e,i){return k()(this,t),uc(this,t,[e,i])}return un()(t,e),x()(t,[{key:"add",value:(i=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.options.url){e.next=2;break}return e.abrupt("return",this.loadModel(this.options.url));case 2:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(e){this.options.attribute.link.content.push({name:"链接",url:e}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(e){this.options.attribute.vr.content.push({name:"全景图",url:e}),this.attributeVr=this.options.attribute.vr.content}},{key:"openRichTextEditor",value:function(e){var t=this;Bn.open(this.options.id,this.options.name,this.options.richTextContent),Bn.primaryCallBack=function(e){t.options.richTextContent=e}}}]);var i}(yl);function pc(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return dc(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)?dc(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function dc(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 mc(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 fc(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?mc(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):mc(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function vc(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function gc(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var yc=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),i=vc(this,t,[e,n,o={}]),n.position?n.position.lng||0===n.position.lng?n.position.lat||0===n.position.lat?(i._timeoutEventObject=null,i.options.earth&&delete i.options.earth,i.picking=!0,i.options.name=n.name||"未命名对象",i.options.color=n.color||"#ffffff","number"==typeof n.scale?(i.options.scale={},i.options.scale.x=n.scale,i.options.scale.y=n.scale,i.options.scale.z=n.scale):(i.options.scale=n.scale||{},i.options.scale.x=i.options.scale.x||0===i.options.scale.x?i.options.scale.x:1,i.options.scale.y=i.options.scale.y||0===i.options.scale.y?i.options.scale.y:1,i.options.scale.z=i.options.scale.z||0===i.options.scale.z?i.options.scale.z:1),i.options.url=n.url,i.options.maximumScale=n.maximumScale||0===n.maximumScale?n.maximumScale:100,i.options.minimumPixelSize=n.minimumPixelSize||0===n.minimumPixelSize?n.minimumPixelSize:60,i.options.position=n.position=n.position||{},i.options.position={lng:n.position.lng,lat:n.position.lat,alt:n.position.alt},i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.options.rotate=n.rotate=n.rotate||{},i.options.rotate.x=n.rotate.x||0,i.options.rotate.y=n.rotate.y||0,i.options.rotate.z=n.rotate.z||0,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera=i.options.attribute.camera.content||[],i.options.attribute.ISC=i.options.attribute.ISC||{},i.options.attribute.ISC.content=i.options.attribute.ISC.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i._elms={},i.entity={id:i.options.id},i.positionCallBack=null,i.rotationCallback=null,i.onClickCallback=null,i._DialogObject=null,i.Dialog=o,i._EventBinding=new xn,i.on(),i):(console.warn("lat is required!"),an()(i)):(console.warn("lng is required!"),an()(i)):(console.warn("position is required!"),an()(i))}return un()(t,e),x()(t,[{key:"type",get:function(){return"glb"}},{key:"loadModel",value:(l=o()(a.a.mark((function e(t){var i,n,o,s=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Mt(this.sdk,this.options.id),this.sdk&&this.sdk.viewer&&this.sdk.viewer.scene){e.next=3;break}return e.abrupt("return");case 3:if(t=this.replaceHost(t,this.options.host),this.originalOptions=this.deepCopyObj(this.options),i={id:this.options.id,url:t,show:this.options.show,maximumScale:this.options.scaleByDistance?void 0:this.options.maximumScale,minimumPixelSize:this.options.scaleByDistance?void 0:this.options.minimumPixelSize},!(Number(Cesium.VERSION.split(".")[1])>=107)){e.next=13;break}return e.next=10,Cesium.Model.fromGltfAsync(i);case 10:this.entity=e.sent,e.next=16;break;case 13:return e.next=15,Cesium.Model.fromGltf(i);case 15:this.entity=e.sent;case 16:return this.entity.imageBasedLighting.luminanceAtZenith=.6,this.entity.color=Cesium.Color.fromCssColorString(this.options.color),e.next=20,this.sdk.viewer.scene.primitives.add(this.entity);case 20:n=Cesium.Cartographic.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n),this.entity.position=o,this.entity.rotate=fc({},this.options.rotate),this.entity.customScale=this.options.scale,this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),Number(Cesium.VERSION.split(".")[1])>=107?(this.entity.readyEvent.addEventListener((function(){s.entity.originalBoundingSphereRadius=s.entity.boundingSphere.radius,s.editObj=new cc(s.sdk,s.entity),s.editObj.transformCallBack=s.rotationEditingCallBack,s.updateModel(s.options.position.lng,s.options.position.lat,s.options.position.alt,s.options.rotate.x,s.options.rotate.y,s.options.rotate.z,s.options.scale),s.label||(s.label=new Xn(s.sdk,{id:s.options.id,show:!!s.options.show&&s.options.label.show,position:[s.options.position.lng,s.options.position.lat,s.options.position.alt],text:s.options.name,fontSize:s.options.label.fontSize,fontFamily:s.options.label.fontFamily?s.options.label.fontFamily:0,color:s.options.label.color,pixelOffset:s.options.label.pixelOffset,backgroundColor:s.options.label.backgroundColor,lineColor:s.options.label.lineColor,lineWidth:s.options.label.lineWidth,scaleByDistance:s.options.label.scaleByDistance,near:s.options.label.near,far:s.options.label.far},s.entity)),s.entity.isMove=!0,clearTimeout(s._timeoutEventObject),s._timeoutEventObject=setTimeout((function(){s.entity&&(s.entity.isMove=!1)}),500)})),this.activeAnimate=this.options.activeAnimate,this.modelAnimations=this.entity.loader.components.animations):this.entity.readyPromise.then((function(e){s.entity.originalBoundingSphereRadius=s.entity.boundingSphere.radius,s.editObj=new cc(s.sdk,s.entity),s.editObj.transformCallBack=s.rotationEditingCallBack,s.updateModel(s.options.position.lng,s.options.position.lat,s.options.position.alt,s.options.rotate.x,s.options.rotate.y,s.options.rotate.z,s.options.scale),s.label||(s.label=new Xn(s.sdk,{id:s.options.id,show:!!s.options.show&&s.options.label.show,position:[s.options.position.lng,s.options.position.lat,s.options.position.alt],text:s.options.name,fontSize:s.options.label.fontSize,fontFamily:s.options.label.fontFamily?s.options.label.fontFamily:0,color:s.options.label.color,pixelOffset:s.options.label.pixelOffset,backgroundColor:s.options.label.backgroundColor,lineColor:s.options.label.lineColor,lineWidth:s.options.label.lineWidth,scaleByDistance:s.options.label.scaleByDistance,near:s.options.label.near,far:s.options.label.far,ground:!1},s.entity)),s.entity.isMove=!0,clearTimeout(s._timeoutEventObject),s._timeoutEventObject=setTimeout((function(){s.entity&&(s.entity.isMove=!1)}),500),s.activeAnimate=s.options.activeAnimate,s.modelAnimations=s.entity.loader.components.animations})),at(this.sdk,this.options.id);case 28:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"getModelAnimations",value:(r=o()(a.a.mark((function e(){var t=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,i){Number(Cesium.VERSION.split(".")[1])>=107?t.entity.readyEvent.addEventListener((function(){t.modelAnimations=t.entity.loader.components.animations,e(t.modelAnimations)})):t.entity.readyPromise.then((function(i){t.modelAnimations=t.entity.loader.components.animations,e(t.modelAnimations)}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"remove",value:function(){gc(t,"remove",this,3)([]),this.label&&this.label.remove(),this.positionEditing=!1,this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"flyTo",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=22;break}if(t={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=fc({},this.options.position):this.options.positions?r=fc({},this.options.positions[0]):this.options.center?r=fc({},this.options.center):this.options.start?r=fc({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),r.hasOwnProperty("alt")){e.next=15;break}return e.next=14,this.getClampToHeight(r);case 14:r.alt=e.sent;case 15:i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:t}),e.next=23;break;case 22:Number(Cesium.VERSION.split(".")[1])>=107?this.entity.ready&&(l=new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt),this.entity.originalBoundingSphereRadius*this.options.scale.z*2),this.sdk.viewer.camera.flyToBoundingSphere(l)):this.entity.readyPromise.then((function(){var e=new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(c.options.position.lng,c.options.position.lat,c.options.position.alt),(c.entity.originalBoundingSphereRadius||c.entity.boundingSphere.radius)*c.options.scale.z*2);c.sdk.viewer.camera.flyToBoundingSphere(e)}));case 23:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"on",value:function(){return this.add()}},{key:"setDefaultValue",value:function(){gc(t,"setDefaultValue",this,3)([]),this.options.host=this.options.host||p(),this.options.url=this.options.url||""}},{key:"name",get:function(){return this.options.name},set:function(e){console.log(e,"vvvvvvvvv"),this.options.name=e,this.options.label.text=e,this.label&&(this.label.text=e)}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;this.options.color=e,this.entity.color=Cesium.Color.fromCssColorString(e),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,255,255,1)"}});t._elms.color[n]=o}))}},{key:"lng",get:function(){return this.options.position.lng},set:function(e){this.options.position={lng:e,lat:this.options.position.lat,alt:this.options.position.alt},this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[this.options.position.lng,this.options.position.lat,this.options.position.alt]),this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e}))}},{key:"lat",get:function(){return this.options.position.lat},set:function(e){this.options.position={lng:this.options.position.lng,lat:e,alt:this.options.position.alt},this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[this.options.position.lng,this.options.position.lat,this.options.position.alt]),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e}))}},{key:"alt",get:function(){return this.options.position.alt},set:function(e){this.options.position={lng:this.options.position.lng,lat:this.options.position.lat,alt:e},this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[Number(this.options.position.lng),Number(this.options.position.lat),Number(this.options.position.alt)]),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e}))}},{key:"maximumScale",get:function(){return this.options.maximumScale},set:function(e){this.options.maximumScale=e,this.entity.maximumScale=this.scaleByDistance?void 0:e,this._elms.maximumScale&&this._elms.maximumScale.forEach((function(t){t.value=e}))}},{key:"minimumPixelSize",get:function(){return this.options.minimumPixelSize},set:function(e){this.options.minimumPixelSize=e,this.entity.minimumPixelSize=this.scaleByDistance?void 0:this.options.minimumPixelSize,this._elms.minimumPixelSize&&this._elms.minimumPixelSize.forEach((function(t){t.value=e}))}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(e){this.options.scaleByDistance=e,this.entity.maximumScale=e?void 0:this.maximumScale,this.entity.minimumPixelSize=e?void 0:this.options.minimumPixelSize,this._elms.scaleByDistance&&this._elms.scaleByDistance.forEach((function(t){t.checked=e}))}},{key:"rotateX",get:function(){return this.options.rotate.x},set:function(e){this.options.rotate.x=e,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateX&&this._elms.rotateX.forEach((function(t){t.value=e}))}},{key:"rotateY",get:function(){return this.options.rotate.y},set:function(e){this.options.rotate.y=e,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateY&&this._elms.rotateY.forEach((function(t){t.value=e}))}},{key:"rotateZ",get:function(){return this.options.rotate.z},set:function(e){this.options.rotate.z=e,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateZ&&this._elms.rotateZ.forEach((function(t){t.value=e}))}},{key:"scaleX",get:function(){return this.options.scale.x},set:function(e){var t=this;this.options.scale.x=Number(Number(e).toFixed(2)),this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scaleX&&this._elms.scaleX.forEach((function(e){e.value=t.options.scale.x}))}},{key:"scaleY",get:function(){return this.options.scale.y},set:function(e){var t=this;this.options.scale.y=Number(Number(e).toFixed(2)),this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scaleY&&this._elms.scaleY.forEach((function(e){e.value=t.options.scale.y}))}},{key:"scaleZ",get:function(){return this.options.scale.z},set:function(e){var t=this;this.options.scale.z=Number(Number(e).toFixed(2)),this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scaleZ&&this._elms.scaleZ.forEach((function(e){e.value=t.options.scale.z}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){this.options.label.show=e,this.show&&!this.showView||3==this.showView?this.label&&(this.label.show=e):this.label&&(this.label.show=!1),this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label&&(this.label.color=e),this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label&&(this.label.fontSize=e),this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label&&(this.label.scaleByDistance=e),this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(e){this.options.label.lineWidth=e,this.label&&(this.label.lineWidth=e),this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(t){t.value=e}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(e){this.options.label.pixelOffset=e,this.label&&(this.label.pixelOffset=e),this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(t){t.value=e}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(e){var t=this;this.options.label.lineColor=e,this.label&&(this.label.lineColor=e),this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelLineColor=e},clear:function(){t.labelLineColor="rgba(0,255,255,0.5)"}});t._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label&&(this.label.backgroundColor=[e,this.label.backgroundColor[1]]),this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label&&(this.label.backgroundColor=[this.label.backgroundColor[0],e]),this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(e){this.options.attributeType=e,this._elms.attributeType&&this._elms.attributeType.forEach((function(t){t.value=e}));for(var t=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<t.length;i++)t[i].className.indexOf("attribute-content-"+e)>-1?t[i].style.display="block":t[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(e){var t=this;if(this.options.attribute.link.content=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),h={linkEdit:(c=o()(a.a.mark((function e(i){var n,o,s,r,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.options.attribute.link.content;case 2:t.attributeLink=e.sent,n=t._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function e(n){var o,r,l,c,u,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==n){e.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){e.next=35;break}if(l[c]&&l[c].attributes){e.next=14;break}return e.abrupt("continue",32);case 14:u=pc(l[c].attributes),e.prev=15,d=a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("@click"!==(t=p.value).name){e.next=5;break}return l[c].addEventListener("click",(function(e){"function"==typeof h[t.value]&&h[t.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(t.name),e.abrupt("return",1);case 5:case"end":return e.stop()}}),e)})),u.s();case 18:if((p=u.n()).done){e.next=24;break}return e.delegateYield(d(),"t0",20);case 20:if(!e.t0){e.next=22;break}return e.abrupt("break",24);case 22:e.next=18;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(15),u.e(e.t1);case 29:return e.prev=29,u.f(),e.finish(29);case 32:c++,e.next=11;break;case 35:return e.abrupt("return",1);case 36:case"end":return e.stop()}}),e,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){e.next=15;break}return e.delegateYield(r(l),"t0",10);case 10:if(!e.t0){e.next=12;break}return e.abrupt("break",15);case 12:l++,e.next=8;break;case 15:case"end":return e.stop()}}),e)}))),function(e){return c.apply(this,arguments)}),linkDelete:function(e){t.options.attribute.link.content.splice(e,1),t.attributeLink=t.options.attribute.link.content},confirmEdit:function(e,i){var n=e.name&&e.name.replace(/\s/g,""),o=e.url&&e.url.replace(/\s/g,"");n&&o?t.options.attribute.link.content[i]=e:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),t.attributeLink=t.options.attribute.link.content},cancelEdit:function(){t.attributeLink=t.options.attribute.link.content},fileSelect:function(e,t){var i=u[t].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",p),i.addEventListener("change",p)}},p=function(e){e.target.value&&(u[e.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=e.target.value,e.target.value=null)},d=function(e){for(var t=u[e].getElementsByTagName("button"),i=0;i<t.length;i++)if(t[i]&&t[i].attributes){var n,o=pc(t[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return t[i].addEventListener("click",(function(t){"function"==typeof h[o.value]&&h[o.value](e)})),t[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(e){o.e(e)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(e){this.options.attribute.camera.content=e}},{key:"attributeISC",get:function(){return this.options.attribute.ISC.content},set:function(e){this.options.attribute.ISC.content=e}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(e){var t=this;if(this.options.attribute.vr.content=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),h={vrEdit:(c=o()(a.a.mark((function e(i){var n,o,s,r,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.options.attribute.vr.content;case 2:t.attributeVr=e.sent,n=t._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function e(n){var o,r,l,c,u,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==n){e.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=t.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=t.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){e.next=35;break}if(l[c]&&l[c].attributes){e.next=14;break}return e.abrupt("continue",32);case 14:u=pc(l[c].attributes),e.prev=15,d=a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("@click"!==(t=p.value).name){e.next=5;break}return l[c].addEventListener("click",(function(e){"function"==typeof h[t.value]&&h[t.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(t.name),e.abrupt("return",1);case 5:case"end":return e.stop()}}),e)})),u.s();case 18:if((p=u.n()).done){e.next=24;break}return e.delegateYield(d(),"t0",20);case 20:if(!e.t0){e.next=22;break}return e.abrupt("break",24);case 22:e.next=18;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(15),u.e(e.t1);case 29:return e.prev=29,u.f(),e.finish(29);case 32:c++,e.next=11;break;case 35:return e.abrupt("return",1);case 36:case"end":return e.stop()}}),e,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){e.next=15;break}return e.delegateYield(r(l),"t0",10);case 10:if(!e.t0){e.next=12;break}return e.abrupt("break",15);case 12:l++,e.next=8;break;case 15:case"end":return e.stop()}}),e)}))),function(e){return c.apply(this,arguments)}),vrDelete:function(e){t.options.attribute.vr.content.splice(e,1),t.attributeVr=t.options.attribute.vr.content},confirmEdit:function(e,i){var n=e.name&&e.name.replace(/\s/g,""),o=e.url&&e.url.replace(/\s/g,"");n&&o?t.options.attribute.vr.content[i]=e:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),t.attributeVr=t.options.attribute.vr.content},cancelEdit:function(){t.attributeVr=t.options.attribute.vr.content},fileSelect:function(e,t){var i=u[t].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",p),i.addEventListener("change",p)}},p=function(e){e.target.value&&(u[e.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=e.target.value,e.target.value=null)},d=function(e){for(var t=u[e].getElementsByTagName("button"),i=0;i<t.length;i++)if(t[i]&&t[i].attributes){var n,o=pc(t[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return t[i].addEventListener("click",(function(t){"function"==typeof h[o.value]&&h[o.value](e)})),t[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(e){o.e(e)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(e){this.options.attribute.goods.content=e}},{key:"rotationEditing",get:function(){return"rtation"===this.editObj.getActiveState()},set:function(e){e?this.editObj&&this.editObj.editRtation():this.editObj&&this.editObj.destroy()}},{key:"positionEditing",get:function(){return!(!this.editObj||"translational"!==this.editObj.getActiveState())},set:function(e){this.sdk&&this.sdk.viewer&&this.entity&&(e?(this.leftClickState=ye(),this.editObj&&this.editObj.editTranslational(),new me(this.sdk)):(this.leftClickState&&!ye()&&new de(this.sdk),this.editObj&&this.editObj.destroy()))}},{key:"positionEditingCallBack",get:function(){},set:function(e){}},{key:"rotationEditingCallBack",get:function(){var e=this;return function(t){e.lng=t.tx,e.lat=t.ty,e.alt=t.tz,e.rotateX=t.rx,e.rotateY=t.ry,e.rotateZ=t.rz,e._rotationEditingCallBack&&e._rotationEditingCallBack(e.editObj._params)}},set:function(e){this._rotationEditingCallBack=e}},{key:"activeAnimate",get:function(){return this.options.activeAnimate},set:function(e){if(this.options.activeAnimate=e,this.entity&&this.entity.loader.components&&this.modelAnimations&&(this.entity.activeAnimations.removeAll(),this.modelAnimations&&this.modelAnimations.length>0))for(var t=0;t<this.modelAnimations.length;t++)if(this.modelAnimations[t].name===e){this.entity.activeAnimations.add({index:t,loop:Cesium.ModelAnimationLoop.REPEAT,speedup:1,reverse:!1});break}}},{key:"resetAnimate",value:(n=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.entity){e.next=2;break}return e.abrupt("return");case 2:this.activeAnimate=void 0,this.sdk.viewer.scene.primitives.remove(this.entity),this.on();case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"edit",value:(i=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f=this,v=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=v.length>0&&void 0!==v[0]&&v[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=46;break}return i=!1,this.scaleX===this.scaleY&&this.scaleX===this.scaleZ&&(i=!0),e.next=9,new pn(this.sdk,this.originalOptions,{title:"模型属性",left:"180px",top:"100px",confirmCallBack:function(e){f.name=f.options.name||"未命名对象",f.originalOptions=f.deepCopyObj(f.options),f._DialogObject.close();var t=f.deepCopyObj(f.options);t.host="",f.Dialog.confirmCallBack&&f.Dialog.confirmCallBack(t),Mt(f.sdk,f.options.id),at(f.sdk,f.options.id)},resetCallBack:function(){f.reset(),f.Dialog.resetCallBack&&f.Dialog.resetCallBack()},removeCallBack:function(){f.Dialog.removeCallBack&&f.Dialog.removeCallBack()},closeCallBack:function(){f.reset(),f.positionEditing=!1,f.editObj&&f.editObj.destroy(),f.Dialog.closeCallBack&&f.Dialog.closeCallBack()},showCallBack:function(e){f.show=e,f.Dialog.showCallBack&&f.Dialog.showCallBack()},translationalCallBack:function(){f.positionEditing?f.positionEditing=!1:f.positionEditing=!0}},!0);case 9:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" model",(n=document.createElement("div")).innerHTML=ac(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,new En("model-edit-tabs",void 0,this.sdk),o=this._DialogObject._element.content.getElementsByClassName("checkbox-box")[0].querySelector("input"),s=this._DialogObject._element.content.getElementsByClassName("equal")[0],r=this._DialogObject._element.content.getElementsByClassName("no-equal")[0],o.checked=i,o.addEventListener("change",(function(e){(i=e.target.checked)?(s.style.display="flex",r.style.display="none",f.scaleY=f.scaleX,f.scaleZ=f.scaleX):(s.style.display="none",r.style.display="flex")})),(l=s.getElementsByTagName("input"))[0].value=this.scaleX,l[1].value=this.scaleX,l[0].addEventListener("input",(function(e){f.scaleX=e.target.value,f.scaleY=e.target.value,f.scaleZ=e.target.value})),l[1].addEventListener("input",(function(e){f.scaleX=e.target.value,f.scaleY=e.target.value,f.scaleZ=e.target.value})),i?(s.style.display="flex",r.style.display="none"):(s.style.display="none",r.style.display="flex"),c=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){f.color=e},clear:function(){f.color="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){f.labelColor=e},clear:function(){f.labelColor="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){f.labelLineColor=e},clear:function(){f.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){f.labelBackgroundColorStart=e},clear:function(){f.labelBackgroundColorStart="rgba(255,255,255,1)"}}),d=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){f.labelBackgroundColorEnd=e},clear:function(){f.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),m=n.getElementsByTagName("*"),this._EventBinding.on(this,m),this._elms=this._EventBinding.element,this._elms.color=[c],this._elms.labelColor=[u],this._elms.labelLineColor=[h],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[d],this._elms.scaleX.push(l[0],l[1]),setTimeout((function(){f.attributeLink=f.options.attribute.link.content,f.attributeVr=f.options.attribute.vr.content,f.ISCSelect&&f.ISCSelect(),f.goodsSelect&&f.goodsSelect(),f.cameraSelect&&f.cameraSelect();var e=f.attributeSelect,t=f._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(t){var i=q(t,".attribute-select");i.legp_search(e);for(var n=f._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],o=0;o<e.length;o++)if(e[o].key===f.options.attributeType){n.value=e[o].value,i.legp_searchActive(e[o].value);break}n.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===n.value){f.attributeType=e[t].key;break}}))}var s=Un(),a=q(f._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(a){a.legp_search(s);var r=f._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];r.value=s[f.labelFontFamily].value;for(var l=0;l<s.length;l++)if(s[l].value==r.value){a.legp_searchActive(s[l].value);break}r.addEventListener("input",(function(){for(var e=0;e<s.length;e++)if(s[e].value===r.value){f.labelFontFamily=s[e].key;break}})),f._elms.labelFontFamily=[r]}}),0),e.next=46;break;case 46:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"setPosition",value:function(e){this.options.position.lng=e.position.lng,this.options.position.lat=e.position.lat,this.options.position.alt=e.position.alt,this.options.rotate.z=-e.heading,this.options.rotate.x=-e.pitch,this.options.rotate.y=-e.roll,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[this.options.position.lng,this.options.position.lat,this.options.position.alt])}},{key:"updateModel",value:function(e,t,i){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6?arguments[6]:void 0;e=parseFloat(e),t=parseFloat(t),i=parseFloat(parseFloat(i).toFixed(2)),o=parseFloat(o),s=parseFloat(s),a=parseFloat(a),r.x=parseFloat(r.x),r.y=parseFloat(r.y),r.z=parseFloat(r.z),this.entity.position=new Cesium.Cartesian3.fromDegrees(e,t,i),this.entity.rotate={x:o,y:s,z:a},this.entity.customScale=r;var l=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(s)),u=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(a)),h=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(e,t,i)),p=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=Cesium.Matrix4.fromRotationTranslation(u),f=new Cesium.Matrix4;Cesium.Matrix4.multiply(h,p,f),Cesium.Matrix4.multiply(f,d,f),Cesium.Matrix4.multiply(f,m,this.entity.modelMatrix);var v=r.x,g=r.y,y=r.z;0===v&&(v=1e-5),0===g&&(g=1e-5),0===y&&(y=1e-5),Cesium.Matrix4.multiplyByScale(this.entity.modelMatrix,new Cesium.Cartesian3(v,g,y),this.entity.modelMatrix),this.entity.minimumPixelSize=this.scaleByDistance?void 0:this.options.minimumPixelSize,this.editObj&&this.editObj.update(),this.entity.isMove=!0,clearTimeout(this._timeoutEventObject),this._timeoutEventObject=setTimeout((function(){n.entity&&(n.entity.isMove=!1)}),500)}},{key:"reset",value:function(){if(this.entity)try{this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lng=this.originalOptions.position.lng,this.lat=this.originalOptions.position.lat,this.alt=this.originalOptions.position.alt,this.maximumScale=this.originalOptions.maximumScale,this.minimumPixelSize=this.originalOptions.minimumPixelSize,this.scaleByDistance=this.originalOptions.scaleByDistance,this.rotateX=this.originalOptions.rotate.x,this.rotateY=this.originalOptions.rotate.y,this.rotateZ=this.originalOptions.rotate.z,this.scaleX=this.originalOptions.scale.x,this.scaleY=this.originalOptions.scale.y,this.scaleZ=this.originalOptions.scale.z,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.ISC.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect()}catch(e){}}}]);var i,n,s,r,l}(hc);function bc(e){return'\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">最大比例</span>\n <input class="input" type="number" title="" min="0.1" max="99999" step="0.1" @model="maximumScale">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label">最小像素</span>\n <input class="input" type="number" title="" min="1" max="99999" @model="minimumPixelSize">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n </div>\n <div class="col">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="scaleByDistance">\n </div>\n </div>\n <div class="row">\n <DIV-cy-tabs id="model-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="方向信息">\n <div>\n <div class="row">\n <div class="col">\n <span class="label">x轴</span>\n <input style="width: 332px;" type="range" max="360" min="0" step="0.01" @model="rotateX">\n <input style="font-size: 13px;width: 100px;" type="number" title="" min="0" max="360" @model="rotateX">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">y轴</span>\n <input style="width: 332px;" type="range" max="360" min="0" step="0.01" @model="rotateY">\n <input style="font-size: 13px;width: 100px;" type="number" title="" min="0" max="360" @model="rotateY">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">z轴</span>\n <input style="width: 332px;" type="range" max="360" min="0" step="0.01" @model="rotateZ">\n <input style="font-size: 13px;width: 100px;" type="number" title="" min="0" max="360" @model="rotateZ">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <input style="width: 332px;" type="range" max="999999" min="-99999" step="0.01" @model="alt">\n <input style="font-size: 13px;width: 100px;" type="number" title="" min="-99999" max="999999" @model="alt">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">缩放</span>\n <input style="width: 332px;" type="range" max="999" min="0" step="1" @model="scale">\n <input style="font-size: 13px;width: 100px;" type="number" title="" min="0" max="999" step="1" @model="scale">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ',"\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n ")}function Cc(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return wc(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)?wc(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function wc(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 kc(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 _c(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?kc(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):kc(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function xc(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function Ec(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var Sc=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(i=xc(this,t,[e,n,o={}])).picking=!0,i.options.name=n.name||"未命名对象",i.options.color=n.color||"#ffffff",i.options.scale=n.scale||0===n.scale?n.scale:1,i.options.url=n.url,i.options.maximumScale=n.maximumScale||0===n.maximumScale?n.maximumScale:100,i.options.minimumPixelSize=n.minimumPixelSize||0===n.minimumPixelSize?n.minimumPixelSize:60,i.options.positions=n.positions||[],i.options.type=n.type||0,i.options.interval=n.interval||0===n.interval?n.interval:1,i.options.quantity=n.quantity,i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.options.rotate=n.rotate=n.rotate||{},i.options.rotate.x=n.rotate.x||0,i.options.rotate.y=n.rotate.y||0,i.options.rotate.z=n.rotate.z||0,i.options.label=n.label=n.label||{},i.options.label.show=!(!n.label.show&&!1!==n.label.show)&&n.label.show,i.options.label.fontSize=n.label.fontSize||20,i.options.label.color=n.label.color||"#ffffff",i.options.label.near=n.label.near||0===n.label.near?n.label.near:2e3,i.options.label.far=n.label.far||0===n.label.far?n.label.far:1e5,i.options.label.scaleByDistance=n.label.scaleByDistance||!1,i.options.label.backgroundColor=n.label.backgroundColor||["#42c6ef","#42c6ef"],i.options.line=n.line=n.line||{},i.options.line.width=n.line.width||2,i.options.line.length=n.line.length||20,i.options.line.color=n.line.color||"#fff000",i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||[],i.options.attributeType=n.attributeType||"richText",i.ModelPositions=[],i._elms={},i.positionCallBack=null,i.rotationCallback=null,i.onClickCallback=null,i._DialogObject=null,i._element_style=null,i.ControllerObject=new Ho(i.sdk),i.ControllerObject.controllerCallBack=function(e){i.lng=e.position.lng,i.lat=e.position.lat,i.alt=e.position.alt},i.Dialog=o,i._EventBinding=new xn,i.on(),i}return un()(t,e),x()(t,[{key:"type",get:function(){return"glb"}},{key:"loadModel",value:(s=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h,p,d,m,f,v,g=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(v=function(e){return new Worker("data:,(".concat(e.toString(),")(").concat(JSON.stringify(m),")"))},f=function(e){var t=e.type,i=e.interval,n=e.positions,o=e.optionsPositions,s=e.quantity,a=e.turfUrl;importScripts(a);var r=[];switch(t){case 1:var l=turf.lineString(n[0]),c=turf.lineChunk(l,i/1e3,{units:"kilometers"});r.push({lng:c.features[0].geometry.coordinates[0][0],lat:c.features[0].geometry.coordinates[0][1]});for(var h=0;h<c.features.length;h++)r.push({lng:c.features[h].geometry.coordinates[1][0],lat:c.features[h].geometry.coordinates[1][1]});break;case 2:var p=turf.polygon(n),d=turf.bbox(p);u=turf.pointGrid(d,i/1e3,{units:"kilometers"});for(var m=turf.pointsWithinPolygon(u,p),f=0;f<m.features.length;f++)r.push({lng:m.features[f].geometry.coordinates[0],lat:m.features[f].geometry.coordinates[1]});break;case 3:if(s)for(var v=o[0].lng,g=o[0].lat,y=o[2].lng,b=o[2].lat,C=turf.point([v,b]),w=turf.point([y,b]),k=turf.distance(C,w,{units:"kilometers"})/s.x,_=turf.point([v,b]),x=turf.point([v,g]),E=turf.distance(_,x,{units:"kilometers"})/s.y,S=turf.lineString([[v,b],[y,b]]),P=turf.lineChunk(S,k,{units:"kilometers"}),D=turf.lineString([[v,b],[v,g]]),M=turf.lineChunk(D,E,{units:"kilometers"}),T=0;T<P.features.length;T++)for(var O=P.features[T].geometry.coordinates,N=0;N<M.features.length;N++){var B=M.features[N].geometry.coordinates;r.push({lng:(O[0][0]+O[1][0])/2,lat:(B[0][1]+B[1][1])/2})}else{u=turf.pointGrid([o[0].lng,o[0].lat,o[2].lng,o[2].lat],i/1e3,{units:"kilometers"});for(var L=0;L<u.features.length;L++)r.push({lng:u.features[L].geometry.coordinates[0],lat:u.features[L].geometry.coordinates[1]})}break;default:r=A()(o)}self.postMessage(r)},t.startsWith("http")||t.includes(":")||this.options.host&&(i=new URL(t,this.options.host),t=i.href),this.originalOptions=this.deepCopyObj(this.options),new Cesium.PrimitiveCollection,n=[[]],o=this.options.positions[0].alt,s=0;s<this.options.positions.length;s++)n[0].push([this.options.positions[s].lng,this.options.positions[s].lat]),this.options.positions[s].alt>this.options.height&&(o=this.options.positions[s].alt);n[0].length>2?(n[0].push([this.options.positions[0].lng,this.options.positions[0].lat]),r=turf.polygon(n),l=turf.pointOnFeature(r),this.center={lng:l.geometry.coordinates[0],lat:l.geometry.coordinates[1]}):2==n[0].length?this.center={lng:(this.options.positions[0].lng+this.options.positions[1].lng)/2,lat:(this.options.positions[0].lat+this.options.positions[1].lat)/2}:this.center={lng:this.options.positions[0].lng,lat:this.options.positions[0].lat},c=[],this.options.height||0===this.options.height||(this.options.height=o),h=document.scripts,p="",d=0;case 14:if(!(d<h.length)){e.next=21;break}if(!h[d].src||!h[d].src.includes("turf.min.js")){e.next=18;break}return p=h[d].src&&h[d].src,e.abrupt("break",21);case 18:d++,e.next=14;break;case 21:m={type:this.options.type,interval:this.options.interval,positions:n,optionsPositions:this.options.positions,quantity:this.options.quantity,turfUrl:p},v(f).onmessage=function(e){g.ModelPositions=c=e.data;for(var i=[],n=0;n<c.length;n++){var o=Cesium.Cartesian3.fromDegrees(c[n].lng,c[n].lat,g.options.height),s=Cesium.Transforms.headingPitchRollToFixedFrame(o,new Cesium.HeadingPitchRoll(0,0,0));Cesium.Matrix4.multiplyByUniformScale(s,1,s),i.push({modelMatrix:s})}g.label=new Xn(g.sdk,{show:!!g.options.show&&g.options.label.show,position:[g.center.lng,g.center.lat,g.options.height],text:g.options.name,fontSize:g.options.label.fontSize,color:g.options.label.color,pixelOffset:g.options.line.length,backgroundColor:g.options.label.backgroundColor,lineColor:g.options.line.color,lineWidth:g.options.line.width,scaleByDistance:g.options.label.scaleByDistance,near:g.options.label.near,far:g.options.label.far}),g.entity=new Cesium2.ModelInstanceCollection({url:t,instances:i}),g.entity.position=new Cesium.Cartesian3.fromDegrees(g.center.lng,g.center.lat,g.options.height),g.entity.rotate={x:g.options.rotate.x,y:g.options.rotate.y,z:g.options.rotate.z},g.updateModel(g.center.lng,g.center.lat,g.options.height,g.options.rotate.x,g.options.rotate.y,g.options.rotate.z,g.options.scale),g.sdk.viewer.scene.primitives.add(g.entity)};case 24:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"remove",value:function(){Ec(t,"remove",this,3)([]),this.label.remove(),this.positionEditing=!1,this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=22;break}if(t={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=_c({},this.options.position):this.options.positions?r=_c({},this.options.positions[0]):this.options.center?r=_c({},this.options.center):this.options.start?r=_c({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),r.hasOwnProperty("alt")){e.next=15;break}return e.next=14,this.getClampToHeight(r);case 14:r.alt=e.sent;case 15:i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:t}),e.next=23;break;case 22:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.center.lng,this.center.lat,this.options.height+500)});case 23:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"on",value:function(){return this.add()}},{key:"setDefaultValue",value:function(){Ec(t,"setDefaultValue",this,3)([]),this.options.host=this.options.host||p(),this.options.url=this.options.url||""}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;this.options.color=e,this.entity.color=Cesium.Color.fromCssColorString(e),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,255,255,1)"}});t._elms.color[n]=o}))}},{key:"lng",get:function(){return this.center.lng},set:function(e){this.center.lng=e,this._ControllerChangePosition(50),this.updateModel(this.center.lng,this.center.lat,this.options.height,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label.position=[this.center.lng,this.center.lat,this.options.height],this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e}))}},{key:"lat",get:function(){return this.center.lat},set:function(e){this.center.lat=e,this._ControllerChangePosition(50),this.updateModel(this.center.lng,this.center.lat,this.options.height,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label.position=[this.center.lng,this.center.lat,this.options.height],this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e}))}},{key:"alt",get:function(){return this.options.height},set:function(e){this.center.alt=e,this.options.height=e,this._ControllerChangePosition(50),this.updateModel(this.center.lng,this.center.lat,this.options.height,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label.position=[Number(this.center.lng),Number(this.center.lat),Number(this.options.height)],this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e}))}},{key:"_ControllerChangePosition",value:function(e){var t=this;clearTimeout(t._ControllerChangePositionEvent),t._ControllerChangePositionEvent=setTimeout((function(){t.ControllerObject.position={lng:t.center.lng,lat:t.center.lat,alt:t.options.height}}),e)}},{key:"maximumScale",get:function(){return this.options.maximumScale},set:function(e){this.options.maximumScale=e,this.entity.maximumScale=this.scaleByDistance?void 0:e,this._elms.maximumScale&&this._elms.maximumScale.forEach((function(t){t.value=e}))}},{key:"minimumPixelSize",get:function(){return this.options.minimumPixelSize},set:function(e){this.options.minimumPixelSize=e,this.entity.minimumPixelSize=this.scaleByDistance?void 0:e,this._elms.minimumPixelSize&&this._elms.minimumPixelSize.forEach((function(t){t.value=e}))}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(e){this.options.scaleByDistance=e,this.entity.maximumScale=e?void 0:this.maximumScale,this.entity.minimumPixelSize=e?void 0:this.minimumPixelSize,this._elms.scaleByDistance&&this._elms.scaleByDistance.forEach((function(t){t.checked=e}))}},{key:"rotateX",get:function(){return this.options.rotate.x},set:function(e){this.options.rotate.x=e,this.updateModelRotate(this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateX&&this._elms.rotateX.forEach((function(t){t.value=e}))}},{key:"rotateY",get:function(){return this.options.rotate.y},set:function(e){this.options.rotate.y=e,this.updateModelRotate(this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateY&&this._elms.rotateY.forEach((function(t){t.value=e}))}},{key:"rotateZ",get:function(){return this.options.rotate.z},set:function(e){this.options.rotate.z=e,this.updateModelRotate(this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateZ&&this._elms.rotateZ.forEach((function(t){t.value=e}))}},{key:"scale",get:function(){return this.options.scale},set:function(e){this.options.scale=e,this.updateModelRotate(this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scale&&this._elms.scale.forEach((function(t){t.value=e}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){this.options.label.show=e,this.show?this.label.show=e:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label.fontSize=e,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label.color=e,this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label.scaleByDistance=e,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(e){this.options.line.width=e,this.label.lineWidth=e,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(t){t.value=e}))}},{key:"lineLength",get:function(){return this.options.line.length},set:function(e){this.options.line.length=e,this.label.pixelOffset=e,this._elms.lineLength&&this._elms.lineLength.forEach((function(t){t.value=e}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(e){var t=this;this.options.line.color=e,this.label.lineColor=e,this._elms.lineColor&&this._elms.lineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.lineColor=e},clear:function(){t.lineColor="rgba(255,255,255,1)"}});t._elms.lineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label.backgroundColor=[e,this.labelBackgroundColorEnd],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label.backgroundColor=[this.labelBackgroundColorStart,e],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(e){this.options.attributeType=e,this._elms.attributeType&&this._elms.attributeType.forEach((function(t){t.value=e}));for(var t=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<t.length;i++)t[i].className.indexOf("attribute-content-"+e)>-1?t[i].style.display="block":t[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(e){var t=this;if(this.options.attribute.link.content=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),h={linkEdit:(c=o()(a.a.mark((function e(i){var n,o,s,r,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.options.attribute.link.content;case 2:t.attributeLink=e.sent,n=t._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function e(n){var o,r,l,c,u,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==n){e.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){e.next=35;break}if(l[c]&&l[c].attributes){e.next=14;break}return e.abrupt("continue",32);case 14:u=Cc(l[c].attributes),e.prev=15,d=a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("@click"!==(t=p.value).name){e.next=5;break}return l[c].addEventListener("click",(function(e){"function"==typeof h[t.value]&&h[t.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(t.name),e.abrupt("return",1);case 5:case"end":return e.stop()}}),e)})),u.s();case 18:if((p=u.n()).done){e.next=24;break}return e.delegateYield(d(),"t0",20);case 20:if(!e.t0){e.next=22;break}return e.abrupt("break",24);case 22:e.next=18;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(15),u.e(e.t1);case 29:return e.prev=29,u.f(),e.finish(29);case 32:c++,e.next=11;break;case 35:return e.abrupt("return",1);case 36:case"end":return e.stop()}}),e,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){e.next=15;break}return e.delegateYield(r(l),"t0",10);case 10:if(!e.t0){e.next=12;break}return e.abrupt("break",15);case 12:l++,e.next=8;break;case 15:case"end":return e.stop()}}),e)}))),function(e){return c.apply(this,arguments)}),linkDelete:function(e){t.options.attribute.link.content.splice(e,1),t.attributeLink=t.options.attribute.link.content},confirmEdit:function(e,i){var n=e.name&&e.name.replace(/\s/g,""),o=e.url&&e.url.replace(/\s/g,"");n&&o?t.options.attribute.link.content[i]=e:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),t.attributeLink=t.options.attribute.link.content},cancelEdit:function(){t.attributeLink=t.options.attribute.link.content},fileSelect:function(e,t){var i=u[t].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",p),i.addEventListener("change",p)}},p=function(e){e.target.value&&(u[e.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=e.target.value,e.target.value=null)},d=function(e){for(var t=u[e].getElementsByTagName("button"),i=0;i<t.length;i++)if(t[i]&&t[i].attributes){var n,o=Cc(t[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return t[i].addEventListener("click",(function(t){"function"==typeof h[o.value]&&h[o.value](e)})),t[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(e){o.e(e)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera},set:function(e){this.options.attribute.camera=e}},{key:"rotationEditing",get:function(){return"rtation"===this.ControllerObject.getActiveState()},set:function(e){e?this.ControllerObject.editRtation():this.ControllerObject.destroy()}},{key:"positionEditing",get:function(){return"translational"===this.ControllerObject.getActiveState()},set:function(e){!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&(e?(this.leftClickState=ye(),this.ControllerObject.position={lng:this.center.lng,lat:this.center.lat,alt:this.options.height},this.ControllerObject.editTranslational(),new me(this.sdk)):(this.leftClickState&&!ye()&&new de(this.sdk),this.ControllerObject.destroy()))}},{key:"positionEditingCallBack",get:function(){},set:function(e){}},{key:"rotationEditingCallBack",get:function(){var e=this;return function(t){e.lng=t.tx,e.lat=t.ty,e.alt=t.tz,e.rotateX=t.rx,e.rotateY=t.ry,e.rotateZ=t.rz,e._rotationEditingCallBack&&e._rotationEditingCallBack(e.ControllerObject._params)}},set:function(e){this._rotationEditingCallBack=e}},{key:"edit",value:(i=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u=this,h=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=h.length>0&&void 0!==h[0]&&h[0],this.originalOptions=this.deepCopyObj(this.options),this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=36;break}return this._element_style=document.createElement("style"),this._element_style.type="text/css",this._element_style.setAttribute("data-name","YJ_style_dialog"),this._element_style.innerHTML="\n .YJ-custom-base-dialog>.content {\n width: 600px;\n }\n .YJ-custom-base-dialog>.content>div>.row .col {\n margin: 0 10px;\n }\n .YJ-custom-base-dialog>.content>div>.row .col:first-child {\n margin-left: 0;\n }\n .YJ-custom-base-dialog>.content>div>.row .col:last-child {\n margin-right: 0;\n }\n .YJ-custom-base-dialog>.content>div>.row .label {\n flex: 0 0 74px;\n }\n .YJ-custom-base-dialog>.content .DIV-cy-tab-content-pane .input-select {\n width: 100px;\n }\n",e.next=12,new pn(this.sdk,this.originalOptions,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(e){u.name=u.options.name||"未命名对象",u.originalOptions=u.deepCopyObj(u.options),u._DialogObject.close(),u.Dialog.confirmCallBack&&u.Dialog.confirmCallBack(u.originalOptions)},resetCallBack:function(){u.reset(),u.Dialog.resetCallBack&&u.Dialog.resetCallBack()},removeCallBack:function(){u.Dialog.removeCallBack&&u.Dialog.removeCallBack()},closeCallBack:function(){u.reset(),u.positionEditing=!1,u.ControllerObject&&u.ControllerObject.destroy(),u.Dialog.closeCallBack&&u.Dialog.closeCallBack()},showCallBack:function(e){u.show=e,u.Dialog.showCallBack&&u.Dialog.showCallBack()},translationalCallBack:function(){u.positionEditing?u.positionEditing=!1:u.positionEditing=!0}},!0);case 12:this._DialogObject=e.sent,document.getElementsByTagName("head")[0].appendChild(this._element_style),(i=document.createElement("div")).innerHTML=bc(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera,new En("model-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){u.color=e},clear:function(){u.color="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("label_color")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){u.labelColor=e},clear:function(){u.labelColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("line_color")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){u.lineColor=e},clear:function(){u.lineColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){u.labelBackgroundColorStart=e},clear:function(){u.labelBackgroundColorStart="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){u.labelBackgroundColorEnd=e},clear:function(){u.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),c=i.getElementsByTagName("*"),this._EventBinding.on(this,c),this._elms=this._EventBinding.element,this._elms.color=[n],this._elms.labelColor=[o],this._elms.lineColor=[s],this._elms.labelBackgroundColorStart=[r],this._elms.labelBackgroundColorEnd=[l],setTimeout((function(){u.attributeLink=u.options.attribute.link.content,u.cameraSelect&&u.cameraSelect();var e=u.attributeSelect,t=u._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(t){var i=q(t,".attribute-select");i.legp_search(e);for(var n=u._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],o=0;o<e.length;o++)if(e[o].key===u.options.attributeType){n.value=e[o].value,i.legp_searchActive(e[o].value);break}n.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===n.value){u.attributeType=e[t].key;break}}))}}),0),e.next=36;break;case 36:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateModel",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6?arguments[6]:void 0;e=parseFloat(e),t=parseFloat(t),i=parseFloat(i),n=parseFloat(n),o=parseFloat(o),s=parseFloat(s),a=parseFloat(a),this.entity.rotate={x:n,y:o,z:s};var r=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(n)),l=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(s)),u=new Cesium.Cartesian3.fromDegrees(e,t,i);Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(u.x-this.entity._center.x,u.y-this.entity._center.y,u.z-this.entity._center.z)),Cesium.Matrix4.fromRotationTranslation(r),Cesium.Matrix4.fromRotationTranslation(l),Cesium.Matrix4.fromRotationTranslation(c),new Cesium.Matrix4;Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(u.x-this.entity._center.x,u.y-this.entity._center.y,u.z-this.entity._center.z),this.entity.modelMatrix),this.ControllerObject.update(),this.entity.position=new Cesium.Cartesian3.fromDegrees(e,t,i)}},{key:"updateModelRotate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;e=parseFloat(e),t=parseFloat(t),i=parseFloat(i),n=parseFloat(n),this.sdk.viewer.scene.primitives.remove(this.entity);var o=this.options.url;if(!o.startsWith("http")&&!o.includes(":")&&this.options.host){var s=new URL(o,this.options.host);o=s.href}for(var a=[],r=0;r<this.ModelPositions.length;r++){var l=n,c=Cesium.Cartesian3.fromDegrees(this.ModelPositions[r].lng,this.ModelPositions[r].lat,this.options.height),u=Cesium.Transforms.headingPitchRollToFixedFrame(c,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(i),Cesium.Math.toRadians(t),Cesium.Math.toRadians(e)));Cesium.Matrix4.multiplyByUniformScale(u,l,u),a.push({modelMatrix:u})}this.entity=new Cesium.ModelInstanceCollection({url:o,instances:a}),this.entity.position=new Cesium.Cartesian3.fromDegrees(this.center.lng,this.center.lat,this.options.height),this.entity.rotate={x:this.options.rotate.x,y:this.options.rotate.y,z:this.options.rotate.z},this.updateModel(this.center.lng,this.center.lat,this.options.height,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.sdk.viewer.scene.primitives.add(this.entity)}},{key:"reset",value:function(){this.entity&&(this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lng=this.originalOptions.position.lng,this.lat=this.originalOptions.position.lat,this.alt=this.originalOptions.position.alt,this.maximumScale=this.originalOptions.maximumScale,this.minimumPixelSize=this.originalOptions.minimumPixelSize,this.scaleByDistance=this.originalOptions.scaleByDistance,this.rotateX=this.originalOptions.rotate.x,this.rotateY=this.originalOptions.rotate.y,this.rotateZ=this.originalOptions.rotate.z,this.scale=this.originalOptions.scale,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeCamera=this.options.attribute.camera,this.cameraSelect&&this.cameraSelect())}}]);var i,n,s}(hc);function Pc(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 Dc(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Pc(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Pc(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Mc(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Tc=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=Mc(this,t,[e,n])).object={},i.options.host=i.options.host||p(),i.on(),i}return un()(t,e),x()(t,[{key:"type",get:function(){return"layer"}},{key:"on",value:function(){return this.loadLayer(this.options)}},{key:"loadLayer",value:(i=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.object=Dc({},t),i="",this.object.url.startsWith("http")?i=this.object.url:this.options.host?(n=new URL(this.object.url,this.options.host),i=n.href):i=this.object.url,o={url:i,mimmumLevel:this.object.minimumLevel,maximumLevel:this.object.maximumLevel,rectangle:new Cesium.Rectangle(Cesium.Math.toRadians(this.object.west),Cesium.Math.toRadians(this.object.south),Cesium.Math.toRadians(this.object.east),Cesium.Math.toRadians(this.object.north))},e.t0=this.object.schemaName,e.next="amapMercatorTilingScheme"===e.t0?7:""===e.t0?9:10;break;case 7:return o.tilingScheme=this.amapMercatorTilingScheme(),e.abrupt("break",12);case 9:return e.abrupt("break",12);case 10:return o.tilingScheme=new Cesium[this.object.schemaName],e.abrupt("break",12);case 12:e.t1=this.object.load_method,e.next="tms"===e.t1?15:"xyz"===e.t1?24:"wmts"===e.t1?26:28;break;case 15:if(this.object.url.endsWith("tilemapresource.xml")&&((r=this.object.url.split("/")).pop(),l=r.join("/"),o.url=l),!(Number(Cesium.VERSION.split(".")[1])>=107)){e.next=22;break}return e.next=19,Cesium.TileMapServiceImageryProvider.fromUrl(o.url,o);case 19:s=e.sent,e.next=23;break;case 22:s=new Cesium.TileMapServiceImageryProvider(o);case 23:return e.abrupt("break",30);case 24:return s=new Cesium.UrlTemplateImageryProvider(o),e.abrupt("break",30);case 26:return s=new Cesium.WebMapTileServiceImageryProvider(o),e.abrupt("break",30);case 28:return s=new Cesium.UrlTemplateImageryProvider(o),e.abrupt("break",30);case 30:if(this.sdk&&this.sdk.viewer){e.next=32;break}return e.abrupt("return");case 32:for(this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(s,this.options.layer_index):this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(s),this.entity._id=this.options.id,c=0;c<this.sdk.viewer.imageryLayers._layers.length;c++)this.sdk.viewer.imageryLayers._layers[c]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[c]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[c]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[c]._imageryProvider._type)&&(u=this.sdk.viewer.imageryLayers._layers[c],this.sdk.viewer.imageryLayers.raiseToTop(u));this.show=this.options.show,this.alpha=this.options.alpha,this.brightness=this.options.brightness,this.options.show&&Qe(0,this.options.id);case 39:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})}]);var i}(_l);function Oc(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Nc=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=Oc(this,t,[e,n])).loadLayer(),i}return un()(t,e),x()(t,[{key:"type",get:function(){return"layer"}},{key:"loadLayer",value:function(e){var t,i={url:this.options.url,mimmumLevel:this.options.minimumLevel||0,maximumLevel:this.options.maximumLevel||20,subdomains:["0","1","2","3","4","5","6","7"]};t=new Cesium.UrlTemplateImageryProvider(i),this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(t,this.options.layer_index):this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(t),this.entity._id=this.options.id;for(var n=0;n<this.sdk.viewer.imageryLayers._layers.length;n++)if(this.sdk.viewer.imageryLayers._layers[n]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type)){var o=this.sdk.viewer.imageryLayers._layers[n];this.sdk.viewer.imageryLayers.raiseToTop(o)}this.show=this.options.show,this.alpha=this.options.alpha,this.brightness=this.options.brightness,this.options.show&&Qe(0,this.options.id)}}])}(_l);function Bc(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 Ac(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Bc(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Bc(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Lc(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Ic(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)?Ic(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ic(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 jc(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function Rc(e,t,i){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,i)}function Fc(e,t,i){return e.set(Hc(e,t),i),i}function zc(e,t){return e.get(Hc(e,t))}function Hc(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var Vc=new WeakMap,Gc=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return k()(this,t),Rc(i=jc(this,t,[e,n]),Vc,void 0),i.object=JSON.parse(JSON.stringify(o)),i.object.west||(i.object.west=40),i.object.south||(i.object.south=30),i.object.east||(i.object.east=160),i.object.north||(i.object.north=50),i.show=i.options.show,i._elms={},i.Dialog=s,i}return un()(t,e),x()(t,[{key:"type",get:function(){return"terrain"}},{key:"name",get:function(){return this.options.name},set:function(e){this.options.name=e,this._elms.name&&this._elms.name.forEach((function(t){t.value=e}))}},{key:"show",get:function(){return!(this.sdk.viewer.scene.terrainProvider instanceof Cesium.EllipsoidTerrainProvider)},set:function(e){e?this.open():this.close()}},{key:"open",value:(r=o()(a.a.mark((function e(){var t,i;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.options.url){e.next=4;break}return e.abrupt("return",this.loadTerrain({url:this.options.url}));case 4:return e.next=6,this.requestResource();case 6:return t=e.sent,e.next=9,t.text();case 9:if(i=e.sent,i=JSON.parse(i),![0,200].includes(i.code)){e.next=19;break}if(!i.data.url.length){e.next=16;break}return e.abrupt("return",this.loadTerrain(i.data));case 16:return e.abrupt("return",new Promise((function(e,t){t("资源不存在")})));case 17:e.next=20;break;case 19:return e.abrupt("return",new Promise((function(e,t){t(i.msg||i.message)})));case 20:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"close",value:function(){var e=this;this.sdk.viewer.scene.terrainProvider=new Cesium.EllipsoidTerrainProvider({});for(var t=0;t<YJ.Analysis.AnalysesResults.length;t++)"ContourAnalysis"===YJ.Analysis.AnalysesResults[t].type&&YJ.Analysis.AnalysesResults[t].destroy();at(this.sdk,this.options.id),clearTimeout(zc(Vc,this)),Fc(Vc,this,setTimeout((function(){clearTimeout(zc(Vc,e));var t,i=Lc(e.sdk.entityMap);try{for(i.s();!(t=i.n()).done;){var n=y()(t.value,2),o=(n[0],n[1]);"BillboardObject"!==o.type||1!=o.heightMode&&3!=o.heightMode?o.label&&(o.label.show=o.label.show):o.updateHeight()}}catch(e){i.e(e)}finally{i.f()}}),500))}},{key:"loadTerrain",value:(s=o()(a.a.mark((function e(t){var i,n,o,s=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=Ac({},t),n="",i.url.startsWith("http")||i.url.includes(":")?n=i.url:this.options.host?(o=new URL(i.url,this.options.host),n=o.href):n=i.url,!(Number(Cesium.VERSION.split(".")[1])>=107)){e.next=9;break}return e.next=6,Cesium.CesiumTerrainProvider.fromUrl(n);case 6:this.terrainProvider=e.sent,e.next=10;break;case 9:this.terrainProvider=new Cesium.CesiumTerrainProvider({url:n});case 10:if(this.sdk&&this.sdk.viewer){e.next=12;break}return e.abrupt("return");case 12:this.sdk.viewer.terrainProvider=this.terrainProvider,clearTimeout(zc(Vc,this)),Fc(Vc,this,setTimeout((function(){clearTimeout(zc(Vc,s)),s.terrainProvider.readyPromise.then((function(){var e,t=Lc(s.sdk.entityMap);try{for(t.s();!(e=t.n()).done;){var i=y()(e.value,2),n=(i[0],i[1]);"BillboardObject"!==n.type||1!=n.heightMode&&3!=n.heightMode?n.label&&(n.label.show=n.label.show):n.updateHeight()}}catch(e){t.e(e)}finally{t.f()}}))}),1e3)),at(this.sdk,this.options.id);case 16:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"remove",value:function(){this.close()}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:3,!this._error){e.next=3;break}return e.abrupt("return");case 3:if(pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Ac({},this.options.position):this.options.positions?l=Ac({},this.options.positions[0]):this.options.center?l=Ac({},this.options.center):this.options.start?l=Ac({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(l);case 17:l.alt=e.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i,duration:t}),e.next=27;break;case 25:c=new Cesium.Rectangle(Cesium.Math.toRadians(this.object.west),Cesium.Math.toRadians(this.object.south),Cesium.Math.toRadians(this.object.east),Cesium.Math.toRadians(this.object.north)),this.sdk.viewer.camera.flyTo({destination:c,duration:t});case 27:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"setDefaultValue",value:function(){var e,i,n,o,s;(e=t,i="setDefaultValue",n=this,o=3,s=aa()(ln()(1&o?e.prototype:e),i,n),2&o&&"function"==typeof s?function(e){return s.apply(n,e)}:s)([]),this.options.host=this.options.host||p(),this.options.url=this.options.url||""}},{key:"edit",value:(i=o()(a.a.mark((function e(){var t,i,n,o=this,s=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.length>0&&void 0!==s[0]&&s[0],e.abrupt("return");case 6:this._DialogObject=e.sent,(t=document.createElement("div")).style.width="300px",i='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称:</span>\n <input class="input name" type="text">\n </div>\n </div>\n </div>\n ',t.innerHTML=i,(n=t.getElementsByClassName("name")[0]).value=this.name,n.addEventListener("input",(function(){o.name=n.value})),this._DialogObject.contentAppChild(t),this._elms.name=[n];case 16:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"reset",value:function(){this.options=this.deepCopyObj(this.originalOptions),this.name=this.options.name}},{key:"flicker",value:function(){}}]);var i,n,s,r}(yl);function Wc(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Uc(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)?Uc(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Uc(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}var Yc=function(){function e(){k()(this,e),this.element={}}return x()(e,[{key:"getEvent",value:function(t){return e.event[t]}},{key:"getEventAll",value:function(){return e.event}},{key:"setEvent",value:function(t,i){e.event[t]=i}},{key:"on",value:function(e,t){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!t[o]||!t[o].attributes)return 1;var r,l=Wc(t[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==t[o].type?(n.push((function(t){e[l.value]=t.target.checked})),t[o].checked=e[l.value]):(n.push((function(t){var i=t.target.value;"number"!=t.target.type&&"range"!=t.target.type||(i=Number(i)),e[l.value]=i})),"IMG"==t[o].nodeName?t[o].src=e[l.value]:t[o].value=e[l.value]),i.element[l.value]?i.element[l.value].push(t[o]):i.element[l.value]=[t[o]],a.push(l.name);break;case"@click":t[o].addEventListener("click",(function(t){"function"==typeof e.Dialog[l.value]&&e.Dialog[l.value](t)})),a.push(l.name)}};for(l.s();!(r=l.n()).done;)c()}catch(e){l.e(e)}finally{l.f()}for(var u=0;u<a.length;u++)t[o].attributes.removeNamedItem(a[u]);if(s){var h="input";"INPUT"==t[o].tagName&&"checkbox"!=t[o].type||(h="change"),t[o].addEventListener(h,(function(e){for(var t=0;t<n.length;t++)n[t](e)}))}},o=0;o<t.length;o++)n()}}])}();C()(Yc,"event",{});var Jc=new Yc;function qc(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 Xc(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?qc(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):qc(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Zc(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function Kc(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var Qc=function(e){function t(e,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(n=Zc(this,t,[e,i])).options.url=i.url,n.options.startColor=i.startColor||"#ff0000",n.options.endColor=i.endColor||"#fff000",n.options.startScale=i.startScale||.5,n.options.endScale=i.endScale||2,n.options.minimumParticleLife=i.minimumParticleLife||1,n.options.maximumParticleLife=i.maximumParticleLife||2,n.options.minimumSpeed=i.minimumSpeed||1,n.options.maximumSpeed=i.maximumSpeed||30,n.options.emissionRate=i.emissionRate||60,n.options.particleSize=i.particleSize||10,n.options.show=!1!==i.show,n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n._elms={},n.previous={positions:{lng:n.options.lng,lat:n.options.lat,alt:n.options.alt}},n.Dialog=o,n.event=new K(n.sdk),n}return un()(t,e),x()(t,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(e){if("boolean"==typeof e){var t=Ht().sdkD;this.isShowView&&t||(this.options.show=e),this.showView&&3!=this.showView&&t?(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=!1),this.options.label&&this.options.label.show&&(this.label.show=!1)):(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=e),Mt(this.sdk,this.options.id),at(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function e(){var t,i,n,o,s,r=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.originalOptions=this.deepCopyObj(this.options),t=this.sdk.viewer.scene,i=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),n=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(i),o=Cesium.Transforms.eastNorthUpToFixedFrame(n),Cesium.Matrix4.multiplyByScale(o,new Cesium.Cartesian3(1,1,1),o),s=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=t.primitives.add(new Cesium.ParticleSystem({show:!(s>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/smoke.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.minimumSpeed,maximumSpeed:this.options.maximumSpeed,minimumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),maximumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,lifetime:.5,loop:!0,emitter:new Cesium.ConeEmitter(Cesium.Math.toRadians(30)),modelMatrix:o,updateCallback:function(e){e._billboard.id=r.options.id}})),this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},Mt(this.sdk,this.options.id),this.options.show&&Qe(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(r.entity&&r.show){var e=r.sdk.viewer.camera.positionCartographic.height;r.entity.show=!(e>=1e7)}}));case 14:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){e.next=3;break}return e.abrupt("return");case 3:if(pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Xc({},this.options.position):this.options.positions?l=Xc({},this.options.positions[0]):this.options.center?l=Xc({},this.options.center):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(l);case 17:l.alt=e.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=26;break;case 25:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,this.options.alt+500),orientation:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(e){var t=this;this.options.startColor=e,this.particleSystem.startColor=Cesium.Color.fromCssColorString(e),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.startColor=e},clear:function(){t.startColor="rgba(255,255,255,1)"}});t._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(e){var t=this;this.options.endColor=e,this.particleSystem.endColor=Cesium.Color.fromCssColorString(e),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.endColor=e},clear:function(){t.endColor="rgba(255,255,255,1)"}});t._elms.endColor[n]=o}))}},{key:"minimumSpeed",get:function(){return this.options.minimumSpeed},set:function(e){this.options.minimumSpeed=e,this.particleSystem.minimumSpeed=e,this._elms.minimumSpeed&&this._elms.minimumSpeed.forEach((function(t){t.value=e}))}},{key:"maximumSpeed",get:function(){return this.options.maximumSpeed},set:function(e){this.options.maximumSpeed=e,this.particleSystem.maximumSpeed=e,this._elms.maximumSpeed&&this._elms.maximumSpeed.forEach((function(t){t.value=e}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(e){this.options.minimumParticleLife=e,this.particleSystem.minimumParticleLife=e,this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(t){t.value=e}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(e){this.options.maximumParticleLife=e,this.particleSystem.maximumParticleLife=e,this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(t){t.value=e}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(e){this.options.startScale=e,this.particleSystem.startScale=e,this._elms.startScale&&this._elms.startScale.forEach((function(t){t.value=e}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(e){this.options.endScale=e,this.particleSystem.endScale=e,this._elms.endScale&&this._elms.endScale.forEach((function(t){t.value=e}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(e){this.options.emissionRate=e,this.particleSystem.emissionRate=e,this._elms.emissionRate&&this._elms.emissionRate.forEach((function(t){t.value=e}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(e){this.options.particleSize=e,this.particleSystem.minimumImageSize=new Cesium.Cartesian2(e,e),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(e,e),this._elms.particleSize&&this._elms.particleSize.forEach((function(t){t.value=e}))}},{key:"lng",get:function(){return this.options.lng},set:function(e){this.options.lng=e;var t=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(t);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e}))}},{key:"lat",get:function(){return this.options.lat},set:function(e){this.options.lat=e;var t=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(t);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e}))}},{key:"alt",get:function(){return this.options.alt},set:function(e){this.options.alt=e;var t=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(t);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e}))}},{key:"edit",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s=this,r=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.length>0&&void 0!==r[0]&&r[0],e.abrupt("return");case 8:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(t=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <div class="row">\n <div class="col">\n <span class="label">起始颜色</span>\n <div class="start_color"></div>\n </div>\n <div class="col" style="margin: 0;justify-content: flex-end;">\n <span class="label">结束颜色</span>\n <div class="end_color"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小初速度</span>\n <input type="range" max="100" min="0" step="1" @model="minimumSpeed">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大初速度</span>\n <input type="range" max="100" min="0" step="1" @model="maximumSpeed">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="minimumParticleLife">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="maximumParticleLife">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>起始比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="startScale">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>结束比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="endScale">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>发射速率(个/秒)</span>\n <input type="range" max="100" min="0" step="1" @model="emissionRate">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>尺寸(像素)</span>\n <input type="range" max="100" min="0" step="1" @model="particleSize">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(t),i=new YJColorPicker({el:t.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(e){s.startColor=e},clear:function(){s.startColor="rgba(255,255,255,1)"}}),n=new YJColorPicker({el:t.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(e){s.endColor=e},clear:function(){s.endColor="rgba(255,255,255,1)"}}),o=t.getElementsByTagName("*"),Jc.on(this,o),this._elms=Jc.element,this._elms.startColor=[i],this._elms.endColor=[n],e.next=22;break;case 22:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.startColor=this.originalOptions.startColor,this.endColor=this.originalOptions.endColor,this.minimumSpeed=this.originalOptions.minimumSpeed,this.maximumSpeed=this.originalOptions.maximumSpeed,this.minimumParticleLife=this.originalOptions.minimumParticleLife,this.maximumParticleLife=this.originalOptions.maximumParticleLife,this.startScale=this.originalOptions.startScale,this.endScale=this.originalOptions.endScale,this.emissionRate=this.originalOptions.emissionRate,this.particleSize=this.originalOptions.particleSize,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.alt=this.originalOptions.alt,function(e){Lt.apply(this,arguments)}(this.entity))}},{key:"remove",value:(i=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Kc(t,"remove",this,3)([]),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),e.next=8,this.sdk.removeIncetance(this.options.id);case 8:return e.next=10,Mt(this.sdk,this.options.id);case 10:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=e,!0===e){var i;this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:Xc({},this.entity.position)},this.event.mouse_move((function(e,n){i=e.endPosition;var o=t.cartesian3Towgs84(n,t.sdk.viewer);t.options.lng=o.lng,t.options.lat=o.lat,t.options.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(t.options.lng,t.options.lat,t.options.alt),a=t.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);t.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),t._elms.lng&&t._elms.lng.forEach((function(e){e.value=t.options.lng})),t._elms.lat&&t._elms.lat.forEach((function(e){e.value=t.options.lat})),t._elms.alt&&t._elms.alt.forEach((function(e){e.value=t.options.alt})),t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,n){if(!i||i.x!==e.position.x||i.y!==e.position.y-2){var o=t.cartesian3Towgs84(n,t.sdk.viewer);t.options.lng=o.lng,t.options.lat=o.lat,t.options.alt=o.alt}t.entity.position={lng:t.options.lng,lat:t.options.lat,alt:t.options.alt},t.previous={positions:Xc({},t.entity.position)},t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t._positionEditingCallback&&(t._positionEditingCallback(),t._positionEditingCallback=null),t.positionEditing=!1})),this.event.mouse_right((function(e,i){t.options.lng=t.entity.position.lng,t.options.lat=t.entity.position.lat,t.options.alt=t.entity.position.alt,t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.options.lng=t.entity.position.lng,t.options.lat=t.entity.position.lat,t.options.alt=t.entity.position.alt,t.positionEditing=!1;else{var e=t.cartesian3Towgs84(i,t.sdk.viewer);t.options.lng=e.lng,t.options.lat=e.lat,t.options.alt=e.alt,t.entity.position={lng:t.options.lng,lat:t.options.lat,alt:t.options.alt},t.previous={positions:Xc({},t.entity.position)},t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.positionEditing=!1}}))}))}else{if(this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){}))),this.tip&&this.tip.destroy(),!this.sdk||!this.sdk.viewer||!this.entity)return;this.options.lng=this.entity.position.lng,this.options.lat=this.entity.position.lat,this.options.alt=this.entity.position.alt;var n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t.options.lng})),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t.options.lat})),this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t.options.alt}))}}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"closePositionEditing",value:function(){this.positionEditing=!1,this._positionEditingCallback=null}},{key:"flicker",value:function(){}}]);var i,n,s,r}(Vn);function $c(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return eu(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)?eu(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function eu(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}var tu=function(){function e(){k()(this,e),this.element={}}return x()(e,[{key:"getEvent",value:function(t){return e.event[t]}},{key:"getEventAll",value:function(){return e.event}},{key:"setEvent",value:function(t,i){e.event[t]=i}},{key:"on",value:function(e,t){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!t[o]||!t[o].attributes)return 1;var r,l=$c(t[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==t[o].type?(n.push((function(t){e[l.value]=t.target.checked})),t[o].checked=e[l.value]):(n.push((function(t){var i=t.target.value;"number"!=t.target.type&&"range"!=t.target.type||(i=Number(i)),e[l.value]=i})),"IMG"==t[o].nodeName?t[o].src=e[l.value]:t[o].value=e[l.value]),i.element[l.value]?i.element[l.value].push(t[o]):i.element[l.value]=[t[o]],a.push(l.name);break;case"@click":t[o].addEventListener("click",(function(t){"function"==typeof e.Dialog[l.value]&&e.Dialog[l.value](t)})),a.push(l.name)}};for(l.s();!(r=l.n()).done;)c()}catch(e){l.e(e)}finally{l.f()}for(var u=0;u<a.length;u++)t[o].attributes.removeNamedItem(a[u]);if(s){var h="input";"INPUT"==t[o].tagName&&"checkbox"!=t[o].type||(h="change"),t[o].addEventListener(h,(function(e){for(var t=0;t<n.length;t++)n[t](e)}))}},o=0;o<t.length;o++)n()}}])}();C()(tu,"event",{});var iu=new tu;function nu(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 ou(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?nu(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):nu(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function su(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function au(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var ru=function(e){function t(e,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(n=su(this,t,[e,i])).options.url=i.url,n.options.startColor=i.startColor||"#00000000",n.options.endColor=i.endColor||"#0000001a",n.options.startScale=i.startScale||.1,n.options.endScale=i.endScale||10,n.options.minimumParticleLife=i.minimumParticleLife||6,n.options.maximumParticleLife=i.maximumParticleLife||7,n.options.minimumSpeed=i.minimumSpeed||10,n.options.maximumSpeed=i.maximumSpeed||15,n.options.emissionRate=i.emissionRate||28,n.options.particleSize=i.particleSize||2,n.options.show=!1!==i.show,n._elms={},n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n.previous={positions:{lng:n.options.lng,lat:n.options.lat,alt:n.options.alt}},n.Dialog=o,n.event=new K(n.sdk),n}return un()(t,e),x()(t,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(e){if("boolean"==typeof e){var t=Ht().sdkD;this.isShowView&&t||(this.options.show=e),this.showView&&3!=this.showView&&t?(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=!1),this.options.label&&this.options.label.show&&(this.label.show=!1)):(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=e),Mt(this.sdk,this.options.id),at(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function e(){var t,i,n,o,s,r=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.originalOptions=this.deepCopyObj(this.options),t=this.sdk.viewer.scene,i=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),n=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(i),o=Cesium.Transforms.eastNorthUpToFixedFrame(n),Cesium.Matrix4.multiplyByScale(o,new Cesium.Cartesian3(1,1,1),o),s=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=t.primitives.add(new Cesium.ParticleSystem({show:!(s>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/smoke.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.minimumSpeed,maximumSpeed:this.options.maximumSpeed,minimumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),maximumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,lifetime:.5,loop:!0,emitter:new Cesium.CircleEmitter(.2),performance:!1,modelMatrix:o,updateCallback:function(e){e._billboard.id=r.options.id}})),this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},Mt(this.sdk,this.options.id),this.options.show&&Qe(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(r.entity&&r.show){var e=r.sdk.viewer.camera.positionCartographic.height;r.entity.show=!(e>=1e7)}}));case 14:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){e.next=3;break}return e.abrupt("return");case 3:if(pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=ou({},this.options.position):this.options.positions?l=ou({},this.options.positions[0]):this.options.center?l=ou({},this.options.center):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(l);case 17:l.alt=e.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=26;break;case 25:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,this.options.alt+500),orientation:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(e){var t=this;this.options.startColor=e,this.particleSystem.startColor=Cesium.Color.fromCssColorString(e),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.startColor=e},clear:function(){t.startColor="rgba(255,255,255,1)"}});t._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(e){var t=this;this.options.endColor=e,this.particleSystem.endColor=Cesium.Color.fromCssColorString(e),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.endColor=e},clear:function(){t.endColor="rgba(255,255,255,1)"}});t._elms.endColor[n]=o}))}},{key:"minimumSpeed",get:function(){return this.options.minimumSpeed},set:function(e){this.options.minimumSpeed=e,this.particleSystem.minimumSpeed=e,this._elms.minimumSpeed&&this._elms.minimumSpeed.forEach((function(t){t.value=e}))}},{key:"maximumSpeed",get:function(){return this.options.maximumSpeed},set:function(e){this.options.maximumSpeed=e,this.particleSystem.maximumSpeed=e,this._elms.maximumSpeed&&this._elms.maximumSpeed.forEach((function(t){t.value=e}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(e){this.options.minimumParticleLife=e,this.particleSystem.minimumParticleLife=e,this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(t){t.value=e}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(e){this.options.maximumParticleLife=e,this.particleSystem.maximumParticleLife=e,this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(t){t.value=e}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(e){this.options.startScale=e,this.particleSystem.startScale=e,this._elms.startScale&&this._elms.startScale.forEach((function(t){t.value=e}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(e){this.options.endScale=e,this.particleSystem.endScale=e,this._elms.endScale&&this._elms.endScale.forEach((function(t){t.value=e}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(e){this.options.emissionRate=e,this.particleSystem.emissionRate=e,this._elms.emissionRate&&this._elms.emissionRate.forEach((function(t){t.value=e}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(e){this.options.particleSize=e,this.particleSystem.minimumImageSize=new Cesium.Cartesian2(e,e),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(e,e),this._elms.particleSize&&this._elms.particleSize.forEach((function(t){t.value=e}))}},{key:"lng",get:function(){return this.options.lng},set:function(e){this.options.lng=e;var t=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(t);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e}))}},{key:"lat",get:function(){return this.options.lat},set:function(e){this.options.lat=e;var t=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(t);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e}))}},{key:"alt",get:function(){return this.options.alt},set:function(e){this.options.alt=e;var t=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(t);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e}))}},{key:"edit",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s=this,r=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.length>0&&void 0!==r[0]&&r[0],e.abrupt("return");case 8:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(t=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <div class="row">\n <div class="col">\n <span class="label">起始颜色</span>\n <div class="start_color"></div>\n </div>\n <div class="col" style="margin: 0;justify-content: flex-end;">\n <span class="label">结束颜色</span>\n <div class="end_color"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小初速度</span>\n <input type="range" max="100" min="0" step="1" @model="minimumSpeed">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大初速度</span>\n <input type="range" max="100" min="0" step="1" @model="maximumSpeed">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="minimumParticleLife">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="maximumParticleLife">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>起始比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="startScale">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>结束比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="endScale">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>发射速率(个/秒)</span>\n <input type="range" max="100" min="0" step="1" @model="emissionRate">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>尺寸(像素)</span>\n <input type="range" max="100" min="0" step="1" @model="particleSize">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(t),i=new YJColorPicker({el:t.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(e){s.startColor=e},clear:function(){s.startColor="rgba(255,255,255,1)"}}),n=new YJColorPicker({el:t.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(e){s.endColor=e},clear:function(){s.endColor="rgba(255,255,255,1)"}}),o=t.getElementsByTagName("*"),iu.on(this,o),this._elms=iu.element,this._elms.startColor=[i],this._elms.endColor=[n],e.next=22;break;case 22:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.startColor=this.originalOptions.startColor,this.endColor=this.originalOptions.endColor,this.minimumSpeed=this.originalOptions.minimumSpeed,this.maximumSpeed=this.originalOptions.maximumSpeed,this.minimumParticleLife=this.originalOptions.minimumParticleLife,this.maximumParticleLife=this.originalOptions.maximumParticleLife,this.startScale=this.originalOptions.startScale,this.endScale=this.originalOptions.endScale,this.emissionRate=this.originalOptions.emissionRate,this.particleSize=this.originalOptions.particleSize,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.alt=this.originalOptions.alt)}},{key:"remove",value:(i=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return au(t,"remove",this,3)([]),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),e.next=8,this.sdk.removeIncetance(this.options.id);case 8:return e.next=10,Mt(this.sdk,this.options.id);case 10:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=e,!0===e){var i;this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:ou({},this.entity.position)},this.event.mouse_move((function(e,n){i=e.endPosition;var o=t.cartesian3Towgs84(n,t.sdk.viewer);t.options.lng=o.lng,t.options.lat=o.lat,t.options.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(t.options.lng,t.options.lat,t.options.alt),a=t.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);t.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),t._elms.lng&&t._elms.lng.forEach((function(e){e.value=t.options.lng})),t._elms.lat&&t._elms.lat.forEach((function(e){e.value=t.options.lat})),t._elms.alt&&t._elms.alt.forEach((function(e){e.value=t.options.alt})),t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,n){if(!i||i.x!==e.position.x||i.y!==e.position.y-2){var o=t.cartesian3Towgs84(n,t.sdk.viewer);t.options.lng=o.lng,t.options.lat=o.lat,t.options.alt=o.alt}t.entity.position={lng:t.options.lng,lat:t.options.lat,alt:t.options.alt},t.previous={positions:ou({},t.entity.position)},t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t._positionEditingCallback&&(t._positionEditingCallback(),t._positionEditingCallback=null),t.positionEditing=!1})),this.event.mouse_right((function(e,i){t.options.lng=t.entity.position.lng,t.options.lat=t.entity.position.lat,t.options.alt=t.entity.position.alt,t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.options.lng=t.entity.position.lng,t.options.lat=t.entity.position.lat,t.options.alt=t.entity.position.alt,t.positionEditing=!1;else{var e=t.cartesian3Towgs84(i,t.sdk.viewer);t.options.lng=e.lng,t.options.lat=e.lat,t.options.alt=e.alt,t.entity.position={lng:t.options.lng,lat:t.options.lat,alt:t.options.alt},t.previous={positions:ou({},t.entity.position)},t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.positionEditing=!1}}))}))}else{if(this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),!this.sdk||!this.sdk.viewer||!this.entity)return;this.options.lng=this.entity.position.lng,this.options.lat=this.entity.position.lat,this.options.alt=this.entity.position.alt;var n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t.options.lng})),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t.options.lat})),this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t.options.alt}))}}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"closePositionEditing",value:function(){this.positionEditing=!1,this._positionEditingCallback=null}},{key:"flicker",value:function(){}}]);var i,n,s,r}(Vn);function lu(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return cu(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)?cu(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function cu(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}var uu=function(){function e(){k()(this,e),this.element={}}return x()(e,[{key:"getEvent",value:function(t){return e.event[t]}},{key:"getEventAll",value:function(){return e.event}},{key:"setEvent",value:function(t,i){e.event[t]=i}},{key:"on",value:function(e,t){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!t[o]||!t[o].attributes)return 1;var r,l=lu(t[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==t[o].type?(n.push((function(t){e[l.value]=t.target.checked})),t[o].checked=e[l.value]):(n.push((function(t){var i=t.target.value;"number"!=t.target.type&&"range"!=t.target.type||(i=Number(i)),e[l.value]=i})),"IMG"==t[o].nodeName?t[o].src=e[l.value]:t[o].value=e[l.value]),i.element[l.value]?i.element[l.value].push(t[o]):i.element[l.value]=[t[o]],a.push(l.name);break;case"@click":t[o].addEventListener("click",(function(t){"function"==typeof e.Dialog[l.value]&&e.Dialog[l.value](t)})),a.push(l.name)}};for(l.s();!(r=l.n()).done;)c()}catch(e){l.e(e)}finally{l.f()}for(var u=0;u<a.length;u++)t[o].attributes.removeNamedItem(a[u]);if(s){var h="input";"INPUT"==t[o].tagName&&"checkbox"!=t[o].type||(h="change"),t[o].addEventListener(h,(function(e){for(var t=0;t<n.length;t++)n[t](e)}))}},o=0;o<t.length;o++)n()}}])}();C()(uu,"event",{});var hu=new uu;function pu(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 du(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?pu(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):pu(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function mu(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function fu(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var vu=function(e){function t(e,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(n=mu(this,t,[e,i])).options.url=i.url,n.options.startColor=i.startColor||"#c1f7f24d",n.options.endColor=i.endColor||"#ffffff00",n.options.startScale=i.startScale||1,n.options.endScale=i.endScale||20,n.options.minimumParticleLife=i.minimumParticleLife||6,n.options.maximumParticleLife=i.maximumParticleLife||7,n.options.minimumSpeed=i.minimumSpeed||9,n.options.maximumSpeed=i.maximumSpeed||9.5,n.options.emissionRate=i.emissionRate||20,n.options.particleSize=i.particleSize||.5,n.options.show=!1!==i.show,n._elms={},n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n.previous={positions:{lng:n.options.lng,lat:n.options.lat,alt:n.options.alt}},n.Dialog=o,n.event=new K(n.sdk),n}return un()(t,e),x()(t,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(e){if("boolean"==typeof e){var t=Ht().sdkD;this.isShowView&&t||(this.options.show=e),this.showView&&3!=this.showView&&t?(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=!1),this.options.label&&this.options.label.show&&(this.label.show=!1)):(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=e),Mt(this.sdk,this.options.id),at(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h=function(){var e=Cesium.HeadingPitchRoll.fromDegrees(0,0,0),t=new Cesium.TranslationRotationScale;//!!!发射粒子的方向
|
||
return t.translation=Cesium.Cartesian3.fromElements(0,0,0),t.rotation=Cesium.Quaternion.fromHeadingPitchRoll(e),Cesium.Matrix4.fromTranslationRotationScale(t)},u=function(e,i){e._billboard.id=t.options.id;var n=e.position;Cesium.Cartesian3.normalize(n,l),Cesium.Cartesian3.multiplyByScalar(l,c*i,l),e.velocity=Cesium.Cartesian3.add(e.velocity,l,e.velocity)},t=this,this.originalOptions=this.deepCopyObj(this.options),i=this.sdk.viewer.scene,new Cesium.Cartesian3,n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n),s=Cesium.Transforms.eastNorthUpToFixedFrame(o),Cesium.Matrix4.multiplyByScale(s,new Cesium.Cartesian3(1,1,1),s),r=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=i.primitives.add(new Cesium.ParticleSystem({show:!(r>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/fountain.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.minimumSpeed,maximumSpeed:this.options.maximumSpeed,lifetime:.5,imageSize:new Cesium.Cartesian2(this.options.particleSize,2*this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,loop:!0,emitter:new Cesium.ConeEmitter(Cesium.Math.toRadians(.2)),modelMatrix:s,emitterModelMatrix:h(),updateCallback:u})),l=new Cesium.Cartesian3,c=-3.5,this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},Mt(this.sdk,this.options.id),this.options.show&&Qe(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(p.entity&&p.show){var e=p.sdk.viewer.camera.positionCartographic.height;p.entity.show=!(e>=1e7)}}));case 21:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){e.next=3;break}return e.abrupt("return");case 3:if(pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=du({},this.options.position):this.options.positions?l=du({},this.options.positions[0]):this.options.center?l=du({},this.options.center):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(l);case 17:l.alt=e.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=26;break;case 25:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,this.options.alt+500),orientation:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(e){var t=this;this.options.startColor=e,this.particleSystem.startColor=Cesium.Color.fromCssColorString(e),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.startColor=e},clear:function(){t.startColor="rgba(255,255,255,1)"}});t._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(e){var t=this;this.options.endColor=e,this.particleSystem.endColor=Cesium.Color.fromCssColorString(e),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.endColor=e},clear:function(){t.endColor="rgba(255,255,255,1)"}});t._elms.endColor[n]=o}))}},{key:"minimumSpeed",get:function(){return this.options.minimumSpeed},set:function(e){this.options.minimumSpeed=e,this.particleSystem.minimumSpeed=e,this._elms.minimumSpeed&&this._elms.minimumSpeed.forEach((function(t){t.value=e}))}},{key:"maximumSpeed",get:function(){return this.options.maximumSpeed},set:function(e){this.options.maximumSpeed=e,this.particleSystem.maximumSpeed=e,this._elms.maximumSpeed&&this._elms.maximumSpeed.forEach((function(t){t.value=e}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(e){this.options.minimumParticleLife=Number(e),this.particleSystem.minimumParticleLife=Number(e),this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(t){t.value=Number(e)}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(e){this.options.maximumParticleLife=Number(e),this.particleSystem.maximumParticleLife=Number(e),this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(t){t.value=Number(e)}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(e){this.options.startScale=e,this.particleSystem.startScale=e,this._elms.startScale&&this._elms.startScale.forEach((function(t){t.value=e}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(e){this.options.endScale=e,this.particleSystem.endScale=e,this._elms.endScale&&this._elms.endScale.forEach((function(t){t.value=e}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(e){this.options.emissionRate=e,this.particleSystem.emissionRate=e,this._elms.emissionRate&&this._elms.emissionRate.forEach((function(t){t.value=e}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(e){this.options.particleSize=e,this.particleSystem.minimumImageSize=new Cesium.Cartesian2(e,e),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(e,e),this._elms.particleSize&&this._elms.particleSize.forEach((function(t){t.value=e}))}},{key:"lng",get:function(){return this.options.lng},set:function(e){this.options.lng=e;var t=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(t);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e}))}},{key:"lat",get:function(){return this.options.lat},set:function(e){this.options.lat=e;var t=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(t);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e}))}},{key:"alt",get:function(){return this.options.alt},set:function(e){this.options.alt=e;var t=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(t);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e}))}},{key:"edit",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s=this,r=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.length>0&&void 0!==r[0]&&r[0],e.abrupt("return");case 8:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(t=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <div class="row">\n <div class="col">\n <span class="label">起始颜色</span>\n <div class="start_color"></div>\n </div>\n <div class="col" style="margin: 0;justify-content: flex-end;">\n <span class="label">结束颜色</span>\n <div class="end_color"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小初速度</span>\n <input type="range" max="100" min="0" step="1" @model="minimumSpeed">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大初速度</span>\n <input type="range" max="100" min="0" step="1" @model="maximumSpeed">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="minimumParticleLife">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="maximumParticleLife">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>起始比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="startScale">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>结束比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="endScale">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>发射速率(个/秒)</span>\n <input type="range" max="100" min="0" step="1" @model="emissionRate">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>尺寸(像素)</span>\n <input type="range" max="100" min="0" step="1" @model="particleSize">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(t),i=new YJColorPicker({el:t.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(e){s.startColor=e},clear:function(){s.startColor="rgba(255,255,255,1)"}}),n=new YJColorPicker({el:t.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(e){s.endColor=e},clear:function(){s.endColor="rgba(255,255,255,1)"}}),o=t.getElementsByTagName("*"),hu.on(this,o),this._elms=hu.element,this._elms.startColor=[i],this._elms.endColor=[n],e.next=22;break;case 22:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.startColor=this.originalOptions.startColor,this.endColor=this.originalOptions.endColor,this.minimumSpeed=this.originalOptions.minimumSpeed,this.maximumSpeed=this.originalOptions.maximumSpeed,this.minimumParticleLife=this.originalOptions.minimumParticleLife,this.maximumParticleLife=this.originalOptions.maximumParticleLife,this.startScale=this.originalOptions.startScale,this.endScale=this.originalOptions.endScale,this.emissionRate=this.originalOptions.emissionRate,this.particleSize=this.originalOptions.particleSize,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.alt=this.originalOptions.alt)}},{key:"remove",value:(i=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return fu(t,"remove",this,3)([]),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),e.next=8,this.sdk.removeIncetance(this.options.id);case 8:return e.next=10,Mt(this.sdk,this.options.id);case 10:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=e,!0===e){var i;this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:du({},this.entity.position)},this.event.mouse_move((function(e,n){i=e.endPosition;var o=t.cartesian3Towgs84(n,t.sdk.viewer);t.options.lng=o.lng,t.options.lat=o.lat,t.options.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(t.options.lng,t.options.lat,t.options.alt),a=t.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);t.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),t._elms.lng&&t._elms.lng.forEach((function(e){e.value=t.options.lng})),t._elms.lat&&t._elms.lat.forEach((function(e){e.value=t.options.lat})),t._elms.alt&&t._elms.alt.forEach((function(e){e.value=t.options.alt})),t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,n){if(!i||i.x!==e.position.x||i.y!==e.position.y-2){var o=t.cartesian3Towgs84(n,t.sdk.viewer);t.options.lng=o.lng,t.options.lat=o.lat,t.options.alt=o.alt}t.entity.position={lng:t.options.lng,lat:t.options.lat,alt:t.options.alt},t.previous={positions:du({},t.entity.position)},t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t._positionEditingCallback&&(t._positionEditingCallback(),t._positionEditingCallback=null),t.positionEditing=!1})),this.event.mouse_right((function(e,i){t.options.lng=t.entity.position.lng,t.options.lat=t.entity.position.lat,t.options.alt=t.entity.position.alt,t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.options.lng=t.entity.position.lng,t.options.lat=t.entity.position.lat,t.options.alt=t.entity.position.alt,t.positionEditing=!1;else{var e=t.cartesian3Towgs84(i,t.sdk.viewer);t.options.lng=e.lng,t.options.lat=e.lat,t.options.alt=e.alt,t.entity.position={lng:t.options.lng,lat:t.options.lat,alt:t.options.alt},t.previous={positions:du({},t.entity.position)},t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.positionEditing=!1}}))}))}else{if(this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),!this.sdk||!this.sdk.viewer||!this.entity)return;this.options.lng=this.entity.position.lng,this.options.lat=this.entity.position.lat,this.options.alt=this.entity.position.alt;var n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t.options.lng})),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t.options.lat})),this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t.options.alt}))}}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"closePositionEditing",value:function(){this.positionEditing=!1,this._positionEditingCallback=null}},{key:"flicker",value:function(){}}]);var i,n,s,r}(Vn);function gu(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return yu(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)?yu(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function yu(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 bu(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 Cu(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?bu(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):bu(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function wu(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function ku(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}var _u=function(e){function t(e,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(n=wu(this,t,[e,i])).options.url=i.url,n.options.startColor=i.startColor||"#c1f7f2",n.options.endColor=i.endColor||"#ffffff00",n.options.startScale=i.startScale||.2,n.options.endScale=i.endScale||2,n.options.minimumParticleLife=i.minimumParticleLife||12,n.options.maximumParticleLife=i.maximumParticleLife||12,n.options.emissionRate=i.emissionRate||100,n.options.particleSize=i.particleSize||1,n.options.show=!1!==i.show,n._elms={},n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n.previous={positions:{lng:n.options.start.lng,lat:n.options.start.lat,alt:n.options.start.alt}},n.Dialog=o,n.event=new K(n.sdk),n}return un()(t,e),x()(t,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(e){if("boolean"==typeof e){var t=Ht().sdkD;this.isShowView&&t||(this.options.show=e),this.showView&&3!=this.showView&&t?(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=!1),this.options.label&&this.options.label.show&&(this.label.show=!1)):(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=e),Mt(this.sdk,this.options.id),at(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:C=function(e,t){var i=new Cesium.Cartesian3,n=Cesium.Transforms.eastNorthUpToFixedFrame(e);return Cesium.Matrix4.inverse(n,n),Cesium.Matrix4.multiplyByPoint(n,t,i),Cesium.Cartesian3.normalize(i,i),Cesium.Math.toDegrees(Math.atan2(i.x,i.y))},b=function(){var e=Cesium.HeadingPitchRoll.fromDegrees(t.options.heading+90,t.options.pitch,0),i=new Cesium.TranslationRotationScale;//!!!发射粒子的方向
|
||
return i.translation=Cesium.Cartesian3.fromElements(0,0,1),i.rotation=Cesium.Quaternion.fromHeadingPitchRoll(e),Cesium.Matrix4.fromTranslationRotationScale(i)},y=function(e,i){e._billboard.id=t.options.id;var n=e.position;Cesium.Cartesian3.normalize(n,r),Cesium.Cartesian3.multiplyByScalar(r,l*i,r),e.velocity=Cesium.Cartesian3.add(e.velocity,r,e.velocity)},t=this,this.originalOptions=this.deepCopyObj(this.options),i=this.sdk.viewer.scene,n=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n),s=Cesium.Transforms.eastNorthUpToFixedFrame(o),Cesium.Matrix4.multiplyByScale(s,new Cesium.Cartesian3(1,1,1),s),r=new Cesium.Cartesian3,l=-3.8,c=Cesium.Cartesian3.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),u=Cesium.Cartesian3.fromDegrees(this.options.end.lng,this.options.end.lat,this.options.end.alt),this.options.heading||0===this.options.heading||(this.options.heading=C(c,u)),h=this.options.end.alt-this.options.start.alt,p=Cesium.Cartesian3.distance(c,Cesium.Cartesian3.fromDegrees(this.options.end.lng,this.options.end.lat,this.options.start.alt)),d=h?2*h/p:0,m=Math.atan(d)*(180/Math.PI),f=Math.sqrt(Math.abs(d)*p/-l),v=-l*f/Math.abs(Math.cos(m)),this.options.pitch||0===this.options.pitch||(this.options.pitch=90-m),this.options.speed||0===this.options.speed||(this.options.speed=v),g=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=i.primitives.add(new Cesium.ParticleSystem({show:!(g>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/smoke.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.speed,maximumSpeed:this.options.speed,lifetime:.5,imageSize:new Cesium.Cartesian2(this.options.particleSize,2*this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,loop:!0,emitter:new Cesium.CircleEmitter(.2),modelMatrix:s,emitterModelMatrix:b(),updateCallback:y})),this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.start.lng,lat:this.options.start.lat,alt:this.options.start.alt},Mt(this.sdk,this.options.id),this.options.show&&Qe(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(w.entity&&w.show){var e=w.sdk.viewer.camera.positionCartographic.height;w.entity.show=!(e>=1e7)}}));case 31:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:{},pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Cu({},this.options.position):this.options.positions?l=Cu({},this.options.positions[0]):this.options.line&&this.options.line.positions?l=Cu({},this.options.line.positions[0]):this.options.center?l=Cu({},this.options.center):this.options.start?l=Cu({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=16;break}return e.next=15,this.getClampToHeight(l);case 15:l.alt=e.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=24;break;case 23:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt+500),orientation:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 24:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(e){var t=this;this.options.startColor=e,this.particleSystem.startColor=Cesium.Color.fromCssColorString(e),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.startColor=e},clear:function(){t.startColor="rgba(255,255,255,1)"}});t._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(e){var t=this;this.options.endColor=e,this.particleSystem.endColor=Cesium.Color.fromCssColorString(e),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.endColor=e},clear:function(){t.endColor="rgba(255,255,255,1)"}});t._elms.endColor[n]=o}))}},{key:"speed",get:function(){return this.options.speed},set:function(e){this.options.speed=Number(e),this.particleSystem.minimumSpeed=Number(e),this.particleSystem.maximumSpeed=Number(e),this._elms.speed&&this._elms.speed.forEach((function(t){t.value=Number(e)}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(e){this.options.minimumParticleLife=Number(e),this.particleSystem.minimumParticleLife=Number(e),this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(t){t.value=Number(e)}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(e){this.options.maximumParticleLife=Number(e),this.particleSystem.maximumParticleLife=Number(e),this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(t){t.value=Number(e)}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(e){this.options.startScale=Number(e),this.particleSystem.startScale=Number(e),this._elms.startScale&&this._elms.startScale.forEach((function(t){t.value=Number(e)}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(e){this.options.endScale=Number(e),this.particleSystem.endScale=Number(e),this._elms.endScale&&this._elms.endScale.forEach((function(t){t.value=Number(e)}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(e){this.options.emissionRate=Number(e),this.particleSystem.emissionRate=Number(e),this._elms.emissionRate&&this._elms.emissionRate.forEach((function(t){t.value=Number(e)}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(e){this.options.particleSize=Number(e),this.particleSystem.minimumImageSize=new Cesium.Cartesian2(Number(e),2*Number(e)),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(Number(e),2*Number(e)),this._elms.particleSize&&this._elms.particleSize.forEach((function(t){t.value=Number(e)}))}},{key:"lng",get:function(){return this.options.start.lng},set:function(e){this.options.start.lng=e;var t=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(t);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.start.lng,lat:this.options.start.lat,alt:this.options.start.alt},this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e}))}},{key:"lat",get:function(){return this.options.start.lat},set:function(e){this.options.start.lat=e;var t=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(t);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.start.lng,lat:this.options.start.lat,alt:this.options.start.alt},this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e}))}},{key:"alt",get:function(){return this.options.start.alt},set:function(e){this.options.start.alt=e;var t=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(t);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.start.lng,lat:this.options.start.lat,alt:this.options.start.alt},this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e}))}},{key:"heading",get:function(){return this.options.heading},set:function(e){this.options.heading=Number(e);var t=Cesium.HeadingPitchRoll.fromDegrees(this.options.heading+90,this.options.pitch,0),i=new Cesium.TranslationRotationScale;//!!!发射粒子的方向
|
||
i.translation=Cesium.Cartesian3.fromElements(0,0,1),i.rotation=Cesium.Quaternion.fromHeadingPitchRoll(t);var n=Cesium.Matrix4.fromTranslationRotationScale(i);this.particleSystem.emitterModelMatrix=n,this._elms.heading&&this._elms.heading.forEach((function(t){t.value=Number(e)}))}},{key:"pitch",get:function(){return this.options.pitch},set:function(e){this.options.pitch=Number(e);var t=Cesium.HeadingPitchRoll.fromDegrees(this.options.heading+90,this.options.pitch,0),i=new Cesium.TranslationRotationScale;//!!!发射粒子的方向
|
||
i.translation=Cesium.Cartesian3.fromElements(0,0,1),i.rotation=Cesium.Quaternion.fromHeadingPitchRoll(t);var n=Cesium.Matrix4.fromTranslationRotationScale(i);this.particleSystem.emitterModelMatrix=n,this._elms.pitch&&this._elms.pitch.forEach((function(t){t.value=Number(e)}))}},{key:"edit",value:(n=o()(a.a.mark((function e(){var i,n,o,s,r,l=this,c=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=c.length>0&&void 0!==c[0]&&c[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){e.next=20;break}return e.next=7,new pn(this.sdk,this.originalOptions,{title:"喷射水柱属性",left:"180px",top:"100px",confirmCallBack:function(e){l.name=l.name.trim(),l.name||(l.name="未命名对象"),l.originalOptions=l.deepCopyObj(l.options),l._DialogObject.close(),l.Dialog.confirmCallBack&&l.Dialog.confirmCallBack(l.originalOptions),Mt(l.sdk,l.options.id),at(l.sdk,l.options.id)},resetCallBack:function(){l.reset(),l.Dialog.resetCallBack&&l.Dialog.resetCallBack()},removeCallBack:function(){l.Dialog.removeCallBack&&l.Dialog.removeCallBack()},closeCallBack:function(){l.reset(),l.positionEditing=!1,l.Dialog.closeCallBack&&l.Dialog.closeCallBack()},showCallBack:function(e){l.show=e,l.Dialog.showCallBack&&l.Dialog.showCallBack()},translationalCallBack:function(){l.positionEditing=!l.positionEditing}},!0);case 7:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input style="width: 175px;" class="input" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <div class="row">\n <div class="col">\n <span class="label">起始颜色</span>\n <div class="start_color"></div>\n </div>\n <div class="col" style="margin: 0;justify-content: flex-end;">\n <span class="label">结束颜色</span>\n <div class="end_color"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="row">\n <span>速度</span>\n <input type="range" max="30" min="0" step="0.1" @model="speed">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>发射速率(个/秒)</span>\n <input type="range" max="100" min="0" step="1" @model="emissionRate">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="minimumParticleLife">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="maximumParticleLife">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>起始比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="startScale">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>结束比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="endScale">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>朝向</span>\n <input type="range" max="360" min="0.1" step="0.1" @model="heading">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>俯仰角度</span>\n <input type="range" max="360" min="0.1" step="0.1" @model="pitch">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>尺寸(像素)</span>\n <input type="range" max="100" min="0" step="1" @model="particleSize">\n </div>\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(n),o=new YJColorPicker({el:n.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(e){l.startColor=e},clear:function(){l.startColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:n.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(e){l.endColor=e},clear:function(){l.endColor="rgba(255,255,255,1)"}}),r=n.getElementsByTagName("*"),t.EventBinding(this,r),this._elms.startColor=[o],this._elms.endColor=[s],e.next=20;break;case 20:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.startColor=this.originalOptions.startColor,this.endColor=this.originalOptions.endColor,this.speed=this.originalOptions.speed,this.minimumParticleLife=this.originalOptions.minimumParticleLife,this.maximumParticleLife=this.originalOptions.maximumParticleLife,this.startScale=this.originalOptions.startScale,this.endScale=this.originalOptions.endScale,this.emissionRate=this.originalOptions.emissionRate,this.particleSize=this.originalOptions.particleSize,this.lng=this.originalOptions.start.lng,this.lat=this.originalOptions.start.lat,this.alt=this.originalOptions.start.alt)}},{key:"remove",value:(i=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ku(t,"remove",this,3)([]),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),e.next=8,this.sdk.removeIncetance(this.options.id);case 8:return e.next=10,Mt(this.sdk,this.options.id);case 10:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=e,!0===e){var i;this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:Cu({},this.entity.position)},this.event.mouse_move((function(e,n){i=e.endPosition;var o=t.cartesian3Towgs84(n,t.sdk.viewer);t.options.start.lng=o.lng,t.options.start.lat=o.lat,t.options.start.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(t.options.start.lng,t.options.start.lat,t.options.start.alt),a=t.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);t.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),t._elms.lng&&t._elms.lng.forEach((function(e){e.value=t.options.start.lng})),t._elms.lat&&t._elms.lat.forEach((function(e){e.value=t.options.start.lat})),t._elms.alt&&t._elms.alt.forEach((function(e){e.value=t.options.start.alt})),t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,n){if(!i||i.x!==e.position.x||i.y!==e.position.y-2){var o=t.cartesian3Towgs84(n,t.sdk.viewer);t.options.start.lng=o.lng,t.options.start.lat=o.lat,t.options.start.alt=o.alt}t.entity.position={lng:t.options.start.lng,lat:t.options.start.lat,alt:t.options.start.alt},t.previous={positions:Cu({},t.entity.position)},t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t._positionEditingCallback&&(t._positionEditingCallback(),t._positionEditingCallback=null),t.positionEditing=!1})),this.event.mouse_right((function(e,i){t.options.start.lng=t.entity.position.lng,t.options.start.lat=t.entity.position.lat,t.options.start.alt=t.entity.position.alt,t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.options.lng=t.entity.position.lng,t.options.lat=t.entity.position.lat,t.options.alt=t.entity.position.alt,t.positionEditing=!1;else{var e=t.cartesian3Towgs84(i,t.sdk.viewer);t.options.lng=e.lng,t.options.lat=e.lat,t.options.alt=e.alt,t.entity.position={lng:t.options.lng,lat:t.options.lat,alt:t.options.alt},t.previous={positions:Cu({},t.entity.position)},t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.positionEditing=!1}}))}))}else{if(this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),!this.sdk||!this.sdk.viewer||!this.entity)return;this.options.start.lng=this.entity.position.lng,this.options.start.lat=this.entity.position.lat,this.options.start.alt=this.entity.position.alt;var n=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t.options.start.lng})),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t.options.start.lat})),this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t.options.start.alt}))}}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"closePositionEditing",value:function(){this.positionEditing=!1,this._positionEditingCallback=null}},{key:"flicker",value:function(){}}],[{key:"EventBinding",value:function(e,t){for(var i=function(){var i=[],o=!1,s=[];if(!t[n]||!t[n].attributes)return 1;var a,r=gu(t[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==t[n].type?(i.push((function(t){e[r.value]=t.target.checked})),t[n].checked=e[r.value]):(i.push((function(t){var i=t.target.value;"number"==t.target.type?"."==t.data||"-"==t.data&&!t.target.value||(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),e[r.value]=i):e[r.value]=i})),"IMG"==t[n].nodeName?t[n].src=e[r.value]:t[n].value=e[r.value]),e._elms[r.value]?e._elms[r.value].push(t[n]):e._elms[r.value]=[t[n]],s.push(r.name);break;case"@click":t[n].addEventListener("click",(function(t){"function"==typeof e[r.value]&&e[r.value](t)})),s.push(r.name);break;case"@change":o=!0,i.push((function(t){var i=t.target.value;"number"==t.target.type&&""!=i&&(i=Number(i),t.target.value=i),"function"==typeof e[r.value]&&e[r.value](t,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(e){r.e(e)}finally{r.f()}for(var c=0;c<s.length;c++)t[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==t[n].tagName&&"checkbox"!=t[n].type||(u="change"),t[n].addEventListener(u,(function(e){for(var t=0;t<i.length;t++)i[t](e)}))}},n=0;n<t.length;n++)i()}}]);var i,n,s,r}(Vn);function xu(e){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">多面体颜色</span>\n <div class="color"></div>\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <span class="label">多面体高度</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="9999999" data-null data-min="0.01" @model="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n \x3c!-- <div class="col">\n <span class="label">拉伸高度</span>\n <input class="input" type="number" title="" min="0" max="9999999" @model="extrudedHeight">\n </div> --\x3e\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="polygon-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Eu(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Su(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)?Su(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Su(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}var Pu=function(){function e(){k()(this,e),this.element={}}return x()(e,[{key:"getEvent",value:function(t){return e.event[t]}},{key:"getEventAll",value:function(){return e.event}},{key:"setEvent",value:function(t,i){e.event[t]=i}},{key:"on",value:function(e,t){for(var i=this,n=function(){var n=[],s=!1,a=[],r=function(){};if(!t[o]||!t[o].attributes)return 1;var l,c=Eu(t[o].attributes);try{var u=function(){var c=l.value;switch(c.name){case"@model":s=!0,"checkbox"==t[o].type?(n.push((function(t){e[c.value]=t.target.checked})),t[o].checked=e[c.value]):(n.push((function(t){var i=t.target.value;if("number"==t.target.type){var n=t.target.value+"";if("."!=t.data&&("-"!=t.data||t.target.value)&&("0"!=n.charAt(n.length-1)||!t.target.value.toString().includes("."))&&"0"!=t.target.value){if(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),"undefined"!==t.target.dataset.min&&""!==t.target.dataset.min){var o=Number(t.target.dataset.min);i<o&&(i=o)}e[c.value]=i}}else e[c.value]=i})),r=function(t){var i=t.target.value;"number"==t.target.type&&(t.target.value||"undefined"!==t.target.dataset.null&&""!==t.target.dataset.null&&!Boolean(t.target.dataset.null))&&(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),t.target.dataset.min&&i<Number(t.target.dataset.min)&&(i=Number(t.target.dataset.min))),e[c.value]=i},"IMG"==t[o].nodeName?t[o].src=e[c.value]:t[o].value=e[c.value]),i.element[c.value]?i.element[c.value].push(t[o]):i.element[c.value]=[t[o]],a.push(c.name);break;case"@click":t[o].addEventListener("click",(function(t){"function"==typeof e[c.value]&&e[c.value](t)})),a.push(c.name);break;case"@change":s=!0,n.push((function(t){var i=t.target.value;"number"==t.target.type&&""!=i&&(i=Number(i),t.target.value=i),"function"==typeof e[c.value]&&e[c.value](t,i)}))}};for(c.s();!(l=c.n()).done;)u()}catch(e){c.e(e)}finally{c.f()}for(var h=0;h<a.length;h++)t[o].attributes.removeNamedItem(a[h]);if(s){var p="input";"INPUT"==t[o].tagName&&"checkbox"!=t[o].type||(p="change"),t[o].addEventListener(p,(function(e){for(var t=0;t<n.length;t++)n[t](e)})),t[o].addEventListener("blur",r)}},o=0;o<t.length;o++)n()}}])}();C()(Pu,"event",{});var Du=new Pu;function Mu(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Tu=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(i=Mu(this,t,[e,n])).options.color=n.color||"#ff0000",i.options.show=!n.show&&!1!==n.show||n.show,i.options.height=n.height||0===n.height?n.height:10,i.options.height<=.01&&(i.options.height=.01),i.options.extrudedHeight=n.extrudedHeight||0===n.extrudedHeight?n.extrudedHeight:0,i.entity,i.nodePoints=[],i.operate={},n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.richTextContent=n.richTextContent||"",i._elms={},i.Dialog=o,!i.options.positions||i.options.positions.length<3?(i._error="多面体最少需要三个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500})):(i.sdk.addIncetance(i.options.id,i),t.create(i)),i}return un()(t,e),x()(t,[{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=this;if(this.event&&this.event.destroy(),this.event=new K(this.sdk),this.operate.positionEditing=e,this.previous={positions:A()(this.positions)},!0===e){var n;this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)"));var o=Cesium.Color.fromCssColorString(this.options.color).withAlpha(.99);2===this.sdk.viewer.scene.mode&&(o=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=o,this.picking=!1;for(var s=[],a=this.positions,r=[],l=0;l<a.length;l++){var c=this.cartesian3Towgs84(a[l],this.sdk.viewer);s.push([c.lng,c.lat])}var u=this.cartesian3Towgs84(a[0],this.sdk.viewer);s.push([u.lng,u.lat]);for(var h=turf.polygon([s]),p=turf.centroid(h),d=(n=Cesium.Cartesian3).fromDegrees.apply(n,A()(p.geometry.coordinates)),m=0;m<a.length;m++)d.x,a[m].x,r.push({x:d.x-a[m].x,y:d.y-a[m].y,z:d.z-a[m].z});var f=[];this.event.mouse_move((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer),o=Cesium.Cartesian3.fromDegrees(n.lng,n.lat);f=[];for(var s=0;s<r.length;s++)f.push({x:o.x-r[s].x,y:o.y-r[s].y,z:o.z-r[s].z});t.label.position=[n.lng,n.lat,t.options.height+t.options.extrudedHeight],t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,i){t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.event.destroy();var n=t.cartesian3Towgs84(i,t.sdk.viewer),o=Cesium.Cartesian3.fromDegrees(n.lng,n.lat);f=[],t.options.positions=[];for(var s=0;s<r.length;s++){f.push({x:o.x-r[s].x,y:o.y-r[s].y,z:o.z-r[s].z});var a=t.cartesian3Towgs84({x:o.x-r[s].x,y:o.y-r[s].y,z:o.z-r[s].z},t.sdk.viewer);a.alt=a.alt-t.options.height,t.options.positions.push(a)}t.positions=f,t.previous.positions=f,t._positionEditingCallback&&(t._positionEditingCallback(),t._positionEditingCallback=null),t.positionEditing=!1})),this.event.mouse_right((function(e,i){t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.positionEditing=!1;else{t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.event.destroy();var e=t.cartesian3Towgs84(i,t.sdk.viewer),o=Cesium.Cartesian3.fromDegrees(e.lng,e.lat);f=[],t.options.positions=[];for(var s=0;s<r.length;s++){f.push({x:o.x-r[s].x,y:o.y-r[s].y,z:o.z-r[s].z});var a=t.cartesian3Towgs84({x:o.x-r[s].x,y:o.y-r[s].y,z:o.z-r[s].z},t.sdk.viewer);a.alt=a.alt-t.options.height,t.options.positions.push(a)}t.positions=f,t.previous.positions=f,t.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return f.length>0?new Cesium.PolygonHierarchy(f):new Cesium.PolygonHierarchy(a)}),!1)}else{this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)"));var v=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(v=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=v,this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){})),this.event.destroy()),this.tip&&this.tip.destroy();for(var g=[[]],y=0;y<this.previous.positions.length;y++){var b=this.cartesian3Towgs84(this.previous.positions[y],this.sdk.viewer);g[0].push([b.lng,b.lat])}var C=this.cartesian3Towgs84(this.previous.positions[0],this.sdk.viewer);g[0].push([C.lng,C.lat]);var w=turf.polygon(g),k=turf.centroid(w);this.label.position=[k.geometry.coordinates[0],k.geometry.coordinates[1],this.options.height+this.options.extrudedHeight],this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.previous.positions)}),!0)}}}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"areaChangeCallBack",get:function(){return this._areaChangeCallBack},set:function(e){this._areaChangeCallBack=e}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;if(this.options.color=e||"#ff0000",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,255,255,1)"}});t._elms.color[i]=n}))}}},{key:"height",get:function(){return this.options.height},set:function(e){this.options.height=e,this.options.height<=.01&&(this.options.height=.01);for(var t=[[]],i=0;i<this.options.positions.length;i++)t[0].push([this.options.positions[i].lng,this.options.positions[i].lat,this.options.height+this.options.extrudedHeight]);t[0].push([this.options.positions[0].lng,this.options.positions[0].lat,this.options.height+this.options.extrudedHeight]);var n,o=turf.polygon(t),s=turf.centroid(o);this.label.position=[s.geometry.coordinates[0],s.geometry.coordinates[1],this.options.extrudedHeight+this.options.height],n=this.entity.polygon.hierarchy._value?this.entity.polygon.hierarchy._value.positions:this.entity.polygon.hierarchy._callback().positions;var a=[];this.entity.polygon.perPositionHeight=!0;for(var r=0;r<n.length;r++){var l=Cesium.Cartographic.fromCartesian(n[r]),c=Cesium.Math.toDegrees(l.longitude),u=Cesium.Math.toDegrees(l.latitude),h=new Cesium.Cartesian3.fromDegrees(c,u,this.options.extrudedHeight+e);a.push(h)}this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(a),this.positions=a,this.previous={positions:A()(this.positions)},this._elms.height&&this._elms.height.forEach((function(t){t.value=e}))}},{key:"extrudedHeight",get:function(){return this.options.extrudedHeight},set:function(e){this.options.extrudedHeight=e;for(var t=[[]],i=0;i<this.options.positions.length;i++)t[0].push([this.options.positions[i].lng,this.options.positions[i].lat]);t[0].push([this.options.positions[0].lng,this.options.positions[0].lat]);var n=turf.polygon(t),o=turf.centroid(n);this.label.position=[o.geometry.coordinates[0],o.geometry.coordinates[1],this.options.extrudedHeight+this.options.height],this._elms.extrudedHeight&&this._elms.extrudedHeight.forEach((function(t){t.value=e}))}},{key:"area",get:function(){return this.options.area},set:function(e){this.options.area=e,this._elms.area&&this._elms.area.forEach((function(t){t.value=e}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){this.options.label.show=e,this.show&&!this.showView||3==this.showView?this.label.show=e:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label.color=e,this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label.fontSize=e,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label.scaleByDistance=e,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(e){this.options.label.lineWidth=e,this.label.lineWidth=e,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(t){t.value=e}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(e){this.options.label.pixelOffset=e,this.label.pixelOffset=e,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(t){t.value=e}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(e){var t=this;this.options.label.lineColor=e,this.label.lineColor=e,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelLineColor=e},clear:function(){t.labelLineColor="rgba(0,255,255,0.5)"}});t._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label.backgroundColor=[e,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label.backgroundColor=[this.label.backgroundColor[0],e],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"edit",value:(r=o()(a.a.mark((function e(i){var n,o,s,r,l,c,u,h=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 3:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){e.next=31;break}return e.next=9,new pn(this.sdk,this.options,{title:"多面体属性",left:"180px",top:"100px",confirmCallBack:function(e){h.name=h.name.trim(),h.name||(h.name="未命名对象"),h.options.label.position={lng:h.label.position[0],lat:h.label.position[1],alt:h.label.position[2]},h.originalOptions=h.deepCopyObj(h.options),h._DialogObject.close(),h.Dialog.confirmCallBack&&h.Dialog.confirmCallBack(h.originalOptions),Mt(h.sdk,h.options.id),at(h.sdk,h.options.id)},resetCallBack:function(){h.reset(),h.Dialog.resetCallBack&&h.Dialog.resetCallBack()},removeCallBack:function(){h.Dialog.removeCallBack&&h.Dialog.removeCallBack()},closeCallBack:function(){h.reset(),h.Dialog.closeCallBack&&h.Dialog.closeCallBack();for(var e=0;e<h.nodePoints.length;e++)h.sdk.viewer.entities.remove(h.nodePoints[e]);h.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),h.positionEditing=!1},showCallBack:function(e){h.options.show=e,h.originalOptions.show=e,h.show=e,h.Dialog.showCallBack&&h.Dialog.showCallBack()},translationalCallBack:function(){h.positionEditing=!h.positionEditing},secondaryEditCallBack:function(){t.nodeEdit(h)}});case 9:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" polyhedron",(n=document.createElement("div")).innerHTML=xu(this),this._DialogObject.contentAppChild(n),new En("polygon-object-edit-tabs",void 0,this.sdk),o=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){h.color=e},clear:function(){h.color="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){h.labelColor=e},clear:function(){h.labelColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){h.labelLineColor=e},clear:function(){h.labelLineColor="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){h.labelBackgroundColorStart=e},clear:function(){h.labelBackgroundColorStart="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){h.labelBackgroundColorEnd=e},clear:function(){h.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),u=n.getElementsByTagName("*"),Du.on(this,u),this._elms=Du.element,this._elms.color=[o],this._elms.labelColor=[s],this._elms.labelLineColor=[r],this._elms.labelBackgroundColorStart=[l],this._elms.labelBackgroundColorEnd=[c],setTimeout((function(){h.attributeLink=h.options.attribute.link.content,h.attributeVr=h.options.attribute.vr.content,h.cameraSelect&&h.cameraSelect(),h.goodsSelect&&h.goodsSelect();var e=h.attributeSelect,t=h._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(t){var i=q(t,".attribute-select");i.legp_search(e);for(var n=h._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],o=0;o<e.length;o++)if(e[o].key===h.options.attributeType){n.value=e[o].value,i.legp_searchActive(e[o].value);break}n.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===n.value){h.attributeType=e[t].key;break}}))}var s=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],a=q(h._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(a){a.legp_search(s);var r=h._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];r.value=h.options["area-unit"];for(var l=0;l<s.length;l++)if(s[l].value===r.value){a.legp_searchActive(s[l].value);break}r.addEventListener("input",(function(){for(var e=0;e<s.length;e++)if(s[e].value===r.value){h.areaUnit=s[e].value;break}}))}var c=Un(),u=q(h._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(u){u.legp_search(c);var p=h._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];p.value=c[h.labelFontFamily].value;for(var d=0;d<c.length;d++)if(c[d].value==p.value){u.legp_searchActive(c[d].value);break}p.addEventListener("input",(function(){for(var e=0;e<c.length;e++)if(c[e].value===p.value){h.labelFontFamily=c[e].key;break}})),h._elms.labelFontFamily=[p]}}),0),e.next=32;break;case 31:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 32:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"reset",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.entity){e.next=2;break}return e.abrupt("return");case 2:if(this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.height=this.originalOptions.height,this.extrudedHeight=this.originalOptions.extrudedHeight,this.area=this.originalOptions.area,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],t=this.options.positions,i=[],this.options.height||0===this.options.height){for(n=0;n<t.length;n++)i.push(t[n].lng,t[n].lat,this.options.height+this.options.extrudedHeight);this.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i)}else{for(o=0;o<t.length;o++)i.push(t[o].lng,t[o].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(i)}for(this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positions),s=[[]],r=0;r<this.options.positions.length;r++)s[0].push([this.options.positions[r].lng,this.options.positions[r].lat]);return s[0].push([this.options.positions[0].lng,this.options.positions[0].lat]),l=turf.polygon(s),c=turf.pointOnFeature(l),e.next=31,this.getClampToHeight({lng:c.geometry.coordinates[0],lat:c.geometry.coordinates[1]});case 31:e.sent,this.label.position=[c.geometry.coordinates[0],c.geometry.coordinates[1],this.extrudedHeight+this.height];case 33:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"remove",value:(n=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label&&this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=8,this.sdk.removeIncetance(this.options.id);case 8:return e.next=10,Mt(this.sdk,this.options.id);case 10:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"nodeEdit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},t=this;if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n;YJ.Measure.SetMeasureStatus(!0),t.tip=new Q("请选择一个顶点,右键取消",t.sdk),t.event=new K(t.sdk),t.nodePoints=[];var o=!1,s=function(e,s){if(i){t.options.positions[i.index]=t.cartesian3Towgs84(s,t.sdk.viewer),n=t.options.positions[i.index],o=!0;var a=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(t.options.positions[i.index].lng,t.options.positions[i.index].lat,t.options.extrudedHeight),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.splice(i.index,0,a),t.options.positions.splice(i.index,0,t.options.positions[i.index]),t.areaByMeter=t.computeArea(t.options.positions),t.areaChangeCallBack&&t.areaChangeCallBack();for(var r=[[]],l=0;l<t.options.positions.length;l++)r[0].push([t.options.positions[l].lng,t.options.positions[l].lat]);if(r[0].push([t.options.positions[0].lng,t.options.positions[0].lat]),r[0].length>=4){var c=turf.polygon(r),u=turf.centroid(c);t.label.position=[u.geometry.coordinates[0],u.geometry.coordinates[1],t.options.height+t.options.extrudedHeight]}}else{var h=t.sdk.viewer.scene.pick(e.position);h&&h.id&&h.id.name&&"node-secondary-edit-point"===h.id.name&&(i=h.id,t.nodePoints.splice(h.id.index,1),t.sdk.viewer.entities.remove(h.id),t.tip.set_text("左键确认,右键结束,CTRL+右键撤销"),n=t.cartesian3Towgs84(i.position._value,t.sdk.viewer))}},a=function(s,a){if(i){t.options.positions[i.index]=n,o&&t.options.positions.splice(i.index,1),t.areaByMeter=t.computeArea(t.options.positions),t.areaChangeCallBack&&t.areaChangeCallBack();for(var r=t.options.positions,l=[],c=0;c<r.length;c++)l.push(r[c].lng,r[c].lat,t.options.height+t.options.extrudedHeight);t.positions=Cesium.Cartesian3.fromDegreesArrayHeights(l),t.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(t.positions),e(null,t.options.positions)}for(var u=0;u<t.nodePoints.length;u++)t.sdk.viewer.entities.remove(t.nodePoints[u]);t.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip.destroy()};t.event.mouse_left(s),t.event.mouse_right(a),t.event.mouse_move((function(e,n){if(i){t.options.positions[i.index]=t.cartesian3Towgs84(n,t.sdk.viewer);for(var o=t.options.positions,s=[],a=0;a<o.length;a++)s.push(o[a].lng,o[a].lat,t.options.height+t.options.extrudedHeight);t.positions=Cesium.Cartesian3.fromDegreesArrayHeights(s),t.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(t.positions);for(var r=[[]],l=0;l<t.options.positions.length;l++)r[0].push([t.options.positions[l].lng,t.options.positions[l].lat]);if(r[0].push([t.options.positions[0].lng,t.options.positions[0].lat]),r[0].length>=4){var c=turf.polygon(r),u=turf.centroid(c);t.label.position=[u.geometry.coordinates[0],u.geometry.coordinates[1],t.options.height+t.options.extrudedHeight]}}t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),t.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?a(o,i):s(o,i)}))})),t.event.mouse_right_keyboard_ctrl((function(e,n){i&&(t.options.positions.pop(),t.sdk.viewer.entities.remove(t.nodePoints[t.nodePoints.length-1]),i.index===t.options.positions.length&&(t.nodePoints[i.index-1]?i=t.nodePoints[i.index-1]:i.index=0),t.nodePoints.pop())}));for(var r=0;r<t.options.positions.length;r++){var l=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:r,position:Cesium.Cartesian3.fromDegrees(t.options.positions[r].lng,t.options.positions[r].lat,t.options.extrudedHeight),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.push(l)}}}},{key:"closeNodeEdit",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=null;for(var e=0;e<this.nodePoints.length;e++)this.sdk.viewer.entities.remove(this.nodePoints[e]);this.nodePoints=[],this.picking=!0}},{key:"setDIV",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};t.x=t.x||0===t.x?t.x:10,t.y=t.y||0===t.y?t.y:10;for(var i=[[]],n=0;n<this.options.positions.length;n++)i[0].push([this.options.positions[n].lng,this.options.positions[n].lat]);i[0].push([this.options.positions[0].lng,this.options.positions[0].lat]);var o=turf.polygon(i),s=turf.pointOnFeature(o),a=document.getElementById(t.domid);this.sdk.viewer.scene.postRender.addEventListener((function(i){var n=Cesium.Cartesian3.fromDegrees(s.geometry.coordinates[0],s.geometry.coordinates[1],e.options.extrudedHeight+e.options.height);if("block"===a.style.display||""===a.style.display){var o=e.sdk.viewer.scene.cartesianToCanvasCoordinates(n);o&&(a.style.left=(o.x+t.x).toFixed(0)+"px",a.style.top=(o.y+t.y).toFixed(0)+"px")}}))}}],[{key:"createLabel",value:(i=o()(a.a.mark((function e(t){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(i=[[]],n=0;n<t.options.positions.length;n++)i[0].push([t.options.positions[n].lng,t.options.positions[n].lat]);i[0].push([t.options.positions[0].lng,t.options.positions[0].lat]),o=turf.polygon(i),s=turf.pointOnFeature(o),t.options.label.position={lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1],alt:t.options.extrudedHeight+t.options.height},t.label=new Xn(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.label.position.lng,t.options.label.position.lat,t.options.label.position.alt],text:t.options.name,ground:!1,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far});case 7:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"create",value:function(e){for(var i=e.options.positions,n=[],o=i[0].alt,s=0;s<i.length;s++)o>i[s].alt&&(o=i[s].alt);e.options.extrudedHeight=o;for(var a=0;a<i.length;a++)n.push(i[a].lng,i[a].lat,e.options.height+o);e.positions=Cesium.Cartesian3.fromDegreesArrayHeights(n);var r=Cesium.Color.fromCssColorString(e.options.color);2===e.sdk.viewer.scene.mode&&(r=new Cesium.CustomColorMaterialSource({color:e.options.color})),e.entity=e.sdk.viewer.entities.add({id:e.options.id,show:e.options.show,polygon:{hierarchy:new Cesium.PolygonHierarchy(e.positions),extrudedHeight:e.options.extrudedHeight,perPositionHeight:!0,material:r}}),t.createLabel(e),e.areaByMeter=e.computeArea(i),Mt(e.sdk,e.options.id),e.options.show&&Qe(0,e.options.id)}}]);var i,n,s,r}(Vn);C()(Tu,"elms",{});var Ou=Tu;function Nu(e){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="assemble-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Bu(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 Au(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Bu(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Bu(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Lu(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Iu=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,t),(i=Lu(this,t,[e,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#ff000080",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.positions=n.positions||[],i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.entity,i.event=new K(i.sdk),i.operate={},i._elms={},i.Dialog=o,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.richTextContent=n.richTextContent||"",delete i.options.attribute.camera,delete i.options.attribute.vr,delete i.options.attribute.goods,i.nodePoints=[],!i.options.positions||i.options.positions.length<3)i._error="集结地最少需要三个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{if(!i.options.height&&0!==i.options.height){for(var s=i.options.positions[0].alt,a=1;a<i.options.positions.length;a++)s<i.options.positions[a].alt&&(s=i.options.positions[a].alt);i.options.height=s}i.sdk.addIncetance(i.options.id,i),t.create(i)}return i}return un()(t,e),x()(t,[{key:"type",get:function(){return"AssembleObject"}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;if(this.options.color=e||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,0,0,0.5)"}});t._elms.color[i]=n}))}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(e){var t=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(t.options.heightMode=e||0==e?e:2,t.positionEditing=!1,t.entity){var i="";t.closeNodeEdit();var n=!1,o=!1;switch(t.renewPositions(),t.entity.polyline.positions=[].concat(A()(t.positionsH),[t.positionsH[0],t.positionsH[1]]),t.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(t.positionsH),t.options.heightMode){case"0":case 0:i="海拔高度";break;case"1":case 1:i="相对地表";break;case"2":case 2:n=!0,o=!0,i="依附模型"}t.previous=null,t.label.ground=n,t.entity.polyline.clampToGround=n,t.entity.polyline.arcType=n?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,t.entity.polygon.perPositionHeight=!n,t._elms.heightMode&&(t._elms.heightMode.value=i),t._elms.heightModeObject&&t._elms.heightModeObject.legp_searchActive(i),o?(t._elms.heightBox&&(t._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),t._elms.heightConfirm&&t._elms.heightConfirm.setAttribute("disabled","disabled")):(t._elms.heightBox&&(t._elms.heightBox.className="input-number input-number-unit-1 height-box"),t._elms.heightConfirm&&t._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.height},set:function(e){var t,i=this;!e||isNaN(Number(e))?this.options.height=0:this.options.height=Number(Number(e).toFixed(2)),t=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.entity.polygon.perPositionHeight=!t,i.entity.polyline.positions=[].concat(A()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polyline.clampToGround=!!t,i.entity.polyline.arcType=t?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(e){e.innerHTML=i.options.height}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(e){var t=this;this.options.line.color=e||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.lineColor=e},clear:function(){t.lineColor="rgba(255,0,0,0.5)"}});t._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(e){var t=this;this.options.line.width=e||0===e?e:3,this.entity.polyline.width=this.options.line.width,this._elms.lineColor&&this._elms.lineColor.forEach((function(e){e.value=t.options.line.width}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){this.options.label.show=e,this.show&&!this.showView||3==this.showView?this.label.show=e:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label.color=e,this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label.fontSize=e,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label.scaleByDistance=e,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(e){this.options.label.lineWidth=e,this.label.lineWidth=e,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(t){t.value=e}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(e){this.options.label.pixelOffset=e,this.label.pixelOffset=e,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(t){t.value=e}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(e){var t=this;this.options.label.lineColor=e,this.label.lineColor=e,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelLineColor=e},clear:function(){t.labelLineColor="rgba(0,255,255,0.5)"}});t._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label.backgroundColor=[e,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label.backgroundColor=[this.label.backgroundColor[0],e],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"edit",value:(r=o()(a.a.mark((function e(i){var n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 3:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){e.next=62;break}return o=function(){var e=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];e.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];for(var i=function(i){var o=document.createElement("div");o.className="tr",o.innerHTML='\n <div class="td">'.concat(i+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var s=o.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.positions[i].lng.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.positions[i].lng.toFixed(8);var l=o.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.positions[i].lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.positions[i].lat.toFixed(8);var h=o.getElementsByClassName("alt")[0],p=document.createElement("span");p.innerHTML=n.height.toFixed(2),h.appendChild(p);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(n.options.positions[i].lng.toFixed(8)),s.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.positions[i].lng.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){n.options.positions[i].lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.positions[i].lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.positions[i].lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.positions[i].lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.positions[i].lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.positions[i].lat.toFixed(8),n.height=n.height})),h.addEventListener("dblclick",(function(){2!=n.heightMode&&(h.innerHTML="",d.value=Number(n.height.toFixed(2)),h.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),h.innerHTML="",h.appendChild(p)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),p.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(p),n._elms.altInput.push(d),e.appendChild(o)},o=0;o<n.options.positions.length;o++)i(o)},e.next=10,new pn(this.sdk,this.options,{title:"集结地属性",left:"180px",top:"100px",confirmCallBack:function(e){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.options.label.position={lng:w.label.position[0],lat:w.label.position[1],alt:w.label.position[2]},w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions),Mt(w.sdk,w.options.id),at(w.sdk,w.options.id)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){w.reset(),w.positionEditing=!1,w.Dialog.closeCallBack&&w.Dialog.closeCallBack()},showCallBack:function(e){w.options.show=e,w.originalOptions.show=e,w.show=e,w.Dialog.showCallBack&&w.Dialog.showCallBack()},translationalCallBack:function(){w.positionEditing=!w.positionEditing},secondaryEditCallBack:function(){t.nodeEdit(w,(function(){o()}))}});case 10:if(this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" assemble",(s=document.createElement("div")).innerHTML=Nu(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new En("assemble-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){w.color=e},clear:function(){w.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){w.lineColor=e},clear:function(){w.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelColor=e},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelLineColor=e},clear:function(){w.labelLineColor="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelBackgroundColorStart=e},clear:function(){w.labelBackgroundColorStart="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelBackgroundColorEnd=e},clear:function(){w.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),t.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[h],this._elms.labelBackgroundColorEnd=[p],m=this._DialogObject._element.content.getElementsByClassName("height-box")[0],f=m.getElementsByClassName("height")[0],v=this._DialogObject._element.content.getElementsByClassName("height-confirm")[0],f.value=10,2==this.heightMode?(m&&(m.className="input-number input-number-unit-1 height-box disabled"),v&&v.setAttribute("disabled","disabled")):(m&&(m.className="input-number input-number-unit-1 height-box"),v&&v.removeAttribute("disabled")),g=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],!(y=q(this._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){e.next=59;break}y.legp_search(g),b=this._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],C=0;case 43:if(!(C<g.length)){e.next=51;break}if(g[C].key!=this.heightMode){e.next=48;break}return b.value=g[C].value,y.legp_searchActive(g[C].value),e.abrupt("break",51);case 48:C++,e.next=43;break;case 51:b.addEventListener("input",(function(){for(var e=0;e<g.length;e++)if(g[e].value===b.value){w.heightMode=g[e].key;break}})),f.addEventListener("input",(function(){w.heightMode})),this._elms.height=f,this._elms.heightBox=m,this._elms.heightMode=b,this._elms.heightConfirm=v,this._elms.heightModeObject=y,v.addEventListener("click",(function(){w.operate.positionEditing?(w.positionEditing=!1,w.height=w.height+Number(f.value)):(t.closeNodeEdit(w),w.heightMode=w.heightMode,setTimeout((function(){w.height=w.height+Number(f.value)}),100))}));case 59:setTimeout((function(){w.attributeLink=w.options.attribute.link.content,w.attributeVr=w.options.attribute.vr.content,w.cameraSelect&&w.cameraSelect(),w.goodsSelect&&w.goodsSelect();var e=w.attributeSelect,t=w._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(t){var i=q(t,".attribute-select");i.legp_search(e);for(var n=w._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<e.length;s++)if(e[s].key===w.options.attributeType){n.value=e[s].value,i.legp_searchActive(e[s].value);break}n.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===n.value){w.attributeType=e[t].key;break}}))}o();var a=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],r=q(w._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);for(var l=w._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0],c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var e=0;e<a.length;e++)if(a[e].value===l.value){w.areaUnit=a[e].value;break}}))}var u=Un(),h=q(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(h){h.legp_search(u);var p=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];p.value=u[w.labelFontFamily].value;for(var d=0;d<u.length;d++)if(u[d].value==p.value){h.legp_searchActive(u[d].value);break}p.addEventListener("input",(function(){for(var e=0;e<u.length;e++)if(u[e].value===p.value){w.labelFontFamily=u[e].key;break}})),w._elms.labelFontFamily=[p]}}),0),e.next=63;break;case 62:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 63:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"reset",value:function(){if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineColor=this.originalOptions.line.color,this.lineWidth=this.originalOptions.line.width,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1];for(var e=0;e<this.options.positions.length;e++)this._elms.lng&&this._elms.lng[e]&&(this._elms.lng[e].innerHTML=this.options.positions[e].lng.toFixed(8)),this._elms.lat&&this._elms.lat[e]&&(this._elms.lat[e].innerHTML=this.options.positions[e].lat.toFixed(8)),this._elms.alt&&this._elms.alt[e]&&(this._elms.alt[e].innerHTML=Number(this.options.height.toFixed(2)));this.heightMode=this.heightMode;for(var t=0;t<this.nodePoints.length;t++)this.sdk.viewer.entities.remove(this.nodePoints[t]);this.previous=null,this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy()}}},{key:"remove",value:(s=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sdk.viewer.entities.remove(this.entity),this.label&&this.label.remove(),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=8,this.sdk.removeIncetance(this.options.id);case 8:return e.next=10,Mt(this.sdk,this.options.id);case 10:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=v.length>0&&void 0!==v[0]?v[0]:{},!this._error){e.next=3;break}return e.abrupt("return");case 3:if(pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Au({},this.options.position):this.options.positions?l=Au({},this.options.positions[0]):this.options.center?l=Au({},this.options.center):this.options.start?l=Au({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(l);case 17:l.alt=e.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=51;break;case 25:c=[],e.t0=this.heightMode,e.next=0===e.t0||"0"===e.t0?29:1===e.t0||"1"===e.t0?31:2===e.t0||"2"===e.t0?33:35;break;case 29:case 31:return u=!1,e.abrupt("break",35);case 33:return u=!0,e.abrupt("break",35);case 35:if(!u){e.next=48;break}h=0;case 37:if(!(h<this.options.positions.length)){e.next=46;break}return e.next=40,this.getClampToHeight(this.options.positions[h]);case 40:p=e.sent,d=Cesium.Cartesian3.fromDegrees(this.options.positions[h].lng,this.options.positions[h].lat,p),c.push(d.x,d.y,d.z);case 43:h++,e.next=37;break;case 46:e.next=49;break;case 48:if(this.positionsH)for(m=0;m<this.positionsH.length;m++)c.push(this.positionsH[m].x,this.positionsH[m].y,this.positionsH[m].z);case 49:f=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(f,{offset:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 51:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(e){var t=this;Bn.open(this.options.id,this.options.name,this.options.richTextContent),Bn.primaryCallBack=function(e){t.options.richTextContent=e}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=this;if(this.event&&this.event.destroy(),this.event=new K(this.sdk),this.operate.positionEditing=e,!0===e){var n;this.previous={positions:A()(this.positions)},this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;for(var o=[],s=A()(this.positions),a=[],r=0;r<s.length;r++){var l=this.cartesian3Towgs84(s[r],this.sdk.viewer);o.push([l.lng,l.lat])}var c=this.cartesian3Towgs84(s[0],this.sdk.viewer);o.push([c.lng,c.lat]);for(var u=turf.polygon([o]),h=turf.centroid(u),p=(n=Cesium.Cartesian3).fromDegrees.apply(n,A()(h.geometry.coordinates)),d=0;d<s.length;d++)p.x,s[d].x,a.push({x:p.x-s[d].x,y:p.y-s[d].y,z:p.z-s[d].z});var m=[];this.event.mouse_move((function(e,i){t.cartesian3Towgs84(i,t.sdk.viewer);m=[];for(var n=0;n<a.length;n++)m.push({x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z});t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,i){t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),m=[];for(var n=0;n<a.length;n++){var o={x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z};m.push(o),t.options.positions[n]=t.cartesian3Towgs84(o,t.sdk.viewer),t._elms.lng&&t._elms.lng[n]&&(t._elms.lng[n].innerHTML=t.options.positions[n].lng.toFixed(8)),t._elms.lat&&t._elms.lat[n]&&(t._elms.lat[n].innerHTML=t.options.positions[n].lat.toFixed(8))}t.positions=m,t.previous=null,t.positionEditing=!1,t._positionEditingCallback&&(t._positionEditingCallback(),t._positionEditingCallback=null)})),this.event.mouse_right((function(e,i){t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.positionEditing=!1;else{t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),m=[];for(var e=0;e<a.length;e++){var o={x:i.x-a[e].x,y:i.y-a[e].y,z:i.z-a[e].z};m.push(o),t.options.positions[e]=t.cartesian3Towgs84(o,t.sdk.viewer),t._elms.lng&&t._elms.lng[e]&&(t._elms.lng[e].innerHTML=t.options.positions[e].lng.toFixed(8)),t._elms.lat&&t._elms.lat[e]&&(t._elms.lat[e].innerHTML=t.options.positions[e].lat.toFixed(8))}t.positions=m,t.previous={positions:A()(t.positions)},t.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var e=[];if(m.length>0)for(var t=0;t<m.length;t++)e.push(i.cartesian3Towgs84(m[t],i.sdk.viewer));else for(var n=0;n<s.length;n++)e.push(i.cartesian3Towgs84(s[n],i.sdk.viewer));return i.renewPositions(e),new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}else{this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.previous?this.positions=A()(this.previous.positions):this.previous={positions:A()(this.positions)};for(var f=[],v=0;v<this.positions.length;v++)f.push(i.cartesian3Towgs84(this.positions[v],i.sdk.viewer));this.renewPositions(f),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!0)}}}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"areaChangeCallBack",get:function(){return this._areaChangeCallBack},set:function(e){this._areaChangeCallBack=e}},{key:"nodeEdit",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};if(this.positionEditing=!1,YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var i=function(){var e=o()(a.a.mark((function e(){var t,i,n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=A()(r.sdk.viewer.entities.values),i=0;case 2:if(!(i<r.options.positions.length)){e.next=11;break}return e.next=5,r.getClampToHeight(r.options.positions[i],t);case 5:n=e.sent,o=r.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:i,position:Cesium.Cartesian3.fromDegrees(r.options.positions[i].lng,r.options.positions[i].lat,n),billboard:{image:r.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),r.nodePoints.push(o);case 8:i++,e.next=2;break;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();YJ.Measure.SetMeasureStatus(!0);var n,s,r=this;this.tip=new Q("请选择一个顶点,右键取消",this.sdk),this.event=new K(this.sdk),this.nodePoints=[];for(var l=[],c=0;c<this.options.positions.length;c++)l.push(this.options.positions[c].lng,this.options.positions[c].lat);var u=function(t,i){n&&(e.options.positions[n.index]=e.cartesian3Towgs84(i,e.sdk.viewer),e._elms.lng&&e._elms.lng[n.index]&&(e._elms.lng[n.index].innerHTML=e.options.positions[n.index].lng.toFixed(8)),e._elms.lat&&e._elms.lat[n.index]&&(e._elms.lat[n.index].innerHTML=e.options.positions[n.index].lat.toFixed(8)),e.renewPositions()),e.tip.setPosition(i,t.position?t.position.x:t.endPosition.x,t.position?t.position.y:t.endPosition.y)},h=function(i,o){u(i,o);var a=e.cartesian3Towgs84(o,e.sdk.viewer);if(n){var r=n.index,l=e.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:r,position:Cesium.Cartesian3.fromDegrees(e.options.positions[n.index].lng,e.options.positions[n.index].lat,a.alt),billboard:{image:e.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});e.nodePoints.splice(n.index,0,l),n=null,e.tip.set_text("请选择一个顶点,右键取消")}else{var c=i.position;c||(c={x:(i.position1.x+i.position2.x)/2,y:(i.position1.y+i.position2.y)/2});var h=e.sdk.viewer.scene.pick(c);h&&h.id&&h.id.name&&"node-secondary-edit-point"===h.id.name&&(n=h.id,s=e.cartesian3Towgs84(h.id.position.getValue(),e.sdk.viewer),e.nodePoints.splice(h.id.index,1),e.sdk.viewer.entities.remove(h.id),e.tip.set_text("左键确认,右键取消"))}e.renewPositions(),t("",A()(e.options.positions))},p=function(){e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),n&&(s?e.options.positions[n.index]=s:e.options.positions.pop(),e._elms.lng&&e._elms.lng[n.index]&&(e._elms.lng[n.index].innerHTML=e.options.positions[n.index].lng.toFixed(8)),e._elms.lat&&e._elms.lat[n.index]&&(e._elms.lat[n.index].innerHTML=e.options.positions[n.index].lat.toFixed(8))),e.heightMode=e.heightMode,e.previous=null};this.entity.polyline.clampToGround=!0,this.entity.polyline.arcType=Cesium.ArcType.GEODESIC,this.entity.polygon.perPositionHeight=!1,this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var e=r.computeAssemble(r.options.positions);return new Cesium.PolygonHierarchy(e)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){var e=r.computeAssemble(r.options.positions);return e.length>=3?[].concat(A()(e),[e[0],e[1]]):A()(e)}),!1);for(var d=[[]],m=[],f=0;f<this.positionsH.length;f++){var v=this.cartesian3Towgs84(this.positionsH[f],this.sdk.viewer);m.push(v),d[0].push([v.lng,v.lat])}var g=this.cartesian3Towgs84(this.positionsH[0],this.sdk.viewer);d[0].push([g.lng,g.lat]);var y=turf.polygon(d),b=turf.pointOnFeature(y),C=A()(this.sdk.viewer.entities.values);this.getClampToHeight({lng:b.geometry.coordinates[0],lat:b.geometry.coordinates[1]},C).then((function(t){e.label.position=[b.geometry.coordinates[0],b.geometry.coordinates[1],t]})),setTimeout((function(){e.event.mouse_left(h),e.event.mouse_right(p),e.event.mouse_move(u),e.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){var e=new Date,o={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};e-n>=500?p():h(o,i)}))})),i()}),200)}}},{key:"closeNodeEdit",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=null;for(var e=0;e<this.nodePoints.length;e++)this.sdk.viewer.entities.remove(this.nodePoints[e]);this.nodePoints=[],this.picking=!0}},{key:"setPosition",value:function(e){for(var t,i=Cesium.Cartesian3.fromDegrees(e.position.lng,e.position.lat,e.position.alt),n=A()(this.positions),o=[],s=[],a=0;a<n.length;a++){var r=this.cartesian3Towgs84(n[a],this.sdk.viewer);o.push([r.lng,r.lat])}var l=this.cartesian3Towgs84(n[0],this.sdk.viewer);o.push([l.lng,l.lat]);for(var c=turf.polygon([o]),u=turf.centroid(c),h=(t=Cesium.Cartesian3).fromDegrees.apply(t,A()(u.geometry.coordinates)),p=0;p<n.length;p++)s.push({x:h.x-n[p].x,y:h.y-n[p].y,z:h.z-n[p].z});for(var d=[],m=0;m<s.length;m++)d.push({x:i.x-s[m].x,y:i.y-s[m].y,z:i.z-s[m].z});this.label.position=[e.position.lng,e.position.lat,e.position.alt];var f=[];if(d.length>0)for(var v=0;v<d.length;v++)f.push(this.cartesian3Towgs84(d[v],this.sdk.viewer));var g=this.computeAssemble(f);0!=g.length&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(g)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return g.length>=3?[].concat(A()(g),[g[0],g[1]]):A()(g)}),!1))}},{key:"setDIV",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};t.x=t.x||0===t.x?t.x:10,t.y=t.y||0===t.y?t.y:10;var i=this.computeAssemble(this.options.positions);if(0!=i.length){for(var n=[[]],o=0;o<i.length;o++){var s=this.cartesian3Towgs84(i[o],this.sdk.viewer);n[0].push([s.lng,s.lat])}var a=this.cartesian3Towgs84(i[0],this.sdk.viewer);n[0].push([a.lng,a.lat]);var r=turf.polygon(n),l=turf.pointOnFeature(r),c=document.getElementById(t.domid),u=Cesium.Cartesian3.fromDegrees(l.geometry.coordinates[0],l.geometry.coordinates[1]);this.sdk.viewer.scene.postRender.addEventListener((function(i){if("block"===c.style.display||""===c.style.display){var n=e.sdk.viewer.scene.cartesianToCanvasCoordinates(u);n&&(c.style.left=(n.x+t.x).toFixed(0)+"px",c.style.top=(n.y+t.y).toFixed(0)+"px")}}))}}},{key:"renewPositions",value:function(e,t){var i=this;if(!this._error&&this.sdk.viewer){var n=!1,o=this.options.positions;e&&(o=e);for(var s=[],a=0;a<o.length;a++)s.push(o[a].lng,o[a].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(s);var r=this.computeAssemble(o);if(0!=r.length){for(var l=[[]],c=[],u=0;u<r.length;u++){var h=this.cartesian3Towgs84(r[u],this.sdk.viewer);c.push(h),l[0].push([h.lng,h.lat])}var p=this.cartesian3Towgs84(r[0],this.sdk.viewer);l[0].push([p.lng,p.lat]);var d=0,m=turf.polygon(l),f=turf.pointOnFeature(m);switch(this.options.heightMode){case"0":case 0:n=!1;break;case"1":case 1:d=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(f.geometry.coordinates[0],f.geometry.coordinates[1]))||0,n=!1;break;case"2":case 2:n=!0}var v=[];if(n||0!=this.nodePoints.length)this.positionsH=r,setTimeout((function(){if(i.sdk.viewer){var e=A()(i.sdk.viewer.entities.values);i.getClampToHeight({lng:f.geometry.coordinates[0],lat:f.geometry.coordinates[1]},e).then((function(e){i.label&&(i.label.position=[f.geometry.coordinates[0],f.geometry.coordinates[1],e])}))}}),100);else{for(var g=0;g<l[0].length;g++)v.push(l[0][g][0],l[0][g][1],this.height+d);this.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(v),this.label&&(this.label.position=[f.geometry.coordinates[0],f.geometry.coordinates[1],this.height+d])}return this.areaByMeter=this.computeArea(c),this.areaChangeCallBack&&this.areaChangeCallBack(),s}}}}],[{key:"create",value:function(e){for(var i=e.options.positions,n=[],o=0;o<i.length;o++)n.push(i[o].lng,i[o].lat);e.positions=Cesium.Cartesian3.fromDegreesArray(n);var s=e.computeAssemble(e.options.positions);if(0!=s.length){for(var a=[[]],r=0;r<s.length;r++){var l=e.cartesian3Towgs84(s[r],e.sdk.viewer);a[0].push([l.lng,l.lat])}var c=e.cartesian3Towgs84(s[0],e.sdk.viewer);a[0].push([c.lng,c.lat]);var u,h=turf.polygon(a),p=turf.pointOnFeature(h),d=0;switch(e.options.heightMode){case"0":case 0:u=!1;break;case"1":case 1:d=e.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(p.geometry.coordinates[0],p.geometry.coordinates[1]))||0,u=!1;break;case"2":case 2:u=!0}e.options.label.position={lng:p.geometry.coordinates[0],lat:p.geometry.coordinates[1],alt:e.height+d};for(var m=[],f=0;f<a[0].length;f++)m.push(a[0][f][0],a[0][f][1],e.height+d);var v=Cesium.Color.fromCssColorString(e.options.color);2===e.sdk.viewer.scene.mode&&(u=!1,v=new Cesium.CustomColorMaterialSource({color:e.options.color})),e.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(m),e.entity=e.sdk.viewer.entities.add({show:e.options.show,id:e.options.id,polygon:{hierarchy:u?new Cesium.PolygonHierarchy(s):new Cesium.PolygonHierarchy(e.positionsH),perPositionHeight:!u,material:v,zIndex:e.sdk._entityZIndex},polyline:{positions:[].concat(A()(e.positionsH),[e.positionsH[0],e.positionsH[1]]),width:e.options.line.width,material:Cesium.Color.fromCssColorString(e.options.line.color),clampToGround:!!u,arcType:u?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:e.sdk._entityZIndex}}),e.sdk._entityZIndex++,t.createLabel(e);for(var g=[],y=0;y<s.length;y++)g.push(e.cartesian3Towgs84(s[y],e.sdk.viewer));e.areaByMeter=e.computeArea(g),e.areaChangeCallBack&&e.areaChangeCallBack(),Mt(e.sdk,e.options.id),e.options.show&&Qe(0,e.options.id)}}},{key:"createLabel",value:(i=o()(a.a.mark((function e(t){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.label=new Xn(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.label.position.lng,t.options.label.position.lat,t.options.label.position.alt],text:t.options.name,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineWidth:t.options.label.lineWidth,lineColor:t.options.label.lineColor,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far});case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}]);var i,n,s,r}(Vn);function ju(e){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">动画时长</span>\n <div class="input-number input-number-unit-3">\n <input class="input blur" type="number" title="" min="500" max="9999999" @model="spreadTime">\n <span class="unit">ms</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col">\n <span class="label">动画</span>\n <input class="btn-switch" type="checkbox" @model="spreadState">\n </div>\n <div class="col">\n <span class="label">动画重复</span>\n <input class="btn-switch" type="checkbox" @model="loop">\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="attack-arrow-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Ru(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Fu(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)?Fu(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Fu(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 zu(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 Hu(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?zu(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):zu(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Vu(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Gu=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,t),(i=Vu(this,t,[e,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#ff000080",i.options.show=!n.show&&!1!==n.show||n.show,i.options.positions=n.positions||[],i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.entity,i.event=new K(i.sdk),i.operate={},i._elms={},i.nodePoints=[],i.Dialog=o,i.options.loop=n.loop||!1,i.options.spreadState=n.spreadState||!1,i.spreadTime=n.spreadTime,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontFamily:n.label.fontFamily?n.label.fontFamily:0,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],delete i.options.attribute.camera,delete i.options.attribute.vr,delete i.options.attribute.goods,i.options.richTextContent=n.richTextContent||"",!i.options.positions||i.options.positions.length<3)i._error="箭头面最少需要三个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{if(!i.options.height&&0!==i.options.height){for(var s=i.options.positions[0].alt,a=1;a<i.options.positions.length;a++)s<i.options.positions[a].alt&&(s=i.options.positions[a].alt);i.options.height=s}i.sdk.addIncetance(i.options.id,i),t.create(i)}return i}return un()(t,e),x()(t,[{key:"type",get:function(){return"AttackArrowObject"}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;if(this.options.color=e||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,0,0,0.5)"}});t._elms.color[i]=n}))}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(e){var t=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(t.options.heightMode=e||0==e?e:2,t.positionEditing=!1,t.entity){var i="";t.closeNodeEdit();var n=!1,o=!1;switch(t.renewPositions(),t.entity.polyline.positions=[].concat(A()(t.positionsH),[t.positionsH[0],t.positionsH[1]]),t.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(t.positionsH),t.options.heightMode){case"0":case 0:i="海拔高度";break;case"1":case 1:i="相对地表";break;case"2":case 2:n=!0,o=!0,i="依附模型"}t.previous=null,t.label.ground=n,t.entity.polyline.clampToGround=n,t.entity.polyline.arcType=n?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,t.entity.polygon.perPositionHeight=!n,t._elms.heightMode&&(t._elms.heightMode.value=i),t._elms.heightModeObject&&t._elms.heightModeObject.legp_searchActive(i),o?(t._elms.heightBox&&(t._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),t._elms.heightConfirm&&t._elms.heightConfirm.setAttribute("disabled","disabled")):(t._elms.heightBox&&(t._elms.heightBox.className="input-number input-number-unit-1 height-box"),t._elms.heightConfirm&&t._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.height},set:function(e){var t,i=this;!e||isNaN(Number(e))?this.options.height=0:this.options.height=Number(Number(e).toFixed(2)),t=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.entity.polygon.perPositionHeight=!t,i.entity.polyline.positions=[].concat(A()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polyline.clampToGround=!!t,i.entity.polyline.arcType=t?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(e){e.innerHTML=i.options.height}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(e){var t=this;this.options.line.color=e||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.lineColor=e},clear:function(){t.lineColor="rgba(255,0,0,0.5)"}});t._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(e){this.options.line.width=e||0===e?e:3,this.entity.polyline.width=this.options.line.width,this._elms.lineColor&&this._elms.lineColor.forEach((function(t){t.value=e}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){this.options.label.show=e,this.show&&!this.showView||3==this.showView?this.label.show=e:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label.color=e,this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label.fontSize=e,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label.scaleByDistance=e,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(e){this.options.label.lineWidth=e,this.label.lineWidth=e,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(t){t.value=e}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(e){this.options.label.pixelOffset=e,this.label.pixelOffset=e,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(t){t.value=e}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(e){var t=this;this.options.label.lineColor=e,this.label.lineColor=e,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelLineColor=e},clear:function(){t.labelLineColor="rgba(0,255,255,0.5)"}});t._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label.backgroundColor=[e,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label.backgroundColor=[this.label.backgroundColor[0],e],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"edit",value:(r=o()(a.a.mark((function e(i){var n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 3:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&this._DialogObject.close(),!i){e.next=62;break}return o=function(){var e=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];e.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];for(var i=function(i){var o=document.createElement("div");o.className="tr",o.innerHTML='\n <div class="td">'.concat(i+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var s=o.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.positions[i].lng.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.positions[i].lng.toFixed(8);var l=o.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.positions[i].lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.positions[i].lat.toFixed(8);var h=o.getElementsByClassName("alt")[0],p=document.createElement("span");p.innerHTML=n.height.toFixed(2),h.appendChild(p);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(n.options.positions[i].lng.toFixed(8)),s.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.positions[i].lng.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){n.options.positions[i].lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.positions[i].lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.positions[i].lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.positions[i].lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.positions[i].lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.positions[i].lat.toFixed(8),n.height=n.height})),h.addEventListener("dblclick",(function(){2!=n.heightMode&&(h.innerHTML="",d.value=Number(n.height.toFixed(2)),h.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),h.innerHTML="",h.appendChild(p)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),p.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(p),n._elms.altInput.push(d),e.appendChild(o)},o=0;o<n.options.positions.length;o++)i(o)},e.next=10,new pn(this.sdk,this.options,{title:"箭头属性",left:"180px",top:"100px",confirmCallBack:function(e){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.options.label.position={lng:w.label.position[0],lat:w.label.position[1],alt:w.label.position[2]},w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){var e=w.options.spreadState;w.positionEditing=!1,setTimeout((function(){w.options.spreadState=e,w.reset()}),10),w.Dialog.closeCallBack&&w.Dialog.closeCallBack()},showCallBack:function(e){w.options.show=e,w.originalOptions.show=e,w.show=e,w.Dialog.showCallBack&&w.Dialog.showCallBack()},translationalCallBack:function(){w.positionEditing=!w.positionEditing},secondaryEditCallBack:function(){t.nodeEdit(w,(function(){o()}))}});case 10:if(this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" attackArrow",(s=document.createElement("div")).innerHTML=ju(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new En("attack-arrow-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){w.color=e},clear:function(){w.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){w.lineColor=e},clear:function(){w.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelColor=e},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelLineColor=e},clear:function(){w.labelLineColor="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelBackgroundColorStart=e},clear:function(){w.labelBackgroundColorStart="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelBackgroundColorEnd=e},clear:function(){w.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),t.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[h],this._elms.labelBackgroundColorEnd=[p],m=this._DialogObject._element.content.getElementsByClassName("height-box")[0],f=m.getElementsByClassName("height")[0],v=this._DialogObject._element.content.getElementsByClassName("height-confirm")[0],f.value=10,2==this.heightMode?(m&&(m.className="input-number input-number-unit-1 height-box disabled"),v&&v.setAttribute("disabled","disabled")):(m&&(m.className="input-number input-number-unit-1 height-box"),v&&v.removeAttribute("disabled")),g=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],!(y=q(this._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){e.next=59;break}y.legp_search(g),b=this._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],C=0;case 43:if(!(C<g.length)){e.next=51;break}if(g[C].key!=this.heightMode){e.next=48;break}return b.value=g[C].value,y.legp_searchActive(g[C].value),e.abrupt("break",51);case 48:C++,e.next=43;break;case 51:b.addEventListener("input",(function(){for(var e=0;e<g.length;e++)if(g[e].value===b.value){w.heightMode=g[e].key;break}})),f.addEventListener("input",(function(){w.heightMode})),this._elms.height=f,this._elms.heightBox=m,this._elms.heightMode=b,this._elms.heightConfirm=v,this._elms.heightModeObject=y,v.addEventListener("click",(function(){w.operate.positionEditing?(w.positionEditing=!1,w.height=w.height+Number(f.value)):(t.closeNodeEdit(w),w.heightMode=w.heightMode,setTimeout((function(){w.height=w.height+Number(f.value)}),100))}));case 59:setTimeout((function(){w.attributeLink=w.options.attribute.link.content,w.attributeVr=w.options.attribute.vr.content,w.cameraSelect&&w.cameraSelect(),w.goodsSelect&&w.goodsSelect();var e=w.attributeSelect,t=w._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(t){var i=q(t,".attribute-select");i.legp_search(e);for(var n=w._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<e.length;s++)if(e[s].key===w.options.attributeType){n.value=e[s].value,i.legp_searchActive(e[s].value);break}n.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===n.value){w.attributeType=e[t].key;break}}))}var a=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],r=q(w._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=w._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];l.value=w.options["area-unit"];for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var e=0;e<a.length;e++)if(a[e].value===l.value){w.areaUnit=a[e].value;break}}))}var u=Un(),h=q(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(h){h.legp_search(u);var p=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];p.value=u[w.labelFontFamily].value;for(var d=0;d<u.length;d++)if(u[d].value==p.value){h.legp_searchActive(u[d].value);break}p.addEventListener("input",(function(){for(var e=0;e<u.length;e++)if(u[e].value===p.value){w.labelFontFamily=u[e].key;break}})),w._elms.labelFontFamily=[p]}o()}),0),e.next=63;break;case 62:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 63:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"reset",value:function(){var e=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineColor=this.originalOptions.line.color,this.lineWidth=this.originalOptions.line.width,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1];for(var t=0;t<this.options.positions.length;t++)this._elms.lng&&this._elms.lng[t]&&(this._elms.lng[t].innerHTML=this.options.positions[t].lng.toFixed(8)),this._elms.lat&&this._elms.lat[t]&&(this._elms.lat[t].innerHTML=this.options.positions[t].lat.toFixed(8)),this._elms.alt&&this._elms.alt[t]&&(this._elms.alt[t].innerHTML=Number(this.options.height.toFixed(2)));this.heightMode=this.heightMode;for(var i=0;i<this.nodePoints.length;i++)this.sdk.viewer.entities.remove(this.nodePoints[i]);this.previous=null,this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy();var n=this.options.spreadState;this.removeAnimate(),setTimeout((function(){e.loop=e.options.loop,e.spreadState=n,Mt(e.sdk,e.options.id),at(e.sdk,e.options.id)}),200)}}},{key:"remove",value:(s=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.removeAnimate(),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.entity&&this.sdk.viewer.entities.remove(this.entity),this.label&&this.label.remove(),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=9,this.sdk.removeIncetance(this.options.id);case 9:return e.next=11,Mt(this.sdk,this.options.id);case 11:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=v.length>0&&void 0!==v[0]?v[0]:{},!this._error){e.next=3;break}return e.abrupt("return");case 3:if(pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Hu({},this.options.position):this.options.positions?l=Hu({},this.options.positions[0]):this.options.center?l=Hu({},this.options.center):this.options.start?l=Hu({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(l);case 17:l.alt=e.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=51;break;case 25:c=[],e.t0=this.heightMode,e.next=0===e.t0||"0"===e.t0?29:1===e.t0||"1"===e.t0?31:2===e.t0||"2"===e.t0?33:35;break;case 29:case 31:return u=!1,e.abrupt("break",35);case 33:return u=!0,e.abrupt("break",35);case 35:if(!u){e.next=48;break}h=0;case 37:if(!(h<this.options.positions.length)){e.next=46;break}return e.next=40,this.getClampToHeight(this.options.positions[h]);case 40:p=e.sent,d=Cesium.Cartesian3.fromDegrees(this.options.positions[h].lng,this.options.positions[h].lat,p),c.push(d.x,d.y,d.z);case 43:h++,e.next=37;break;case 46:e.next=49;break;case 48:if(this.positionsH)for(m=0;m<this.positionsH.length;m++)c.push(this.positionsH[m].x,this.positionsH[m].y,this.positionsH[m].z);case 49:f=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(f,{offset:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 51:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){this.removeAnimate();var i=this;if(this.event&&this.event.destroy(),this.event=new K(this.sdk),this.operate.positionEditing=e,!0===e){var n;this.previous={positions:A()(this.positions)},this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;for(var o=[],s=A()(this.positions),a=[],r=0;r<s.length;r++){var l=this.cartesian3Towgs84(s[r],this.sdk.viewer);o.push([l.lng,l.lat])}var c=this.cartesian3Towgs84(s[0],this.sdk.viewer);o.push([c.lng,c.lat]);for(var u=turf.polygon([o]),h=turf.centroid(u),p=(n=Cesium.Cartesian3).fromDegrees.apply(n,A()(h.geometry.coordinates)),d=0;d<s.length;d++)p.x,s[d].x,a.push({x:p.x-s[d].x,y:p.y-s[d].y,z:p.z-s[d].z});var m=[];this.event.mouse_move((function(e,i){m=[];for(var n=0;n<a.length;n++)m.push({x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z});t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,i){t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),m=[];for(var n=0;n<a.length;n++){var o={x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z};m.push(o),t.options.positions[n]=t.cartesian3Towgs84(o,t.sdk.viewer),t._elms.lng&&t._elms.lng[n]&&(t._elms.lng[n].innerHTML=t.options.positions[n].lng.toFixed(8)),t._elms.lat&&t._elms.lat[n]&&(t._elms.lat[n].innerHTML=t.options.positions[n].lat.toFixed(8))}t.positions=m,t.previous={positions:A()(t.positions)},t.positionEditing=!1,t._positionEditingCallback&&(t._positionEditingCallback(),t._positionEditingCallback=null)})),this.event.mouse_right((function(e,i){t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.positionEditing=!1;else{t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),m=[];for(var e=0;e<a.length;e++){var o={x:i.x-a[e].x,y:i.y-a[e].y,z:i.z-a[e].z};m.push(o),t.options.positions[e]=t.cartesian3Towgs84(o,t.sdk.viewer),t._elms.lng&&t._elms.lng[e]&&(t._elms.lng[e].innerHTML=t.options.positions[e].lng.toFixed(8)),t._elms.lat&&t._elms.lat[e]&&(t._elms.lat[e].innerHTML=t.options.positions[e].lat.toFixed(8))}t.positions=m,t.previous={positions:A()(t.positions)},t.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var e=[];if(m.length>0)for(var t=0;t<m.length;t++)e.push(i.cartesian3Towgs84(m[t],i.sdk.viewer));else for(var n=0;n<s.length;n++)e.push(i.cartesian3Towgs84(s[n],i.sdk.viewer));return i.renewPositions(e),new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}else{this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.previous?this.positions=A()(this.previous.positions):this.previous={positions:A()(this.positions)};for(var f=[],v=0;v<this.positions.length;v++)f.push(i.cartesian3Towgs84(this.positions[v],i.sdk.viewer));i.renewPositions(f),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!0)}}}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"areaChangeCallBack",get:function(){return this._areaChangeCallBack},set:function(e){this._areaChangeCallBack=e}},{key:"nodeEdit",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};this.positionEditing=!1,setTimeout((function(){if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var i=function(){var e=o()(a.a.mark((function e(){var t,i,n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=A()(r.sdk.viewer.entities.values),i=0;case 2:if(!(i<r.options.positions.length)){e.next=11;break}return e.next=5,r.getClampToHeight(r.options.positions[i],t);case 5:n=e.sent,o=r.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:i,position:Cesium.Cartesian3.fromDegrees(r.options.positions[i].lng,r.options.positions[i].lat,n),billboard:{image:r.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),r.nodePoints.push(o);case 8:i++,e.next=2;break;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e.removeAnimate(),YJ.Measure.SetMeasureStatus(!0);var n,s,r=e;e.event&&e.event.destroy(),e.tip&&e.tip.destroy(),e.tip=new Q("请选择一个顶点,右键取消",e.sdk),e.event=new K(e.sdk),e.nodePoints=[];var l=function(t,i){n&&(e.options.positions[n.index]=e.cartesian3Towgs84(i,e.sdk.viewer),e.renewPositions()),e.tip.setPosition(i,t.position?t.position.x:t.endPosition.x,t.position?t.position.y:t.endPosition.y)},c=function(i,o){if(l(i,o),n){e.options.positions[n.index]=e.cartesian3Towgs84(o,e.sdk.viewer);var a=n.index;n.index===e.options.positions.length-1&&(a+=1);var r=e.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:a,position:Cesium.Cartesian3.fromDegrees(e.options.positions[n.index].lng,e.options.positions[n.index].lat,e.options.positions[n.index].alt),billboard:{image:e.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});n=r,s=e.options.positions[n.index],e.nodePoints.splice(n.index,0,r),a<e.options.positions.length?(n=null,e.tip.set_text("请选择一个顶点,右键取消")):(e.options.positions.splice(n.index,0,e.options.positions[n.index]),e.options.positions[n.index]=e.cartesian3Towgs84(o,e.sdk.viewer)),e.renewPositions(),t("",A()(e.options.positions))}else{var c=e.sdk.viewer.scene.pick(i.position||i.endPosition);c&&c.id&&c.id.name&&"node-secondary-edit-point"===c.id.name&&(n=c.id,s=e.cartesian3Towgs84(c.id.position.getValue(),e.sdk.viewer),e.nodePoints.splice(c.id.index,1),e.sdk.viewer.entities.remove(c.id),e.tip.set_text("左键确认,右键结束,CTRL+右键撤销"))}},u=function(t,i){e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),n&&(s?(e.options.positions[n.index]=s,e.options.positions.length>3&&n.index===e.options.positions.length-1&&e.options.positions.splice(n.index+1,1)):e.options.positions.pop(),e._elms.lng&&e._elms.lng[n.index]&&(e._elms.lng[n.index].innerHTML=e.options.positions[n.index].lng.toFixed(8)),e._elms.lat&&e._elms.lat[n.index]&&(e._elms.lat[n.index].innerHTML=e.options.positions[n.index].lat.toFixed(8))),e.heightMode=e.heightMode,e.previous=null};e.entity.polyline.clampToGround=!0,e.entity.polyline.arcType=Cesium.ArcType.GEODESIC,e.entity.polygon.perPositionHeight=!1,e.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(r.positionsH)}),!1),e.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(r.positionsH),[r.positionsH[0],r.positionsH[1]])}),!1);for(var h=[[]],p=[],d=0;d<e.positionsH.length;d++){var m=e.cartesian3Towgs84(e.positionsH[d],e.sdk.viewer);p.push(m),h[0].push([m.lng,m.lat])}var f=e.cartesian3Towgs84(e.positionsH[0],e.sdk.viewer);h[0].push([f.lng,f.lat]);var v=turf.polygon(h),g=turf.pointOnFeature(v),y=A()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:g.geometry.coordinates[0],lat:g.geometry.coordinates[1]},y).then((function(t){e.label.position=[g.geometry.coordinates[0],g.geometry.coordinates[1],t]})),setTimeout((function(){e.event.mouse_left(c),e.event.mouse_right(u),e.event.mouse_move(l),e.event.mouse_right_keyboard_ctrl((function(t,i){n&&(e.options.positions.pop(),e.sdk.viewer.entities.remove(e.nodePoints[e.nodePoints.length-1]),e.nodePoints.pop(),n.index&&n.index===e.options.positions.length&&(e.nodePoints[n.index-1]?n=e.nodePoints[n.index-1]:n.index=n.index-1),e.renewPositions())})),e.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){var e=new Date,o={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};e-n>=500?u():c(o,i)}))})),i()}),200)}}),0)}},{key:"closeNodeEdit",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=null;for(var e=0;e<this.nodePoints.length;e++)this.sdk.viewer.entities.remove(this.nodePoints[e]);this.nodePoints=[],this.picking=!0}},{key:"setPosition",value:function(e){for(var t,i=Cesium.Cartesian3.fromDegrees(e.position.lng,e.position.lat,e.position.alt),n=A()(this.positions),o=[],s=[],a=0;a<n.length;a++){var r=this.cartesian3Towgs84(n[a],this.sdk.viewer);o.push([r.lng,r.lat])}var l=this.cartesian3Towgs84(n[0],this.sdk.viewer);o.push([l.lng,l.lat]);for(var c=turf.polygon([o]),u=turf.centroid(c),h=(t=Cesium.Cartesian3).fromDegrees.apply(t,A()(u.geometry.coordinates)),p=0;p<n.length;p++)s.push({x:h.x-n[p].x,y:h.y-n[p].y,z:h.z-n[p].z});for(var d=[],m=0;m<s.length;m++)d.push({x:i.x-s[m].x,y:i.y-s[m].y,z:i.z-s[m].z});this.label.position=[e.position.lng,e.position.lat,e.position.alt];var f=[];if(d.length>0)for(var v=0;v<d.length;v++)f.push(this.cartesian3Towgs84(d[v],this.sdk.viewer));var g=this.computeAttackArrow(f);0!=g.length&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(g)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return g.length>=3?[].concat(A()(g),[g[0],g[1]]):A()(g)}),!1))}},{key:"setDIV",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};t.x=t.x||0===t.x?t.x:10,t.y=t.y||0===t.y?t.y:10;var i=this.computeAttackArrow(this.options.positions);if(0!=i.length){for(var n=[[]],o=0;o<i.length;o++){var s=this.cartesian3Towgs84(i[o],this.sdk.viewer);n[0].push([s.lng,s.lat])}var a=this.cartesian3Towgs84(i[0],this.sdk.viewer);n[0].push([a.lng,a.lat]);var r=turf.polygon(n),l=turf.pointOnFeature(r),c=document.getElementById(t.domid),u=Cesium.Cartesian3.fromDegrees(l.geometry.coordinates[0],l.geometry.coordinates[1]);this.sdk.viewer.scene.postRender.addEventListener((function(i){if("block"===c.style.display||""===c.style.display){var n=e.sdk.viewer.scene.cartesianToCanvasCoordinates(u);n&&(c.style.left=(n.x+t.x).toFixed(0)+"px",c.style.top=(n.y+t.y).toFixed(0)+"px")}}))}}},{key:"spreadTime",get:function(){return this.options.spreadTime},set:function(e){var t=Number(e);isNaN(t)?t=3e3:t<500?t=500:t>9999999&&(t=9999999),this.options.spreadTime=t,this.spreadState&&this.setSpreadProgressByTime(),this._elms.spreadTime&&this._elms.spreadTime.forEach((function(e){e.value=t}))}},{key:"loop",get:function(){return this.options.loop},set:function(e){this.options.loop=e,this.TweenAnimate&&(e?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat()),this._elms.loop&&this._elms.loop.forEach((function(t){t.checked=e}))}},{key:"spreadState",get:function(){return this.options.spreadState},set:function(e){this.options.spreadState=e,this.TweenAnimate?e?(this.lineEdit=!1,this.setSpreadProgressByTime(this.TweenAnimate._object.distance/this.TweenAnimate._valuesEnd.distance*this.spreadTime)):this.TweenAnimate.pause():e&&this.setSpreadProgressByTime(),this._elms.spreadState&&this._elms.spreadState.forEach((function(t){t.checked=e}))}},{key:"setSpreadProgressByTime",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.entity){for(var i=this,n=0;n<this.nodePoints.length;n++)this.sdk.viewer.entities.remove(this.nodePoints[n]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy();i.computeAttackArrow(i.options.positions);this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null);var s,r=rt(),l=r.sdkP,c=r.sdkD;if(c&&l&&this.sdk===c)(s=l.entityMap.get(this.options.id))&&s.entity&&s.entity.polygon&&s.positionsH&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(s.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(s.positionsH),[s.positionsH[0],s.positionsH[1]])}),!1));else{for(var u=[[(i.options.positions[0].lng+i.options.positions[1].lng)/2,(i.options.positions[0].lat+i.options.positions[1].lat)/2]],h=2;h<i.options.positions.length;h++)u.push([i.options.positions[h].lng,i.options.positions[h].lat]);for(var p=turf.lineString(u),d=[],m=1;m<u.length;m++){var f=turf.point(u[m]),v=turf.point(u[m-1]),g=turf.distance(f,v,{units:"kilometers"}),y=d[d.length-1]||0;d.push(y+g)}var b=turf.length(p,{units:"kilometers"}),C=t/this.spreadTime;this.TweenAnimate=new TWEEN.Tween({distance:b*C}).to({distance:b},this.spreadTime-t).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){t&&e.setSpreadProgressByTime()})).onUpdate(function(){var t=o()(a.a.mark((function t(i,n){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.TweenAnimate._duration!=1/0){t.next=2;break}return t.abrupt("return");case 2:if(e.sdk.viewer){t.next=6;break}return e.removeAnimate(),t.abrupt("return");case 6:w(i);case 7:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}()).onStart((function(){e.options.spreadState=!0,e._elms.spreadState&&e._elms.spreadState.forEach((function(e){e.checked=!0}))})).onComplete((function(t){e.removeAnimate()})),this.spreadState?this.TweenAnimate.start():w({distance:b*C}),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}}function w(e){return k.apply(this,arguments)}function k(){return(k=o()(a.a.mark((function e(t){var n,o,s,r,l,c;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.show){e.next=2;break}return e.abrupt("return");case 2:n=2,o=d.length-2;case 4:if(!(o>=0)){e.next=12;break}if(!(t.distance>=d[o])){e.next=9;break}return(n=n+o+1)>i.options.positions.length-1&&(n=i.options.positions.length-1),e.abrupt("break",12);case 9:o--,e.next=4;break;case 12:for(s=[],r=0;r<n;r++)s[r]=Hu({},i.options.positions[r]);if(t.distance){e.next=18;break}s[n]={lng:s[1].lng,lat:s[1].lat},e.next=25;break;case 18:return e.next=20,turf.lineSliceAlong(p,0,t.distance,{units:"kilometers"});case 20:l=e.sent,c=A()(l.geometry.coordinates[l.geometry.coordinates.length-1]),s[n]||(s[n]={}),s[n].lng=c[0],s[n].lat=c[1];case 25:i.renewPositions(s);case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}}},{key:"removeAnimate",value:function(){this.spreadState=!1,this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null,this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positionsH),this.entity.polyline.positions=[].concat(A()(this.positionsH),[this.positionsH[0],this.positionsH[1]]))}},{key:"renewPositions",value:function(e){var t=this;if(!this._error&&this.sdk.viewer){var i=!1,n=this.options.positions;e&&(n=e);for(var o=[],s=0;s<n.length;s++)o.push(n[s].lng,n[s].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(o);var a=this.computeAttackArrow(n);if(0!=a.length){for(var r=[[]],l=[],c=0;c<a.length;c++){var u=this.cartesian3Towgs84(a[c],this.sdk.viewer);l.push(u),r[0].push([u.lng,u.lat])}var h=this.cartesian3Towgs84(a[0],this.sdk.viewer);r[0].push([h.lng,h.lat]);var p=0,d=turf.polygon(r),m=turf.pointOnFeature(d);switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:p=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(m.geometry.coordinates[0],m.geometry.coordinates[1]))||0,i=!1;break;case"2":case 2:i=!0}var f=[];if(i||0!=this.nodePoints.length)this.positionsH=a,setTimeout((function(){if(t.sdk.viewer){var e=A()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:m.geometry.coordinates[0],lat:m.geometry.coordinates[1]},e).then((function(e){t.label&&(t.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],e])}))}}),100);else{for(var v=0;v<r[0].length;v++)f.push(r[0][v][0],r[0][v][1],this.height+p);this.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(f),this.label&&(this.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],this.height+p])}return this.spreadState||(this.areaByMeter=this.computeArea(l),this.areaChangeCallBack&&this.areaChangeCallBack()),o}}}}],[{key:"create",value:function(e){for(var i=e.options.positions,n=[],o=0;o<i.length;o++)n.push(i[o].lng,i[o].lat);e.positions=Cesium.Cartesian3.fromDegreesArray(n);var s=e.computeAttackArrow(e.options.positions);if(0!=s.length){for(var a=[[]],r=0;r<s.length;r++){var l=e.cartesian3Towgs84(s[r],e.sdk.viewer);a[0].push([l.lng,l.lat])}var c=e.cartesian3Towgs84(s[0],e.sdk.viewer);a[0].push([c.lng,c.lat]);var u,h=turf.polygon(a),p=turf.pointOnFeature(h),d=0;switch(e.options.heightMode){case"0":case 0:u=!1;break;case"1":case 1:d=e.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(p.geometry.coordinates[0],p.geometry.coordinates[1]))||0,u=!1;break;case"2":case 2:u=!0}e.options.label.position={lng:p.geometry.coordinates[0],lat:p.geometry.coordinates[1],alt:e.height+d};for(var m=[],f=0;f<a[0].length;f++)m.push(a[0][f][0],a[0][f][1],e.height+d);var v=Cesium.Color.fromCssColorString(e.options.color);2===e.sdk.viewer.scene.mode&&(u=!1,v=new Cesium.CustomColorMaterialSource({color:e.options.color})),e.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(m),e.entity=e.sdk.viewer.entities.add({show:e.options.show,id:e.options.id,polygon:{hierarchy:u?new Cesium.PolygonHierarchy(s):new Cesium.PolygonHierarchy(e.positionsH),perPositionHeight:!u,material:v,zIndex:e.sdk._entityZIndex},polyline:{positions:[].concat(A()(e.positionsH),[e.positionsH[0],e.positionsH[1]]),width:e.options.line.width,material:Cesium.Color.fromCssColorString(e.options.line.color),clampToGround:!!u,arcType:u?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:e.sdk._entityZIndex}}),e.sdk._entityZIndex++,t.createLabel(e);for(var g=[],y=0;y<s.length;y++)g.push(e.cartesian3Towgs84(s[y],e.sdk.viewer));e.areaByMeter=e.computeArea(g),e.areaChangeCallBack&&e.areaChangeCallBack(),Mt(e.sdk,e.options.id),e.options.show&&Qe(0,e.options.id),e.spreadState=e.options.spreadState}}},{key:"createLabel",value:(i=o()(a.a.mark((function e(t){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.label=new Xn(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.label.position.lng,t.options.label.position.lat,t.options.label.position.alt],text:t.options.name,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far});case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"EventBinding",value:function(e,t){for(var i=function(){var i=[],o=!1,s=[];if(!t[n]||!t[n].attributes)return 1;var a,r=Ru(t[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==t[n].type?(i.push((function(t){e[r.value]=t.target.checked})),t[n].checked=e[r.value]):(i.push((function(t){var i=t.target.value;"number"==t.target.type?"."==t.data||"-"==t.data&&!t.target.value||(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),e[r.value]=i):e[r.value]=i})),"IMG"==t[n].nodeName?t[n].src=e[r.value]:t[n].value=e[r.value]),e._elms[r.value]?e._elms[r.value].push(t[n]):e._elms[r.value]=[t[n]],s.push(r.name);break;case"@click":t[n].addEventListener("click",(function(t){"function"==typeof e[r.value]&&e[r.value](t)})),s.push(r.name);break;case"@change":o=!0,i.push((function(t){var i=t.target.value;"number"==t.target.type&&""!=i&&(i=Number(i),t.target.value=i),"function"==typeof e[r.value]&&e[r.value](t,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(e){r.e(e)}finally{r.f()}for(var c=0;c<s.length;c++)t[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==t[n].tagName&&"checkbox"!=t[n].type||(u="change"),-1!==t[n].className.indexOf("blur")&&(u="blur"),t[n].addEventListener(u,(function(e){for(var t=0;t<i.length;t++)i[t](e)}))}},n=0;n<t.length;n++)i()}}]);var i,n,s,r}(Vn);function Wu(e){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">动画时长</span>\n <div class="input-number input-number-unit-3">\n <input class="input blur" type="number" title="" min="500" max="9999999" @model="spreadTime">\n <span class="unit">ms</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col">\n <span class="label">动画</span>\n <input class="btn-switch" type="checkbox" @model="spreadState">\n </div>\n <div class="col">\n <span class="label">动画重复</span>\n <input class="btn-switch" type="checkbox" @model="loop">\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="pincer-arrow-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Uu(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 Yu(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Uu(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Uu(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Ju(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var qu=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,t),(i=Ju(this,t,[e,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#ff000080",i.options.show=!n.show&&!1!==n.show||n.show,i.options.positions=n.positions||[],i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options.height=n.height,i.options.loop=n.loop||!1,i.options.spreadState=n.spreadState||!1,i._elms={},i.nodePoints=[],i.spreadTime=n.spreadTime,i.entity,i.event,i.operate={},i.Dialog=o,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],delete i.options.attribute.camera,delete i.options.attribute.vr,delete i.options.attribute.goods,i.options.richTextContent=n.richTextContent||"",!i.options.positions||i.options.positions.length<5)i._error="双箭头最少需要五个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{if(!i.options.height&&0!==i.options.height){for(var s=i.options.positions[0].alt,a=1;a<i.options.positions.length;a++)s<i.options.positions[a].alt&&(s=i.options.positions[a].alt);i.options.height=s}i.sdk.addIncetance(i.options.id,i),t.create(i)}return i}return un()(t,e),x()(t,[{key:"type",get:function(){return"PincerArrowObject"}},{key:"name",get:function(){return this.options.name},set:function(e){this.options.name=e,this.label.text=e,this._elms.name&&this._elms.name.forEach((function(t){t.value=e}))}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;if(this.options.color=e||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,0,0,0.5)"}});t._elms.color[i]=n}))}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(e){var t=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(t.options.heightMode=e||0==e?e:2,t.positionEditing=!1,t.entity){var i="";t.closeNodeEdit();var n=!1,o=!1;switch(t.renewPositions(),t.entity.polyline.positions=[].concat(A()(t.positionsH),[t.positionsH[0],t.positionsH[1]]),t.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(t.positionsH),t.options.heightMode){case"0":case 0:i="海拔高度";break;case"1":case 1:i="相对地表";break;case"2":case 2:n=!0,o=!0,i="依附模型"}t.label.ground=n,t.entity.polyline.clampToGround=n,t.entity.polyline.arcType=n?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,t.entity.polygon.perPositionHeight=!n,t._elms.heightMode&&(t._elms.heightMode.value=i),t._elms.heightModeObject&&t._elms.heightModeObject.legp_searchActive(i),o?(t._elms.heightBox&&(t._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),t._elms.heightConfirm&&t._elms.heightConfirm.setAttribute("disabled","disabled")):(t._elms.heightBox&&(t._elms.heightBox.className="input-number input-number-unit-1 height-box"),t._elms.heightConfirm&&t._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.height},set:function(e){var t,i=this;!e||isNaN(Number(e))?this.options.height=0:this.options.height=Number(Number(e).toFixed(2)),t=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.entity.polygon.perPositionHeight=!t,i.entity.polyline.positions=[].concat(A()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polyline.clampToGround=!!t,i.entity.polyline.arcType=t?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(e){e.innerHTML=i.options.height}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(e){var t=this;this.options.line.color=e||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.lineColor=e},clear:function(){t.lineColor="rgba(255,0,0,0.5)"}});t._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(e){var t=this;this.options.line.width=e||0===e?e:3,this.entity.polyline.width=this.options.line.width,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(e){e.value=t.options.line.width}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){this.options.label.show=e,this.show&&!this.showView||3==this.showView?this.label.show=e:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label.color=e,this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label.fontSize=e,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label.scaleByDistance=e,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(e){this.options.label.lineWidth=e,this.label.lineWidth=e,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(t){t.value=e}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(e){this.options.label.pixelOffset=e,this.label.pixelOffset=e,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(t){t.value=e}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(e){var t=this;this.options.label.lineColor=e,this.label.lineColor=e,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelLineColor=e},clear:function(){t.labelLineColor="rgba(0,255,255,0.5)"}});t._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label.backgroundColor=[e,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label.backgroundColor=[this.label.backgroundColor[0],e],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"edit",value:(r=o()(a.a.mark((function e(i){var n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 3:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){e.next=62;break}return o=function(){var e=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];e.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];for(var i=function(i){var o=document.createElement("div");o.className="tr",o.innerHTML='\n <div class="td">'.concat(i+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var s=o.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.positions[i].lng.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.positions[i].lng.toFixed(8);var l=o.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.positions[i].lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.positions[i].lat.toFixed(8);var h=o.getElementsByClassName("alt")[0],p=document.createElement("span");p.innerHTML=n.height.toFixed(2),h.appendChild(p);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(n.options.positions[i].lng.toFixed(8)),s.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.positions[i].lng.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){n.options.positions[i].lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.positions[i].lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.positions[i].lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.positions[i].lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.positions[i].lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.positions[i].lat.toFixed(8),n.height=n.height})),h.addEventListener("dblclick",(function(){2!=n.heightMode&&(h.innerHTML="",d.value=Number(n.height.toFixed(2)),h.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),h.innerHTML="",h.appendChild(p)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),p.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(p),n._elms.altInput.push(d),e.appendChild(o)},o=0;o<n.options.positions.length;o++)i(o)},e.next=10,new pn(this.sdk,this.options,{title:"双箭头属性",left:"180px",top:"100px",confirmCallBack:function(e){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.options.label.position={lng:w.label.position[0],lat:w.label.position[1],alt:w.label.position[2]},w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){var e=w.options.spreadState;w.positionEditing=!1,setTimeout((function(){w.options.spreadState=e,w.reset()}),10),w.Dialog.closeCallBack&&w.Dialog.closeCallBack()},showCallBack:function(e){w.options.show=e,w.originalOptions.show=e,w.show=e,w.Dialog.showCallBack&&w.Dialog.showCallBack()},translationalCallBack:function(){w.positionEditing=!w.positionEditing},secondaryEditCallBack:function(){t.nodeEdit(w,(function(){o()}))}});case 10:if(this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" pincerArrow",(s=document.createElement("div")).innerHTML=Wu(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new En("pincer-arrow-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){w.color=e},clear:function(){w.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){w.lineColor=e},clear:function(){w.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelColor=e},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelLineColor=e},clear:function(){w.labelLineColor="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelBackgroundColorStart=e},clear:function(){w.labelBackgroundColorStart="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelBackgroundColorEnd=e},clear:function(){w.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),t.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[h],this._elms.labelBackgroundColorEnd=[p],m=this._DialogObject._element.content.getElementsByClassName("height-box")[0],f=m.getElementsByClassName("height")[0],v=this._DialogObject._element.content.getElementsByClassName("height-confirm")[0],f.value=10,2==this.heightMode?(m&&(m.className="input-number input-number-unit-1 height-box disabled"),v&&v.setAttribute("disabled","disabled")):(m&&(m.className="input-number input-number-unit-1 height-box"),v&&v.removeAttribute("disabled")),g=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],!(y=q(this._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){e.next=59;break}y.legp_search(g),b=this._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],C=0;case 43:if(!(C<g.length)){e.next=51;break}if(g[C].key!=this.heightMode){e.next=48;break}return b.value=g[C].value,y.legp_searchActive(g[C].value),e.abrupt("break",51);case 48:C++,e.next=43;break;case 51:b.addEventListener("input",(function(){for(var e=0;e<g.length;e++)if(g[e].value===b.value){w.heightMode=g[e].key;break}})),f.addEventListener("input",(function(){w.heightMode})),this._elms.height=f,this._elms.heightBox=m,this._elms.heightMode=b,this._elms.heightConfirm=v,this._elms.heightModeObject=y,v.addEventListener("click",(function(){w.operate.positionEditing?(w.positionEditing=!1,w.height=w.height+Number(f.value)):(t.closeNodeEdit(w),w.heightMode=w.heightMode,setTimeout((function(){w.height=w.height+Number(f.value)}),100))}));case 59:setTimeout((function(){w.attributeLink=w.options.attribute.link.content,w.attributeVr=w.options.attribute.vr.content,w.cameraSelect&&w.cameraSelect(),w.goodsSelect&&w.goodsSelect();var e=w.attributeSelect,t=w._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(t){var i=q(t,".attribute-select");i.legp_search(e);for(var n=w._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<e.length;s++)if(e[s].key===w.options.attributeType){n.value=e[s].value,i.legp_searchActive(e[s].value);break}n.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===n.value){w.attributeType=e[t].key;break}}))}var a=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],r=q(w._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=w._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];l.value=w.options["area-unit"];for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var e=0;e<a.length;e++)if(a[e].value===l.value){w.areaUnit=a[e].value;break}}))}var u=Un(),h=q(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(h){h.legp_search(u);var p=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];p.value=u[w.labelFontFamily].value;for(var d=0;d<u.length;d++)if(u[d].value==p.value){h.legp_searchActive(u[d].value);break}p.addEventListener("input",(function(){for(var e=0;e<u.length;e++)if(u[e].value===p.value){w.labelFontFamily=u[e].key;break}})),w._elms.labelFontFamily=[p]}o()}),0),e.next=63;break;case 62:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 63:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"reset",value:function(){var e=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineColor=this.originalOptions.line.color,this.lineWidth=this.originalOptions.line.width,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1];for(var t=0;t<this.options.positions.length;t++)this._elms.lng&&this._elms.lng[t]&&(this._elms.lng[t].innerHTML=this.options.positions[t].lng.toFixed(8)),this._elms.lat&&this._elms.lat[t]&&(this._elms.lat[t].innerHTML=this.options.positions[t].lat.toFixed(8)),this._elms.alt&&this._elms.alt[t]&&(this._elms.alt[t].innerHTML=Number(this.options.height.toFixed(2)));this.heightMode=this.heightMode;for(var i=0;i<this.nodePoints.length;i++)this.sdk.viewer.entities.remove(this.nodePoints[i]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy();var n=this.options.spreadState;this.removeAnimate(),setTimeout((function(){e.loop=e.options.loop,e.spreadState=n,Mt(e.sdk,e.options.id),at(e.sdk,e.options.id)}),200),setTimeout((function(){e.previous=null}),50)}}},{key:"remove",value:(s=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.removeAnimate(),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label&&this.label.remove(),this.entity&&this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=9,this.sdk.removeIncetance(this.options.id);case 9:return e.next=11,Mt(this.sdk,this.options.id);case 11:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=v.length>0&&void 0!==v[0]?v[0]:{},!this._error){e.next=3;break}return e.abrupt("return");case 3:if(pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Yu({},this.options.position):this.options.positions?l=Yu({},this.options.positions[0]):this.options.center?l=Yu({},this.options.center):this.options.start?l=Yu({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(l);case 17:l.alt=e.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=51;break;case 25:c=[],e.t0=this.heightMode,e.next=0===e.t0||"0"===e.t0?29:1===e.t0||"1"===e.t0?31:2===e.t0||"2"===e.t0?33:35;break;case 29:case 31:return u=!1,e.abrupt("break",35);case 33:return u=!0,e.abrupt("break",35);case 35:if(!u){e.next=48;break}h=0;case 37:if(!(h<this.options.positions.length)){e.next=46;break}return e.next=40,this.getClampToHeight(this.options.positions[h]);case 40:p=e.sent,d=Cesium.Cartesian3.fromDegrees(this.options.positions[h].lng,this.options.positions[h].lat,p),c.push(d.x,d.y,d.z);case 43:h++,e.next=37;break;case 46:e.next=49;break;case 48:if(this.positionsH)for(m=0;m<this.positionsH.length;m++)c.push(this.positionsH[m].x,this.positionsH[m].y,this.positionsH[m].z);case 49:f=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(f,{offset:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 51:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(e){var t=this;Bn.open(this.options.id,this.options.name,this.options.richTextContent),Bn.primaryCallBack=function(e){t.options.richTextContent=e}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){this.removeAnimate();var i=this;if(this.event&&this.event.destroy(),this.event=new K(this.sdk),this.operate.positionEditing=e,!0===e){var n;this.previous={positions:A()(this.positions)},this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;for(var o=[],s=A()(this.positions),a=[],r=0;r<s.length;r++){var l=this.cartesian3Towgs84(s[r],this.sdk.viewer);o.push([l.lng,l.lat])}var c=this.cartesian3Towgs84(s[0],this.sdk.viewer);o.push([c.lng,c.lat]);for(var u=turf.polygon([o]),h=turf.centroid(u),p=(n=Cesium.Cartesian3).fromDegrees.apply(n,A()(h.geometry.coordinates)),d=0;d<s.length;d++)p.x,s[d].x,a.push({x:p.x-s[d].x,y:p.y-s[d].y,z:p.z-s[d].z});var m=[];this.event.mouse_move((function(e,i){m=[];for(var n=0;n<a.length;n++)m.push({x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z});t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,i){t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),m=[];for(var n=0;n<a.length;n++){var o={x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z};m.push(o),t.options.positions[n]=t.cartesian3Towgs84(o,t.sdk.viewer),t._elms.lng&&t._elms.lng[n]&&(t._elms.lng[n].innerHTML=t.options.positions[n].lng.toFixed(8)),t._elms.lat&&t._elms.lat[n]&&(t._elms.lat[n].innerHTML=t.options.positions[n].lat.toFixed(8))}t.positions=m,t.previous={positions:A()(t.positions)},t.positionEditing=!1,t._positionEditingCallback&&(t._positionEditingCallback(),t._positionEditingCallback=null)})),this.event.mouse_right((function(e,i){t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.positionEditing=!1;else{t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),m=[];for(var e=0;e<a.length;e++){var o={x:i.x-a[e].x,y:i.y-a[e].y,z:i.z-a[e].z};m.push(o),t.options.positions[e]=t.cartesian3Towgs84(o,t.sdk.viewer),t._elms.lng&&t._elms.lng[e]&&(t._elms.lng[e].innerHTML=t.options.positions[e].lng.toFixed(8)),t._elms.lat&&t._elms.lat[e]&&(t._elms.lat[e].innerHTML=t.options.positions[e].lat.toFixed(8))}t.positions=m,t.previous={positions:A()(t.positions)},t.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var e=[];if(m.length>0)for(var t=0;t<m.length;t++)e.push(i.cartesian3Towgs84(m[t],i.sdk.viewer));else for(var n=0;n<s.length;n++)e.push(i.cartesian3Towgs84(s[n],i.sdk.viewer));return i.renewPositions(e),new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}else{this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.previous?this.positions=A()(this.previous.positions):this.previous={positions:A()(this.positions)};for(var f=[],v=0;v<this.positions.length;v++)f.push(this.cartesian3Towgs84(this.positions[v],this.sdk.viewer));this.renewPositions(f),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!0)}}}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"areaChangeCallBack",get:function(){return this._areaChangeCallBack},set:function(e){this._areaChangeCallBack=e}},{key:"nodeEdit",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};this.positionEditing=!1,setTimeout((function(){if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var i=function(){var e=o()(a.a.mark((function e(){var t,i,n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=A()(r.sdk.viewer.entities.values),i=0;case 2:if(!(i<l.length)){e.next=11;break}return e.next=5,r.getClampToHeight(r.options.positions[i],t);case 5:n=e.sent,o=r.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:i,position:Cesium.Cartesian3.fromDegrees(l[i].lng,l[i].lat,n),billboard:{image:r.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),r.nodePoints.push(o);case 8:i++,e.next=2;break;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e.removeAnimate();var n,s,r=e;YJ.Measure.SetMeasureStatus(!0),e.tip=new Q("请选择一个顶点,右键取消",e.sdk),e.event=new K(e.sdk),e.nodePoints=[];var l=A()(e.options.positions),c=function(t,i){if(n){e.options.positions[n.index]=e.cartesian3Towgs84(i,e.sdk.viewer),l[n.index]=e.options.positions[n.index];var o=n.index,a=e.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:o,position:Cesium.Cartesian3.fromDegrees(l[n.index].lng,l[n.index].lat,l[n.index].alt),billboard:{image:e.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});e.nodePoints.splice(n.index,0,a),n=null,e.tip.set_text("请选择一个顶点,右键取消")}else{var r=e.sdk.viewer.scene.pick(t.position);r&&r.id&&r.id.name&&"node-secondary-edit-point"===r.id.name&&(n=r.id,s=e.cartesian3Towgs84(r.id.position.getValue(),e.sdk.viewer),e.nodePoints.splice(r.id.index,1),e.sdk.viewer.entities.remove(r.id),e.tip.set_text("左键确定,右键取消"))}e.renewPositions(),e.tip.setPosition(i,t.position.x,t.position.y)},u=function(){e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),n&&(l[n.index]=s,e._elms.lng&&e._elms.lng[n.index]&&(e._elms.lng[n.index].innerHTML=e.options.positions[n.index].lng.toFixed(8)),e._elms.lat&&e._elms.lat[n.index]&&(e._elms.lat[n.index].innerHTML=e.options.positions[n.index].lat.toFixed(8)),t(null,l)),e.options.positions=A()(l),e.heightMode=e.heightMode,e.previous=null};e.entity.polyline.clampToGround=!0,e.entity.polyline.arcType=Cesium.ArcType.GEODESIC,e.entity.polygon.perPositionHeight=!1,e.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(r.positionsH)}),!1),e.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(r.positionsH),[r.positionsH[0],r.positionsH[1]])}),!1),setTimeout((function(){e.event.mouse_left(c),e.event.mouse_right(u),e.event.mouse_move((function(t,i){n&&(e.options.positions[n.index]=e.cartesian3Towgs84(i,e.sdk.viewer),e.renewPositions()),e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),e.event.gesture_pinck_start((function(t,i){var n=new Date,o={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};e.event.gesture_pinck_end((function(){new Date-n>=500?u():c(o,i)}))}));for(var t=[[]],o=[],s=0;s<e.positionsH.length;s++){var a=e.cartesian3Towgs84(e.positionsH[s],e.sdk.viewer);o.push(a),t[0].push([a.lng,a.lat])}var r=e.cartesian3Towgs84(e.positionsH[0],e.sdk.viewer);t[0].push([r.lng,r.lat]);var l=turf.polygon(t),h=turf.pointOnFeature(l),p=A()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:h.geometry.coordinates[0],lat:h.geometry.coordinates[1]},p).then((function(t){e.label.position=[h.geometry.coordinates[0],h.geometry.coordinates[1],t]})),i()}),200)}}),0)}},{key:"closeNodeEdit",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=null;for(var e=0;e<this.nodePoints.length;e++)this.sdk.viewer.entities.remove(this.nodePoints[e]);this.nodePoints=[],this.picking=!0}},{key:"setPosition",value:function(e){for(var t,i=Cesium.Cartesian3.fromDegrees(e.position.lng,e.position.lat,e.position.alt),n=A()(this.positions),o=[],s=[],a=0;a<n.length;a++){var r=this.cartesian3Towgs84(n[a],this.sdk.viewer);o.push([r.lng,r.lat])}var l=this.cartesian3Towgs84(n[0],this.sdk.viewer);o.push([l.lng,l.lat]);for(var c=turf.polygon([o]),u=turf.centroid(c),h=(t=Cesium.Cartesian3).fromDegrees.apply(t,A()(u.geometry.coordinates)),p=0;p<n.length;p++)s.push({x:h.x-n[p].x,y:h.y-n[p].y,z:h.z-n[p].z});for(var d=[],m=0;m<s.length;m++)d.push({x:i.x-s[m].x,y:i.y-s[m].y,z:i.z-s[m].z});this.label.position=[e.position.lng,e.position.lat,e.position.alt];var f=[];if(d.length>0)for(var v=0;v<d.length;v++)f.push(this.cartesian3Towgs84(d[v],this.sdk.viewer));var g=this.computePincerArrow(f);0!=g.length&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(g)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return g.length>=3?[].concat(A()(g),[g[0],g[1]]):A()(g)}),!1))}},{key:"setDIV",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};t.x=t.x||0===t.x?t.x:10,t.y=t.y||0===t.y?t.y:10;var i=this.computePincerArrow(this.options.positions);if(0!=i.length){for(var n=[[]],o=0;o<i.length;o++){var s=this.cartesian3Towgs84(i[o],this.sdk.viewer);n[0].push([s.lng,s.lat])}var a=this.cartesian3Towgs84(i[0],this.sdk.viewer);n[0].push([a.lng,a.lat]);var r=turf.polygon(n),l=turf.pointOnFeature(r),c=document.getElementById(t.domid),u=Cesium.Cartesian3.fromDegrees(l.geometry.coordinates[0],l.geometry.coordinates[1]);this.sdk.viewer.scene.postRender.addEventListener((function(i){if("block"===c.style.display||""===c.style.display){var n=e.sdk.viewer.scene.cartesianToCanvasCoordinates(u);n&&(c.style.left=(n.x+t.x).toFixed(0)+"px",c.style.top=(n.y+t.y).toFixed(0)+"px")}}))}}},{key:"spreadTime",get:function(){return this.options.spreadTime},set:function(e){var t=Number(e);isNaN(t)?t=3e3:t<500?t=500:t>9999999&&(t=9999999),this.options.spreadTime=t,this.spreadState&&this.setSpreadProgressByTime(),this._elms.spreadTime&&this._elms.spreadTime.forEach((function(e){e.value=t}))}},{key:"loop",get:function(){return this.options.loop},set:function(e){this.options.loop=e,this.TweenAnimate&&(e?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat()),this._elms.loop&&this._elms.loop.forEach((function(t){t.checked=e}))}},{key:"spreadState",get:function(){return this.options.spreadState},set:function(e){this.options.spreadState=e,this.TweenAnimate?e?(this.lineEdit=!1,this.setSpreadProgressByTime(this.TweenAnimate._object.distance1/this.TweenAnimate._valuesEnd.distance1*this.spreadTime)):this.TweenAnimate.pause():e&&this.setSpreadProgressByTime(),this._elms.spreadState&&this._elms.spreadState.forEach((function(t){t.checked=e}))}},{key:"setSpreadProgressByTime",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.entity){for(var i=this,n=0;n<this.nodePoints.length;n++)this.sdk.viewer.entities.remove(this.nodePoints[n]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy();var s=this.computePincerArrow(this.options.positions);if(0!=s.length){this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null);var r,l=rt(),c=l.sdkP,u=l.sdkD;if(u&&c&&this.sdk===u)(r=c.entityMap.get(this.options.id))&&r.entity&&r.entity.polygon&&r.positionsH&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(r.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(r.positionsH),[r.positionsH[0],r.positionsH[1]])}),!1));else{for(var h=[],p=[],d=[],m=[],f=0;f<=2;f++)m.push([this.options.positions[f].lng,this.options.positions[f].lat]);m.push([this.options.positions[0].lng,this.options.positions[0].lat]);for(var v=turf.lineString(m),g=turf.booleanClockwise(v),y=0;y<=100;y++){var b=this.cartesian3Towgs84(s[y],this.sdk.viewer);h.push([b.lng,b.lat,b.alt])}g?h.push([this.options.positions[3].lng,this.options.positions[3].lat,this.options.positions[3].alt]):h.push([this.options.positions[2].lng,this.options.positions[2].lat,this.options.positions[2].alt]);for(var C=312;C>=212;C--){var w=this.cartesian3Towgs84(s[C],this.sdk.viewer);p.push([w.lng,w.lat,w.alt])}g?p.push([this.options.positions[2].lng,this.options.positions[2].lat,this.options.positions[2].alt]):p.push([this.options.positions[3].lng,this.options.positions[3].lat,this.options.positions[3].alt]),d.push([(this.options.positions[0].lng+this.options.positions[1].lng)/2,(this.options.positions[0].lat+this.options.positions[1].lat)/2],[this.options.positions[4].lng,this.options.positions[4].lat]);var k=this.deepCopyObj(this.options.positions),_=turf.lineString(h),x=turf.length(_,{units:"kilometers"}),E=turf.lineString(p),S=turf.length(E,{units:"kilometers"}),P=turf.lineString(d),D=turf.length(P,{units:"kilometers"}),M=t/this.spreadTime;this.TweenAnimate=new TWEEN.Tween({distance1:x*M,distance2:S*M,distance3:D*M}).to({distance1:x,distance2:S,distance3:D},this.spreadTime-t).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){t&&e.setSpreadProgressByTime()})).onUpdate(function(){var t=o()(a.a.mark((function t(i,n){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.TweenAnimate._duration!=1/0){t.next=2;break}return t.abrupt("return");case 2:if(e.sdk.viewer){t.next=6;break}return e.removeAnimate(),t.abrupt("return");case 6:T(i);case 7:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}()).onStart((function(){e.options.spreadState=!0,e._elms.spreadState&&e._elms.spreadState.forEach((function(e){e.checked=!0}))})).onComplete((function(t){e.removeAnimate()})),this.spreadState?this.TweenAnimate.start():T({distance1:x*M,distance2:S*M,distance3:D*M}),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}}}function T(e){return O.apply(this,arguments)}function O(){return(O=o()(a.a.mark((function e(t){var n,o,s,r,l,c,u,h;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.show){e.next=2;break}return e.abrupt("return");case 2:if(n=2,o=3,g&&(n=3,o=2),t.distance1){e.next=10;break}k[n].lng=k[1].lng,k[n].lat=k[1].lat,e.next=16;break;case 10:return e.next=12,turf.lineSliceAlong(_,0,t.distance1,{units:"kilometers"});case 12:s=e.sent,r=A()(s.geometry.coordinates[s.geometry.coordinates.length-1]),k[n].lng=r[0],k[n].lat=r[1];case 16:if(t.distance2){e.next=21;break}k[o].lng=k[0].lng,k[3].lat=k[0].lat,e.next=27;break;case 21:return e.next=23,turf.lineSliceAlong(E,0,t.distance2,{units:"kilometers"});case 23:l=e.sent,c=A()(l.geometry.coordinates[l.geometry.coordinates.length-1]),k[o].lng=c[0],k[o].lat=c[1];case 27:if(t.distance3){e.next=32;break}k[4].lng=d[0][0],k[4].lat=d[0][1],e.next=38;break;case 32:return e.next=34,turf.lineSliceAlong(P,0,t.distance3,{units:"kilometers"});case 34:u=e.sent,h=A()(u.geometry.coordinates[u.geometry.coordinates.length-1]),k[4].lng=h[0],k[4].lat=h[1];case 38:i.renewPositions(k);case 39:case"end":return e.stop()}}),e)})))).apply(this,arguments)}}},{key:"removeAnimate",value:function(){this.spreadState=!1,this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null,this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positionsH),this.entity.polyline.positions=[].concat(A()(this.positionsH),[this.positionsH[0],this.positionsH[1]]))}},{key:"renewPositions",value:function(e){var t=this;if(!this._error&&this.sdk.viewer){var i=!1,n=this.options.positions;e&&(n=e);for(var o=[],s=0;s<n.length;s++)o.push(n[s].lng,n[s].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(o);var a=this.computePincerArrow(n);if(0!=a.length){for(var r=[[]],l=[],c=0;c<a.length;c++){var u=this.cartesian3Towgs84(a[c],this.sdk.viewer);l.push(u),r[0].push([u.lng,u.lat])}var h=this.cartesian3Towgs84(a[0],this.sdk.viewer);r[0].push([h.lng,h.lat]);var p=0,d=turf.polygon(r),m=turf.pointOnFeature(d);switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:p=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(m.geometry.coordinates[0],m.geometry.coordinates[1]))||0,i=!1;break;case"2":case 2:i=!0}var f=[];if(i||0!=this.nodePoints.length)this.positionsH=a,setTimeout((function(){if(t.sdk.viewer){var e=A()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:m.geometry.coordinates[0],lat:m.geometry.coordinates[1]},e).then((function(e){t.label&&(t.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],e])}))}}),100);else{for(var v=0;v<r[0].length;v++)f.push(r[0][v][0],r[0][v][1],this.height+p);this.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(f),this.label&&(this.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],this.height+p])}return this.spreadState||(this.areaByMeter=this.computeArea(l),this.areaChangeCallBack&&this.areaChangeCallBack()),o}}}}],[{key:"create",value:function(e){for(var i=e.options.positions,n=[],o=0;o<i.length;o++)n.push(i[o].lng,i[o].lat);e.positions=Cesium.Cartesian3.fromDegreesArray(n);var s=e.computePincerArrow(e.options.positions);if(0!=s.length){for(var a=[[]],r=0;r<s.length;r++){var l=e.cartesian3Towgs84(s[r],e.sdk.viewer);a[0].push([l.lng,l.lat])}var c=e.cartesian3Towgs84(s[0],e.sdk.viewer);a[0].push([c.lng,c.lat]);var u,h=turf.polygon(a),p=turf.pointOnFeature(h),d=0;switch(e.options.heightMode){case"0":case 0:u=!1;break;case"1":case 1:d=e.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(p.geometry.coordinates[0],p.geometry.coordinates[1]))||0,u=!1;break;case"2":case 2:u=!0}e.options.label.position={lng:p.geometry.coordinates[0],lat:p.geometry.coordinates[1],alt:e.height+d};for(var m=[],f=0;f<a[0].length;f++)m.push(a[0][f][0],a[0][f][1],e.height+d);var v=Cesium.Color.fromCssColorString(e.options.color);2===e.sdk.viewer.scene.mode&&(u=!1,v=new Cesium.CustomColorMaterialSource({color:e.options.color})),e.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(m),e.entity=e.sdk.viewer.entities.add({id:e.options.id,show:e.options.show,polygon:{hierarchy:u?new Cesium.PolygonHierarchy(s):new Cesium.PolygonHierarchy(e.positionsH),perPositionHeight:!u,material:v,zIndex:e.sdk._entityZIndex},polyline:{positions:[].concat(A()(e.positionsH),[e.positionsH[0],e.positionsH[1]]),width:e.options.line.width,material:Cesium.Color.fromCssColorString(e.options.line.color),clampToGround:!!u,arcType:u?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:e.sdk._entityZIndex}}),e.sdk._entityZIndex++,t.createLabel(e);for(var g=[],y=0;y<s.length;y++)g.push(e.cartesian3Towgs84(s[y],e.sdk.viewer));e.areaByMeter=e.computeArea(g),e.areaChangeCallBack&&e.areaChangeCallBack(),Mt(e.sdk,e.options.id),e.options.show&&Qe(0,e.options.id),e.spreadState=e.options.spreadState}}},{key:"createLabel",value:(i=o()(a.a.mark((function e(t){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.label=new Xn(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.label.position.lng,t.options.label.position.lat,t.options.label.position.alt],text:t.options.name,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far});case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}]);var i,n,s,r}(Vn);function Xu(e){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">动画时长</span>\n <div class="input-number input-number-unit-3">\n <input class="input blur" type="number" title="" min="500" max="9999999" @model="spreadTime">\n <span class="unit">ms</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col">\n <span class="label">动画</span>\n <input class="btn-switch" type="checkbox" @model="spreadState">\n </div>\n <div class="col">\n <span class="label">动画重复</span>\n <input class="btn-switch" type="checkbox" @model="loop">\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="assemble-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Zu(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 Ku(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Zu(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Zu(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Qu(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return $u(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)?$u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function $u(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 eh(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var th=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,t),(i=eh(this,t,[e,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#ff000080",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.positions=n.positions||[],i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",i.entity,i.event=new K(i.sdk),i.operate={},i._elms={},i.Dialog=o,i.options.loop=n.loop||!1,i.options.spreadState=n.spreadState||!1,i.spreadTime=n.spreadTime,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.options.richTextContent=n.richTextContent||"",i.nodePoints=[],!i.options.positions||i.options.positions.length<2)i._error="直线箭头需要两个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{if(!i.options.height&&0!==i.options.height){for(var s=i.options.positions[0].alt,a=1;a<i.options.positions.length;a++)s<i.options.positions[a].alt&&(s=i.options.positions[a].alt);i.options.height=s}i.sdk.addIncetance(i.options.id,i),t.create(i)}return i}return un()(t,e),x()(t,[{key:"type",get:function(){return"StraightArrowObject"}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;if(this.options.color=e||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,255,255,1)"}});t._elms.color[i]=n}))}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(e){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=e||0==e?e:2,i.positionEditing=!1,i.entity){var n="";t.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(A()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.height},set:function(e){var t,i=this;!e||isNaN(Number(e))?this.options.height=0:this.options.height=Number(Number(e).toFixed(2)),t=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.entity.polygon.perPositionHeight=!t,i.entity.polyline.positions=[].concat(A()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polyline.clampToGround=!!t,i.entity.polyline.arcType=t?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(e){e.innerHTML=i.options.height}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(e){var t=this;this.options.line.color=e,this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(e),this._elms.lineColor&&this._elms.lineColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.lineColor=e},clear:function(){t.lineColor="rgba(255,255,255,1)"}});t._elms.lineColor[n]=o})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(e){this.options.line.width=e,this.entity.polyline.width=e,this._elms.lineColor&&this._elms.lineColor.forEach((function(t){t.value=e}))}},{key:"area",get:function(){return this.options.area},set:function(e){this.options.area=e,this._elms.area&&this._elms.area.forEach((function(t){t.value=e}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(e){if(this.options["area-unit"]=e,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(t){t.value=e})),this.options.areaByMeter||0==this.options.areaByMeter)switch(e){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){this.options.label.show=e,this.show&&!this.showView||3==this.showView?this.label.show=e:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label.color=e,this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label.fontSize=e,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label.scaleByDistance=e,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(e){this.options.label.lineWidth=e,this.label.lineWidth=e,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(t){t.value=e}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(e){this.options.label.pixelOffset=e,this.label.pixelOffset=e,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(t){t.value=e}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(e){var t=this;this.options.label.lineColor=e,this.label.lineColor=e,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelLineColor=e},clear:function(){t.labelLineColor="rgba(0,255,255,0.5)"}});t._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label.backgroundColor=[e,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label.backgroundColor=[this.label.backgroundColor[0],e],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(e){this.options.attributeType=e,this._elms.attributeType&&this._elms.attributeType.forEach((function(t){t.value=e}));for(var t=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<t.length;i++)t[i].className.indexOf("attribute-content-"+e)>-1?t[i].style.display="block":t[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(e){var t=this;if(this.options.attribute.link.content=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),h={linkEdit:(c=o()(a.a.mark((function e(i){var n,o,s,r,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.options.attribute.link.content;case 2:t.attributeLink=e.sent,n=t._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function e(n){var o,r,l,c,u,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==n){e.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){e.next=35;break}if(l[c]&&l[c].attributes){e.next=14;break}return e.abrupt("continue",32);case 14:u=Qu(l[c].attributes),e.prev=15,d=a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("@click"!==(t=p.value).name){e.next=5;break}return l[c].addEventListener("click",(function(e){"function"==typeof h[t.value]&&h[t.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(t.name),e.abrupt("return",1);case 5:case"end":return e.stop()}}),e)})),u.s();case 18:if((p=u.n()).done){e.next=24;break}return e.delegateYield(d(),"t0",20);case 20:if(!e.t0){e.next=22;break}return e.abrupt("break",24);case 22:e.next=18;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(15),u.e(e.t1);case 29:return e.prev=29,u.f(),e.finish(29);case 32:c++,e.next=11;break;case 35:return e.abrupt("return",1);case 36:case"end":return e.stop()}}),e,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){e.next=15;break}return e.delegateYield(r(l),"t0",10);case 10:if(!e.t0){e.next=12;break}return e.abrupt("break",15);case 12:l++,e.next=8;break;case 15:case"end":return e.stop()}}),e)}))),function(e){return c.apply(this,arguments)}),linkDelete:function(e){t.options.attribute.link.content.splice(e,1),t.attributeLink=t.options.attribute.link.content},confirmEdit:function(e,i){var n=e.name&&e.name.replace(/\s/g,""),o=e.url&&e.url.replace(/\s/g,"");n&&o?t.options.attribute.link.content[i]=e:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),t.attributeLink=t.options.attribute.link.content},cancelEdit:function(){t.attributeLink=t.options.attribute.link.content},fileSelect:function(e,t){var i=u[t].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",p),i.addEventListener("change",p)}},p=function(e){e.target.value&&(u[e.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=e.target.value,e.target.value=null)},d=function(e){for(var t=u[e].getElementsByTagName("button"),i=0;i<t.length;i++)if(t[i]&&t[i].attributes){var n,o=Qu(t[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return t[i].addEventListener("click",(function(t){"function"==typeof h[o.value]&&h[o.value](e)})),t[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(e){o.e(e)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(e){this.options.attribute.camera.content=e}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(e){var t=this;if(this.options.attribute.vr.content=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),h={vrEdit:(c=o()(a.a.mark((function e(i){var n,o,s,r,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.options.attribute.vr.content;case 2:t.attributeVr=e.sent,n=t._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function e(n){var o,r,l,c,u,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==n){e.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=t.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=t.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){e.next=35;break}if(l[c]&&l[c].attributes){e.next=14;break}return e.abrupt("continue",32);case 14:u=Qu(l[c].attributes),e.prev=15,d=a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("@click"!==(t=p.value).name){e.next=5;break}return l[c].addEventListener("click",(function(e){"function"==typeof h[t.value]&&h[t.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(t.name),e.abrupt("return",1);case 5:case"end":return e.stop()}}),e)})),u.s();case 18:if((p=u.n()).done){e.next=24;break}return e.delegateYield(d(),"t0",20);case 20:if(!e.t0){e.next=22;break}return e.abrupt("break",24);case 22:e.next=18;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(15),u.e(e.t1);case 29:return e.prev=29,u.f(),e.finish(29);case 32:c++,e.next=11;break;case 35:return e.abrupt("return",1);case 36:case"end":return e.stop()}}),e,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){e.next=15;break}return e.delegateYield(r(l),"t0",10);case 10:if(!e.t0){e.next=12;break}return e.abrupt("break",15);case 12:l++,e.next=8;break;case 15:case"end":return e.stop()}}),e)}))),function(e){return c.apply(this,arguments)}),vrDelete:function(e){t.options.attribute.vr.content.splice(e,1),t.attributeVr=t.options.attribute.vr.content},confirmEdit:function(e,i){var n=e.name&&e.name.replace(/\s/g,""),o=e.url&&e.url.replace(/\s/g,"");n&&o?t.options.attribute.vr.content[i]=e:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),t.attributeVr=t.options.attribute.vr.content},cancelEdit:function(){t.attributeVr=t.options.attribute.vr.content},fileSelect:function(e,t){var i=u[t].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",p),i.addEventListener("change",p)}},p=function(e){e.target.value&&(u[e.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=e.target.value,e.target.value=null)},d=function(e){for(var t=u[e].getElementsByTagName("button"),i=0;i<t.length;i++)if(t[i]&&t[i].attributes){var n,o=Qu(t[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return t[i].addEventListener("click",(function(t){"function"==typeof h[o.value]&&h[o.value](e)})),t[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(e){o.e(e)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(e){this.options.attribute.goods.content=e}},{key:"edit",value:(r=o()(a.a.mark((function e(i){var n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._error){e.next=2;break}return e.abrupt("return");case 2:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){e.next=61;break}return o=function(){var e=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];e.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];for(var i=function(i){var o=document.createElement("div");o.className="tr",o.innerHTML='\n <div class="td">'.concat(i+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var s=o.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.positions[i].lng.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.positions[i].lng.toFixed(8);var l=o.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.positions[i].lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.positions[i].lat.toFixed(8);var h=o.getElementsByClassName("alt")[0],p=document.createElement("span");p.innerHTML=n.height.toFixed(2),h.appendChild(p);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(n.options.positions[i].lng.toFixed(8)),s.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.positions[i].lng.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){n.options.positions[i].lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.positions[i].lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.positions[i].lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.positions[i].lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.positions[i].lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.positions[i].lat.toFixed(8),n.height=n.height})),h.addEventListener("dblclick",(function(){2!=n.heightMode&&(h.innerHTML="",d.value=Number(n.height.toFixed(2)),h.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),h.innerHTML="",h.appendChild(p)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),p.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(p),n._elms.altInput.push(d),e.appendChild(o)},o=0;o<n.options.positions.length;o++)i(o)},e.next=9,new pn(this.sdk,this.options,{title:"直线箭头属性",left:"180px",top:"100px",confirmCallBack:function(e){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.options.label.position={lng:w.label.position[0],lat:w.label.position[1],alt:w.label.position[2]},w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){var e=w.options.spreadState;w.positionEditing=!1,setTimeout((function(){w.options.spreadState=e,w.reset()}),10),w.Dialog.closeCallBack&&w.Dialog.closeCallBack()},showCallBack:function(e){w.options.show=e,w.originalOptions.show=e,w.show=e,w.Dialog.showCallBack&&w.Dialog.showCallBack()},translationalCallBack:function(){w.positionEditing=!w.positionEditing},secondaryEditCallBack:function(){t.nodeEdit(w,(function(){o()}))}});case 9:if(this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" assemble",(s=document.createElement("div")).innerHTML=Xu(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new En("assemble-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){w.color=e},clear:function(){w.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){w.lineColor=e},clear:function(){w.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelColor=e},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelLineColor=e},clear:function(){w.labelLineColor="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelBackgroundColorStart=e},clear:function(){w.labelBackgroundColorStart="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelBackgroundColorEnd=e},clear:function(){w.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),t.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[h],this._elms.labelBackgroundColorEnd=[p],m=this._DialogObject._element.content.getElementsByClassName("height-box")[0],f=m.getElementsByClassName("height")[0],v=this._DialogObject._element.content.getElementsByClassName("height-confirm")[0],f.value=10,2==this.heightMode?(m&&(m.className="input-number input-number-unit-1 height-box disabled"),v&&v.setAttribute("disabled","disabled")):(m&&(m.className="input-number input-number-unit-1 height-box"),v&&v.removeAttribute("disabled")),g=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],!(y=q(this._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){e.next=58;break}y.legp_search(g),b=this._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],C=0;case 42:if(!(C<g.length)){e.next=50;break}if(g[C].key!=this.heightMode){e.next=47;break}return b.value=g[C].value,y.legp_searchActive(g[C].value),e.abrupt("break",50);case 47:C++,e.next=42;break;case 50:b.addEventListener("input",(function(){for(var e=0;e<g.length;e++)if(g[e].value===b.value){w.heightMode=g[e].key;break}})),f.addEventListener("input",(function(){w.heightMode})),this._elms.height=f,this._elms.heightBox=m,this._elms.heightMode=b,this._elms.heightConfirm=v,this._elms.heightModeObject=y,v.addEventListener("click",(function(){w.operate.positionEditing?(w.positionEditing=!1,w.height=w.height+Number(f.value)):(t.closeNodeEdit(w),w.heightMode=w.heightMode,setTimeout((function(){w.height=w.height+Number(f.value)}),100))}));case 58:setTimeout((function(){w.attributeLink=w.options.attribute.link.content,w.attributeVr=w.options.attribute.vr.content,w.cameraSelect&&w.cameraSelect(),w.goodsSelect&&w.goodsSelect();var e=w.attributeSelect,t=w._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(t){var i=q(t,".attribute-select");i.legp_search(e);for(var n=w._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<e.length;s++)if(e[s].key===w.options.attributeType){n.value=e[s].value,i.legp_searchActive(e[s].value);break}n.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===n.value){w.attributeType=e[t].key;break}}))}o();var a=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],r=q(w._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=w._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];l.value=w.options["area-unit"];for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var e=0;e<a.length;e++)if(a[e].value===l.value){w.areaUnit=a[e].value;break}}))}var u=Un(),h=q(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(h){h.legp_search(u);var p=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];p.value=u[w.labelFontFamily].value;for(var d=0;d<u.length;d++)if(u[d].value==p.value){h.legp_searchActive(u[d].value);break}p.addEventListener("input",(function(){for(var e=0;e<u.length;e++)if(u[e].value===p.value){w.labelFontFamily=u[e].key;break}})),w._elms.labelFontFamily=[p]}}),0),e.next=62;break;case 61:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 62:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"reset",value:function(){var e=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineColor=this.originalOptions.line.color,this.lineWidth=this.originalOptions.line.width,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeVr=this.options.attribute.vr.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect();for(var t=0;t<this.options.positions.length;t++)this._elms.lng&&this._elms.lng[t]&&(this._elms.lng[t].innerHTML=this.options.positions[t].lng.toFixed(8)),this._elms.lat&&this._elms.lat[t]&&(this._elms.lat[t].innerHTML=this.options.positions[t].lat.toFixed(8)),this._elms.alt&&this._elms.alt[t]&&(this._elms.alt[t].innerHTML=Number(this.options.height.toFixed(2)));this.heightMode=this.heightMode;for(var i=0;i<this.nodePoints.length;i++)this.sdk.viewer.entities.remove(this.nodePoints[i]);this.previous=null,this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy();var n=this.options.spreadState;this.removeAnimate(),setTimeout((function(){e.loop=e.options.loop,e.spreadState=n,Mt(e.sdk,e.options.id),at(e.sdk,e.options.id)}),200)}}},{key:"remove",value:(s=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.removeAnimate(),this.sdk.viewer.entities.remove(this.entity),this.label&&this.label.remove(),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=9,this.sdk.removeIncetance(this.options.id);case 9:return e.next=11,Mt(this.sdk,this.options.id);case 11:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0]&&this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(e){this.options.attribute.link.content.push({name:"链接",url:e}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(e){this.options.attribute.vr.content.push({name:"全景图",url:e}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=v.length>0&&void 0!==v[0]?v[0]:{},!this._error){e.next=3;break}return e.abrupt("return");case 3:if(pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Ku({},this.options.position):this.options.positions?l=Ku({},this.options.positions[0]):this.options.center?l=Ku({},this.options.center):this.options.start?l=Ku({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(l);case 17:l.alt=e.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=51;break;case 25:c=[],e.t0=this.heightMode,e.next=0===e.t0||"0"===e.t0?29:1===e.t0||"1"===e.t0?31:2===e.t0||"2"===e.t0?33:35;break;case 29:case 31:return u=!1,e.abrupt("break",35);case 33:return u=!0,e.abrupt("break",35);case 35:if(!u){e.next=48;break}h=0;case 37:if(!(h<this.options.positions.length)){e.next=46;break}return e.next=40,this.getClampToHeight(this.options.positions[h]);case 40:p=e.sent,d=Cesium.Cartesian3.fromDegrees(this.options.positions[h].lng,this.options.positions[h].lat,p),c.push(d.x,d.y,d.z);case 43:h++,e.next=37;break;case 46:e.next=49;break;case 48:if(this.positionsH)for(m=0;m<this.positionsH.length;m++)c.push(this.positionsH[m].x,this.positionsH[m].y,this.positionsH[m].z);case 49:f=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(f,{offset:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 51:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(e){var t=this;Bn.open(this.options.id,this.options.name,this.options.richTextContent),Bn.primaryCallBack=function(e){t.options.richTextContent=e}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){this.removeAnimate();var i=this;if(this.event&&this.event.destroy(),this.event=new K(this.sdk),this.operate.positionEditing=e,!0===e){this.previous={positions:A()(this.positions)},this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;for(var n=[],o=A()(this.positions),s=[],a=0;a<o.length;a++){var r=this.cartesian3Towgs84(o[a],this.sdk.viewer);n.push([r.lng,r.lat])}for(var l=Cesium.Cartesian3.fromDegrees((n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2),c=0;c<o.length;c++)l.x,o[c].x,s.push({x:l.x-o[c].x,y:l.y-o[c].y,z:l.z-o[c].z});var u=[];this.event.mouse_move((function(e,i){t.cartesian3Towgs84(i,t.sdk.viewer);u=[];for(var n=0;n<s.length;n++)u.push({x:i.x-s[n].x,y:i.y-s[n].y,z:i.z-s[n].z});t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,i){t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),u=[];for(var n=0;n<s.length;n++){var o={x:i.x-s[n].x,y:i.y-s[n].y,z:i.z-s[n].z};u.push(o),t.options.positions[n]=t.cartesian3Towgs84(o,t.sdk.viewer),t._elms.lng&&t._elms.lng[n]&&(t._elms.lng[n].innerHTML=t.options.positions[n].lng.toFixed(8)),t._elms.lat&&t._elms.lat[n]&&(t._elms.lat[n].innerHTML=t.options.positions[n].lat.toFixed(8))}t.positions=u,t.previous={positions:A()(t.positions)},t.positionEditing=!1})),this.event.mouse_right((function(e,i){t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.positionEditing=!1;else{t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),u=[];for(var e=0;e<s.length;e++){var o={x:i.x-s[e].x,y:i.y-s[e].y,z:i.z-s[e].z};u.push(o),t.options.positions[e]=t.cartesian3Towgs84(o,t.sdk.viewer),t._elms.lng&&t._elms.lng[e]&&(t._elms.lng[e].innerHTML=t.options.positions[e].lng.toFixed(8)),t._elms.lat&&t._elms.lat[e]&&(t._elms.lat[e].innerHTML=t.options.positions[e].lat.toFixed(8))}t.positions=u,t.previous={positions:A()(t.positions)},t.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var e=[];if(u.length>0)for(var t=0;t<u.length;t++)e.push(i.cartesian3Towgs84(u[t],i.sdk.viewer));else for(var n=0;n<o.length;n++)e.push(i.cartesian3Towgs84(o[n],i.sdk.viewer));return i.renewPositions(e),new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}else{this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.previous?this.positions=A()(this.previous.positions):this.previous={positions:A()(this.positions)};for(var h=[],p=0;p<this.positions.length;p++)h.push(i.cartesian3Towgs84(this.positions[p],i.sdk.viewer));this.renewPositions(h),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!0)}}}},{key:"setPosition",value:function(e){for(var t,i=Cesium.Cartesian3.fromDegrees(e.position.lng,e.position.lat,e.position.alt),n=A()(this.positions),o=[],s=[],a=0;a<n.length;a++){var r=this.cartesian3Towgs84(n[a],this.sdk.viewer);o.push([r.lng,r.lat])}var l=this.cartesian3Towgs84(n[0],this.sdk.viewer);o.push([l.lng,l.lat]);for(var c=turf.polygon([o]),u=turf.centroid(c),h=(t=Cesium.Cartesian3).fromDegrees.apply(t,A()(u.geometry.coordinates)),p=0;p<n.length;p++)s.push({x:h.x-n[p].x,y:h.y-n[p].y,z:h.z-n[p].z});for(var d=[],m=0;m<s.length;m++)d.push({x:i.x-s[m].x,y:i.y-s[m].y,z:i.z-s[m].z});this.label.position=[e.position.lng,e.position.lat,e.position.alt];var f=[];if(d.length>0)for(var v=0;v<d.length;v++)f.push(this.cartesian3Towgs84(d[v],this.sdk.viewer));var g=this.computeStraightArrow(f);0!=g.length&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(g)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return g.length>=3?[].concat(A()(g),[g[0],g[1]]):A()(g)}),!1))}},{key:"setDIV",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};t.x=t.x||0===t.x?t.x:10,t.y=t.y||0===t.y?t.y:10;var i=this.computeStraightArrow(this.options.positions);if(0!=i.length){for(var n=[[]],o=0;o<i.length;o++){var s=this.cartesian3Towgs84(i[o],this.sdk.viewer);n[0].push([s.lng,s.lat])}var a=this.cartesian3Towgs84(i[0],this.sdk.viewer);n[0].push([a.lng,a.lat]);var r=turf.polygon(n),l=turf.pointOnFeature(r),c=document.getElementById(t.domid),u=Cesium.Cartesian3.fromDegrees(l.geometry.coordinates[0],l.geometry.coordinates[1]);this.sdk.viewer.scene.postRender.addEventListener((function(i){if("block"===c.style.display||""===c.style.display){var n=e.sdk.viewer.scene.cartesianToCanvasCoordinates(u);n&&(c.style.left=(n.x+t.x).toFixed(0)+"px",c.style.top=(n.y+t.y).toFixed(0)+"px")}}))}}},{key:"spreadTime",get:function(){return this.options.spreadTime},set:function(e){var t=Number(e);isNaN(t)?t=3e3:t<500?t=500:t>9999999&&(t=9999999),this.options.spreadTime=t,this.spreadState&&this.setSpreadProgressByTime(),this._elms.spreadTime&&this._elms.spreadTime.forEach((function(e){e.value=t}))}},{key:"loop",get:function(){return this.options.loop},set:function(e){this.options.loop=e,this.TweenAnimate&&(e?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat()),this._elms.loop&&this._elms.loop.forEach((function(t){t.checked=e}))}},{key:"spreadState",get:function(){return this.options.spreadState},set:function(e){this.options.spreadState=e,this.TweenAnimate?e?(this.lineEdit=!1,this.setSpreadProgressByTime(this.TweenAnimate._object.distance/this.TweenAnimate._valuesEnd.distance*this.spreadTime)):this.TweenAnimate.pause():e&&this.setSpreadProgressByTime(),this._elms.spreadState&&this._elms.spreadState.forEach((function(t){t.checked=e}))}},{key:"setSpreadProgressByTime",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.entity){for(var i=this,n=0;n<this.nodePoints.length;n++)this.sdk.viewer.entities.remove(this.nodePoints[n]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null);var s,r=rt(),l=r.sdkP,c=r.sdkD;if(c&&l&&this.sdk===c)(s=l.entityMap.get(this.options.id))&&s.entity&&s.entity.polygon&&s.positionsH&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(s.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(s.positionsH),[s.positionsH[0],s.positionsH[1]])}),!1));else{for(var u=[],h=0;h<i.options.positions.length;h++)u.push([i.options.positions[h].lng,i.options.positions[h].lat]);for(var p=turf.lineString(u),d=[],m=1;m<u.length;m++){var f=turf.point(u[m]),v=turf.point(u[m-1]),g=turf.distance(f,v,{units:"kilometers"}),y=d[d.length-1]||0;d.push(y+g)}var b=turf.length(p,{units:"kilometers"}),C=t/this.spreadTime;this.TweenAnimate=new TWEEN.Tween({distance:b*C}).to({distance:b},this.spreadTime-t).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){t&&e.setSpreadProgressByTime()})).onUpdate(function(){var t=o()(a.a.mark((function t(i,n){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.TweenAnimate._duration!=1/0){t.next=2;break}return t.abrupt("return");case 2:if(e.sdk.viewer){t.next=6;break}return e.removeAnimate(),t.abrupt("return");case 6:w(i);case 7:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}()).onStart((function(){e.options.spreadState=!0,e._elms.spreadState&&e._elms.spreadState.forEach((function(e){e.checked=!0}))})).onComplete((function(t){e.removeAnimate()})),this.spreadState?this.TweenAnimate.start():w({distance:b*C}),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}}function w(e){return k.apply(this,arguments)}function k(){return(k=o()(a.a.mark((function e(t){var n,o,s,r,l,c;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.show){e.next=2;break}return e.abrupt("return");case 2:n=2,o=d.length-2;case 4:if(!(o>=0)){e.next=12;break}if(!(t.distance>=d[o])){e.next=9;break}return(n=n+o+1)>i.options.positions.length-1&&(n=i.options.positions.length-1),e.abrupt("break",12);case 9:o--,e.next=4;break;case 12:for(s=[],r=0;r<n;r++)s[r]=Ku({},i.options.positions[r]);if(t.distance){e.next=18;break}s[n]={lng:s[1].lng,lat:s[1].lat},e.next=24;break;case 18:return e.next=20,turf.lineSliceAlong(p,0,t.distance,{units:"kilometers"});case 20:l=e.sent,c=A()(l.geometry.coordinates[l.geometry.coordinates.length-1]),s[1].lng=c[0],s[1].lat=c[1];case 24:i.renewPositions(s);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}}},{key:"removeAnimate",value:function(){this.spreadState=!1,this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null,this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positionsH),this.entity.polyline.positions=[].concat(A()(this.positionsH),[this.positionsH[0],this.positionsH[1]]))}},{key:"renewPositions",value:function(e){var t=this;if(!this._error&&this.sdk.viewer){var i=!1,n=this.options.positions;e&&(n=e);for(var o=[],s=0;s<n.length;s++)o.push(n[s].lng,n[s].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(o);var a=this.computeStraightArrow(n);if(0!=a.length){for(var r=[[]],l=[],c=0;c<a.length;c++){var u=this.cartesian3Towgs84(a[c],this.sdk.viewer);l.push(u),r[0].push([u.lng,u.lat])}var h=this.cartesian3Towgs84(a[0],this.sdk.viewer);r[0].push([h.lng,h.lat]);var p=0,d=turf.polygon(r),m=turf.pointOnFeature(d);switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:p=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(m.geometry.coordinates[0],m.geometry.coordinates[1]))||0,i=!1;break;case"2":case 2:i=!0}var f=[];if(i||0!=this.nodePoints.length)this.positionsH=a,setTimeout((function(){if(t.sdk.viewer){var e=A()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:m.geometry.coordinates[0],lat:m.geometry.coordinates[1]},e).then((function(e){t.label&&(t.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],e])}))}}),100);else{for(var v=0;v<r[0].length;v++)f.push(r[0][v][0],r[0][v][1],this.height+p);this.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(f),this.label&&(this.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],this.height+p])}return this.spreadState||(this.options.areaByMeter=this.computeArea(l),this.areaUnit=this.areaUnit),o}}}}],[{key:"create",value:function(e){for(var i=e.options.positions,n=[],o=0;o<i.length;o++)n.push(i[o].lng,i[o].lat);e.positions=Cesium.Cartesian3.fromDegreesArray(n);var s=e.computeStraightArrow(e.options.positions);if(0!=s.length){for(var a=[[]],r=0;r<s.length;r++){var l=e.cartesian3Towgs84(s[r],e.sdk.viewer);a[0].push([l.lng,l.lat])}var c=e.cartesian3Towgs84(s[0],e.sdk.viewer);a[0].push([c.lng,c.lat]);var u,h=turf.polygon(a),p=turf.pointOnFeature(h),d=0;switch(e.options.heightMode){case"0":case 0:u=!1;break;case"1":case 1:d=e.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(p.geometry.coordinates[0],p.geometry.coordinates[1]))||0,u=!1;break;case"2":case 2:u=!0}e.options.label.position||(e.options.label.position={lng:p.geometry.coordinates[0],lat:p.geometry.coordinates[1],alt:e.height+d});for(var m=[],f=0;f<a[0].length;f++)m.push(a[0][f][0],a[0][f][1],e.height+d);var v=Cesium.Color.fromCssColorString(e.options.color);2===e.sdk.viewer.scene.mode&&(u=!1,v=new Cesium.CustomColorMaterialSource({color:e.options.color})),e.options.label.ground=u,e.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(m),e.entity=e.sdk.viewer.entities.add({show:e.options.show,id:e.options.id,polygon:{hierarchy:u?new Cesium.PolygonHierarchy(s):new Cesium.PolygonHierarchy(e.positionsH),perPositionHeight:!u,material:v,zIndex:e.sdk._entityZIndex},polyline:{positions:[].concat(A()(e.positionsH),[e.positionsH[0],e.positionsH[1]]),width:e.options.line.width,material:Cesium.Color.fromCssColorString(e.options.line.color),clampToGround:!!u,arcType:u?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:e.sdk._entityZIndex}}),e.sdk._entityZIndex++,t.createLabel(e);for(var g=[],y=0;y<s.length;y++)g.push(e.cartesian3Towgs84(s[y],e.sdk.viewer));switch(e.options.areaByMeter=e.computeArea(g),e.options["area-unit"]){case"平方米":e.options.area=e.options.areaByMeter;break;case"平方千米":e.options.area=Number((e.options.areaByMeter/1e6).toFixed(8));break;case"亩":e.options.area=Number((e.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":e.options.area=Number((e.options.areaByMeter/1e4).toFixed(6));break;default:e.options.area=e.options.areaByMeter}Mt(e.sdk,e.options.id),e.options.show&&Qe(0,e.options.id),e.spreadState=e.options.spreadState}}},{key:"createLabel",value:(i=o()(a.a.mark((function e(t){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.label=new Xn(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.label.position.lng,t.options.label.position.lat,t.options.label.position.alt],text:t.options.name,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far,ground:t.options.label.ground});case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"EventBinding",value:function(e,t){for(var i=function(){var i=[],o=!1,s=[];if(!t[n]||!t[n].attributes)return 1;var a,r=Qu(t[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==t[n].type?(i.push((function(t){e[r.value]=t.target.checked})),t[n].checked=e[r.value]):(i.push((function(t){var i=t.target.value;"number"==t.target.type?"."==t.data||"-"==t.data&&!t.target.value||(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),e[r.value]=i):e[r.value]=i})),"IMG"==t[n].nodeName?t[n].src=e[r.value]:t[n].value=e[r.value]),e._elms[r.value]?e._elms[r.value].push(t[n]):e._elms[r.value]=[t[n]],s.push(r.name);break;case"@click":t[n].addEventListener("click",(function(t){"function"==typeof e[r.value]&&e[r.value](t)})),s.push(r.name);break;case"@change":o=!0,i.push((function(t){var i=t.target.value;"number"==t.target.type&&""!=i&&(i=Number(i),t.target.value=i),"function"==typeof e[r.value]&&e[r.value](t,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(e){r.e(e)}finally{r.f()}for(var c=0;c<s.length;c++)t[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==t[n].tagName&&"checkbox"!=t[n].type||(u="change"),t[n].addEventListener(u,(function(e){for(var t=0;t<i.length;t++)i[t](e)}))}},n=0;n<t.length;n++)i()}},{key:"nodeEdit",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(e.positionEditing=!1,YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var i,n,s=function(){var t=o()(a.a.mark((function t(){var i,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=A()(e.sdk.viewer.entities.values),n=0;case 2:if(!(n<e.options.positions.length)){t.next=11;break}return t.next=5,e.getClampToHeight(e.options.positions[n],i);case 5:o=t.sent,s=e.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:n,position:Cesium.Cartesian3.fromDegrees(e.options.positions[n].lng,e.options.positions[n].lat,o),billboard:{image:e.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),e.nodePoints.push(s);case 8:n++,t.next=2;break;case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();e.removeAnimate(),YJ.Measure.SetMeasureStatus(!0),e.tip=new Q("请选择一个顶点,右键取消",e.sdk),e.event=new K(e.sdk),e.nodePoints=[];for(var r=[],l=0;l<e.options.positions.length;l++)r.push(e.options.positions[l].lng,e.options.positions[l].lat);var c=function(t,n){i&&(e.options.positions[i.index]=e.cartesian3Towgs84(n,e.sdk.viewer),e._elms.lng&&e._elms.lng[i.index]&&(e._elms.lng[i.index].innerHTML=e.options.positions[i.index].lng.toFixed(8)),e._elms.lat&&e._elms.lat[i.index]&&(e._elms.lat[i.index].innerHTML=e.options.positions[i.index].lat.toFixed(8)),e.renewPositions()),e.tip.setPosition(n,t.position?t.position.x:t.endPosition.x,t.position?t.position.y:t.endPosition.y)},u=function(t,o){c(t,o);var s=e.cartesian3Towgs84(o,e.sdk.viewer);if(i){var a=i.index,r=e.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:a,position:Cesium.Cartesian3.fromDegrees(e.options.positions[i.index].lng,e.options.positions[i.index].lat,s.alt),billboard:{image:e.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});e.nodePoints.splice(i.index,0,r),i=null,e.tip.set_text("请选择一个顶点,右键取消")}else{var l=t.position;l||(l={x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2});var u=e.sdk.viewer.scene.pick(l);u&&u.id&&u.id.name&&"node-secondary-edit-point"===u.id.name&&(i=u.id,n=e.cartesian3Towgs84(u.id.position.getValue(),e.sdk.viewer),e.nodePoints.splice(u.id.index,1),e.sdk.viewer.entities.remove(u.id),e.tip.set_text("左键确认,右键取消"))}e.renewPositions()},h=function(){e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),i&&(n?e.options.positions[i.index]=n:e.options.positions.pop(),e._elms.lng&&e._elms.lng[i.index]&&(e._elms.lng[i.index].innerHTML=e.options.positions[i.index].lng.toFixed(8)),e._elms.lat&&e._elms.lat[i.index]&&(e._elms.lat[i.index].innerHTML=e.options.positions[i.index].lat.toFixed(8))),e.heightMode=e.heightMode,e.previous=null};e.entity.polyline.clampToGround=!0,e.entity.polyline.arcType=Cesium.ArcType.GEODESIC,e.entity.polygon.perPositionHeight=!1,e.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var t=e.computeStraightArrow(e.options.positions);return new Cesium.PolygonHierarchy(t)}),!1),e.entity.polyline.positions=new Cesium.CallbackProperty((function(){var t=e.computeStraightArrow(e.options.positions);return t.length>=3?[].concat(A()(t),[t[0],t[1]]):A()(t)}),!1),setTimeout((function(){e.event.mouse_left(u),e.event.mouse_right(h),e.event.mouse_move(c),e.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){var e=new Date,o={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};e-n>=500?h():u(o,i)}))}));for(var t=[[]],i=[],n=0;n<e.positionsH.length;n++){var o=e.cartesian3Towgs84(e.positionsH[n],e.sdk.viewer);i.push(o),t[0].push([o.lng,o.lat])}var a=e.cartesian3Towgs84(e.positionsH[0],e.sdk.viewer);t[0].push([a.lng,a.lat]);var r=turf.polygon(t),l=turf.pointOnFeature(r),p=A()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:l.geometry.coordinates[0],lat:l.geometry.coordinates[1]},p).then((function(t){e.label.position=[l.geometry.coordinates[0],l.geometry.coordinates[1],t]})),s()}),200)}}},{key:"closeNodeEdit",value:function(e){YJ.Measure.SetMeasureStatus(!1),e.event&&e.event.destroy(),e.tip&&e.tip.destroy(),e.tip=null;for(var t=0;t<e.nodePoints.length;t++)e.sdk.viewer.entities.remove(e.nodePoints[t]);e.nodePoints=[],e.picking=!0}}]);var i,n,s,r}(Vn);function ih(e){return'\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <DIV-cy-tabs id="circle-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ',"\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n ")}function nh(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return oh(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)?oh(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function oh(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 sh(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 ah(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?sh(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):sh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function rh(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var lh=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=rh(this,t,[e,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#ff000080",i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.radius=n.radius||0===n.radius?n.radius:10,i.options.show=!n.show&&!1!==n.show||n.show,i.options.center=n.center||{},i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",n.label=n.label||{},i._elms={},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],delete i.options.attribute.camera,delete i.options.attribute.vr,delete i.options.attribute.goods,i.options.richTextContent=n.richTextContent||"",i.event=new K(i.sdk),i.nodePoints=[],i.operate={},i.Dialog={},i.sdk.addIncetance(i.options.id,i),t.create(i),i}return un()(t,e),x()(t,[{key:"type",get:function(){return"CircleObject"}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(e){var t=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(t.options.heightMode=e||0==e?e:2,t.positionEditing=!1,t.entity){var i="";t.closeNodeEdit();var n=!1,o=!1;switch(t.renewPositions(),t.entity.polyline.positions=[].concat(A()(t.positions),[t.positions[0],t.positions[1]]),t.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(t.positions),t.options.heightMode){case"0":case 0:i="海拔高度";break;case"1":case 1:i="相对地表";break;case"2":case 2:n=!0,o=!0,i="依附模型"}t.label.ground=n,t.entity.polyline.clampToGround=n,t.entity.polyline.arcType=n?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,t.entity.polygon.perPositionHeight=!n,t._elms.heightMode&&(t._elms.heightMode.value=i),t._elms.heightModeObject&&t._elms.heightModeObject.legp_searchActive(i),o?(t._elms.heightBox&&(t._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),t._elms.heightConfirm&&t._elms.heightConfirm.setAttribute("disabled","disabled")):(t._elms.heightBox&&(t._elms.heightBox.className="input-number input-number-unit-1 height-box"),t._elms.heightConfirm&&t._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.center.alt},set:function(e){var t,i=this;!e||isNaN(Number(e))?this.options.center.alt=0:this.options.center.alt=Number(Number(e).toFixed(2)),t=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.entity.polygon.perPositionHeight=!t,i.entity.polyline.positions=[].concat(A()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polyline.clampToGround=!!t,i.entity.polyline.arcType=t?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(e){e.innerHTML=i.options.center.alt}))}},{key:"radius",get:function(){return this.options.radius},set:function(e){this.options.radius=Number(e),this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positions),this.entity.polyline.positions=[].concat(A()(this.positions),[this.positions[0],this.positions[1]])}},{key:"center",get:function(){return this.options.center},set:function(e){var t=this;this.options.center=e,this.height=this.height,this._elms.lng&&this._elms.lng.forEach((function(e){e.innerHTML=t.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(e){e.innerHTML=t.options.center.lat}))}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;if(this.options.color=e||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,0,0,0.5)"}});t._elms.color[i]=n}))}}},{key:"lineColor",get:function(){return this.options.line.color},set:function(e){var t=this;this.options.line.color=e||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.lineColor=e},clear:function(){t.lineColor="rgba(255,0,0,0.5)"}});t._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(e){this.options.line.width=e||0===e?e:3,this.entity.polyline.width=this.options.line.width,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(t){t.value=e}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){this.options.label.show=e,!this.show||this.showView&&3!=this.showView?this.label.show=!1:this.label.show=e,this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label.color=e,this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label.fontSize=e,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label.scaleByDistance=e,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(e){this.options.label.lineWidth=e,this.label.lineWidth=e,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(t){t.value=e}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(e){this.options.label.pixelOffset=e,this.label.pixelOffset=e,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(t){t.value=e}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(e){var t=this;this.options.label.lineColor=e,this.label.lineColor=e,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelLineColor=e},clear:function(){t.labelLineColor="rgba(0,255,255,0.5)"}});t._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label.backgroundColor=[e,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label.backgroundColor=[this.label.backgroundColor[0],e],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"edit",value:(r=o()(a.a.mark((function e(i){var n,o,s,r,l,c,u,h,p=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 8:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" circle",(n=document.createElement("div")).innerHTML=ih(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new En("circle-object-edit-tabs",void 0,this.sdk),o=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){p.color=e},clear:function(){p.color="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:n.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){p.lineColor=e},clear:function(){p.lineColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){p.labelColor=e},clear:function(){p.labelColor="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){p.labelLineColor=e},clear:function(){p.labelLineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){p.labelBackgroundColorStart=e},clear:function(){p.labelBackgroundColorStart="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){p.labelBackgroundColorEnd=e},clear:function(){p.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),h=n.getElementsByTagName("*"),t.EventBinding(this,h),this._elms.color=[o],this._elms.lineColor=[s],this._elms.labelColor=[r],this._elms.labelLineColor=[l],this._elms.labelBackgroundColorStart=[c],this._elms.labelBackgroundColorEnd=[u],setTimeout((function(){p.attributeLink=p.options.attribute.link.content,p.attributeVr=p.options.attribute.vr.content,p.cameraSelect&&p.cameraSelect(),p.goodsSelect&&p.goodsSelect();var e=p.attributeSelect,i=p._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(i){var n=q(i,".attribute-select");n.legp_search(e);for(var o=p._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<e.length;s++)if(e[s].key===p.options.attributeType){o.value=e[s].value,n.legp_searchActive(e[s].value);break}o.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===o.value){p.attributeType=e[t].key;break}}))}var a=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],r=q(p._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=p._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];l.value=p.options["area-unit"];for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var e=0;e<a.length;e++)if(a[e].value===l.value){p.areaUnit=a[e].value;break}}))}var u=p._DialogObject._element.content.getElementsByClassName("height-box")[0],h=u.getElementsByClassName("height")[0],d=p._DialogObject._element.content.getElementsByClassName("height-confirm")[0];h.value=10,2==p.heightMode?(u&&(u.className="input-number input-number-unit-1 height-box disabled"),d&&d.setAttribute("disabled","disabled")):(u&&(u.className="input-number input-number-unit-1 height-box"),d&&d.removeAttribute("disabled"));var m=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],f=q(p._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode");if(f){f.legp_search(m);for(var v=p._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],g=0;g<m.length;g++)if(m[g].key==p.heightMode){v.value=m[g].value,f.legp_searchActive(m[g].value);break}v.addEventListener("input",(function(){for(var e=0;e<m.length;e++)if(m[e].value===v.value){p.heightMode=m[e].key;break}})),h.addEventListener("input",(function(){p.heightMode})),p._elms.height=h,p._elms.heightBox=u,p._elms.heightMode=v,p._elms.heightConfirm=d,p._elms.heightModeObject=f,d.addEventListener("click",(function(){p.operate.positionEditing?(p.positionEditing=!1,p.height=p.height+Number(h.value)):(t.closeNodeEdit(p),p.heightMode=p.heightMode,setTimeout((function(){p.height=p.height+Number(h.value)}),100))}))}var y=Un(),b=q(p._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(b){b.legp_search(y);var C=p._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];C.value=y[p.labelFontFamily].value;for(var w=0;w<y.length;w++)if(y[w].value==C.value){b.legp_searchActive(y[w].value);break}C.addEventListener("input",(function(){for(var e=0;e<y.length;e++)if(y[e].value===C.value){p.labelFontFamily=y[e].key;break}})),p._elms.labelFontFamily=[C]}(void 0)()}),0),e.next=34;break;case 33:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 34:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"reset",value:function(){var e=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.radius=this.originalOptions.radius,this.color=this.originalOptions.color,this.labelShow=this.originalOptions.label.show,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelLineColor=this.originalOptions.label.lineColor,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelColor=this.originalOptions.label.color,this.lineWidth=this.originalOptions.line.width,this.lineLength=this.originalOptions.line.length,this.lineColor=this.originalOptions.line.color,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.heightMode=this.originalOptions.heightMode,this._elms.lng&&this._elms.lng.forEach((function(t){t.innerHTML=e.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.innerHTML=e.options.center.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=e.options.center.alt}));for(var t=0;t<this.nodePoints.length;t++)this.sdk.viewer.entities.remove(this.nodePoints[t]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy()}}},{key:"remove",value:(s=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=8,this.sdk.removeIncetance(this.options.id);case 8:return e.next=10,Mt(this.sdk,this.options.id);case 10:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w,k,_,x,E=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=E.length>0&&void 0!==E[0]?E[0]:{},pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=ah({},this.options.position):this.options.positions?l=ah({},this.options.positions[0]):this.options.center?l=ah({},this.options.center):this.options.start?l=ah({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=16;break}return e.next=15,this.getClampToHeight(l);case 15:l.alt=e.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=60;break;case 23:c=this.entity.polygon.hierarchy.getValue(Cesium.JulianDate.now()).positions,u=[],h=0,p=this.cartesian3Towgs84(c[0],this.sdk.viewer),d=Cesium.Cartesian3.fromDegrees(p.lng,p.lat,0),m=Cesium.Cartesian3.fromDegrees(p.lng,p.lat,1e7),f=Cesium.Cartesian3.subtract(m,d,new Cesium.Cartesian3),v=Cesium.Cartesian3.normalize(f,f),g=new Cesium.Ray(d,v),y={},b=this.sdk.viewer.scene.drillPickFromRay(g),C=0;case 35:if(!(C<b.length)){e.next=42;break}if(!b[C].position){e.next=39;break}return y=b[C],e.abrupt("break",42);case 39:C++,e.next=35;break;case 42:if(!y||!y.position){e.next=46;break}h=this.cartesian3Towgs84(y.position,this.sdk.viewer).alt,e.next=55;break;case 46:return e.prev=46,e.next=49,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(p.lng,p.lat)]);case 49:w=e.sent,h=w[0].height,e.next=55;break;case 53:e.prev=53,e.t0=e.catch(46);case 55:for(k=Cesium.Cartesian3.fromDegrees(p.lng,p.lat,h),u.push(k.x,k.y,k.z),_=1;_<c.length;_++)u.push(c[_].x,c[_].y,c[_].z);x=Cesium.BoundingSphere.fromVertices(u),this.sdk.viewer.camera.flyToBoundingSphere(x,{offset:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 60:case"end":return e.stop()}}),e,this,[[46,53]])}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(e){var t=this;Bn.open(this.options.id,this.options.name,this.options.richTextContent),Bn.primaryCallBack=function(e){t.options.richTextContent=e}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){var i=this;this.operate.positionEditing=e,this.event&&this.event.destroy(),this.event=new K(this.sdk),this.previous={positions:ah({},this.options.center)},!0===e?(this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.renewPositions(),this.event.mouse_move((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);n.alt=t.options.center.alt;var o=0,s=!1;switch(t.options.heightMode){case"0":case 0:s=!1;break;case"1":case 1:o=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(n.lng,n.lat))||0,s=!1;break;case"2":case 2:s=!0}var a=t.createCircle(n,t.options.radius),r=[];if(s){t.positions=Cesium.Cartesian3.fromDegreesArray(a);var l=A()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:n.lng,lat:n.lat},l).then((function(e){t.label&&(t.label.position=[n.lng,n.lat,e])}))}else{for(var c=0;c<a.length;c+=2)r.push(a[c],a[c+1],n.alt+o);t.positions=Cesium.Cartesian3.fromDegreesArrayHeights(r),t.label&&(t.label.position=[n.lng,n.lat,n.alt+o])}t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.options.center.lng=Number(n.lng.toFixed(8)),t.options.center.lat=Number(n.lat.toFixed(8)),t.center=t.options.center,t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.previous={positions:ah({},t.options.center)},t.positionEditing=!1,t._positionEditingCallback&&(t._positionEditingCallback(),t._positionEditingCallback=null)})),this.event.mouse_right((function(e,i){t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.positionEditing=!1;else{var e=t.cartesian3Towgs84(i,t.sdk.viewer);t.options.center.lng=Number(e.lng.toFixed(8)),t.options.center.lat=Number(e.lat.toFixed(8)),t.center=t.options.center,t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.previous={positions:ah({},t.options.center)},t.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positions)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(i.positions),[i.positions[0],i.positions[1]])}),!1)):(this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positions)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(i.positions),[i.positions[0],i.positions[1]])}),!0))}}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"areaChangeCallBack",get:function(){return this._areaChangeCallBack},set:function(e){this._areaChangeCallBack=e}},{key:"nodeEdit",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};if(this.positionEditing=!1,YJ.Measure.GetMeasureStatus());else{var i=function(){var e=o()(a.a.mark((function e(){var t,i,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=A()(n.sdk.viewer.entities.values),e.next=3,n.getClampToHeight(n.options.center,t);case 3:i=e.sent,o=n.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(n.options.center.lng,n.options.center.lat,i),billboard:{image:n.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),n.nodePoints.push(o);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n=this;this.event&&this.event.destroy(),this.event=new K(this.sdk),YJ.Measure.SetMeasureStatus(!0),this.tip=new Q("左键确认,右键取消",this.sdk),this.event=new K(this.sdk),this.nodePoints=[];var s,r=[],l=ah({},this.options.center),c=null;r=this.createCircle(this.options.center,this.options.radius),this.entity.polyline.clampToGround=!0,this.entity.polyline.arcType=Cesium.ArcType.GEODESIC,this.entity.polygon.perPositionHeight=!1,this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(r))}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArray(r)}),!1),setTimeout((function(){var t=A()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:e.options.center.lng,lat:e.options.center.lat},t).then((function(t){e.label.position=[e.options.center.lng,e.options.center.lat,t]}))}),50),setTimeout((function(){e.event.mouse_left((function(i,n){s&&(e.sdk.viewer.entities.remove(s),s=null),l=e.cartesian3Towgs84(n,e.viewer);var o=e.computeDistance2([e.options.center,l]);e.radius=o,YJ.Measure.SetMeasureStatus(!1),e.event.destroy(),e.tip.destroy(),e.heightMode=e.heightMode,t("",ah({},e.options.center))})),e.event.mouse_right((function(t,i){s&&(e.sdk.viewer.entities.remove(s),s=null),YJ.Measure.SetMeasureStatus(!1),e.event.destroy(),e.tip.destroy(),e.heightMode=e.heightMode})),e.event.mouse_move((function(t,i){s&&(s.show=!0),l=e.cartesian3Towgs84(i,e.viewer),c=e.computeDistance2([e.options.center,l]),r=e.createCircle(e.options.center,c),e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),i()}),200),s=this.sdk.viewer.entities.add(new Cesium.Entity({show:!1,position:new Cesium.CallbackProperty((function(t){if(l){var i=e.computeMidpoint(e.options.center,l);return Cesium.Cartesian3.fromDegrees(i.lng,i.lat,l.alt)}return Cesium.Cartesian3()}),!1),label:{text:new Cesium.CallbackProperty((function(e){return c>1e3?"半径:"+(c/1e3).toFixed(2)+" 公里":"半径:"+c+" 米"}),!1),font:"20px Microsoft YaHei",distanceDisplayCondition:1e7,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,fillColor:Cesium.Color.fromCssColorString("#f5ce0a"),style:Cesium.LabelStyle.FILL_AND_OUTLINE},polyline:{positions:new Cesium.CallbackProperty((function(t){return Cesium.Cartesian3.fromDegreesArray([e.options.center.lng,e.options.center.lat,l.lng,l.lat])}),!1),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:99999999}})),this.nodePoints.push(s)}}},{key:"closeNodeEdit",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=null;for(var e=0;e<this.nodePoints.length;e++)this.sdk.viewer.entities.remove(this.nodePoints[e]);this.nodePoints=[],this.picking=!0}},{key:"setDIV",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};t.x=t.x||0===t.x?t.x:10,t.y=t.y||0===t.y?t.y:10;var i=document.getElementById(t.domid),n=Cesium.Cartesian3.fromDegrees(this.options.center.lng,this.options.center.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=e.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+t.x).toFixed(0)+"px",i.style.top=(s.y+t.y).toFixed(0)+"px")}}))}},{key:"renewPositions",value:function(e){var t=this;if(!this._error){var i=!1;e||(e=this.options.center);var n=0;switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:n=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(e.lng,e.lat))||0,i=!1;break;case"2":case 2:i=!0}var o=this.createCircle(e,this.options.radius),s=[];if(i)this.positions=Cesium.Cartesian3.fromDegreesArray(o),setTimeout((function(){var i=A()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:e.lng,lat:e.lat},i).then((function(i){t.label&&(t.label.position=[e.lng,e.lat,i])}))}),100);else{for(var a=0;a<o.length;a+=2)s.push(o[a],o[a+1],e.alt+n);this.positions=Cesium.Cartesian3.fromDegreesArrayHeights(s),this.label&&(this.label.position=[e.lng,e.lat,e.alt+n])}return this.areaByMeter=Number((Cesium.Math.PI*this.options.radius*this.options.radius).toFixed(2)),this.areaChangeCallBack&&this.areaChangeCallBack(),o}}}],[{key:"create",value:function(e){var i,n=e.createCircle(e.options.center,e.options.radius),o=0;switch(e.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:o=e.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(e.options.center.lng,e.options.center.lat))||0,i=!1;break;case"2":case 2:i=!0}e.options.label.position={lng:e.options.center.lng,lat:e.options.center.lat,alt:e.options.center.alt+o};var s=Cesium.Color.fromCssColorString(e.options.color);2===e.sdk.viewer.scene.mode&&(i=!1,s=new Cesium.CustomColorMaterialSource({color:e.options.color}));for(var a,r=[],l=0;l<n.length;l+=2)r.push(n[l],n[l+1],e.options.center.alt+o);e.positions=Cesium.Cartesian3.fromDegreesArrayHeights(r),a=Cesium.Cartesian3.fromDegreesArray(n),e.entity=e.sdk.viewer.entities.add({id:e.options.id,show:e.options.show,polygon:{hierarchy:i?new Cesium.PolygonHierarchy(a):new Cesium.PolygonHierarchy(e.positions),perPositionHeight:!i,material:s,zIndex:e.sdk._entityZIndex},polyline:{positions:[].concat(A()(e.positions),[e.positions[0],e.positions[1]]),width:e.options.line.width,material:Cesium.Color.fromCssColorString(e.options.line.color),clampToGround:!!i,arcType:i?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:e.sdk._entityZIndex}}),e.sdk._entityZIndex++,t.createLabel(e),e.areaByMeter=Number((Cesium.Math.PI*e.options.radius*e.options.radius).toFixed(2)),e.areaChangeCallBack&&e.areaChangeCallBack(),Mt(e.sdk,e.options.id),e.options.show&&Qe(0,e.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function e(t){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.label=new Xn(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.label.position.lng,t.options.label.position.lat,t.options.label.position.alt],text:t.options.name,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far});case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"EventBinding",value:function(e,t){for(var i=function(){var i=[],o=!1,s=[];if(!t[n]||!t[n].attributes)return 1;var a,r=nh(t[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==t[n].type?(i.push((function(t){e[r.value]=t.target.checked})),t[n].checked=e[r.value]):(i.push((function(t){var i=t.target.value;"number"==t.target.type?"."==t.data||"-"==t.data&&!t.target.value||(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),e[r.value]=i):e[r.value]=i})),"IMG"==t[n].nodeName?t[n].src=e[r.value]:t[n].value=e[r.value]),e._elms[r.value]?e._elms[r.value].push(t[n]):e._elms[r.value]=[t[n]],s.push(r.name);break;case"@click":t[n].addEventListener("click",(function(t){"function"==typeof e[r.value]&&e[r.value](t)})),s.push(r.name);break;case"@change":o=!0,i.push((function(t){var i=t.target.value;"number"==t.target.type&&""!=i&&(i=Number(i),t.target.value=i),"function"==typeof e[r.value]&&e[r.value](t,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(e){r.e(e)}finally{r.f()}for(var c=0;c<s.length;c++)t[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==t[n].tagName&&"checkbox"!=t[n].type||(u="change"),t[n].addEventListener(u,(function(e){for(var t=0;t<i.length;t++)i[t](e)}))}},n=0;n<t.length;n++)i()}}]);var i,n,s,r}(Vn);function ch(e){return'\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <DIV-cy-tabs id="circle-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ',"\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n ")}function uh(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 hh(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?uh(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):uh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function ph(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return dh(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)?dh(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function dh(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 mh(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var fh=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=mh(this,t,[e,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"rgba(255, 0, 0, 0.5)",i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.semiMinorAxis=n.semiMinorAxis||0===n.semiMinorAxis?n.semiMinorAxis:10,i.options.semiMajorAxis=n.semiMajorAxis||0===n.semiMajorAxis?n.semiMajorAxis:20,i.options.show=!n.show&&!1!==n.show||n.show,i.options.center=n.center||{},i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",n.label=n.label||{},i._elms={},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.options.richTextContent=n.richTextContent||"",i.event=new K(i.sdk),i.nodePoints=[],i.operate={},i.Dialog={},i.sdk.addIncetance(i.options.id,i),t.create(i),i}return un()(t,e),x()(t,[{key:"type",get:function(){return"EllipseObject"}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(e){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=e||0==e?e:2,i.positionEditing=!1,i.entity){var n="";t.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(A()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.center.alt},set:function(e){var t,i=this;this.entity.polygon.hierarchy=[],!e||isNaN(Number(e))?this.options.center.alt=0:this.options.center.alt=Number(Number(e).toFixed(2)),this.previous=null,t=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.entity.polygon.perPositionHeight=!t,i.entity.polyline.positions=[].concat(A()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polyline.clampToGround=!!t,i.entity.polyline.arcType=t?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(e){e.innerHTML=i.options.center.alt}))}},{key:"semiMinorAxis",get:function(){return this.options.semiMinorAxis},set:function(e){this.options.semiMinorAxis=e,this.height=this.height}},{key:"semiMajorAxis",get:function(){return this.options.semiMajorAxis},set:function(e){this.options.semiMajorAxis=e,this.height=this.height}},{key:"center",get:function(){return this.options.center},set:function(e){var t=this;this.options.center=e,this.height=this.height,this._elms.lng&&this._elms.lng.forEach((function(e){e.innerHTML=t.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(e){e.innerHTML=t.options.center.lat}))}},{key:"bearing",get:function(){return this.options.bearing},set:function(e){this.options.bearing=e,this.height=this.height}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;if(this.options.color=e||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this.entity.polyline.width=this.lineWidth,this._elms.color&&this._elms.color.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,0,0,0.5)"}});t._elms.color[i]=n}))}}},{key:"lineColor",get:function(){return this.options.line.color},set:function(e){var t=this;this.options.line.color=e||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.lineColor=e},clear:function(){t.lineColor="rgba(255,0,0,0.5)"}});t._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(e){var t=this;this.options.line.width=e||0===e?e:3,this.entity.polyline.width=this.options.line.width,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(e){e.value=t.options.line.width}))}},{key:"area",get:function(){return this.options.area},set:function(e){this.options.area=e,this._elms.area&&this._elms.area.forEach((function(t){t.value=e}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(e){if(this.options["area-unit"]=e,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(t){t.value=e})),this.options.areaByMeter)switch(e){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){this.options.label.show=e,this.show&&!this.showView||3==this.showView?this.label.show=e:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label.color=e,this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label.fontSize=e,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label.scaleByDistance=e,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(e){this.options.label.lineWidth=e,this.label.lineWidth=e,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(t){t.value=e}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(e){this.options.label.pixelOffset=e,this.label.pixelOffset=e,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(t){t.value=e}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(e){var t=this;this.options.label.lineColor=e,this.label.lineColor=e,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelLineColor=e},clear:function(){t.labelLineColor="rgba(0,255,255,0.5)"}});t._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label.backgroundColor=[e,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label.backgroundColor=[this.label.backgroundColor[0],e],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(e){this.options.attributeType=e,this._elms.attributeType&&this._elms.attributeType.forEach((function(t){t.value=e}));for(var t=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<t.length;i++)t[i].className.indexOf("attribute-content-"+e)>-1?t[i].style.display="block":t[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(e){var t=this;if(this.options.attribute.link.content=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),h={linkEdit:(c=o()(a.a.mark((function e(i){var n,o,s,r,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.options.attribute.link.content;case 2:t.attributeLink=e.sent,n=t._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function e(n){var o,r,l,c,u,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==n){e.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){e.next=35;break}if(l[c]&&l[c].attributes){e.next=14;break}return e.abrupt("continue",32);case 14:u=ph(l[c].attributes),e.prev=15,d=a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("@click"!==(t=p.value).name){e.next=5;break}return l[c].addEventListener("click",(function(e){"function"==typeof h[t.value]&&h[t.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(t.name),e.abrupt("return",1);case 5:case"end":return e.stop()}}),e)})),u.s();case 18:if((p=u.n()).done){e.next=24;break}return e.delegateYield(d(),"t0",20);case 20:if(!e.t0){e.next=22;break}return e.abrupt("break",24);case 22:e.next=18;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(15),u.e(e.t1);case 29:return e.prev=29,u.f(),e.finish(29);case 32:c++,e.next=11;break;case 35:return e.abrupt("return",1);case 36:case"end":return e.stop()}}),e,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){e.next=15;break}return e.delegateYield(r(l),"t0",10);case 10:if(!e.t0){e.next=12;break}return e.abrupt("break",15);case 12:l++,e.next=8;break;case 15:case"end":return e.stop()}}),e)}))),function(e){return c.apply(this,arguments)}),linkDelete:function(e){t.options.attribute.link.content.splice(e,1),t.attributeLink=t.options.attribute.link.content},confirmEdit:function(e,i){var n=e.name&&e.name.replace(/\s/g,""),o=e.url&&e.url.replace(/\s/g,"");n&&o?t.options.attribute.link.content[i]=e:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),t.attributeLink=t.options.attribute.link.content},cancelEdit:function(){t.attributeLink=t.options.attribute.link.content},fileSelect:function(e,t){var i=u[t].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",p),i.addEventListener("change",p)}},p=function(e){e.target.value&&(u[e.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=e.target.value,e.target.value=null)},d=function(e){for(var t=u[e].getElementsByTagName("button"),i=0;i<t.length;i++)if(t[i]&&t[i].attributes){var n,o=ph(t[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return t[i].addEventListener("click",(function(t){"function"==typeof h[o.value]&&h[o.value](e)})),t[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(e){o.e(e)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(e){this.options.attribute.camera.content=e}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(e){var t=this;if(this.options.attribute.vr.content=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),h={vrEdit:(c=o()(a.a.mark((function e(i){var n,o,s,r,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.options.attribute.vr.content;case 2:t.attributeVr=e.sent,n=t._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function e(n){var o,r,l,c,u,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==n){e.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=t.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=t.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){e.next=35;break}if(l[c]&&l[c].attributes){e.next=14;break}return e.abrupt("continue",32);case 14:u=ph(l[c].attributes),e.prev=15,d=a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("@click"!==(t=p.value).name){e.next=5;break}return l[c].addEventListener("click",(function(e){"function"==typeof h[t.value]&&h[t.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(t.name),e.abrupt("return",1);case 5:case"end":return e.stop()}}),e)})),u.s();case 18:if((p=u.n()).done){e.next=24;break}return e.delegateYield(d(),"t0",20);case 20:if(!e.t0){e.next=22;break}return e.abrupt("break",24);case 22:e.next=18;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(15),u.e(e.t1);case 29:return e.prev=29,u.f(),e.finish(29);case 32:c++,e.next=11;break;case 35:return e.abrupt("return",1);case 36:case"end":return e.stop()}}),e,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){e.next=15;break}return e.delegateYield(r(l),"t0",10);case 10:if(!e.t0){e.next=12;break}return e.abrupt("break",15);case 12:l++,e.next=8;break;case 15:case"end":return e.stop()}}),e)}))),function(e){return c.apply(this,arguments)}),vrDelete:function(e){t.options.attribute.vr.content.splice(e,1),t.attributeVr=t.options.attribute.vr.content},confirmEdit:function(e,i){var n=e.name&&e.name.replace(/\s/g,""),o=e.url&&e.url.replace(/\s/g,"");n&&o?t.options.attribute.vr.content[i]=e:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),t.attributeVr=t.options.attribute.vr.content},cancelEdit:function(){t.attributeVr=t.options.attribute.vr.content},fileSelect:function(e,t){var i=u[t].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",p),i.addEventListener("change",p)}},p=function(e){e.target.value&&(u[e.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=e.target.value,e.target.value=null)},d=function(e){for(var t=u[e].getElementsByTagName("button"),i=0;i<t.length;i++)if(t[i]&&t[i].attributes){var n,o=ph(t[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return t[i].addEventListener("click",(function(t){"function"==typeof h[o.value]&&h[o.value](e)})),t[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(e){o.e(e)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(e){this.options.attribute.goods.content=e}},{key:"edit",value:(r=o()(a.a.mark((function e(i){var n,o,s,r,l,c,u,h,p,d,m=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){e.next=32;break}return o=function(){var e=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];e.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];var i=document.createElement("div");i.className="tr",i.innerHTML='\n <div class="td align-center">圆心坐标</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ';var o=i.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.center.lng.toFixed(8),o.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.center.lng.toFixed(8);var l=i.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.center.lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.center.lat.toFixed(8);var h=i.getElementsByClassName("alt")[0],p=document.createElement("span");p.innerHTML=n.height.toFixed(2),h.appendChild(p);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),o.addEventListener("dblclick",(function(){o.innerHTML="",r.value=Number(n.options.center.lng.toFixed(8)),o.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.center.lng.toFixed(8)),o.innerHTML="",o.appendChild(a)})),r.addEventListener("input",(function(){n.options.center.lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.center.lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.center.lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.center.lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.center.lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.center.lat.toFixed(8),n.height=n.height})),h.addEventListener("dblclick",(function(){2!=n.heightMode&&(h.innerHTML="",d.value=Number(n.height.toFixed(2)),h.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),h.innerHTML="",h.appendChild(p)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),p.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(p),n._elms.altInput.push(d),e.appendChild(i)},e.next=7,new pn(this.sdk,this.options,{title:"椭圆属性",left:"180px",top:"100px",confirmCallBack:function(e){m.name=m.name.trim(),m.name||(m.name="未命名对象"),m.options.label.position={lng:m.label.position[0],lat:m.label.position[1],alt:m.label.position[2]},m.originalOptions=m.deepCopyObj(m.options),m._DialogObject.close(),m.Dialog.confirmCallBack&&m.Dialog.confirmCallBack(m.originalOptions),Mt(m.sdk,m.options.id),at(m.sdk,m.options.id)},resetCallBack:function(){m.reset(),m.Dialog.resetCallBack&&m.Dialog.resetCallBack()},removeCallBack:function(){m.Dialog.removeCallBack&&m.Dialog.removeCallBack()},closeCallBack:function(){m.reset(),m.previous=null,m.positionEditing=!1,m.Dialog.closeCallBack&&m.Dialog.closeCallBack()},showCallBack:function(e){m.options.show=e,m.originalOptions.show=e,m.show=e,m.Dialog.showCallBack&&m.Dialog.showCallBack()},translationalCallBack:function(){m.positionEditing=!m.positionEditing},secondaryEditCallBack:function(){t.nodeEdit(m,(function(){o()}))}});case 7:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" circle",(s=document.createElement("div")).innerHTML=ch(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new En("circle-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){m.color=e},clear:function(){m.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){m.lineColor=e},clear:function(){m.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){m.labelColor=e},clear:function(){m.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){m.labelLineColor=e},clear:function(){m.labelLineColor="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){m.labelBackgroundColorStart=e},clear:function(){m.labelBackgroundColorStart="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){m.labelBackgroundColorEnd=e},clear:function(){m.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),t.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[h],this._elms.labelBackgroundColorEnd=[p],setTimeout((function(){m.attributeLink=m.options.attribute.link.content,m.attributeVr=m.options.attribute.vr.content,m.cameraSelect&&m.cameraSelect(),m.goodsSelect&&m.goodsSelect();var e=m.attributeSelect,i=m._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(i){var n=q(i,".attribute-select");n.legp_search(e);for(var s=m._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],a=0;a<e.length;a++)if(e[a].key===m.options.attributeType){s.value=e[a].value,n.legp_searchActive(e[a].value);break}s.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===s.value){m.attributeType=e[t].key;break}}))}var r=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],l=q(m._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(l){l.legp_search(r);var c=m._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];c.value=m.options["area-unit"];for(var u=0;u<r.length;u++)if(r[u].value===c.value){l.legp_searchActive(r[u].value);break}c.addEventListener("input",(function(){for(var e=0;e<r.length;e++)if(r[e].value===c.value){m.areaUnit=r[e].value;break}}))}var h=m._DialogObject._element.content.getElementsByClassName("height-box")[0],p=h.getElementsByClassName("height")[0],d=m._DialogObject._element.content.getElementsByClassName("height-confirm")[0];p.value=10,2==m.heightMode?(h&&(h.className="input-number input-number-unit-1 height-box disabled"),d&&d.setAttribute("disabled","disabled")):(h&&(h.className="input-number input-number-unit-1 height-box"),d&&d.removeAttribute("disabled"));var f=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],v=q(m._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode");if(v){v.legp_search(f);for(var g=m._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],y=0;y<f.length;y++)if(f[y].key==m.heightMode){g.value=f[y].value,v.legp_searchActive(f[y].value);break}g.addEventListener("input",(function(){for(var e=0;e<f.length;e++)if(f[e].value===g.value){m.heightMode=f[e].key;break}})),p.addEventListener("input",(function(){m.heightMode})),m._elms.height=p,m._elms.heightBox=h,m._elms.heightMode=g,m._elms.heightConfirm=d,m._elms.heightModeObject=v,d.addEventListener("click",(function(){m.operate.positionEditing?(m.positionEditing=!1,m.height=m.height+Number(p.value)):(t.closeNodeEdit(m),setTimeout((function(){m.height=m.height+Number(p.value)}),100))}))}var b=Un(),C=q(m._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(C){C.legp_search(b);var w=m._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];w.value=b[m.labelFontFamily].value;for(var k=0;k<b.length;k++)if(b[k].value==w.value){C.legp_searchActive(b[k].value);break}w.addEventListener("input",(function(){for(var e=0;e<b.length;e++)if(b[e].value===w.value){m.labelFontFamily=b[e].key;break}})),m._elms.labelFontFamily=[w]}o()}),0),e.next=33;break;case 32:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 33:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"reset",value:function(){var e=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.radius=this.originalOptions.radius,this.semiMinorAxis=this.originalOptions.semiMinorAxis,this.semiMajorAxis=this.originalOptions.semiMajorAxis,this.bearing=this.originalOptions.bearing,this.color=this.originalOptions.color,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelColor=this.originalOptions.label.color,this.lineWidth=this.originalOptions.line.width,this.lineLength=this.originalOptions.line.length,this.lineColor=this.originalOptions.line.color,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect(),this.heightMode=this.originalOptions.heightMode,this._elms.lng&&this._elms.lng.forEach((function(t){t.innerHTML=e.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.innerHTML=e.options.center.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=e.options.center.alt}));for(var t=0;t<this.nodePoints.length;t++)this.sdk.viewer.entities.remove(this.nodePoints[t]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy()}}},{key:"remove",value:(s=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=8,this.sdk.removeIncetance(this.options.id);case 8:return e.next=10,Mt(this.sdk,this.options.id);case 10:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(e){this.options.attribute.link.content.push({name:"链接",url:e}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(e){this.options.attribute.vr.content.push({name:"全景图",url:e}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w,k,_,x,E=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=E.length>0&&void 0!==E[0]?E[0]:{},pi(0),ni(this.sdk),oi(this.sdk),!this.options.customView){e.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=hh({},this.options.position):this.options.positions?l=hh({},this.options.positions[0]):this.options.center?l=hh({},this.options.center):this.options.start?l=hh({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=16;break}return e.next=15,this.getClampToHeight(l);case 15:l.alt=e.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=60;break;case 23:c=this.entity.polyline.positions.getValue(),u=[],h=0,p=this.cartesian3Towgs84(c[0],this.sdk.viewer),d=Cesium.Cartesian3.fromDegrees(p.lng,p.lat,0),m=Cesium.Cartesian3.fromDegrees(p.lng,p.lat,1e7),f=Cesium.Cartesian3.subtract(m,d,new Cesium.Cartesian3),v=Cesium.Cartesian3.normalize(f,f),g=new Cesium.Ray(d,v),y={},b=this.sdk.viewer.scene.drillPickFromRay(g),C=0;case 35:if(!(C<b.length)){e.next=42;break}if(!b[C].position){e.next=39;break}return y=b[C],e.abrupt("break",42);case 39:C++,e.next=35;break;case 42:if(!y||!y.position){e.next=46;break}h=this.cartesian3Towgs84(y.position,this.sdk.viewer).alt,e.next=55;break;case 46:return e.prev=46,e.next=49,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(p.lng,p.lat)]);case 49:w=e.sent,h=w[0].height,e.next=55;break;case 53:e.prev=53,e.t0=e.catch(46);case 55:for(k=Cesium.Cartesian3.fromDegrees(p.lng,p.lat,h),u.push(k.x,k.y,k.z),_=1;_<c.length;_++)u.push(c[_].x,c[_].y,c[_].z);x=Cesium.BoundingSphere.fromVertices(u),this.sdk.viewer.camera.flyToBoundingSphere(x,{offset:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 60:case"end":return e.stop()}}),e,this,[[46,53]])}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(e){var t=this;Bn.open(this.options.id,this.options.name,this.options.richTextContent),Bn.primaryCallBack=function(e){t.options.richTextContent=e}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){var i=this;if(this.operate.positionEditing=e,this.event&&this.event.destroy(),this.event=new K(this.sdk),!0===e){this.previous={center:this.deepCopyObj(this.options.center)},this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.renewPositions();this.createEllipse(this.options.center,{bearing:this.options.bearing,semiMinorAxis:this.options.semiMinorAxis,semiMajorAxis:this.options.semiMajorAxis}),this.event.mouse_move((function(e,i){[];var n=t.cartesian3Towgs84(i,t.sdk.viewer);n.alt=t.options.center.alt,t.renewPositions(n),t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,i){[];var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.options.center.lng=Number(n.lng.toFixed(8)),t.options.center.lat=Number(n.lat.toFixed(8)),t.center=t.options.center,t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.previous={center:t.deepCopyObj(t.options.center)},t.positionEditing=!1})),this.event.mouse_right((function(e,i){t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.positionEditing=!1;else{[];var e=t.cartesian3Towgs84(i,t.sdk.viewer);t.options.center.lng=e.lng,t.options.center.lat=e.lat,t.center=t.options.center,t.createEllipse(t.options.center,{bearing:t.options.bearing,semiMinorAxis:t.options.semiMinorAxis,semiMajorAxis:t.options.semiMajorAxis}),t.label.position=[e.lng,e.lat],t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.previous={center:t.deepCopyObj(t.options.center)},t.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positions)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(i.positions),[i.positions[0],i.positions[1]])}),!1)}else this.previous||(this.previous={center:this.deepCopyObj(this.options.center)}),this.options.center=this.deepCopyObj(this.previous.center),this.tip&&this.tip.destroy(),this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positions)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(i.positions),[i.positions[0],i.positions[1]])}),!0)}}},{key:"setDIV",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};t.x=t.x||0===t.x?t.x:10,t.y=t.y||0===t.y?t.y:10;var i=document.getElementById(t.domid),n=Cesium.Cartesian3.fromDegrees(this.options.center.lng,this.options.center.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=e.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+t.x).toFixed(0)+"px",i.style.top=(s.y+t.y).toFixed(0)+"px")}}))}},{key:"renewPositions",value:function(e){var t=this;if(!this._error){var i=!1;e||(e=this.options.center);var n=0;switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:n=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(e.lng,e.lat))||0,i=!1;break;case"2":case 2:i=!0}return this.positions=this.createEllipse(e,{bearing:this.options.bearing,semiMinorAxis:this.options.semiMinorAxis,semiMajorAxis:this.options.semiMajorAxis,height:e.alt+n}),i?setTimeout((function(){t.getClampToHeight({lng:e.lng,lat:e.lat}).then((function(i){t.label&&(t.label.position=[e.lng,e.lat,i])}))}),100):this.label&&(this.label.position=[e.lng,e.lat,e.alt+n]),this.options.areaByMeter=Number((Cesium.Math.PI*this.options.semiMinorAxis*this.options.semiMajorAxis).toFixed(2)),this.areaUnit=this.areaUnit,this.positions}}}],[{key:"create",value:function(e){var i,n=0;switch(e.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:n=e.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(e.options.center.lng,e.options.center.lat))||0,i=!1;break;case"2":case 2:i=!0}e.options.label.position||(e.options.label.position={lng:e.options.center.lng,lat:e.options.center.lat,alt:e.options.center.alt+n});var o=Cesium.Color.fromCssColorString(e.options.color);2===e.sdk.viewer.scene.mode&&(i=!1,o=new Cesium.CustomColorMaterialSource({color:e.options.color})),e.options.label.ground=i;var s=e.createEllipse(e.options.center,{bearing:e.options.bearing,semiMinorAxis:e.options.semiMinorAxis,semiMajorAxis:e.options.semiMajorAxis,height:e.options.center.alt+n});switch(e.entity=e.sdk.viewer.entities.add({id:e.options.id,show:e.options.show,polygon:{hierarchy:new Cesium.PolygonHierarchy(s),perPositionHeight:!i,material:o,zIndex:e.sdk._entityZIndex},polyline:{positions:[].concat(A()(s),[s[0],s[1]]),width:e.options.line.width,material:Cesium.Color.fromCssColorString(e.options.line.color),clampToGround:!!i,arcType:i?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:e.sdk._entityZIndex}}),e.sdk._entityZIndex++,t.createLabel(e),e.options.areaByMeter=Number((Cesium.Math.PI*e.options.semiMinorAxis*e.options.semiMajorAxis).toFixed(2)),e.options["area-unit"]){case"平方米":e.options.area=e.options.areaByMeter;break;case"平方千米":e.options.area=Number((e.options.areaByMeter/1e6).toFixed(8));break;case"亩":e.options.area=Number((e.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":e.options.area=Number((e.options.areaByMeter/1e4).toFixed(6));break;default:e.options.area=e.options.areaByMeter}Mt(e.sdk,e.options.id),e.options.show&&Qe(0,e.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function e(t){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.label=new Xn(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.label.position.lng,t.options.label.position.lat,t.options.label.position.alt],text:t.options.name,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far,ground:t.options.label.ground});case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"nodeEdit",value:function(e){if(e.positionEditing=!1,YJ.Measure.GetMeasureStatus());else{var t,i=function(e,t){var i=Math.PI/180,n=e.y*i,o=t.y*i,s=e.x*i,a=t.x*i,r=Math.sin(a-s)*Math.cos(o),l=Math.cos(n)*Math.sin(o)-Math.sin(n)*Math.cos(o)*Math.cos(a-s),c=Math.atan2(r,l)%(2*Math.PI);return 450-(180*c/Math.PI<0?360+180*c/Math.PI:180*c/Math.PI)},n=function(){var t=o()(a.a.mark((function t(i,n){var o,s,r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=e.cartesian3Towgs84(i,e.sdk.viewer),t.next=3,e.getClampToHeight(o,d);case 3:s=t.sent,r=e.sdk.viewer.entities.add({name:"node-secondary-edit-point",type:n,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,s),billboard:{image:e.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),e.nodePoints.push(r);case 6:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}();e.event&&e.event.destroy(),e.event=new K(e.sdk),YJ.Measure.SetMeasureStatus(!0),e.tip=new Q("请选择一个编辑点,右键取消",e.sdk),e.event=new K(e.sdk),e.nodePoints=[];var s=Cesium.Cartesian3.fromDegrees(e.center.lng,e.center.lat),r=e.options.semiMinorAxis,l=e.options.semiMajorAxis,c=e.options.bearing,u=e.createEllipse(e.options.center,{bearing:e.options.bearing,semiMinorAxis:e.options.semiMinorAxis,semiMajorAxis:e.options.semiMajorAxis});e.entity.polyline.clampToGround=!0,e.entity.polyline.arcType=Cesium.ArcType.GEODESIC,e.entity.polygon.perPositionHeight=!1,e.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(u)}),!1),e.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(u),[u[0],u[1]])}),!1);var h=e.entity.polyline.positions.getValue(),p=h.length,d=A()(e.sdk.viewer.entities.values);setTimeout((function(){e.event.mouse_left((function(n,o){if(t)e.options.semiMinorAxis=r,e.options.semiMajorAxis=l,e.options.bearing=c,e.event&&e.event.destroy(),e.tip&&e.tip.destroy(),e.tip=null,t=null,YJ.Measure.SetMeasureStatus(!1),e.heightMode=e.heightMode;else{var a=e.sdk.viewer.scene.pick(n.position);if(a&&a.id&&a.id.name&&"node-secondary-edit-point"===a.id.name&&("semiMinorAxis"===a.id._type||"semiMajorAxis"===a.id._type)){e.tip.set_text("左键确认,右键取消"),t=a.id;for(var h=0;h<e.nodePoints.length;h++)e.sdk.viewer.entities.remove(e.nodePoints[h]);e.nodePoints=[];var p=o,d=e.cartesian3Towgs84(p,e.sdk.viewer);s=Cesium.Cartesian3.fromDegrees(e.center.lng,e.center.lat,d.alt);var m=Cesium.Cartesian3.distance(s,p),f={x:e.center.lng,y:e.center.lat},v={x:d.lng,y:d.lat};c=i(f,v),"semiMinorAxis"===t._type&&(r=m,c+=90),"semiMajorAxis"===t._type&&(l=m),u=e.createEllipse(e.center,{bearing:c,semiMinorAxis:r,semiMajorAxis:l})}}})),e.event.mouse_move((function(n,o){if(t){var a=o,h=e.cartesian3Towgs84(o,e.sdk.viewer);s=Cesium.Cartesian3.fromDegrees(e.center.lng,e.center.lat,h.alt);var p=Cesium.Cartesian3.distance(s,a),d={x:e.center.lng,y:e.center.lat},m={x:h.lng,y:h.lat};c=i(d,m),"semiMinorAxis"===t._type&&(r=p,c+=90),"semiMajorAxis"===t._type&&(l=p),u=e.createEllipse(e.center,{bearing:c,semiMinorAxis:r,semiMajorAxis:l})}e.tip.setPosition(o,n.endPosition.x,n.endPosition.y)})),e.event.mouse_right((function(t,i){for(var n=0;n<e.nodePoints.length;n++)e.sdk.viewer.entities.remove(e.nodePoints[n]);e.nodePoints=[],e.event&&e.event.destroy(),e.tip&&e.tip.destroy(),e.tip=null,e.heightMode=e.heightMode})),e.getClampToHeight({lng:e.center.lng,lat:e.center.lat},d).then((function(t){e.label&&(e.label.position=[e.center.lng,e.center.lat,t])})),n(h[0],"semiMajorAxis"),n(h[(p-2)/4],"semiMinorAxis"),n(h[(p-2)/2],"semiMajorAxis"),n(h[p-2-(p-2)/4],"semiMinorAxis")}),200)}}},{key:"closeNodeEdit",value:function(e){YJ.Measure.SetMeasureStatus(!1),e.event&&e.event.destroy(),e.tip&&e.tip.destroy(),e.tip=null;for(var t=0;t<e.nodePoints.length;t++)e.sdk.viewer.entities.remove(e.nodePoints[t]);e.nodePoints=[],e.picking=!0}},{key:"EventBinding",value:function(e,t){for(var i=function(){var i=[],o=!1,s=[];if(!t[n]||!t[n].attributes)return 1;var a,r=ph(t[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==t[n].type?(i.push((function(t){e[r.value]=t.target.checked})),t[n].checked=e[r.value]):(i.push((function(t){var i=t.target.value;"number"==t.target.type?"."==t.data||"-"==t.data&&!t.target.value||(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),e[r.value]=i):e[r.value]=i})),"IMG"==t[n].nodeName?t[n].src=e[r.value]:t[n].value=e[r.value]),e._elms[r.value]?e._elms[r.value].push(t[n]):e._elms[r.value]=[t[n]],s.push(r.name);break;case"@click":t[n].addEventListener("click",(function(t){"function"==typeof e[r.value]&&e[r.value](t)})),s.push(r.name);break;case"@change":o=!0,i.push((function(t){var i=t.target.value;"number"==t.target.type&&""!=i&&(i=Number(i),t.target.value=i),"function"==typeof e[r.value]&&e[r.value](t,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(e){r.e(e)}finally{r.f()}for(var c=0;c<s.length;c++)t[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==t[n].tagName&&"checkbox"!=t[n].type||(u="change"),t[n].addEventListener(u,(function(e){for(var t=0;t<i.length;t++)i[t](e)}))}},n=0;n<t.length;n++)i()}}]);var i,n,s,r}(Vn);function vh(e){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">拉伸高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999999" @model="extrudedHeight">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col material-box">\n <span class="label">材质样式</span>\n <div class="material"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">墙体闭合</span>\n <input class="btn-switch" type="checkbox" @model="noseToTail">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="radar-scan-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function gh(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return yh(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)?yh(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function yh(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}var bh=function(){function e(){k()(this,e),this.element={}}return x()(e,[{key:"getEvent",value:function(t){return e.event[t]}},{key:"getEventAll",value:function(){return e.event}},{key:"setEvent",value:function(t,i){e.event[t]=i}},{key:"on",value:function(e,t){for(var i=this,n=function(){var n=[],s=!1,a=[],r=function(){};if(!t[o]||!t[o].attributes)return 1;var l,c=gh(t[o].attributes);try{var u=function(){var c=l.value;switch(c.name){case"@model":s=!0,"checkbox"==t[o].type?(n.push((function(t){e[c.value]=t.target.checked})),t[o].checked=e[c.value]):(n.push((function(t){var i=t.target.value;if("number"==t.target.type){if("."!=t.data&&("-"!=t.data||t.target.value)){var n=Number(i);t.target.max&&n>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&n<Number(t.target.min)&&(i=Number(t.target.min)),e[c.value]=i}}else e[c.value]=i})),r=function(t){var i=t.target.value;"number"==t.target.type&&(t.target.value||"undefined"!==t.target.dataset.null&&""!==t.target.dataset.null&&!Boolean(t.target.dataset.null))&&(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),t.target.dataset.min&&i<Number(t.target.dataset.min)&&(i=Number(t.target.dataset.min))),e[c.value]=i},"IMG"==t[o].nodeName?t[o].src=e[c.value]:t[o].value=e[c.value]),i.element[c.value]?i.element[c.value].push(t[o]):i.element[c.value]=[t[o]],a.push(c.name);break;case"@click":t[o].addEventListener("click",(function(t){"function"==typeof e[c.value]&&e[c.value](t)})),a.push(c.name);break;case"@change":s=!0,n.push((function(t){var i=t.target.value;"number"==t.target.type&&""!=i&&(i=Number(i),t.target.value=i),"function"==typeof e[c.value]&&e[c.value](t,i)}))}};for(c.s();!(l=c.n()).done;)u()}catch(e){c.e(e)}finally{c.f()}for(var h=0;h<a.length;h++)t[o].attributes.removeNamedItem(a[h]);if(s){var p="input";"INPUT"==t[o].tagName&&"checkbox"!=t[o].type||(p="change"),t[o].addEventListener(p,(function(e){for(var t=0;t<n.length;t++)n[t](e)})),t[o].addEventListener("blur",(function(e){r(e)}))}},o=0;o<t.length;o++)n()}}])}();C()(bh,"event",{});var Ch=new bh;function wh(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var kh=function(e){function t(e,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(n=wh(this,t,[e,i])).options.color=i.color||"#ff0000",n.options.extrudedHeight=i.extrudedHeight||2.4,n.options.positions=i.positions,n.options.material=Number(i.material)||0===Number(i.material)?Number(i.material):3,n.options.duration=i.duration||0===i.duration?i.duration:1e3,n.options.show=!i.show&&!1!==i.show||i.show,n.options.noseToTail=i.noseToTail||!1,n.entity,n.nodePoints=[],i.label=i.label||{},n.options.label={show:i.label.show||!1,fontSize:i.label.fontSize||0===i.label.fontSize?i.label.fontSize:20,fontFamily:i.label.fontFamily?i.label.fontFamily:0,color:i.label.color||"#ffffff",lineWidth:i.label.lineWidth||0===i.label.lineWidth?i.label.lineWidth:4,pixelOffset:i.label.pixelOffset||0===i.label.pixelOffset?i.label.pixelOffset:20,backgroundColor:i.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:i.label.lineColor||"#00ffff80",scaleByDistance:i.label.scaleByDistance||!1,near:i.label.near||0===i.label.near?i.label.near:2e3,far:i.label.far||0===i.label.far?i.label.far:1e5},n.options.instruct=i.instruct||"",n.options.operatingPoint=i.operatingPoint||"",n.options.attribute=i.attribute||{},n.options.attribute.link=n.options.attribute.link||{},n.options.attribute.link.content=n.options.attribute.link.content||[],delete n.options.attribute.camera,delete n.options.attribute.vr,delete n.options.attribute.goods,n.options.richTextContent=i.richTextContent||"",n.Dialog=o,n._elms={},!n.options.positions||n.options.positions.length<2?(n._error="最少需要两个坐标!",console.warn(n._error),window.ELEMENT&&window.ELEMENT.Message({message:n._error,type:"warning",duration:1500})):(n.sdk.addIncetance(n.options.id,n),t.create(n)),n}return un()(t,e),x()(t,[{key:"type",get:function(){return"wallStereoscopic"}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;this.options.color=e||"#ff0000",this.entity.polylineVolume.material=this.getMaterial(),this._elms.color&&this._elms.color.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,255,255,1)"}});t._elms.color[i]=n}))}},{key:"material",get:function(){return this.options.material},set:function(e){var t=this;this.options.material=Number(e)||0===Number(e)?Number(e):3,this.entity.polylineVolume.material=this.getMaterial(),this._elms.material&&this._elms.material.forEach((function(e){e.value=t.options.material}))}},{key:"noseToTail",get:function(){return this.options.noseToTail},set:function(e){this.options.noseToTail=e;for(var t=this.options.positions,i=[],n=0;n<t.length;n++)i.push(t[n].lng,t[n].lat,t[n].alt);e&&i.push(t[0].lng,t[0].lat,t[0].alt),this.entity.polylineVolume.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i),this.material=this.material,this._elms.noseToTail&&this._elms.noseToTail.forEach((function(t){t.checked=e}))}},{key:"extrudedHeight",get:function(){return this.options.extrudedHeight},set:function(e){this.options.extrudedHeight=e,this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat,this.options.positions[0].alt+this.options.extrudedHeight],this.entity.polylineVolume.shape=[{x:-1e-7,y:-this.options.extrudedHeight/2},{x:1e-7,y:-this.options.extrudedHeight/2},{x:1e-7,y:this.options.extrudedHeight/2},{x:-1e-7,y:this.options.extrudedHeight/2}],this._elms.extrudedHeight&&this._elms.extrudedHeight.forEach((function(t){t.value=e}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){this.options.label.show=e,this.show&&!this.showView||3==this.showView?this.label.show=e:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label.color=e,this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label.fontSize=e,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label.scaleByDistance=e,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(e){this.options.label.lineWidth=e,this.label.lineWidth=e,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(t){t.value=e}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(e){this.options.label.pixelOffset=e,this.label.pixelOffset=e,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(t){t.value=e}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(e){var t=this;this.options.label.lineColor=e,this.label.lineColor=e,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelLineColor=e},clear:function(){t.labelLineColor="rgba(0,255,255,0.5)"}});t._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label.backgroundColor=[e,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label.backgroundColor=[this.label.backgroundColor[0],e],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(e){this.options.instruct=e,this._elms.instruct&&this._elms.instruct.forEach((function(t){t.value=e}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(e){this.options.operatingPoint=e,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(t){t.value=e}))}},{key:"edit",value:(s=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h,p,d,m,f=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 7:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" wall-stereoscopic",(i=document.createElement("div")).innerHTML=vh(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,n=[{name:'<i class="icon icon-wall"></i>纯色墙',value:"纯色墙",key:0,icon:"icon-wall"},{name:'<i class="icon icon-wall-gradient"></i>上升墙',value:"上升墙",key:1,icon:"icon-wall-gradient"},{name:'<i class="icon icon-wall-arrow"></i>箭头墙',value:"箭头墙",key:2,icon:"icon-wall-arrow"},{name:'<i class="icon icon-wall-warn"></i>警戒墙',value:"警戒墙",key:3,icon:"icon-wall-warn"}],(o=q(i.getElementsByClassName("material-box")[0],".material")).legp_search(n),(s=document.createElement("i")).className="icon icon-active",i.getElementsByClassName("material")[0].getElementsByClassName("cy_datalist")[0].appendChild(s),r=i.getElementsByClassName("material")[0].getElementsByTagName("input")[0],l=0;case 23:if(!(l<n.length)){e.next=32;break}if(n[l].key!==this.material){e.next=29;break}return o.legp_searchActive(n[l].value),r.value=n[l].value,s.className="icon icon-active ".concat(n[l].icon),e.abrupt("break",32);case 29:l++,e.next=23;break;case 32:r.addEventListener("input",(function(e,t){for(var i=0;i<n.length;i++)if(n[i].value===r.value){f.material=n[i].key,s.className="icon icon-active ".concat(n[i].icon);break}})),new En("radar-scan-edit-tabs",void 0,this.sdk),c=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){f.color=e},clear:function(){f.color="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){f.labelColor=e},clear:function(){f.labelColor="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){f.labelLineColor=e},clear:function(){f.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){f.labelBackgroundColorStart=e},clear:function(){f.labelBackgroundColorStart="rgba(255,255,255,1)"}}),d=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){f.labelBackgroundColorEnd=e},clear:function(){f.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),m=i.getElementsByTagName("*"),Ch.on(this,m),this._elms=Ch.element,this._elms.color=[c],this._elms.labelColor=[u],this._elms.labelLineColor=[h],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[d],setTimeout((function(){f.attributeLink=f.options.attribute.link.content,f.ISCSelect&&f.ISCSelect(),f.goodsSelect&&f.goodsSelect(),f.cameraSelect&&f.cameraSelect(),f.attributeVr=f.options.attribute.vr.content;var e=f.attributeSelect,t=q(f._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0],".attribute-select");if(t.legp_search(e),f._DialogObject._element.content.getElementsByClassName("attribute-select")[0]){for(var i=f._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],n=0;n<e.length;n++)if(e[n].key===f.options.attributeType){i.value=e[n].value,t.legp_searchActive(e[n].value);break}i.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===i.value){f.attributeType=e[t].key;break}}));var o=Un(),s=q(f._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(s){s.legp_search(o);var a=f._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];a.value=o[f.labelFontFamily].value;for(var r=0;r<o.length;r++)if(o[r].value==a.value){s.legp_searchActive(o[r].value);break}a.addEventListener("input",(function(){for(var e=0;e<o.length;e++)if(o[e].value===a.value){f.labelFontFamily=o[e].key;break}})),f._elms.labelFontFamily=[a]}}}),0),e.next=51;break;case 50:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 51:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"reset",value:function(){var e=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.extrudedHeight=this.originalOptions.extrudedHeight,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.instruct=this.originalOptions.instruct,this.operatingPoint=this.originalOptions.operatingPoint;for(var t=this.options.positions,i=[],n=0;n<t.length;n++)i.push(t[n].lng,t[n].lat,t[n].alt);this.noseToTail&&i.push(i[0],i[1],i[2]),this.entity.polylineVolume.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i),this.material=this.material,this._elms.noseToTail&&this._elms.noseToTail.forEach((function(t){t.checked=e.noseToTail}))}}},{key:"remove",value:(n=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=8,this.sdk.removeIncetance(this.options.id);case 8:return e.next=10,Mt(this.sdk,this.options.id);case 10:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"getMaterial",value:function(){var e,t=this;switch(this.options.material){case 0:e=Cesium.Color.fromCssColorString(this.options.color),2===this.sdk.viewer.scene.mode&&(e=new Cesium.CustomColorMaterialSource({color:this.options.color}));break;case 1:e=new Cesium.PolylineTrailLinkMaterialProperty({color:Cesium.Color.fromCssColorString(this.options.color),duration:this.options.duration});break;case 2:case 3:var i;switch(this.options.material){case 2:i="arrow";break;case 3:i="warn"}e=new Cesium.CustomMaterialSource({image:this.getSourceRootPath()+"/img/material/".concat(i,".png"),color:this.options.color,repeats:new Cesium.CallbackProperty((function(){var e=[[1,1,1]];if(!t.entity||!t.entity.polylineVolume)return e;var i=t.entity.polylineVolume.positions.getValue();if(!Cesium.defined(i))return e;var n=0,o=[];e=[];for(var s=!1,a=0;a<i.length-1;++a){var r=Cesium.Cartesian3.distance(i[a],i[a+1]);r>=1e5&&(s=!0),o.push(r),n+=r}var l=n/t.options.extrudedHeight;if(l/=1,s)for(var c=0;c<o.length;c++){e.push([((c+1)/o.length).toFixed(30),l/5,1])}else for(var u=0;u<o.length;u++){var h=o[u]/n;h;var p=h*l;e.push([((u+1)/o.length).toFixed(30),p,1])}return e}),!1),duration:this.options.duration})}return e}},{key:"openRichTextEditor",value:function(e){var t=this;Bn.open(this.options.id,this.options.name,this.options.richTextContent),Bn.primaryCallBack=function(e){t.options.richTextContent=e}}},{key:"nodeEdit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},t=this;if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n;YJ.Measure.SetMeasureStatus(!0),t.tip=new Q("请选择一个顶点,右键取消",t.sdk),t.event=new K(t.sdk),t.nodePoints=[];for(var o=t.options.positions,s=[],a=0;a<o.length;a++)s.push(o[a].lng,o[a].lat,o[a].alt);t.noseToTail&&s.push(s[0],s[1],s[2]);var r=!1,l=function(e,o){if(i){r=!0;var a=t.sdk.viewer.scene.clampToHeight(o,[t.entity]);t.options.positions[i.index]=t.cartesian3Towgs84(a,t.sdk.viewer),n=t.options.positions[i.index];var l=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(t.options.positions[i.index].lng,t.options.positions[i.index].lat,t.options.positions[i.index].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.splice(i.index,0,l),t.options.positions.splice(i.index,0,t.options.positions[i.index]);var c=t.options.positions;s=[];for(var u=0;u<c.length;u++)s.push(c[u].lng,c[u].lat,c[u].alt);t.noseToTail&&s.push(s[0],s[1],s[2]),t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight],t.tip.setPosition(o,e.position.x,e.position.y),t.material=t.material}else{var h=t.sdk.viewer.scene.pick(e.position);h&&h.id&&h.id.name&&"node-secondary-edit-point"===h.id.name&&(i=h.id,t.nodePoints.splice(h.id.index,1),t.sdk.viewer.entities.remove(h.id),t.tip.set_text("左键开始,右键结束,CTRL+右键撤销"),n=t.cartesian3Towgs84(i.position._value,t.sdk.viewer),t.entity.polylineVolume.positions=new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArrayHeights(s)}),!1))}},c=function(o,a){i&&(t.options.positions[i.index]=n,r&&t.options.positions.splice(i.index,1),e(null,t.options.positions));var l=t.options.positions;s=[];for(var c=0;c<l.length;c++)s.push(l[c].lng,l[c].lat,l[c].alt);t.noseToTail&&s.push(s[0],s[1],s[2]),t.entity.polylineVolume.positions=Cesium.Cartesian3.fromDegreesArrayHeights(s),t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight];for(var u=0;u<t.nodePoints.length;u++)t.sdk.viewer.entities.remove(t.nodePoints[u]);t.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip.destroy(),t.material=t.material};t.event.mouse_left(l),t.event.mouse_right(c);var u=!1;t.event.mouse_move((function(e,n){if(i){var o=t.sdk.viewer.scene.clampToHeight(n,[t.entity]);t.options.positions[i.index]=t.cartesian3Towgs84(o,t.sdk.viewer);var a=t.options.positions;s=[];for(var r=0;r<a.length;r++)s.push(a[r].lng,a[r].lat,a[r].alt);if(t.noseToTail&&s.push(s[0],s[1],s[2]),t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight],u)return u=!1,void(t.material=t.material)}t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right_keyboard_ctrl((function(e,n){i&&(u=!0,t.options.positions.pop(),t.sdk.viewer.entities.remove(t.nodePoints[t.nodePoints.length-1]),i.index===t.options.positions.length&&(t.nodePoints[i.index-1]?i=t.nodePoints[i.index-1]:i.index=0),t.nodePoints.pop())})),t.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?c(o,i):l(o,i)}))}));for(var h=0;h<t.options.positions.length;h++){var p=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:h,position:Cesium.Cartesian3.fromDegrees(t.options.positions[h].lng,t.options.positions[h].lat,t.options.positions[h].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.push(p)}}}},{key:"setDIV",value:function(){var e,t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};i.x=i.x||0===i.x?i.x:10,i.y=i.y||0===i.y?i.y:10;for(var n=[],o=0;o<this.options.positions.length;o++)n.push([this.options.positions[o].lng,this.options.positions[o].lat]);var s=turf.lineString(n),a=turf.length(s,{units:"kilometers"}),r=turf.lineSliceAlong(s,0,a/2,{units:"kilometers"}),l=document.getElementById(i.domid),c=(e=Cesium.Cartesian3).fromDegrees.apply(e,A()(r.geometry.coordinates[r.geometry.coordinates.length-1]).concat([this.options.positions[0].alt+this.options.extrudedHeight]));this.sdk.viewer.scene.postRender.addEventListener((function(e){if("block"===l.style.display||""===l.style.display){var n=t.sdk.viewer.scene.cartesianToCanvasCoordinates(c);n&&(l.style.left=(n.x+i.x).toFixed(0)+"px",l.style.top=(n.y+i.y).toFixed(0)+"px")}}))}}],[{key:"createLabel",value:function(e){e.label=new Xn(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.positions[0].lng,e.options.positions[0].lat,e.options.positions[0].alt+e.options.extrudedHeight],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,ground:!1,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far})}},{key:"create",value:(i=o()(a.a.mark((function e(i){var n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n=i.options.positions,o=[],s=0;s<n.length;s++)o.push(n[s].lng,n[s].lat,n[s].alt);i.noseToTail&&o.push(o[0],o[1],o[2]),i.entity=i.sdk.viewer.entities.add({id:i.options.id,show:i.options.show,polylineVolume:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(o),shape:[{x:-1e-7,y:-i.options.extrudedHeight/2},{x:1e-7,y:-i.options.extrudedHeight/2},{x:1e-7,y:i.options.extrudedHeight/2},{x:-1e-7,y:i.options.extrudedHeight/2}],cornerType:Cesium.CornerType.MITERED}}),i.entity.polylineVolume.material=i.getMaterial(),t.createLabel(i),Mt(i.sdk,i.options.id),i.options.show&&Qe(0,i.options.id);case 9:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}]);var i,n,s}(Vn);function _h(e){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" data-min="0.01" max="999999" @model="width">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">拉伸高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999999" @model="extrudedHeight">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col corner-type-box">\n <span class="label">拐角类型</span>\n <div class="corner-type"></div>\n </div>\n <div class="col material-box">\n <span class="label">墙体样式</span>\n <div class="material"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">墙体闭合</span>\n <input class="btn-switch" type="checkbox" @model="noseToTail">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="radar-scan-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function xh(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Eh(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)?Eh(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Eh(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}var Sh=function(){function e(){k()(this,e),this.element={}}return x()(e,[{key:"getEvent",value:function(t){return e.event[t]}},{key:"getEventAll",value:function(){return e.event}},{key:"setEvent",value:function(t,i){e.event[t]=i}},{key:"on",value:function(e,t){for(var i=this,n=function(){var n=[],s=!1,a=[],r=function(){};if(!t[o]||!t[o].attributes)return 1;var l,c=xh(t[o].attributes);try{var u=function(){var c=l.value;switch(c.name){case"@model":s=!0,"checkbox"==t[o].type?(n.push((function(t){e[c.value]=t.target.checked})),t[o].checked=e[c.value]):(n.push((function(t){var i=t.target.value;if("number"==t.target.type){if("."!=t.data&&("-"!=t.data||t.target.value)){var n=Number(i);t.target.max&&n>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&n<Number(t.target.min)&&(i=Number(t.target.min)),t.target.dataset.min&&n<Number(t.target.dataset.min)&&(i=Number(t.target.dataset.min)),e[c.value]=i}}else e[c.value]=i})),r=function(t){var i=t.target.value;"number"==t.target.type&&(t.target.value||"undefined"!==t.target.dataset.null&&""!==t.target.dataset.null&&!Boolean(t.target.dataset.null))&&(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),t.target.dataset.min&&i<Number(t.target.dataset.min)&&(i=Number(t.target.dataset.min))),e[c.value]=i},"IMG"==t[o].nodeName?t[o].src=e[c.value]:t[o].value=e[c.value]),i.element[c.value]?i.element[c.value].push(t[o]):i.element[c.value]=[t[o]],a.push(c.name);break;case"@click":t[o].addEventListener("click",(function(t){"function"==typeof e[c.value]&&e[c.value](t)})),a.push(c.name);break;case"@change":s=!0,n.push((function(t){var i=t.target.value;"number"==t.target.type&&""!=i&&(i=Number(i),t.target.value=i),"function"==typeof e[c.value]&&e[c.value](t,i)}))}};for(c.s();!(l=c.n()).done;)u()}catch(e){c.e(e)}finally{c.f()}for(var h=0;h<a.length;h++)t[o].attributes.removeNamedItem(a[h]);if(s){var p="input";"INPUT"==t[o].tagName&&"checkbox"!=t[o].type||(p="change"),t[o].addEventListener(p,(function(e){for(var t=0;t<n.length;t++)n[t](e)})),t[o].addEventListener("blur",(function(e){r(e)}))}},o=0;o<t.length;o++)n()}}])}();C()(Sh,"event",{});var Ph=new Sh;function Dh(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Mh=function(e){function t(e,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(n=Dh(this,t,[e,i]))._elms={},n.options.color=i.color||"#ffffff",n.options.width=i.width||.24,n.options.noseToTail=i.noseToTail||!1,n.options.extrudedHeight=i.extrudedHeight||2.4,n.cornerType=i.cornerType,n.options.positions=i.positions,n.options.material=Number(i.material)||0,n.options.show=!i.show&&!1!==i.show||i.show,n.entity,n.nodePoints=[],i.label=i.label||{},n.options.label={text:n.options.name,show:i.label.show||!1,position:i.label.position,fontSize:i.label.fontSize||0===i.label.fontSize?i.label.fontSize:20,fontFamily:i.label.fontFamily?i.label.fontFamily:0,color:i.label.color||"#ffffff",lineWidth:i.label.lineWidth||0===i.label.lineWidth?i.label.lineWidth:4,pixelOffset:i.label.pixelOffset||0===i.label.pixelOffset?i.label.pixelOffset:20,backgroundColor:i.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:i.label.lineColor||"#00ffff80",scaleByDistance:i.label.scaleByDistance||!1,near:i.label.near||0===i.label.near?i.label.near:2e3,far:i.label.far||0===i.label.far?i.label.far:1e5},n.options.attribute=i.attribute||{},n.options.attribute.link=n.options.attribute.link||{},n.options.attribute.link.content=n.options.attribute.link.content||[],delete n.options.attribute.camera,delete n.options.attribute.vr,delete n.options.attribute.goods,n.options.richTextContent=i.richTextContent||"",n.Dialog=o,!n.options.positions||n.options.positions.length<2?(n._error="最少需要两个坐标!",console.warn(n._error),window.ELEMENT&&window.ELEMENT.Message({message:n._error,type:"warning",duration:1500})):(n.sdk.addIncetance(n.options.id,n),t.create(n)),n}return un()(t,e),x()(t,[{key:"type",get:function(){return"WallRealStereoscopic"}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;if(this.options.color=e,this.entity)for(var i=0;i<this.entity.values.length;i++){if(this.entity.values[i].polylineVolume){var n=this.entity.values[i];n.polylineVolume.material=this.getMaterial(n.id)}if(this.entity.values[i].polygon)this.entity.values[i].polygon.material=Cesium.Color.fromCssColorString(this.options.color)}this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!1,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,255,255,1)"}});t._elms.color[n]=o}))}},{key:"width",get:function(){return this.options.width},set:function(e){this.options.width=e,this.options.width<=.01&&(this.options.width=.01),this.update(),this._elms.width&&this._elms.width.forEach((function(t){t.value=e}))}},{key:"cornerType",get:function(){return this.options.cornerType},set:function(e){switch(e){case 0:case"0":e=0;break;case 1:case"1":e=1;break;case 2:case"2":e=2;break;default:e=0}this.options.cornerType=e,this.update(),this._elms.cornerType&&this._elms.cornerType.forEach((function(t){t.value=e}))}},{key:"material",get:function(){return this.options.material},set:function(e){if(this.options.material=Number(e),this.entity)for(var t=0;t<this.entity.values.length;t++)if(this.entity.values[t].polylineVolume){var i=this.entity.values[t];i.polylineVolume.material=this.getMaterial(i.id)}this._elms.material&&this._elms.material.forEach((function(t){t.value=e}))}},{key:"noseToTail",get:function(){return this.options.noseToTail},set:function(e){this.options.noseToTail=e,this.update(),this.material=this.material,this._elms.noseToTail&&this._elms.noseToTail.forEach((function(t){t.checked=e}))}},{key:"extrudedHeight",get:function(){return this.options.extrudedHeight},set:function(e){this.options.extrudedHeight=e,this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat,this.options.positions[0].alt+this.options.extrudedHeight],this.update(),this._elms.extrudedHeight&&this._elms.extrudedHeight.forEach((function(t){t.value=e}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){this.options.label.show=e,this.show&&!this.showView||3==this.showView?this.label.show=e:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label.color=e,this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label.fontSize=e,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label.scaleByDistance=e,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(e){this.options.label.lineWidth=e,this.label.lineWidth=e,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(t){t.value=e}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(e){this.options.label.pixelOffset=e,this.label.pixelOffset=e,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(t){t.value=e}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(e){var t=this;this.options.label.lineColor=e,this.label.lineColor=e,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelLineColor=e},clear:function(){t.labelLineColor="rgba(0,255,255,0.5)"}});t._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label.backgroundColor=[e,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label.backgroundColor=[this.label.backgroundColor[0],e],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"calculatePositions3",value:function(){var e=this.deepCopyObj(this.options.positions);this.noseToTail&&e.push(e[0],e[1]);for(var t=[],i=[],n=[],o=[],s=[],a=0;a<e.length-1;a++){var r=turf.point([e[a].lng,e[a].lat]),l=turf.point([e[a+1].lng,e[a+1].lat]),c=turf.rhumbBearing(r,l),u=turf.destination(r,this.options.width/2/1e3,c+90,{units:"kilometers"}),h=turf.destination(l,this.options.width/2/1e3,c+90,{units:"kilometers"}),p=turf.destination(r,this.options.width/2/1e3,c-90,{units:"kilometers"}),d=turf.destination(l,this.options.width/2/1e3,c-90,{units:"kilometers"}),m=u.geometry.coordinates,f=h.geometry.coordinates,v=p.geometry.coordinates,g=d.geometry.coordinates;m[2]=e[a].alt,f[2]=e[a+1].alt,v[2]=e[a].alt,g[2]=e[a+1].alt,t.push(m,f),i.push(v,g)}if(0===this.cornerType);else if(1===this.cornerType)for(var y=0;y<t.length-3;y+=2)0==y&&(o.push(t[y]),s.push(i[y])),o.push(t[y+1],t[y+2]),s.push(i[y+1],i[y+2]),y==t.length-4&&(o.push(t[y+3]),s.push(i[y+3]));else if(2===this.cornerType)for(var b=0;b<t.length-3;b+=2){var C=e[b/2+1],w=turf.point(t[b+1]),k=turf.point(i[b+1]),_=turf.rhumbBearing(w,k),x=turf.point(t[b+2]),E=turf.point(i[b+2]),S=turf.rhumbBearing(x,E);console.log("bearing1, bearing2",_-S);var P=!0;if(Math.sin(Cesium.Math.toRadians(_-S))>0){var D=_;_=S+180,S=D+180,P=!1}var M=turf.sector([C.lng,C.lat,C.alt],this.options.width/1e3/2,_,S,{units:"kilometers"});if(console.log("sector",M),0==b&&(o.push(t[b]),s.push(i[b])),console.log("face",P),P){o.push(t[b+1],t[b+2]);for(var T=1;T<M.geometry.coordinates[0].length-1;T++)s.push([].concat(A()(M.geometry.coordinates[0][T]),[t[b+1][2]]))}else{for(var O=M.geometry.coordinates[0].length-2;O>0;O--)o.push([].concat(A()(M.geometry.coordinates[0][O]),[t[b+1][2]]));s.push(i[b+1],i[b+2])}b==t.length-4&&(o.push(t[b+3]),s.push(i[b+3]))}n=[].concat(o);for(var N=s.length-1;N>=0;N--)n.push(s[N]);return n.push(n[0]),console.log("positions",n),n}},{key:"calculatePositions2",value:function(){for(var e=[],t=0;t<this.options.positions.length-2;t++){var i=(180-u(this.options.positions[t],this.options.positions[t+1],this.options.positions[t+2]))/2,n=Math.tan(i*Math.PI/180)*(this.options.width/2);console.log("width",n,i);var o=turf.lineString([[this.options.positions[1].lng,this.options.positions[1].lat],[this.options.positions[0].lng,this.options.positions[0].lat]]),s=turf.lineString([[this.options.positions[1].lng,this.options.positions[1].lat],[this.options.positions[2].lng,this.options.positions[2].lat]]),a=turf.lineSliceAlong(o,0,n/1e3,{units:"kilometers"}),r=turf.lineSliceAlong(s,0,n/1e3,{units:"kilometers"}),l=a.geometry.coordinates[a.geometry.coordinates.length-1],c=r.geometry.coordinates[r.geometry.coordinates.length-1];l[2]=this.options.positions[t+1].alt,c[2]=this.options.positions[t+1].alt,e.push([l,c]),this.sdk.viewer.entities.add({position:Cesium.Cartesian3.fromDegrees(l[0],l[1],l[2]),billboard:{image:this.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),this.sdk.viewer.entities.add({position:Cesium.Cartesian3.fromDegrees(c[0],c[1],c[2]),billboard:{image:this.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}})}function u(e,t,i){var n=turf.point([e.lng,e.lat]),o=turf.point([t.lng,t.lat]),s=turf.point([i.lng,i.lat]),a={units:"kilometers"},r=turf.rhumbDistance(n,o,a),l=turf.rhumbDistance(s,o,a);var c=turf.rhumbBearing(n,o),u=turf.rhumbBearing(s,o),h=Math.abs((c-u+360)%360);return h>180&&(h=360-h),h}return e}},{key:"calculatePositions",value:function(){var e=this.deepCopyObj(this.options.positions);this.noseToTail&&e.push(e[0],e[1]);for(var t=[],i=[],n=0;n<e.length-1;n++){var o=turf.point([e[n].lng,e[n].lat]),s=turf.point([e[n+1].lng,e[n+1].lat]),a=turf.rhumbBearing(o,s),r=turf.destination(o,this.options.width/2/1e3,a+90,{units:"kilometers"}),l=turf.destination(s,this.options.width/2/1e3,a+90,{units:"kilometers"}),c=turf.destination(o,this.options.width/2/1e3,a-90,{units:"kilometers"}),u=turf.destination(s,this.options.width/2/1e3,a-90,{units:"kilometers"}),h=r.geometry.coordinates,p=l.geometry.coordinates,d=c.geometry.coordinates,m=u.geometry.coordinates;h[2]=e[n].alt,p[2]=e[n+1].alt,d[2]=e[n].alt,m[2]=e[n+1].alt,t.push([h,p,m,d,h])}if(i.push(t[0]),0===this.cornerType)for(var f=1;f<t.length;f++){var v=e[f],g=turf.point(t[f-1][1]),y=turf.point(t[f-1][2]),b=turf.rhumbBearing(g,y),C=turf.point(t[f][0]),w=turf.point(t[f][3]),k=turf.rhumbBearing(C,w);if(Math.sin(Cesium.Math.toRadians(b-k))>0){var _=b;b=k+180,k=_+180,!1}var x=Math.abs(b-k);x>180&&(x=360-x);var E=this.options.width/2/Math.cos(Cesium.Math.toRadians(x/2));E>5*this.options.width&&(E=5*this.options.width);var S=turf.sector([v.lng,v.lat],this.options.width/1e3/2,b,k,{units:"kilometers",steps:3600}),P=turf.point([v.lng,v.lat]),D=turf.point(A()(S.geometry.coordinates[0][Math.ceil(S.geometry.coordinates[0].length/2)])),M=turf.bearing(P,D),T=turf.destination(P,E/1e3,M,{units:"kilometers"}),O=[];O.push([].concat(A()(S.geometry.coordinates[0][0]),[v.alt])),O.push([].concat(A()(S.geometry.coordinates[0][1]),[v.alt])),O.push([].concat(A()(T.geometry.coordinates),[v.alt])),O.push([].concat(A()(S.geometry.coordinates[0][S.geometry.coordinates[0].length-2]),[v.alt])),i.push(O),i.push(t[f])}else if(1===this.cornerType)for(var N=1;N<t.length;N++)i.push([t[N-1][2],t[N][0],t[N-1][1],t[N][3],t[N-1][2]]),i.push(t[N]);else if(2===this.cornerType)for(var B=1;B<t.length;B++){var L=e[B],I=turf.point(t[B-1][1]),j=turf.point(t[B-1][2]),R=turf.rhumbBearing(I,j),F=turf.point(t[B][0]),z=turf.point(t[B][3]),H=turf.rhumbBearing(F,z);if(Math.sin(Cesium.Math.toRadians(R-H))>0){var V=R;R=H+180,H=V+180}for(var G=turf.sector([L.lng,L.lat],this.options.width/1e3/2,R,H,{units:"kilometers"}),W=[],U=0;U<G.geometry.coordinates[0].length-1;U++)W.push([].concat(A()(G.geometry.coordinates[0][U]),[L.alt]));i.push(W),i.push(t[B])}return i}},{key:"edit",value:(s=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 7:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" wall-stereoscopic",(i=document.createElement("div")).innerHTML=_h(this),this._DialogObject.contentAppChild(i),n=[{name:'<svg class="icon-zj"><use xlink:href="#yj-icon-zj"></use></svg>直角',value:"直角",key:0,icon:"yj-icon-zj"},{name:'<svg class="icon-xj"><use xlink:href="#yj-icon-xj"></use></svg>斜角',value:"斜角",key:1,icon:"yj-icon-xj"},{name:'<svg class="icon-yj"><use xlink:href="#yj-icon-yj"></use></svg>圆角',value:"圆角",key:2,icon:"yj-icon-yj"}],(o=q(i.getElementsByClassName("corner-type-box")[0],".corner-type")).legp_search(n),(s=document.createElement("i")).className="icon-active",i.getElementsByClassName("corner-type")[0].getElementsByClassName("cy_datalist")[0].appendChild(s),r=i.getElementsByClassName("corner-type")[0].getElementsByTagName("input")[0],l=0;case 20:if(!(l<n.length)){e.next=29;break}if(n[l].key!==this.cornerType){e.next=26;break}return o.legp_searchActive(n[l].value),r.value=n[l].value,s.innerHTML='<svg class="'.concat(n[l].icon,'"><use xlink:href="#').concat(n[l].icon,'"></use></svg>'),e.abrupt("break",29);case 26:l++,e.next=20;break;case 29:r.addEventListener("input",(function(e,t){for(var i=0;i<n.length;i++)if(n[i].value===r.value){C.cornerType=n[i].key,s.innerHTML='<svg class="'.concat(n[i].icon,'"><use xlink:href="#').concat(n[i].icon,'"></use></svg>');break}})),c=[{name:'<i class="icon icon-wall"></i>纯色墙',value:"纯色墙",key:0,icon:"icon-wall"},{name:'<i class="icon icon-wall-brick1"></i>红砖墙',value:"红砖墙",key:1,icon:"icon-wall-brick1"},{name:'<i class="icon icon-wall-brick2"></i>黄砖墙',value:"黄砖墙",key:2,icon:"icon-wall-brick2"},{name:'<i class="icon icon-wall-brick3"></i>灰瓷墙',value:"灰瓷墙",key:3,icon:"icon-wall-brick3"}],(u=q(i.getElementsByClassName("material-box")[0],".material")).legp_search(c),(h=document.createElement("i")).className="icon icon-active",i.getElementsByClassName("material")[0].getElementsByClassName("cy_datalist")[0].appendChild(h),p=i.getElementsByClassName("material")[0].getElementsByTagName("input")[0],d=0;case 38:if(!(d<c.length)){e.next=47;break}if(c[d].key!==this.material){e.next=44;break}return u.legp_searchActive(c[d].value),p.value=c[d].value,h.className="icon icon-active ".concat(c[d].icon),e.abrupt("break",47);case 44:d++,e.next=38;break;case 47:p.addEventListener("input",(function(e,t){for(var i=0;i<c.length;i++)if(c[i].value===p.value){C.material=c[i].key,h.className="icon icon-active ".concat(c[i].icon);break}})),new En("radar-scan-edit-tabs",void 0,this.sdk),m=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!1,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){C.color=e},clear:function(){C.color="rgba(255,255,255,1)"}}),f=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){C.labelColor=e},clear:function(){C.labelColor="rgba(255,255,255,1)"}}),v=new YJColorPicker({el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){C.labelLineColor=e},clear:function(){C.labelLineColor="rgba(255,255,255,1)"}}),g=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){C.labelBackgroundColorStart=e},clear:function(){C.labelBackgroundColorStart="rgba(255,255,255,1)"}}),y=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){C.labelBackgroundColorEnd=e},clear:function(){C.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),b=i.getElementsByTagName("*"),Ph.on(this,b),this._elms=Ph.element,this._elms.color=[m],this._elms.labelColor=[f],this._elms.labelLineColor=[v],this._elms.labelBackgroundColorStart=[g],this._elms.labelBackgroundColorEnd=[y],setTimeout((function(){C.attributeLink=C.options.attribute.link.content;var e=C.attributeSelect,t=q(C._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0],".attribute-select");if(t.legp_search(e),C._DialogObject._element.content.getElementsByClassName("attribute-select")[0]){for(var i=C._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],n=0;n<e.length;n++)if(e[n].key===C.options.attributeType){i.value=e[n].value,t.legp_searchActive(e[n].value);break}i.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===i.value){C.attributeType=e[t].key;break}}));var o=Un(),s=q(C._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(s){s.legp_search(o);var a=C._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];a.value=o[C.labelFontFamily].value;for(var r=0;r<o.length;r++)if(o[r].value==a.value){s.legp_searchActive(o[r].value);break}a.addEventListener("input",(function(){for(var e=0;e<o.length;e++)if(o[e].value===a.value){C.labelFontFamily=o[e].key;break}})),C._elms.labelFontFamily=[a]}}}),0),e.next=66;break;case 65:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 66:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"reset",value:function(){if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.width=this.originalOptions.width,this.cornerType=this.originalOptions.cornerType,this.extrudedHeight=this.originalOptions.extrudedHeight,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1];for(var e=this.options.positions,t=[],i=[],n=[],o=0;o<e.length;o++)t.push(e[o].lng,e[o].lat,e[o].alt),i.push(e[o].alt),n.push(e[o].alt+this.options.extrudedHeight)}}},{key:"remove",value:(n=o()(a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label.remove(),t=0;t<this.entity.values.length;t++)this.sdk.viewer.entities.remove(this.entity.values[t]);return this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=8,this.sdk.removeIncetance(this.options.id);case 8:return e.next=10,Mt(this.sdk,this.options.id);case 10:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"getMaterial",value:function(e){var t,i,n=this;switch(this.options.material){case 0:t=Cesium.Color.fromCssColorString(this.options.color),2===this.sdk.viewer.scene.mode&&(t=new Cesium.CustomColorMaterialSource({color:this.options.color}));break;case 1:case 2:case 3:case 4:switch(this.options.material){case 1:i="brick1";break;case 2:i="brick2";break;case 3:i="brick3";break;case 4:i="brick4"}t=new Cesium.CustomMaterialSource({image:this.getSourceRootPath()+"/img/material/".concat(i,".png"),color:this.options.color,is2D:!1,repeats:new Cesium.CallbackProperty((function(){var t=[["1.0",1,1]];if(!n.entity)return t;var i=n.entity.getById(e);if(!i||!i.polylineVolume)return t;var o=i.polylineVolume.positions.getValue();if(!Cesium.defined(o))return t;var s=0,a=[];t=[];for(var r=0;r<o.length-1;++r){var l=Cesium.Cartesian3.distance(o[r],o[r+1]);a.push(l),s+=l}var c=s/n.options.extrudedHeight;c/=1;for(var u=0;u<a.length;u++){var h=a[u]/s;h;var p=h*c;t.push([((u+1)/a.length).toFixed(30),p,1])}return t}),!1),isTranslucent:!1,duration:0})}return t}},{key:"openRichTextEditor",value:function(e){var t=this;Bn.open(this.options.id,this.options.name,this.options.richTextContent),Bn.primaryCallBack=function(e){t.options.richTextContent=e}}},{key:"nodeEdit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},i=this;if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var n,o,s=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(i.entity){for(var n=i.calculatePositions(),o=0;o<i.entity.values.length;o++)i.sdk.viewer.entities.remove(i.entity.values[o]);i.entity.removeAll(),a=[],r=[];for(var s=function(o){for(var s=[],l=[],c=0;c<n[o].length;c++)s.push(n[o][c][0],n[o][c][1],n[o][c][2]),l.push(n[o][c][0],n[o][c][1],n[o][c][2]+i.options.extrudedHeight);a.push(s),r.push(l);var u=i.sdk.viewer.entities.add({id:i.options.id+"-"+t.randomString(12),polylineVolume:{positions:e?new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArrayHeights(a[o])}),!1):Cesium.Cartesian3.fromDegreesArrayHeights(a[o]),shape:[{x:-1e-7,y:-i.options.extrudedHeight/2},{x:1e-7,y:-i.options.extrudedHeight/2},{x:1e-7,y:i.options.extrudedHeight/2},{x:-1e-7,y:i.options.extrudedHeight/2}],cornerType:Cesium.CornerType.MITERED}}),h=i.sdk.viewer.entities.add({id:i.options.id+"-"+t.randomString(12),polygon:{hierarchy:e?new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(r[o]))}),!1):new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(r[o])),perPositionHeight:!0,material:Cesium.Color.fromCssColorString(i.options.color)}});i.entity.add(u),i.entity.add(h),u.polylineVolume.material=i.getMaterial(u.id)},l=0;l<n.length;l++)s(l)}};YJ.Measure.SetMeasureStatus(!0),i.tip=new Q("请选择一个顶点,右键取消",i.sdk),i.event=new K(i.sdk),i.nodePoints=[];i.options.positions;var a=[],r=[],l=!1,c=function(e,t){if(!0,n){l=!0;var a=i.sdk.viewer.scene.clampToHeight(t,A()(i.entity.values));i.options.positions[n.index]=i.cartesian3Towgs84(a,i.sdk.viewer),o=i.options.positions[n.index];var r=i.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(i.options.positions[n.index].lng,i.options.positions[n.index].lat,i.options.positions[n.index].alt),billboard:{image:i.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});i.nodePoints.splice(n.index,0,r),i.options.positions.splice(n.index,0,i.options.positions[n.index]),s(!0),i.label.position=[i.options.positions[0].lng,i.options.positions[0].lat,i.options.positions[0].alt+i.options.extrudedHeight],i.tip.setPosition(t,e.position.x,e.position.y),i.material=i.material}else{var c=i.sdk.viewer.scene.pick(e.position);c&&c.id&&c.id.name&&"node-secondary-edit-point"===c.id.name&&(n=c.id,i.nodePoints.splice(c.id.index,1),i.sdk.viewer.entities.remove(c.id),i.tip.set_text("左键开始,右键结束,CTRL+右键撤销"),o=i.cartesian3Towgs84(n.position._value,i.sdk.viewer),s(!0))}},u=function(t,a){n&&(i.options.positions[n.index]=o,l&&i.options.positions.splice(n.index,1),s(),e(null,i.options.positions)),i.label.position=[i.options.positions[0].lng,i.options.positions[0].lat,i.options.positions[0].alt+i.options.extrudedHeight];for(var r=0;r<i.nodePoints.length;r++)i.sdk.viewer.entities.remove(i.nodePoints[r]);i.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),i.event.destroy(),i.tip.destroy(),i.material=i.material};i.event.mouse_left(c),i.event.mouse_right(u),i.event.mouse_move((function(e,t){if(n){var o=i.sdk.viewer.scene.clampToHeight(t,A()(i.entity.values));i.options.positions[n.index]=i.cartesian3Towgs84(o,i.sdk.viewer);for(var s=i.calculatePositions(),l=0;l<s.length;l++){for(var c=[],u=[],h=0;h<s[l].length;h++)c.push(s[l][h][0],s[l][h][1],s[l][h][2]),u.push(s[l][h][0],s[l][h][1],s[l][h][2]+i.options.extrudedHeight);a[l]=c,r[l]=u}i.label.position=[i.options.positions[0].lng,i.options.positions[0].lat,i.options.positions[0].alt+i.options.extrudedHeight]}i.tip.setPosition(t,e.endPosition.x,e.endPosition.y)})),i.event.mouse_right_keyboard_ctrl((function(e,t){n&&(!0,i.options.positions.pop(),s(!0),i.sdk.viewer.entities.remove(i.nodePoints[i.nodePoints.length-1]),n.index===i.options.positions.length&&(i.nodePoints[n.index-1]?n=i.nodePoints[n.index-1]:n.index=0),i.nodePoints.pop())})),i.event.gesture_pinck_start((function(e,t){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};i.event.gesture_pinck_end((function(){new Date-n>=500?u(o,t):c(o,t)}))}));for(var h=0;h<i.options.positions.length;h++){var p=i.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:h,position:Cesium.Cartesian3.fromDegrees(i.options.positions[h].lng,i.options.positions[h].lat,i.options.positions[h].alt),billboard:{image:i.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});i.nodePoints.push(p)}}}},{key:"update",value:function(){if(this.entity){for(var e=this.calculatePositions(),i=[],n=[],o=0;o<this.entity.values.length;o++)this.sdk.viewer.entities.remove(this.entity.values[o]);this.entity.removeAll();for(var s=0;s<e.length;s++){for(var a=[],r=[],l=0;l<e[s].length;l++)a.push(e[s][l][0],e[s][l][1],e[s][l][2]),r.push(e[s][l][0],e[s][l][1],e[s][l][2]+this.options.extrudedHeight);i.push(a),n.push(r);var c=this.sdk.viewer.entities.add({id:this.options.id+"-"+t.randomString(12),polylineVolume:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(i[s]),shape:[{x:-1e-7,y:-this.options.extrudedHeight/2},{x:1e-7,y:-this.options.extrudedHeight/2},{x:1e-7,y:this.options.extrudedHeight/2},{x:-1e-7,y:this.options.extrudedHeight/2}],cornerType:Cesium.CornerType.MITERED}}),u=this.sdk.viewer.entities.add({id:this.options.id+"-"+t.randomString(12),polygon:{hierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(n[s])),perPositionHeight:!0,material:Cesium.Color.fromCssColorString(this.options.color)}});this.entity.add(c),this.entity.add(u),c.polylineVolume.material=this.getMaterial(c.id)}}}},{key:"setDIV",value:function(){var e,t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};i.x=i.x||0===i.x?i.x:10,i.y=i.y||0===i.y?i.y:10;for(var n=[],o=0;o<this.options.positions.length;o++)n.push([this.options.positions[o].lng,this.options.positions[o].lat]);var s=turf.lineString(n),a=turf.length(s,{units:"kilometers"}),r=turf.lineSliceAlong(s,0,a/2,{units:"kilometers"}),l=document.getElementById(i.domid),c=(e=Cesium.Cartesian3).fromDegrees.apply(e,A()(r.geometry.coordinates[r.geometry.coordinates.length-1]).concat([this.options.positions[0].alt+this.options.extrudedHeight]));this.sdk.viewer.scene.postRender.addEventListener((function(e){if("block"===l.style.display||""===l.style.display){var n=t.sdk.viewer.scene.cartesianToCanvasCoordinates(c);n&&(l.style.left=(n.x+i.x).toFixed(0)+"px",l.style.top=(n.y+i.y).toFixed(0)+"px")}}))}}],[{key:"createLabel",value:function(e){e.label=new Xn(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.positions[0].lng,e.options.positions[0].lat,e.options.positions[0].alt+e.options.extrudedHeight],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,ground:!1,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far})}},{key:"create",value:(i=o()(a.a.mark((function e(i){var n,o,s,r,l,c,u;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(i.entity=new Cesium.EntityCollection,n=i.calculatePositions(),o=0;o<n.length;o++){for(s=[],r=[],l=0;l<n[o].length;l++)s.push(n[o][l][0],n[o][l][1],n[o][l][2]),r.push(n[o][l][0],n[o][l][1],n[o][l][2]+i.options.extrudedHeight);c=i.sdk.viewer.entities.add({id:i.options.id+"-"+t.randomString(12),polylineVolume:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(s),shape:[{x:-1e-7,y:-i.options.extrudedHeight/2},{x:1e-7,y:-i.options.extrudedHeight/2},{x:1e-7,y:i.options.extrudedHeight/2},{x:-1e-7,y:i.options.extrudedHeight/2}],cornerType:Cesium.CornerType.MITERED}}),u=i.sdk.viewer.entities.add({id:i.options.id+"-"+t.randomString(12),polygon:{hierarchy:Cesium.Cartesian3.fromDegreesArrayHeights(r),perPositionHeight:!0,material:Cesium.Color.fromCssColorString(i.options.color)}}),i.entity.add(c),i.entity.add(u),c.polylineVolume.material=i.getMaterial(c.id)}i.entity.show=i.options.show,t.createLabel(i),Mt(i.sdk,i.options.id),i.options.show&&Qe(0,i.options.id);case 9:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"randomString",value:function(e){e=e||32;for(var t="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",i=t.length,n="",o=0;o<e;o++)n+=t.charAt(Math.floor(Math.random()*i));return n}}]);var i,n,s}(Vn);function Th(e){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 56%;">\n <div>\n <div class="row">\n <div class="col input-select-unit-box">\n <div class="input-select-unit"></div>\n <input class="input input-text" readonly="readonly" type="text" style="flex: 0 0 130px;" @model="length">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="polyline-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="线条风格">\n <div class="row">\n <div class="col">\n <span class="label">线条颜色</span>\n <div class="color"></div>\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">线条宽度</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="1" max="999" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col input-select-line-type-box" style="flex: 0 0 37%;">\n <span class="label">线条形式</span>\n <div class="input-select-line-type"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">线段缓冲</span>\n <input class="btn-switch" type="checkbox" @model="extend">\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">缓冲宽度</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="0" data-min="0.01" max="999999" @model="extendWidth">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 37%;">\n <span class="label">缓冲颜色</span>\n <div class="extendColor"></div>\n </div>\n </div>\n <div class="row" id="dashTextureDom">\n <div class="col">\n <span class="label">动画顺向</span>\n <input class="btn-switch" type="checkbox" @model="rotate">\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">流动速率</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="999999" step="1" @model="speed">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 37%;">\n <span class="label lineSpace">间距</span>\n <div class="input-number input-number-unit-1 lineSpace" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="4.5" step="0.1" @model="space">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">首尾相连</span>\n <input class="btn-switch" type="checkbox" @model="noseToTail">\n </div>\n <div class="col" style="flex: 0 0 33%;">\n </div>\n <div class="col" style="flex: 0 0 37%;">\n </div>\n </div>\n\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n \x3c!-- <DIV-cy-tab-pane label="灯光控制">--\x3e\n \x3c!-- <div>--\x3e\n \x3c!-- <div class="row">--\x3e\n \x3c!-- <div class="col">--\x3e\n \x3c!-- <span class="label">指令</span>--\x3e\n \x3c!-- <input class="input" type="text" @model="instruct">--\x3e\n \x3c!-- <button class="primary" @click="instructSubmit">提交</button>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </DIV-cy-tab-pane>--\x3e\n \x3c!-- <DIV-cy-tab-pane label="设置操作点">--\x3e\n \x3c!-- <div>--\x3e\n \x3c!-- <div class="row">--\x3e\n \x3c!-- <div class="col">--\x3e\n \x3c!-- <span class="label">设置操作点</span>--\x3e\n \x3c!-- <input class="input" type="text" @model="operatingPoint">--\x3e\n \x3c!-- <button class="primary" @click="operatingPointSubmit">提交</button>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </DIV-cy-tab-pane>--\x3e\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Oh(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Nh(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)?Nh(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Nh(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}var Bh=function(){function e(){k()(this,e),this.element={}}return x()(e,[{key:"getEvent",value:function(t){return e.event[t]}},{key:"getEventAll",value:function(){return e.event}},{key:"setEvent",value:function(t,i){e.event[t]=i}},{key:"on",value:function(e,t){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!t[o]||!t[o].attributes)return 1;var r,l=Oh(t[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==t[o].type?(n.push((function(t){e[l.value]=t.target.checked})),t[o].checked=e[l.value]):(n.push((function(t){var i=t.target.value;"number"==t.target.type?"."==t.data||"-"==t.data&&!t.target.value||(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),t.target.dataset.min&&i<Number(t.target.dataset.min)&&(i=Number(t.target.dataset.min)),e[l.value]=i):e[l.value]=i})),"IMG"==t[o].nodeName?t[o].src=e[l.value]:t[o].value=e[l.value]),i.element[l.value]?i.element[l.value].push(t[o]):i.element[l.value]=[t[o]],a.push(l.name);break;case"@click":t[o].addEventListener("click",(function(t){"function"==typeof e[l.value]&&e[l.value](t)})),a.push(l.name);break;case"@change":s=!0,n.push((function(t){var i=t.target.value;"number"==t.target.type&&""!=i&&(i=Number(i),t.target.value=i),"function"==typeof e[l.value]&&e[l.value](t,i)}))}};for(l.s();!(r=l.n()).done;)c()}catch(e){l.e(e)}finally{l.f()}for(var u=0;u<a.length;u++)t[o].attributes.removeNamedItem(a[u]);if(s){var h="input";"INPUT"==t[o].tagName&&"checkbox"!=t[o].type||(h="change"),t[o].addEventListener(h,(function(e){for(var t=0;t<n.length;t++)n[t](e)}))}},o=0;o<t.length;o++)n()}}])}();C()(Bh,"event",{});var Ah=new Bh;function Lh(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 Ih(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Lh(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Lh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function jh(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Rh=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,t),(i=jh(this,t,[e,n])).options.name=n.name||"未命名对象",i.options.width=n.width||0===n.width?n.width:3,i.options.color=n.color||"#ff0000",i.options.type=n.type?Number(n.type):0,i.options.noseToTail=n.noseToTail||!1,i.options.extend=n.extend||!1,i.options.rotate=!n.rotate&&!1!==n.rotate||n.rotate,i.options.space=n.space||1,i.options.speed=n.speed||10,i.options.wordsName=n.wordsName||0,i.options.extendWidth=n.extendWidth||0===n.extendWidth?n.extendWidth:10,i.options.extendColor=n.extendColor||"rgba(255,255,80,0.3)",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i._elms=[],n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],delete i.options.attribute.camera,delete i.options.attribute.vr,delete i.options.attribute.goods,i.options.richTextContent=n.richTextContent||"",i.operate={},i.nodePoints=[],i.unitNum=0,i.inputSpeed=n.speed&&100*Math.pow(n.speed,-1)||10,i.Dialog=o,!i.options.positions||i.options.positions.length<2)i._error="线段最少需要两个坐标!",console.warn(i._error);else{for(var s=0;s<i.options.positions.length;s++)i.options.positions[s].lng=Number(Number(i.options.positions[s].lng).toFixed(8)),i.options.positions[s].lat=Number(Number(i.options.positions[s].lat).toFixed(8)),i.options.positions[s].alt=Number(Number(i.options.positions[s].alt).toFixed(2));i.sdk.addIncetance(i.options.id,i),t.create(i)}return i}return un()(t,e),x()(t,[{key:"color",get:function(){return this.options.color},set:function(e){var t=this;this.options.color=e||"#ff0000";var i=Ih({},this.options);i.speed=this.inputSpeed,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,i),this._elms.color&&this._elms.color.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,0,0,1)"}});t._elms.color[i]=n}))}},{key:"speed",get:function(){return this.options.speed},set:function(e){this.options.speed=e,this.inputSpeed=0!==e?100*Math.pow(e,-1):0;var t=Ih({},this.options);t.speed=this.inputSpeed,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,t)}},{key:"rotate",get:function(){return this.options.rotate},set:function(e){this.options.rotate=e,this.closeNodeEdit(),this._elms.rotate&&this._elms.rotate.forEach((function(t){t.checked=e})),this.options.rotate=e,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,this.options)}},{key:"space",get:function(){return this.options.space},set:function(e){this.options.space=e;var t=Ih({},this.options);t.speed=this.inputSpeed,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,t)}},{key:"wordsName",get:function(){return this.options.wordsName},set:function(e){var t=this;this.options.wordsName=Number(e);var i=this;if(this.noseToTail)this.renewPositions(this.options.positions);else this.computeDistance(this.smoothHandle(this.options.positions),2,e).then((function(e){i.lengthByMeter=e,t.lengthChangeCallBack&&t.lengthChangeCallBack()}))}},{key:"lineWidth",get:function(){return this.options.width},set:function(e){var t=this;this.options.width=e||0==e?e:3,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(e){e.value=t.options.width})),this.entity&&this.entity.polyline&&(this.entity.polyline.width=this.entity.polyline.width+e-this.entity.polyline.oriWidth,this.entity.polyline.oriWidth=this.options.width)}},{key:"lineType",get:function(){return this.options.type},set:function(e){var t=this,i=[{name:'<i class="icon line"></i>实线',value:"实线",key:0,icon:"line"},{name:'<i class="icon dash-line"></i>虚线',value:"虚线",key:1,icon:"dash-line"},{name:'<i class="icon light-line"></i>泛光',value:"泛光",key:2,icon:"light-line"},{name:'<i class="icon tail-line"></i>尾迹光线',value:"尾迹光线",key:3,icon:"tail-line"},{name:'<i class="icon mult-tail-line"></i>多尾迹光线',value:"多尾迹光线",key:4,icon:"mult-tail-line"},{name:'<i class="icon flow-dash-line1"></i>流动虚线1',value:"流动虚线1",key:5,icon:"flow-dash-line1"},{name:'<i class="icon flow-dash-line2"></i>流动虚线2',value:"流动虚线2",key:6,icon:"flow-dash-line2"},{name:'<i class="icon pic-line1"></i>流动箭头1',value:"流动箭头1",key:7,icon:"pic-line1"},{name:'<i class="icon pic-line2"></i>流动箭头2',value:"流动箭头2",key:8,icon:"pic-line2"},{name:'<i class="icon pic-line3"></i>流动箭头3',value:"流动箭头3",key:9,icon:"pic-line3"},{name:'<i class="icon pic-line4"></i>流动箭头4',value:"流动箭头4",key:10,icon:"pic-line4"},{name:'<i class="icon pic-line5"></i>流动箭头5',value:"流动箭头5",key:11,icon:"pic-line5"},{name:'<i class="icon pic-line6"></i>流动箭头6',value:"流动箭头6",key:12,icon:"pic-line6"}];this.options.type=Number(e);for(var n=function(n){if(i[n].key===Number(e))return t._elms.lineType&&t._elms.lineType.forEach((function(e){e.value=i[n].value,2<e.value&&e.value<13?document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="flex"):document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="none"),2<e.value&&e.value<5?(document.getElementsByClassName("lineSpace")[0]&&(document.getElementsByClassName("lineSpace")[0].style.display="none"),document.getElementsByClassName("lineSpace")[1]&&(document.getElementsByClassName("lineSpace")[1].style.display="none")):(document.getElementsByClassName("lineSpace")[0]&&(document.getElementsByClassName("lineSpace")[0].style.display="flex"),document.getElementsByClassName("lineSpace")[1]&&(document.getElementsByClassName("lineSpace")[1].style.display="flex"))})),1},o=0;o<i.length&&!n(o);o++);var s=Ih({},this.options);s.speed=this.inputSpeed,this.entity&&this.entity.polyline&&(this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,s))}},{key:"noseToTail",get:function(){return this.options.noseToTail},set:function(e){if(this.options.noseToTail=e,this.closeNodeEdit(),this._elms.noseToTail&&this._elms.noseToTail.forEach((function(t){t.checked=e})),this.entity){var t=this.renewPositions(this.options.positions);this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(t),this.renewPolygon(t)}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(e){var t=this;this.positionEditing=!1,this.options.heightMode=e||0==e?e:2;var i="";this.closeNodeEdit();var n=!1,o=!1,s=this.renewPositions(this.options.positions);switch(this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(s),this.renewPolygon(s),this.options.heightMode){case"0":case 0:this.entity.polyline.clampToGround=n,this.extend=!1,i="海拔高度";break;case"1":case 1:this.entity.polyline.clampToGround=n,this.extend=!1,i="相对地表";break;case"2":case 2:n=!0,o=!0,this.entity.polyline.clampToGround=n,i="依附模型"}this._elms.heightMode&&(this._elms.heightMode.value=i),this._elms.heightModeObject&&this._elms.heightModeObject.legp_searchActive(i),o?(this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),this._elms.heightConfirm&&this._elms.heightConfirm.setAttribute("disabled","disabled")):(this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box"),this._elms.heightConfirm&&this._elms.heightConfirm.removeAttribute("disabled")),setTimeout((function(){n?(t.label.ground=n,t._elms.heightMode&&(t._elms.heightMode.value="依附模型"),t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat]):(t.label.ground=n,t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,s[2]],t.options.label.position={lng:t.options.positions[0].lng,lat:t.options.positions[0].lat,alt:s[2]})}),0)}},{key:"extend",get:function(){return this.options.extend},set:function(e){if(this.options.extend=e,this.closeNodeEdit(),e&&(this.heightMode=2),this._elms.extend&&this._elms.extend.forEach((function(t){t.checked=e})),this.entity)if(this.options.extend){var t=this.renewPositions(this.options.positions);this.renewPolygon(t)}else this.entity.polygon=void 0}},{key:"extendWidth",get:function(){return this.options.extendWidth},set:function(e){this.options.extendWidth=e,this._elms.extendWidth&&this._elms.extendWidth.forEach((function(t){t.value=e}));var t=this.renewPositions(this.options.positions);this.renewPolygon(t)}},{key:"extendColor",get:function(){return this.options.extendColor},set:function(e){var t=this;this.options.extendColor=e,this._elms.extendColor&&this._elms.extendColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.extendColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.extendColor=e},clear:function(){t.extendColor="rgba(255,255,255,1)"}});t._elms.extendColor[i]=n})),this.entity&&this.entity.polygon&&(this.entity.polygon.material=Cesium.Color.fromCssColorString(this.options.extendColor))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){var t=this;this.options.label.show=e,this.show&&!this.showView||3==this.showView?(this.label.show=e,setTimeout((function(){t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt]}),0)):this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label.color=e,this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label.fontSize=e,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label.scaleByDistance=e,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(e){this.options.label.lineWidth=e,this.label.lineWidth=e,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(t){t.value=e}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(e){this.options.label.pixelOffset=e,this.label.pixelOffset=e,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(t){t.value=e}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(e){var t=this;this.options.label.lineColor=e,this.label.lineColor=e,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelLineColor=e},clear:function(){t.labelLineColor="rgba(0,255,255,0.5)"}});t._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label.backgroundColor=[e,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label.backgroundColor=[this.label.backgroundColor[0],e],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"judgeLine",value:function(e,t){if(!e.polyline.oriRepeat){var i={color:t.color,image:this.getSourceRootPath()+"/img/arrow/1.png",space:t.space,speed:t.speed};i.speed=t.rotate?i.speed:0-i.speed;var n=document.createElement("canvas"),o=(n.getContext("2d"),new Image);o.src=i.image;var s=this;o.onload=function(){n.width=o.width*(i.space+1),n.height=o.height;var t=s.getSceenLine(e,i,n);t&&(e.polyline.oriRepeat=t);var a=e.polyline.positions.getValue(s.sdk.viewer.clock.currentTime);if(!Cesium.defined(a))return new Cesium.Cartesian2(1,1);for(var r=0,l=0;l<a.length-1;++l)r+=Cesium.Cartesian3.distance(a[l],a[l+1]);var c=r/e.polyline.width.getValue(),u=s.sdk.viewer.camera.positionCartographic.height,h=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),p=s.sdk.viewer.canvas.clientWidth,d=s.sdk.viewer.canvas.clientHeight;if(c*=s.sdk.viewer.scene.camera.getPixelSize(h,p,d)/u/(i.space*(n.width/n.height*5)+1),s.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D){var m=c/e.polyline.oriRepeat;e.polyline.oriSpeed=m,e.polyline.oriRepeatX=c}else{var f=Ft().viewer.entities.getById(s.options.id);e.polyline.oriSpeed=f.polyline.oriSpeed,e.polyline.oriRepeatX=f.polyline.oriRepeatX}}}}},{key:"getSceenLine",value:function(e,t,i){var n=new Cesium.Cartesian2(0,this.sdk.viewer.canvas.clientHeight),o=new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth/2,this.sdk.viewer.canvas.clientHeight),s=this.sdk.viewer.camera.getPickRay(n),a=this.sdk.viewer.scene.globe.pick(s,this.sdk.viewer.scene),r=this.sdk.viewer.camera.getPickRay(o),l=this.sdk.viewer.scene.globe.pick(r,this.sdk.viewer.scene);if(a&&l){var c=Cesium.Cartesian3.distance(a,l)/e.polyline.width.getValue(),u=this.sdk.viewer.camera.positionCartographic.height,h=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),p=this.sdk.viewer.canvas.clientWidth,d=this.sdk.viewer.canvas.clientHeight,m=this.sdk.viewer.scene.camera.getPixelSize(h,p,d);return m>700?c*=m/u/(t.space*(i.width/i.height*5)+1):c=void 0,this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D?c:Ft().viewer.entities.getById(this.options.id).polyline.oriRepeatX}}},{key:"edit",value:(l=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 8:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" polyline",(i=document.createElement("div")).innerHTML=Th(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,new En("polyline-object-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){h.color=e},clear:function(){h.color="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){h.labelColor=e},clear:function(){h.labelColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("extendColor")[0],size:"mini",alpha:!0,defaultColor:this.extendColor,disabled:!1,openPickerAni:"opacity",sure:function(e){h.extendColor=e},clear:function(){h.extendColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){h.labelLineColor=e},clear:function(){h.labelLineColor="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){h.labelBackgroundColorStart=e},clear:function(){h.labelBackgroundColorStart="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){h.labelBackgroundColorEnd=e},clear:function(){h.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),u=i.getElementsByTagName("*"),Ah.on(this,u),this._elms=Ah.element,this._elms.color=[n],this._elms.labelColor=[o],this._elms.extendColor=[s],this._elms.labelLineColor=[r],this._elms.labelBackgroundColorStart=[l],this._elms.labelBackgroundColorEnd=[c],setTimeout((function(){h.attributeLink=h.options.attribute.link.content;var e=h.attributeSelect,t=h._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(t){var n=q(t,".attribute-select");n.legp_search(e);for(var o=h._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<e.length;s++)if(e[s].key===h.options.attributeType){o.value=e[s].value,n.legp_searchActive(e[s].value);break}o.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===o.value){h.attributeType=e[t].key;break}}))}var a=[{name:"空间长度",value:"空间长度"},{name:"投影长度",value:"投影长度"},{name:"地表长度",value:"地表长度"}],r=q(h._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=h._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];h._elms.wordsName=[l],l.value=h.options.wordsName;for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var e=0;e<a.length;e++)if(a[e].value===l.value){h.wordsName=a[e].value;break}}))}var u=[{name:"米",value:"米"},{name:"千米",value:"千米"}],p=q(h._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit",1);if(p){p.legp_search(u);var d=h._DialogObject._element.content.getElementsByClassName("input-select-unit")[1].getElementsByTagName("input")[0];h._elms.lengthUnit=[d];for(var m=0;m<u.length;m++)if(u[m].value===d.value){p.legp_searchActive(u[m].value);break}d.addEventListener("input",(function(){for(var e=0;e<u.length;e++)if(u[e].value===d.value){h.lengthUnit=u[e].value;break}}))}var f=[{name:'<i class="icon line"></i>实线',value:"实线",key:0,icon:"line"},{name:'<i class="icon dash-line"></i>虚线',value:"虚线",key:1,icon:"dash-line"},{name:'<i class="icon light-line"></i>泛光',value:"泛光",key:2,icon:"light-line"},{name:'<i class="icon tail-line"></i>尾迹光线',value:"尾迹光线",key:3,icon:"tail-line"},{name:'<i class="icon mult-tail-line"></i>多尾迹光线',value:"多尾迹光线",key:4,icon:"mult-tail-line"},{name:'<i class="icon flow-dash-line1"></i>流动虚线1',value:"流动虚线1",key:5,icon:"flow-dash-line1"},{name:'<i class="icon flow-dash-line2"></i>流动虚线2',value:"流动虚线2",key:6,icon:"flow-dash-line2"},{name:'<i class="icon pic-line1"></i>流动箭头1',value:"流动箭头1",key:7,icon:"pic-line1"},{name:'<i class="icon pic-line2"></i>流动箭头2',value:"流动箭头2",key:8,icon:"pic-line2"},{name:'<i class="icon pic-line3"></i>流动箭头3',value:"流动箭头3",key:9,icon:"pic-line3"},{name:'<i class="icon pic-line4"></i>流动箭头4',value:"流动箭头4",key:10,icon:"pic-line4"},{name:'<i class="icon pic-line5"></i>流动箭头5',value:"流动箭头5",key:11,icon:"pic-line5"},{name:'<i class="icon pic-line6"></i>流动箭头6',value:"流动箭头6",key:12,icon:"pic-line6"}],v=q(h._DialogObject._element.content.getElementsByClassName("input-select-line-type-box")[0],".input-select-line-type");if(v){v.legp_search(f);var g=document.createElement("i");g.className="icon icon-active",h._DialogObject._element.content.getElementsByClassName("input-select-line-type")[0].getElementsByClassName("cy_datalist")[0].appendChild(g);var y=h._DialogObject._element.content.getElementsByClassName("input-select-line-type")[0].getElementsByTagName("input")[0];h._elms.lineType=[y];for(var b=0;b<f.length;b++)if(f[b].key===h.options.type){v.legp_searchActive(f[b].value),y.value=f[b].value,g.className="icon icon-active ".concat(f[b].icon);break}y.addEventListener("input",(function(){for(var e=0;e<f.length;e++)if(f[e].value===y.value){h.lineType=f[e].key,g.className="icon icon-active ".concat(f[e].icon),2<h.lineType&&h.lineType<13?document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="flex"):document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="none"),2<h.lineType&&h.lineType<5?(document.getElementsByClassName("lineSpace")[0]&&(document.getElementsByClassName("lineSpace")[0].style.display="none"),document.getElementsByClassName("lineSpace")[1]&&(document.getElementsByClassName("lineSpace")[1].style.display="none")):(document.getElementsByClassName("lineSpace")[0]&&(document.getElementsByClassName("lineSpace")[0].style.display="flex"),document.getElementsByClassName("lineSpace")[1]&&(document.getElementsByClassName("lineSpace")[1].style.display="flex"));break}}))}var C=h._DialogObject._element.content.getElementsByClassName("height-box")[0],w=C.getElementsByClassName("height")[0],k=h._DialogObject._element.content.getElementsByClassName("height-confirm")[0];w.value=10,2==h.heightMode?(C&&(C.className="input-number input-number-unit-1 height-box disabled"),k&&k.setAttribute("disabled","disabled")):(C&&(C.className="input-number input-number-unit-1 height-box"),k&&k.removeAttribute("disabled"));var _=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],x=q(h._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode");if(x){x.legp_search(_);for(var E=h._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],S=0;S<_.length;S++)if(_[S].key==h.heightMode){E.value=_[S].value,x.legp_searchActive(_[S].value);break}E.addEventListener("input",(function(){for(var e=0;e<_.length;e++)if(_[e].value===E.value){h.heightMode=_[e].key;break}})),w.addEventListener("input",(function(){h.heightMode})),h._elms.height=w,h._elms.heightBox=C,h._elms.heightMode=E,h._elms.heightConfirm=k,h._elms.heightModeObject=x,k.addEventListener("click",(function(){h.positionEditing=!1;for(var e=0;e<h.options.positions.length;e++)h.options.positions[e].alt=Number((h.options.positions[e].alt+Number(w.value)).toFixed(2)),h._elms.alt[e].innerHTML=h.options.positions[e].alt;var t=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(t),h.positionEditing=!1,h.closeNodeEdit()}))}var P=i.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];h._elms.lng=[],h._elms.lngInput=[],h._elms.lat=[],h._elms.latInput=[],h._elms.alt=[],h._elms.altInput=[];for(var D=function(e){var t=document.createElement("div");t.className="tr",t.innerHTML='\n <div class="td">'.concat(e+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var i=t.getElementsByClassName("lng")[0],n=document.createElement("span");n.innerHTML=h.options.positions[e].lng.toFixed(8),i.appendChild(n);var o=document.createElement("input");o.className="input",o.type="number",o.title="",o.min=-180,o.max=180,o.value=h.options.positions[e].lng.toFixed(8);var s=t.getElementsByClassName("lat")[0],a=document.createElement("span");a.innerHTML=h.options.positions[e].lat.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-90,r.max=90,r.value=h.options.positions[e].lat.toFixed(8);var l=t.getElementsByClassName("alt")[0],c=document.createElement("span");c.innerHTML=h.options.positions[e].alt.toFixed(2),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-9999999,u.max=999999999,u.value=h.options.positions[e].alt.toFixed(2),i.addEventListener("dblclick",(function(){i.innerHTML="",o.value=Number(h.options.positions[e].lng.toFixed(8)),i.appendChild(o),o.focus(),h.positionEditing=!1,h.closeNodeEdit()})),o.addEventListener("blur",(function(){o.value=Number(h.options.positions[e].lng.toFixed(8)),i.innerHTML="",i.appendChild(n)})),o.addEventListener("input",(function(){h.options.positions[e].lng=Number(Number(o.value).toFixed(8)),n.innerHTML=h.options.positions[e].lng.toFixed(8);var t=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(t),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,t[2]]})),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(h.options.positions[e].lat.toFixed(8)),s.appendChild(r),r.focus(),h.positionEditing=!1,h.closeNodeEdit()})),r.addEventListener("blur",(function(){r.value=Number(h.options.positions[e].lat.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){h.options.positions[e].lat=Number(Number(r.value).toFixed(8)),a.innerHTML=h.options.positions[e].lat.toFixed(8);var t=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(t),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,t[2]]})),l.addEventListener("dblclick",(function(){2!=h.heightMode&&(l.innerHTML="",u.value=Number(h.options.positions[e].alt.toFixed(2)),l.appendChild(u),u.focus(),h.positionEditing=!1,h.closeNodeEdit())})),u.addEventListener("blur",(function(){u.value=Number(h.options.positions[e].alt.toFixed(2)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){h.options.positions[e].alt=Number(Number(u.value).toFixed(2)),c.innerHTML=h.options.positions[e].alt.toFixed(2);var t=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(t),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,t[2]]})),h._elms.lng.push(n),h._elms.lngInput.push(o),h._elms.lat.push(a),h._elms.latInput.push(r),h._elms.alt.push(c),h._elms.altInput.push(u),P.appendChild(t)},M=0;M<h.options.positions.length;M++)D(M);var T=Un(),O=q(h._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(O){O.legp_search(T);var N=h._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];N.value=T[h.labelFontFamily].value;for(var B=0;B<T.length;B++)if(T[B].value==N.value){O.legp_searchActive(T[B].value);break}N.addEventListener("input",(function(){for(var e=0;e<T.length;e++)if(T[e].value===N.value){h.labelFontFamily=T[e].key;break}})),h._elms.labelFontFamily=[N]}}),0),e.next=34;break;case 33:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 34:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"smoothHandle",value:function(e){for(var t=[],i=[],n=[],o=0;o<e.length;o++)n.push(e[o].lng,e[o].lat,e[o].alt),i.push(o/(e.length-1));for(var s=new Cesium.CatmullRomSpline({times:i,points:Cesium.Cartesian3.fromDegreesArrayHeights(n)}),a=20*e.length,r=0;r<=a;r++){var l=s.evaluate(r/a);t.push(this.cartesian3Towgs84(l,this.sdk.viewer))}return t}},{key:"renewPositions",value:function(e,t){var i=this;if(!this._error){var n,o=JSON.parse(JSON.stringify(e));switch(this.heightMode){case 0:case"0":!1;break;case 1:case"1":for(var s=0;s<o.length;s++){var a=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(o[s].lng,o[s].lat));o[s].alt=Number(a?(o[s].alt+Number(a)).toFixed(2):o[s].alt.toFixed(2))}!1;break;case 2:case"2":!0}var r=[];n=this.options.noseToTail&&"false"!==this.options.noseToTail?[].concat(A()(o),[o[0]]):A()(o),n=this.smoothHandle(n);for(var l=0;l<n.length;l++)r.push(n[l].lng,n[l].lat,n[l].alt);if(this.options.noseToTail&&"false"!==this.options.noseToTail||this.options.smooth&&"false"!==this.options.smooth){for(var c=[],u=0;u<r.length;u+=3)c.push({lng:r[u],lat:r[u+1],alt:r[u+2]});var h=this;this.computeDistance(c,2,this.options.wordsName).then((function(e){h.lengthByMeter=e,i.lengthChangeCallBack&&i.lengthChangeCallBack(),t&&t()}))}else{var p=this;this.computeDistance(p.smoothHandle(o),2,this.options.wordsName).then((function(e){p.lengthByMeter=e,i.lengthChangeCallBack&&i.lengthChangeCallBack(),t&&t()}))}return r}}},{key:"renewPolygon",value:function(e){var t=[];if(this.options.extend&&"false"!==this.options.extend){for(var i=[],n=0;n<e.length;n+=3)t.push([e[n],e[n+1]]);for(var o=turf.lineString(t),s=turf.buffer(o,this.options.extendWidth/1e3,{units:"kilometers"}),a=0;a<s.geometry.coordinates[0].length;a++)i.push(s.geometry.coordinates[0][a][0],s.geometry.coordinates[0][a][1]);for(var r=[],l=1;l<s.geometry.coordinates.length;l++){for(var c=[],u=0;u<s.geometry.coordinates[l].length;u++)c.push(s.geometry.coordinates[l][u][0],s.geometry.coordinates[l][u][1]);r.push({positions:Cesium.Cartesian3.fromDegreesArray(c)})}this.entity.polygon=new Cesium.PolygonGraphics({hierarchy:{positions:Cesium.Cartesian3.fromDegreesArray(i),holes:r},material:Cesium.Color.fromCssColorString(this.options.extendColor)})}else this.entity.polygon=void 0}},{key:"reset",value:(r=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.entity){e.next=2;break}return e.abrupt("return");case 2:this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineWidth=this.originalOptions.width,this.lineType=this.originalOptions.type,this.noseToTail=this.originalOptions.noseToTail,this.extend=this.originalOptions.extend,this.extendWidth=this.originalOptions.extendWidth,this.extendColor=this.originalOptions.extendColor,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.rotate=this.originalOptions.rotate,this.speed=this.originalOptions.speed,this.space=this.originalOptions.space,this.heightMode=this.options.heightMode;case 27:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=y.length>0&&void 0!==y[0]?y[0]:{},!this._error){e.next=3;break}return e.abrupt("return");case 3:if(ni(this.sdk),oi(this.sdk),pi(0),!this.options.customView){e.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Ih({},this.options.position):this.options.positions?l=Ih({},this.options.positions[0]):this.options.center?l=Ih({},this.options.center):this.options.start?l=Ih({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(l);case 17:l.alt=e.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=43;break;case 25:c=[],e.t0=this.options.heightMode,e.next="0"===e.t0||0===e.t0?29:"1"===e.t0||1===e.t0?31:"2"===e.t0||2===e.t0?36:41;break;case 29:for(h=0;h<this.options.positions.length;h++)p=Cesium.Cartesian3.fromDegrees(this.options.positions[h].lng,this.options.positions[h].lat,this.options.positions[h].alt),c.push(p.x,p.y,p.z);return e.abrupt("break",41);case 31:return e.next=33,this.getClampToHeight(this.options.positions[0]);case 33:for(u=e.sent,d=0;d<this.options.positions.length;d++)m=Cesium.Cartesian3.fromDegrees(this.options.positions[d].lng,this.options.positions[d].lat,u+this.options.positions[d].alt),c.push(m.x,m.y,m.z);return e.abrupt("break",41);case 36:return e.next=38,this.getClampToHeight(this.options.positions[0]);case 38:for(u=e.sent,f=0;f<this.options.positions.length;f++)v=Cesium.Cartesian3.fromDegrees(this.options.positions[f].lng,this.options.positions[f].lat,u),c.push(v.x,v.y,v.z);return e.abrupt("break",41);case 41:g=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(g,{offset:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 43:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"openRichTextEditor",value:function(e){var t=this;Bn.open(this.options.id,this.options.name,this.options.richTextContent),Bn.primaryCallBack=function(e){t.options.richTextContent=e}}},{key:"nodeEdit",value:function(e){var t=this;if(this.positionEditing=!1,YJ.Measure.GetMeasureStatus());else{var i;this.closeNodeEdit(),this.tip=new Q("请选择一个顶点,右键取消",this.sdk),this.event=new K(this.sdk),this.ControllerObject=new Ho(this.sdk),this._nodeEditCallback=e,this.event.mouse_left((function(e,n){var o=t.sdk.viewer.scene.pick(e.position);o&&o.id&&o.id.name&&"node-secondary-edit-point"===o.id.name&&(i=o.id,t.ControllerObject.position=t.options.positions[i.index],t.ControllerObject.editTranslational(),t.tip&&t.tip.destroy(),t.ControllerObject.controllerCallBack=function(e){0===i.index&&(t.label.position=[e.position.lng,e.position.lat,e.position.alt],t.options.label.position={lng:e.position.lng,lat:e.position.lat,alt:e.position.alt}),t.options.positions[i.index]=e.position,t._elms.lng&&(t._elms.lng[i.index].innerHTML=e.position.lng.toFixed(8)),t._elms.lngInput&&(t._elms.lngInput[i.index].value=e.position.lng.toFixed(8)),t._elms.lat&&(t._elms.lat[i.index].innerHTML=e.position.lat.toFixed(8)),t._elms.latInput&&(t._elms.latInput[i.index].value=e.position.lat.toFixed(8)),t._elms.alt&&(t._elms.alt[i.index].innerHTML=e.position.alt.toFixed(2)),t._elms.altInput&&(t._elms.altInput[i.index].value=e.position.alt.toFixed(2)),i.position=Cesium.Cartesian3.fromDegrees(e.position.lng,e.position.lat,e.position.alt)})})),this.event.mouse_right((function(e,i){for(var n=0;n<t.nodePoints.length;n++)t.sdk.viewer.entities.remove(t.nodePoints[n]);t.nodePoints=[],t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,t.ControllerObject.destroy();var o=t.renewPositions(t.options.positions);t.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(o),YJ.Measure.SetMeasureStatus(!1),t._nodeEditCallback=null})),this.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){var e=t.renewPositions(t.options.positions);return t._nodeEditCallback(t.options.positions,t.lengthByMeter),Cesium.Cartesian3.fromDegreesArrayHeights(e)}),!1);for(var n=0;n<this.options.positions.length;n++){var o=this.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:n,position:Cesium.Cartesian3.fromDegrees(this.options.positions[n].lng,this.options.positions[n].lat,this.options.positions[n].alt),billboard:{image:this.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});this.nodePoints.push(o)}}}},{key:"closeNodeEdit",value:function(){this.ControllerObject&&this.ControllerObject.destroy(),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=null;for(var e=0;e<this.nodePoints.length;e++)this.sdk.viewer.entities.remove(this.nodePoints[e]);this.nodePoints=[],this._nodeEditCallback=null}},{key:"remove",value:(n=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label&&this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=8,this.sdk.removeIncetance(this.options.id);case 8:return e.next=10,Mt(this.sdk,this.options.id);case 10:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=e,!0===e){this.closeNodeEdit(),this.event&&this.event.destroy(),this.event=new K(this.sdk),this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;var i=JSON.parse(JSON.stringify(this.options.positions)),n=this.renewPositions(this.options.positions);this.previous={positions:A()(this.options.positions)};for(var o=0;o<i.length;o++)i[o]=Cesium.Cartesian3.fromDegrees(i[o].lng,i[o].lat,i[o].alt);for(var s=i[Math.floor(i.length/2)],a=[],r=0;r<i.length;r++)a.push({x:s.x-i[r].x,y:s.y-i[r].y,z:s.z-i[r].z});var l=[],c=[];this.event.mouse_move((function(e,i){l=[],c=[];for(var o=0;o<a.length;o++){var s={x:i.x-a[o].x,y:i.y-a[o].y,z:i.z-a[o].z},r=t.cartesian3Towgs84(s,t.sdk.viewer);r.alt=t.options.positions[o].alt,l.push(s),c.push(r)}var u=c[0];n=t.renewPositions(c),t.label.position=[u.lng,u.lat,u.alt],t.options.label.position={lng:u.lng,lat:u.lat,alt:u.alt},t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,i){t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),l=[],c=[];for(var n=0;n<a.length;n++){var o={x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z},s=t.cartesian3Towgs84(o,t.sdk.viewer);s.alt=t.options.positions[n].alt,l.push(o),c.push(s)}for(var r=[],u=0;u<c.length;u++){var h=c[u];r.push(h),t._elms.lng&&(t._elms.lng[u].innerHTML=h.lng.toFixed(8)),t._elms.lngInput&&(t._elms.lngInput[u].value=h.lng.toFixed(8)),t._elms.lat&&(t._elms.lat[u].innerHTML=h.lat.toFixed(8)),t._elms.latInput&&(t._elms.latInput[u].value=h.lat.toFixed(8)),t._elms.alt&&(t._elms.alt[u].innerHTML=h.alt.toFixed(2)),t._elms.altInput&&(t._elms.altInput[u].value=h.alt.toFixed(2))}t.options.positions=r,t.previous.positions=r;var p=t.renewPositions(t.options.positions,(function(){t._positionEditingCallback&&(t._positionEditingCallback(),t._positionEditingCallback=null)}));t.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(p),t.renewPolygon(p),t.positionEditing=!1})),this.event.mouse_right((function(e,i){t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){var o=new Date,s={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};o-n>=500?(t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.positionEditing=!1):leftEvent(s,i)}))})),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArrayHeights(n)}),!1)}else{this.sdk&&this.sdk.viewer&&this.label&&this.label.entity||(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.destroy()),this.tip&&this.tip.destroy();var u=this.renewPositions(this.options.positions);switch(this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(u),this.renewPolygon(u),this.heightMode){case 0:case"0":case 1:case"1":this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat,u[2]],this.options.label.position={lng:this.options.positions[0].lng,lat:this.options.positions[0].lat,alt:u[2]};break;case 2:case"2":this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat],this.options.label.position={lng:this.options.positions[0].lng,lat:this.options.positions[0].lat,alt:u[2]}}}}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"lengthChangeCallBack",get:function(){return this._lengthChangeCallBack},set:function(e){this._lengthChangeCallBack=e}},{key:"setDIV",value:function(){var e,t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};i.x=i.x||0===i.x?i.x:10,i.y=i.y||0===i.y?i.y:10;for(var n=[],o=0;o<this.options.positions.length;o++)n.push([this.options.positions[o].lng,this.options.positions[o].lat]);var s=turf.lineString(n),a=turf.length(s,{units:"kilometers"}),r=turf.lineSliceAlong(s,0,a/2,{units:"kilometers"}),l=document.getElementById(i.domid),c=(e=Cesium.Cartesian3).fromDegrees.apply(e,A()(r.geometry.coordinates[r.geometry.coordinates.length-1]));this.sdk.viewer.scene.postRender.addEventListener((function(e){if("block"===l.style.display||""===l.style.display){var n=t.sdk.viewer.scene.cartesianToCanvasCoordinates(c);n&&(l.style.left=(n.x+i.x).toFixed(0)+"px",l.style.top=(n.y+i.y).toFixed(0)+"px")}}))}}],[{key:"createLabel",value:(i=o()(a.a.mark((function e(t){var i,n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=A()(t.sdk.viewer.entities.values),e.t0=t.options.heightMode,e.next="0"===e.t0||0===e.t0?4:"1"===e.t0||1===e.t0?7:"2"===e.t0||2===e.t0?14:19;break;case 4:return n=!1,i=t.options.positions[0].alt,e.abrupt("break",19);case 7:return n=!1,e.next=10,t.getClampToHeight({lng:t.options.positions[0].lng,lat:t.options.positions[0].lat},o);case 10:return e.t1=e.sent,e.t2=t.options.positions[0].alt,i=e.t1+e.t2,e.abrupt("break",19);case 14:return n=!0,e.next=17,t.getClampToHeight({lng:t.options.positions[0].lng,lat:t.options.positions[0].lat},o);case 17:return i=e.sent,e.abrupt("break",19);case 19:t.options.label.position||(t.options.label.position={lng:t.options.positions[0].lng,lat:t.options.positions[0].lat,alt:i}),t.label=new Xn(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.label.position.lng,t.options.label.position.lat,t.options.label.position.alt],text:t.options.name,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far,ground:n});case 21:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"create",value:function(e){var i;i=2==e.heightMode;var n=e.options.positions,o=e.renewPositions(n);e.entity=e.sdk.viewer.entities.add({id:e.options.id,show:e.options.show,polyline:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(o),width:e.options.width,clampToGround:i,zIndex:e.sdk._entityZIndex}}),e.entity.polyline.oriWidth=e.options.width,e.judgeLine(e.entity,e.options);var s=Ih({},e.options);s.speed=e.inputSpeed,e.entity.polyline.material=e.getMaterial(e.options.color,e.options.type,e.entity,s),e.sdk._entityZIndex++,t.createLabel(e),e.renewPolygon(o),e.computeDistance(e.smoothHandle(n),2,e.options.wordsName).then((function(t){e.lengthByMeter=t,e.lengthChangeCallBack&&e.lengthChangeCallBack(),Mt(e.sdk,e.options.id)})),e.options.show&&Qe(0,e.options.id);e.sdk.viewer.scene}}]);var i,n,s,r,l}(Vn);function Fh(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 zh(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Fh(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Fh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Hh(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Vh=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(i=Hh(this,t,[e,n])).viewer=e.viewer,i.options.show=!n.show&&!1!==n.show||n.show,i.options.name=i.options.name||"未命名对象",i.options.size=i.options.size||0===i.options.size?i.options.size:80,i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.event=new K(i.sdk),i.Dialog=o,i.operate={},i._elms={},i._EventBinding=new xn,i.sdk.addIncetance(i.options.id,i),t.create(i),i}return un()(t,e),x()(t,[{key:"type",get:function(){return"Explosion"}},{key:"edit",value:(s=o()(a.a.mark((function e(t){var i,n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 7:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" explosion",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">随地图缩放</span>\n <input class="btn-switch" type="checkbox" @model="scaleByDistance">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">爆炸范围</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="999999" @model="size">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,this.scaleByDistance=this.options.scaleByDistance;case 16:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:{},pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=zh({},this.options.position):this.options.positions?l=zh({},this.options.positions[0]):this.options.center?l=zh({},this.options.center):this.options.start?l=zh({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=16;break}return e.next=15,this.getClampToHeight(l);case 15:l.alt=e.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=24;break;case 23:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt+8*this.options.size),orientation:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-85),roll:Cesium.Math.toRadians(0)}});case 24:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.previous=null,this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.size=this.originalOptions.size,this.scaleByDistance=this.originalOptions.scaleByDistance,this.lng=this.options.position.lng,this.lat=this.options.position.lat)}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(e){this.options.scaleByDistance=e,this.entity.billboard.sizeInMeters=e,this._elms.scaleByDistance&&this._elms.scaleByDistance.forEach((function(t){t.checked=e}))}},{key:"lng",get:function(){return this.options.position.lng},set:function(e){this.options.position.lng=e,this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e}))}},{key:"lat",get:function(){return this.options.position.lat},set:function(e){this.options.position.lat=e,this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e}))}},{key:"alt",get:function(){return this.options.position.alt},set:function(e){this.options.position.alt=e,this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e}))}},{key:"size",get:function(){return this.options.size},set:function(e){this.options.size=e,this.entity.billboard.width=this.options.size,this.entity.billboard.height=this.options.size,this._elms.size&&this._elms.size.forEach((function(t){t.value=e}))}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity&&(this.operate.positionEditing=e,!0===e?(this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.previous={position:zh({},this.options.position)},this.event.mouse_move((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=n.lng,t.lat=n.lat,t.alt=n.alt,t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=n.lng,t.lat=n.lat,t.alt=n.alt,t.previous={position:zh({},t.options.position)},t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t._positionEditingCallback&&(t._positionEditingCallback(),t._positionEditingCallback=null),t.positionEditing=!1})),this.event.mouse_right((function(e,i){t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.positionEditing=!1;else{var e=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=e.lng,t.lat=e.lat,t.alt=e.alt,t.previous={position:zh({},t.options.position)},t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.positionEditing=!1}}))}))):(this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),this.previous&&(this.lng=this.previous.position.lng,this.lat=this.previous.position.lat,this.alt=this.previous.position.alt)))}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"closePositionEditing",value:function(){this.positionEditing=!1,this._positionEditingCallback=null}},{key:"remove",value:(i=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),e.next=7,this.sdk.removeIncetance(this.options.id);case 7:return e.next=9,Mt(this.sdk,this.options.id);case 9:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"create",value:function(e){for(var t=[],i=10001;i<=10120;i++){var n=e.getSourceRootPath()+"/img/frameAnimation/explosion/b".concat(i,".png");t.push(n)}var o=new Cesium.Entity({id:e.options.id,show:e.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(e.options.position.lng,e.options.position.lat,e.options.position.alt)}),!1),billboard:{image:new Cesium.CallbackProperty((function(){var e=t[o.imgIndex];return o.imgIndex++,o.imgIndex>=t.length&&(o.imgIndex=0),e}),!1),disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ii()?void 0:Number.POSITIVE_INFINITY}),!1),width:e.options.size,height:e.options.size,sizeInMeters:e.options.scaleByDistance,pixelOffset:{x:0,y:-20}}});o.imgIndex=0,e.entity=e.viewer.entities.add(o),Mt(e.sdk,e.options.id),e.options.show&&Qe(0,e.options.id)}}]);var i,n,s}(Vn);function Gh(e){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">扩散半径</span>\n <div class="input-number input-number-unit-2 input-radius">\n <input class="input" type="number" title="" data-min="0.1" max="999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <div class="input-radius-unit-box" style="flex: 0 0 60px;">\n <div class="input-radius-unit"></div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label">持续时间</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="100" max="99999" @model="duration">\n <span class="unit">ms</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <div class="row">\n <div class="col">\n <span class="label">范围颜色</span>\n <div class="colorOut"></div>\n </div>\n <div class="col">\n <span class="label">扫描颜色</span>\n <div class="colorIn"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="radar-scan-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Wh(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 Uh(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Wh(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Wh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Yh(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Jh=function(e){function t(e,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(n=Yh(this,t,[e,i])).options.lng=i.lng,n.options.lat=i.lat,n.options.alt=i.alt,n.options.colorOut=i.colorOut||"rgba(255,255,0,0.3)",n.options.colorIn=i.colorIn||"rgba(255,0,0,0.3)",n.options.radius=i.radius||10,n.options.radius>999999&&(n.options.radius=999999),n.options.duration=i.duration||2e3,n.event=new K(n.sdk),i.label=i.label||{},n.options.label={show:i.label.show||!1,fontSize:i.label.fontSize||0===i.label.fontSize?i.label.fontSize:20,fontFamily:i.label.fontFamily?i.label.fontFamily:0,color:i.label.color||"#ffffff",lineWidth:i.label.lineWidth||0===i.label.lineWidth?i.label.lineWidth:4,pixelOffset:i.label.pixelOffset||0===i.label.pixelOffset?i.label.pixelOffset:20,backgroundColor:i.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:i.label.lineColor||"#00ffff80",scaleByDistance:i.label.scaleByDistance||!1,near:i.label.near||0===i.label.near?i.label.near:2e3,far:i.label.far||0===i.label.far?i.label.far:1e5},n.options.attribute=i.attribute||{},n.options.attribute.link=n.options.attribute.link||{},n.options.attribute.link.content=n.options.attribute.link.content||[],n.options.richTextContent=i.richTextContent||"",n._elms={},n.Dialog=o,n._EventBinding=new xn,n.ControllerObject=new Ho(n.sdk),n.sdk.addIncetance(n.options.id,n),t.radarSolidScan(n),n}return un()(t,e),x()(t,[{key:"type",get:function(){return"RadarScanStereoscopic"}},{key:"positionEditing",get:function(){return"translational"===this.ControllerObject.getActiveState()},set:function(e){var t=this;this.sdk&&this.sdk.viewer&&this.entity&&(e?(this.picking=!1,this.ControllerObject.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this.ControllerObject.editTranslational(),this.ControllerObject.controllerCallBack=function(e){t.lng=e.position.lng,t.lat=e.position.lat,t.alt=e.position.alt,t._positionEditingCallback&&t._positionEditingCallback()}):(setTimeout((function(){t.picking=!0}),500),this.ControllerObject.destroy(),this._positionEditingCallback=null))}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"closePositionEditing",value:function(){this.positionEditing=!1,this._positionEditingCallback=null}},{key:"lng",get:function(){return this.options.lng},set:function(e){this.options.lng=Number(e),this.label.position=[e,this.lat,this.alt+this.radius],this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e})),t.changeParam(this)}},{key:"lat",get:function(){return this.options.lat},set:function(e){this.options.lat=Number(e),this.label.position=[this.lng,e,this.alt+this.radius],this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e})),t.changeParam(this)}},{key:"alt",get:function(){return this.options.alt},set:function(e){this.options.alt=Number(e),this.label.position=[this.lng,this.lat,e+this.radius],this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e})),t.changeParam(this)}},{key:"radius",get:function(){return this.options.radius},set:function(e){var i=Number(e.toFixed(2));(i>999999&&(i=999999),i<.1&&(i=.1),this.options.radius=i,this.label.position=[this.lng,this.lat,this.alt+e],this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content)&&("千米"===this._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value&&(i=Number((i/1e3).toFixed(5))));this._elms.radius&&this._elms.radius.forEach((function(e){e.value=i})),t.changeParam(this)}},{key:"duration",get:function(){return this.options.duration},set:function(e){this.options.duration=e,this._elms.duration&&this._elms.duration.forEach((function(t){t.value=e})),t.changeParam(this)}},{key:"colorOut",get:function(){return this.options.colorOut},set:function(e){var t=this;this.options.colorOut=e,this.entity.ellipsoid.material=Cesium.Color.fromCssColorString(e),this.entity.ellipsoid.outlineColor=Cesium.Color.fromCssColorString(e),this._elms.colorOut&&this._elms.colorOut.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.colorOut=e},clear:function(){t.colorOut="rgba(255,255,255,1)"}});t._elms.colorOut[n]=o}))}},{key:"colorIn",get:function(){return this.options.colorIn},set:function(e){var t=this;this.options.colorIn=e,this.entity.wall.material=Cesium.Color.fromCssColorString(e),this._elms.colorIn&&this._elms.colorIn.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.colorIn=e},clear:function(){t.colorIn="rgba(255,255,255,1)"}});t._elms.colorIn[n]=o}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){this.options.label.show=e,this.show&&!this.showView||3==this.showView?this.label.show=e:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label.color=e,this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label.fontSize=e,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label.scaleByDistance=e,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(e){this.options.label.lineWidth=e,this.label.lineWidth=e,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(t){t.value=e}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(e){this.options.label.pixelOffset=e,this.label.pixelOffset=e,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(t){t.value=e}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(e){var t=this;this.options.label.lineColor=e,this.label.lineColor=e,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelLineColor=e},clear:function(){t.labelLineColor="rgba(0,255,255,0.5)"}});t._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label.backgroundColor=[e,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label.backgroundColor=[this.label.backgroundColor[0],e],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"edit",value:(r=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h,p=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 7:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" radar-scan-stereoscopic",(i=document.createElement("div")).innerHTML=Gh(this),this._DialogObject.contentAppChild(i),new En("radar-scan-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("colorOut")[0],size:"mini",alpha:!0,defaultColor:this.colorOut,disabled:!1,openPickerAni:"opacity",sure:function(e){p.colorOut=e},clear:function(){p.colorOut="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("colorIn")[0],size:"mini",alpha:!0,defaultColor:this.colorIn,disabled:!1,openPickerAni:"opacity",sure:function(e){p.colorIn=e},clear:function(){p.colorIn="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){p.labelColor=e},clear:function(){p.labelColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){p.labelLineColor=e},clear:function(){p.labelLineColor="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){p.labelBackgroundColorStart=e},clear:function(){p.labelBackgroundColorStart="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){p.labelBackgroundColorEnd=e},clear:function(){p.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),u=i.getElementsByTagName("*"),this._EventBinding.on(this,u),this._elms=this._EventBinding.element,this._elms.colorOut=[n],this._elms.colorIn=[o],this._elms.labelColor=[s],this._elms.labelLineColor=[r],this._elms.labelBackgroundColorStart=[l],this._elms.labelBackgroundColorEnd=[c],(h=this._DialogObject._element.content.getElementsByClassName("input-radius")[0].getElementsByTagName("input")[0]).value=this.options.radius,this._elms.radius=[h],h.addEventListener("input",(function(e){var t=p._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(e.target.value||0===e.target.value){var i=e.target.value;i=Number(i),"."==e.data||"-"==e.data&&!e.target.value||(!e.target.max&&!e.target.min||i<=Number(e.target.max)/("米"===t?1:1e3)&&i>=Number(e.target.min))&&(p.radius=i*("米"===t?1:1e3))}})),h.addEventListener("blur",(function(e){var t=p._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(e.target.value||0===e.target.value){var i=e.target.value;i=Number(i),e.target.max&&i>Number(e.target.max)/("米"===t?1:1e3)&&(i=Number(e.target.max)/("米"===t?1:1e3)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),p.radius=Number((i*("米"===t?1:1e3)).toFixed(2))}})),setTimeout((function(){var e=p.attributeSelect,t=p._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(t){var i=q(t,".attribute-select");i.legp_search(e);for(var n=t.getElementsByTagName("input")[0],o=0;o<e.length;o++)if(e[o].key===p.options.attributeType){n.value=e[o].value,i.legp_searchActive(e[o].value);break}n.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===n.value){p.attributeType=e[t].key;break}}))}var s=[{name:"米",value:"米"},{name:"千米",value:"千米"}],a=p._DialogObject._element.content.getElementsByClassName("input-radius-unit-box")[0];if(a){q(a,".input-radius-unit").legp_search(s);var r=p._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0];r.value=s[0].value,r.addEventListener("input",(function(){var e=p._DialogObject._element.content.getElementsByClassName("input-radius")[0],t=e.getElementsByClassName("unit")[0],i=e.getElementsByClassName("input")[0];switch(r.value){case"米":"km"===t.innerHTML&&(t.innerHTML="m",i.value=Number((1e3*i.value).toFixed(2)));break;case"千米":"m"===t.innerHTML&&(t.innerHTML="km",i.value=Number((i.value/1e3).toFixed(5)))}}))}var l=Un(),c=q(p._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(c){c.legp_search(l);var u=p._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];u.value=l[p.labelFontFamily].value;for(var h=0;h<l.length;h++)if(l[h].value==u.value){c.legp_searchActive(l[h].value);break}u.addEventListener("input",(function(){for(var e=0;e<l.length;e++)if(l[e].value===u.value){p.labelFontFamily=l[e].key;break}})),p._elms.labelFontFamily=[u]}}),0);case 34:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:{},pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Uh({},this.options.position):this.options.positions?l=Uh({},this.options.positions[0]):this.options.center?l=Uh({},this.options.center):this.options.start?l=Uh({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=16;break}return e.next=15,this.getClampToHeight(l);case 15:l.alt=e.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=27;break;case 23:return e.next=25,this.getClampToHeight({lng:this.options.lng,lat:this.options.lat});case 25:c=e.sent,this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,6*this.options.radius+c),orientation:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},duration:1});case 27:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.alt=this.originalOptions.alt,this.colorOut=this.originalOptions.colorOut,this.colorIn=this.originalOptions.colorIn,this.radius=this.originalOptions.radius,this.duration=this.originalOptions.duration,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.positionEditing=!1)}},{key:"remove",value:(n=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=6,this.sdk.removeIncetance(this.options.id);case 6:return e.next=8,Mt(this.sdk,this.options.id);case 8:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"setDIV",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};t.x=t.x||0===t.x?t.x:10,t.y=t.y||0===t.y?t.y:10;var i=document.getElementById(t.domid),n=Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,this.options.alt+this.options.radius);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=e.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+t.x).toFixed(0)+"px",i.style.top=(s.y+t.y).toFixed(0)+"px")}}))}}],[{key:"radarSolidScan",value:function(e){var i=e.sdk.viewer,n=e.options,o=(n.radius,n.lng,n.lat,n.alt,e.options.duration?360/e.options.duration*Cesium.getTimestamp():0),s=a(e.options,e.options.radius,o);(new Date).getTime();function a(e,t,i){var n=e.lng,o=e.lat,s=e.alt,a=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(n,o,s)),r=t*Math.cos(i*Math.PI/180),l=t*Math.sin(i*Math.PI/180),c=Cesium.Cartesian3.fromElements(r,l,s),u=Cesium.Matrix4.multiplyByPoint(a,c,new Cesium.Cartesian3),h=Cesium.Cartographic.fromCartesian(u);return function(e,t,i,n,o){var s=[],a=[];s.push(e,t,o),a.push(o);for(var r=Cesium.Cartesian3.distance(Cesium.Cartesian3.fromDegrees(e,t),Cesium.Cartesian3.fromDegrees(i,n)),l=0;l<=90;l++){var c=r*Math.sin(l*Math.PI/180),u=Math.cos(l*Math.PI/180),h=(i-e)*u+e,p=(n-t)*u+t;s.push(h,p,c+o),a.push(o)}return{positionArr:s,bottomArr:a}}(n,o,Cesium.Math.toDegrees(h.longitude),Cesium.Math.toDegrees(h.latitude),s)}i.clock.onTick.addEventListener((function(){o=e.options.duration?360/e.options.duration*Cesium.getTimestamp():0,s=a(e.options,e.options.radius,o)})),e.entity=i.entities.add({id:e.options.id,show:e.options.show,position:new Cesium.CallbackProperty((function(){return new Cesium.Cartesian3.fromDegrees(e.options.lng,e.options.lat,e.options.alt)}),!1),ellipsoid:{radii:new Cesium.CallbackProperty((function(){return new Cesium.Cartesian3(e.options.radius,e.options.radius,e.options.radius)}),!1),material:Cesium.Color.fromCssColorString(n.colorOut),outline:!0,outlineColor:Cesium.Color.fromCssColorString(n.colorOut),outlineWidth:1,maximumCone:Cesium.Math.toRadians(90)},wall:{positions:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArrayHeights(s.positionArr)}),!1),material:Cesium.Color.fromCssColorString(n.colorIn),minimumHeights:new Cesium.CallbackProperty((function(){return s.bottomArr}),!1)}}),t.createLabel(e),Mt(e.sdk,e.options.id),e.options.show&&Qe(0,e.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function e(t){var i,n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.options.alt){e.next=4;break}i=t.options.alt+t.options.radius,e.next=8;break;case 4:return n=A()(t.sdk.viewer.entities.values),e.next=7,t.getClampToHeight({lng:t.options.lng,lat:t.options.lat},n);case 7:i=e.sent;case 8:t.options.label.position={lng:t.options.lng,lat:t.options.lat,alt:i},t.label=new Xn(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.label.position.lng,t.options.label.position.lat,t.options.label.position.alt],text:t.options.name,ground:!1,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far});case 10:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"changeParam",value:function(e){}}]);var i,n,s,r}(Vn);function qh(e){return'\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <DIV-cy-tabs id="circle-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(jn(e),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ',"\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n ")}function Xh(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 Zh(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Xh(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Xh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Kh(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Qh(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)?Qh(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Qh(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 $h(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var ep=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=$h(this,t,[e,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"rgba(255, 0, 0, 0.5)",i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.semiMinorAxis=n.semiMinorAxis||0===n.semiMinorAxis?n.semiMinorAxis:10,i.options.semiMajorAxis=n.semiMajorAxis||0===n.semiMajorAxis?n.semiMajorAxis:20,i.options.show=!n.show&&!1!==n.show||n.show,i.options.center=n.center||{},i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",n.label=n.label||{},i._elms={},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.options.richTextContent=n.richTextContent||"",i.event=new K(i.sdk),i.nodePoints=[],i.operate={},i.Dialog={},i.sdk.addIncetance(i.options.id,i),t.create(i),i}return un()(t,e),x()(t,[{key:"type",get:function(){return"SectorObject"}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(e){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=e||0==e?e:2,i.positionEditing=!1,i.entity){var n="";t.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(A()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.center.alt},set:function(e){var t,i=this;!e||isNaN(Number(e))?this.options.center.alt=0:this.options.center.alt=Number(Number(e).toFixed(2)),t=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.entity.polygon.perPositionHeight=!t,i.entity.polyline.positions=[].concat(A()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polyline.clampToGround=!!t,i.entity.polyline.arcType=t?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(e){e.innerHTML=i.options.center.alt}))}},{key:"startAngle",get:function(){return this.options.startAngle},set:function(e){this.options.startAngle=e,this.height=this.height}},{key:"endAngle",get:function(){return this.options.endAngle},set:function(e){this.options.endAngle=e,this.height=this.height}},{key:"center",get:function(){return this.options.center},set:function(e){var t=this;this.options.center=e,this.height=this.height,this._elms.lng&&this._elms.lng.forEach((function(e){e.innerHTML=t.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(e){e.innerHTML=t.options.center.lat}))}},{key:"radius",get:function(){return this.options.radius},set:function(e){this.options.radius=e,this.height=this.height}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;if(this.options.color=e||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this.entity.polyline.width=this.lineWidth,this._elms.color&&this._elms.color.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,0,0,0.5)"}});t._elms.color[i]=n}))}}},{key:"lineColor",get:function(){return this.options.line.color},set:function(e){var t=this;this.options.line.color=e||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.lineColor=e},clear:function(){t.lineColor="rgba(255,0,0,0.5)"}});t._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(e){var t=this;this.options.line.width=e||0===e?e:3,this.entity.polyline.width=this.options.line.width,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(e){e.value=t.options.line.width}))}},{key:"area",get:function(){return this.options.area},set:function(e){this.options.area=e,this._elms.area&&this._elms.area.forEach((function(t){t.value=e}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(e){if(this.options["area-unit"]=e,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(t){t.value=e})),this.options.areaByMeter)switch(e){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){this.options.label.show=e,this.show&&!this.showView||3==this.showView?this.label.show=e:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label.color=e,this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label.fontSize=e,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label.scaleByDistance=e,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label.near=t,this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label.far=t,this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(e){this.options.label.lineWidth=e,this.label.lineWidth=e,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(t){t.value=e}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(e){this.options.label.pixelOffset=e,this.label.pixelOffset=e,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(t){t.value=e}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(e){var t=this;this.options.label.lineColor=e,this.label.lineColor=e,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelLineColor=e},clear:function(){t.labelLineColor="rgba(0,255,255,0.5)"}});t._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(e){var t=this;this.options.label.backgroundColor[0]=e,this.label.backgroundColor=[e,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorStart=e},clear:function(){t.labelBackgroundColorStart="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(e){var t=this;this.options.label.backgroundColor[1]=e,this.label.backgroundColor=[this.label.backgroundColor[0],e],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelBackgroundColorEnd=e},clear:function(){t.labelBackgroundColorEnd="rgba(255,255,255,1)"}});t._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(e){this.options.attributeType=e,this._elms.attributeType&&this._elms.attributeType.forEach((function(t){t.value=e}));for(var t=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<t.length;i++)t[i].className.indexOf("attribute-content-"+e)>-1?t[i].style.display="block":t[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(e){var t=this;if(this.options.attribute.link.content=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),h={linkEdit:(c=o()(a.a.mark((function e(i){var n,o,s,r,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.options.attribute.link.content;case 2:t.attributeLink=e.sent,n=t._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function e(n){var o,r,l,c,u,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==n){e.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){e.next=35;break}if(l[c]&&l[c].attributes){e.next=14;break}return e.abrupt("continue",32);case 14:u=Kh(l[c].attributes),e.prev=15,d=a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("@click"!==(t=p.value).name){e.next=5;break}return l[c].addEventListener("click",(function(e){"function"==typeof h[t.value]&&h[t.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(t.name),e.abrupt("return",1);case 5:case"end":return e.stop()}}),e)})),u.s();case 18:if((p=u.n()).done){e.next=24;break}return e.delegateYield(d(),"t0",20);case 20:if(!e.t0){e.next=22;break}return e.abrupt("break",24);case 22:e.next=18;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(15),u.e(e.t1);case 29:return e.prev=29,u.f(),e.finish(29);case 32:c++,e.next=11;break;case 35:return e.abrupt("return",1);case 36:case"end":return e.stop()}}),e,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){e.next=15;break}return e.delegateYield(r(l),"t0",10);case 10:if(!e.t0){e.next=12;break}return e.abrupt("break",15);case 12:l++,e.next=8;break;case 15:case"end":return e.stop()}}),e)}))),function(e){return c.apply(this,arguments)}),linkDelete:function(e){t.options.attribute.link.content.splice(e,1),t.attributeLink=t.options.attribute.link.content},confirmEdit:function(e,i){var n=e.name&&e.name.replace(/\s/g,""),o=e.url&&e.url.replace(/\s/g,"");n&&o?t.options.attribute.link.content[i]=e:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),t.attributeLink=t.options.attribute.link.content},cancelEdit:function(){t.attributeLink=t.options.attribute.link.content},fileSelect:function(e,t){var i=u[t].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",p),i.addEventListener("change",p)}},p=function(e){e.target.value&&(u[e.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=e.target.value,e.target.value=null)},d=function(e){for(var t=u[e].getElementsByTagName("button"),i=0;i<t.length;i++)if(t[i]&&t[i].attributes){var n,o=Kh(t[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return t[i].addEventListener("click",(function(t){"function"==typeof h[o.value]&&h[o.value](e)})),t[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(e){o.e(e)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(e){this.options.attribute.camera.content=e}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(e){var t=this;if(this.options.attribute.vr.content=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),h={vrEdit:(c=o()(a.a.mark((function e(i){var n,o,s,r,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.options.attribute.vr.content;case 2:t.attributeVr=e.sent,n=t._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function e(n){var o,r,l,c,u,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==n){e.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=t.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=t.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){e.next=35;break}if(l[c]&&l[c].attributes){e.next=14;break}return e.abrupt("continue",32);case 14:u=Kh(l[c].attributes),e.prev=15,d=a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("@click"!==(t=p.value).name){e.next=5;break}return l[c].addEventListener("click",(function(e){"function"==typeof h[t.value]&&h[t.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(t.name),e.abrupt("return",1);case 5:case"end":return e.stop()}}),e)})),u.s();case 18:if((p=u.n()).done){e.next=24;break}return e.delegateYield(d(),"t0",20);case 20:if(!e.t0){e.next=22;break}return e.abrupt("break",24);case 22:e.next=18;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(15),u.e(e.t1);case 29:return e.prev=29,u.f(),e.finish(29);case 32:c++,e.next=11;break;case 35:return e.abrupt("return",1);case 36:case"end":return e.stop()}}),e,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){e.next=15;break}return e.delegateYield(r(l),"t0",10);case 10:if(!e.t0){e.next=12;break}return e.abrupt("break",15);case 12:l++,e.next=8;break;case 15:case"end":return e.stop()}}),e)}))),function(e){return c.apply(this,arguments)}),vrDelete:function(e){t.options.attribute.vr.content.splice(e,1),t.attributeVr=t.options.attribute.vr.content},confirmEdit:function(e,i){var n=e.name&&e.name.replace(/\s/g,""),o=e.url&&e.url.replace(/\s/g,"");n&&o?t.options.attribute.vr.content[i]=e:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),t.attributeVr=t.options.attribute.vr.content},cancelEdit:function(){t.attributeVr=t.options.attribute.vr.content},fileSelect:function(e,t){var i=u[t].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",p),i.addEventListener("change",p)}},p=function(e){e.target.value&&(u[e.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=e.target.value,e.target.value=null)},d=function(e){for(var t=u[e].getElementsByTagName("button"),i=0;i<t.length;i++)if(t[i]&&t[i].attributes){var n,o=Kh(t[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return t[i].addEventListener("click",(function(t){"function"==typeof h[o.value]&&h[o.value](e)})),t[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(e){o.e(e)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(e){this.options.attribute.goods.content=e}},{key:"edit",value:(r=o()(a.a.mark((function e(i){var n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){e.next=59;break}return o=function(){var e=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];e.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];var i=document.createElement("div");i.className="tr",i.innerHTML='\n <div class="td align-center">圆心坐标</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ';var o=i.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.center.lng.toFixed(8),o.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.center.lng.toFixed(8);var l=i.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.center.lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.center.lat.toFixed(8);var h=i.getElementsByClassName("alt")[0],p=document.createElement("span");p.innerHTML=n.height.toFixed(2),h.appendChild(p);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),o.addEventListener("dblclick",(function(){o.innerHTML="",r.value=Number(n.options.center.lng.toFixed(8)),o.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.center.lng.toFixed(8)),o.innerHTML="",o.appendChild(a)})),r.addEventListener("input",(function(){n.options.center.lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.center.lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.center.lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.center.lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.center.lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.center.lat.toFixed(8),n.height=n.height})),h.addEventListener("dblclick",(function(){2!=n.heightMode&&(h.innerHTML="",d.value=Number(n.height.toFixed(2)),h.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),t.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),h.innerHTML="",h.appendChild(p)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),p.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(p),n._elms.altInput.push(d),e.appendChild(i)},e.next=7,new pn(this.sdk,this.options,{title:"扇形属性",left:"180px",top:"100px",confirmCallBack:function(e){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.options.label.position={lng:w.label.position[0],lat:w.label.position[1],alt:w.label.position[2]},w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions),Mt(w.sdk,w.options.id),at(w.sdk,w.options.id)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){w.reset(),w.positionEditing=!1,w.Dialog.closeCallBack&&w.Dialog.closeCallBack()},showCallBack:function(e){w.options.show=e,w.originalOptions.show=e,w.show=e,w.Dialog.showCallBack&&w.Dialog.showCallBack()},translationalCallBack:function(){w.positionEditing=!w.positionEditing},secondaryEditCallBack:function(){t.nodeEdit(w,(function(){o()}))}});case 7:if(this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" circle",(s=document.createElement("div")).innerHTML=qh(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new En("circle-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){w.color=e},clear:function(){w.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){w.lineColor=e},clear:function(){w.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelColor=e},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelLineColor=e},clear:function(){w.labelLineColor="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelBackgroundColorStart=e},clear:function(){w.labelBackgroundColorStart="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelBackgroundColorEnd=e},clear:function(){w.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),t.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[h],this._elms.labelBackgroundColorEnd=[p],m=this._DialogObject._element.content.getElementsByClassName("height-box")[0],f=m.getElementsByClassName("height")[0],v=this._DialogObject._element.content.getElementsByClassName("height-confirm")[0],f.value=10,2==this.heightMode?(m&&(m.className="input-number input-number-unit-1 height-box disabled"),v&&v.setAttribute("disabled","disabled")):(m&&(m.className="input-number input-number-unit-1 height-box"),v&&v.removeAttribute("disabled")),g=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],!(y=q(this._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){e.next=56;break}y.legp_search(g),b=this._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],C=0;case 40:if(!(C<g.length)){e.next=48;break}if(g[C].key!=this.heightMode){e.next=45;break}return b.value=g[C].value,y.legp_searchActive(g[C].value),e.abrupt("break",48);case 45:C++,e.next=40;break;case 48:b.addEventListener("input",(function(){for(var e=0;e<g.length;e++)if(g[e].value===b.value){w.heightMode=g[e].key;break}})),f.addEventListener("input",(function(){w.heightMode})),this._elms.height=f,this._elms.heightBox=m,this._elms.heightMode=b,this._elms.heightConfirm=v,this._elms.heightModeObject=y,v.addEventListener("click",(function(){w.operate.positionEditing?(w.positionEditing=!1,w.height=w.height+Number(f.value)):(t.closeNodeEdit(w),w.heightMode=w.heightMode,setTimeout((function(){w.height=w.height+Number(f.value)}),100))}));case 56:setTimeout((function(){w.attributeLink=w.options.attribute.link.content,w.attributeVr=w.options.attribute.vr.content,w.cameraSelect&&w.cameraSelect(),w.goodsSelect&&w.goodsSelect();var e=w.attributeSelect,t=w._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(t){var i=q(t,".attribute-select");i.legp_search(e);for(var n=w._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<e.length;s++)if(e[s].key===w.options.attributeType){n.value=e[s].value,i.legp_searchActive(e[s].value);break}n.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===n.value){w.attributeType=e[t].key;break}}))}var a=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],r=q(w._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=w._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];l.value=w.options["area-unit"];for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var e=0;e<a.length;e++)if(a[e].value===l.value){w.areaUnit=a[e].value;break}}))}var u=Un(),h=q(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(h){h.legp_search(u);var p=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];p.value=u[w.labelFontFamily].value;for(var d=0;d<u.length;d++)if(u[d].value==p.value){h.legp_searchActive(u[d].value);break}p.addEventListener("input",(function(){for(var e=0;e<u.length;e++)if(u[e].value===p.value){w.labelFontFamily=u[e].key;break}})),w._elms.labelFontFamily=[p]}o()}),0),e.next=60;break;case 59:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 60:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"reset",value:function(){var e=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.radius=this.originalOptions.radius,this.color=this.originalOptions.color,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelColor=this.originalOptions.label.color,this.lineWidth=this.originalOptions.line.width,this.lineLength=this.originalOptions.line.length,this.lineColor=this.originalOptions.line.color,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect(),this.heightMode=this.originalOptions.heightMode,this._elms.lng&&this._elms.lng.forEach((function(t){t.innerHTML=e.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.innerHTML=e.options.center.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=e.options.center.alt}));for(var t=0;t<this.nodePoints.length;t++)this.sdk.viewer.entities.remove(this.nodePoints[t]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy()}}},{key:"remove",value:(s=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=8,this.sdk.removeIncetance(this.options.id);case 8:return e.next=10,Mt(this.sdk,this.options.id);case 10:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(e){this.options.attribute.link.content.push({name:"链接",url:e}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(e){this.options.attribute.vr.content.push({name:"全景图",url:e}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w,k,_,x,E=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=E.length>0&&void 0!==E[0]?E[0]:{},pi(0),ni(this.sdk),oi(this.sdk),!this.options.customView){e.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Zh({},this.options.position):this.options.positions?l=Zh({},this.options.positions[0]):this.options.center?l=Zh({},this.options.center):this.options.start?l=Zh({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=16;break}return e.next=15,this.getClampToHeight(l);case 15:l.alt=e.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=60;break;case 23:c=this.entity.polyline.positions.getValue(),u=[],h=0,p=this.cartesian3Towgs84(c[0],this.sdk.viewer),d=Cesium.Cartesian3.fromDegrees(p.lng,p.lat,0),m=Cesium.Cartesian3.fromDegrees(p.lng,p.lat,1e7),f=Cesium.Cartesian3.subtract(m,d,new Cesium.Cartesian3),v=Cesium.Cartesian3.normalize(f,f),g=new Cesium.Ray(d,v),y={},b=this.sdk.viewer.scene.drillPickFromRay(g),C=0;case 35:if(!(C<b.length)){e.next=42;break}if(!b[C].position){e.next=39;break}return y=b[C],e.abrupt("break",42);case 39:C++,e.next=35;break;case 42:if(!y||!y.position){e.next=46;break}h=this.cartesian3Towgs84(y.position,this.sdk.viewer).alt,e.next=55;break;case 46:return e.prev=46,e.next=49,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(p.lng,p.lat)]);case 49:w=e.sent,h=w[0].height,e.next=55;break;case 53:e.prev=53,e.t0=e.catch(46);case 55:for(k=Cesium.Cartesian3.fromDegrees(p.lng,p.lat,h),u.push(k.x,k.y,k.z),_=1;_<c.length;_++)u.push(c[_].x,c[_].y,c[_].z);x=Cesium.BoundingSphere.fromVertices(u),this.sdk.viewer.camera.flyToBoundingSphere(x,{offset:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 60:case"end":return e.stop()}}),e,this,[[46,53]])}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(e){var t=this;Bn.open(this.options.id,this.options.name,this.options.richTextContent),Bn.primaryCallBack=function(e){t.options.richTextContent=e}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(e){var t=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=this;this.operate.positionEditing=e,this.event&&this.event.destroy(),this.event=new K(this.sdk),!0===e?(this.previous={center:this.deepCopyObj(this.options.center)},this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.renewPositions(),this.event.mouse_move((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);n.alt=t.options.center.alt;var o=0,s=!1;switch(t.options.heightMode){case"0":case 0:s=!1;break;case"1":case 1:o=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(n.lng,n.lat))||0,s=!1;break;case"2":case 2:s=!0}var a=t.calSector(n,t.options.radius,t.options.startAngle,t.options.endAngle,360,!0),r=[];if(s){for(var l=0;l<a.length;l++)r.push(a[l].lng,a[l].lat);t.positions=Cesium.Cartesian3.fromDegreesArray(r),t.getClampToHeight({lng:n.lng,lat:n.lat}).then((function(e){t.label&&(t.label.position=[n.lng,n.lat,e])}))}else{for(var c=0;c<a.length;c++)r.push(a[c].lng,a[c].lat,n.alt+o);t.positions=Cesium.Cartesian3.fromDegreesArrayHeights(r),t.label&&(t.label.position=[n.lng,n.lat,n.alt+o])}t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.options.center.lng=Number(n.lng.toFixed(8)),t.options.center.lat=Number(n.lat.toFixed(8)),t.center=t.options.center,t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.previous={center:t.deepCopyObj(t.options.center)},t.positionEditing=!1})),this.event.mouse_right((function(e,i){t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.positionEditing=!1;else{var e=t.cartesian3Towgs84(i,t.sdk.viewer);t.options.center.lng=e.lng,t.options.center.lat=e.lat,t.center=t.options.center,t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.previous={center:t.deepCopyObj(t.options.center)},t.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positions)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(i.positions),[i.positions[0],i.positions[1]])}),!1)):(this.previous||(this.previous={center:this.deepCopyObj(this.options.center)}),this.options.center=this.deepCopyObj(this.previous.center),this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),this.entity.polyline.positions=[].concat(A()(i.positions),[i.positions[0],i.positions[1]]),this.previous=null)}}},{key:"setDIV",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};t.x=t.x||0===t.x?t.x:10,t.y=t.y||0===t.y?t.y:10;var i=document.getElementById(t.domid),n=Cesium.Cartesian3.fromDegrees(this.options.center.lng,this.options.center.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=e.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+t.x).toFixed(0)+"px",i.style.top=(s.y+t.y).toFixed(0)+"px")}}))}},{key:"renewPositions",value:function(e){var t=this;if(!this._error){var i=!1;e||(e=this.options.center);var n=0;switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:n=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(e.lng,e.lat))||0,i=!1;break;case"2":case 2:i=!0}var o=this.calSector(e,this.options.radius,this.options.startAngle,this.options.endAngle,360,!0),s=[];if(i){for(var a=0;a<o.length;a++)s.push(o[a].lng,o[a].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(s),setTimeout((function(){t.getClampToHeight({lng:e.lng,lat:e.lat}).then((function(i){t.label&&(t.label.position=[e.lng,e.lat,i])}))}),100)}else{for(var r=0;r<o.length;r++)s.push(o[r].lng,o[r].lat,e.alt+n);this.positions=Cesium.Cartesian3.fromDegreesArrayHeights(s),this.label&&(this.label.position=[e.lng,e.lat,e.alt+n])}var l=this.options.endAngle-this.options.startAngle;return l<0&&(l=360+l),this.options.areaByMeter=Number((Cesium.Math.PI*this.options.radius*this.options.radius*(l/360)).toFixed(2)),this.areaUnit=this.areaUnit,o}}}],[{key:"create",value:function(e){var i=e.calSector(e.options.center,e.options.radius,e.options.startAngle,e.options.endAngle,360,!0),n=!0,o=0;switch(e.options.heightMode){case"0":case 0:n=!1;break;case"1":case 1:o=e.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(e.options.center.lng,e.options.center.lat))||0,n=!1;break;case"2":case 2:n=!0}e.options.label.position||(e.options.label.position={lng:e.options.center.lng,lat:e.options.center.lat,alt:e.options.center.alt+o});var s=Cesium.Color.fromCssColorString(e.options.color);2===e.sdk.viewer.scene.mode&&(n=!1,s=new Cesium.CustomColorMaterialSource({color:e.options.color}));var a=[];if(e.options.label.ground=n,n){for(var r=0;r<i.length;r++)a.push(i[r].lng,i[r].lat);e.positions=Cesium.Cartesian3.fromDegreesArray(a)}else{for(var l=0;l<i.length;l++)a.push(i[l].lng,i[l].lat,e.options.center.alt+o);e.positions=Cesium.Cartesian3.fromDegreesArrayHeights(a)}e.entity=e.sdk.viewer.entities.add({id:e.options.id,show:e.options.show,polygon:{hierarchy:new Cesium.PolygonHierarchy(e.positions),perPositionHeight:!n,material:s,zIndex:e.sdk._entityZIndex},polyline:{positions:[].concat(A()(e.positions),[e.positions[0],e.positions[1]]),width:e.options.line.width,material:Cesium.Color.fromCssColorString(e.options.line.color),clampToGround:!!n,arcType:n?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:e.sdk._entityZIndex}}),e.sdk._entityZIndex++,t.createLabel(e);var c=e.options.endAngle-e.options.startAngle;switch(c<0&&(c=360+c),e.options.areaByMeter=Number((Cesium.Math.PI*e.options.radius*e.options.radius*(c/360)).toFixed(2)),e.options["area-unit"]){case"平方米":e.options.area=e.options.areaByMeter;break;case"平方千米":e.options.area=Number((e.options.areaByMeter/1e6).toFixed(8));break;case"亩":e.options.area=Number((e.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":e.options.area=Number((e.options.areaByMeter/1e4).toFixed(6));break;default:e.options.area=e.options.areaByMeter}Mt(e.sdk,e.options.id),e.options.show&&Qe(0,e.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function e(t){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.label=new Xn(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.label.position.lng,t.options.label.position.lat,t.options.label.position.alt],text:t.options.name,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far,ground:t.options.label.ground});case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"nodeEdit",value:function(e){if(e.positionEditing=!1,YJ.Measure.GetMeasureStatus());else{var t,i=function(e){function t(e,t){var i=Math.PI/180,n=e.y*i,o=t.y*i,s=e.x*i,a=t.x*i,r=Math.sin(a-s)*Math.cos(o),l=Math.cos(n)*Math.sin(o)-Math.sin(n)*Math.cos(o)*Math.cos(a-s),c=Math.atan2(r,l)%(2*Math.PI);return 360-(450-(180*c/Math.PI<0?360+180*c/Math.PI:180*c/Math.PI)-90)%360}var i=e[0],n=e[1],o=e[2],s={x:i.lng,y:i.lat},a={x:n.lng,y:n.lat},r={x:o.lng,y:o.lat};return{angle1:t(s,a),angle2:t(s,r)}},n=function(){var t=o()(a.a.mark((function t(i,n){var o,s,r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=e.cartesian3Towgs84(i,e.sdk.viewer),t.next=3,e.getClampToHeight(o);case 3:s=t.sent,r=e.sdk.viewer.entities.add({name:"node-secondary-edit-point",type:n,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,s),billboard:{image:e.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),e.nodePoints.push(r);case 6:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}();e.event&&e.event.destroy(),e.event=new K(e.sdk),YJ.Measure.SetMeasureStatus(!0),e.tip=new Q("请选择一个编辑点,右键取消",e.sdk),e.event=new K(e.sdk),e.nodePoints=[];var s=e.calSector(e.options.center,e.options.radius,e.options.startAngle,e.options.endAngle),r=[],l=e.options.radius,c={angle1:e.options.startAngle,angle2:e.options.endAngle};e.entity.polyline.clampToGround=!0,e.entity.polyline.arcType=Cesium.ArcType.GEODESIC,e.entity.polygon.perPositionHeight=!1,e.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(s)}),!1),e.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(A()(s),[s[0],s[1]])}),!1);var u=e.entity.polyline.positions.getValue();r=[Zh({},e.center),e.cartesian3Towgs84(u[1],e.sdk.viewer),e.cartesian3Towgs84(u[u.length-4],e.sdk.viewer)];var h=A()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:e.options.center.lng,lat:e.options.center.lat},h).then((function(t){e.label.position=[e.options.center.lng,e.options.center.lat,t]})),setTimeout((function(){n(u[1],"sector-start"),n(u[u.length-4],"sector-end"),e.event.mouse_left((function(i,n){if(t)e.options.startAngle=c.angle1,e.options.endAngle=c.angle2,e.options.radius=l,e.event&&e.event.destroy(),e.tip&&e.tip.destroy(),e.tip=null,t=null,YJ.Measure.SetMeasureStatus(!1),e.heightMode=e.heightMode;else{var o=e.sdk.viewer.scene.pick(i.position);if(o&&o.id&&o.id.name&&"node-secondary-edit-point"===o.id.name&&("sector-start"===o.id._type||"sector-end"===o.id._type)){e.tip.set_text("左键确认,右键取消"),t=o.id;for(var s=0;s<e.nodePoints.length;s++)e.sdk.viewer.entities.remove(e.nodePoints[s]);e.nodePoints=[]}}})),e.event.mouse_move((function(n,o){if(t){var a=e.cartesian3Towgs84(o,e.sdk.viewer);"sector-start"===t._type&&(r[1]=a),"sector-end"===t._type&&(r[2]=a),c=i(r);var u=Cesium.Cartesian3.fromDegrees(r[0].lng,r[0].lat,0),h=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,0);l=Cesium.Cartesian3.distance(u,h),s=e.calSector(e.options.center,l,c.angle1,c.angle2)}e.tip.setPosition(o,n.endPosition.x,n.endPosition.y)})),e.event.mouse_right((function(t,i){for(var n=0;n<e.nodePoints.length;n++)e.sdk.viewer.entities.remove(e.nodePoints[n]);e.nodePoints=[],e.event&&e.event.destroy(),e.tip&&e.tip.destroy(),e.tip=null,e.heightMode=e.heightMode}))}),200)}}},{key:"closeNodeEdit",value:function(e){YJ.Measure.SetMeasureStatus(!1),e.event&&e.event.destroy(),e.tip&&e.tip.destroy(),e.tip=null;for(var t=0;t<e.nodePoints.length;t++)e.sdk.viewer.entities.remove(e.nodePoints[t]);e.nodePoints=[],e.picking=!0}},{key:"EventBinding",value:function(e,t){for(var i=function(){var i=[],o=!1,s=[];if(!t[n]||!t[n].attributes)return 1;var a,r=Kh(t[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==t[n].type?(i.push((function(t){e[r.value]=t.target.checked})),t[n].checked=e[r.value]):(i.push((function(t){var i=t.target.value;"number"==t.target.type?"."==t.data||"-"==t.data&&!t.target.value||(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),e[r.value]=i):e[r.value]=i})),"IMG"==t[n].nodeName?t[n].src=e[r.value]:t[n].value=e[r.value]),e._elms[r.value]?e._elms[r.value].push(t[n]):e._elms[r.value]=[t[n]],s.push(r.name);break;case"@click":t[n].addEventListener("click",(function(t){"function"==typeof e[r.value]&&e[r.value](t)})),s.push(r.name);break;case"@change":o=!0,i.push((function(t){var i=t.target.value;"number"==t.target.type&&""!=i&&(i=Number(i),t.target.value=i),"function"==typeof e[r.value]&&e[r.value](t,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(e){r.e(e)}finally{r.f()}for(var c=0;c<s.length;c++)t[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==t[n].tagName&&"checkbox"!=t[n].type||(u="change"),t[n].addEventListener(u,(function(e){for(var t=0;t<i.length;t++)i[t](e)}))}},n=0;n<t.length;n++)i()}}]);var i,n,s,r}(Vn);function tp(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var ip=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=tp(this,t,[e,n])).source=new Cesium.CustomDataSource(i.options.id),i.detail=[],i}return un()(t,e),x()(t,[{key:"show",get:function(){return this.options.show},set:function(e){this.source&&(this.source.show=e,this.options.show=e)}},{key:"setDefaultValue",value:function(){var e;this.options.id=this.options.id||Cesium.createGuid(),this.options.url=this.options.url||"",this.options.show=null===(e=this.options.show)||void 0===e||e}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=l.length>0&&void 0!==l[0]?l[0]:3,pi(0),ni(this.sdk),oi(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation?(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i,duration:t})):this.source&&this.viewer.flyTo(this.source,{duration:t});case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:function(){var e,i,n,o,s;(e=t,i="remove",n=this,o=3,s=aa()(ln()(1&o?e.prototype:e),i,n),2&o&&"function"==typeof s?function(e){return s.apply(n,e)}:s)([]),this.viewer.dataSources.remove(this.source),this.source=null}},{key:"on",value:(i=o()(a.a.mark((function e(){var t=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.show=this.options.show,e.next=3,Cesium.KmlDataSource.load(this.options.url,{camera:this.viewer.scene.camera,canvas:this.viewer.scene.canvas});case 3:return e.sent.entities.values.forEach((function(e,i){if(t.detail.push({name:e.name,id:e.id}),e.label){var n=1;e.billboard&&(n=e.billboard.scale._value),e.label.pixelOffset=new Cesium.Cartesian2(0,-32*n-15),e.label.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,e.label.disableDepthTestDistance=Number.POSITIVE_INFINITY}if(e.polygon){var o={hierarchy:e.polygon.hierarchy.getValue().positions,material:e.polygon.material,classificationType:Cesium.ClassificationType.BOTH};if(e.polygon.outline.getValue()){var s=e.polygon.hierarchy.getValue().positions,a=new Cesium.Entity({id:t.getOutlineId(e.id),polyline:{positions:s,width:e.polygon.outlineWidth.getValue(),material:e.polygon.outlineColor.getValue(),clampToGround:!0,zIndex:t.sdk._entityZIndex}});t.source.entities.add(a)}e.polygon=o}e.billboard&&(e.billboard.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND),e.polyline&&(e.polyline={positions:e.polyline.positions.getValue(),material:e.polyline.material,clampToGround:!0,width:e.polyline.width?e.polyline.width.getValue():1}),e.show=!0,t.source.entities.add(e)})),e.next=7,this.viewer.dataSources.add(this.source);case 7:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"getOutlineId",value:function(e){return[e,"outline"].join("_")}}]);var i,n}(Vn);function np(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var op=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=np(this,t,[e,n])).primitive=void 0,i.positions=[],i.loading=!0,i}return un()(t,e),x()(t,[{key:"setDefaultValue",value:function(){var e,i,n,o,s;(e=t,i="setDefaultValue",n=this,o=3,s=aa()(ln()(1&o?e.prototype:e),i,n),2&o&&"function"==typeof s?function(e){return s.apply(n,e)}:s)([]),this.options.host=this.options.host||p(),this.options.color=this.options.color||"rgb(239, 6, 6, 1)",this.options.width=this.options.width||1}},{key:"show",get:function(){return this.options.show},set:function(e){if(this.options.show=e,this.entity)for(var t=0;t<this.entity.entities.values.length;t++)this.entity.entities.values[t].show=e}},{key:"on",value:(n=o()(a.a.mark((function e(){var i,n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i="",i=(i=this.options.host.endsWith("yjearth4.0")?this.options.host+"/data/service/getFile":this.options.host+"/yjearth4.0/data/service/getFile")+"?path="+encodeURIComponent(this.options.url),e.next=5,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 5:return n=e.sent,e.next=8,n.json();case 8:return o=e.sent,this.geojson=o,e.abrupt("return",t.addDataToGlobe(this,o.features));case 11:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:function(){var e=this;this.entity&&(this.entity.entities.values.forEach((function(t){e.sdk.viewer.entities.remove(t)})),this.entity=null,this.geojson={})}},{key:"flyTo",value:(i=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.loading){e.next=24;break}if(!this.geojson){e.next=24;break}if(pi(0),ni(this.sdk),oi(this.sdk),t=turf.bbox(this.geojson),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=23;break}return i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:t[0],lat:t[1]},e.next=15,this.getClampToHeight(l);case 15:l.alt=e.sent,n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=24;break;case 23:this.viewer.camera.flyTo({destination:(c=Cesium.Rectangle).fromDegrees.apply(c,A()(t))});case 24:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"addDataToGlobe",value:function(e){for(var t=new Cesium.GeoJsonDataSource,i=e.deepCopyObj(e.geojson),n=0;n<i.features.length;n++)i.features[n].id||(i.features[n].id=e.options.id+"_"+n);return t.load(i,{clampToGround:!0}).then((function(t){e.entity=t,t.entities.values.forEach((function(t){var i=Cesium.Color.fromCssColorString(e.options.color),n=i.withAlpha(.2);t.show=e.options.show,e.sdk.viewer.entities.add(t),t.billboard&&(t.billboard.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND,t.point=new Cesium.PointGraphics({show:!0,color:i,pixelSize:10,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY})),t.polyline&&(t.polyline.material=i,t.polyline.zIndex=e.sdk._entityZIndex,e.sdk._entityZIndex++),t.polygon&&(t.polygon.perPositionHeight=!1,t.polygon.material=n,t.polygon.zIndex=e.sdk._entityZIndex,t.polyline=new Cesium.PolylineGraphics({positions:t.polygon.hierarchy._value.positions,width:1,clampToGround:!0,material:i,zIndex:e.sdk._entityZIndex}),e.sdk._entityZIndex++)})),e.loading=!1}))}}]);var i,n}(Vn);function sp(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 ap(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?sp(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):sp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function rp(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var lp=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(i=rp(this,t,[e,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"rgba(32,67,135,0.5)",i.options.positions=n.positions||[],i.options.frequency=n.frequency||10,i.options.animationSpeed=n.animationSpeed||1,i.options.amplitude=n.amplitude||10,i.options.show=!n.show&&!1!==n.show||n.show,i.Dialog=o,i._EventBinding=new xn,i._elms={},i.sdk.addIncetance(i.options.id,i),t.create(i),i}return un()(t,e),x()(t,[{key:"color",get:function(){return this.options.color},set:function(e){var t=this;this.options.color=e,this.entity&&(this.entity.appearance.material.uniforms.baseWaterColor=Cesium.Color.fromCssColorString(e)),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,255,255,1)"}});t._elms.color[n]=o}))}},{key:"frequency",get:function(){return this.options.frequency},set:function(e){this.options.frequency=e,this.entity&&(this.entity.appearance.material.uniforms.frequency=10*e),this._elms.frequency&&this._elms.frequency.forEach((function(t){t.value=e}))}},{key:"animationSpeed",get:function(){return this.options.animationSpeed},set:function(e){this.options.animationSpeed=e,this.entity&&(this.entity.appearance.material.uniforms.animationSpeed=.01*e),this._elms.animationSpeed&&this._elms.animationSpeed.forEach((function(t){t.value=e}))}},{key:"amplitude",get:function(){return this.options.amplitude},set:function(e){this.options.amplitude=e,this.entity&&(this.entity.appearance.material.uniforms.amplitude=e),this._elms.amplitude&&this._elms.amplitude.forEach((function(t){t.value=e}))}},{key:"height",get:function(){return this.options.height},set:function(e){this.options.height=e;var t=this.options.positions[0],i=Cesium.Cartesian3.fromDegrees(t.lng,t.lat,e),n=Cesium.Cartesian3.fromDegrees(t.lng,t.lat,this.entity.originalHeight);this.entity.modelMatrix=Cesium.Matrix4.setTranslation(this.entity.modelMatrix,new Cesium.Cartesian3(i.x-n.x,i.y-n.y,i.z-n.z),new Cesium.Matrix4),this._elms.height&&this._elms.height.forEach((function(t){t.value=e}))}},{key:"edit",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s=this,r=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.length>0&&void 0!==r[0]&&r[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=19;break}return e.next=7,new pn(this.sdk,this.originalOptions,{title:"水面属性",left:"180px",top:"100px",confirmCallBack:function(e){s.name=s.name.trim(),s.name||(s.name="未命名对象"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),Mt(s.sdk,s.options.id),at(s.sdk,s.options.id)},resetCallBack:function(){s.reset(),s.Dialog.resetCallBack&&s.Dialog.resetCallBack()},removeCallBack:function(){s.Dialog.removeCallBack&&s.Dialog.removeCallBack()},closeCallBack:function(){s.reset(),s.Dialog.closeCallBack&&s.Dialog.closeCallBack()},showCallBack:function(e){s.show=e,s.Dialog.showCallBack&&s.Dialog.showCallBack()}},!0);case 7:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" water-surface",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="water-color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">水面振幅</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="100" step="1" @model="amplitude">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">动画速度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="10" min="0" step="0.1" @model="animationSpeed">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">水面频率</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="100" min="0" step="1" @model="frequency">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("water-color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){s.color=e},clear:function(){s.color="rgba(255,255,255,1)"}}),o=i.getElementsByTagName("*"),this._EventBinding.on(this,o),this._elms=this._EventBinding.element,this._elms.color=[n],e.next=19;break;case 19:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.frequency=this.originalOptions.frequency,this.animationSpeed=this.originalOptions.animationSpeed,this.amplitude=this.originalOptions.amplitude,this.height=this.originalOptions.height)}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=d.length>0&&void 0!==d[0]?d[0]:{},pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=ap({},this.options.position):this.options.positions?l=ap({},this.options.positions[0]):this.options.center?l=ap({},this.options.center):this.options.start?l=ap({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=16;break}return e.next=15,this.getClampToHeight(l);case 15:l.alt=e.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=28;break;case 23:c=Cesium.Rectangle.fromCartesianArray(this.entity.geometryInstances.geometry._polygonHierarchy.positions),u=this.sdk.viewer.camera.getRectangleCameraCoordinates(c),h=this.cartesian3Towgs84(u,this.sdk.viewer),p=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,h.alt+this.height),this.sdk.viewer.camera.flyTo({orientation:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},destination:p});case 28:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:(i=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=5,this.sdk.removeIncetance(this.options.id);case 5:return e.next=7,Mt(this.sdk,this.options.id);case 7:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"create",value:function(e){for(var t=e.options.positions,i=[],n=t[0].alt,o=0;o<t.length;o++)i.push(t[o].lng,t[o].lat),n<t[o].alt&&(n=t[o].alt);e.options.height||0===e.options.height||(e.options.height=n),e.entity=e.sdk.viewer.scene.primitives.add(new Cesium.Primitive({id:e.options.id,show:e.options.show,asynchronous:!1,releaseGeometryInstances:!1,geometryInstances:new Cesium.GeometryInstance({name:"water-surface",geometry:new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(i)),vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,height:e.options.height})}),appearance:new Cesium.EllipsoidSurfaceAppearance({aboveGroud:!0,material:new Cesium.Material({fabric:{type:"Water",uniforms:{baseWaterColor:Cesium.Color.fromCssColorString(e.options.color),normalMap:e.getSourceRootPath()+"/img/water.png",frequency:10*e.options.frequency,animationSpeed:.01*e.options.animationSpeed,amplitude:e.options.amplitude}}})})})),e.entity.id=e.options.id,e.entity.originalHeight=e.options.height,Mt(e.sdk,e.options.id),e.options.show&&Qe(0,e.options.id)}}]);var i,n,s}(Vn);function cp(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return up(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)?up(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function up(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 hp(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 pp(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?hp(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):hp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function dp(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function mp(e,t,i){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,i)}function fp(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var vp=new WeakMap,gp=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),mp(i=dp(this,t,[e,n]),vp,null),i.options.name=n.name||"",i.options.show=!n.show&&!1!==n.show||n.show,i.options.speed=n.speed||0===n.speed?n.speed:1,i.options.speed<=0&&(i.options.speed=.01),i.options.delay=n.delay||0,i.options.loop=!n.loop&&!1!==n.loop||n.loop,i.options.model=n.model=n.model||{},i.options.line=n.line=n.line||{},i.options.line.positions=n.line.positions||[],i.options.height=i.options.line.positions[0]?i.options.line.positions[0].alt:0,i.options.height=Number(i.options.height.toFixed(2)),i.options.line.show=!n.line.show&&!1!==n.line.show||n.line.show,i.options.model.show=!n.model.show&&!1!==n.model.show||n.model.show,i.options.model.url=n.model.url||"",i.options.model.pixelSize=n.model.pixelSize||70,i.options.model.heading=n.model.heading||0,i.options.model.pitch=n.model.pitch||0,i.options.model.roll=n.model.roll||0,i.options.model.scale=n.model.scale||0===n.model.scale?n.model.scale:1,i.options.model.animate=n.model.animate||"无",i.options.line.smooth=!!n.line.smooth&&n.line.smooth,i.options.line.noseToTail=!!n.line.noseToTail&&n.line.noseToTail,i.positions_smooth=[],i.options.ground=n.ground||!1,i.options.state=!n.state&&!1!==n.state||n.state,i.options.routeDirection=!n.routeDirection&&!1!==n.routeDirection||n.routeDirection,i.keyPoints=[],i.realTimePositions=[],i._lineEdit=!1,i._keyPoint=!1,i._elms={},i.Dialog=o,i.realTimeRouteArray=[],i.distance,n.label=n.label||{},i.options.label={show:n.label.show||!1,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.line.positions.length<2?(i._error="最少需要两个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500})):(i.sdk.addIncetance(i.options.id,i),i.ControllerObject=new Ho(i.sdk),i._EventBinding=new xn,i.options.viewFollow=!1,i.options.firstPersonView=!1,t.addLine(i),i.firstPersonView=!1),i}return un()(t,e),x()(t,[{key:"type",get:function(){return"TrajectoryMotion"}},{key:"show",get:function(){return this.options.show},set:function(e){if("boolean"==typeof e){var t=Rt();if(this.isShowView&&t||(this.options.show=e,this.originalOptions&&(this.originalOptions.show=e)),this.options.show){this.firstPersonView?this.model.show=!1:this.model.show=(!this.showView||3==this.showView||!t)&&this.modelShow,this.showView&&3!=this.showView&&t?this.line.polyline.material=new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff00"),dashLength:20}):this.line.polyline.material=this.lineShow?new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff"),dashLength:20}):new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff00"),dashLength:20});for(var i=0;i<this.keyPoints.length;i++)this.keyPoints[i].show=(!this.showView||3==this.showView||!t)&&this.keyPointShow;this.realTimeRoute&&this.realTimeLine&&(this.realTimeLine.show=!this.showView||3==this.showView||!t),this.label&&(this.label.show=(!this.showView||3==this.showView)&&this.options.label.show)}else{this.model.show=(!this.showView||3==this.showView||!t)&&this.options.show;var n=this.options.show;n=(!this.showView||3==this.showView||!t)&&this.options.show,this.realTimeLine&&(this.realTimeLine.show=!1),this.line.polyline.material=n?new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff"),dashLength:20}):new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff00"),dashLength:20});for(var o=0;o<this.keyPoints.length;o++)this.keyPoints[o].show=(!this.showView||3==this.showView)&&n;this.label&&(this.label.show=!1),this.viewFollow=!1}this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=e),Mt(this.sdk,this.options.id),at(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"height",get:function(){return this.options.height},set:function(e){var t=this;if(!this.ground){var i=this.options.height-Number(e.toFixed(2));if(this.options.height=Number(e.toFixed(2)),this.line)if(this.ground);else{var n=this.options.height-this.options.line.positions[0].alt;this.line.polyline.clampToGround=!1;for(var o=0;o<this.keyPoints.length;o++)this.options.line.positions[o].alt+=n,this.keyPoints[o].position=Cesium.Cartesian3.fromDegrees(this.options.line.positions[o].lng,this.options.line.positions[o].lat,this.options.line.positions[o].alt)}if(this.model&&this.model.position){var s=this.model.heading,a=this.model.pitch,r=this.model.roll;if(isNaN(s)||isNaN(a)||isNaN(r))return;var l=Cesium.Transforms.eastNorthUpToFixedFrame(this.model.position);Cesium.Matrix4.multiplyByTranslation(l,new Cesium.Cartesian3(0,0,-i),l),Cesium.Matrix4.getTranslation(l,this.model.position),Cesium.Matrix4.multiplyByMatrix3(l,Cesium.Matrix3.fromHeadingPitchRoll(Cesium.HeadingPitchRoll.fromDegrees(s,a,r)),this.entity.modelMatrix),this.label&&(this.label.show=this.label.show),this.options.label.position&&setTimeout((function(){t.options.label.position.alt?t.label&&(t.label.position=[t.options.label.position.lng,t.options.label.position.lat,t.options.label.position.alt]):t.getClampToHeight({lng:t.options.label.position.lng,lat:t.options.label.position.lat}).then((function(e){t.label&&(t.label.position=[t.options.label.position.lng,t.options.label.position.lat,e])}))}),0)}var c=this.renewLinePositions(this.options.line.positions);this.line.polyline.positions=c,this._elms.height&&this._elms.height.forEach((function(t){t.value=Number(e.toFixed(2))}))}}},{key:"ground",get:function(){return this.options.ground},set:function(e){var t=this;if(this.lineEdit=!1,this.options.ground=e,this.realTimeLine.polyline.clampToGround=e,this.height=this.options.height,this.line&&e){this.line.polyline.clampToGround=!0;for(var i=function(e){t.sdk.viewer.scene.clampToHeightMostDetailed([new Cesium.Cartesian3.fromDegrees(t.options.line.positions[e].lng,t.options.line.positions[e].lat)]).then((function(i){t.keyPoints[e].position=i[0]}))},n=0;n<this.keyPoints.length;n++)i(n)}setTimeout((function(){t.TweenAnimate&&t.TweenAnimate._isPlaying?t.setMovePositionByDistance(t.TweenAnimate._object.distance):t.setMovePositionByDistance(0)}),200),e?this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"):this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box"),this._elms.ground&&this._elms.ground.forEach((function(t){t.checked=e}))}},{key:"modelPixelSize",get:function(){return this.options.model.pixelSize},set:function(e){this.options.model.pixelSize=e,this.model&&(this.model.minimumPixelSize=e),this._elms.modelPixelSize&&this._elms.modelPixelSize.forEach((function(t){t.value=e}))}},{key:"scale",get:function(){return this.options.model.scale},set:function(e){this.options.model.scale=Number(e),this.model&&(this.model.scale=e,this.model.customScale={x:this.options.model.scale,y:this.options.model.scale,z:this.options.model.scale}),this._elms.scale&&this._elms.scale.forEach((function(t){t.value=e}))}},{key:"speed",get:function(){return this.options.speed},set:function(e){e<=0&&(e=.01),this.options.speed=e,this.state&&this.TweenAnimate&&this.TweenAnimate._isPlaying&&this.setMovePositionByDistance(this.TweenAnimate._object.distance),this._elms.speed&&this._elms.speed.forEach((function(t){t.value=e}))}},{key:"smooth",get:function(){return this.options.line.smooth},set:function(e){this.lineEdit=!1,this.options.line.smooth=e;var t=this.renewLinePositions(this.options.line.positions);this.line.polyline.positions=t,this.model.position=t[0],this.modelMove(t),this._elms.smooth&&this._elms.smooth.forEach((function(t){t.checked=e}))}},{key:"delay",get:function(){return this.options.delay},set:function(e){this.options.delay=e,this.TweenAnimate&&this.TweenAnimate._isPlaying&&this.TweenAnimate.delay(this.delay),this._elms.delay&&this._elms.delay.forEach((function(t){t.value=e}))}},{key:"state",get:function(){return this.options.state},set:function(e){var t=this;if(this.options.state=e,cancelAnimationFrame(this._requestAnimationFrameEventId),this.editObj&&(this.editObj.destroy(),this.editObj=null,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="开始调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn")),this.TweenAnimate&&this.TweenAnimate._isPlaying)if(clearTimeout(this.TweenAnimate.timeout),e)this.lineEdit=!1,this.TweenAnimate.isPlaying()?this.TweenAnimate.timeout=setTimeout((function(){t.TweenAnimate.resume()}),this.options.delay):this.TweenAnimate.delay(this.delay).start(),this.speed=this.speed;else{var i=pp({},this.sdk.viewer.camera._position),n=this;this._requestAnimationFrameEventId=requestAnimationFrame((function e(){n.firstPersonView&&n.sdk.viewer.camera.setView({destination:pp({},i),orientation:{heading:n.sdk.viewer.camera.heading,pitch:n.sdk.viewer.camera.pitch,roll:n.sdk.viewer.camera.roll}}),n._requestAnimationFrameEventId=requestAnimationFrame(e)})),this.TweenAnimate.pause(),setTimeout((function(){n.model&&(n.model.isMove=!1)}),200)}else if(e){var o=this.renewLinePositions(this.options.line.positions);this.modelMove(o)}this._elms.state&&this._elms.state.forEach((function(t){t.checked=e}))}},{key:"modelShow",get:function(){return this.options.model.show},set:function(e){var t=Rt();this.options.model.show=e;var i=e;i=!(!this.show||this.showView&&3!=this.showView&&t)&&e,this.model&&this.show&&(this.model.show=i),this._elms.modelShow&&this._elms.modelShow.forEach((function(t){t.checked=e}))}},{key:"modelAnimate",get:function(){return this.options.model.animate},set:function(e){if(this.options.model.animate=e,this.model&&this.model.loader.components){var t=this.model.loader.components.animations;if(this.model.activeAnimations.removeAll(),t&&t.length>0)for(var i=0;i<t.length;i++)if(t[i].name==e){this.model.activeAnimations.add({index:i,loop:Cesium.ModelAnimationLoop.REPEAT,speedup:1,reverse:!1});break}this._elms.modelAnimate&&this._elms.modelAnimate.forEach((function(t){t.value=e}))}}},{key:"noseToTail",get:function(){return this.options.line.noseToTail},set:function(e){this.lineEdit=!1,this.options.line.noseToTail=e;for(var t=[],i=0;i<this.options.line.positions.length;i++)t.push(this.options.line.positions[i].lng,this.options.line.positions[i].lat,this.options.line.positions[i].alt);Cesium.Cartesian3.fromDegreesArrayHeights(t);if(this.line){var n=this.renewLinePositions(this.options.line.positions);this.line.polyline.positions=n,this.model.position=n[0],this.modelMove(n)}this._elms.noseToTail&&this._elms.noseToTail.forEach((function(t){t.checked=e}))}},{key:"lineShow",get:function(){return this.options.line.show},set:function(e){e&&(this.realTimeRoute=!1),this.options.line.show=e;var t=e,i=Rt();t=(!this.showView||3==this.showView||!i)&&e,this.line&&this.show&&(this.line.polyline.material=t?new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff"),dashLength:20}):new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff00"),dashLength:20})),this._elms.lineShow&&this._elms.lineShow.forEach((function(t){t.checked=e}))}},{key:"realTimeRoute",get:function(){return this.options.realTimeRoute},set:function(e){e&&(this.lineShow=!1,this.keyPointShow=!1),this.options.realTimeRoute=e,this.realTimeLine&&this.show&&(this.realTimeLine.show=e),this._elms.realTimeRoute&&this._elms.realTimeRoute.forEach((function(t){t.checked=e}))}},{key:"keyPointShow",get:function(){return this._keyPoint},set:function(e){this._keyPoint=e;for(var t=0;t<this.keyPoints.length;t++)this.show&&(this.keyPoints[t].show=e);this._elms.keyPointShow&&this._elms.keyPointShow.forEach((function(t){t.checked=e})),!e&&this.lineEdit&&(this._lineEdit=e,YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.ControllerObject&&this.ControllerObject.destroy(),this.tip&&this.tip.destroy(),this.tip=null,this._elms.lineEdit&&this._elms.lineEdit.forEach((function(t){t.checked=e})))}},{key:"lineEdit",get:function(){return this._lineEdit},set:function(e){var t=this,i=[],n=function(e){i=t.renewLinePositions(e),t.model.position=i[0],t.modelMove(i)};if(e){if(this.viewFollow=!1,YJ.Measure.GetMeasureStatus())return console.warn("上一次测量未结束"),void(this.lineEdit=!1);var o;this.ground=!1,this.smooth=!1,this.state=!1,YJ.Measure.SetMeasureStatus(!0),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=new Q("请选择一个顶点,右键取消",this.sdk),this.event=new K(this.sdk),n(A()(this.options.line.positions));var s=function(e,i){var s=t.sdk.viewer.scene.pick(e.position);if(s&&s.id&&s.id.name&&"node-secondary-edit-point"===s.id.name)for(var a=0;a<t.keyPoints.length;a++)if(t.keyPoints[a].id===s.id.id){o=s.id,t.ControllerObject.position=t.options.line.positions[o.index],t.ControllerObject.editTranslational(),t.tip&&t.tip.destroy(),t.tip=null,t.ControllerObject.controllerCallBack=function(e){t.options.line.positions[o.index]=e.position,0===o.index&&(t.options.height=t.options.line.positions[o.index].alt,t._elms.height&&t._elms.height.forEach((function(e){e.value=Number(t.options.height.toFixed(2))}))),o.position=Cesium.Cartesian3.fromDegrees(e.position.lng,e.position.lat,e.position.alt),n(A()(t.options.line.positions))};break}};this.event.mouse_left(s),this.event.mouse_right((function(e,i){t.keyPointShow=!1,YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,t.ControllerObject.destroy()})),this.event.mouse_move((function(e,i){t.tip&&t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?(t.keyPointShow=!1,YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,t.ControllerObject.destroy()):s(o)}))})),this.line.polyline.positions=new Cesium.CallbackProperty((function(){return i}),!1),this.keyPointShow=e}else this.lineEdit&&(YJ.Measure.SetMeasureStatus(!1),this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=null),this.keyPointShow=e,this.ControllerObject.destroy();this._lineEdit=e,this._elms.lineEdit&&this._elms.lineEdit.forEach((function(t){t.checked=e}))}},{key:"routeDirection",get:function(){return this.options.routeDirection},set:function(e){this.options.routeDirection=e,this._elms.routeDirection&&this._elms.routeDirection.forEach((function(t){t.checked=e}))}},{key:"loop",get:function(){return this.options.loop},set:function(e){this.options.loop=e,this.TweenAnimate&&this.TweenAnimate._isPlaying&&(e?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat()),this._elms.loop&&this._elms.loop.forEach((function(t){t.checked=e}))}},{key:"firstPersonView",get:function(){return this.options.firstPersonView},set:function(e){var t=this,i=Rt(),n=rt();if((Rt()||n.sdkD||!this.show)&&(e=!1),cancelAnimationFrame(this._requestAnimationFrameEventId),this._firstPersonViewEvent&&this._firstPersonViewEvent.destroy(),this.sdk.viewer._firstPersonView=e,this.options.firstPersonView=e,this.options.firstPersonView){if(this.viewFollow=!0,this.firstPersonHeadingPitch={heading:0,pitch:-10},this.state=!0,this.model&&(this.model.show=!1),this._DialogObject&&this._DialogObject._element.content){var o=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");o[0].className="btn is-active",o[1].className="btn"}this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null),Qt(this.sdk,!1);var s,a=rt(),r=(s=this.sdk===a.sdkP?a.sdkD:a.sdkP)?s.entityMap.get(this.options.id):void 0;this.sdk&&(this._firstPersonViewEvent=new K(this.sdk)),this._firstPersonViewEvent.mouse_right_down((function(e,i){var n=pp({},e.position);t._firstPersonViewEvent.mouse_move((function(e,i){t.firstPersonHeadingPitch.heading=t.firstPersonHeadingPitch.heading+(e.endPosition.x-n.x)/20,t.firstPersonHeadingPitch.pitch=t.firstPersonHeadingPitch.pitch+(n.y-e.endPosition.y)/10,r&&(r.firstPersonHeadingPitch=pp({},t.firstPersonHeadingPitch)),n=pp({},e.endPosition)}),!0)}),!0),this._firstPersonViewEvent.mouse_right_up((function(e,i){t._firstPersonViewEvent.mouse_move((function(){}))}),!0)}else{if(Qt(this.sdk,!0),this.model&&this.modelShow&&this.show){var l=!0;l=!(!this.show||this.showView&&3!=this.showView&&i),this.model.show=l}if(this._DialogObject&&this._DialogObject._element.content){var c=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");c[0]&&c[1]&&(c[0].className="btn",c[1].className="btn is-active")}if(this.viewFollow&&this.show){if(this.sdk.viewer.trackedEntity&&this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),3===this.sdk.viewer.scene.mode){var u=this.sdk.viewer.entities.add({position:this.positions_smooth[0],point:{color:Cesium.Color.RED.withAlpha(0),pixelSize:0}});this.sdk.viewer.trackedEntity=u}this.viewFollow=this.viewFollow}}at(this.sdk,this.options.id)}},{key:"viewFollow",get:function(){return this.options.viewFollow},set:function(e){rt();var t=Rt();if(this.show||(e=!1),this.options.viewFollow=e,this.options.viewFollow?(this.editObj&&(this.editObj.destroy(),this.editObj=null,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="开始调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn")),ni(this.sdk),this.lineEdit=!1):this.firstPersonView=!1,this.options.firstPersonView){if(this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null),this._DialogObject&&this._DialogObject._element.content){var i=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");i[0]&&i[1]&&(i[0].className="btn",i[1].className="btn is-active")}}else if(this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null),e&&this.show&&this.model){var n=this.sdk.viewer.entities.add({position:this.model.position,point:{color:Cesium.Color.RED.withAlpha(0),pixelSize:0}});this.sdk.viewer.trackedEntity=n}var o=Ft();if(o)if(this.sdk!=o){var s=o.entityMap.get(this.options.id);s&&s.viewFollow!=e&&(s.viewFollow=e)}else if(t){var a=t.entityMap.get(this.options.id);a&&a.viewFollow!=e&&(a.viewFollow=e,this.TweenAnimate&&this.TweenAnimate._isPlaying&&a.setMovePositionByDistance(this.TweenAnimate._object.distance))}at(this.sdk,this.options.id),this._elms.viewFollow&&this._elms.viewFollow.forEach((function(t){t.checked=e}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){var t=this;this.options.label.show=e;var i=Rt(),n=e;n=!(!this.show||this.showView&&3!=this.showView&&i)&&e,this.show?this.label&&(this.label.show=n,this.label.pixelOffset=this.options.label.pixelOffset,this.options.label.position&&setTimeout((function(){t.options.label.position.alt?t.label&&(t.label.position=[t.options.label.position.lng,t.options.label.position.lat,t.options.label.position.alt]):t.getClampToHeight({lng:t.options.label.position.lng,lat:t.options.label.position.lat}).then((function(e){t.label&&(t.label.position=[t.options.label.position.lng,t.options.label.position.lat,e])}))}),0)):this.label&&(this.label.show=!1),this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.checked=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e,this.label&&(this.label.color=e),this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(255,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.label&&(this.label.fontSize=e),this.label.pixelOffset=this.options.label.pixelOffset,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(e){this.options.label.scaleByDistance=e,this.label&&(this.label.scaleByDistance=e),this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(e){var t=e;t>this.labelFar&&(t=this.labelFar),this.options.label.near=t,this.label&&(this.label.near=t),this._elms.labelNear&&this._elms.labelNear.forEach((function(e){e.value=t}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(e){var t=e;t<this.labelNear&&(t=this.labelNear),this.options.label.far=t,this.label&&(this.label.far=t),this._elms.labelFar&&this._elms.labelFar.forEach((function(e){e.value=t}))}},{key:"modelMove",value:(h=o()(a.a.mark((function e(t){var i,n,s,r,l,c,u,h,p,d,m,f,v,g,b,C,w,k=this,_=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(w=function(e,t){var i=Cesium.Transforms.eastNorthUpToFixedFrame(e);if(t){var n=Cesium.Cartesian3.subtract(t,e,new Cesium.Cartesian3),o=Cesium.Matrix4.multiplyByPointAsVector(Cesium.Matrix4.inverse(i,new Cesium.Matrix4),n,new Cesium.Cartesian3),s=Cesium.Cartesian3.normalize(o,new Cesium.Cartesian3),a=Math.atan2(s.y,s.x)-Cesium.Math.PI_OVER_TWO,r=Cesium.Math.PI_OVER_TWO-Cesium.Math.acosClamped(s.z),l=Cesium.Math.fastApproximateAtan2(s.x,s.z);return{heading:Cesium.Math.TWO_PI-Cesium.Math.zeroToTwoPi(a),pitch:r,roll:l}}},C=function(){return(C=o()(a.a.mark((function e(t){var i,o,s,r,c,u,h,d,g,b,C,k,_,x,E,S,P,D,M,T,O,N,B,L,I,j,R,F,z,H,V,G,W,U,Y,J,q;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.model.isMove=!0,i=Rt(),o=rt(),n.sdk.viewer&&n.sdk.viewer.scene){e.next=6;break}return n.removeModelAnimate(),e.abrupt("return");case 6:if(c=p,!(s=t)){e.next=16;break}return e.next=12,turf.lineSliceAlong(p,0,s,{units:"kilometers"});case 12:c=e.sent,r=A()(c.geometry.coordinates[c.geometry.coordinates.length-1]),e.next=17;break;case 16:r=A()(p.geometry.coordinates[0]);case 17:if(!n.ground){e.next=57;break}d=[],g=cp(n.sdk.entityMap);try{for(g.s();!(b=g.n()).done;)(C=y()(b.value,2))[0],(!(k=C[1]).type||"glb"!==k.type&&"bim"!==k.type&&"tileset"!==k.type&&"TrajectoryMotion"!==k.type&&"ParticleEffects"!==k.type&&k.entity)&&(d.push(k.entity),k.label&&k.label.entity&&d.push(k.label.entity))}catch(e){g.e(e)}finally{g.f()}if(n.label&&n.label.entity&&d.push(n.label.entity),!(x=Rt())||n.sdk!=x){e.next=28;break}_=new Cesium.Cartesian3.fromDegrees(r[0],r[1]),u=_,e.next=32;break;case 28:return e.next=30,n.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(r[0],r[1]),[n.model].concat(d));case 30:_=e.sent,u=_;case 32:return _||(u=new Cesium.Cartesian3.fromDegrees(r[0],r[1])),E=n.cartesian3Towgs84(u,l),S=0,e.prev=35,e.next=38,Cesium.sampleTerrainMostDetailed(n.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(E.lng,E.lat)]);case 38:P=e.sent,S=P[0].height,e.next=45;break;case 42:e.prev=42,e.t0=e.catch(35),S=0;case 45:if(E.alt<S&&(E.alt=S),E.alt=Number(E.alt.toFixed(1)),u=Cesium.Cartesian3.fromDegrees(E.lng,E.lat,E.alt),n.sdk.viewer&&n.sdk.viewer.scene){e.next=51;break}return n.removeModelAnimate(),e.abrupt("return");case 51:for(h=Cesium.Cartesian3.fromDegrees(r[0],r[1],n.cartesian3Towgs84(u,n.sdk.viewer).alt+1.8),D=[],M=0;M<c.geometry.coordinates.length;M++)D.push(c.geometry.coordinates[M][0],c.geometry.coordinates[M][1]);n.realTimePositions=Cesium.Cartesian3.fromDegreesArray(D),e.next=76;break;case 57:if(T=n.spline.evaluate(t/n.distance)){e.next=60;break}return e.abrupt("return");case 60:O=n.cartesian3Towgs84(T,l),r=[O.lng,O.lat,O.alt+1.8],u=T,h=Cesium.Cartesian3.fromDegrees(r[0],r[1],r[2]),N=[],B=0;case 66:if(!(B<=1e3)){e.next=74;break}if(!(B/1e3>t/n.distance)){e.next=69;break}return e.abrupt("break",74);case 69:L=n.spline.evaluate(B/1e3),N.push(L);case 71:B++,e.next=66;break;case 74:N.push(T),n.realTimePositions=N;case 76:if(m=w(n.model.position,u),v&&v.position&&(f=w(v.position,u),m.pitch=f.pitch),v.position=n.model.position,Cesium.HeadingPitchRoll.fromDegrees(n.options.model.heading,n.options.model.pitch,n.options.model.roll),I=0,j=0,R=0,F=Cesium.Transforms.eastNorthUpToFixedFrame(u),!n.options.routeDirection||n.lineEdit){e.next=96;break}if(I=m.heading*(180/Math.PI)-90-n.options.model.heading,j=m.pitch*(180/Math.PI)-n.options.model.pitch,R=n.options.model.roll,z=Ft()?Ft().entityMap.get(n.options.id):o.sdkP&&o.sdkP.entityMap.get(n.options.id),n.state||z&&(i&&i===n.sdk||o.sdkD&&o.sdkD===n.sdk)&&(I=z.model.heading,j=z.model.pitch,R=z.model.roll),!(isNaN(I)||isNaN(j)||isNaN(R))){e.next=92;break}return e.abrupt("return");case 92:n.state||(z&&(i&&i===n.sdk||o.sdkD&&o.sdkD===n.sdk)?(I=z.model.heading,j=z.model.pitch,R=z.model.roll):(I=n.model.heading||0===n.model.heading?n.model.heading:n.options.model.heading,j=n.model.pitch||0===n.model.pitch?n.model.pitch:n.options.model.pitch,R=n.model.roll||0===n.model.roll?n.model.roll:n.options.model.roll)),n.model.modelMatrix=Cesium.Matrix4.multiplyByMatrix3(F,Cesium.Matrix3.fromHeadingPitchRoll(Cesium.HeadingPitchRoll.fromDegrees(I,j,R)),n.model.modelMatrix),e.next=112;break;case 96:if(!n.entity){e.next=112;break}if(I=n.options.model.heading,j=n.options.model.pitch,R=n.options.model.roll,!(isNaN(I)||isNaN(j)||isNaN(R))){e.next=102;break}return e.abrupt("return");case 102:H=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(R)),V=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(j)),G=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(I)),W=Cesium.Matrix4.fromRotationTranslation(H),U=Cesium.Matrix4.fromRotationTranslation(V),Y=Cesium.Matrix4.fromRotationTranslation(G),J=new Cesium.Matrix4,Cesium.Matrix4.multiply(F,W,J),Cesium.Matrix4.multiply(J,U,J),Cesium.Matrix4.multiply(J,Y,n.entity.modelMatrix);case 112:if(n.model.position=u,n.model.roll=R,n.model.pitch=j,n.model.heading=I,u){e.next=118;break}return e.abrupt("return");case 118:q=n.cartesian3Towgs84(u,n.sdk.viewer),n.label.position=[q.lng,q.lat,q.alt],n.realTimeRouteArray.push(u),n.viewFollow&&(n.options.firstPersonView?n.sdk.viewer.camera.setView({destination:h,orientation:{heading:Cesium.Math.toRadians(I+90+n.firstPersonHeadingPitch.heading),pitch:Cesium.Math.toRadians(n.firstPersonHeadingPitch.pitch),roll:0}}):3===n.sdk.viewer.scene.mode?n.sdk.viewer.trackedEntity&&(n.sdk.viewer.trackedEntity.position=u):n.sdk.viewer.trackedEntity&&n.sdk.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(r[0],r[1],n.sdk.viewer.camera.positionCartographic.height),orientation:{heading:Cesium.Math.toRadians(-90),pitch:0,roll:0}}));case 123:case"end":return e.stop()}}),e,null,[[35,42]])})))).apply(this,arguments)},b=function(e){return C.apply(this,arguments)},i=_.length>1&&void 0!==_[1]?_[1]:{time:0},cancelAnimationFrame(this._requestAnimationFrameEventId),n=this,s=i.time||0,r=i.distance,l=this.sdk.viewer,this.model&&this.sdk&&this.sdk.viewer){e.next=11;break}return e.abrupt("return");case 11:for(this.removeModelAnimate(),c=[],u=0;u<t.length;u++)h=this.cartesian3Towgs84(t[u],l),c.push([h.lng,h.lat,h.alt]);p=turf.lineString(c),this.distance=turf.length(p,{units:"kilometers"}),d=1e3*this.distance/this.options.speed,r||0===r?(r>this.distance&&(r=this.distance),s=r/this.distance*d):(r=1e-6,s&&(s>d&&(s=d),r=s/d*this.distance)),v={},this.TweenAnimate=new TWEEN.Tween({distance:r}).to({distance:this.distance},1e3*(d-s)).delay(this.delay).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){(s||r)&&k.modelMove(t)})).onUpdate(function(){var e=o()(a.a.mark((function e(t,i){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(k.TweenAnimate._duration!=1/0){e.next=2;break}return e.abrupt("return");case 2:if(k.sdk.viewer){e.next=6;break}return k.removeModelAnimate(),e.abrupt("return");case 6:isNaN(t.distance)||b(t.distance);case 7:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).onEveryStart((function(){k.realTimeRouteArray=[]})).onComplete((function(e){k.state=!1})),this.state?this.TweenAnimate.start():(g=function(){if(n._requestAnimationFrameEventId2=requestAnimationFrame(g),n.options.firstPersonView){var e=pp({},n.sdk.viewer.camera._position);n.sdk.viewer.camera.setView({destination:e,orientation:{heading:Cesium.Math.toRadians(n.model.heading+90+n.firstPersonHeadingPitch.heading),pitch:Cesium.Math.toRadians(n.firstPersonHeadingPitch.pitch),roll:0}})}},b(r),setTimeout((function(){n.model.isMove=!1}),1e3),g());case 24:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"setMovePositionByDistance",value:function(e){var t=this.renewLinePositions(this.options.line.positions);this.modelMove(t,{distance:e})}},{key:"setMovePositionByTime",value:function(e){var t=this.renewLinePositions(this.options.line.positions);this.modelMove(t,{time:e})}},{key:"edit",value:(u=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 3:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=46;break}return e.next=9,new pn(this.sdk,this.options,{title:"轨迹运动属性",left:"180px",top:"100px",confirmCallBack:function(e){h.name=h.name.trim(),h.name||(h.name="未命名对象"),h.originalOptions=h.deepCopyObj(h.options),h._DialogObject.close();var t=h.deepCopyObj(h.options);t.host="",h.Dialog.confirmCallBack&&h.Dialog.confirmCallBack(t),Mt(h.sdk,h.options.id),at(h.sdk,h.options.id)},removeCallBack:function(){h.sdk.viewer.trackedEntity&&(h.sdk.viewer.entities.remove(h.sdk.viewer.trackedEntity),h.sdk.viewer.trackedEntity=null),h.Dialog.removeCallBack&&h.Dialog.removeCallBack()},closeCallBack:function(){h._DialogObject=null,h.reset(),h.Dialog.closeCallBack&&h.Dialog.closeCallBack(),h.editObj&&(h.editObj.destroy(),h.editObj=null),h.keyPointShow=!1,h.event&&h.event.destroy(),h.tip&&h.tip.destroy(),h.tip=null,h.ControllerObject.destroy(),h.firstPersonView!==h.originalOptions.firstPersonView&&(h.firstPersonView=h.originalOptions.firstPersonView),h.firstPersonView&&h.modelShow&&h.model&&(h.model.show=!1)},showCallBack:function(e){h.show=e,h.Dialog.showCallBack&&h.Dialog.showCallBack()}});case 9:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" trajectory-motion",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col"></div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">起始点高度</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">模型倍数</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="99999" step="1" @model="scale">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">运行速度</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" min="0" max="99999999" step="1" @model="speed">\n <span class="unit">m/s</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">延迟运动</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" min="0" max="9999999" @model="delay">\n <span class="unit">ms</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">更换模型</span>\n <button class="btn" @click="clickChangeModel">选择</button>\n </div>\n <div class="col">\n <span class="label">模型方向</span>\n <button class="btn model-rotate-btn" @click="modelRotate">开始调整</button>\n <svg class="icon-rubric"><use xlink:href="#yj-icon-rubric"></use></svg>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="btn-group">\n <button class="btn" style="border-radius: 5px 0 0 5px;" name="firstPerson"\n data-state="true"><span>第一视角</span></button>\n <button class="btn" style="border-radius: 0 5px 5px 0;" name="firstPerson"\n data-state="false"><span>第三视角</span></button>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item div-item-switch">\n <div class="row">\n <div class="col">\n <span class="label">路径显隐</span>\n <input class="btn-switch" type="checkbox" @model="lineShow">\n </div>\n <div class="col">\n <span class="label">模型显隐</span>\n <input class="btn-switch" type="checkbox" @model="modelShow">\n </div>\n <div class="col">\n <span class="label">实时路径</span>\n <input class="btn-switch" type="checkbox" @model="realTimeRoute">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">编辑</span>\n <input class="btn-switch" type="checkbox" @model="lineEdit">\n </div>\n <div class="col">\n <span class="label">路径圆滑</span>\n <input class="btn-switch" type="checkbox" @model="smooth">\n </div>\n <div class="col">\n <span class="label">环线</span>\n <input class="btn-switch" type="checkbox" @model="noseToTail">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">轨迹贴地</span>\n <input class="btn-switch" type="checkbox" @model="ground">\n </div>\n <div class="col">\n <span class="label">轨迹循环</span>\n <input class="btn-switch" type="checkbox" @model="loop">\n </div>\n <div class="col">\n <span class="label">轨迹动画</span>\n <input class="btn-switch" type="checkbox" @model="state">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">路径方向</span>\n <input class="btn-switch" type="checkbox" @model="routeDirection">\n </div>\n <div class="col" style="margin-right: 33px;">\n <span class="label">视角跟随</span>\n <input class="btn-switch" type="checkbox" @model="viewFollow">\n </div>\n <div class="col" style="margin: 0px;">\n <span class="label">模型动画</span>\n <div class="input input-select model-animate-select"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">文字开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n <div class="col"></div>\n </div>\n <div class="row">\n <div class="col" style="margin-right: 14px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2" style="width: 82px;">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1" style="width: 82px;">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1" style="width: 82px;">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">油耗</span>\n <div class="input-number input-number-unit-6" style="width: 170px;">\n <input class="input" type="number" title="" min="1" max="99999999" @model="unitFuelConsumption">\n <span class="unit">L/100km</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 0;">\n <span class="label">总油耗</span>\n <input class="btn-switch" type="checkbox" @model="fuelShow">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),this.editObj?(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="结束调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn is-active"):(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="开始调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn"),n=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){h.labelColor=e},clear:function(){h.labelColor=""}}),o=this._DialogObject._element.content.getElementsByClassName("height-box")[0],s=i.getElementsByTagName("*"),this._EventBinding.on(this,s),this._elms=this._EventBinding.element,this._elms.heightBox=o,this._elms.labelColor=[n],this.model&&(r=function(){var e=h.model.loader.components.animations;if(h._DialogObject){if(e){for(var t=[{name:"无",value:"无"}],n=0;n<e.length;n++)t.push({name:e[n].name,value:e[n].name});q(h._DialogObject._element.content,".model-animate-select").legp_search(t)}var o=i.getElementsByClassName("model-animate-select")[0].getElementsByTagName("input")[0];o.value=h.modelAnimate,o.addEventListener("input",(function(e,t){h.modelAnimate=o.value}))}},Number(Cesium.VERSION.split(".")[1])>=107?this.model.ready?r():this.model.readyEvent.addEventListener((function(){r()})):this.model.readyPromise.then((function(e){r()}))),this.ground?this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"):this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box"),(l=i.querySelectorAll("button[name='firstPerson']"))[0].addEventListener("click",(function(e){var t=rt();Rt()||t.sdkD||(h.firstPersonView||(h.viewFollow=!0),h.firstPersonView=!0)})),l[1].addEventListener("click",(function(e){h.firstPersonView&&(h.viewFollow=!0),h.firstPersonView=!1})),this.options.firstPersonView?(l[0].className="btn is-active",l[1].className="btn",this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null)):(l[0].className="btn",l[1].className="btn is-active"),(c=document.createElement("div")).className="custom-rubric-box",c.style.transformOrigin="center bottom",c.style.position="absolute",c.style.top="180px",c.style.right="3px",c.style.padding="5px 10px",c.style.backgroundColor="#3e4249",c.style.borderRadius="5px",c.style.fontSize="12px",c.style.color="#ff5733",c.style.display="none",c.innerHTML='场景正东方向为轨迹前进正方向<div x-arrow="" class="custom__popper__arrow" style="left: 59px;"></div>',(u=i.getElementsByClassName("icon-rubric")[0]).addEventListener("mouseenter",(function(e){c.style.display="block"})),document.addEventListener("mousemove",(function(e){u.contains(e.target)||(c.style.display="none")})),this._DialogObject._element.content.appendChild(c),setTimeout((function(){var e=Un(),t=q(h._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(t){t.legp_search(e);var i=h._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];i.value=e[h.labelFontFamily].value;for(var n=0;n<e.length;n++)if(e[n].value==i.value){t.legp_searchActive(e[n].value);break}i.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===i.value){h.labelFontFamily=e[t].key;break}})),h._elms.labelFontFamily=[i]}}),0);case 46:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"flyTo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};pi(0),ni(this.sdk),this.options.customView&&this.options.customView.position&&this.options.customView.orientation?this.sdk.viewer.camera.flyTo({destination:this.options.customView.position,orientation:this.options.customView.orientation}):this.line&&this.sdk.viewer.flyTo(this.line,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}})}},{key:"remove",value:(c=o()(a.a.mark((function e(){var t,i;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.scene.primitives.remove(this.model),this.sdk.viewer.entities.remove(this.line),this.sdk.viewer.entities.remove(this.realTimeLine),this.label&&this.label.remove(),t=0;t<this.keyPointShow.length;t++)this.sdk.viewer.entities.remove(this.keyPointShow[t]);return this.line=null,this.realTimeLine=null,this.model=null,this.label=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this._mouseRightevent&&this._mouseRightevent.destroy(),this.removeModelAnimate(),(i=Rt())&&i===this.sdk||(this.viewFollow=!1),cancelAnimationFrame(this._requestAnimationFrameEventId),e.next=19,this.sdk.removeIncetance(this.options.id);case 19:return e.next=21,Mt(this.sdk,this.options.id);case 21:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"reset",value:(l=o()(a.a.mark((function e(){var t,i=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.options.model.url!==this.originalOptions.model.url&&this.changeModelUrl(this.originalOptions.model.url),this.name=this.originalOptions.name,JSON.stringify(this.options.line.positions)!==JSON.stringify(this.originalOptions.line.positions)&&(this.options.line.positions=this.deepCopyObj(this.originalOptions.line.positions),t=this.renewLinePositions(this.options.line.positions),this.line.polyline.positions=t,setTimeout((function(){i.model.position=t[0],i.modelMove(t)}),0)),this.modelShow=this.originalOptions.model.show,this.noseToTail!==this.originalOptions.line.noseToTail&&(this.noseToTail=this.originalOptions.line.noseToTail),this.height!==this.originalOptions.height&&(this.height=this.originalOptions.height),this.lineShow!==this.originalOptions.line.show&&(this.lineShow=this.originalOptions.line.show),this.keyPointShow=!1,this.routeDirection=this.originalOptions.routeDirection,this.scale=this.originalOptions.model.scale,this.loop!==this.originalOptions.loop&&(this.loop=this.originalOptions.loop),this.viewFollow=this.originalOptions.viewFollow,this.state=this.originalOptions.state,this.speed=this.originalOptions.speed,this.smooth!==this.originalOptions.line.smooth&&(this.smooth=this.originalOptions.line.smooth),this.realTimeRoute=this.originalOptions.realTimeRoute,this.modelAnimate=this.originalOptions.model.animate,this.delay=this.originalOptions.delay,this.ground!==this.originalOptions.ground&&(this.ground=this.originalOptions.ground),this.firstPersonView!==this.originalOptions.firstPersonView&&(this.firstPersonView=this.originalOptions.firstPersonView),this.firstPersonView&&this.modelShow&&this.model&&(this.model.show=!1),this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.options=this.deepCopyObj(this.originalOptions);case 34:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"modelRotate",value:function(){if(this.editObj)this.editObj.destroy(),this.editObj=null,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="开始调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn");else if(this.viewFollow)window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"关闭视角跟随后可调整模型方向!",type:"warning",duration:1500}),console.warn("关闭视角跟随后可调整模型方向!"));else{this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="结束调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn is-active"),this.state=!1,this.editObj=new cc(this.sdk,this.model),this.editObj.editRtation(),this.editObj.transformCallBack=this.rotationEditingCallBack,this.routeDirection=!1;var e=this.options.model.heading,t=this.options.model.pitch,i=this.options.model.roll;if(isNaN(e)||isNaN(t)||isNaN(i))return;var n=Cesium.Transforms.eastNorthUpToFixedFrame(this.model.position),o=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(i)),s=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(t)),a=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(e)),r=Cesium.Matrix4.fromRotationTranslation(o),l=Cesium.Matrix4.fromRotationTranslation(s),c=Cesium.Matrix4.fromRotationTranslation(a),u=new Cesium.Matrix4;Cesium.Matrix4.multiply(n,r,u),Cesium.Matrix4.multiply(u,l,u),Cesium.Matrix4.multiply(u,c,this.entity.modelMatrix)}}},{key:"clickChangeModel",value:function(){this.Dialog.changeModelCallBack&&this.Dialog.changeModelCallBack()}},{key:"rotationEditingCallBack",get:function(){var e=this;return function(t){var i,n;e.options.model.heading=t.rz,e.options.model.pitch=t.ry,e.options.model.roll=t.rx,e._rotationEditingCallBack&&e._rotationEditingCallBack(e.editObj._params),e.entity&&(e.entity.isMove=!0),clearTimeout((n=e,(i=vp).get(fp(i,n)))),function(e,t,i){e.set(fp(e,t),i)}(vp,e,setTimeout((function(){e.entity&&(e.entity.isMove=!1)}),500))}},set:function(e){this._rotationEditingCallBack=e}},{key:"changeModelUrl",value:(r=o()(a.a.mark((function e(t){var i,n,o,s,r=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.sdk.viewer.scene.primitives.remove(this.model),this.options.model.url=this.replaceHost(t,this.options.host),i=this.model.modelMatrix,n=this.model.position,o={id:this.options.id,url:this.options.model.url,show:this.options.model.show,scale:this.options.model.scale},s=function(){r.options.model.url===r.originalOptions.model.url?r.modelAnimate=r.originalOptions.model.animate:r.options.model.animate="无";var e=r.model.loader.components.animations;if(r._DialogObject){if(e){for(var t=[{name:"无",value:"无"}],i=0;i<e.length;i++)t.push({name:e[i].name,value:e[i].name});q(r._DialogObject._element.content,".model-animate-select").legp_search(t)}var n=r._DialogObject._element.content.getElementsByClassName("model-animate-select")[0].getElementsByTagName("input")[0];n.value=r.modelAnimate,n.addEventListener("input",(function(e,t){r.modelAnimate=n.value}))}},!(Number(Cesium.VERSION.split(".")[1])>=107)){e.next=15;break}return e.next=9,Cesium.Model.fromGltfAsync(o);case 9:this.model=e.sent,this.model.position=n,this.sdk.viewer.scene.primitives.add(this.model),this.model.readyEvent.addEventListener((function(){s(),r.model.modelMatrix=i})),e.next=18;break;case 15:this.model=this.sdk.viewer.scene.primitives.add(Cesium.Model.fromGltf(o)),this.model.position=n,this.model.readyPromise.then((function(e){s(),r.model.modelMatrix=i}));case 18:this.model.imageBasedLighting.luminanceAtZenith=.6;case 19:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"removeModelAnimate",value:function(){this.TweenAnimate&&(clearTimeout(this.TweenAnimate.timeout),TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null)}},{key:"controllerCallBack",get:function(){return function(e){}},set:function(e){this._controllerCallBack=e}},{key:"renewLinePositions",value:function(e){var t=e;this.noseToTail&&(t=[].concat(A()(e),[e[0]]));for(var i=[],n=[],o=[],s=0;s<t.length;s++)i.push(t[s].lng,t[s].lat,t[s].alt),n.push(s/(t.length-1));this.smooth?this.spline=new Cesium.CatmullRomSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)}):this.spline=new Cesium.LinearSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)});for(var a=0;a<=1e3;a++){var r=this.spline.evaluate(a/1e3);o.push(r)}return this.positions_smooth=o,o}},{key:"flicker",value:function(){}}],[{key:"addLine",value:function(e){var i,n=e.renewLinePositions(e.options.line.positions);i=!!e.options.show&&e.options.line.show,e.sdk.viewer.entities.removeById(e.options.id+"-2"),e.sdk.viewer.entities.removeById(e.options.id+"-3"),e.line=e.sdk.viewer.entities.add({id:e.options.id+"-2",polyline:{positions:n,width:2,clampToGround:e.ground,material:i?new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff"),dashLength:20}):new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff00"),dashLength:20}),zIndex:e.sdk._entityZIndex}}),e.realTimeLine=e.sdk.viewer.entities.add({id:e.options.id+"-3",show:!!e.options.realTimeRoute&&e.options.realTimeRoute,polyline:{positions:new Cesium.CallbackProperty((function(){return e.realTimePositions}),!1),width:2,clampToGround:e.ground,material:Cesium.Color.fromCssColorString("#ff0000"),zIndex:e.sdk._entityZIndex}}),e.sdk._entityZIndex++,e._mouseRightevent&&e._mouseRightevent.destroy(),e._mouseRightevent=new K(e.sdk),e._mouseRightevent.mouse_right((function(t,i){var n,o=rt(),s=(n=e.sdk===o.sdkP?o.sdkD:o.sdkP)?n.entityMap.get(e.options.id):void 0;s&&(s.viewFollow=!1),e.viewFollow=!1}),!0),t.addModel(e),t.addKeyPoint(e),e.noseToTail=e.options.line.noseToTail,e.smooth=e.options.line.smooth,Mt(e.sdk,e.options.id),e.options.show&&Qe(0,e.options.id)}},{key:"addModel",value:(s=o()(a.a.mark((function e(i){var n,o,s,r,l,c,u;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.replaceHost(i.options.model.url,i.options.host),o={id:i.options.id,url:n,show:!!i.options.show&&i.options.model.show,scale:i.options.model.scale},!(Number(Cesium.VERSION.split(".")[1])>=107)){e.next=11;break}return e.next=5,Cesium.Model.fromGltfAsync(o);case 5:i.model=e.sent,i.model.originalBoundingSphereRadius=0,i.sdk.viewer.scene.primitives.add(i.model),i.model.readyEvent.addEventListener((function(){i.model.originalBoundingSphereRadius=i.model.boundingSphere.radius,i.modelAnimate=i.options.model.animate})),e.next=14;break;case 11:i.model=i.sdk.viewer.scene.primitives.add(Cesium.Model.fromGltf(o)),i.model.originalBoundingSphereRadius=0,i.model.readyPromise.then((function(){i.model.originalBoundingSphereRadius=i.model.boundingSphere.radius,i.modelAnimate=i.options.model.animate}));case 14:for(i.model.imageBasedLighting.luminanceAtZenith=.6,s=Cesium.Transforms.eastNorthUpToFixedFrame(i.positions_smooth[0]),i.model.modelMatrix=s,i.model.position=i.positions_smooth[0],i.model.customScale={x:i.options.model.scale,y:i.options.model.scale,z:i.options.model.scale},r=i.options.line.positions,l=[],c=0;c<r.length;c++)l.push(r[c].lng,r[c].lat,r[c].alt);u=i.smooth?i.positions_smooth:Cesium.Cartesian3.fromDegreesArrayHeights(l),t.createLabel(i),i.modelMove(u),i.entity=i.model;case 26:case"end":return e.stop()}}),e)}))),function(e){return s.apply(this,arguments)})},{key:"createLabel",value:(n=o()(a.a.mark((function e(t){var i;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=t.cartesian3Towgs84(t.model.position,t.sdk.viewer),t.label=new Xn(t.sdk,{show:!!t.options.show&&!!t.options.label.show,position:[i.lng,i.lat,i.alt],text:t.options.name,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far},t.model);case 2:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"addKeyPoint",value:(i=o()(a.a.mark((function e(t){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=0;case 1:if(!(i<t.options.line.positions.length)){e.next=13;break}return e.next=4,t.getClampToHeight(t.options.line.positions[i]);case 4:return n=e.sent,e.next=7,Cesium.Cartesian3.fromDegrees(t.options.line.positions[i].lng,t.options.line.positions[i].lat,n);case 7:o=e.sent,s=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:i,show:t._keyPoint||!1,position:t.ground?o:Cesium.Cartesian3.fromDegrees(t.options.line.positions[i].lng,t.options.line.positions[i].lat,t.options.line.positions[i].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.keyPoints.push(s);case 10:i++,e.next=1;break;case 13:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}]);var i,n,s,r,l,c,u,h}(Vn);function yp(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return bp(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)?bp(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function bp(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 Cp(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 wp(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Cp(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Cp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function kp(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function _p(e,t,i){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,i)}function Ep(e,t,i){return e.set(Sp(e,t),i),i}function Sp(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var Pp=new WeakMap,Dp=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),_p(i=kp(this,t,[e,n]),Pp,!1),i.options.name=n.name||"",i.options.show=!n.show&&!1!==n.show||n.show,i.options.speed=n.speed||0===n.speed?n.speed:1,i.options.totalTime=n.totalTime,(n.totalTime||0===n.totalTime)&&(i.totalTime=n.totalTime),i.options.delay=n.delay||0,i.options.loop=!n.loop&&!1!==n.loop||n.loop,i.options.line=n.line=n.line||{},i.options.line.positions=n.line.positions||[],i.options.height=n.height||0===n.height?n.height:i.options.line.positions[0]?i.options.line.positions[0].alt:0,i.options.line.show=!n.line.show&&!1!==n.line.show||n.line.show,i.options.line.smooth=!!n.line.smooth&&n.line.smooth,i.options.line.noseToTail=!!n.line.noseToTail&&n.line.noseToTail,i.positions_smooth=[],i.options.ground=n.ground||!1,i.options.state=!n.state&&!1!==n.state||n.state,i.options.routeDirection=!n.routeDirection&&!1!==n.routeDirection||n.routeDirection,i.keyPoints=[],i.realTimePositions=[],i._elms={},i.Dialog=o,i.realTimeRouteArray=[],i._current={heading:0,pitch:0,roll:0},i.distance,i.options.line.positions.length<2?(i._error="最少需要两个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500})):(i.ControllerObject=new Ho(i.sdk),i._EventBinding=new xn,t.addLine(i),i.firstPersonView=!1,i.options.viewFollow=!1),i}return un()(t,e),x()(t,[{key:"type",get:function(){return"TrajectoryMotionObject"}},{key:"show",get:function(){return this.options.show},set:function(e){if("boolean"==typeof e){if(this.options.show=e,e){this.line.show=this.lineShow;for(var t=0;t<this.keyPoints.length;t++)this.keyPoints[t].show=this.keyPointShow}else{this.line.show=e;for(var i=0;i<this.keyPoints.length;i++)this.keyPoints[i].show=e}this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=e)}else console.error("参数必须为boolean")}},{key:"height",get:function(){return this.options.height},set:function(e){var t=this;if(this.options.height=e,this.line)if(this.ground){this.line.polyline.clampToGround=!0;for(var i=function(e){t.sdk.viewer.scene.clampToHeightMostDetailed([new Cesium.Cartesian3.fromDegrees(t.options.line.positions[e].lng,t.options.line.positions[e].lat)]).then((function(i){t.keyPoints[e].position=i[0]}))},n=0;n<this.keyPoints.length;n++)i(n)}else{var o=this.options.height-this.options.line.positions[0].alt;this.line.polyline.clampToGround=!1;for(var s=0;s<this.keyPoints.length;s++)this.options.line.positions[s].alt+=o,this.keyPoints[s].position=Cesium.Cartesian3.fromDegrees(this.options.line.positions[s].lng,this.options.line.positions[s].lat,this.options.line.positions[s].alt)}this._renewLine(this.options.line.positions);this._elms.height&&this._elms.height.forEach((function(t){t.value=e}))}},{key:"ground",get:function(){return this.options.ground},set:function(e){this.lineEdit=!1,this.options.ground=e,this.realTimeLine.polyline.clampToGround=e,this.height=this.options.height,this._elms.ground&&this._elms.ground.forEach((function(t){t.checked=e}))}},{key:"speed",get:function(){return this.options.speed},set:function(e){var t=this;e<=0&&(e=.01),this.options.speed=e,(this.distance||0===this.distance)&&(this.options.totalTime=1e3*this.distance/this.options.speed,this.TweenAnimate&&this.state&&this.TweenAnimate&&this.setMovePositionByDistance(this.TweenAnimate._object.distance),this._elms.speed&&this._elms.speed.forEach((function(t){t.value=e})),this._elms.totalTime&&this._elms.totalTime.forEach((function(e){e.value=t.options.totalTime})))}},{key:"totalTime",get:function(){return this.options.totalTime},set:function(e){var t=this;this.options.totalTime=e,(this.distance||0===this.distance)&&(this.options.speed=1e3*this.distance/this.options.totalTime,this.TweenAnimate&&this.setMovePositionByDistance(this.TweenAnimate._object.distance),this._elms.totalTime&&this._elms.totalTime.forEach((function(t){t.value=e})),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t.options.speed})))}},{key:"smooth",get:function(){return this.options.line.smooth},set:function(e){this.lineEdit=!1,this.options.line.smooth=e;var t=this._renewLine(this.options.line.positions);this.modelMove(t),this._elms.smooth&&this._elms.smooth.forEach((function(t){t.checked=e}))}},{key:"delay",get:function(){return this.options.delay},set:function(e){this.options.delay=e,this.TweenAnimate&&this.TweenAnimate.delay(this.delay),this._elms.delay&&this._elms.delay.forEach((function(t){t.value=e}))}},{key:"state",get:function(){return this.options.state},set:function(e){if(this.options.state=e,this.editObj&&(this.editObj.destroy(),this.editObj=null),this.TweenAnimate)e?this.speed=this.speed:this.TweenAnimate.pause();else if(e){var t=this._renewLine(this.options.line.positions);this.modelMove(t)}this._elms.state&&this._elms.state.forEach((function(t){t.checked=e}))}},{key:"noseToTail",get:function(){return this.options.line.noseToTail},set:function(e){this.lineEdit=!1,this.options.line.noseToTail=e;for(var t=[],i=0;i<this.options.line.positions.length;i++)t.push(this.options.line.positions[i].lng,this.options.line.positions[i].lat,this.options.line.positions[i].alt);Cesium.Cartesian3.fromDegreesArrayHeights(t);if(this.line){var n=this._renewLine(this.options.line.positions);this.modelMove(n)}this._elms.noseToTail&&this._elms.noseToTail.forEach((function(t){t.checked=e}))}},{key:"lineShow",get:function(){return this.options.line.show},set:function(e){e&&(this.realTimeRoute=!1),this.options.line.show=e,this.line&&this.show&&(this.line.show=e),this._elms.lineShow&&this._elms.lineShow.forEach((function(t){t.checked=e}))}},{key:"realTimeRoute",get:function(){return this.options.realTimeRoute},set:function(e){e&&(this.lineShow=!1,this.keyPointShow=!1),this.options.realTimeRoute=e,this.realTimeLine&&this.show&&(this.realTimeLine.show=e),this._elms.realTimeRoute&&this._elms.realTimeRoute.forEach((function(t){t.checked=e}))}},{key:"keyPointShow",get:function(){return this.options.line.keyPoint},set:function(e){this.options.line.keyPoint=e;for(var t=0;t<this.keyPoints.length;t++)this.show&&(this.keyPoints[t].show=e);this._elms.keyPointShow&&this._elms.keyPointShow.forEach((function(t){t.checked=e})),!e&&this.lineEdit&&(Ep(Pp,this,e),YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.ControllerObject&&this.ControllerObject.destroy(),this.tip&&this.tip.destroy(),this.tip=null,this._elms.lineEdit&&this._elms.lineEdit.forEach((function(t){t.checked=e})))}},{key:"lineEdit",get:function(){return t=this,(e=Pp).get(Sp(e,t));var e,t},set:function(e){var t=this,i=[],n=function(e){i=t._renewLine(e),t.modelMove(i)};if(e){if(this.viewFollow=!1,YJ.Measure.GetMeasureStatus())return console.warn("上一次测量未结束"),void(this.lineEdit=!1);var o;this.ground=!1,this.smooth=!1,this.state=!1,YJ.Measure.SetMeasureStatus(!0),this.tip=new Q("请选择一个顶点,右键取消",this.sdk),this.event=new K(this.sdk),n(A()(this.options.line.positions)),this.event.mouse_left((function(e,i){var s=t.sdk.viewer.scene.pick(e.position);if(s&&s.id&&s.id.name&&"node-secondary-edit-point"===s.id.name)for(var a=0;a<t.keyPoints.length;a++)if(t.keyPoints[a].id===s.id.id){o=s.id,t.ControllerObject.position=t.options.line.positions[o.index],t.ControllerObject.editTranslational(),t.tip&&t.tip.destroy(),t.tip=null,t.ControllerObject.controllerCallBack=function(e){t.options.line.positions[o.index]=e.position,o.position=Cesium.Cartesian3.fromDegrees(e.position.lng,e.position.lat,e.position.alt),n(A()(t.options.line.positions))};break}})),this.event.mouse_right((function(e,i){t.keyPointShow=!1,YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,t.ControllerObject.destroy()})),this.event.mouse_move((function(e,i){t.tip&&t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.line.polyline.positions=new Cesium.CallbackProperty((function(){return i}),!1),this.keyPointShow=e}else this.lineEdit&&(YJ.Measure.SetMeasureStatus(!1),this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=null),this.keyPointShow=e,this.ControllerObject.destroy();Ep(Pp,this,e),this._elms.lineEdit&&this._elms.lineEdit.forEach((function(t){t.checked=e}))}},{key:"routeDirection",get:function(){return this.options.routeDirection},set:function(e){this.options.routeDirection=e,this._elms.routeDirection&&this._elms.routeDirection.forEach((function(t){t.checked=e}))}},{key:"loop",get:function(){return this.options.loop},set:function(e){this.options.loop=e,e?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat(),this._elms.loop&&this._elms.loop.forEach((function(t){t.checked=e}))}},{key:"firstPersonView",get:function(){return this.options.firstPersonView},set:function(e){if(this.sdk.viewer._firstPersonView=e,this.options.firstPersonView=e,this.options.firstPersonView){if(this._DialogObject&&this._DialogObject._element.content){var t=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");t[0].className="btn is-active",t[1].className="btn"}this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null)}else{if(this._DialogObject&&this._DialogObject._element.content){var i=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");i[0]&&i[1]&&(i[0].className="btn",i[1].className="btn is-active")}if(this.viewFollow){this.sdk.viewer.trackedEntity&&this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity);var n=this.sdk.viewer.entities.add({position:this.positions_smooth[0],point:{color:Cesium.Color.RED.withAlpha(0),pixelSize:0}});this.sdk.viewer.trackedEntity=n}}}},{key:"viewFollow",get:function(){return this.options.viewFollow},set:function(e){if(this.options.viewFollow=e,this.options.viewFollow?this.lineEdit=!1:this.firstPersonView=!1,this.options.firstPersonView){if(this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null),this._DialogObject&&this._DialogObject._element.content){var t=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");t[0]&&t[1]&&(t[0].className="btn",t[1].className="btn is-active")}}else if(this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null),e){var i=this.sdk.viewer.entities.add({position:this.current.position,point:{color:Cesium.Color.RED.withAlpha(0),pixelSize:0}});this.sdk.viewer.trackedEntity=i}this._elms.viewFollow&&this._elms.viewFollow.forEach((function(t){t.checked=e}))}},{key:"moveCallBack",value:function(e){this.setPosition=e.setPosition.bind(e)}},{key:"current",get:function(){return this._current},set:function(e){this._current=e;var t=this.cartesian3Towgs84(this._current.position,this.sdk.viewer);this.setPosition&&this.setPosition(wp(wp({},this._current),{},{position:wp({},t)}))}},{key:"modelMove",value:(s=o()(a.a.mark((function e(t){var i,n,s,r,l,c,u,h,p,d,m,f,v,g,b,C,w,k,_,x,E,S,P=this,D=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(S=function(e,t){var i=Cesium.Transforms.eastNorthUpToFixedFrame(e);if(t){var n=Cesium.Cartesian3.subtract(t,e,new Cesium.Cartesian3),o=Cesium.Matrix4.multiplyByPointAsVector(Cesium.Matrix4.inverse(i,new Cesium.Matrix4),n,new Cesium.Cartesian3),s=Cesium.Cartesian3.normalize(o,new Cesium.Cartesian3),a=Math.atan2(s.y,s.x)-Cesium.Math.PI_OVER_TWO,r=Cesium.Math.PI_OVER_TWO-Cesium.Math.acosClamped(s.z),l=r*(180/Math.PI);r=l*(Math.PI/180);var c=Cesium.Math.fastApproximateAtan2(s.x,s.z);return{heading:Cesium.Math.TWO_PI-Cesium.Math.zeroToTwoPi(a),pitch:r,roll:c}}},E=function(){return(E=o()(a.a.mark((function e(t){var i,o,s,r,c,u,h,d,y,b,C,w,k,x,E,P,D,M,T,O;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=p,!(i=t)){e.next=10;break}return e.next=6,turf.lineSliceAlong(p,0,i,{units:"kilometers"});case 6:r=e.sent,o=A()(r.geometry.coordinates[r.geometry.coordinates.length-1]),e.next=11;break;case 10:o=A()(p.geometry.coordinates[0]);case 11:if(!n.ground){e.next=38;break}return e.next=14,n.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(o[0],o[1]),g);case 14:return h=e.sent,(c=h)||(c=new Cesium.Cartesian3.fromDegrees(o[0],o[1])),d=n.cartesian3Towgs84(c,l),y=0,e.prev=19,e.next=22,Cesium.sampleTerrainMostDetailed(n.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(d.lng,d.lat)]);case 22:b=e.sent,y=b[0].height,e.next=29;break;case 26:e.prev=26,e.t0=e.catch(19),y=0;case 29:for(d.alt<y&&(d.alt=y),d.alt=Number(d.alt.toFixed(1)),c=Cesium.Cartesian3.fromDegrees(d.lng,d.lat,d.alt),u=Cesium.Cartesian3.fromDegrees(o[0],o[1],n.cartesian3Towgs84(c,n.sdk.viewer).alt+1),C=[],w=0;w<s.geometry.coordinates.length;w++)C.push(s.geometry.coordinates[w][0],s.geometry.coordinates[w][1]);n.realTimePositions=Cesium.Cartesian3.fromDegreesArray(C),e.next=54;break;case 38:k=n.spline.evaluate(t/n.distance),o=n.cartesian3Towgs84(k,l),c=Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),u=Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt+1),x=[],E=0;case 44:if(!(E<=100)){e.next=52;break}if(!(E/100>t/n.distance)){e.next=47;break}return e.abrupt("break",52);case 47:P=n.spline.evaluate(E/100),x.push(P);case 49:E++,e.next=44;break;case 52:x.push(k),n.realTimePositions=x;case 54:if(m=S(n.current.position,c),v&&v.position&&(f=S(v.position,c),m.pitch=f.pitch),v.position=n.current.position,D=Cesium.HeadingPitchRoll.fromDegrees(n.current.heading,n.current.pitch,n.current.roll),M=0,T=0,O=0,n.options.routeDirection?(M=(m.heading-D.heading)*(180/Math.PI)-90+n.current.heading,T=m.pitch*(180/Math.PI)):(M=n.current.heading,T=n.current.pitch),O=n.current.roll,!(isNaN(M)||isNaN(T)||isNaN(O))){e.next=65;break}return e.abrupt("return");case 65:(M<0||M>180)&&(T=-T),n.current={position:c,heading:M,pitch:T,roll:O},_&&(_=!1,n._first={position:c,heading:M,pitch:T,roll:O}),n.realTimeRouteArray.push(c),n.viewFollow&&(n.options.firstPersonView?n.sdk.viewer.camera.setView({destination:u,orientation:{heading:n.sdk.viewer.camera.heading,pitch:n.sdk.viewer.camera.pitch,roll:n.sdk.viewer.camera.roll}}):n.sdk.viewer.trackedEntity&&(n.sdk.viewer.trackedEntity.position=c));case 71:case"end":return e.stop()}}),e,null,[[19,26]])})))).apply(this,arguments)},x=function(e){return E.apply(this,arguments)},i=D.length>1&&void 0!==D[1]?D[1]:{time:0},n=this,s=i.time||0,r=i.distance||0,l=this.sdk.viewer,this.removeModelAnimate(),c=[],u=0;u<t.length;u++)h=this.cartesian3Towgs84(t[u],l),c.push([h.lng,h.lat,h.alt]);p=turf.lineString(c),this.distance=turf.length(p,{units:"kilometers"}),this.totalTime||(this.totalTime=1e3*this.distance/this.options.speed),d=this.totalTime,s&&(s>d&&(s=d),r=s/d*this.distance),v={},g=[],b=yp(this.sdk.entityMap);try{for(b.s();!(C=b.n()).done;)(w=y()(C.value,2))[0],(k=w[1]).type&&"glb"===k.type&&g.push(k.entity)}catch(e){b.e(e)}finally{b.f()}_=!0,this.TweenAnimate=new TWEEN.Tween({distance:r}).to({distance:this.distance},1e3*(d-s)).delay(this.delay).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){s&&P.modelMove(t)})).onUpdate(function(){var e=o()(a.a.mark((function e(t,i){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(P.TweenAnimate._duration!=1/0){e.next=2;break}return e.abrupt("return");case 2:if(P.sdk.viewer){e.next=6;break}return P.removeModelAnimate(),e.abrupt("return");case 6:x(t.distance);case 7:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).onEveryStart((function(){P.realTimeRouteArray=[]})).onComplete((function(e){P.state=!1,P.removeModelAnimate()})),this.state?this.TweenAnimate.start():x(r);case 26:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"setMovePositionByDistance",value:function(e){var t=this._renewLine(this.options.line.positions);this.modelMove(t,{distance:e})}},{key:"setMovePositionByTime",value:function(e){var t=this._renewLine(this.options.line.positions);this.modelMove(t,{time:e}),this.state||this.modelMove(t,{time:e+.01})}},{key:"pause",value:function(){this.state=!1}},{key:"resume",value:function(){this.state=!0}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:{},pi(0),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=22;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},(l=wp({},this.options.line.positions[0])).hasOwnProperty("alt")){e.next=15;break}return e.next=14,this.getClampToHeight(l);case 14:l.alt=e.sent;case 15:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=23;break;case 22:this.line&&this.sdk.viewer.flyTo(this.line,{offset:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}});case 23:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:function(){this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.entities.remove(this.line),this.line=null,this.removeModelAnimate()}},{key:"reset",value:function(){this.modelMove(this.line.polyline.positions._value),this.state=!1,this.current=this._first}},{key:"removeModelAnimate",value:function(){this.TweenAnimate&&(clearTimeout(this.TweenAnimate.timeout),TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null)}},{key:"_renewLine",value:function(e){this.options.line.positions=e;var t=e;this.noseToTail&&(t=[].concat(A()(e),[e[0]]));for(var i=[],n=[],o=[],s=0;s<t.length;s++)i.push(t[s].lng,t[s].lat,t[s].alt),n.push(s/(t.length-1));this.smooth?this.spline=new Cesium.CatmullRomSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)}):this.spline=new Cesium.LinearSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)});for(var a=0;a<=100;a++){var r=this.spline.evaluate(a/100);o.push(r)}return this.positions_smooth=o,o}},{key:"renewLinePositions",value:function(e){this.options.line.positions=e;var t=e;this.noseToTail&&(t=[].concat(A()(e),[e[0]]));for(var i=[],n=[],o=[],s=0;s<t.length;s++)i.push(t[s].lng,t[s].lat,t[s].alt),n.push(s/(t.length-1));this.smooth?this.spline=new Cesium.CatmullRomSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)}):this.spline=new Cesium.LinearSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)});for(var a=0;a<=100;a++){var r=this.spline.evaluate(a/100);o.push(r)}return this.positions_smooth=o,this.line&&this.line.polyline&&(this.line.polyline.positions=o),o}},{key:"flicker",value:function(){}}],[{key:"addLine",value:function(e){var i=e._renewLine(e.options.line.positions);e.current.position=i[0],e.line=e.sdk.viewer.entities.add({id:e.options.id+"-2",show:!!e.options.show&&e.options.line.show,polyline:{positions:i,width:2,clampToGround:e.ground,material:Cesium.Color.fromCssColorString("#ffffff"),zIndex:e.sdk._entityZIndex}}),e.realTimeLine=e.sdk.viewer.entities.add({id:e.options.id+"-3",show:!!e.options.realTimeRoute&&e.options.realTimeRoute,polyline:{positions:new Cesium.CallbackProperty((function(){return e.realTimePositions}),!1),width:2,clampToGround:e.ground,zIndex:e.sdk._entityZIndex,material:Cesium.Color.fromCssColorString("#ff0000")}}),e.sdk._entityZIndex++,new K(e.sdk).mouse_right((function(t,i){e.viewFollow=!1})),t.addKeyPoint(e),e.noseToTail=e.options.line.noseToTail,e.smooth=e.options.line.smooth}},{key:"addModel",value:function(e){}},{key:"addKeyPoint",value:(i=o()(a.a.mark((function e(t){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=0;case 1:if(!(i<t.options.line.positions.length)){e.next=13;break}return e.next=4,t.getClampToHeight(t.options.line.positions[i]);case 4:return n=e.sent,e.next=7,Cesium.Cartesian3.fromDegrees(t.options.line.positions[i].lng,t.options.line.positions[i].lat,n);case 7:o=e.sent,s=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:i,show:t.options.line.keyPoint||!1,position:t.ground?o:Cesium.Cartesian3.fromDegrees(t.options.line.positions[i].lng,t.options.line.positions[i].lat,t.options.line.positions[i].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.keyPoints.push(s);case 10:i++,e.next=1;break;case 13:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}]);var i,n,s}(Vn);function Mp(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Tp=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=Mp(this,t,[e,n])).options.width=n.width||1,i.options.color=n.color||"#ff0000",i._elms={},i.tools=new vi(e),i._EventBinding=new xn,t.edit(i,!0),i}return un()(t,e),x()(t,[{key:"color",get:function(){return this.options.color},set:function(e){var t=this;this.options.color&&(this.options.color=e,this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,255,255,1)"}});t._elms.color[n]=o})))}},{key:"width",get:function(){return this.options.width},set:function(e){this.options.width=e,this._elms.width&&this._elms.width.forEach((function(t){t.value=e}))}},{key:"start",value:function(){var e,i,n,o,s,a=this;if(YJ.Measure.GetMeasureStatus())this.tools.message({type:"warning",text:"上一次测量未结束"});else{this.sdk.viewer;Qt(this.sdk,!1),(e=t,i="start",n=this,o=3,s=aa()(ln()(1&o?e.prototype:e),i,n),2&o&&"function"==typeof s?function(e){return s.apply(n,e)}:s)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Q("长按左键,拖动鼠标进行涂鸦,右键结束涂鸦",this.sdk),this.event=new K(this.sdk),this.positions=[],this.points_ids=[];var r=[],l=[];this.event.mouse_left_down((function(e,t){l=[];var i=a.sdk.viewer.entities.add({name:"涂鸦",polyline:{positions:new Cesium.CallbackProperty((function(){return l}),!1),width:a.width,clampToGround:!0,material:Cesium.Color.fromCssColorString(a.color),zIndex:99999999}});r.push(i),a.event.mouse_move((function(e,t){a.tip.setPosition(t,e.endPosition.x,e.endPosition.y),l.push(t)}))})),this.event.mouse_left_up((function(e,t){r[r.length-1].polyline.positions=l,a.event.mouse_move((function(e,t){a.tip.setPosition(t,e.endPosition.x,e.endPosition.y)}))})),this.event.mouse_move((function(e,t){a.tip.setPosition(t,e.endPosition.x,e.endPosition.y)})),this.event.mouse_right((function(e,t){a.end()})),this.event.gesture_pinck_start((function(e,t){var i=new Date;a.event.gesture_pinck_end((function(){new Date-i>=500&&a.end()}))}))}}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.event=void 0,this.tip&&this.tip.destroy(),this.tip=void 0,Qt(this.sdk,!0)}},{key:"remove",value:function(){this.end(),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);for(var e=this.sdk.viewer.entities.values,t=e.length-1;t>=0;t--)"涂鸦"===e[t].name&&this.sdk.viewer.entities.remove(e[t])}},{key:"flicker",value:function(){}}],[{key:"edit",value:(i=o()(a.a.mark((function e(t,i){var n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i?(n=document.getElementsByClassName("graffiti")[0],o=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:t.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,255,255,1)"}}),s=n.getElementsByTagName("*"),t._EventBinding.on(t,s),t._elms=t._EventBinding.element,t._elms.color=[o]):t._DialogObject&&t._DialogObject.close&&(t._DialogObject.close(),t._DialogObject=null);case 1:case"end":return e.stop()}}),e)}))),function(e,t){return i.apply(this,arguments)})}]);var i}(la),Op=i(14),Np=i.n(Op);function Bp(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Ap(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)?Ap(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ap(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 Lp(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 Ip(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Lp(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Lp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function jp(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Rp=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(i=jp(this,t,[e,n])).options.name=n.name||"未命名对象",i.options.show=!n.show&&!1!==n.show||n.show,i.options.url=n.url,i.options.angle=n.angle||0,i.options.scale=n.scale||0===n.scale?n.scale:1,i.options.position=n.position,i.options.offset=n.offset||{x:.5,y:1},i.options.mode=i.options.mode?1:0,i.options.billboard=n.billboard||{},i.options.billboard.scale=i.options.billboard.scale||1,i.options.billboard.near=i.options.billboard.near||0===i.options.billboard.near?i.options.billboard.near:2e3,i.options.billboard.far=i.options.billboard.far||0===i.options.billboard.far?i.options.billboard.far:1e5,i.options.billboard.scaleByDistance=!!i.options.billboard.scaleByDistance,n.label=n.label||{},i.options.label=n.label||{},i.options.label.text=n.label.text||i.options.name,i.options.name=i.options.label.text,i.options.label.show=!n.label.show&&!1!==n.label.show||n.label.show,i.options.label.fontFamily=n.label.fontFamily||0,i.options.label.fontSize=n.label.fontSize||39,i.options.label.color=n.label.color||"#00ffff",i.options.flipe=n.flipe||{},i.options.flipe.x=i.options.flipe.x||!1,i.options.flipe.y=i.options.flipe.y||!1,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:3,i.entity={id:i.options.id},i._positionEditing=!1,i.Dialog=o,i._elms={},i._proj=i.sdk.proj,i.previous={position:Ip({},i.options.position)},i._EventBinding=new xn,i.event=new K(i.sdk),i.sdk.addIncetance(i.options.id,i),i.create(),i}return un()(t,e),x()(t,[{key:"name",get:function(){return this.options.name},set:function(e){var i,n,o,s,a,r;i=t,n="name",o=e,s=this,a=1,r=1,Np()(ln()(r?i.prototype:i),n,o,s,a),this.options.label.text=this.options.name,this.entity&&(this.entity.label.text=this.options.label.text)}},{key:"mode",get:function(){return this.options.mode},set:function(e){var t=this;this.options.mode=e?1:0;for(var i=[{name:"贴地",value:"贴地",key:0},{name:"立体",value:"立体",key:1}],n=function(e){if(i[e].key===t.options.mode)return t._elms.mode&&t._elms.mode.forEach((function(t){t.value=i[e].value})),1},o=0;o<i.length&&!n(o);o++);if(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.body){for(var s=this._DialogObject._element.body.getElementsByClassName("row"),a=this._DialogObject._element.foot.getElementsByTagName("button"),r=this._DialogObject._element.foot.getElementsByTagName("h4"),l=0;l<s.length;l++){var c=s[l].getAttribute("mode");null!==c&&(c==this.options.mode?s[l].style.display="flex":s[l].style.display="none")}for(var u=0;u<a.length;u++){var h=a[u].getAttribute("mode");null!==h&&(h==this.options.mode?a[u].style.display="block":a[u].style.display="none")}for(var p=0;p<r.length;p++){var d=r[p].getAttribute("mode");null!==d&&(d==this.options.mode?r[p].style.display="block":r[p].style.display="none")}}var m=new Image;m.crossOrigin="Anonymous",m.src=this.replaceHost(this.options.url,this.options.host),m.onload=function(){var e=document.createElement("canvas"),i=e.getContext("2d");if(t.mode){var n=t.entity.billboard.image.getValue(),o=n.height*(128/n.width);t.entity.billboard.pixelOffset={x:-128*t.billboardScale*t.options.offset.x,y:-o*t.billboardScale*t.options.offset.y},t.entity.billboard.show=!0,t.labelShow&&(t.entity.label.show=!0),t.entity.rectangle.show=!1}else e.width=2*m.width,e.height=2*m.height,t.flipeX&&(i.scale(1,-1),i.translate(0,-e.height)),t.flipeY&&(i.scale(-1,1),i.translate(-e.width,0)),i.drawImage(m,m.width-m.width*t.options.offset.x,m.height-m.height*t.options.offset.y),t.entity.rectangle.material=new Cesium.ImageMaterialProperty({image:e,transparent:!0}),t.entity.billboard.show=!1,t.entity.label.show=!1,t.entity.rectangle.show=!0}}},{key:"offset",get:function(){return this.options.offset},set:function(e){var t=this;this.options.offset=e;var i=new Image;i.crossOrigin="Anonymous",i.src=this.replaceHost(this.options.url,this.options.host),i.onload=function(){var e=document.createElement("canvas"),n=e.getContext("2d");if(t.mode){var o=t.entity.billboard.image.getValue(),s=o.height*(128/o.width);t.entity.billboard.pixelOffset={x:-128*t.billboardScale*t.options.offset.x,y:-s*t.billboardScale*t.options.offset.y},t.entity.billboard.show=!0,t.labelShow&&(t.entity.label.show=!0),t.entity.rectangle.show=!1}else e.width=2*i.width,e.height=2*i.height,t.flipeX&&(n.scale(1,-1),n.translate(0,-e.height)),t.flipeY&&(n.scale(-1,1),n.translate(-e.width,0)),n.drawImage(i,i.width-i.width*t.options.offset.x,i.height-i.height*t.options.offset.y),t.entity.rectangle.material=new Cesium.ImageMaterialProperty({image:e,transparent:!0}),t.entity.billboard.show=!1,t.entity.label.show=!1,t.entity.rectangle.show=!0}}},{key:"angle",get:function(){return this.options.angle},set:function(e){this.options.angle=e,this._elms.angle&&this._elms.angle.forEach((function(t){t.value=e}))}},{key:"scale",get:function(){return this.options.scale},set:function(e){this.options.scale=e,this._elms.scale&&this._elms.scale.forEach((function(t){t.value=e}))}},{key:"billboardScale",get:function(){return this.options.billboard.scale},set:function(e){var t=Number(e.toFixed(2));t>99&&(t=99),t<.1&&(t=.1),this.options.billboard.scale=t,this.renewPoint(),this._elms.billboardScale&&this._elms.billboardScale.forEach((function(t){t.value=e}))}},{key:"billboardScaleByDistance",get:function(){return this.options.billboard.scaleByDistance},set:function(e){this.options.billboard.scaleByDistance=e,this.renewPoint(),this._elms.billboardScaleByDistance&&this._elms.billboardScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"billboardNear",get:function(){return this.options.billboard.near},set:function(e){var t=e;t>this.billboardFar&&(t=this.billboardFar),this.options.billboard.near=t,this.renewPoint(),this._elms.billboardNear&&this._elms.billboardNear.forEach((function(e){e.value=t}))}},{key:"billboardFar",get:function(){return this.options.billboard.far},set:function(e){var t=e;t<this.billboardNear&&(t=this.billboardNear),this.options.billboard.far=t,this.renewPoint(),this._elms.billboardFar&&this._elms.billboardFar.forEach((function(e){e.value=t}))}},{key:"flipeY",get:function(){return this.options.flipe.y},set:function(e){var t=this;if("boolean"==typeof e){if(this.options.flipe.y=e,!this.entity)return;var i=new Image;i.crossOrigin="Anonymous",i.src=this.replaceHost(this.options.url,this.options.host),i.onload=function(){var e=document.createElement("canvas"),n=e.getContext("2d");t.mode||(e.width=2*i.width,e.height=2*i.height,t.flipeX&&(n.scale(1,-1),n.translate(0,-e.height)),t.flipeY&&(n.scale(-1,1),n.translate(-e.width,0)),n.drawImage(i,i.width-i.width*t.options.offset.x,i.height-i.height*t.options.offset.y),t.entity.rectangle.material=new Cesium.ImageMaterialProperty({image:e,transparent:!0}),t.entity.billboard.show=!1,t.entity.label.show=!1,t.entity.rectangle.show=!0)}}else console.error("参数必须为boolean")}},{key:"flipeX",get:function(){return this.options.flipe.x},set:function(e){var t=this;if("boolean"==typeof e){if(this.options.flipe.x=e,!this.entity)return;var i=new Image;i.crossOrigin="Anonymous",i.src=this.replaceHost(this.options.url,this.options.host),i.onload=function(){var e=document.createElement("canvas"),n=e.getContext("2d");t.mode||(e.width=2*i.width,e.height=2*i.height,t.flipeX&&(n.scale(1,-1),n.translate(0,-e.height)),t.flipeY&&(n.scale(-1,1),n.translate(-e.width,0)),n.drawImage(i,i.width-i.width*t.options.offset.x,i.height-i.height*t.options.offset.y),t.entity.rectangle.material=new Cesium.ImageMaterialProperty({image:e,transparent:!0}),t.entity.billboard.show=!1,t.entity.label.show=!1,t.entity.rectangle.show=!0)}}else console.error("参数必须为boolean")}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(e){var t;this.options.heightMode=e||0,this.options.heightMode=e||0==e?e:3;var i,n,o="";switch(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(i=this._DialogObject._element.content.getElementsByClassName("alt-box")[0]),this._elms.height&&(n=this._elms.height.getElementsByClassName("input-number")[0]),this.options.heightMode){case"0":case 0:i&&(i.className="input-number input-number-unit-1 alt-box"),n&&(n.className="input-number input-number-unit-1"),t=Cesium.HeightReference.NONE,o="海拔高度";break;case"1":case 1:i&&(i.className="input-number input-number-unit-1 alt-box"),n&&(n.className="input-number input-number-unit-1"),t=Cesium.HeightReference.NONE,o="相对地表";break;case"2":case 2:i&&(i.className="input-number input-number-unit-1 alt-box disabled"),o="依附地表",i&&(i.className="input-number input-number-unit-1 alt-box disabled"),o="依附地表",t=Cesium.HeightReference.CLAMP_TO_GROUND,n&&(n.className="input-number input-number-unit-1 disabled");break;case"3":case 3:i&&(i.className="input-number input-number-unit-1 alt-box disabled"),n&&(n.className="input-number input-number-unit-1 disabled"),t=Cesium.HeightReference.NONE,o="依附模型"}this.entity&&this.entity.billboard&&(this.entity.billboard.heightReference=t),this._elms.heightMode&&(this._elms.heightMode.value=o)}},{key:"coordinate",get:function(){return this.options.coordinate},set:function(e){this.options.coordinate=e}},{key:"position",get:function(){return this.options.position},set:function(e){var t=this;if(this.options.position=e,this.coordinate=this.options.coordinate,this._textToCenter){var i=turf.point([this.options.position.lng,this.options.position.lat]),n=turf.destination(i,this._textToCenter.distance,this._textToCenter.angle,{units:"kilometers"}).geometry.coordinates;this.getClampToHeight({lng:n[0],lat:n[1]}).then((function(e){var i=[n[0],n[1],e];t.options.text.position={lng:n[0],lat:n[1],alt:e},t.text&&(t.text.position=i)}))}if(this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t.options.position.lng})),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t.options.position.lat})),this._elms.height){var o=this._elms.height.getElementsByClassName("height")[0];if(o)switch(this._elms.heightMode.value){case"海拔高度":o.value=this.options.position.alt;break;case"相对地表":this.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.position.lng,this.options.position.lat)]).then((function(e){o.value=Number((t.options.position.alt-e[0].height).toFixed(2)),t._elms.alt&&t._elms.alt.forEach((function(e){e.value=t.options.position.alt}))})):(o.value=Number(Number(this.options.position.alt).toFixed(2)),this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t.options.position.alt})));break;case"依附地表":case"依附地表":break;case"依附模型":this.updateHeight()}}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(e){this.options.label.show=e,this.entity&&(1==this.mode?this.entity.label.show=e:this.entity.label.show=!1),this._elms.labelShow&&this._elms.labelShow.forEach((function(t){t.value=e}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(e){this.options.label.fontFamily=e||0,this.renewPoint();var t=Jn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(e){e.value=t}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(e){this.options.label.fontSize=e,this.renewPoint(),this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(e){var t=this;this.options.label.color=e||"#00ffff",this.renewPoint(),this._elms.labelColor&&this._elms.labelColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.options.label.color,disabled:!1,openPickerAni:"opacity",sure:function(e){t.labelColor=e},clear:function(){t.labelColor="rgba(0,255,255,1)"}});t._elms.labelColor[i]=n}))}},{key:"create",value:(l=o()(a.a.mark((function e(){var t,i,n,o,s=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this,n=Yn(this.labelFontFamily)||"Helvetica",e.t0=this.options.heightMode,e.next=2===e.t0||"2"===e.t0?5:7;break;case 5:return i=Cesium.HeightReference.CLAMP_TO_GROUND,e.abrupt("break",7);case 7:return e.next=9,fetch(this.replaceHost(this.options.url,this.options.host),{method:"get",headers:{"Content-Type":"application/json"}});case 9:e.sent.ok&&((o=new Image).crossOrigin="Anonymous",o.src=this.replaceHost(this.options.url,this.options.host),o.onload=function(){var e=document.createElement("canvas"),a=e.getContext("2d"),r=document.createElement("canvas"),l=r.getContext("2d"),c=o.width,u=o.height;r.width=c,r.height=u,l.drawImage(o,0,0,c,u),e.width=2*o.width,e.height=2*o.height,s.flipeX&&(a.scale(1,-1),a.translate(0,-e.height)),s.flipeY&&(a.scale(-1,1),a.translate(-e.width,0)),a.drawImage(o,o.width-o.width*s.options.offset.x,o.height-o.height*s.options.offset.y);var h=u*(128/c);s.entity=s.sdk.viewer.entities.add({id:s.options.id,show:s.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(s.options.position.lng,s.options.position.lat,s.options.position.alt||0)})),billboard:{show:!!s.mode,image:r,scale:s.billboardScale,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ii()?void 0:Number.POSITIVE_INFINITY}),!1),heightReference:i,width:128,height:h,horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.TOP,pixelOffset:{x:-128*s.billboardScale*s.options.offset.x,y:-h*s.billboardScale*s.options.offset.y}},label:{show:!!s.mode&&t.options.label.show,text:t.options.label.text,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ii()?void 0:Number.POSITIVE_INFINITY}),!1),heightReference:i,font:t.options.label.fontSize+"px "+n,fillColor:Cesium.Color.fromCssColorString(t.options.label.color),pixelOffset:new Cesium.CallbackProperty((function(){return t.options.show?new Cesium.Cartesian2(0,-h*t.billboardScale-t.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-t.options.label.fontSize/2-5)}),!1),outlineColor:Cesium.Color.BLACK,outlineWidth:1,style:Cesium.LabelStyle.FILL_AND_OUTLINE},rectangle:{show:!s.mode,coordinates:new Cesium.CallbackProperty((function(){var e,t=Math.abs(Math.cos(Math.PI/180*s.options.position.lat))*(1e-4*s.options.scale),i={x:s.flipeY?Math.abs(s.options.offset.x-1):s.options.offset.x,y:s.flipeX?Math.abs(s.options.offset.y-1):s.options.offset.y};i={lng:i.x*(1e-4*s.options.scale*2),lat:Math.abs(i.y-1)*(2*t)};var n=[s.options.position.lng-1e-4*s.options.scale,s.options.position.lat-t,s.options.position.lng+1e-4*s.options.scale,s.options.position.lat+t];return(e=Cesium.Rectangle).fromDegrees.apply(e,n)}),!1),material:new Cesium.ImageMaterialProperty({image:e,transparent:!0}),rotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(s.options.angle)}),!1),stRotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(s.options.angle)}),!1)}}),s.renewPoint(),"cesium-viewer 2d"===s.sdk.viewer._element.className&&(s.entity.rectangle.height=0),Mt(s.sdk,s.options.id),s.options.show&&Qe(0,s.options.id)});case 11:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"edit",value:(r=o()(a.a.mark((function e(t){var i,n,s,r,l,c,u,h,p,d,m,f,v,g,b,C,w=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=27;break}return n=function(e){!function t(i){if(i)if(i===r._element.body){var n=e.x-i.getBoundingClientRect().left,o=e.y-i.getBoundingClientRect().top,s={x:Number(((n-42)/l.width).toFixed(2)),y:Number(((o-71)/l.height).toFixed(2))};s.x<0&&(s.x=0),s.x>1&&(s.x=1),s.y<0&&(s.y=0),s.y>1&&(s.y=1),u={x:s.x,y:s.y},c.style.top="calc(".concat(100*u.y,"% - 5px)"),c.style.left="calc(".concat(100*u.x,"% - 5px)")}else t(i.offsetParent)}(e.target)},s=function(){r&&r._element.body.removeEventListener("mousemove",n)},e.next=8,new pn(this.sdk,this.originalOptions,{title:"军标属性",left:"180px",top:"100px",confirmCallBack:function(e){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){w.previous=null,w.reset(),r&&r.close&&r.close(),w.Dialog.closeCallBack&&w.Dialog.closeCallBack(),YJ.Measure.SetMeasureStatus(!1),w.positionEditing=!1},showCallBack:function(e){w.show=e,w.Dialog.showCallBack&&w.Dialog.showCallBack()},translationalCallBack:function(){w.positionEditing=!w.positionEditing},addFootElm:[{tagName:"button",className:"flipe-over-y",innerHTML:"Y轴翻转",event:["click",function(){w.flipeY=!w.flipeY}]},{tagName:"button",className:"flipe-over-x",innerHTML:"X轴翻转",event:["click",function(){w.flipeX=!w.flipeX}]}]},!0);case 8:for(this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" ground-image",(h=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col"></div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <button class="anchor btn">调整锚点</button>\n </div>\n <div class="col mode-box">\n <span class="label" style="flex: unset;">军标模式</span>\n <div class="mode"></div>\n </div>\n </div>\n <div class="row" mode="0">\n <div class="col">\n <span class="label">旋转角度</span>\n <input type="range" max="360" min="0" step="0.1" @model="angle">\n <div class="input-number input-number-unit" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="360" step="0.1" @model="angle">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row" mode="0">\n <div class="col">\n <span class="label">调整大小</span>\n <input type="range" max="40000" min="0" step="0.1" @model="scale">\n <div class="input-number input-number-unit-1" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="40000" step="0.1" @model="scale">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row" mode="1">\n <div class="col height-mode-box" style="flex: 0 0 155px;margin-right: 10px;">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col" style="margin: 0 10px;">\n <div class="height-box" style="display: flex; align-items: center;">\n <span class="label" style="flex: 0 0 56px;">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="col" style="margin-left: 10px;">\n <span class="label">图标倍数</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" data-min="0.1" max="99" @model="billboardScale">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row" mode="1">\n <div class="col" style="flex: 0 0 155px;margin-right: 10px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="billboardScaleByDistance">\n </div>\n <div class="col" style="margin: 0 10px;">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="billboardNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="margin-left: 10px;">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="billboardFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <h4 mode="1">文字设置</h4>\n <div class="row" mode="1">\n <div class="col" style="flex: 0 0 80px;margin: 0 10px;">\n <span class="label" style="flex: none;">显隐</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n <div class="col font-select-box" style="margin: 0 0px;flex: 0 0 150px;">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col" style="margin: 0 10px;">\n <span class="label">文字大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize" style="width: 70px;">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="margin-left: 10px;">\n <span class="label">文字颜色</span>\n <div class="labelColor"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(h),p=h.getElementsByTagName("*"),this._EventBinding.on(this,p),this._elms=this._EventBinding.element,h.getElementsByClassName("anchor")[0].addEventListener("click",o()(a.a.mark((function e(){var t,o,h,p;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r&&r.close&&r.close(),document.body.addEventListener("mouseup",s),t=i._DialogObject._element.body.getBoundingClientRect(),e.next=5,new pn(w.sdk,w.originalOptions,{title:"锚点设置",left:t.left+80+"px",top:t.top+200+"px",confirmCallBack:function(e){i.offset={x:u.x,y:u.y},o.close()},closeCallBack:function(){document.body.removeEventListener("mouseup",s)}},!1);case 5:o=e.sent,r=o,o._element.body.className=o._element.body.className+" anchor-point",h=document.createElement("div"),(p=new Image).src=w.replaceHost(w.options.url,w.options.host),p.onload=function(){var e=150/(p.width/p.height),t=(l=document.createElement("canvas")).getContext("2d",{willReadFrequently:!0});l.width=150,l.height=e,l.style.display="block",t.drawImage(p,0,0,150,e),h.appendChild(l),o.contentAppChild(h),(c=document.createElement("span")).className="point",h.appendChild(c),u={x:i.offset.x,y:i.offset.y},c.style.top="calc(".concat(100*Number(u.y),"% - 6px)"),c.style.left="calc(".concat(100*Number(u.x),"% - 6px)"),l.addEventListener("click",(function(e){var t=e.offsetX,i=e.offsetY,n={x:Number((t/l.width).toFixed(2)),y:Number((i/l.height).toFixed(2))};n.x<0&&(n.x=0),n.x>1&&(n.x=1),n.y<0&&(n.y=0),n.y>1&&(n.y=1),u={x:n.x,y:n.y},c.style.top="calc(".concat(100*u.y,"% - 5px)"),c.style.left="calc(".concat(100*u.x,"% - 5px)")})),c.addEventListener("mousedown",(function(e){o._element.body.addEventListener("mousemove",n)}))};case 12:case"end":return e.stop()}}),e)})))),d=h.getElementsByClassName("row"),m=h.getElementsByTagName("h4"),f=0;f<d.length;f++)null!==(v=d[f].getAttribute("mode"))&&(v==this.options.mode?d[f].style.display="flex":d[f].style.display="none");for(g=0;g<m.length;g++)null!==(b=m[g].getAttribute("mode"))&&(b==this.options.mode?m[g].style.display="block":m[g].style.display="none");C=new YJColorPicker({el:h.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(e){w.labelColor=e},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),this._elms.labelColor=[C],setTimeout(o()(a.a.mark((function e(){var t,i,n,s,r,l,c,u,h,p,d,m,f,v,g,b,C,k,_,x,E,S;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=w._DialogObject._element.foot.getElementsByClassName("flipe-over-x")[0],i=w._DialogObject._element.foot.getElementsByClassName("flipe-over-y")[0],t.setAttribute("mode",0),i.setAttribute("mode",0),w.options.mode?(t.style.display="none",i.style.display="none"):(t.style.display="block",i.style.display="block"),n=[{name:"贴地",value:"贴地",key:0},{name:"立体",value:"立体",key:1}],!(s=q(w._DialogObject._element.content.getElementsByClassName("mode-box")[0],".mode"))){e.next=22;break}s.legp_search(n),(r=w._DialogObject._element.content.getElementsByClassName("mode")[0].getElementsByTagName("input")[0]).value=w.mode,l=0;case 12:if(!(l<n.length)){e.next=20;break}if(n[l].key!==w.mode){e.next=17;break}return r.value=n[l].value,s.legp_searchActive(n[l].value),e.abrupt("break",20);case 17:l++,e.next=12;break;case 20:r.addEventListener("input",(function(){for(var e=0;e<n.length;e++)if(n[e].value===r.value){w.mode=n[e].key;break}})),w._elms.mode=[r];case 22:c=w._DialogObject._element.content.getElementsByClassName("height-box")[0],u=c.getElementsByClassName("height")[0],h=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附地表",value:"依附地表",key:"2"},{name:"依附模型",value:"依附模型",key:"3"}],p=w.heightMode,e.t0=p,e.next=0===e.t0||"0"===e.t0?29:1===e.t0||"1"===e.t0?31:2===e.t0||"2"===e.t0||3===e.t0||"3"===e.t0?33:38;break;case 29:return u.value=w.options.position.alt,e.abrupt("break",38);case 31:return w.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(w.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(w.options.position.lng,w.options.position.lat)]).then((function(e){u.value=Number((w.options.position.alt-Number(e[0].height.toFixed(2))).toFixed(2))})):u.value=Number(w.options.position.alt.toFixed(2)),e.abrupt("break",38);case 33:d=[],m=Bp(w.sdk.entityMap);try{for(m.s();!(f=m.n()).done;)(v=y()(f.value,2))[0],"RadarScanStereoscopic"===(g=v[1]).type&&g.entity&&d.push(g.entity)}catch(e){m.e(e)}finally{m.f()}return w.getClampToHeight(w.options.position,d).then((function(e){w.options.position.alt=Number(e.toFixed(2)),w.coordinate=w.options.coordinate,w._elms.alt&&w._elms.alt.forEach((function(e){e.value=w.options.position.alt})),u.value=w.options.position.alt})),e.abrupt("break",38);case 38:if(!(b=q(w._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){e.next=56;break}b.legp_search(h),(C=w._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0]).value=h[w.heightMode].value,k=0;case 44:if(!(k<h.length)){e.next=51;break}if(h[k].value!=C.value){e.next=48;break}return b.legp_searchActive(h[k].value),e.abrupt("break",51);case 48:k++,e.next=44;break;case 51:C.addEventListener("input",(function(){for(var e=0;e<h.length;e++)if(h[e].value===C.value){switch(p=h[e].key){case 0:case"0":w.options.position.alt=Number(u.value),w.heightMode=0;break;case 1:case"1":w.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(w.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(w.options.position.lng,w.options.position.lat)]).then((function(e){w.options.position.alt=Number(u.value)+Number(e[0].height.toFixed(2))})):w.options.position.alt=Number(u.value),w.heightMode=1;break;case 2:case"2":w.heightMode=2;break;case 3:case"3":var t,i=[],n=Bp(w.sdk.entityMap);try{for(n.s();!(t=n.n()).done;){var o=y()(t.value,2),s=(o[0],o[1]);"RadarScanStereoscopic"===s.type&&s.entity&&i.push(s.entity)}}catch(e){n.e(e)}finally{n.f()}w.getClampToHeight(w.options.position,i).then((function(e){w.options.position.alt=Number(e.toFixed(2))})),w.heightMode=3}w.position=w.options.position;break}})),u.addEventListener("blur",o()(a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=p,e.next=0===e.t0||"0"===e.t0?3:1===e.t0||"1"===e.t0?5:2===e.t0||"2"===e.t0?14:15;break;case 3:return w.options.position.alt=Number(Number(u.value).toFixed(2)),e.abrupt("break",15);case 5:if(!w.sdk.viewer.scene.terrainProvider.availability){e.next=12;break}return e.next=8,Cesium.sampleTerrainMostDetailed(w.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(w.options.position.lng,w.options.position.lat)]);case 8:t=e.sent,w.options.position.alt=Number(u.value)+Number(t[0].height.toFixed(2)),e.next=13;break;case 12:w.options.position.alt=Number(u.value);case 13:case 14:return e.abrupt("break",15);case 15:w.position=w.options.position;case 16:case"end":return e.stop()}}),e)})))),w._elms.height=c,w._elms.heightMode=C,w.heightMode=w.heightMode;case 56:if(_=Un(),!(x=q(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select"))){e.next=72;break}x.legp_search(_),(E=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0]).value=_[w.labelFontFamily].value,S=0;case 63:if(!(S<_.length)){e.next=70;break}if(_[S].value!=E.value){e.next=67;break}return x.legp_searchActive(_[S].value),e.abrupt("break",70);case 67:S++,e.next=63;break;case 70:E.addEventListener("input",(function(){for(var e=0;e<_.length;e++)if(_[e].value===E.value){w.labelFontFamily=_[e].key;break}})),w._elms.labelFontFamily=[E];case 72:case"end":return e.stop()}}),e)}))),0),e.next=28;break;case 27:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 28:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"positionEditing",get:function(){return this._positionEditing},set:function(e){var t=this;this.sdk&&this.sdk.viewer&&this.entity&&(this._positionEditing=e,!0===e?(this.previous={position:Ip({},this.options.position)},this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.event.mouse_move((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.options.position.lng=n.lng,t.options.position.lat=n.lat,t.options.position.alt=n.alt,t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.options.position.lng=n.lng,t.options.position.lat=n.lat,t.options.position.alt=n.alt,t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.previous=null,t.positionEditing=!1})),this.event.mouse_right((function(e,i){t.options.position.lng=t.previous.position.lng,t.options.position.lat=t.previous.position.lat,t.options.position.alt=t.previous.position.alt,t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.options.position.lng=t.previous.position.lng,t.options.position.lat=t.previous.position.lat,t.options.position.alt=t.previous.position.alt,t.positionEditing=!1;else{var e=t.cartesian3Towgs84(i,t.sdk.viewer);t.options.position.lng=e.lng,t.options.position.lat=e.lat,t.options.position.alt=e.alt,t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.positionEditing=!1}}))}))):(this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),this.previous||(this.previous={position:Ip({},this.options.position)}),this.position=Ip({},this.previous.position)))}},{key:"flyTo",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w,k,_,x,E,S,P=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=P.length>0&&void 0!==P[0]?P[0]:{},pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Ip({},this.options.position):this.options.position?l=Ip({},this.options.position[0]):this.options.center?l=Ip({},this.options.center):this.options.start?l=Ip({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=16;break}return e.next=15,this.getClampToHeight(l);case 15:l.alt=e.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=59;break;case 23:c=Math.abs(Math.cos(Math.PI/180*this.options.position.lat))*(1e-4*this.options.scale),u=[[this.options.position.lng-1e-4*this.options.scale,this.options.position.lat-c],[this.options.position.lng+1e-4*this.options.scale,this.options.position.lat+c]],h=[],p=0,d=this.options.position,m=Cesium.Cartesian3.fromDegrees(d.lng,d.lat,0),f=Cesium.Cartesian3.fromDegrees(d.lng,d.lat,1e7),v=Cesium.Cartesian3.subtract(f,m,new Cesium.Cartesian3),g=Cesium.Cartesian3.normalize(v,v),y=new Cesium.Ray(m,g),b={},C=this.sdk.viewer.scene.drillPickFromRay(y),w=0;case 36:if(!(w<C.length)){e.next=43;break}if(!C[w].position){e.next=40;break}return b=C[w],e.abrupt("break",43);case 40:w++,e.next=36;break;case 43:if(!b||!b.position){e.next=47;break}p=this.cartesian3Towgs84(b.position,this.sdk.viewer).alt,e.next=56;break;case 47:return e.prev=47,e.next=50,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(d.lng,d.lat)]);case 50:k=e.sent,p=k[0].height,e.next=56;break;case 54:e.prev=54,e.t0=e.catch(47);case 56:for(_=0;_<u.length;_++)E=(x=Cesium.Cartesian3).fromDegrees.apply(x,A()(u[_]).concat([p])),h.push(E.x,E.y,E.z);S=Cesium.BoundingSphere.fromVertices(h),this.sdk.viewer.camera.flyToBoundingSphere(S,{offset:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 59:case"end":return e.stop()}}),e,this,[[47,54]])}))),function(){return s.apply(this,arguments)})},{key:"updateHeight",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,b,C,w=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,0),o=new Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,1e13),s=[],r=Bp(this.sdk.entityMap);try{for(r.s();!(l=r.n()).done;)(c=y()(l.value,2))[0],"RadarScanStereoscopic"===(u=c[1]).type&&u.entity&&s.push(u.entity)}catch(e){r.e(e)}finally{r.f()}return e.next=7,this.sdk.viewer.scene.clampToHeightMostDetailed([n],s);case 7:(h=e.sent)&&h[0]&&(t=this.cartesian3Towgs84(h[0],this.sdk.viewer).alt),p=Cesium.Cartesian3.subtract(n,o,new Cesium.Cartesian3),d=Cesium.Cartesian3.normalize(p,new Cesium.Cartesian3),m=new Cesium.Ray(o,d),f={},v=this.sdk.viewer.scene.drillPickFromRay(m),g=v.length-1;case 15:if(!(g>=0)){e.next=22;break}if(!v[g].position){e.next=19;break}return f=v[g],e.abrupt("break",22);case 19:g--,e.next=15;break;case 22:return f&&f.position&&(i=this.cartesian3Towgs84(f.position,this.sdk.viewer).alt),e.prev=23,e.next=26,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.position.lng,this.options.position.lat)]);case 26:b=e.sent,e.next=31;break;case 29:e.prev=29,e.t0=e.catch(23);case 31:if((void 0===i||i<b[0].height)&&b&&(i=b[0].height),(void 0===t||t<i)&&(t=i),void 0===t){e.next=50;break}if(this.options.position.alt=Number(Number(t).toFixed(2)),this._elms.alt&&this._elms.alt.forEach((function(e){e.value=w.options.position.alt})),this.coordinate=this.options.coordinate,!this._elms.height){e.next=50;break}if(!(C=this._elms.height.getElementsByClassName("height")[0])){e.next=50;break}e.t1=this._elms.heightMode.value,e.next="海拔高度"===e.t1?43:"相对地表"===e.t1?45:"依附地表"===e.t1?47:"依附模型"===e.t1?48:50;break;case 43:return C.value=this.options.position.alt,e.abrupt("break",50);case 45:return this.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.position.lng,this.options.position.lat)]).then((function(e){C.value=Number((w.options.position.alt-e[0].height).toFixed(2))})):C.value=this.options.position.alt,e.abrupt("break",50);case 47:return e.abrupt("break",50);case 48:return C.value=this.options.position.alt,e.abrupt("break",50);case 50:case"end":return e.stop()}}),e,this,[[23,29]])}))),function(){return n.apply(this,arguments)})},{key:"renewPoint",value:function(){if(!this.entity.values&&this.entity.billboard){var e=Yn(this.labelFontFamily)||"Helvetica";this.entity.billboard.scale=this.billboardScale,this.billboardScaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.billboardNear,1,this.billboardFar,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.billboardNear,1,this.billboardFar,0),this.entity.label.scaleByDistance=new Cesium.NearFarScalar(this.billboardNear,1,this.billboardFar,0),this.entity.label.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.billboardNear,1,this.billboardFar,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0,this.entity.label.scaleByDistance=void 0,this.entity.label.pixelOffsetScaleByDistance=void 0),this.entity.label.font=this.options.label.fontSize+"px "+e,this.entity.label.fillColor=Cesium.Color.fromCssColorString(this.options.label.color);var t=this.entity.billboard.image.getValue(),i=t.height*(128/t.width);this.entity.billboard.pixelOffset={x:-128*this.billboardScale*this.options.offset.x,y:-i*this.billboardScale*this.options.offset.y}}}},{key:"reset",value:function(){this.entity&&(this.options=this.deepCopyObj(this.originalOptions),this.name=this.options.name,this.angle=this.options.angle,this.scale=this.options.scale,this.offset=this.options.offset,this.flipeX=this.options.flipe.x,this.flipeY=this.options.flipe.y,this.show=this.options.show,this.mode=this.options.mode,this.heightMode=this.options.heightMode,this.billboardScale=this.options.billboard.scale,this.labelShow=this.options.label.show)}},{key:"remove",value:(i=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=7,this.sdk.removeIncetance(this.options.id);case 7:return e.next=9,Mt(this.sdk,this.options.id);case 9:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"setPosition",value:function(e){this.options.position.lng=e.position.lng,this.options.position.lat=e.position.lat,this.options.position.alt=e.position.alt}}]);var i,n,s,r,l}(Vn);function Fp(e){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">旋转角度</span>\n <input type="range" max="360" min="0" step="0.1" @model="angle">\n <div class="input-number input-number-unit" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="360" step="0.1" @model="angle">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col x-scale">\n <span class="label">X 轴大小</span>\n <input type="range" max="200" min="0.001" step="0.001">\n <div class="input-number" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0.001" max="200" step="0.001">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col y-scale">\n <span class="label">Y 轴大小</span>\n <input type="range" max="200" min="0.001" step="0.001">\n <div class="input-number" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0.001" max="200" step="0.001">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col" style="flex: 5;">\n <span class="label">文字内容</span>\n <input class="input" type="text" @model="textValue" maxlength="30">\n </div>\n <div class="col">\n <button class="btn" @click="textPosPick">设置位置</span>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">文字开关</span>\n <input class="btn-switch" type="checkbox" @model="textShow">\n </div>\n <div class="col">\n <span class="label">字体颜色</span>\n <div class="textColor"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="textFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="textScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="textNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="textFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item attribute-info">\n <div class="row">\n '.concat(jn(e),"\n </div>\n </div>\n ")}var zp=i(21),Hp=i.n(zp),Vp=i(12),Gp=i.n(Vp);function Wp(e,t,i,n){var o=aa()(ln()(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof o?function(e){return o.apply(i,e)}:o}function Up(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}
|
||
/**
|
||
* @license
|
||
* Copyright 2010-2024 Three.js Authors
|
||
* SPDX-License-Identifier: MIT
|
||
*/()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Yp=1014,Jp=1020,qp=2400,Xp=2401,Zp="srgb",Kp="srgb-linear",Qp="display-p3",$p="display-p3-linear",ed="linear",td="srgb",id="rec709",nd=7680,od=35044,sd=2e3,ad=2001,rd=function(){return x()((function e(){k()(this,e)}),[{key:"addEventListener",value:function(e,t){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}},{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){var i=this._listeners[e];if(void 0!==i){var n=i.indexOf(t);-1!==n&&i.splice(n,1)}}}},{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,o=i.length;n<o;n++)i[n].call(this,e);e.target=null}}}}])}(),ld=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],cd=Math.PI/180;Math.PI;function ud(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(ld[255&e]+ld[e>>8&255]+ld[e>>16&255]+ld[e>>24&255]+"-"+ld[255&t]+ld[t>>8&255]+"-"+ld[t>>16&15|64]+ld[t>>24&255]+"-"+ld[63&i|128]+ld[i>>8&255]+"-"+ld[i>>16&255]+ld[i>>24&255]+ld[255&n]+ld[n>>8&255]+ld[n>>16&255]+ld[n>>24&255]).toLowerCase()}function hd(e,t,i){return Math.max(t,Math.min(i,e))}function pd(e,t){return(e%t+t)%t}function dd(e,t,i){return(1-i)*e+i*t}function md(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function fd(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}var vd=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,e),e.prototype.isVector2=!0,this.x=t,this.y=i}),[{key:"width",get:function(){return this.x},set:function(e){this.x=e}},{key:"height",get:function(){return this.y},set:function(e){this.y=e}},{key:"set",value:function(e,t){return this.x=e,this.y=t,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"applyMatrix3",value:function(e){var t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}},{key:"clampLength",value:function(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y}},{key:"cross",value:function(e){return this.x*e.y-this.y*e.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){return Math.atan2(-this.y,-this.x)+Math.PI}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var i=this.dot(e)/t;return Math.acos(hd(i,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,i=this.y-e.y;return t*t+i*i}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}},{key:"lerpVectors",value:function(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e}},{key:"fromBufferAttribute",value:function(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}},{key:"rotateAround",value:function(e,t){var i=Math.cos(t),n=Math.sin(t),o=this.x-e.x,s=this.y-e.y;return this.x=o*i-s*n+e.x,this.y=o*n+s*i+e.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.x;case 2:return e.next=4,this.y;case 4:case"end":return e.stop()}}),e,this)}))}])}(),gd=function(){return x()((function e(t,i,n,o,s,a,r,l,c){k()(this,e),e.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,i,n,o,s,a,r,l,c)}),[{key:"set",value:function(e,t,i,n,o,s,a,r,l){var c=this.elements;return c[0]=e,c[1]=n,c[2]=a,c[3]=t,c[4]=o,c[5]=r,c[6]=i,c[7]=s,c[8]=l,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"copy",value:function(e){var t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}},{key:"extractBasis",value:function(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var i=e.elements,n=t.elements,o=this.elements,s=i[0],a=i[3],r=i[6],l=i[1],c=i[4],u=i[7],h=i[2],p=i[5],d=i[8],m=n[0],f=n[3],v=n[6],g=n[1],y=n[4],b=n[7],C=n[2],w=n[5],k=n[8];return o[0]=s*m+a*g+r*C,o[3]=s*f+a*y+r*w,o[6]=s*v+a*b+r*k,o[1]=l*m+c*g+u*C,o[4]=l*f+c*y+u*w,o[7]=l*v+c*b+u*k,o[2]=h*m+p*g+d*C,o[5]=h*f+p*y+d*w,o[8]=h*v+p*b+d*k,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],r=e[6],l=e[7],c=e[8];return t*s*c-t*a*l-i*o*c+i*a*r+n*o*l-n*s*r}},{key:"invert",value:function(){var e=this.elements,t=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],r=e[6],l=e[7],c=e[8],u=c*s-a*l,h=a*r-c*o,p=l*o-s*r,d=t*u+i*h+n*p;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);var m=1/d;return e[0]=u*m,e[1]=(n*l-c*i)*m,e[2]=(a*i-n*s)*m,e[3]=h*m,e[4]=(c*t-n*r)*m,e[5]=(n*o-a*t)*m,e[6]=p*m,e[7]=(i*r-l*t)*m,e[8]=(s*t-i*o)*m,this}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}},{key:"getNormalMatrix",value:function(e){return this.setFromMatrix4(e).invert().transpose()}},{key:"transposeIntoArray",value:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}},{key:"setUvTransform",value:function(e,t,i,n,o,s,a){var r=Math.cos(o),l=Math.sin(o);return this.set(i*r,i*l,-i*(r*s+l*a)+s+e,-n*l,n*r,-n*(-l*s+r*a)+a+t,0,0,1),this}},{key:"scale",value:function(e,t){return this.premultiply(yd.makeScale(e,t)),this}},{key:"rotate",value:function(e){return this.premultiply(yd.makeRotation(-e)),this}},{key:"translate",value:function(e,t){return this.premultiply(yd.makeTranslation(e,t)),this}},{key:"makeTranslation",value:function(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}},{key:"makeRotation",value:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}},{key:"makeScale",value:function(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}},{key:"equals",value:function(e){for(var t=this.elements,i=e.elements,n=0;n<9;n++)if(t[n]!==i[n])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0;i<9;i++)this.elements[i]=e[i+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}},{key:"clone",value:function(){return(new this.constructor).fromArray(this.elements)}}])}(),yd=new gd;function bd(e){for(var t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function Cd(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}var wd={};function kd(e){e in wd||(wd[e]=!0,console.warn(e))}var _d,xd=(new gd).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Ed=(new gd).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Sd=C()(C()(C()(C()({},Kp,{transfer:ed,primaries:id,toReference:function(e){return e},fromReference:function(e){return e}}),Zp,{transfer:td,primaries:id,toReference:function(e){return e.convertSRGBToLinear()},fromReference:function(e){return e.convertLinearToSRGB()}}),$p,{transfer:ed,primaries:"p3",toReference:function(e){return e.applyMatrix3(Ed)},fromReference:function(e){return e.applyMatrix3(xd)}}),Qp,{transfer:td,primaries:"p3",toReference:function(e){return e.convertSRGBToLinear().applyMatrix3(Ed)},fromReference:function(e){return e.applyMatrix3(xd).convertLinearToSRGB()}}),Pd=new Set([Kp,$p]),Dd={enabled:!0,_workingColorSpace:Kp,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!Pd.has(e))throw new Error('Unsupported working color space, "'.concat(e,'".'));this._workingColorSpace=e},convert:function(e,t,i){if(!1===this.enabled||t===i||!t||!i)return e;var n=Sd[t].toReference;return(0,Sd[i].fromReference)(n(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return Sd[e].primaries},getTransfer:function(e){return""===e?ed:Sd[e].transfer}};function Md(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Td(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var Od=function(){return x()((function e(){k()(this,e)}),null,[{key:"getDataURL",value:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;var t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===_d&&(_d=Cd("canvas")),_d.width=e.width,_d.height=e.height;var i=_d.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=_d}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}},{key:"sRGBToLinear",value:function(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var t=Cd("canvas");t.width=e.width,t.height=e.height;var i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);for(var n=i.getImageData(0,0,e.width,e.height),o=n.data,s=0;s<o.length;s++)o[s]=255*Md(o[s]/255);return i.putImageData(n,0,0),t}if(e.data){for(var a=e.data.slice(0),r=0;r<a.length;r++)a instanceof Uint8Array||a instanceof Uint8ClampedArray?a[r]=Math.floor(255*Md(a[r]/255)):a[r]=Md(a[r]);return{data:a,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}])}(),Nd=0,Bd=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;k()(this,e),this.isSource=!0,Object.defineProperty(this,"id",{value:Nd++}),this.uuid=ud(),this.data=t,this.dataReady=!0,this.version=0}),[{key:"needsUpdate",set:function(e){!0===e&&this.version++}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];var i={uuid:this.uuid,url:""},n=this.data;if(null!==n){var o;if(Array.isArray(n)){o=[];for(var s=0,a=n.length;s<a;s++)n[s].isDataTexture?o.push(Ad(n[s].image)):o.push(Ad(n[s]))}else o=Ad(n);i.url=o}return t||(e.images[this.uuid]=i),i}}])}();function Ad(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Od.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Ld=0,Id=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.DEFAULT_IMAGE,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.DEFAULT_MAPPING,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1001,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1001,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1006,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1008,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1023,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1009,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:t.DEFAULT_ANISOTROPY,h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:"";return k()(this,t),(e=Up(this,t)).isTexture=!0,Object.defineProperty(Gp()(e),"id",{value:Ld++}),e.uuid=ud(),e.name="",e.source=new Bd(i),e.mipmaps=[],e.mapping=n,e.channel=0,e.wrapS=o,e.wrapT=s,e.magFilter=a,e.minFilter=r,e.anisotropy=u,e.format=l,e.internalFormat=null,e.type=c,e.offset=new vd(0,0),e.repeat=new vd(1,1),e.center=new vd(0,0),e.rotation=0,e.matrixAutoUpdate=!0,e.matrix=new gd,e.generateMipmaps=!0,e.premultiplyAlpha=!1,e.flipY=!0,e.unpackAlignment=4,e.colorSpace=h,e.userData={},e.version=0,e.onUpdate=null,e.isRenderTargetTexture=!1,e.pmremVersion=0,e}return un()(t,e),x()(t,[{key:"image",get:function(){return this.source.data},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.source.data=e}},{key:"updateMatrix",value:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var i={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"transformUv",value:function(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}},{key:"needsUpdate",set:function(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}},{key:"needsPMREMUpdate",set:function(e){!0===e&&this.pmremVersion++}}])}(rd);Id.DEFAULT_IMAGE=null,Id.DEFAULT_MAPPING=300,Id.DEFAULT_ANISOTROPY=1;var jd=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;k()(this,e),e.prototype.isVector4=!0,this.x=t,this.y=i,this.z=n,this.w=o}),[{key:"width",get:function(){return this.z},set:function(e){this.z=e}},{key:"height",get:function(){return this.w},set:function(e){this.w=e}},{key:"set",value:function(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setW",value:function(e){return this.w=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}},{key:"applyMatrix4",value:function(e){var t=this.x,i=this.y,n=this.z,o=this.w,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*n+s[12]*o,this.y=s[1]*t+s[5]*i+s[9]*n+s[13]*o,this.z=s[2]*t+s[6]*i+s[10]*n+s[14]*o,this.w=s[3]*t+s[7]*i+s[11]*n+s[15]*o,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"setAxisAngleFromQuaternion",value:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}},{key:"setAxisAngleFromRotationMatrix",value:function(e){var t,i,n,o,s=.01,a=.1,r=e.elements,l=r[0],c=r[4],u=r[8],h=r[1],p=r[5],d=r[9],m=r[2],f=r[6],v=r[10];if(Math.abs(c-h)<s&&Math.abs(u-m)<s&&Math.abs(d-f)<s){if(Math.abs(c+h)<a&&Math.abs(u+m)<a&&Math.abs(d+f)<a&&Math.abs(l+p+v-3)<a)return this.set(1,0,0,0),this;t=Math.PI;var g=(l+1)/2,y=(p+1)/2,b=(v+1)/2,C=(c+h)/4,w=(u+m)/4,k=(d+f)/4;return g>y&&g>b?g<s?(i=0,n=.707106781,o=.707106781):(n=C/(i=Math.sqrt(g)),o=w/i):y>b?y<s?(i=.707106781,n=0,o=.707106781):(i=C/(n=Math.sqrt(y)),o=k/n):b<s?(i=.707106781,n=.707106781,o=0):(i=w/(o=Math.sqrt(b)),n=k/o),this.set(i,n,o,t),this}var _=Math.sqrt((f-d)*(f-d)+(u-m)*(u-m)+(h-c)*(h-c));return Math.abs(_)<.001&&(_=1),this.x=(f-d)/_,this.y=(u-m)/_,this.z=(h-c)/_,this.w=Math.acos((l+p+v-1)/2),this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}},{key:"clampLength",value:function(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}},{key:"lerpVectors",value:function(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}},{key:"fromBufferAttribute",value:function(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.x;case 2:return e.next=4,this.y;case 4:return e.next=6,this.z;case 6:return e.next=8,this.w;case 8:case"end":return e.stop()}}),e,this)}))}])}(),Rd=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return k()(this,t),(e=Up(this,t,[null])).isDataArrayTexture=!0,e.image={data:i,width:n,height:o,depth:s},e.magFilter=1003,e.minFilter=1003,e.wrapR=1001,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e}return un()(t,e),x()(t)}(Id),Fd=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return k()(this,t),(e=Up(this,t,[null])).isData3DTexture=!0,e.image={data:i,width:n,height:o,depth:s},e.magFilter=1003,e.minFilter=1003,e.wrapR=1001,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e}return un()(t,e),x()(t)}(Id),zd=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;k()(this,e),this.isQuaternion=!0,this._x=t,this._y=i,this._z=n,this._w=o}),[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}},{key:"set",value:function(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}},{key:"setFromEuler",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=e._x,n=e._y,o=e._z,s=e._order,a=Math.cos,r=Math.sin,l=a(i/2),c=a(n/2),u=a(o/2),h=r(i/2),p=r(n/2),d=r(o/2);switch(s){case"XYZ":this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d;break;case"YXZ":this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d;break;case"ZXY":this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d;break;case"ZYX":this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d;break;case"YZX":this._x=h*c*u+l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u-h*p*d;break;case"XZY":this._x=h*c*u-l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u+h*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===t&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(e,t){var i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=e.elements,i=t[0],n=t[4],o=t[8],s=t[1],a=t[5],r=t[9],l=t[2],c=t[6],u=t[10],h=i+a+u;if(h>0){var p=.5/Math.sqrt(h+1);this._w=.25/p,this._x=(c-r)*p,this._y=(o-l)*p,this._z=(s-n)*p}else if(i>a&&i>u){var d=2*Math.sqrt(1+i-a-u);this._w=(c-r)/d,this._x=.25*d,this._y=(n+s)/d,this._z=(o+l)/d}else if(a>u){var m=2*Math.sqrt(1+a-i-u);this._w=(o-l)/m,this._x=(n+s)/m,this._y=.25*m,this._z=(r+c)/m}else{var f=2*Math.sqrt(1+u-i-a);this._w=(s-n)/f,this._x=(o+l)/f,this._y=(r+c)/f,this._z=.25*f}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(e,t){var i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}},{key:"angleTo",value:function(e){return 2*Math.acos(Math.abs(hd(this.dot(e),-1,1)))}},{key:"rotateTowards",value:function(e,t){var i=this.angleTo(e);if(0===i)return this;var n=Math.min(1,t/i);return this.slerp(e,n),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}},{key:"multiply",value:function(e){return this.multiplyQuaternions(this,e)}},{key:"premultiply",value:function(e){return this.multiplyQuaternions(e,this)}},{key:"multiplyQuaternions",value:function(e,t){var i=e._x,n=e._y,o=e._z,s=e._w,a=t._x,r=t._y,l=t._z,c=t._w;return this._x=i*c+s*a+n*l-o*r,this._y=n*c+s*r+o*a-i*l,this._z=o*c+s*l+i*r-n*a,this._w=s*c-i*a-n*r-o*l,this._onChangeCallback(),this}},{key:"slerp",value:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this._x,n=this._y,o=this._z,s=this._w,a=s*e._w+i*e._x+n*e._y+o*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=s,this._x=i,this._y=n,this._z=o,this;var r=1-a*a;if(r<=Number.EPSILON){var l=1-t;return this._w=l*s+t*this._w,this._x=l*i+t*this._x,this._y=l*n+t*this._y,this._z=l*o+t*this._z,this.normalize(),this}var c=Math.sqrt(r),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,p=Math.sin(t*u)/c;return this._w=s*h+this._w*p,this._x=i*h+this._x*p,this._y=n*h+this._y*p,this._z=o*h+this._z*p,this._onChangeCallback(),this}},{key:"slerpQuaternions",value:function(e,t,i){return this.copy(e).slerp(t,i)}},{key:"random",value:function(){var e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),o=Math.sqrt(i);return this.set(n*Math.sin(e),n*Math.cos(e),o*Math.sin(t),o*Math.cos(t))}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}},{key:"fromBufferAttribute",value:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}},{key:"toJSON",value:function(){return this.toArray()}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._x;case 2:return e.next=4,this._y;case 4:return e.next=6,this._z;case 6:return e.next=8,this._w;case 8:case"end":return e.stop()}}),e,this)}))}],[{key:"slerpFlat",value:function(e,t,i,n,o,s,a){var r=i[n+0],l=i[n+1],c=i[n+2],u=i[n+3],h=o[s+0],p=o[s+1],d=o[s+2],m=o[s+3];if(0===a)return e[t+0]=r,e[t+1]=l,e[t+2]=c,void(e[t+3]=u);if(1===a)return e[t+0]=h,e[t+1]=p,e[t+2]=d,void(e[t+3]=m);if(u!==m||r!==h||l!==p||c!==d){var f=1-a,v=r*h+l*p+c*d+u*m,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var b=Math.sqrt(y),C=Math.atan2(b,v*g);f=Math.sin(f*C)/b,a=Math.sin(a*C)/b}var w=a*g;if(r=r*f+h*w,l=l*f+p*w,c=c*f+d*w,u=u*f+m*w,f===1-a){var k=1/Math.sqrt(r*r+l*l+c*c+u*u);r*=k,l*=k,c*=k,u*=k}}e[t]=r,e[t+1]=l,e[t+2]=c,e[t+3]=u}},{key:"multiplyQuaternionsFlat",value:function(e,t,i,n,o,s){var a=i[n],r=i[n+1],l=i[n+2],c=i[n+3],u=o[s],h=o[s+1],p=o[s+2],d=o[s+3];return e[t]=a*d+c*u+r*p-l*h,e[t+1]=r*d+c*h+l*u-a*p,e[t+2]=l*d+c*p+a*h-r*u,e[t+3]=c*d-a*u-r*h-l*p,e}}])}(),Hd=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;k()(this,e),e.prototype.isVector3=!0,this.x=t,this.y=i,this.z=n}),[{key:"set",value:function(e,t,i){return void 0===i&&(i=this.z),this.x=e,this.y=t,this.z=i,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this}},{key:"multiplyVectors",value:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}},{key:"applyEuler",value:function(e){return this.applyQuaternion(Gd.setFromEuler(e))}},{key:"applyAxisAngle",value:function(e,t){return this.applyQuaternion(Gd.setFromAxisAngle(e,t))}},{key:"applyMatrix3",value:function(e){var t=this.x,i=this.y,n=this.z,o=e.elements;return this.x=o[0]*t+o[3]*i+o[6]*n,this.y=o[1]*t+o[4]*i+o[7]*n,this.z=o[2]*t+o[5]*i+o[8]*n,this}},{key:"applyNormalMatrix",value:function(e){return this.applyMatrix3(e).normalize()}},{key:"applyMatrix4",value:function(e){var t=this.x,i=this.y,n=this.z,o=e.elements,s=1/(o[3]*t+o[7]*i+o[11]*n+o[15]);return this.x=(o[0]*t+o[4]*i+o[8]*n+o[12])*s,this.y=(o[1]*t+o[5]*i+o[9]*n+o[13])*s,this.z=(o[2]*t+o[6]*i+o[10]*n+o[14])*s,this}},{key:"applyQuaternion",value:function(e){var t=this.x,i=this.y,n=this.z,o=e.x,s=e.y,a=e.z,r=e.w,l=2*(s*n-a*i),c=2*(a*t-o*n),u=2*(o*i-s*t);return this.x=t+r*l+s*u-a*c,this.y=i+r*c+a*l-o*u,this.z=n+r*u+o*c-s*l,this}},{key:"project",value:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}},{key:"unproject",value:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}},{key:"transformDirection",value:function(e){var t=this.x,i=this.y,n=this.z,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*n,this.y=o[1]*t+o[5]*i+o[9]*n,this.z=o[2]*t+o[6]*i+o[10]*n,this.normalize()}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}},{key:"clampLength",value:function(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}},{key:"lerpVectors",value:function(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}},{key:"cross",value:function(e){return this.crossVectors(this,e)}},{key:"crossVectors",value:function(e,t){var i=e.x,n=e.y,o=e.z,s=t.x,a=t.y,r=t.z;return this.x=n*r-o*a,this.y=o*s-i*r,this.z=i*a-n*s,this}},{key:"projectOnVector",value:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}},{key:"projectOnPlane",value:function(e){return Vd.copy(this).projectOnVector(e),this.sub(Vd)}},{key:"reflect",value:function(e){return this.sub(Vd.copy(e).multiplyScalar(2*this.dot(e)))}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var i=this.dot(e)/t;return Math.acos(hd(i,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}},{key:"setFromSpherical",value:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}},{key:"setFromSphericalCoords",value:function(e,t,i){var n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}},{key:"setFromCylindrical",value:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}},{key:"setFromCylindricalCoords",value:function(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}},{key:"setFromMatrixPosition",value:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}},{key:"setFromMatrixScale",value:function(e){var t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}},{key:"setFromMatrixColumn",value:function(e,t){return this.fromArray(e.elements,4*t)}},{key:"setFromMatrix3Column",value:function(e,t){return this.fromArray(e.elements,3*t)}},{key:"setFromEuler",value:function(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}},{key:"setFromColor",value:function(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}},{key:"fromBufferAttribute",value:function(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}},{key:"randomDirection",value:function(){var e=Math.random()*Math.PI*2,t=2*Math.random()-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.x;case 2:return e.next=4,this.y;case 4:return e.next=6,this.z;case 6:case"end":return e.stop()}}),e,this)}))}])}(),Vd=new Hd,Gd=new zd,Wd=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Hd(1/0,1/0,1/0),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Hd(-1/0,-1/0,-1/0);k()(this,e),this.isBox3=!0,this.min=t,this.max=i}),[{key:"set",value:function(e,t){return this.min.copy(e),this.max.copy(t),this}},{key:"setFromArray",value:function(e){this.makeEmpty();for(var t=0,i=e.length;t<i;t+=3)this.expandByPoint(Yd.fromArray(e,t));return this}},{key:"setFromBufferAttribute",value:function(e){this.makeEmpty();for(var t=0,i=e.count;t<i;t++)this.expandByPoint(Yd.fromBufferAttribute(e,t));return this}},{key:"setFromPoints",value:function(e){this.makeEmpty();for(var t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}},{key:"setFromCenterAndSize",value:function(e,t){var i=Yd.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}},{key:"setFromObject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.makeEmpty(),this.expandByObject(e,t)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.min.copy(e.min),this.max.copy(e.max),this}},{key:"makeEmpty",value:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}},{key:"isEmpty",value:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}},{key:"getCenter",value:function(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}},{key:"getSize",value:function(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}},{key:"expandByPoint",value:function(e){return this.min.min(e),this.max.max(e),this}},{key:"expandByVector",value:function(e){return this.min.sub(e),this.max.add(e),this}},{key:"expandByScalar",value:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this}},{key:"expandByObject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.updateWorldMatrix(!1,!1);var i=e.geometry;if(void 0!==i){var n=i.getAttribute("position");if(!0===t&&void 0!==n&&!0!==e.isInstancedMesh)for(var o=0,s=n.count;o<s;o++)!0===e.isMesh?e.getVertexPosition(o,Yd):Yd.fromBufferAttribute(n,o),Yd.applyMatrix4(e.matrixWorld),this.expandByPoint(Yd);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),Jd.copy(e.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),Jd.copy(i.boundingBox)),Jd.applyMatrix4(e.matrixWorld),this.union(Jd)}for(var a=e.children,r=0,l=a.length;r<l;r++)this.expandByObject(a[r],t);return this}},{key:"containsPoint",value:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}},{key:"containsBox",value:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}},{key:"getParameter",value:function(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}},{key:"intersectsBox",value:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}},{key:"intersectsSphere",value:function(e){return this.clampPoint(e.center,Yd),Yd.distanceToSquared(e.center)<=e.radius*e.radius}},{key:"intersectsPlane",value:function(e){var t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}},{key:"intersectsTriangle",value:function(e){if(this.isEmpty())return!1;this.getCenter(em),tm.subVectors(this.max,em),qd.subVectors(e.a,em),Xd.subVectors(e.b,em),Zd.subVectors(e.c,em),Kd.subVectors(Xd,qd),Qd.subVectors(Zd,Xd),$d.subVectors(qd,Zd);var t=[0,-Kd.z,Kd.y,0,-Qd.z,Qd.y,0,-$d.z,$d.y,Kd.z,0,-Kd.x,Qd.z,0,-Qd.x,$d.z,0,-$d.x,-Kd.y,Kd.x,0,-Qd.y,Qd.x,0,-$d.y,$d.x,0];return!!om(t,qd,Xd,Zd,tm)&&(!!om(t=[1,0,0,0,1,0,0,0,1],qd,Xd,Zd,tm)&&(im.crossVectors(Kd,Qd),om(t=[im.x,im.y,im.z],qd,Xd,Zd,tm)))}},{key:"clampPoint",value:function(e,t){return t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return this.clampPoint(e,Yd).distanceTo(e)}},{key:"getBoundingSphere",value:function(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(Yd).length()),e}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"applyMatrix4",value:function(e){return this.isEmpty()||(Ud[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ud[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ud[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ud[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ud[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ud[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ud[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ud[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ud)),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}])}(),Ud=[new Hd,new Hd,new Hd,new Hd,new Hd,new Hd,new Hd,new Hd],Yd=new Hd,Jd=new Wd,qd=new Hd,Xd=new Hd,Zd=new Hd,Kd=new Hd,Qd=new Hd,$d=new Hd,em=new Hd,tm=new Hd,im=new Hd,nm=new Hd;function om(e,t,i,n,o){for(var s=0,a=e.length-3;s<=a;s+=3){nm.fromArray(e,s);var r=o.x*Math.abs(nm.x)+o.y*Math.abs(nm.y)+o.z*Math.abs(nm.z),l=t.dot(nm),c=i.dot(nm),u=n.dot(nm);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>r)return!1}return!0}var sm=new Wd,am=new Hd,rm=new Hd,lm=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Hd,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;k()(this,e),this.isSphere=!0,this.center=t,this.radius=i}),[{key:"set",value:function(e,t){return this.center.copy(e),this.radius=t,this}},{key:"setFromPoints",value:function(e,t){var i=this.center;void 0!==t?i.copy(t):sm.setFromPoints(e).getCenter(i);for(var n=0,o=0,s=e.length;o<s;o++)n=Math.max(n,i.distanceToSquared(e[o]));return this.radius=Math.sqrt(n),this}},{key:"copy",value:function(e){return this.center.copy(e.center),this.radius=e.radius,this}},{key:"isEmpty",value:function(){return this.radius<0}},{key:"makeEmpty",value:function(){return this.center.set(0,0,0),this.radius=-1,this}},{key:"containsPoint",value:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}},{key:"distanceToPoint",value:function(e){return e.distanceTo(this.center)-this.radius}},{key:"intersectsSphere",value:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}},{key:"intersectsBox",value:function(e){return e.intersectsSphere(this)}},{key:"intersectsPlane",value:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}},{key:"clampPoint",value:function(e,t){var i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}},{key:"getBoundingBox",value:function(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}},{key:"applyMatrix4",value:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}},{key:"translate",value:function(e){return this.center.add(e),this}},{key:"expandByPoint",value:function(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;am.subVectors(e,this.center);var t=am.lengthSq();if(t>this.radius*this.radius){var i=Math.sqrt(t),n=.5*(i-this.radius);this.center.addScaledVector(am,n/i),this.radius+=n}return this}},{key:"union",value:function(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(rm.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(am.copy(e.center).add(rm)),this.expandByPoint(am.copy(e.center).sub(rm))),this)}},{key:"equals",value:function(e){return e.center.equals(this.center)&&e.radius===this.radius}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),cm=new Hd,um=new Hd,hm=new Hd,pm=new Hd,dm=new Hd,mm=new Hd,fm=new Hd,vm=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Hd,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Hd(0,0,-1);k()(this,e),this.origin=t,this.direction=i}),[{key:"set",value:function(e,t){return this.origin.copy(e),this.direction.copy(t),this}},{key:"copy",value:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}},{key:"at",value:function(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}},{key:"lookAt",value:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this}},{key:"recast",value:function(e){return this.origin.copy(this.at(e,cm)),this}},{key:"closestPointToPoint",value:function(e,t){t.subVectors(e,this.origin);var i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}},{key:"distanceToPoint",value:function(e){return Math.sqrt(this.distanceSqToPoint(e))}},{key:"distanceSqToPoint",value:function(e){var t=cm.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(cm.copy(this.origin).addScaledVector(this.direction,t),cm.distanceToSquared(e))}},{key:"distanceSqToSegment",value:function(e,t,i,n){um.copy(e).add(t).multiplyScalar(.5),hm.copy(t).sub(e).normalize(),pm.copy(this.origin).sub(um);var o,s,a,r,l=.5*e.distanceTo(t),c=-this.direction.dot(hm),u=pm.dot(this.direction),h=-pm.dot(hm),p=pm.lengthSq(),d=Math.abs(1-c*c);if(d>0)if(s=c*u-h,r=l*d,(o=c*h-u)>=0)if(s>=-r)if(s<=r){var m=1/d;a=(o*=m)*(o+c*(s*=m)+2*u)+s*(c*o+s+2*h)+p}else s=l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*h)+p;else s=-l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*h)+p;else s<=-r?a=-(o=Math.max(0,-(-c*l+u)))*o+(s=o>0?-l:Math.min(Math.max(-l,-h),l))*(s+2*h)+p:s<=r?(o=0,a=(s=Math.min(Math.max(-l,-h),l))*(s+2*h)+p):a=-(o=Math.max(0,-(c*l+u)))*o+(s=o>0?l:Math.min(Math.max(-l,-h),l))*(s+2*h)+p;else s=c>0?-l:l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*h)+p;return i&&i.copy(this.origin).addScaledVector(this.direction,o),n&&n.copy(um).addScaledVector(hm,s),a}},{key:"intersectSphere",value:function(e,t){cm.subVectors(e.center,this.origin);var i=cm.dot(this.direction),n=cm.dot(cm)-i*i,o=e.radius*e.radius;if(n>o)return null;var s=Math.sqrt(o-n),a=i-s,r=i+s;return r<0?null:a<0?this.at(r,t):this.at(a,t)}},{key:"intersectsSphere",value:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}},{key:"distanceToPlane",value:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}},{key:"intersectPlane",value:function(e,t){var i=this.distanceToPlane(e);return null===i?null:this.at(i,t)}},{key:"intersectsPlane",value:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}},{key:"intersectBox",value:function(e,t){var i,n,o,s,a,r,l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(i=(e.min.x-h.x)*l,n=(e.max.x-h.x)*l):(i=(e.max.x-h.x)*l,n=(e.min.x-h.x)*l),c>=0?(o=(e.min.y-h.y)*c,s=(e.max.y-h.y)*c):(o=(e.max.y-h.y)*c,s=(e.min.y-h.y)*c),i>s||o>n?null:((o>i||isNaN(i))&&(i=o),(s<n||isNaN(n))&&(n=s),u>=0?(a=(e.min.z-h.z)*u,r=(e.max.z-h.z)*u):(a=(e.max.z-h.z)*u,r=(e.min.z-h.z)*u),i>r||a>n?null:((a>i||i!=i)&&(i=a),(r<n||n!=n)&&(n=r),n<0?null:this.at(i>=0?i:n,t)))}},{key:"intersectsBox",value:function(e){return null!==this.intersectBox(e,cm)}},{key:"intersectTriangle",value:function(e,t,i,n,o){dm.subVectors(t,e),mm.subVectors(i,e),fm.crossVectors(dm,mm);var s,a=this.direction.dot(fm);if(a>0){if(n)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}pm.subVectors(this.origin,e);var r=s*this.direction.dot(mm.crossVectors(pm,mm));if(r<0)return null;var l=s*this.direction.dot(dm.cross(pm));if(l<0)return null;if(r+l>a)return null;var c=-s*pm.dot(fm);return c<0?null:this.at(c/a,o)}},{key:"applyMatrix4",value:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}},{key:"equals",value:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),gm=function(){function e(t,i,n,o,s,a,r,l,c,u,h,p,d,m,f,v){k()(this,e),e.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,i,n,o,s,a,r,l,c,u,h,p,d,m,f,v)}return x()(e,[{key:"set",value:function(e,t,i,n,o,s,a,r,l,c,u,h,p,d,m,f){var v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=n,v[1]=o,v[5]=s,v[9]=a,v[13]=r,v[2]=l,v[6]=c,v[10]=u,v[14]=h,v[3]=p,v[7]=d,v[11]=m,v[15]=f,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new e).fromArray(this.elements)}},{key:"copy",value:function(e){var t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}},{key:"copyPosition",value:function(e){var t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}},{key:"setFromMatrix3",value:function(e){var t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}},{key:"extractBasis",value:function(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(e){var t=this.elements,i=e.elements,n=1/ym.setFromMatrixColumn(e,0).length(),o=1/ym.setFromMatrixColumn(e,1).length(),s=1/ym.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*o,t[5]=i[5]*o,t[6]=i[6]*o,t[7]=0,t[8]=i[8]*s,t[9]=i[9]*s,t[10]=i[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromEuler",value:function(e){var t=this.elements,i=e.x,n=e.y,o=e.z,s=Math.cos(i),a=Math.sin(i),r=Math.cos(n),l=Math.sin(n),c=Math.cos(o),u=Math.sin(o);if("XYZ"===e.order){var h=s*c,p=s*u,d=a*c,m=a*u;t[0]=r*c,t[4]=-r*u,t[8]=l,t[1]=p+d*l,t[5]=h-m*l,t[9]=-a*r,t[2]=m-h*l,t[6]=d+p*l,t[10]=s*r}else if("YXZ"===e.order){var f=r*c,v=r*u,g=l*c,y=l*u;t[0]=f+y*a,t[4]=g*a-v,t[8]=s*l,t[1]=s*u,t[5]=s*c,t[9]=-a,t[2]=v*a-g,t[6]=y+f*a,t[10]=s*r}else if("ZXY"===e.order){var b=r*c,C=r*u,w=l*c,k=l*u;t[0]=b-k*a,t[4]=-s*u,t[8]=w+C*a,t[1]=C+w*a,t[5]=s*c,t[9]=k-b*a,t[2]=-s*l,t[6]=a,t[10]=s*r}else if("ZYX"===e.order){var _=s*c,x=s*u,E=a*c,S=a*u;t[0]=r*c,t[4]=E*l-x,t[8]=_*l+S,t[1]=r*u,t[5]=S*l+_,t[9]=x*l-E,t[2]=-l,t[6]=a*r,t[10]=s*r}else if("YZX"===e.order){var P=s*r,D=s*l,M=a*r,T=a*l;t[0]=r*c,t[4]=T-P*u,t[8]=M*u+D,t[1]=u,t[5]=s*c,t[9]=-a*c,t[2]=-l*c,t[6]=D*u+M,t[10]=P-T*u}else if("XZY"===e.order){var O=s*r,N=s*l,B=a*r,A=a*l;t[0]=r*c,t[4]=-u,t[8]=l*c,t[1]=O*u+A,t[5]=s*c,t[9]=N*u-B,t[2]=B*u-N,t[6]=a*c,t[10]=A*u+O}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(e){return this.compose(Cm,e,wm)}},{key:"lookAt",value:function(e,t,i){var n=this.elements;return xm.subVectors(e,t),0===xm.lengthSq()&&(xm.z=1),xm.normalize(),km.crossVectors(i,xm),0===km.lengthSq()&&(1===Math.abs(i.z)?xm.x+=1e-4:xm.z+=1e-4,xm.normalize(),km.crossVectors(i,xm)),km.normalize(),_m.crossVectors(xm,km),n[0]=km.x,n[4]=_m.x,n[8]=xm.x,n[1]=km.y,n[5]=_m.y,n[9]=xm.y,n[2]=km.z,n[6]=_m.z,n[10]=xm.z,this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var i=e.elements,n=t.elements,o=this.elements,s=i[0],a=i[4],r=i[8],l=i[12],c=i[1],u=i[5],h=i[9],p=i[13],d=i[2],m=i[6],f=i[10],v=i[14],g=i[3],y=i[7],b=i[11],C=i[15],w=n[0],k=n[4],_=n[8],x=n[12],E=n[1],S=n[5],P=n[9],D=n[13],M=n[2],T=n[6],O=n[10],N=n[14],B=n[3],A=n[7],L=n[11],I=n[15];return o[0]=s*w+a*E+r*M+l*B,o[4]=s*k+a*S+r*T+l*A,o[8]=s*_+a*P+r*O+l*L,o[12]=s*x+a*D+r*N+l*I,o[1]=c*w+u*E+h*M+p*B,o[5]=c*k+u*S+h*T+p*A,o[9]=c*_+u*P+h*O+p*L,o[13]=c*x+u*D+h*N+p*I,o[2]=d*w+m*E+f*M+v*B,o[6]=d*k+m*S+f*T+v*A,o[10]=d*_+m*P+f*O+v*L,o[14]=d*x+m*D+f*N+v*I,o[3]=g*w+y*E+b*M+C*B,o[7]=g*k+y*S+b*T+C*A,o[11]=g*_+y*P+b*O+C*L,o[15]=g*x+y*D+b*N+C*I,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],i=e[4],n=e[8],o=e[12],s=e[1],a=e[5],r=e[9],l=e[13],c=e[2],u=e[6],h=e[10],p=e[14];return e[3]*(+o*r*u-n*l*u-o*a*h+i*l*h+n*a*p-i*r*p)+e[7]*(+t*r*p-t*l*h+o*s*h-n*s*p+n*l*c-o*r*c)+e[11]*(+t*l*u-t*a*p-o*s*u+i*s*p+o*a*c-i*l*c)+e[15]*(-n*a*c-t*r*u+t*a*h+n*s*u-i*s*h+i*r*c)}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}},{key:"setPosition",value:function(e,t,i){var n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}},{key:"invert",value:function(){var e=this.elements,t=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],r=e[6],l=e[7],c=e[8],u=e[9],h=e[10],p=e[11],d=e[12],m=e[13],f=e[14],v=e[15],g=u*f*l-m*h*l+m*r*p-a*f*p-u*r*v+a*h*v,y=d*h*l-c*f*l-d*r*p+s*f*p+c*r*v-s*h*v,b=c*m*l-d*u*l+d*a*p-s*m*p-c*a*v+s*u*v,C=d*u*r-c*m*r-d*a*h+s*m*h+c*a*f-s*u*f,w=t*g+i*y+n*b+o*C;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var k=1/w;return e[0]=g*k,e[1]=(m*h*o-u*f*o-m*n*p+i*f*p+u*n*v-i*h*v)*k,e[2]=(a*f*o-m*r*o+m*n*l-i*f*l-a*n*v+i*r*v)*k,e[3]=(u*r*o-a*h*o-u*n*l+i*h*l+a*n*p-i*r*p)*k,e[4]=y*k,e[5]=(c*f*o-d*h*o+d*n*p-t*f*p-c*n*v+t*h*v)*k,e[6]=(d*r*o-s*f*o-d*n*l+t*f*l+s*n*v-t*r*v)*k,e[7]=(s*h*o-c*r*o+c*n*l-t*h*l-s*n*p+t*r*p)*k,e[8]=b*k,e[9]=(d*u*o-c*m*o-d*i*p+t*m*p+c*i*v-t*u*v)*k,e[10]=(s*m*o-d*a*o+d*i*l-t*m*l-s*i*v+t*a*v)*k,e[11]=(c*a*o-s*u*o-c*i*l+t*u*l+s*i*p-t*a*p)*k,e[12]=C*k,e[13]=(c*m*n-d*u*n+d*i*h-t*m*h-c*i*f+t*u*f)*k,e[14]=(d*a*n-s*m*n-d*i*r+t*m*r+s*i*f-t*a*f)*k,e[15]=(s*u*n-c*a*n+c*i*r-t*u*r-s*i*h+t*a*h)*k,this}},{key:"scale",value:function(e){var t=this.elements,i=e.x,n=e.y,o=e.z;return t[0]*=i,t[4]*=n,t[8]*=o,t[1]*=i,t[5]*=n,t[9]*=o,t[2]*=i,t[6]*=n,t[10]*=o,t[3]*=i,t[7]*=n,t[11]*=o,this}},{key:"getMaxScaleOnAxis",value:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}},{key:"makeTranslation",value:function(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}},{key:"makeRotationX",value:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}},{key:"makeRotationY",value:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(e,t){var i=Math.cos(t),n=Math.sin(t),o=1-i,s=e.x,a=e.y,r=e.z,l=o*s,c=o*a;return this.set(l*s+i,l*a-n*r,l*r+n*a,0,l*a+n*r,c*a+i,c*r-n*s,0,l*r-n*a,c*r+n*s,o*r*r+i,0,0,0,0,1),this}},{key:"makeScale",value:function(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}},{key:"makeShear",value:function(e,t,i,n,o,s){return this.set(1,i,o,0,e,1,s,0,t,n,1,0,0,0,0,1),this}},{key:"compose",value:function(e,t,i){var n=this.elements,o=t._x,s=t._y,a=t._z,r=t._w,l=o+o,c=s+s,u=a+a,h=o*l,p=o*c,d=o*u,m=s*c,f=s*u,v=a*u,g=r*l,y=r*c,b=r*u,C=i.x,w=i.y,k=i.z;return n[0]=(1-(m+v))*C,n[1]=(p+b)*C,n[2]=(d-y)*C,n[3]=0,n[4]=(p-b)*w,n[5]=(1-(h+v))*w,n[6]=(f+g)*w,n[7]=0,n[8]=(d+y)*k,n[9]=(f-g)*k,n[10]=(1-(h+m))*k,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}},{key:"decompose",value:function(e,t,i){var n=this.elements,o=ym.set(n[0],n[1],n[2]).length(),s=ym.set(n[4],n[5],n[6]).length(),a=ym.set(n[8],n[9],n[10]).length();this.determinant()<0&&(o=-o),e.x=n[12],e.y=n[13],e.z=n[14],bm.copy(this);var r=1/o,l=1/s,c=1/a;return bm.elements[0]*=r,bm.elements[1]*=r,bm.elements[2]*=r,bm.elements[4]*=l,bm.elements[5]*=l,bm.elements[6]*=l,bm.elements[8]*=c,bm.elements[9]*=c,bm.elements[10]*=c,t.setFromRotationMatrix(bm),i.x=o,i.y=s,i.z=a,this}},{key:"makePerspective",value:function(e,t,i,n,o,s){var a,r,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2e3,c=this.elements,u=2*o/(t-e),h=2*o/(i-n),p=(t+e)/(t-e),d=(i+n)/(i-n);if(l===sd)a=-(s+o)/(s-o),r=-2*s*o/(s-o);else{if(l!==ad)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);a=-s/(s-o),r=-s*o/(s-o)}return c[0]=u,c[4]=0,c[8]=p,c[12]=0,c[1]=0,c[5]=h,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=a,c[14]=r,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}},{key:"makeOrthographic",value:function(e,t,i,n,o,s){var a,r,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2e3,c=this.elements,u=1/(t-e),h=1/(i-n),p=1/(s-o),d=(t+e)*u,m=(i+n)*h;if(l===sd)a=(s+o)*p,r=-2*p;else{if(l!==ad)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);a=o*p,r=-1*p}return c[0]=2*u,c[4]=0,c[8]=0,c[12]=-d,c[1]=0,c[5]=2*h,c[9]=0,c[13]=-m,c[2]=0,c[6]=0,c[10]=r,c[14]=-a,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}},{key:"equals",value:function(e){for(var t=this.elements,i=e.elements,n=0;n<16;n++)if(t[n]!==i[n])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0;i<16;i++)this.elements[i]=e[i+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}])}(),ym=new Hd,bm=new gm,Cm=new Hd(0,0,0),wm=new Hd(1,1,1),km=new Hd,_m=new Hd,xm=new Hd,Em=new gm,Sm=new zd,Pm=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.DEFAULT_ORDER;k()(this,e),this.isEuler=!0,this._x=t,this._y=i,this._z=n,this._order=o}),[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}},{key:"set",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=e,this._y=t,this._z=i,this._order=n,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=e.elements,o=n[0],s=n[4],a=n[8],r=n[1],l=n[5],c=n[9],u=n[2],h=n[6],p=n[10];switch(t){case"XYZ":this._y=Math.asin(hd(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-hd(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(r,l)):(this._y=Math.atan2(-u,o),this._z=0);break;case"ZXY":this._x=Math.asin(hd(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(r,o));break;case"ZYX":this._y=Math.asin(-hd(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,p),this._z=Math.atan2(r,o)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(hd(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,o)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-hd(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-c,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===i&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(e,t,i){return Em.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Em,t,i)}},{key:"setFromVector3",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}},{key:"reorder",value:function(e){return Sm.setFromEuler(this),this.setFromQuaternion(Sm,e)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}},{key:"fromArray",value:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._x;case 2:return e.next=4,this._y;case 4:return e.next=6,this._z;case 6:return e.next=8,this._order;case 8:case"end":return e.stop()}}),e,this)}))}])}();Pm.DEFAULT_ORDER="XYZ";var Dm=function(){return x()((function e(){k()(this,e),this.mask=1}),[{key:"set",value:function(e){this.mask=(1<<e|0)>>>0}},{key:"enable",value:function(e){this.mask|=1<<e|0}},{key:"enableAll",value:function(){this.mask=-1}},{key:"toggle",value:function(e){this.mask^=1<<e|0}},{key:"disable",value:function(e){this.mask&=~(1<<e|0)}},{key:"disableAll",value:function(){this.mask=0}},{key:"test",value:function(e){return 0!=(this.mask&e.mask)}},{key:"isEnabled",value:function(e){return 0!=(this.mask&(1<<e|0))}}])}(),Mm=0,Tm=new Hd,Om=new zd,Nm=new gm,Bm=new Hd,Am=new Hd,Lm=new Hd,Im=new zd,jm=new Hd(1,0,0),Rm=new Hd(0,1,0),Fm=new Hd(0,0,1),zm={type:"added"},Hm={type:"removed"},Vm={type:"childadded",child:null},Gm={type:"childremoved",child:null},Wm=function(e){function t(){var e;k()(this,t),(e=Up(this,t)).isObject3D=!0,Object.defineProperty(Gp()(e),"id",{value:Mm++}),e.uuid=ud(),e.name="",e.type="Object3D",e.parent=null,e.children=[],e.up=t.DEFAULT_UP.clone();var i=new Hd,n=new Pm,o=new zd,s=new Hd(1,1,1);return n._onChange((function(){o.setFromEuler(n,!1)})),o._onChange((function(){n.setFromQuaternion(o,void 0,!1)})),Object.defineProperties(e,{position:{configurable:!0,enumerable:!0,value:i},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:o},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new gm},normalMatrix:{value:new gd}}),e.matrix=new gm,e.matrixWorld=new gm,e.matrixAutoUpdate=t.DEFAULT_MATRIX_AUTO_UPDATE,e.matrixWorldAutoUpdate=t.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,e.matrixWorldNeedsUpdate=!1,e.layers=new Dm,e.visible=!0,e.castShadow=!1,e.receiveShadow=!1,e.frustumCulled=!0,e.renderOrder=0,e.animations=[],e.userData={},e}return un()(t,e),x()(t,[{key:"onBeforeShadow",value:function(){}},{key:"onAfterShadow",value:function(){}},{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 Om.setFromAxisAngle(e,t),this.quaternion.multiply(Om),this}},{key:"rotateOnWorldAxis",value:function(e,t){return Om.setFromAxisAngle(e,t),this.quaternion.premultiply(Om),this}},{key:"rotateX",value:function(e){return this.rotateOnAxis(jm,e)}},{key:"rotateY",value:function(e){return this.rotateOnAxis(Rm,e)}},{key:"rotateZ",value:function(e){return this.rotateOnAxis(Fm,e)}},{key:"translateOnAxis",value:function(e,t){return Tm.copy(e).applyQuaternion(this.quaternion),this.position.add(Tm.multiplyScalar(t)),this}},{key:"translateX",value:function(e){return this.translateOnAxis(jm,e)}},{key:"translateY",value:function(e){return this.translateOnAxis(Rm,e)}},{key:"translateZ",value:function(e){return this.translateOnAxis(Fm,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(Nm.copy(this.matrixWorld).invert())}},{key:"lookAt",value:function(e,t,i){e.isVector3?Bm.copy(e):Bm.set(e,t,i);var n=this.parent;this.updateWorldMatrix(!0,!1),Am.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Nm.lookAt(Am,Bm,this.up):Nm.lookAt(Bm,Am,this.up),this.quaternion.setFromRotationMatrix(Nm),n&&(Nm.extractRotation(n.matrixWorld),Om.setFromRotationMatrix(Nm),this.quaternion.premultiply(Om.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?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(zm),Vm.child=e,this.dispatchEvent(Vm),Vm.child=null):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(Hm),Gm.child=e,this.dispatchEvent(Gm),Gm.child=null),this}},{key:"removeFromParent",value:function(){var e=this.parent;return null!==e&&e.remove(this),this}},{key:"clear",value:function(){return this.remove.apply(this,A()(this.children))}},{key:"attach",value:function(e){return this.updateWorldMatrix(!0,!1),Nm.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Nm.multiply(e.parent.matrixWorld)),e.applyMatrix4(Nm),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(zm),Vm.child=e,this.dispatchEvent(Vm),Vm.child=null,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 o=this.children[i].getObjectByProperty(e,t);if(void 0!==o)return o}}},{key:"getObjectsByProperty",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this[e]===t&&i.push(this);for(var n=this.children,o=0,s=n.length;o<s;o++)n[o].getObjectsByProperty(e,t,i);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(Am,e,Lm),e}},{key:"getWorldScale",value:function(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Am,Im,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 o=t[i];!0!==o.matrixWorldAutoUpdate&&!0!==e||o.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,o=0,s=n.length;o<s;o++){var a=n[o];!0===a.matrixWorldAutoUpdate&&a.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.6,type:"Object",generator:"Object3D.toJSON"});var n={};function o(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.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.visibility=this._visibility,n.active=this._active,n.bounds=this._bounds.map((function(e){return{boxInitialized:e.boxInitialized,boxMin:e.box.min.toArray(),boxMax:e.box.max.toArray(),sphereInitialized:e.sphereInitialized,sphereRadius:e.sphere.radius,sphereCenter:e.sphere.center.toArray()}})),n.maxGeometryCount=this._maxGeometryCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.geometryCount=this._geometryCount,n.matricesTexture=this._matricesTexture.toJSON(e),null!==this.boundingSphere&&(n.boundingSphere={center:n.boundingSphere.center.toArray(),radius:n.boundingSphere.radius}),null!==this.boundingBox&&(n.boundingBox={min:n.boundingBox.min.toArray(),max:n.boundingBox.max.toArray()})),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=o(e.geometries,this.geometry);var s=this.geometry.parameters;if(void 0!==s&&void 0!==s.shapes){var a=s.shapes;if(Array.isArray(a))for(var r=0,l=a.length;r<l;r++){var c=a[r];o(e.shapes,c)}else o(e.shapes,a)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(o(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){for(var u=[],h=0,p=this.material.length;h<p;h++)u.push(o(e.materials,this.material[h]));n.material=u}else n.material=o(e.materials,this.material);if(this.children.length>0){n.children=[];for(var d=0;d<this.children.length;d++)n.children.push(this.children[d].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(var m=0;m<this.animations.length;m++){var f=this.animations[m];n.animations.push(o(e.animations,f))}}if(t){var v=x(e.geometries),g=x(e.materials),y=x(e.textures),b=x(e.images),C=x(e.shapes),w=x(e.skeletons),k=x(e.animations),_=x(e.nodes);v.length>0&&(i.geometries=v),g.length>0&&(i.materials=g),y.length>0&&(i.textures=y),b.length>0&&(i.images=b),C.length>0&&(i.shapes=C),w.length>0&&(i.skeletons=w),k.length>0&&(i.animations=k),_.length>0&&(i.nodes=_)}return i.object=n,i;function x(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.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,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.animations=e.animations.slice(),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}}])}(rd);Wm.DEFAULT_UP=new Hd(0,1,0),Wm.DEFAULT_MATRIX_AUTO_UPDATE=!0,Wm.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Um=new Hd,Ym=new Hd,Jm=new Hd,qm=new Hd,Xm=new Hd,Zm=new Hd,Km=new Hd,Qm=new Hd,$m=new Hd,ef=new Hd,tf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Hd,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Hd,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Hd;k()(this,e),this.a=t,this.b=i,this.c=n}return x()(e,[{key:"set",value:function(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}},{key:"setFromPointsAndIndices",value:function(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}},{key:"setFromAttributeAndIndices",value:function(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}},{key:"getArea",value:function(){return Um.subVectors(this.c,this.b),Ym.subVectors(this.a,this.b),.5*Um.cross(Ym).length()}},{key:"getMidpoint",value:function(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}},{key:"getNormal",value:function(t){return e.getNormal(this.a,this.b,this.c,t)}},{key:"getPlane",value:function(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}},{key:"getBarycoord",value:function(t,i){return e.getBarycoord(t,this.a,this.b,this.c,i)}},{key:"getInterpolation",value:function(t,i,n,o,s){return e.getInterpolation(t,this.a,this.b,this.c,i,n,o,s)}},{key:"containsPoint",value:function(t){return e.containsPoint(t,this.a,this.b,this.c)}},{key:"isFrontFacing",value:function(t){return e.isFrontFacing(this.a,this.b,this.c,t)}},{key:"intersectsBox",value:function(e){return e.intersectsTriangle(this)}},{key:"closestPointToPoint",value:function(e,t){var i,n,o=this.a,s=this.b,a=this.c;Xm.subVectors(s,o),Zm.subVectors(a,o),Qm.subVectors(e,o);var r=Xm.dot(Qm),l=Zm.dot(Qm);if(r<=0&&l<=0)return t.copy(o);$m.subVectors(e,s);var c=Xm.dot($m),u=Zm.dot($m);if(c>=0&&u<=c)return t.copy(s);var h=r*u-c*l;if(h<=0&&r>=0&&c<=0)return i=r/(r-c),t.copy(o).addScaledVector(Xm,i);ef.subVectors(e,a);var p=Xm.dot(ef),d=Zm.dot(ef);if(d>=0&&p<=d)return t.copy(a);var m=p*l-r*d;if(m<=0&&l>=0&&d<=0)return n=l/(l-d),t.copy(o).addScaledVector(Zm,n);var f=c*d-p*u;if(f<=0&&u-c>=0&&p-d>=0)return Km.subVectors(a,s),n=(u-c)/(u-c+(p-d)),t.copy(s).addScaledVector(Km,n);var v=1/(f+m+h);return i=m*v,n=h*v,t.copy(o).addScaledVector(Xm,i).addScaledVector(Zm,n)}},{key:"equals",value:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}],[{key:"getNormal",value:function(e,t,i,n){n.subVectors(i,t),Um.subVectors(e,t),n.cross(Um);var o=n.lengthSq();return o>0?n.multiplyScalar(1/Math.sqrt(o)):n.set(0,0,0)}},{key:"getBarycoord",value:function(e,t,i,n,o){Um.subVectors(n,t),Ym.subVectors(i,t),Jm.subVectors(e,t);var s=Um.dot(Um),a=Um.dot(Ym),r=Um.dot(Jm),l=Ym.dot(Ym),c=Ym.dot(Jm),u=s*l-a*a;if(0===u)return o.set(0,0,0),null;var h=1/u,p=(l*r-a*c)*h,d=(s*c-a*r)*h;return o.set(1-p-d,d,p)}},{key:"containsPoint",value:function(e,t,i,n){return null!==this.getBarycoord(e,t,i,n,qm)&&qm.x>=0&&qm.y>=0&&qm.x+qm.y<=1}},{key:"getInterpolation",value:function(e,t,i,n,o,s,a,r){return null===this.getBarycoord(e,t,i,n,qm)?(r.x=0,r.y=0,"z"in r&&(r.z=0),"w"in r&&(r.w=0),null):(r.setScalar(0),r.addScaledVector(o,qm.x),r.addScaledVector(s,qm.y),r.addScaledVector(a,qm.z),r)}},{key:"isFrontFacing",value:function(e,t,i,n){return Um.subVectors(i,t),Ym.subVectors(e,t),Um.cross(Ym).dot(n)<0}}])}(),nf={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},of={h:0,s:0,l:0},sf={h:0,s:0,l:0};function af(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+6*(t-e)*(2/3-i):e}var rf=function(){return x()((function e(t,i,n){return k()(this,e),this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,i,n)}),[{key:"set",value:function(e,t,i){if(void 0===t&&void 0===i){var n=e;n&&n.isColor?this.copy(n):"number"==typeof n?this.setHex(n):"string"==typeof n&&this.setStyle(n)}else this.setRGB(e,t,i);return this}},{key:"setScalar",value:function(e){return this.r=e,this.g=e,this.b=e,this}},{key:"setHex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zp;return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,Dd.toWorkingColorSpace(this,t),this}},{key:"setRGB",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Dd.workingColorSpace;return this.r=e,this.g=t,this.b=i,Dd.toWorkingColorSpace(this,n),this}},{key:"setHSL",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Dd.workingColorSpace;if(e=pd(e,1),t=hd(t,0,1),i=hd(i,0,1),0===t)this.r=this.g=this.b=i;else{var o=i<=.5?i*(1+t):i+t-i*t,s=2*i-o;this.r=af(s,o,e+1/3),this.g=af(s,o,e),this.b=af(s,o,e-1/3)}return Dd.toWorkingColorSpace(this,n),this}},{key:"setStyle",value:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zp;function n(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}if(t=/^(\w+)\(([^\)]*)\)/.exec(e)){var o,s=t[1],a=t[2];switch(s){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,i);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,i);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,i);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(t=/^\#([A-Fa-f\d]+)$/.exec(e)){var r=t[1],l=r.length;if(3===l)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,i);if(6===l)return this.setHex(parseInt(r,16),i);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,i);return this}},{key:"setColorName",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zp,i=nf[e.toLowerCase()];return void 0!==i?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b)}},{key:"copy",value:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}},{key:"copySRGBToLinear",value:function(e){return this.r=Md(e.r),this.g=Md(e.g),this.b=Md(e.b),this}},{key:"copyLinearToSRGB",value:function(e){return this.r=Td(e.r),this.g=Td(e.g),this.b=Td(e.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zp;return Dd.fromWorkingColorSpace(lf.copy(this),e),65536*Math.round(hd(255*lf.r,0,255))+256*Math.round(hd(255*lf.g,0,255))+Math.round(hd(255*lf.b,0,255))}},{key:"getHexString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zp;return("000000"+this.getHex(e).toString(16)).slice(-6)}},{key:"getHSL",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Dd.workingColorSpace;Dd.fromWorkingColorSpace(lf.copy(this),t);var i,n,o=lf.r,s=lf.g,a=lf.b,r=Math.max(o,s,a),l=Math.min(o,s,a),c=(l+r)/2;if(l===r)i=0,n=0;else{var u=r-l;switch(n=c<=.5?u/(r+l):u/(2-r-l),r){case o:i=(s-a)/u+(s<a?6:0);break;case s:i=(a-o)/u+2;break;case a:i=(o-s)/u+4}i/=6}return e.h=i,e.s=n,e.l=c,e}},{key:"getRGB",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Dd.workingColorSpace;return Dd.fromWorkingColorSpace(lf.copy(this),t),e.r=lf.r,e.g=lf.g,e.b=lf.b,e}},{key:"getStyle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zp;Dd.fromWorkingColorSpace(lf.copy(this),e);var t=lf.r,i=lf.g,n=lf.b;return e!==Zp?"color(".concat(e," ").concat(t.toFixed(3)," ").concat(i.toFixed(3)," ").concat(n.toFixed(3),")"):"rgb(".concat(Math.round(255*t),",").concat(Math.round(255*i),",").concat(Math.round(255*n),")")}},{key:"offsetHSL",value:function(e,t,i){return this.getHSL(of),this.setHSL(of.h+e,of.s+t,of.l+i)}},{key:"add",value:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}},{key:"addColors",value:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}},{key:"addScalar",value:function(e){return this.r+=e,this.g+=e,this.b+=e,this}},{key:"sub",value:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}},{key:"multiply",value:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}},{key:"multiplyScalar",value:function(e){return this.r*=e,this.g*=e,this.b*=e,this}},{key:"lerp",value:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}},{key:"lerpColors",value:function(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}},{key:"lerpHSL",value:function(e,t){this.getHSL(of),e.getHSL(sf);var i=dd(of.h,sf.h,t),n=dd(of.s,sf.s,t),o=dd(of.l,sf.l,t);return this.setHSL(i,n,o),this}},{key:"setFromVector3",value:function(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}},{key:"applyMatrix3",value:function(e){var t=this.r,i=this.g,n=this.b,o=e.elements;return this.r=o[0]*t+o[3]*i+o[6]*n,this.g=o[1]*t+o[4]*i+o[7]*n,this.b=o[2]*t+o[5]*i+o[8]*n,this}},{key:"equals",value:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}},{key:"fromBufferAttribute",value:function(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}},{key:"toJSON",value:function(){return this.getHex()}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.r;case 2:return e.next=4,this.g;case 4:return e.next=6,this.b;case 6:case"end":return e.stop()}}),e,this)}))}])}(),lf=new rf;rf.NAMES=nf;var cf=0,uf=function(e){function t(){var e;return k()(this,t),(e=Up(this,t)).isMaterial=!0,Object.defineProperty(Gp()(e),"id",{value:cf++}),e.uuid=ud(),e.name="",e.type="Material",e.blending=1,e.side=0,e.vertexColors=!1,e.opacity=1,e.transparent=!1,e.alphaHash=!1,e.blendSrc=204,e.blendDst=205,e.blendEquation=100,e.blendSrcAlpha=null,e.blendDstAlpha=null,e.blendEquationAlpha=null,e.blendColor=new rf(0,0,0),e.blendAlpha=0,e.depthFunc=3,e.depthTest=!0,e.depthWrite=!0,e.stencilWriteMask=255,e.stencilFunc=519,e.stencilRef=0,e.stencilFuncMask=255,e.stencilFail=nd,e.stencilZFail=nd,e.stencilZPass=nd,e.stencilWrite=!1,e.clippingPlanes=null,e.clipIntersection=!1,e.clipShadows=!1,e.shadowSide=null,e.colorWrite=!0,e.precision=null,e.polygonOffset=!1,e.polygonOffsetFactor=0,e.polygonOffsetUnits=0,e.dithering=!1,e.alphaToCoverage=!1,e.premultipliedAlpha=!1,e.forceSinglePass=!1,e.visible=!0,e.toneMapped=!0,e.userData={},e.version=0,e._alphaTest=0,e}return un()(t,e),x()(t,[{key:"alphaTest",get:function(){return this._alphaTest},set:function(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}},{key:"onBuild",value:function(){}},{key:"onBeforeRender",value:function(){}},{key:"onBeforeCompile",value:function(){}},{key:"customProgramCacheKey",value:function(){return this.onBeforeCompile.toString()}},{key:"setValues",value:function(e){if(void 0!==e)for(var t in e){var i=e[t];if(void 0!==i){var n=this[t];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i:console.warn("THREE.Material: '".concat(t,"' is not a property of THREE.").concat(this.type,"."))}else console.warn("THREE.Material: parameter '".concat(t,"' has value of undefined."))}}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function n(e){var t=[];for(var i in e){var n=e[i];delete n.metadata,t.push(n)}return t}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(i.dispersion=this.dispersion),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapRotation&&(i.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),204!==this.blendSrc&&(i.blendSrc=this.blendSrc),205!==this.blendDst&&(i.blendDst=this.blendDst),100!==this.blendEquation&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==nd&&(i.stencilFail=this.stencilFail),this.stencilZFail!==nd&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==nd&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),t){var o=n(e.textures),s=n(e.images);o.length>0&&(i.textures=o),s.length>0&&(i.images=s)}return i}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,i=null;if(null!==t){var n=t.length;i=new Array(n);for(var o=0;o!==n;++o)i[o]=t[o].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}])}(rd),hf=function(e){function t(e){var i;return k()(this,t),(i=Up(this,t)).isMeshBasicMaterial=!0,i.type="MeshBasicMaterial",i.color=new rf(16777215),i.map=null,i.lightMap=null,i.lightMapIntensity=1,i.aoMap=null,i.aoMapIntensity=1,i.specularMap=null,i.alphaMap=null,i.envMap=null,i.envMapRotation=new Pm,i.combine=0,i.reflectivity=1,i.refractionRatio=.98,i.wireframe=!1,i.wireframeLinewidth=1,i.wireframeLinecap="round",i.wireframeLinejoin="round",i.fog=!0,i.setValues(e),i}return un()(t,e),x()(t,[{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}])}(uf);!function(){for(var e=new ArrayBuffer(4),t=new Float32Array(e),i=new Uint32Array(e),n=new Uint32Array(512),o=new Uint32Array(512),s=0;s<256;++s){var a=s-127;a<-27?(n[s]=0,n[256|s]=32768,o[s]=24,o[256|s]=24):a<-14?(n[s]=1024>>-a-14,n[256|s]=1024>>-a-14|32768,o[s]=-a-1,o[256|s]=-a-1):a<=15?(n[s]=a+15<<10,n[256|s]=a+15<<10|32768,o[s]=13,o[256|s]=13):a<128?(n[s]=31744,n[256|s]=64512,o[s]=24,o[256|s]=24):(n[s]=31744,n[256|s]=64512,o[s]=13,o[256|s]=13)}for(var r=new Uint32Array(2048),l=new Uint32Array(64),c=new Uint32Array(64),u=1;u<1024;++u){for(var h=u<<13,p=0;0==(8388608&h);)h<<=1,p-=8388608;h&=-8388609,p+=947912704,r[u]=h|p}for(var d=1024;d<2048;++d)r[d]=939524096+(d-1024<<13);for(var m=1;m<31;++m)l[m]=m<<23;l[31]=1199570944,l[32]=2147483648;for(var f=33;f<63;++f)l[f]=2147483648+(f-32<<23);l[63]=3347054592;for(var v=1;v<64;++v)32!==v&&(c[v]=1024)}();var pf=new Hd,df=new vd,mf=function(){return x()((function e(t,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(k()(this,e),Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=i,this.count=void 0!==t?t.length/i:0,this.normalized=n,this.usage=od,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=1015,this.version=0}),[{key:"onUploadCallback",value:function(){}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}},{key:"updateRange",get:function(){return kd("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}},{key:"setUsage",value:function(e){return this.usage=e,this}},{key:"addUpdateRange",value:function(e,t){this.updateRanges.push({start:e,count:t})}},{key:"clearUpdateRanges",value:function(){this.updateRanges.length=0}},{key:"copy",value:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}},{key:"copyAt",value:function(e,t,i){e*=this.itemSize,i*=t.itemSize;for(var n=0,o=this.itemSize;n<o;n++)this.array[e+n]=t.array[i+n];return this}},{key:"copyArray",value:function(e){return this.array.set(e),this}},{key:"applyMatrix3",value:function(e){if(2===this.itemSize)for(var t=0,i=this.count;t<i;t++)df.fromBufferAttribute(this,t),df.applyMatrix3(e),this.setXY(t,df.x,df.y);else if(3===this.itemSize)for(var n=0,o=this.count;n<o;n++)pf.fromBufferAttribute(this,n),pf.applyMatrix3(e),this.setXYZ(n,pf.x,pf.y,pf.z);return this}},{key:"applyMatrix4",value:function(e){for(var t=0,i=this.count;t<i;t++)pf.fromBufferAttribute(this,t),pf.applyMatrix4(e),this.setXYZ(t,pf.x,pf.y,pf.z);return this}},{key:"applyNormalMatrix",value:function(e){for(var t=0,i=this.count;t<i;t++)pf.fromBufferAttribute(this,t),pf.applyNormalMatrix(e),this.setXYZ(t,pf.x,pf.y,pf.z);return this}},{key:"transformDirection",value:function(e){for(var t=0,i=this.count;t<i;t++)pf.fromBufferAttribute(this,t),pf.transformDirection(e),this.setXYZ(t,pf.x,pf.y,pf.z);return this}},{key:"set",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}},{key:"getComponent",value:function(e,t){var i=this.array[e*this.itemSize+t];return this.normalized&&(i=md(i,this.array)),i}},{key:"setComponent",value:function(e,t,i){return this.normalized&&(i=fd(i,this.array)),this.array[e*this.itemSize+t]=i,this}},{key:"getX",value:function(e){var t=this.array[e*this.itemSize];return this.normalized&&(t=md(t,this.array)),t}},{key:"setX",value:function(e,t){return this.normalized&&(t=fd(t,this.array)),this.array[e*this.itemSize]=t,this}},{key:"getY",value:function(e){var t=this.array[e*this.itemSize+1];return this.normalized&&(t=md(t,this.array)),t}},{key:"setY",value:function(e,t){return this.normalized&&(t=fd(t,this.array)),this.array[e*this.itemSize+1]=t,this}},{key:"getZ",value:function(e){var t=this.array[e*this.itemSize+2];return this.normalized&&(t=md(t,this.array)),t}},{key:"setZ",value:function(e,t){return this.normalized&&(t=fd(t,this.array)),this.array[e*this.itemSize+2]=t,this}},{key:"getW",value:function(e){var t=this.array[e*this.itemSize+3];return this.normalized&&(t=md(t,this.array)),t}},{key:"setW",value:function(e,t){return this.normalized&&(t=fd(t,this.array)),this.array[e*this.itemSize+3]=t,this}},{key:"setXY",value:function(e,t,i){return e*=this.itemSize,this.normalized&&(t=fd(t,this.array),i=fd(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}},{key:"setXYZ",value:function(e,t,i,n){return e*=this.itemSize,this.normalized&&(t=fd(t,this.array),i=fd(i,this.array),n=fd(n,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this}},{key:"setXYZW",value:function(e,t,i,n,o){return e*=this.itemSize,this.normalized&&(t=fd(t,this.array),i=fd(i,this.array),n=fd(n,this.array),o=fd(o,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=o,this}},{key:"onUpload",value:function(e){return this.onUploadCallback=e,this}},{key:"clone",value:function(){return new this.constructor(this.array,this.itemSize).copy(this)}},{key:"toJSON",value:function(){var e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==od&&(e.usage=this.usage),e}}])}(),ff=function(e){function t(e,i,n){return k()(this,t),Up(this,t,[new Uint16Array(e),i,n])}return un()(t,e),x()(t)}(mf),vf=function(e){function t(e,i,n){return k()(this,t),Up(this,t,[new Uint32Array(e),i,n])}return un()(t,e),x()(t)}(mf),gf=function(e){function t(e,i,n){return k()(this,t),Up(this,t,[new Float32Array(e),i,n])}return un()(t,e),x()(t)}(mf),yf=0,bf=new gm,Cf=new Wm,wf=new Hd,kf=new Wd,_f=new Wd,xf=new Hd,Ef=function(e){function t(){var e;return k()(this,t),(e=Up(this,t)).isBufferGeometry=!0,Object.defineProperty(Gp()(e),"id",{value:yf++}),e.uuid=ud(),e.name="",e.type="BufferGeometry",e.index=null,e.attributes={},e.morphAttributes={},e.morphTargetsRelative=!1,e.groups=[],e.boundingBox=null,e.boundingSphere=null,e.drawRange={start:0,count:1/0},e.userData={},e}return un()(t,e),x()(t,[{key:"getIndex",value:function(){return this.index}},{key:"setIndex",value:function(e){return Array.isArray(e)?this.index=new(bd(e)?vf:ff)(e,1):this.index=e,this}},{key:"getAttribute",value:function(e){return this.attributes[e]}},{key:"setAttribute",value:function(e,t){return this.attributes[e]=t,this}},{key:"deleteAttribute",value:function(e){return delete this.attributes[e],this}},{key:"hasAttribute",value:function(e){return void 0!==this.attributes[e]}},{key:"addGroup",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:i})}},{key:"clearGroups",value:function(){this.groups=[]}},{key:"setDrawRange",value:function(e,t){this.drawRange.start=e,this.drawRange.count=t}},{key:"applyMatrix4",value:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var i=this.attributes.normal;if(void 0!==i){var n=(new gd).getNormalMatrix(e);i.applyNormalMatrix(n),i.needsUpdate=!0}var o=this.attributes.tangent;return void 0!==o&&(o.transformDirection(e),o.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"applyQuaternion",value:function(e){return bf.makeRotationFromQuaternion(e),this.applyMatrix4(bf),this}},{key:"rotateX",value:function(e){return bf.makeRotationX(e),this.applyMatrix4(bf),this}},{key:"rotateY",value:function(e){return bf.makeRotationY(e),this.applyMatrix4(bf),this}},{key:"rotateZ",value:function(e){return bf.makeRotationZ(e),this.applyMatrix4(bf),this}},{key:"translate",value:function(e,t,i){return bf.makeTranslation(e,t,i),this.applyMatrix4(bf),this}},{key:"scale",value:function(e,t,i){return bf.makeScale(e,t,i),this.applyMatrix4(bf),this}},{key:"lookAt",value:function(e){return Cf.lookAt(e),Cf.updateMatrix(),this.applyMatrix4(Cf.matrix),this}},{key:"center",value:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(wf).negate(),this.translate(wf.x,wf.y,wf.z),this}},{key:"setFromPoints",value:function(e){for(var t=[],i=0,n=e.length;i<n;i++){var o=e[i];t.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new gf(t,3)),this}},{key:"computeBoundingBox",value:function(){null===this.boundingBox&&(this.boundingBox=new Wd);var e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new Hd(-1/0,-1/0,-1/0),new Hd(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var i=0,n=t.length;i<n;i++){var o=t[i];kf.setFromBufferAttribute(o),this.morphTargetsRelative?(xf.addVectors(this.boundingBox.min,kf.min),this.boundingBox.expandByPoint(xf),xf.addVectors(this.boundingBox.max,kf.max),this.boundingBox.expandByPoint(xf)):(this.boundingBox.expandByPoint(kf.min),this.boundingBox.expandByPoint(kf.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}},{key:"computeBoundingSphere",value:function(){null===this.boundingSphere&&(this.boundingSphere=new lm);var e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new Hd,1/0);if(e){var i=this.boundingSphere.center;if(kf.setFromBufferAttribute(e),t)for(var n=0,o=t.length;n<o;n++){var s=t[n];_f.setFromBufferAttribute(s),this.morphTargetsRelative?(xf.addVectors(kf.min,_f.min),kf.expandByPoint(xf),xf.addVectors(kf.max,_f.max),kf.expandByPoint(xf)):(kf.expandByPoint(_f.min),kf.expandByPoint(_f.max))}kf.getCenter(i);for(var a=0,r=0,l=e.count;r<l;r++)xf.fromBufferAttribute(e,r),a=Math.max(a,i.distanceToSquared(xf));if(t)for(var c=0,u=t.length;c<u;c++)for(var h=t[c],p=this.morphTargetsRelative,d=0,m=h.count;d<m;d++)xf.fromBufferAttribute(h,d),p&&(wf.fromBufferAttribute(e,d),xf.add(wf)),a=Math.max(a,i.distanceToSquared(xf));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}},{key:"computeTangents",value:function(){var e=this.index,t=this.attributes;if(null!==e&&void 0!==t.position&&void 0!==t.normal&&void 0!==t.uv){var i=t.position,n=t.normal,o=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new mf(new Float32Array(4*i.count),4));for(var s=this.getAttribute("tangent"),a=[],r=[],l=0;l<i.count;l++)a[l]=new Hd,r[l]=new Hd;var c=new Hd,u=new Hd,h=new Hd,p=new vd,d=new vd,m=new vd,f=new Hd,v=new Hd,g=this.groups;0===g.length&&(g=[{start:0,count:e.count}]);for(var y=0,b=g.length;y<b;++y)for(var C=g[y],w=C.start,k=w,_=w+C.count;k<_;k+=3)A(e.getX(k+0),e.getX(k+1),e.getX(k+2));for(var x=new Hd,E=new Hd,S=new Hd,P=new Hd,D=0,M=g.length;D<M;++D)for(var T=g[D],O=T.start,N=O,B=O+T.count;N<B;N+=3)L(e.getX(N+0)),L(e.getX(N+1)),L(e.getX(N+2))}else console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");function A(e,t,n){c.fromBufferAttribute(i,e),u.fromBufferAttribute(i,t),h.fromBufferAttribute(i,n),p.fromBufferAttribute(o,e),d.fromBufferAttribute(o,t),m.fromBufferAttribute(o,n),u.sub(c),h.sub(c),d.sub(p),m.sub(p);var s=1/(d.x*m.y-m.x*d.y);isFinite(s)&&(f.copy(u).multiplyScalar(m.y).addScaledVector(h,-d.y).multiplyScalar(s),v.copy(h).multiplyScalar(d.x).addScaledVector(u,-m.x).multiplyScalar(s),a[e].add(f),a[t].add(f),a[n].add(f),r[e].add(v),r[t].add(v),r[n].add(v))}function L(e){S.fromBufferAttribute(n,e),P.copy(S);var t=a[e];x.copy(t),x.sub(S.multiplyScalar(S.dot(t))).normalize(),E.crossVectors(P,t);var i=E.dot(r[e])<0?-1:1;s.setXYZW(e,x.x,x.y,x.z,i)}}},{key:"computeVertexNormals",value:function(){var e=this.index,t=this.getAttribute("position");if(void 0!==t){var i=this.getAttribute("normal");if(void 0===i)i=new mf(new Float32Array(3*t.count),3),this.setAttribute("normal",i);else for(var n=0,o=i.count;n<o;n++)i.setXYZ(n,0,0,0);var s=new Hd,a=new Hd,r=new Hd,l=new Hd,c=new Hd,u=new Hd,h=new Hd,p=new Hd;if(e)for(var d=0,m=e.count;d<m;d+=3){var f=e.getX(d+0),v=e.getX(d+1),g=e.getX(d+2);s.fromBufferAttribute(t,f),a.fromBufferAttribute(t,v),r.fromBufferAttribute(t,g),h.subVectors(r,a),p.subVectors(s,a),h.cross(p),l.fromBufferAttribute(i,f),c.fromBufferAttribute(i,v),u.fromBufferAttribute(i,g),l.add(h),c.add(h),u.add(h),i.setXYZ(f,l.x,l.y,l.z),i.setXYZ(v,c.x,c.y,c.z),i.setXYZ(g,u.x,u.y,u.z)}else for(var y=0,b=t.count;y<b;y+=3)s.fromBufferAttribute(t,y+0),a.fromBufferAttribute(t,y+1),r.fromBufferAttribute(t,y+2),h.subVectors(r,a),p.subVectors(s,a),h.cross(p),i.setXYZ(y+0,h.x,h.y,h.z),i.setXYZ(y+1,h.x,h.y,h.z),i.setXYZ(y+2,h.x,h.y,h.z);this.normalizeNormals(),i.needsUpdate=!0}}},{key:"normalizeNormals",value:function(){for(var e=this.attributes.normal,t=0,i=e.count;t<i;t++)xf.fromBufferAttribute(e,t),xf.normalize(),e.setXYZ(t,xf.x,xf.y,xf.z)}},{key:"toNonIndexed",value:function(){function e(e,t){for(var i=e.array,n=e.itemSize,o=e.normalized,s=new i.constructor(t.length*n),a=0,r=0,l=0,c=t.length;l<c;l++){a=e.isInterleavedBufferAttribute?t[l]*e.data.stride+e.offset:t[l]*n;for(var u=0;u<n;u++)s[r++]=i[a++]}return new mf(s,n,o)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;var i=new t,n=this.index.array,o=this.attributes;for(var s in o){var a=e(o[s],n);i.setAttribute(s,a)}var r=this.morphAttributes;for(var l in r){for(var c=[],u=r[l],h=0,p=u.length;h<p;h++){var d=e(u[h],n);c.push(d)}i.morphAttributes[l]=c}i.morphTargetsRelative=this.morphTargetsRelative;for(var m=this.groups,f=0,v=m.length;f<v;f++){var g=m[f];i.addGroup(g.start,g.count,g.materialIndex)}return i}},{key:"toJSON",value:function(){var e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};var n=this.index;null!==n&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});var o=this.attributes;for(var s in o){var a=o[s];e.data.attributes[s]=a.toJSON(e.data)}var r={},l=!1;for(var c in this.morphAttributes){for(var u=this.morphAttributes[c],h=[],p=0,d=u.length;p<d;p++){var m=u[p];h.push(m.toJSON(e.data))}h.length>0&&(r[c]=h,l=!0)}l&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);var f=this.groups;f.length>0&&(e.data.groups=JSON.parse(JSON.stringify(f)));var v=this.boundingSphere;return null!==v&&(e.data.boundingSphere={center:v.center.toArray(),radius:v.radius}),e}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var t={};this.name=e.name;var i=e.index;null!==i&&this.setIndex(i.clone(t));var n=e.attributes;for(var o in n){var s=n[o];this.setAttribute(o,s.clone(t))}var a=e.morphAttributes;for(var r in a){for(var l=[],c=a[r],u=0,h=c.length;u<h;u++)l.push(c[u].clone(t));this.morphAttributes[r]=l}this.morphTargetsRelative=e.morphTargetsRelative;for(var p=e.groups,d=0,m=p.length;d<m;d++){var f=p[d];this.addGroup(f.start,f.count,f.materialIndex)}var v=e.boundingBox;null!==v&&(this.boundingBox=v.clone());var g=e.boundingSphere;return null!==g&&(this.boundingSphere=g.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}}])}(rd),Sf=new gm,Pf=new vm,Df=new lm,Mf=new Hd,Tf=new Hd,Of=new Hd,Nf=new Hd,Bf=new Hd,Af=new Hd,Lf=new vd,If=new vd,jf=new vd,Rf=new Hd,Ff=new Hd,zf=new Hd,Hf=new Hd,Vf=new Hd,Gf=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ef,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new hf;return k()(this,t),(e=Up(this,t)).isMesh=!0,e.type="Mesh",e.geometry=i,e.material=n,e.updateMorphTargets(),e}return un()(t,e),x()(t,[{key:"copy",value:function(e,i){return Wp(t,"copy",this,3)([e,i]),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}},{key:"updateMorphTargets",value:function(){var e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){var i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var n=0,o=i.length;n<o;n++){var s=i[n].name||String(n);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=n}}}}},{key:"getVertexPosition",value:function(e,t){var i=this.geometry,n=i.attributes.position,o=i.morphAttributes.position,s=i.morphTargetsRelative;t.fromBufferAttribute(n,e);var a=this.morphTargetInfluences;if(o&&a){Af.set(0,0,0);for(var r=0,l=o.length;r<l;r++){var c=a[r],u=o[r];0!==c&&(Bf.fromBufferAttribute(u,e),s?Af.addScaledVector(Bf,c):Af.addScaledVector(Bf.sub(t),c))}t.add(Af)}return t}},{key:"raycast",value:function(e,t){var i=this.geometry,n=this.material,o=this.matrixWorld;if(void 0!==n){if(null===i.boundingSphere&&i.computeBoundingSphere(),Df.copy(i.boundingSphere),Df.applyMatrix4(o),Pf.copy(e.ray).recast(e.near),!1===Df.containsPoint(Pf.origin)){if(null===Pf.intersectSphere(Df,Mf))return;if(Pf.origin.distanceToSquared(Mf)>Math.pow(e.far-e.near,2))return}Sf.copy(o).invert(),Pf.copy(e.ray).applyMatrix4(Sf),null!==i.boundingBox&&!1===Pf.intersectsBox(i.boundingBox)||this._computeIntersections(e,t,Pf)}}},{key:"_computeIntersections",value:function(e,t,i){var n,o=this.geometry,s=this.material,a=o.index,r=o.attributes.position,l=o.attributes.uv,c=o.attributes.uv1,u=o.attributes.normal,h=o.groups,p=o.drawRange;if(null!==a)if(Array.isArray(s))for(var d=0,m=h.length;d<m;d++)for(var f=h[d],v=s[f.materialIndex],g=Math.max(f.start,p.start),y=Math.min(a.count,Math.min(f.start+f.count,p.start+p.count));g<y;g+=3)(n=Wf(this,v,e,i,l,c,u,a.getX(g),a.getX(g+1),a.getX(g+2)))&&(n.faceIndex=Math.floor(g/3),n.face.materialIndex=f.materialIndex,t.push(n));else for(var b=Math.max(0,p.start),C=Math.min(a.count,p.start+p.count);b<C;b+=3)(n=Wf(this,s,e,i,l,c,u,a.getX(b),a.getX(b+1),a.getX(b+2)))&&(n.faceIndex=Math.floor(b/3),t.push(n));else if(void 0!==r)if(Array.isArray(s))for(var w=0,k=h.length;w<k;w++)for(var _=h[w],x=s[_.materialIndex],E=Math.max(_.start,p.start),S=Math.min(r.count,Math.min(_.start+_.count,p.start+p.count));E<S;E+=3)(n=Wf(this,x,e,i,l,c,u,E,E+1,E+2))&&(n.faceIndex=Math.floor(E/3),n.face.materialIndex=_.materialIndex,t.push(n));else for(var P=Math.max(0,p.start),D=Math.min(r.count,p.start+p.count);P<D;P+=3)(n=Wf(this,s,e,i,l,c,u,P,P+1,P+2))&&(n.faceIndex=Math.floor(P/3),t.push(n))}}])}(Wm);function Wf(e,t,i,n,o,s,a,r,l,c){e.getVertexPosition(r,Tf),e.getVertexPosition(l,Of),e.getVertexPosition(c,Nf);var u=function(e,t,i,n,o,s,a,r){if(null===(1===t.side?n.intersectTriangle(a,s,o,!0,r):n.intersectTriangle(o,s,a,0===t.side,r)))return null;Vf.copy(r),Vf.applyMatrix4(e.matrixWorld);var l=i.ray.origin.distanceTo(Vf);return l<i.near||l>i.far?null:{distance:l,point:Vf.clone(),object:e}}(e,t,i,n,Tf,Of,Nf,Hf);if(u){o&&(Lf.fromBufferAttribute(o,r),If.fromBufferAttribute(o,l),jf.fromBufferAttribute(o,c),u.uv=tf.getInterpolation(Hf,Tf,Of,Nf,Lf,If,jf,new vd)),s&&(Lf.fromBufferAttribute(s,r),If.fromBufferAttribute(s,l),jf.fromBufferAttribute(s,c),u.uv1=tf.getInterpolation(Hf,Tf,Of,Nf,Lf,If,jf,new vd)),a&&(Rf.fromBufferAttribute(a,r),Ff.fromBufferAttribute(a,l),zf.fromBufferAttribute(a,c),u.normal=tf.getInterpolation(Hf,Tf,Of,Nf,Rf,Ff,zf,new Hd),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));var h={a:r,b:l,c:c,normal:new Hd,materialIndex:0};tf.getNormal(Tf,Of,Nf,h.normal),u.face=h}return u}var Uf=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;k()(this,t),(e=Up(this,t)).type="BoxGeometry",e.parameters={width:i,height:n,depth:o,widthSegments:s,heightSegments:a,depthSegments:r};var l=e;s=Math.floor(s),a=Math.floor(a),r=Math.floor(r);var c=[],u=[],h=[],p=[],d=0,m=0;function f(e,t,i,n,o,s,a,r,f,v,g){for(var y=s/f,b=a/v,C=s/2,w=a/2,k=r/2,_=f+1,x=v+1,E=0,S=0,P=new Hd,D=0;D<x;D++)for(var M=D*b-w,T=0;T<_;T++){var O=T*y-C;P[e]=O*n,P[t]=M*o,P[i]=k,u.push(P.x,P.y,P.z),P[e]=0,P[t]=0,P[i]=r>0?1:-1,h.push(P.x,P.y,P.z),p.push(T/f),p.push(1-D/v),E+=1}for(var N=0;N<v;N++)for(var B=0;B<f;B++){var A=d+B+_*N,L=d+B+_*(N+1),I=d+(B+1)+_*(N+1),j=d+(B+1)+_*N;c.push(A,L,j),c.push(L,I,j),S+=6}l.addGroup(m,S,g),m+=S,d+=E}return f("z","y","x",-1,-1,o,n,i,r,a,0),f("z","y","x",1,-1,o,n,-i,r,a,1),f("x","z","y",1,1,i,o,n,s,r,2),f("x","z","y",1,-1,i,o,-n,s,r,3),f("x","y","z",1,-1,i,n,o,s,a,4),f("x","y","z",-1,-1,i,n,-o,s,a,5),e.setIndex(c),e.setAttribute("position",new gf(u,3)),e.setAttribute("normal",new gf(h,3)),e.setAttribute("uv",new gf(p,2)),e}return un()(t,e),x()(t,[{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}])}(Ef);function Yf(e){var t={};for(var i in e)for(var n in t[i]={},e[i]){var o=e[i][n];o&&(o.isColor||o.isMatrix3||o.isMatrix4||o.isVector2||o.isVector3||o.isVector4||o.isTexture||o.isQuaternion)?o.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[i][n]=null):t[i][n]=o.clone():Array.isArray(o)?t[i][n]=o.slice():t[i][n]=o}return t}function Jf(e){for(var t={},i=0;i<e.length;i++){var n=Yf(e[i]);for(var o in n)t[o]=n[o]}return t}var qf=function(e){function t(){var e;return k()(this,t),(e=Up(this,t)).isCamera=!0,e.type="Camera",e.matrixWorldInverse=new gm,e.projectionMatrix=new gm,e.projectionMatrixInverse=new gm,e.coordinateSystem=sd,e}return un()(t,e),x()(t,[{key:"copy",value:function(e,i){return Wp(t,"copy",this,3)([e,i]),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}},{key:"getWorldDirection",value:function(e){return Wp(t,"getWorldDirection",this,3)([e]).negate()}},{key:"updateMatrixWorld",value:function(e){Wp(t,"updateMatrixWorld",this,3)([e]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"updateWorldMatrix",value:function(e,i){Wp(t,"updateWorldMatrix",this,3)([e,i]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(Wm),Xf=(new Hd,new vd,new vd,function(e){function t(e,i,n,o,s,a,r,l,c,u){var h;return k()(this,t),(h=Up(this,t,[e=void 0!==e?e:[],i=void 0!==i?i:301,n,o,s,a,r,l,c,u])).isCubeTexture=!0,h.flipY=!1,h}return un()(t,e),x()(t,[{key:"images",get:function(){return this.image},set:function(e){this.image=e}}])}(Id)),Zf=new Hd,Kf=new Hd,Qf=new gd,$f=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Hd(1,0,0),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,e),this.isPlane=!0,this.normal=t,this.constant=i}),[{key:"set",value:function(e,t){return this.normal.copy(e),this.constant=t,this}},{key:"setComponents",value:function(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}},{key:"setFromNormalAndCoplanarPoint",value:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(e,t,i){var n=Zf.subVectors(i,t).cross(Kf.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}},{key:"copy",value:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this}},{key:"normalize",value:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(e){return this.normal.dot(e)+this.constant}},{key:"distanceToSphere",value:function(e){return this.distanceToPoint(e.center)-e.radius}},{key:"projectPoint",value:function(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}},{key:"intersectLine",value:function(e,t){var i=e.delta(Zf),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;var o=-(e.start.dot(this.normal)+this.constant)/n;return o<0||o>1?null:t.copy(e.start).addScaledVector(i,o)}},{key:"intersectsLine",value:function(e){var t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}},{key:"intersectsBox",value:function(e){return e.intersectsPlane(this)}},{key:"intersectsSphere",value:function(e){return e.intersectsPlane(this)}},{key:"coplanarPoint",value:function(e){return e.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(e,t){var i=t||Qf.getNormalMatrix(e),n=this.coplanarPoint(Zf).applyMatrix4(e),o=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(o),this}},{key:"translate",value:function(e){return this.constant-=e.dot(this.normal),this}},{key:"equals",value:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),ev=new lm,tv=new Hd,iv=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new $f,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new $f,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new $f,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new $f,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new $f,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new $f;k()(this,e),this.planes=[t,i,n,o,s,a]}),[{key:"set",value:function(e,t,i,n,o,s){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(n),a[4].copy(o),a[5].copy(s),this}},{key:"copy",value:function(e){for(var t=this.planes,i=0;i<6;i++)t[i].copy(e.planes[i]);return this}},{key:"setFromProjectionMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=this.planes,n=e.elements,o=n[0],s=n[1],a=n[2],r=n[3],l=n[4],c=n[5],u=n[6],h=n[7],p=n[8],d=n[9],m=n[10],f=n[11],v=n[12],g=n[13],y=n[14],b=n[15];if(i[0].setComponents(r-o,h-l,f-p,b-v).normalize(),i[1].setComponents(r+o,h+l,f+p,b+v).normalize(),i[2].setComponents(r+s,h+c,f+d,b+g).normalize(),i[3].setComponents(r-s,h-c,f-d,b-g).normalize(),i[4].setComponents(r-a,h-u,f-m,b-y).normalize(),t===sd)i[5].setComponents(r+a,h+u,f+m,b+y).normalize();else{if(t!==ad)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);i[5].setComponents(a,u,m,y).normalize()}return this}},{key:"intersectsObject",value:function(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),ev.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{var t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),ev.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ev)}},{key:"intersectsSprite",value:function(e){return ev.center.set(0,0,0),ev.radius=.7071067811865476,ev.applyMatrix4(e.matrixWorld),this.intersectsSphere(ev)}},{key:"intersectsSphere",value:function(e){for(var t=this.planes,i=e.center,n=-e.radius,o=0;o<6;o++)if(t[o].distanceToPoint(i)<n)return!1;return!0}},{key:"intersectsBox",value:function(e){for(var t=this.planes,i=0;i<6;i++){var n=t[i];if(tv.x=n.normal.x>0?e.max.x:e.min.x,tv.y=n.normal.y>0?e.max.y:e.min.y,tv.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(tv)<0)return!1}return!0}},{key:"containsPoint",value:function(e){for(var t=this.planes,i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}();var nv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;k()(this,t),(e=Up(this,t)).type="PlaneGeometry",e.parameters={width:i,height:n,widthSegments:o,heightSegments:s};for(var a=i/2,r=n/2,l=Math.floor(o),c=Math.floor(s),u=l+1,h=c+1,p=i/l,d=n/c,m=[],f=[],v=[],g=[],y=0;y<h;y++)for(var b=y*d-r,C=0;C<u;C++){var w=C*p-a;f.push(w,-b,0),v.push(0,0,1),g.push(C/l),g.push(1-y/c)}for(var _=0;_<c;_++)for(var x=0;x<l;x++){var E=x+u*_,S=x+u*(_+1),P=x+1+u*(_+1),D=x+1+u*_;m.push(E,S,D),m.push(S,P,D)}return e.setIndex(m),e.setAttribute("position",new gf(f,3)),e.setAttribute("normal",new gf(v,3)),e.setAttribute("uv",new gf(g,2)),e}return un()(t,e),x()(t,[{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.width,e.height,e.widthSegments,e.heightSegments)}}])}(Ef),ov={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\tattribute float batchId;\n\tuniform highp sampler2D batchingTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( batchId );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[MORPHTARGETS_COUNT];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t#endif\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\t#ifndef USE_INSTANCING_MORPH\n\t\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\t#endif\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},sv={common:{diffuse:{value:new rf(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new gd},alphaMap:{value:null},alphaMapTransform:{value:new gd},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new gd}},envmap:{envMap:{value:null},envMapRotation:{value:new gd},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new gd}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new gd}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new gd},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new gd},normalScale:{value:new vd(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new gd},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new gd}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new gd}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new gd}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new rf(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new rf(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new gd},alphaTest:{value:0},uvTransform:{value:new gd}},sprite:{diffuse:{value:new rf(16777215)},opacity:{value:1},center:{value:new vd(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new gd},alphaMap:{value:null},alphaMapTransform:{value:new gd},alphaTest:{value:0}}},av={basic:{uniforms:Jf([sv.common,sv.specularmap,sv.envmap,sv.aomap,sv.lightmap,sv.fog]),vertexShader:ov.meshbasic_vert,fragmentShader:ov.meshbasic_frag},lambert:{uniforms:Jf([sv.common,sv.specularmap,sv.envmap,sv.aomap,sv.lightmap,sv.emissivemap,sv.bumpmap,sv.normalmap,sv.displacementmap,sv.fog,sv.lights,{emissive:{value:new rf(0)}}]),vertexShader:ov.meshlambert_vert,fragmentShader:ov.meshlambert_frag},phong:{uniforms:Jf([sv.common,sv.specularmap,sv.envmap,sv.aomap,sv.lightmap,sv.emissivemap,sv.bumpmap,sv.normalmap,sv.displacementmap,sv.fog,sv.lights,{emissive:{value:new rf(0)},specular:{value:new rf(1118481)},shininess:{value:30}}]),vertexShader:ov.meshphong_vert,fragmentShader:ov.meshphong_frag},standard:{uniforms:Jf([sv.common,sv.envmap,sv.aomap,sv.lightmap,sv.emissivemap,sv.bumpmap,sv.normalmap,sv.displacementmap,sv.roughnessmap,sv.metalnessmap,sv.fog,sv.lights,{emissive:{value:new rf(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ov.meshphysical_vert,fragmentShader:ov.meshphysical_frag},toon:{uniforms:Jf([sv.common,sv.aomap,sv.lightmap,sv.emissivemap,sv.bumpmap,sv.normalmap,sv.displacementmap,sv.gradientmap,sv.fog,sv.lights,{emissive:{value:new rf(0)}}]),vertexShader:ov.meshtoon_vert,fragmentShader:ov.meshtoon_frag},matcap:{uniforms:Jf([sv.common,sv.bumpmap,sv.normalmap,sv.displacementmap,sv.fog,{matcap:{value:null}}]),vertexShader:ov.meshmatcap_vert,fragmentShader:ov.meshmatcap_frag},points:{uniforms:Jf([sv.points,sv.fog]),vertexShader:ov.points_vert,fragmentShader:ov.points_frag},dashed:{uniforms:Jf([sv.common,sv.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ov.linedashed_vert,fragmentShader:ov.linedashed_frag},depth:{uniforms:Jf([sv.common,sv.displacementmap]),vertexShader:ov.depth_vert,fragmentShader:ov.depth_frag},normal:{uniforms:Jf([sv.common,sv.bumpmap,sv.normalmap,sv.displacementmap,{opacity:{value:1}}]),vertexShader:ov.meshnormal_vert,fragmentShader:ov.meshnormal_frag},sprite:{uniforms:Jf([sv.sprite,sv.fog]),vertexShader:ov.sprite_vert,fragmentShader:ov.sprite_frag},background:{uniforms:{uvTransform:{value:new gd},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ov.background_vert,fragmentShader:ov.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new gd}},vertexShader:ov.backgroundCube_vert,fragmentShader:ov.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ov.cube_vert,fragmentShader:ov.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ov.equirect_vert,fragmentShader:ov.equirect_frag},distanceRGBA:{uniforms:Jf([sv.common,sv.displacementmap,{referencePosition:{value:new Hd},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ov.distanceRGBA_vert,fragmentShader:ov.distanceRGBA_frag},shadow:{uniforms:Jf([sv.lights,sv.fog,{color:{value:new rf(0)},opacity:{value:1}}]),vertexShader:ov.shadow_vert,fragmentShader:ov.shadow_frag}};av.physical={uniforms:Jf([av.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new gd},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new gd},clearcoatNormalScale:{value:new vd(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new gd},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new gd},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new gd},sheen:{value:0},sheenColor:{value:new rf(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new gd},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new gd},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new gd},transmissionSamplerSize:{value:new vd},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new gd},attenuationDistance:{value:0},attenuationColor:{value:new rf(0)},specularColor:{value:new rf(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new gd},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new gd},anisotropyVector:{value:new vd},anisotropyMap:{value:null},anisotropyMapTransform:{value:new gd}}]),vertexShader:ov.meshphysical_vert,fragmentShader:ov.meshphysical_frag};new Pm,new gm;var rv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;return k()(this,t),(e=Up(this,t)).isOrthographicCamera=!0,e.type="OrthographicCamera",e.zoom=1,e.view=null,e.left=i,e.right=n,e.top=o,e.bottom=s,e.near=a,e.far=r,e.updateProjectionMatrix(),e}return un()(t,e),x()(t,[{key:"copy",value:function(e,i){return Wp(t,"copy",this,3)([e,i]),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}},{key:"setViewOffset",value:function(e,t,i,n,o,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,o=i-e,s=i+e,a=n+t,r=n-t;if(null!==this.view&&this.view.enabled){var l=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s=(o+=l*this.view.offsetX)+l*this.view.width,r=(a-=c*this.view.offsetY)-c*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,r,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var i=Wp(t,"toJSON",this,3)([e]);return i.object.zoom=this.zoom,i.object.left=this.left,i.object.right=this.right,i.object.top=this.top,i.object.bottom=this.bottom,i.object.near=this.near,i.object.far=this.far,null!==this.view&&(i.object.view=Object.assign({},this.view)),i}}])}(qf),lv=(new rv,new rf,(1+Math.sqrt(5))/2),cv=1/lv;new Hd(-lv,cv,0),new Hd(lv,cv,0),new Hd(-cv,0,lv),new Hd(cv,0,lv),new Hd(0,lv,-cv),new Hd(0,lv,cv),new Hd(-1,1,-1),new Hd(1,1,-1),new Hd(-1,1,1),new Hd(1,1,1);var uv=function(e){function t(e,i,n,o,s,a,r,l,c,u){var h;if(k()(this,t),1026!==(u=void 0!==u?u:1026)&&1027!==u)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");return void 0===n&&1026===u&&(n=Yp),void 0===n&&1027===u&&(n=Jp),(h=Up(this,t,[null,o,s,a,r,l,u,n,c])).isDepthTexture=!0,h.image={width:e,height:i},h.magFilter=void 0!==r?r:1003,h.minFilter=void 0!==l?l:1003,h.flipY=!1,h.generateMipmaps=!1,h.compareFunction=null,h}return un()(t,e),x()(t,[{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.compareFunction=e.compareFunction,this}},{key:"toJSON",value:function(e){var i=Wp(t,"toJSON",this,3)([e]);return null!==this.compareFunction&&(i.compareFunction=this.compareFunction),i}}])}(Id),hv=(new Id,new uv(1,1));hv.compareFunction=515;new Rd,new Fd,new Xf,new Float32Array(16),new Float32Array(9),new Float32Array(4);new Map;new Pm,new gm;new Hd,new Hd,new Hd,new Hd,new vd,new vd,new gm,new Hd,new Hd,new Hd,new vd,new vd,new vd;new Hd,new Hd,new Hd,new jd,new jd,new Hd,new gm,new Hd,new lm,new gm,new vm,new gm,new gm,new gm,new gm,new Wd,new gm,new Gf,new lm;var pv=function(){return x()((function e(){k()(this,e),this.index=0,this.pool=[],this.list=[]}),[{key:"push",value:function(e,t){var i=this.pool,n=this.list;this.index>=i.length&&i.push({start:-1,count:-1,z:-1});var o=i[this.index];n.push(o),this.index++,o.start=e.start,o.count=e.count,o.z=t}},{key:"reset",value:function(){this.list.length=0,this.index=0}}])}();new gm,new gm,new gm,new gm,new iv,new Wd,new lm,new Hd,new pv,new Gf;new Hd,new Hd,new gm,new vm,new lm,new Hd,new Hd;new Hd,new Hd,new gm,new vm,new lm,new Hd;var dv=function(){return x()((function e(){k()(this,e),this.type="Curve",this.arcLengthDivisions=200}),[{key:"getPoint",value:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}},{key:"getPointAt",value:function(e,t){var i=this.getUtoTmapping(e);return this.getPoint(i,t)}},{key:"getPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}},{key:"getSpacedPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}},{key:"getLength",value:function(){var e=this.getLengths();return e[e.length-1]}},{key:"getLengths",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,i=[],n=this.getPoint(0),o=0;i.push(0);for(var s=1;s<=e;s++)o+=(t=this.getPoint(s/e)).distanceTo(n),i.push(o),n=t;return this.cacheArcLengths=i,i}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.getLengths()}},{key:"getUtoTmapping",value:function(e,t){var i,n=this.getLengths(),o=0,s=n.length;i=t||e*n[s-1];for(var a,r=0,l=s-1;r<=l;)if((a=n[o=Math.floor(r+(l-r)/2)]-i)<0)r=o+1;else{if(!(a>0)){l=o;break}l=o-1}if(n[o=l]===i)return o/(s-1);var c=n[o];return(o+(i-c)/(n[o+1]-c))/(s-1)}},{key:"getTangent",value:function(e,t){var i=1e-4,n=e-i,o=e+i;n<0&&(n=0),o>1&&(o=1);var s=this.getPoint(n),a=this.getPoint(o),r=t||(s.isVector2?new vd:new Hd);return r.copy(a).sub(s).normalize(),r}},{key:"getTangentAt",value:function(e,t){var i=this.getUtoTmapping(e);return this.getTangent(i,t)}},{key:"computeFrenetFrames",value:function(e,t){for(var i=new Hd,n=[],o=[],s=[],a=new Hd,r=new gm,l=0;l<=e;l++){var c=l/e;n[l]=this.getTangentAt(c,new Hd)}o[0]=new Hd,s[0]=new Hd;var u=Number.MAX_VALUE,h=Math.abs(n[0].x),p=Math.abs(n[0].y),d=Math.abs(n[0].z);h<=u&&(u=h,i.set(1,0,0)),p<=u&&(u=p,i.set(0,1,0)),d<=u&&i.set(0,0,1),a.crossVectors(n[0],i).normalize(),o[0].crossVectors(n[0],a),s[0].crossVectors(n[0],o[0]);for(var m=1;m<=e;m++){if(o[m]=o[m-1].clone(),s[m]=s[m-1].clone(),a.crossVectors(n[m-1],n[m]),a.length()>Number.EPSILON){a.normalize();var f=Math.acos(hd(n[m-1].dot(n[m]),-1,1));o[m].applyMatrix4(r.makeRotationAxis(a,f))}s[m].crossVectors(n[m],o[m])}if(!0===t){var v=Math.acos(hd(o[0].dot(o[e]),-1,1));v/=e,n[0].dot(a.crossVectors(o[0],o[e]))>0&&(v=-v);for(var g=1;g<=e;g++)o[g].applyMatrix4(r.makeRotationAxis(n[g],v*g)),s[g].crossVectors(n[g],o[g])}return{tangents:n,normals:o,binormals:s}}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},{key:"toJSON",value:function(){var e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}},{key:"fromJSON",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}])}(),mv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI,l=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;return k()(this,t),(e=Up(this,t)).isEllipseCurve=!0,e.type="EllipseCurve",e.aX=i,e.aY=n,e.xRadius=o,e.yRadius=s,e.aStartAngle=a,e.aEndAngle=r,e.aClockwise=l,e.aRotation=c,e}return un()(t,e),x()(t,[{key:"getPoint",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new vd,i=t,n=2*Math.PI,o=this.aEndAngle-this.aStartAngle,s=Math.abs(o)<Number.EPSILON;o<0;)o+=n;for(;o>n;)o-=n;o<Number.EPSILON&&(o=s?0:n),!0!==this.aClockwise||s||(o===n?o=-n:o-=n);var a=this.aStartAngle+e*o,r=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var c=Math.cos(this.aRotation),u=Math.sin(this.aRotation),h=r-this.aX,p=l-this.aY;r=h*c-p*u+this.aX,l=h*u+p*c+this.aY}return i.set(r,l)}},{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}},{key:"toJSON",value:function(){var e=Wp(t,"toJSON",this,3)([]);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}},{key:"fromJSON",value:function(e){return Wp(t,"fromJSON",this,3)([e]),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}])}(dv),fv=function(e){function t(e,i,n,o,s,a){var r;return k()(this,t),(r=Up(this,t,[e,i,n,n,o,s,a])).isArcCurve=!0,r.type="ArcCurve",r}return un()(t,e),x()(t)}(mv);function vv(){var e=0,t=0,i=0,n=0;function o(o,s,a,r){e=o,t=a,i=-3*o+3*s-2*a-r,n=2*o-2*s+a+r}return{initCatmullRom:function(e,t,i,n,s){o(t,i,s*(i-e),s*(n-t))},initNonuniformCatmullRom:function(e,t,i,n,s,a,r){var l=(t-e)/s-(i-e)/(s+a)+(i-t)/a,c=(i-t)/a-(n-t)/(a+r)+(n-i)/r;o(t,i,l*=a,c*=a)},calc:function(o){var s=o*o;return e+t*o+i*s+n*(s*o)}}}var gv=new Hd,yv=new vv,bv=new vv,Cv=new vv,wv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;return k()(this,t),(e=Up(this,t)).isCatmullRomCurve3=!0,e.type="CatmullRomCurve3",e.points=i,e.closed=n,e.curveType=o,e.tension=s,e}return un()(t,e),x()(t,[{key:"getPoint",value:function(e){var t,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Hd,o=n,s=this.points,a=s.length,r=(a-(this.closed?0:1))*e,l=Math.floor(r),c=r-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/a)+1)*a:0===c&&l===a-1&&(l=a-2,c=1),this.closed||l>0?t=s[(l-1)%a]:(gv.subVectors(s[0],s[1]).add(s[0]),t=gv);var u=s[l%a],h=s[(l+1)%a];if(this.closed||l+2<a?i=s[(l+2)%a]:(gv.subVectors(s[a-1],s[a-2]).add(s[a-1]),i=gv),"centripetal"===this.curveType||"chordal"===this.curveType){var p="chordal"===this.curveType?.5:.25,d=Math.pow(t.distanceToSquared(u),p),m=Math.pow(u.distanceToSquared(h),p),f=Math.pow(h.distanceToSquared(i),p);m<1e-4&&(m=1),d<1e-4&&(d=m),f<1e-4&&(f=m),yv.initNonuniformCatmullRom(t.x,u.x,h.x,i.x,d,m,f),bv.initNonuniformCatmullRom(t.y,u.y,h.y,i.y,d,m,f),Cv.initNonuniformCatmullRom(t.z,u.z,h.z,i.z,d,m,f)}else"catmullrom"===this.curveType&&(yv.initCatmullRom(t.x,u.x,h.x,i.x,this.tension),bv.initCatmullRom(t.y,u.y,h.y,i.y,this.tension),Cv.initCatmullRom(t.z,u.z,h.z,i.z,this.tension));return o.set(yv.calc(c),bv.calc(c),Cv.calc(c)),o}},{key:"copy",value:function(e){Wp(t,"copy",this,3)([e]),this.points=[];for(var i=0,n=e.points.length;i<n;i++){var o=e.points[i];this.points.push(o.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}},{key:"toJSON",value:function(){var e=Wp(t,"toJSON",this,3)([]);e.points=[];for(var i=0,n=this.points.length;i<n;i++){var o=this.points[i];e.points.push(o.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}},{key:"fromJSON",value:function(e){Wp(t,"fromJSON",this,3)([e]),this.points=[];for(var i=0,n=e.points.length;i<n;i++){var o=e.points[i];this.points.push((new Hd).fromArray(o))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}])}(dv);function kv(e,t,i,n,o){var s=.5*(n-t),a=.5*(o-i),r=e*e;return(2*i-2*n+s+a)*(e*r)+(-3*i+3*n-2*s-a)*r+s*e+i}function _v(e,t,i,n){return function(e,t){var i=1-e;return i*i*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,i)+function(e,t){return e*e*t}(e,n)}function xv(e,t,i,n,o){return function(e,t){var i=1-e;return i*i*i*t}(e,t)+function(e,t){var i=1-e;return 3*i*i*e*t}(e,i)+function(e,t){return 3*(1-e)*e*e*t}(e,n)+function(e,t){return e*e*e*t}(e,o)}var Ev=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new vd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new vd,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new vd,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new vd;return k()(this,t),(e=Up(this,t)).isCubicBezierCurve=!0,e.type="CubicBezierCurve",e.v0=i,e.v1=n,e.v2=o,e.v3=s,e}return un()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new vd,i=t,n=this.v0,o=this.v1,s=this.v2,a=this.v3;return i.set(xv(e,n.x,o.x,s.x,a.x),xv(e,n.y,o.y,s.y,a.y)),i}},{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=Wp(t,"toJSON",this,3)([]);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return Wp(t,"fromJSON",this,3)([e]),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}])}(dv),Sv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Hd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Hd,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Hd,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Hd;return k()(this,t),(e=Up(this,t)).isCubicBezierCurve3=!0,e.type="CubicBezierCurve3",e.v0=i,e.v1=n,e.v2=o,e.v3=s,e}return un()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Hd,i=t,n=this.v0,o=this.v1,s=this.v2,a=this.v3;return i.set(xv(e,n.x,o.x,s.x,a.x),xv(e,n.y,o.y,s.y,a.y),xv(e,n.z,o.z,s.z,a.z)),i}},{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=Wp(t,"toJSON",this,3)([]);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return Wp(t,"fromJSON",this,3)([e]),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}])}(dv),Pv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new vd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new vd;return k()(this,t),(e=Up(this,t)).isLineCurve=!0,e.type="LineCurve",e.v1=i,e.v2=n,e}return un()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new vd,i=t;return 1===e?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"getTangent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new vd;return t.subVectors(this.v2,this.v1).normalize()}},{key:"getTangentAt",value:function(e,t){return this.getTangent(e,t)}},{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=Wp(t,"toJSON",this,3)([]);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return Wp(t,"fromJSON",this,3)([e]),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}])}(dv),Dv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Hd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Hd;return k()(this,t),(e=Up(this,t)).isLineCurve3=!0,e.type="LineCurve3",e.v1=i,e.v2=n,e}return un()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Hd,i=t;return 1===e?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"getTangent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Hd;return t.subVectors(this.v2,this.v1).normalize()}},{key:"getTangentAt",value:function(e,t){return this.getTangent(e,t)}},{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=Wp(t,"toJSON",this,3)([]);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return Wp(t,"fromJSON",this,3)([e]),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}])}(dv),Mv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new vd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new vd,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new vd;return k()(this,t),(e=Up(this,t)).isQuadraticBezierCurve=!0,e.type="QuadraticBezierCurve",e.v0=i,e.v1=n,e.v2=o,e}return un()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new vd,i=t,n=this.v0,o=this.v1,s=this.v2;return i.set(_v(e,n.x,o.x,s.x),_v(e,n.y,o.y,s.y)),i}},{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=Wp(t,"toJSON",this,3)([]);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return Wp(t,"fromJSON",this,3)([e]),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}])}(dv),Tv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Hd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Hd,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Hd;return k()(this,t),(e=Up(this,t)).isQuadraticBezierCurve3=!0,e.type="QuadraticBezierCurve3",e.v0=i,e.v1=n,e.v2=o,e}return un()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Hd,i=t,n=this.v0,o=this.v1,s=this.v2;return i.set(_v(e,n.x,o.x,s.x),_v(e,n.y,o.y,s.y),_v(e,n.z,o.z,s.z)),i}},{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=Wp(t,"toJSON",this,3)([]);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return Wp(t,"fromJSON",this,3)([e]),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}])}(dv),Ov=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return k()(this,t),(e=Up(this,t)).isSplineCurve=!0,e.type="SplineCurve",e.points=i,e}return un()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new vd,i=t,n=this.points,o=(n.length-1)*e,s=Math.floor(o),a=o-s,r=n[0===s?s:s-1],l=n[s],c=n[s>n.length-2?n.length-1:s+1],u=n[s>n.length-3?n.length-1:s+2];return i.set(kv(a,r.x,l.x,c.x,u.x),kv(a,r.y,l.y,c.y,u.y)),i}},{key:"copy",value:function(e){Wp(t,"copy",this,3)([e]),this.points=[];for(var i=0,n=e.points.length;i<n;i++){var o=e.points[i];this.points.push(o.clone())}return this}},{key:"toJSON",value:function(){var e=Wp(t,"toJSON",this,3)([]);e.points=[];for(var i=0,n=this.points.length;i<n;i++){var o=this.points[i];e.points.push(o.toArray())}return e}},{key:"fromJSON",value:function(e){Wp(t,"fromJSON",this,3)([e]),this.points=[];for(var i=0,n=e.points.length;i<n;i++){var o=e.points[i];this.points.push((new vd).fromArray(o))}return this}}])}(dv),Nv=Object.freeze({__proto__:null,ArcCurve:fv,CatmullRomCurve3:wv,CubicBezierCurve:Ev,CubicBezierCurve3:Sv,EllipseCurve:mv,LineCurve:Pv,LineCurve3:Dv,QuadraticBezierCurve:Mv,QuadraticBezierCurve3:Tv,SplineCurve:Ov}),Bv=function(e){function t(e){var i;return k()(this,t),(i=Up(this,t)).type="Path",i.currentPoint=new vd,e&&i.setFromPoints(e),i}return un()(t,e),x()(t,[{key:"setFromPoints",value:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}},{key:"moveTo",value:function(e,t){return this.currentPoint.set(e,t),this}},{key:"lineTo",value:function(e,t){var i=new Pv(this.currentPoint.clone(),new vd(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}},{key:"quadraticCurveTo",value:function(e,t,i,n){var o=new Mv(this.currentPoint.clone(),new vd(e,t),new vd(i,n));return this.curves.push(o),this.currentPoint.set(i,n),this}},{key:"bezierCurveTo",value:function(e,t,i,n,o,s){var a=new Ev(this.currentPoint.clone(),new vd(e,t),new vd(i,n),new vd(o,s));return this.curves.push(a),this.currentPoint.set(o,s),this}},{key:"splineThru",value:function(e){var t=[this.currentPoint.clone()].concat(e),i=new Ov(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}},{key:"arc",value:function(e,t,i,n,o,s){var a=this.currentPoint.x,r=this.currentPoint.y;return this.absarc(e+a,t+r,i,n,o,s),this}},{key:"absarc",value:function(e,t,i,n,o,s){return this.absellipse(e,t,i,i,n,o,s),this}},{key:"ellipse",value:function(e,t,i,n,o,s,a,r){var l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,i,n,o,s,a,r),this}},{key:"absellipse",value:function(e,t,i,n,o,s,a,r){var l=new mv(e,t,i,n,o,s,a,r);if(this.curves.length>0){var c=l.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(l);var u=l.getPoint(1);return this.currentPoint.copy(u),this}},{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.currentPoint.copy(e.currentPoint),this}},{key:"toJSON",value:function(){var e=Wp(t,"toJSON",this,3)([]);return e.currentPoint=this.currentPoint.toArray(),e}},{key:"fromJSON",value:function(e){return Wp(t,"fromJSON",this,3)([e]),this.currentPoint.fromArray(e.currentPoint),this}}])}(function(e){function t(){var e;return k()(this,t),(e=Up(this,t)).type="CurvePath",e.curves=[],e.autoClose=!1,e}return un()(t,e),x()(t,[{key:"add",value:function(e){this.curves.push(e)}},{key:"closePath",value:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){var i=!0===e.isVector2?"LineCurve":"LineCurve3";this.curves.push(new Nv[i](t,e))}return this}},{key:"getPoint",value:function(e,t){for(var i=e*this.getLength(),n=this.getCurveLengths(),o=0;o<n.length;){if(n[o]>=i){var s=n[o]-i,a=this.curves[o],r=a.getLength(),l=0===r?0:1-s/r;return a.getPointAt(l,t)}o++}return null}},{key:"getLength",value:function(){var e=this.getCurveLengths();return e[e.length-1]}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}},{key:"getCurveLengths",value:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,i=0,n=this.curves.length;i<n;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}},{key:"getSpacedPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40,t=[],i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}},{key:"getPoints",value:function(){for(var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,i=[],n=0,o=this.curves;n<o.length;n++)for(var s=o[n],a=s.isEllipseCurve?2*t:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?t*s.points.length:t,r=s.getPoints(a),l=0;l<r.length;l++){var c=r[l];e&&e.equals(c)||(i.push(c),e=c)}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}},{key:"copy",value:function(e){Wp(t,"copy",this,3)([e]),this.curves=[];for(var i=0,n=e.curves.length;i<n;i++){var o=e.curves[i];this.curves.push(o.clone())}return this.autoClose=e.autoClose,this}},{key:"toJSON",value:function(){var e=Wp(t,"toJSON",this,3)([]);e.autoClose=this.autoClose,e.curves=[];for(var i=0,n=this.curves.length;i<n;i++){var o=this.curves[i];e.curves.push(o.toJSON())}return e}},{key:"fromJSON",value:function(e){Wp(t,"fromJSON",this,3)([e]),this.autoClose=e.autoClose,this.curves=[];for(var i=0,n=e.curves.length;i<n;i++){var o=e.curves[i];this.curves.push((new Nv[o.type]).fromJSON(o))}return this}}])}(dv)),Av=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[new vd(0,-.5),new vd(.5,0),new vd(0,.5)],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;k()(this,t),(e=Up(this,t)).type="LatheGeometry",e.parameters={points:i,segments:n,phiStart:o,phiLength:s},n=Math.floor(n),s=hd(s,0,2*Math.PI);for(var a=[],r=[],l=[],c=[],u=[],h=1/n,p=new Hd,d=new vd,m=new Hd,f=new Hd,v=new Hd,g=0,y=0,b=0;b<=i.length-1;b++)switch(b){case 0:g=i[b+1].x-i[b].x,y=i[b+1].y-i[b].y,m.x=1*y,m.y=-g,m.z=0*y,v.copy(m),m.normalize(),c.push(m.x,m.y,m.z);break;case i.length-1:c.push(v.x,v.y,v.z);break;default:g=i[b+1].x-i[b].x,y=i[b+1].y-i[b].y,m.x=1*y,m.y=-g,m.z=0*y,f.copy(m),m.x+=v.x,m.y+=v.y,m.z+=v.z,m.normalize(),c.push(m.x,m.y,m.z),v.copy(f)}for(var C=0;C<=n;C++)for(var w=o+C*h*s,_=Math.sin(w),x=Math.cos(w),E=0;E<=i.length-1;E++){p.x=i[E].x*_,p.y=i[E].y,p.z=i[E].x*x,r.push(p.x,p.y,p.z),d.x=C/n,d.y=E/(i.length-1),l.push(d.x,d.y);var S=c[3*E+0]*_,P=c[3*E+1],D=c[3*E+0]*x;u.push(S,P,D)}for(var M=0;M<n;M++)for(var T=0;T<i.length-1;T++){var O=T+M*i.length,N=O,B=O+i.length,A=O+i.length+1,L=O+1;a.push(N,B,L),a.push(A,L,B)}return e.setIndex(a),e.setAttribute("position",new gf(r,3)),e.setAttribute("uv",new gf(l,2)),e.setAttribute("normal",new gf(u,3)),e}return un()(t,e),x()(t,[{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.points,e.segments,e.phiStart,e.phiLength)}}])}(Ef),Lv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;k()(this,t);var a=new Bv;return a.absarc(0,-n/2,i,1.5*Math.PI,0),a.absarc(0,n/2,i,0,.5*Math.PI),(e=Up(this,t,[a.getPoints(o),s])).type="CapsuleGeometry",e.parameters={radius:i,length:n,capSegments:o,radialSegments:s},e}return un()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.length,e.capSegments,e.radialSegments)}}])}(Av),Iv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;k()(this,t),(e=Up(this,t)).type="CircleGeometry",e.parameters={radius:i,segments:n,thetaStart:o,thetaLength:s},n=Math.max(3,n);var a=[],r=[],l=[],c=[],u=new Hd,h=new vd;r.push(0,0,0),l.push(0,0,1),c.push(.5,.5);for(var p=0,d=3;p<=n;p++,d+=3){var m=o+p/n*s;u.x=i*Math.cos(m),u.y=i*Math.sin(m),r.push(u.x,u.y,u.z),l.push(0,0,1),h.x=(r[d]/i+1)/2,h.y=(r[d+1]/i+1)/2,c.push(h.x,h.y)}for(var f=1;f<=n;f++)a.push(f,f+1,0);return e.setIndex(a),e.setAttribute("position",new gf(r,3)),e.setAttribute("normal",new gf(l,3)),e.setAttribute("uv",new gf(c,2)),e}return un()(t,e),x()(t,[{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radius,e.segments,e.thetaStart,e.thetaLength)}}])}(Ef),jv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:32,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;k()(this,t),(e=Up(this,t)).type="CylinderGeometry",e.parameters={radiusTop:i,radiusBottom:n,height:o,radialSegments:s,heightSegments:a,openEnded:r,thetaStart:l,thetaLength:c};var u=e;s=Math.floor(s),a=Math.floor(a);var h=[],p=[],d=[],m=[],f=0,v=[],g=o/2,y=0;function b(e){for(var t=f,o=new vd,a=new Hd,r=0,v=!0===e?i:n,b=!0===e?1:-1,C=1;C<=s;C++)p.push(0,g*b,0),d.push(0,b,0),m.push(.5,.5),f++;for(var w=f,k=0;k<=s;k++){var _=k/s*c+l,x=Math.cos(_),E=Math.sin(_);a.x=v*E,a.y=g*b,a.z=v*x,p.push(a.x,a.y,a.z),d.push(0,b,0),o.x=.5*x+.5,o.y=.5*E*b+.5,m.push(o.x,o.y),f++}for(var S=0;S<s;S++){var P=t+S,D=w+S;!0===e?h.push(D,D+1,P):h.push(D+1,D,P),r+=3}u.addGroup(y,r,!0===e?1:2),y+=r}return function(){for(var e=new Hd,t=new Hd,r=0,b=(n-i)/o,C=0;C<=a;C++){for(var w=[],k=C/a,_=k*(n-i)+i,x=0;x<=s;x++){var E=x/s,S=E*c+l,P=Math.sin(S),D=Math.cos(S);t.x=_*P,t.y=-k*o+g,t.z=_*D,p.push(t.x,t.y,t.z),e.set(P,b,D).normalize(),d.push(e.x,e.y,e.z),m.push(E,1-k),w.push(f++)}v.push(w)}for(var M=0;M<s;M++)for(var T=0;T<a;T++){var O=v[T][M],N=v[T+1][M],B=v[T+1][M+1],A=v[T][M+1];h.push(O,N,A),h.push(N,B,A),r+=6}u.addGroup(y,r,0),y+=r}(),!1===r&&(i>0&&b(!0),n>0&&b(!1)),e.setIndex(h),e.setAttribute("position",new gf(p,3)),e.setAttribute("normal",new gf(d,3)),e.setAttribute("uv",new gf(m,2)),e}return un()(t,e),x()(t,[{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}])}(Ef),Rv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;return k()(this,t),(e=Up(this,t,[0,i,n,o,s,a,r,l])).type="ConeGeometry",e.parameters={radius:i,height:n,radialSegments:o,heightSegments:s,openEnded:a,thetaStart:r,thetaLength:l},e}return un()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}])}(jv),Fv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;k()(this,t),(e=Up(this,t)).type="PolyhedronGeometry",e.parameters={vertices:i,indices:n,radius:o,detail:s};var a=[],r=[];function l(e,t,i,n){for(var o=n+1,s=[],a=0;a<=o;a++){s[a]=[];for(var r=e.clone().lerp(i,a/o),l=t.clone().lerp(i,a/o),u=o-a,h=0;h<=u;h++)s[a][h]=0===h&&a===o?r:r.clone().lerp(l,h/u)}for(var p=0;p<o;p++)for(var d=0;d<2*(o-p)-1;d++){var m=Math.floor(d/2);d%2==0?(c(s[p][m+1]),c(s[p+1][m]),c(s[p][m])):(c(s[p][m+1]),c(s[p+1][m+1]),c(s[p+1][m]))}}function c(e){a.push(e.x,e.y,e.z)}function u(e,t){var n=3*e;t.x=i[n+0],t.y=i[n+1],t.z=i[n+2]}function h(e,t,i,n){n<0&&1===e.x&&(r[t]=e.x-1),0===i.x&&0===i.z&&(r[t]=n/2/Math.PI+.5)}function p(e){return Math.atan2(e.z,-e.x)}return function(e){for(var t=new Hd,i=new Hd,o=new Hd,s=0;s<n.length;s+=3)u(n[s+0],t),u(n[s+1],i),u(n[s+2],o),l(t,i,o,e)}(s),function(e){for(var t=new Hd,i=0;i<a.length;i+=3)t.x=a[i+0],t.y=a[i+1],t.z=a[i+2],t.normalize().multiplyScalar(e),a[i+0]=t.x,a[i+1]=t.y,a[i+2]=t.z}(o),function(){for(var e,t=new Hd,i=0;i<a.length;i+=3){t.x=a[i+0],t.y=a[i+1],t.z=a[i+2];var n=p(t)/2/Math.PI+.5,o=(e=t,Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))/Math.PI+.5);r.push(n,1-o)}(function(){for(var e=new Hd,t=new Hd,i=new Hd,n=new Hd,o=new vd,s=new vd,l=new vd,c=0,u=0;c<a.length;c+=9,u+=6){e.set(a[c+0],a[c+1],a[c+2]),t.set(a[c+3],a[c+4],a[c+5]),i.set(a[c+6],a[c+7],a[c+8]),o.set(r[u+0],r[u+1]),s.set(r[u+2],r[u+3]),l.set(r[u+4],r[u+5]),n.copy(e).add(t).add(i).divideScalar(3);var d=p(n);h(o,u+0,e,d),h(s,u+2,t,d),h(l,u+4,i,d)}})(),function(){for(var e=0;e<r.length;e+=6){var t=r[e+0],i=r[e+2],n=r[e+4],o=Math.max(t,i,n),s=Math.min(t,i,n);o>.9&&s<.1&&(t<.2&&(r[e+0]+=1),i<.2&&(r[e+2]+=1),n<.2&&(r[e+4]+=1))}}()}(),e.setAttribute("position",new gf(a,3)),e.setAttribute("normal",new gf(a.slice(),3)),e.setAttribute("uv",new gf(r,2)),0===s?e.computeVertexNormals():e.normalizeNormals(),e}return un()(t,e),x()(t,[{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.vertices,e.indices,e.radius,e.details)}}])}(Ef),zv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,t);var o=(1+Math.sqrt(5))/2,s=1/o;return(e=Up(this,t,[[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-o,0,-s,o,0,s,-o,0,s,o,-s,-o,0,-s,o,0,s,-o,0,s,o,0,-o,0,-s,o,0,-s,-o,0,s,o,0,s],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],i,n])).type="DodecahedronGeometry",e.parameters={radius:i,detail:n},e}return un()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.detail)}}])}(Fv),Hv=new Hd,Vv=new Hd,Gv=new Hd,Wv=new tf,Uv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(k()(this,t),(e=Up(this,t)).type="EdgesGeometry",e.parameters={geometry:i,thresholdAngle:n},null!==i){for(var o=4,s=Math.pow(10,o),a=Math.cos(cd*n),r=i.getIndex(),l=i.getAttribute("position"),c=r?r.count:l.count,u=[0,0,0],h=["a","b","c"],p=new Array(3),d={},m=[],f=0;f<c;f+=3){r?(u[0]=r.getX(f),u[1]=r.getX(f+1),u[2]=r.getX(f+2)):(u[0]=f,u[1]=f+1,u[2]=f+2);var v=Wv.a,g=Wv.b,y=Wv.c;if(v.fromBufferAttribute(l,u[0]),g.fromBufferAttribute(l,u[1]),y.fromBufferAttribute(l,u[2]),Wv.getNormal(Gv),p[0]="".concat(Math.round(v.x*s),",").concat(Math.round(v.y*s),",").concat(Math.round(v.z*s)),p[1]="".concat(Math.round(g.x*s),",").concat(Math.round(g.y*s),",").concat(Math.round(g.z*s)),p[2]="".concat(Math.round(y.x*s),",").concat(Math.round(y.y*s),",").concat(Math.round(y.z*s)),p[0]!==p[1]&&p[1]!==p[2]&&p[2]!==p[0])for(var b=0;b<3;b++){var C=(b+1)%3,w=p[b],_=p[C],x=Wv[h[b]],E=Wv[h[C]],S="".concat(w,"_").concat(_),P="".concat(_,"_").concat(w);P in d&&d[P]?(Gv.dot(d[P].normal)<=a&&(m.push(x.x,x.y,x.z),m.push(E.x,E.y,E.z)),d[P]=null):S in d||(d[S]={index0:u[b],index1:u[C],normal:Gv.clone()})}}for(var D in d)if(d[D]){var M=d[D],T=M.index0,O=M.index1;Hv.fromBufferAttribute(l,T),Vv.fromBufferAttribute(l,O),m.push(Hv.x,Hv.y,Hv.z),m.push(Vv.x,Vv.y,Vv.z)}e.setAttribute("position",new gf(m,3))}return e}return un()(t,e),x()(t,[{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}])}(Ef),Yv=function(e){function t(e){var i;return k()(this,t),(i=Up(this,t,[e])).uuid=ud(),i.type="Shape",i.holes=[],i}return un()(t,e),x()(t,[{key:"getPointsHoles",value:function(e){for(var t=[],i=0,n=this.holes.length;i<n;i++)t[i]=this.holes[i].getPoints(e);return t}},{key:"extractPoints",value:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}},{key:"copy",value:function(e){Wp(t,"copy",this,3)([e]),this.holes=[];for(var i=0,n=e.holes.length;i<n;i++){var o=e.holes[i];this.holes.push(o.clone())}return this}},{key:"toJSON",value:function(){var e=Wp(t,"toJSON",this,3)([]);e.uuid=this.uuid,e.holes=[];for(var i=0,n=this.holes.length;i<n;i++){var o=this.holes[i];e.holes.push(o.toJSON())}return e}},{key:"fromJSON",value:function(e){Wp(t,"fromJSON",this,3)([e]),this.uuid=e.uuid,this.holes=[];for(var i=0,n=e.holes.length;i<n;i++){var o=e.holes[i];this.holes.push((new Bv).fromJSON(o))}return this}}])}(Bv);function Jv(e,t,i,n,o){var s,a;if(o===function(e,t,i,n){for(var o=0,s=t,a=i-n;s<i;s+=n)o+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return o}(e,t,i,n)>0)for(s=t;s<i;s+=n)a=mg(s,e[s],e[s+1],a);else for(s=i-n;s>=t;s-=n)a=mg(s,e[s],e[s+1],a);return a&&lg(a,a.next)&&(fg(a),a=a.next),a}function qv(e,t){if(!e)return e;t||(t=e);var i,n=e;do{if(i=!1,n.steiner||!lg(n,n.next)&&0!==rg(n.prev,n,n.next))n=n.next;else{if(fg(n),(n=t=n.prev)===n.next)break;i=!0}}while(i||n!==t);return t}function Xv(e,t,i,n,o,s,a){if(e){!a&&s&&function(e,t,i,n){var o=e;do{0===o.z&&(o.z=ng(o.x,o.y,t,i,n)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,function(e){var t,i,n,o,s,a,r,l,c=1;do{for(i=e,e=null,s=null,a=0;i;){for(a++,n=i,r=0,t=0;t<c&&(r++,n=n.nextZ);t++);for(l=c;r>0||l>0&&n;)0!==r&&(0===l||!n||i.z<=n.z)?(o=i,i=i.nextZ,r--):(o=n,n=n.nextZ,l--),s?s.nextZ=o:e=o,o.prevZ=s,s=o;i=n}s.nextZ=null,c*=2}while(a>1)}(o)}(e,n,o,s);for(var r,l,c=e;e.prev!==e.next;)if(r=e.prev,l=e.next,s?Kv(e,n,o,s):Zv(e))t.push(r.i/i|0),t.push(e.i/i|0),t.push(l.i/i|0),fg(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?Xv(e=Qv(qv(e),t,i),t,i,n,o,s,2):2===a&&$v(e,t,i,n,o,s):Xv(qv(e),t,i,n,o,s,1);break}}}function Zv(e){var t=e.prev,i=e,n=e.next;if(rg(t,i,n)>=0)return!1;for(var o=t.x,s=i.x,a=n.x,r=t.y,l=i.y,c=n.y,u=o<s?o<a?o:a:s<a?s:a,h=r<l?r<c?r:c:l<c?l:c,p=o>s?o>a?o:a:s>a?s:a,d=r>l?r>c?r:c:l>c?l:c,m=n.next;m!==t;){if(m.x>=u&&m.x<=p&&m.y>=h&&m.y<=d&&sg(o,r,s,l,a,c,m.x,m.y)&&rg(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Kv(e,t,i,n){var o=e.prev,s=e,a=e.next;if(rg(o,s,a)>=0)return!1;for(var r=o.x,l=s.x,c=a.x,u=o.y,h=s.y,p=a.y,d=r<l?r<c?r:c:l<c?l:c,m=u<h?u<p?u:p:h<p?h:p,f=r>l?r>c?r:c:l>c?l:c,v=u>h?u>p?u:p:h>p?h:p,g=ng(d,m,t,i,n),y=ng(f,v,t,i,n),b=e.prevZ,C=e.nextZ;b&&b.z>=g&&C&&C.z<=y;){if(b.x>=d&&b.x<=f&&b.y>=m&&b.y<=v&&b!==o&&b!==a&&sg(r,u,l,h,c,p,b.x,b.y)&&rg(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,C.x>=d&&C.x<=f&&C.y>=m&&C.y<=v&&C!==o&&C!==a&&sg(r,u,l,h,c,p,C.x,C.y)&&rg(C.prev,C,C.next)>=0)return!1;C=C.nextZ}for(;b&&b.z>=g;){if(b.x>=d&&b.x<=f&&b.y>=m&&b.y<=v&&b!==o&&b!==a&&sg(r,u,l,h,c,p,b.x,b.y)&&rg(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;C&&C.z<=y;){if(C.x>=d&&C.x<=f&&C.y>=m&&C.y<=v&&C!==o&&C!==a&&sg(r,u,l,h,c,p,C.x,C.y)&&rg(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function Qv(e,t,i){var n=e;do{var o=n.prev,s=n.next.next;!lg(o,s)&&cg(o,n,n.next,s)&&pg(o,s)&&pg(s,o)&&(t.push(o.i/i|0),t.push(n.i/i|0),t.push(s.i/i|0),fg(n),fg(n.next),n=e=s),n=n.next}while(n!==e);return qv(n)}function $v(e,t,i,n,o,s){var a=e;do{for(var r=a.next.next;r!==a.prev;){if(a.i!==r.i&&ag(a,r)){var l=dg(a,r);return a=qv(a,a.next),l=qv(l,l.next),Xv(a,t,i,n,o,s,0),void Xv(l,t,i,n,o,s,0)}r=r.next}a=a.next}while(a!==e)}function eg(e,t){return e.x-t.x}function tg(e,t){var i=function(e,t){var i,n=t,o=-1/0,s=e.x,a=e.y;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var r=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(r<=s&&r>o&&(o=r,i=n.x<n.next.x?n:n.next,r===s))return i}n=n.next}while(n!==t);if(!i)return null;var l,c=i,u=i.x,h=i.y,p=1/0;n=i;do{s>=n.x&&n.x>=u&&s!==n.x&&sg(a<h?s:o,a,u,h,a<h?o:s,a,n.x,n.y)&&(l=Math.abs(a-n.y)/(s-n.x),pg(n,e)&&(l<p||l===p&&(n.x>i.x||n.x===i.x&&ig(i,n)))&&(i=n,p=l)),n=n.next}while(n!==c);return i}(e,t);if(!i)return t;var n=dg(i,e);return qv(n,n.next),qv(i,i.next)}function ig(e,t){return rg(e.prev,e,t.prev)<0&&rg(t.next,e,e.next)<0}function ng(e,t,i,n,o){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*o|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function og(e){var t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function sg(e,t,i,n,o,s,a,r){return(o-a)*(t-r)>=(e-a)*(s-r)&&(e-a)*(n-r)>=(i-a)*(t-r)&&(i-a)*(s-r)>=(o-a)*(n-r)}function ag(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&cg(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&(pg(e,t)&&pg(t,e)&&function(e,t){var i=e,n=!1,o=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&o<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==e);return n}(e,t)&&(rg(e.prev,e,t.prev)||rg(e,t.prev,t))||lg(e,t)&&rg(e.prev,e,e.next)>0&&rg(t.prev,t,t.next)>0)}function rg(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function lg(e,t){return e.x===t.x&&e.y===t.y}function cg(e,t,i,n){var o=hg(rg(e,t,i)),s=hg(rg(e,t,n)),a=hg(rg(i,n,e)),r=hg(rg(i,n,t));return o!==s&&a!==r||!(0!==o||!ug(e,i,t))||!(0!==s||!ug(e,n,t))||!(0!==a||!ug(i,e,n))||!(0!==r||!ug(i,t,n))}function ug(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function hg(e){return e>0?1:e<0?-1:0}function pg(e,t){return rg(e.prev,e,e.next)<0?rg(e,t,e.next)>=0&&rg(e,e.prev,t)>=0:rg(e,t,e.prev)<0||rg(e,e.next,t)<0}function dg(e,t){var i=new vg(e.i,e.x,e.y),n=new vg(t.i,t.x,t.y),o=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=o,o.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function mg(e,t,i,n){var o=new vg(e,t,i);return n?(o.next=n.next,o.prev=n,n.next.prev=o,n.next=o):(o.prev=o,o.next=o),o}function fg(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function vg(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}var gg=function(){function e(){k()(this,e)}return x()(e,null,[{key:"area",value:function(e){for(var t=e.length,i=0,n=t-1,o=0;o<t;n=o++)i+=e[n].x*e[o].y-e[o].x*e[n].y;return.5*i}},{key:"isClockWise",value:function(t){return e.area(t)<0}},{key:"triangulateShape",value:function(e,t){var i=[],n=[],o=[];yg(e),bg(i,e);var s=e.length;t.forEach(yg);for(var a=0;a<t.length;a++)n.push(s),s+=t[a].length,bg(i,t[a]);for(var r=function(e,t){var i,n,o,s,a,r,l,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,u=t&&t.length,h=u?t[0]*c:e.length,p=Jv(e,0,h,c,!0),d=[];if(!p||p.next===p.prev)return d;if(u&&(p=function(e,t,i,n){var o,s,a,r=[];for(o=0,s=t.length;o<s;o++)(a=Jv(e,t[o]*n,o<s-1?t[o+1]*n:e.length,n,!1))===a.next&&(a.steiner=!0),r.push(og(a));for(r.sort(eg),o=0;o<r.length;o++)i=tg(r[o],i);return i}(e,t,p,c)),e.length>80*c){i=o=e[0],n=s=e[1];for(var m=c;m<h;m+=c)(a=e[m])<i&&(i=a),(r=e[m+1])<n&&(n=r),a>o&&(o=a),r>s&&(s=r);l=0!==(l=Math.max(o-i,s-n))?32767/l:0}return Xv(p,d,c,i,n,l,0),d}(i,n),l=0;l<r.length;l+=3)o.push(r.slice(l,l+3));return o}}])}();function yg(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function bg(e,t){for(var i=0;i<t.length;i++)e.push(t[i].x),e.push(t[i].y)}var Cg=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Yv([new vd(.5,.5),new vd(-.5,.5),new vd(-.5,-.5),new vd(.5,-.5)]),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),(e=Up(this,t)).type="ExtrudeGeometry",e.parameters={shapes:i,options:n},i=Array.isArray(i)?i:[i];for(var o=e,s=[],a=[],r=0,l=i.length;r<l;r++)c(i[r]);function c(e){var t,i,r,l,c,u=[],h=void 0!==n.curveSegments?n.curveSegments:12,p=void 0!==n.steps?n.steps:1,d=void 0!==n.depth?n.depth:1,m=void 0===n.bevelEnabled||n.bevelEnabled,f=void 0!==n.bevelThickness?n.bevelThickness:.2,v=void 0!==n.bevelSize?n.bevelSize:f-.1,g=void 0!==n.bevelOffset?n.bevelOffset:0,y=void 0!==n.bevelSegments?n.bevelSegments:3,b=n.extrudePath,C=void 0!==n.UVGenerator?n.UVGenerator:wg,w=!1;b&&(t=b.getSpacedPoints(p),w=!0,m=!1,i=b.computeFrenetFrames(p,!1),r=new Hd,l=new Hd,c=new Hd),m||(y=0,f=0,v=0,g=0);var k=e.extractPoints(h),_=k.shape,x=k.holes;if(!gg.isClockWise(_)){_=_.reverse();for(var E=0,S=x.length;E<S;E++){var P=x[E];gg.isClockWise(P)&&(x[E]=P.reverse())}}for(var D=gg.triangulateShape(_,x),M=_,T=0,O=x.length;T<O;T++){var N=x[T];_=_.concat(N)}function B(e,t,i){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().addScaledVector(t,i)}var A=_.length,L=D.length;function I(e,t,i){var n,o,s,a=e.x-t.x,r=e.y-t.y,l=i.x-e.x,c=i.y-e.y,u=a*a+r*r,h=a*c-r*l;if(Math.abs(h)>Number.EPSILON){var p=Math.sqrt(u),d=Math.sqrt(l*l+c*c),m=t.x-r/p,f=t.y+a/p,v=((i.x-c/d-m)*c-(i.y+l/d-f)*l)/(a*c-r*l),g=(n=m+a*v-e.x)*n+(o=f+r*v-e.y)*o;if(g<=2)return new vd(n,o);s=Math.sqrt(g/2)}else{var y=!1;a>Number.EPSILON?l>Number.EPSILON&&(y=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(y=!0):Math.sign(r)===Math.sign(c)&&(y=!0),y?(n=-r,o=a,s=Math.sqrt(u)):(n=a,o=r,s=Math.sqrt(u/2))}return new vd(n/s,o/s)}for(var j=[],R=0,F=M.length,z=F-1,H=R+1;R<F;R++,z++,H++)z===F&&(z=0),H===F&&(H=0),j[R]=I(M[R],M[z],M[H]);for(var V,G=[],W=j.concat(),U=0,Y=x.length;U<Y;U++){var J=x[U];V=[];for(var q=0,X=J.length,Z=X-1,K=q+1;q<X;q++,Z++,K++)Z===X&&(Z=0),K===X&&(K=0),V[q]=I(J[q],J[Z],J[K]);G.push(V),W=W.concat(V)}for(var Q=0;Q<y;Q++){for(var $=Q/y,ee=f*Math.cos($*Math.PI/2),te=v*Math.sin($*Math.PI/2)+g,ie=0,ne=M.length;ie<ne;ie++){var oe=B(M[ie],j[ie],te);Oe(oe.x,oe.y,-ee)}for(var se=0,ae=x.length;se<ae;se++){var re=x[se];V=G[se];for(var le=0,ce=re.length;le<ce;le++){var ue=B(re[le],V[le],te);Oe(ue.x,ue.y,-ee)}}}for(var he=v+g,pe=0;pe<A;pe++){var de=m?B(_[pe],W[pe],he):_[pe];w?(l.copy(i.normals[0]).multiplyScalar(de.x),r.copy(i.binormals[0]).multiplyScalar(de.y),c.copy(t[0]).add(l).add(r),Oe(c.x,c.y,c.z)):Oe(de.x,de.y,0)}for(var me=1;me<=p;me++)for(var fe=0;fe<A;fe++){var ve=m?B(_[fe],W[fe],he):_[fe];w?(l.copy(i.normals[me]).multiplyScalar(ve.x),r.copy(i.binormals[me]).multiplyScalar(ve.y),c.copy(t[me]).add(l).add(r),Oe(c.x,c.y,c.z)):Oe(ve.x,ve.y,d/p*me)}for(var ge=y-1;ge>=0;ge--){for(var ye=ge/y,be=f*Math.cos(ye*Math.PI/2),Ce=v*Math.sin(ye*Math.PI/2)+g,we=0,ke=M.length;we<ke;we++){var _e=B(M[we],j[we],Ce);Oe(_e.x,_e.y,d+be)}for(var xe=0,Ee=x.length;xe<Ee;xe++){var Se=x[xe];V=G[xe];for(var Pe=0,De=Se.length;Pe<De;Pe++){var Me=B(Se[Pe],V[Pe],Ce);w?Oe(Me.x,Me.y+t[p-1].y,t[p-1].x+be):Oe(Me.x,Me.y,d+be)}}}function Te(e,t){for(var i=e.length;--i>=0;){var n=i,o=i-1;o<0&&(o=e.length-1);for(var s=0,a=p+2*y;s<a;s++){var r=A*s,l=A*(s+1);Be(t+n+r,t+o+r,t+o+l,t+n+l)}}}function Oe(e,t,i){u.push(e),u.push(t),u.push(i)}function Ne(e,t,i){Ae(e),Ae(t),Ae(i);var n=s.length/3,a=C.generateTopUV(o,s,n-3,n-2,n-1);Le(a[0]),Le(a[1]),Le(a[2])}function Be(e,t,i,n){Ae(e),Ae(t),Ae(n),Ae(t),Ae(i),Ae(n);var a=s.length/3,r=C.generateSideWallUV(o,s,a-6,a-3,a-2,a-1);Le(r[0]),Le(r[1]),Le(r[3]),Le(r[1]),Le(r[2]),Le(r[3])}function Ae(e){s.push(u[3*e+0]),s.push(u[3*e+1]),s.push(u[3*e+2])}function Le(e){a.push(e.x),a.push(e.y)}!function(){var e=s.length/3;if(m){for(var t=0,i=A*t,n=0;n<L;n++){var a=D[n];Ne(a[2]+i,a[1]+i,a[0]+i)}i=A*(t=p+2*y);for(var r=0;r<L;r++){var l=D[r];Ne(l[0]+i,l[1]+i,l[2]+i)}}else{for(var c=0;c<L;c++){var u=D[c];Ne(u[2],u[1],u[0])}for(var h=0;h<L;h++){var d=D[h];Ne(d[0]+A*p,d[1]+A*p,d[2]+A*p)}}o.addGroup(e,s.length/3-e,0)}(),function(){var e=s.length/3,t=0;Te(M,t),t+=M.length;for(var i=0,n=x.length;i<n;i++){var a=x[i];Te(a,t),t+=a.length}o.addGroup(e,s.length/3-e,1)}()}return e.setAttribute("position",new gf(s,3)),e.setAttribute("uv",new gf(a,2)),e.computeVertexNormals(),e}return un()(t,e),x()(t,[{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}},{key:"toJSON",value:function(){var e=Wp(t,"toJSON",this,3)([]);return function(e,t,i){if(i.shapes=[],Array.isArray(e))for(var n=0,o=e.length;n<o;n++){var s=e[n];i.shapes.push(s.uuid)}else i.shapes.push(e.uuid);return i.options=Object.assign({},t),void 0!==t.extrudePath&&(i.options.extrudePath=t.extrudePath.toJSON()),i}(this.parameters.shapes,this.parameters.options,e)}}],[{key:"fromJSON",value:function(e,i){for(var n=[],o=0,s=e.shapes.length;o<s;o++){var a=i[e.shapes[o]];n.push(a)}var r=e.options.extrudePath;return void 0!==r&&(e.options.extrudePath=(new Nv[r.type]).fromJSON(r)),new t(n,e.options)}}])}(Ef),wg={generateTopUV:function(e,t,i,n,o){var s=t[3*i],a=t[3*i+1],r=t[3*n],l=t[3*n+1],c=t[3*o],u=t[3*o+1];return[new vd(s,a),new vd(r,l),new vd(c,u)]},generateSideWallUV:function(e,t,i,n,o,s){var a=t[3*i],r=t[3*i+1],l=t[3*i+2],c=t[3*n],u=t[3*n+1],h=t[3*n+2],p=t[3*o],d=t[3*o+1],m=t[3*o+2],f=t[3*s],v=t[3*s+1],g=t[3*s+2];return Math.abs(r-u)<Math.abs(a-c)?[new vd(a,1-l),new vd(c,1-h),new vd(p,1-m),new vd(f,1-g)]:[new vd(r,1-l),new vd(u,1-h),new vd(d,1-m),new vd(v,1-g)]}},kg=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,t);var o=(1+Math.sqrt(5))/2;return(e=Up(this,t,[[-1,o,0,1,o,0,-1,-o,0,1,-o,0,0,-1,o,0,1,o,0,-1,-o,0,1,-o,o,0,-1,o,0,1,-o,0,-1,-o,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],i,n])).type="IcosahedronGeometry",e.parameters={radius:i,detail:n},e}return un()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.detail)}}])}(Fv),_g=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return k()(this,t),(e=Up(this,t,[[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],i,n])).type="OctahedronGeometry",e.parameters={radius:i,detail:n},e}return un()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.detail)}}])}(Fv),xg=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI;k()(this,t),(e=Up(this,t)).type="RingGeometry",e.parameters={innerRadius:i,outerRadius:n,thetaSegments:o,phiSegments:s,thetaStart:a,thetaLength:r},o=Math.max(3,o);for(var l=[],c=[],u=[],h=[],p=i,d=(n-i)/(s=Math.max(1,s)),m=new Hd,f=new vd,v=0;v<=s;v++){for(var g=0;g<=o;g++){var y=a+g/o*r;m.x=p*Math.cos(y),m.y=p*Math.sin(y),c.push(m.x,m.y,m.z),u.push(0,0,1),f.x=(m.x/n+1)/2,f.y=(m.y/n+1)/2,h.push(f.x,f.y)}p+=d}for(var b=0;b<s;b++)for(var C=b*(o+1),w=0;w<o;w++){var _=w+C,x=_,E=_+o+1,S=_+o+2,P=_+1;l.push(x,E,P),l.push(E,S,P)}return e.setIndex(l),e.setAttribute("position",new gf(c,3)),e.setAttribute("normal",new gf(u,3)),e.setAttribute("uv",new gf(h,2)),e}return un()(t,e),x()(t,[{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}])}(Ef),Eg=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Yv([new vd(0,.5),new vd(-.5,-.5),new vd(.5,-.5)]),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;k()(this,t),(e=Up(this,t)).type="ShapeGeometry",e.parameters={shapes:i,curveSegments:n};var o=[],s=[],a=[],r=[],l=0,c=0;if(!1===Array.isArray(i))h(i);else for(var u=0;u<i.length;u++)h(i[u]),e.addGroup(l,c,u),l+=c,c=0;function h(e){var t=s.length/3,i=e.extractPoints(n),l=i.shape,u=i.holes;!1===gg.isClockWise(l)&&(l=l.reverse());for(var h=0,p=u.length;h<p;h++){var d=u[h];!0===gg.isClockWise(d)&&(u[h]=d.reverse())}for(var m=gg.triangulateShape(l,u),f=0,v=u.length;f<v;f++){var g=u[f];l=l.concat(g)}for(var y=0,b=l.length;y<b;y++){var C=l[y];s.push(C.x,C.y,0),a.push(0,0,1),r.push(C.x,C.y)}for(var w=0,k=m.length;w<k;w++){var _=m[w],x=_[0]+t,E=_[1]+t,S=_[2]+t;o.push(x,E,S),c+=3}}return e.setIndex(o),e.setAttribute("position",new gf(s,3)),e.setAttribute("normal",new gf(a,3)),e.setAttribute("uv",new gf(r,2)),e}return un()(t,e),x()(t,[{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}},{key:"toJSON",value:function(){var e=Wp(t,"toJSON",this,3)([]);return function(e,t){if(t.shapes=[],Array.isArray(e))for(var i=0,n=e.length;i<n;i++){var o=e[i];t.shapes.push(o.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}}],[{key:"fromJSON",value:function(e,i){for(var n=[],o=0,s=e.shapes.length;o<s;o++){var a=i[e.shapes[o]];n.push(a)}return new t(n,e.curveSegments)}}])}(Ef),Sg=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;k()(this,t),(e=Up(this,t)).type="SphereGeometry",e.parameters={radius:i,widthSegments:n,heightSegments:o,phiStart:s,phiLength:a,thetaStart:r,thetaLength:l},n=Math.max(3,Math.floor(n)),o=Math.max(2,Math.floor(o));for(var c=Math.min(r+l,Math.PI),u=0,h=[],p=new Hd,d=new Hd,m=[],f=[],v=[],g=[],y=0;y<=o;y++){var b=[],C=y/o,w=0;0===y&&0===r?w=.5/n:y===o&&c===Math.PI&&(w=-.5/n);for(var _=0;_<=n;_++){var x=_/n;p.x=-i*Math.cos(s+x*a)*Math.sin(r+C*l),p.y=i*Math.cos(r+C*l),p.z=i*Math.sin(s+x*a)*Math.sin(r+C*l),f.push(p.x,p.y,p.z),d.copy(p).normalize(),v.push(d.x,d.y,d.z),g.push(x+w,1-C),b.push(u++)}h.push(b)}for(var E=0;E<o;E++)for(var S=0;S<n;S++){var P=h[E][S+1],D=h[E][S],M=h[E+1][S],T=h[E+1][S+1];(0!==E||r>0)&&m.push(P,D,T),(E!==o-1||c<Math.PI)&&m.push(D,M,T)}return e.setIndex(m),e.setAttribute("position",new gf(f,3)),e.setAttribute("normal",new gf(v,3)),e.setAttribute("uv",new gf(g,2)),e}return un()(t,e),x()(t,[{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}])}(Ef),Pg=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return k()(this,t),(e=Up(this,t,[[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],i,n])).type="TetrahedronGeometry",e.parameters={radius:i,detail:n},e}return un()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.detail)}}])}(Fv),Dg=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:48,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI;k()(this,t),(e=Up(this,t)).type="TorusGeometry",e.parameters={radius:i,tube:n,radialSegments:o,tubularSegments:s,arc:a},o=Math.floor(o),s=Math.floor(s);for(var r=[],l=[],c=[],u=[],h=new Hd,p=new Hd,d=new Hd,m=0;m<=o;m++)for(var f=0;f<=s;f++){var v=f/s*a,g=m/o*Math.PI*2;p.x=(i+n*Math.cos(g))*Math.cos(v),p.y=(i+n*Math.cos(g))*Math.sin(v),p.z=n*Math.sin(g),l.push(p.x,p.y,p.z),h.x=i*Math.cos(v),h.y=i*Math.sin(v),d.subVectors(p,h).normalize(),c.push(d.x,d.y,d.z),u.push(f/s),u.push(m/o)}for(var y=1;y<=o;y++)for(var b=1;b<=s;b++){var C=(s+1)*y+b-1,w=(s+1)*(y-1)+b-1,_=(s+1)*(y-1)+b,x=(s+1)*y+b;r.push(C,w,x),r.push(w,_,x)}return e.setIndex(r),e.setAttribute("position",new gf(l,3)),e.setAttribute("normal",new gf(c,3)),e.setAttribute("uv",new gf(u,2)),e}return un()(t,e),x()(t,[{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}])}(Ef),Mg=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3;k()(this,t),(e=Up(this,t)).type="TorusKnotGeometry",e.parameters={radius:i,tube:n,tubularSegments:o,radialSegments:s,p:a,q:r},o=Math.floor(o),s=Math.floor(s);for(var l=[],c=[],u=[],h=[],p=new Hd,d=new Hd,m=new Hd,f=new Hd,v=new Hd,g=new Hd,y=new Hd,b=0;b<=o;++b){var C=b/o*a*Math.PI*2;N(C,a,r,i,m),N(C+.01,a,r,i,f),g.subVectors(f,m),y.addVectors(f,m),v.crossVectors(g,y),y.crossVectors(v,g),v.normalize(),y.normalize();for(var w=0;w<=s;++w){var _=w/s*Math.PI*2,x=-n*Math.cos(_),E=n*Math.sin(_);p.x=m.x+(x*y.x+E*v.x),p.y=m.y+(x*y.y+E*v.y),p.z=m.z+(x*y.z+E*v.z),c.push(p.x,p.y,p.z),d.subVectors(p,m).normalize(),u.push(d.x,d.y,d.z),h.push(b/o),h.push(w/s)}}for(var S=1;S<=o;S++)for(var P=1;P<=s;P++){var D=(s+1)*(S-1)+(P-1),M=(s+1)*S+(P-1),T=(s+1)*S+P,O=(s+1)*(S-1)+P;l.push(D,M,O),l.push(M,T,O)}function N(e,t,i,n,o){var s=Math.cos(e),a=Math.sin(e),r=i/t*e,l=Math.cos(r);o.x=n*(2+l)*.5*s,o.y=n*(2+l)*a*.5,o.z=n*Math.sin(r)*.5}return e.setIndex(l),e.setAttribute("position",new gf(c,3)),e.setAttribute("normal",new gf(u,3)),e.setAttribute("uv",new gf(h,2)),e}return un()(t,e),x()(t,[{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}])}(Ef),Tg=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Tv(new Hd(-1,-1,0),new Hd(-1,1,0),new Hd(1,1,0)),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];k()(this,t),(e=Up(this,t)).type="TubeGeometry",e.parameters={path:i,tubularSegments:n,radius:o,radialSegments:s,closed:a};var r=i.computeFrenetFrames(n,a);e.tangents=r.tangents,e.normals=r.normals,e.binormals=r.binormals;var l=new Hd,c=new Hd,u=new vd,h=new Hd,p=[],d=[],m=[],f=[];function v(e){h=i.getPointAt(e/n,h);for(var t=r.normals[e],a=r.binormals[e],u=0;u<=s;u++){var m=u/s*Math.PI*2,f=Math.sin(m),v=-Math.cos(m);c.x=v*t.x+f*a.x,c.y=v*t.y+f*a.y,c.z=v*t.z+f*a.z,c.normalize(),d.push(c.x,c.y,c.z),l.x=h.x+o*c.x,l.y=h.y+o*c.y,l.z=h.z+o*c.z,p.push(l.x,l.y,l.z)}}return function(){for(var e=0;e<n;e++)v(e);v(!1===a?n:0),function(){for(var e=0;e<=n;e++)for(var t=0;t<=s;t++)u.x=e/n,u.y=t/s,m.push(u.x,u.y)}(),function(){for(var e=1;e<=n;e++)for(var t=1;t<=s;t++){var i=(s+1)*(e-1)+(t-1),o=(s+1)*e+(t-1),a=(s+1)*e+t,r=(s+1)*(e-1)+t;f.push(i,o,r),f.push(o,a,r)}}()}(),e.setIndex(f),e.setAttribute("position",new gf(p,3)),e.setAttribute("normal",new gf(d,3)),e.setAttribute("uv",new gf(m,2)),e}return un()(t,e),x()(t,[{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}},{key:"toJSON",value:function(){var e=Wp(t,"toJSON",this,3)([]);return e.path=this.parameters.path.toJSON(),e}}],[{key:"fromJSON",value:function(e){return new t((new Nv[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}])}(Ef),Og=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(k()(this,t),(e=Up(this,t)).type="WireframeGeometry",e.parameters={geometry:i},null!==i){var n=[],o=new Set,s=new Hd,a=new Hd;if(null!==i.index){var r=i.attributes.position,l=i.index,c=i.groups;0===c.length&&(c=[{start:0,count:l.count,materialIndex:0}]);for(var u=0,h=c.length;u<h;++u)for(var p=c[u],d=p.start,m=d,f=d+p.count;m<f;m+=3)for(var v=0;v<3;v++){var g=l.getX(m+v),y=l.getX(m+(v+1)%3);s.fromBufferAttribute(r,g),a.fromBufferAttribute(r,y),!0===Ng(s,a,o)&&(n.push(s.x,s.y,s.z),n.push(a.x,a.y,a.z))}}else for(var b=i.attributes.position,C=0,w=b.count/3;C<w;C++)for(var _=0;_<3;_++){var x=3*C+_,E=3*C+(_+1)%3;s.fromBufferAttribute(b,x),a.fromBufferAttribute(b,E),!0===Ng(s,a,o)&&(n.push(s.x,s.y,s.z),n.push(a.x,a.y,a.z))}e.setAttribute("position",new gf(n,3))}return e}return un()(t,e),x()(t,[{key:"copy",value:function(e){return Wp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}])}(Ef);function Ng(e,t,i){var n="".concat(e.x,",").concat(e.y,",").concat(e.z,"-").concat(t.x,",").concat(t.y,",").concat(t.z),o="".concat(t.x,",").concat(t.y,",").concat(t.z,"-").concat(e.x,",").concat(e.y,",").concat(e.z);return!0!==i.has(n)&&!0!==i.has(o)&&(i.add(n),i.add(o),!0)}Object.freeze({__proto__:null,BoxGeometry:Uf,CapsuleGeometry:Lv,CircleGeometry:Iv,ConeGeometry:Rv,CylinderGeometry:jv,DodecahedronGeometry:zv,EdgesGeometry:Uv,ExtrudeGeometry:Cg,IcosahedronGeometry:kg,LatheGeometry:Av,OctahedronGeometry:_g,PlaneGeometry:nv,PolyhedronGeometry:Fv,RingGeometry:xg,ShapeGeometry:Eg,SphereGeometry:Sg,TetrahedronGeometry:Pg,TorusGeometry:Dg,TorusKnotGeometry:Mg,TubeGeometry:Tg,WireframeGeometry:Og});function Bg(e,t,i){return!e||!i&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)}function Ag(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}var Lg=function(){return x()((function e(t,i,n,o){k()(this,e),this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==o?o:new i.constructor(n),this.sampleValues=i,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}),[{key:"evaluate",value:function(e){var t=this.parameterPositions,i=this._cachedIndex,n=t[i],o=t[i-1];e:{t:{var s;i:{n:if(!(e<n)){for(var a=i+2;;){if(void 0===n){if(e<o)break n;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===a)break;if(o=n,e<(n=t[++i]))break t}s=t.length;break i}if(e>=o)break e;var r=t[1];e<r&&(i=2,o=r);for(var l=i-2;;){if(void 0===o)return this._cachedIndex=0,this.copySampleValue_(0);if(i===l)break;if(n=o,e>=(o=t[--i-1]))break t}s=i,i=0}for(;i<s;){var c=i+s>>>1;e<t[c]?s=c:i=c+1}if(n=t[i],void 0===(o=t[i-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===n)return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,o,n)}return this.interpolate_(i,o,e,n)}},{key:"getSettings_",value:function(){return this.settings||this.DefaultSettings_}},{key:"copySampleValue_",value:function(e){for(var t=this.resultBuffer,i=this.sampleValues,n=this.valueSize,o=e*n,s=0;s!==n;++s)t[s]=i[o+s];return t}},{key:"interpolate_",value:function(){throw new Error("call to abstract method")}},{key:"intervalChanged_",value:function(){}}])}(),Ig=function(e){function t(e,i,n,o){var s;return k()(this,t),(s=Up(this,t,[e,i,n,o]))._weightPrev=-0,s._offsetPrev=-0,s._weightNext=-0,s._offsetNext=-0,s.DefaultSettings_={endingStart:qp,endingEnd:qp},s}return un()(t,e),x()(t,[{key:"intervalChanged_",value:function(e,t,i){var n=this.parameterPositions,o=e-2,s=e+1,a=n[o],r=n[s];if(void 0===a)switch(this.getSettings_().endingStart){case Xp:o=e,a=2*t-i;break;case 2402:a=t+n[o=n.length-2]-n[o+1];break;default:o=e,a=i}if(void 0===r)switch(this.getSettings_().endingEnd){case Xp:s=e,r=2*i-t;break;case 2402:s=1,r=i+n[1]-n[0];break;default:s=e-1,r=t}var l=.5*(i-t),c=this.valueSize;this._weightPrev=l/(t-a),this._weightNext=l/(r-i),this._offsetPrev=o*c,this._offsetNext=s*c}},{key:"interpolate_",value:function(e,t,i,n){for(var o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,r=e*a,l=r-a,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,p=this._weightNext,d=(i-t)/(n-t),m=d*d,f=m*d,v=-h*f+2*h*m-h*d,g=(1+h)*f+(-1.5-2*h)*m+(-.5+h)*d+1,y=(-1-p)*f+(1.5+p)*m+.5*d,b=p*f-p*m,C=0;C!==a;++C)o[C]=v*s[c+C]+g*s[l+C]+y*s[r+C]+b*s[u+C];return o}}])}(Lg),jg=function(e){function t(e,i,n,o){return k()(this,t),Up(this,t,[e,i,n,o])}return un()(t,e),x()(t,[{key:"interpolate_",value:function(e,t,i,n){for(var o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,r=e*a,l=r-a,c=(i-t)/(n-t),u=1-c,h=0;h!==a;++h)o[h]=s[l+h]*u+s[r+h]*c;return o}}])}(Lg),Rg=function(e){function t(e,i,n,o){return k()(this,t),Up(this,t,[e,i,n,o])}return un()(t,e),x()(t,[{key:"interpolate_",value:function(e){return this.copySampleValue_(e-1)}}])}(Lg),Fg=function(){return x()((function e(t,i,n,o){if(k()(this,e),void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===i||0===i.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Bg(i,this.TimeBufferType),this.values=Bg(n,this.ValueBufferType),this.setInterpolation(o||this.DefaultInterpolation)}),[{key:"InterpolantFactoryMethodDiscrete",value:function(e){return new Rg(this.times,this.values,this.getValueSize(),e)}},{key:"InterpolantFactoryMethodLinear",value:function(e){return new jg(this.times,this.values,this.getValueSize(),e)}},{key:"InterpolantFactoryMethodSmooth",value:function(e){return new Ig(this.times,this.values,this.getValueSize(),e)}},{key:"setInterpolation",value:function(e){var t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){var i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(i);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}},{key:"getInterpolation",value:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}},{key:"getValueSize",value:function(){return this.values.length/this.times.length}},{key:"shift",value:function(e){if(0!==e)for(var t=this.times,i=0,n=t.length;i!==n;++i)t[i]+=e;return this}},{key:"scale",value:function(e){if(1!==e)for(var t=this.times,i=0,n=t.length;i!==n;++i)t[i]*=e;return this}},{key:"trim",value:function(e,t){for(var i=this.times,n=i.length,o=0,s=n-1;o!==n&&i[o]<e;)++o;for(;-1!==s&&i[s]>t;)--s;if(++s,0!==o||s!==n){o>=s&&(o=(s=Math.max(s,1))-1);var a=this.getValueSize();this.times=i.slice(o,s),this.values=this.values.slice(o*a,s*a)}return this}},{key:"validate",value:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var i=this.times,n=this.values,o=i.length;0===o&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var s=null,a=0;a!==o;a++){var r=i[a];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,r),e=!1;break}if(null!==s&&s>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,r,s),e=!1;break}s=r}if(void 0!==n&&Ag(n))for(var l=0,c=n.length;l!==c;++l){var u=n[l];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,u),e=!1;break}}return e}},{key:"optimize",value:function(){for(var e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),n=2302===this.getInterpolation(),o=e.length-1,s=1,a=1;a<o;++a){var r=!1,l=e[a];if(l!==e[a+1]&&(1!==a||l!==e[0]))if(n)r=!0;else for(var c=a*i,u=c-i,h=c+i,p=0;p!==i;++p){var d=t[c+p];if(d!==t[u+p]||d!==t[h+p]){r=!0;break}}if(r){if(a!==s){e[s]=e[a];for(var m=a*i,f=s*i,v=0;v!==i;++v)t[f+v]=t[m+v]}++s}}if(o>0){e[s]=e[o];for(var g=o*i,y=s*i,b=0;b!==i;++b)t[y+b]=t[g+b];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=t.slice(0,s*i)):(this.times=e,this.values=t),this}},{key:"clone",value:function(){var e=this.times.slice(),t=this.values.slice(),i=new(0,this.constructor)(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}],[{key:"toJSON",value:function(e){var t,i=e.constructor;if(i.toJSON!==this.toJSON)t=i.toJSON(e);else{t={name:e.name,times:Bg(e.times,Array),values:Bg(e.values,Array)};var n=e.getInterpolation();n!==e.DefaultInterpolation&&(t.interpolation=n)}return t.type=e.ValueTypeName,t}}])}();Fg.prototype.TimeBufferType=Float32Array,Fg.prototype.ValueBufferType=Float32Array,Fg.prototype.DefaultInterpolation=2301;var zg=function(e){function t(){return k()(this,t),Up(this,t,arguments)}return un()(t,e),x()(t)}(Fg);zg.prototype.ValueTypeName="bool",zg.prototype.ValueBufferType=Array,zg.prototype.DefaultInterpolation=2300,zg.prototype.InterpolantFactoryMethodLinear=void 0,zg.prototype.InterpolantFactoryMethodSmooth=void 0;var Hg=function(e){function t(){return k()(this,t),Up(this,t,arguments)}return un()(t,e),x()(t)}(Fg);Hg.prototype.ValueTypeName="color";var Vg=function(e){function t(){return k()(this,t),Up(this,t,arguments)}return un()(t,e),x()(t)}(Fg);Vg.prototype.ValueTypeName="number";var Gg=function(e){function t(e,i,n,o){return k()(this,t),Up(this,t,[e,i,n,o])}return un()(t,e),x()(t,[{key:"interpolate_",value:function(e,t,i,n){for(var o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,r=(i-t)/(n-t),l=e*a,c=l+a;l!==c;l+=4)zd.slerpFlat(o,0,s,l-a,s,l,r);return o}}])}(Lg),Wg=function(e){function t(){return k()(this,t),Up(this,t,arguments)}return un()(t,e),x()(t,[{key:"InterpolantFactoryMethodLinear",value:function(e){return new Gg(this.times,this.values,this.getValueSize(),e)}}])}(Fg);Wg.prototype.ValueTypeName="quaternion",Wg.prototype.DefaultInterpolation=2301,Wg.prototype.InterpolantFactoryMethodSmooth=void 0;var Ug=function(e){function t(){return k()(this,t),Up(this,t,arguments)}return un()(t,e),x()(t)}(Fg);Ug.prototype.ValueTypeName="string",Ug.prototype.ValueBufferType=Array,Ug.prototype.DefaultInterpolation=2300,Ug.prototype.InterpolantFactoryMethodLinear=void 0,Ug.prototype.InterpolantFactoryMethodSmooth=void 0;var Yg=function(e){function t(){return k()(this,t),Up(this,t,arguments)}return un()(t,e),x()(t)}(Fg);Yg.prototype.ValueTypeName="vector";var Jg=x()((function e(t,i,n){k()(this,e);var o,s=this,a=!1,r=0,l=0,c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=i,this.onError=n,this.itemStart=function(e){l++,!1===a&&void 0!==s.onStart&&s.onStart(e,r,l),a=!0},this.itemEnd=function(e){r++,void 0!==s.onProgress&&s.onProgress(e,r,l),r===l&&(a=!1,void 0!==s.onLoad&&s.onLoad())},this.itemError=function(e){void 0!==s.onError&&s.onError(e)},this.resolveURL=function(e){return o?o(e):e},this.setURLModifier=function(e){return o=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){var t=c.indexOf(e);return-1!==t&&c.splice(t,2),this},this.getHandler=function(e){for(var t=0,i=c.length;t<i;t+=2){var n=c[t],o=c[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return o}return null}})),qg=new Jg,Xg=function(){return x()((function e(t){k()(this,e),this.manager=void 0!==t?t:qg,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}),[{key:"load",value:function(){}},{key:"loadAsync",value:function(e,t){var i=this;return new Promise((function(n,o){i.load(e,n,t,o)}))}},{key:"parse",value:function(){}},{key:"setCrossOrigin",value:function(e){return this.crossOrigin=e,this}},{key:"setWithCredentials",value:function(e){return this.withCredentials=e,this}},{key:"setPath",value:function(e){return this.path=e,this}},{key:"setResourcePath",value:function(e){return this.resourcePath=e,this}},{key:"setRequestHeader",value:function(e){return this.requestHeader=e,this}}])}();Xg.DEFAULT_MATERIAL_NAME="__DEFAULT";Error,new gm,new Hd,new Hd,new gm,new Hd,new Hd,new gm,new gm,new gm;new Hd,new zd,new Hd,new Hd,new Hd,new zd,new Hd,new Hd;var Zg="\\[\\]\\.:\\/",Kg=new RegExp("["+Zg+"]","g"),Qg="[^"+Zg+"]",$g="[^"+Zg.replace("\\.","")+"]",ey=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",Qg)+/(WCOD+)?/.source.replace("WCOD",$g)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Qg)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Qg)+"$"),ty=["material","materials","bones","map"],iy=function(){function e(t,i,n){k()(this,e),this.path=i,this.parsedPath=n||e.parseTrackName(i),this.node=e.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}return x()(e,[{key:"_getValue_unavailable",value:function(){}},{key:"_setValue_unavailable",value:function(){}},{key:"_getValue_direct",value:function(e,t){e[t]=this.targetObject[this.propertyName]}},{key:"_getValue_array",value:function(e,t){for(var i=this.resolvedProperty,n=0,o=i.length;n!==o;++n)e[t++]=i[n]}},{key:"_getValue_arrayElement",value:function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}},{key:"_getValue_toArray",value:function(e,t){this.resolvedProperty.toArray(e,t)}},{key:"_setValue_direct",value:function(e,t){this.targetObject[this.propertyName]=e[t]}},{key:"_setValue_direct_setNeedsUpdate",value:function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}},{key:"_setValue_direct_setMatrixWorldNeedsUpdate",value:function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_array",value:function(e,t){for(var i=this.resolvedProperty,n=0,o=i.length;n!==o;++n)i[n]=e[t++]}},{key:"_setValue_array_setNeedsUpdate",value:function(e,t){for(var i=this.resolvedProperty,n=0,o=i.length;n!==o;++n)i[n]=e[t++];this.targetObject.needsUpdate=!0}},{key:"_setValue_array_setMatrixWorldNeedsUpdate",value:function(e,t){for(var i=this.resolvedProperty,n=0,o=i.length;n!==o;++n)i[n]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_arrayElement",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}},{key:"_setValue_arrayElement_setNeedsUpdate",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}},{key:"_setValue_arrayElement_setMatrixWorldNeedsUpdate",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_fromArray",value:function(e,t){this.resolvedProperty.fromArray(e,t)}},{key:"_setValue_fromArray_setNeedsUpdate",value:function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}},{key:"_setValue_fromArray_setMatrixWorldNeedsUpdate",value:function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_getValue_unbound",value:function(e,t){this.bind(),this.getValue(e,t)}},{key:"_setValue_unbound",value:function(e,t){this.bind(),this.setValue(e,t)}},{key:"bind",value:function(){var t=this.node,i=this.parsedPath,n=i.objectName,o=i.propertyName,s=i.propertyIndex;if(t||(t=e.findNode(this.rootNode,i.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var a=i.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var r=0;r<t.length;r++)if(t[r].name===a){a=r;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);t=t.material.map;break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==a){if(void 0===t[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[a]}}var l=t[o];if(void 0!==l){var c=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?c=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate);var u=this.BindingType.Direct;if(void 0!==s){if("morphTargetInfluences"===o){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[s]&&(s=t.morphTargetDictionary[s])}u=this.BindingType.ArrayElement,this.resolvedProperty=l,this.propertyIndex=s}else void 0!==l.fromArray&&void 0!==l.toArray?(u=this.BindingType.HasFromToArray,this.resolvedProperty=l):Array.isArray(l)?(u=this.BindingType.EntireArray,this.resolvedProperty=l):this.propertyName=o;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][c]}else{var h=i.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+o+" but it wasn't found.",t)}}else console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".")}},{key:"unbind",value:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}],[{key:"create",value:function(t,i,n){return t&&t.isAnimationObjectGroup?new e.Composite(t,i,n):new e(t,i,n)}},{key:"sanitizeNodeName",value:function(e){return e.replace(/\s/g,"_").replace(Kg,"")}},{key:"parseTrackName",value:function(e){var t=ey.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){var o=i.nodeName.substring(n+1);-1!==ty.indexOf(o)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=o)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}},{key:"findNode",value:function(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var i=e.skeleton.getBoneByName(t);if(void 0!==i)return i}if(e.children){var n=function(e){for(var i=0;i<e.length;i++){var o=e[i];if(o.name===t||o.uuid===t)return o;var s=n(o.children);if(s)return s}return null},o=n(e.children);if(o)return o}return null}}])}();iy.Composite=function(){return x()((function e(t,i,n){k()(this,e);var o=n||iy.parseTrackName(i);this._targetGroup=t,this._bindings=t.subscribe_(i,o)}),[{key:"getValue",value:function(e,t){this.bind();var i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(e,t)}},{key:"setValue",value:function(e,t){for(var i=this._bindings,n=this._targetGroup.nCachedObjects_,o=i.length;n!==o;++n)i[n].setValue(e,t)}},{key:"bind",value:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}},{key:"unbind",value:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}])}(),iy.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},iy.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},iy.prototype.GetterByBindingType=[iy.prototype._getValue_direct,iy.prototype._getValue_array,iy.prototype._getValue_arrayElement,iy.prototype._getValue_toArray],iy.prototype.SetterByBindingTypeAndVersioning=[[iy.prototype._setValue_direct,iy.prototype._setValue_direct_setNeedsUpdate,iy.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[iy.prototype._setValue_array,iy.prototype._setValue_array_setNeedsUpdate,iy.prototype._setValue_array_setMatrixWorldNeedsUpdate],[iy.prototype._setValue_arrayElement,iy.prototype._setValue_arrayElement_setNeedsUpdate,iy.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[iy.prototype._setValue_fromArray,iy.prototype._setValue_fromArray_setNeedsUpdate,iy.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];new Float32Array(1),new gm;new vd,new Hd,new Hd,new Hd,new Hd,new gm,new gm;new Hd,new rf,new rf,new Hd,new Hd,new Hd,new Hd,new qf;new Wd,new Hd;"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"164"}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="164");i(37);function ny(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 oy(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ny(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ny(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function sy(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return ay(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)?ay(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function ay(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 ry(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var ly=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,t),i=ry(this,t,[e,n]);var s="\n importScripts('".concat(i.getSourceRootPath(),"/3rdparty/turf.min.js');\n self.addEventListener('message', function (e) {\n let features = []\n eval(e.data.code);\n self.postMessage(features);\n }, false);\n "),a="data:text/javascript;charset=utf-8,"+encodeURIComponent(s);if(i._worker=new Worker(a),i.options.angle=i.options.angle||0,i.loaded=!1,i.ismove=!1,i._loadEvent=void 0,i._loaded=!1,i.options.position.lat>83.5&&(i.options.position.lat=83.5),i.options.position.lat<-83.5&&(i.options.position.lat=-83.5),i.options.show=!n.show&&!1!==n.show||n.show,i.options.scale=n.scale||{},i.options.scale.x=i.options.scale.x||0===i.options.scale.x?i.options.scale.x:1,i.options.scale.y=i.options.scale.y||0===i.options.scale.y?i.options.scale.y:1,i.options.flipe=n.flipe||{},i.options.flipe.x=i.options.flipe.x||!1,i.options.flipe.y=i.options.flipe.y||!1,i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attributeType=n.attributeType||"richText",n.text=n.text||{},i.options.text={value:n.text.value||"",show:!n.text.show&&!1!==n.text.show||n.text.show,position:n.text.position,fontSize:n.text.fontSize||0===n.text.fontSize?n.text.fontSize:20,color:n.text.color||"#ffffff",scaleByDistance:n.text.scaleByDistance||!1,near:n.text.near||0===n.text.near?n.text.near:2e3,far:n.text.far||0===n.text.far?n.text.far:1e5},i.options.text.position){var r=turf.point([i.options.position.lng,i.options.position.lat]),l=turf.point([i.options.text.position.lng,i.options.text.position.lat]),c=turf.distance(r,l,{units:"kilometers"}),u=turf.rhumbBearing(r,l);i._textToCenter={distance:c,angle:u}}return i.hierarchys=[],i._elms={},i.Dialog=o,i._isdrag=!1,i._EventBinding=new xn,i.sdk.entityMap.get(i.options.id)?an()(i):(i.sdk.addIncetance(i.options.id,i),i.picking=!0,i.options.show&&Qe(0,i.options.id),i._entityArray=[],i.init(),i)}return un()(t,e),x()(t,[{key:"type",get:function(){return"GroundSvg"}},{key:"attributeSelect",get:function(){return[{name:"富文本",value:"富文本",key:"richText"},{name:"链接",value:"链接",key:"link"}]}},{key:"name",get:function(){return this.options.name},set:function(e){this.options.name=e,this._elms.name&&this._elms.name.forEach((function(t){t.value=e}))}},{key:"show",get:function(){return this.options.show},set:function(e){var i,n,o,s,a,r;"boolean"==typeof e?(this.options.text&&this.options.text.show&&this.text&&(this.showView&&3!=this.showView?this.text.show=!1:this.text.show=e),i=t,n="show",o=e,s=this,a=1,r=1,Np()(ln()(r?i.prototype:i),n,o,s,a)):console.error("参数必须为boolean")}},{key:"position",get:function(){return this.options.position},set:function(e){var t=this;if(this.options.position=e,this.options.position.lat>83.5&&(this.options.position.lat=83.5),this.options.position.lat<-83.5&&(this.options.position.lat=-83.5),this._update(),this._textToCenter){var i=turf.point([this.options.position.lng,this.options.position.lat]),n=turf.destination(i,this._textToCenter.distance,this._textToCenter.angle,{units:"kilometers"}).geometry.coordinates;this.getClampToHeight({lng:n[0],lat:n[1]}).then((function(e){var i=[n[0],n[1],e];t.text&&(t.text.position=i)}))}}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;if(this.options.color=e,this.options.color)for(var i=0;i<this.entity.values.length;i++)this.entity.values[i].polygon.material=Cesium.Color.fromCssColorString(this.options.color);else for(var n=0;n<this.entity.values.length;n++)this.entity.values[n].polygon.material=Cesium.Color.fromCssColorString(this.entity.values[n].properties.color._value);this._elms.color&&this._elms.color.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.color||void 0,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color=""}});t._elms.color[i]=n}))}},{key:"angle",get:function(){return this.options.angle},set:function(e){var t=this,i=(Number(e)+360)%360;i=parseFloat(i.toFixed(1)),this.options.angle=i,e>0&&0===i&&(this.options.angle=360),this._elms.angle&&this._elms.angle.forEach((function(e){e.value=t.options.angle})),this._update()}},{key:"scale",get:function(){return this.options.scale},set:function(e){this.options.scale.x=e.x,this.options.scale.y=e.y,this._elms&&(this._elms.xRange&&(this._elms.xRange.value=this.options.scale.x),this._elms.yRange&&(this._elms.yRange.value=this.options.scale.y),this._elms.xInput&&(this._elms.xInput.value=this.options.scale.x),this._elms.yInput&&(this._elms.yInput.value=this.options.scale.y)),this._update()}},{key:"flipeY",get:function(){return this.options.flipe.y},set:function(e){"boolean"==typeof e?(this.options.flipe.y=e,this._update()):console.error("参数必须为boolean")}},{key:"flipeX",get:function(){return this.options.flipe.x},set:function(e){"boolean"==typeof e?(this.options.flipe.x=e,this._update()):console.error("参数必须为boolean")}},{key:"textValue",get:function(){return this.options.text.value},set:function(e){this.options.text.value=e,this.text?this.text.text=e:t.createText(this),this._elms.textValue&&this._elms.textValue.forEach((function(t){t.value=e}))}},{key:"textShow",get:function(){return this.options.text.show},set:function(e){var t=this;this.options.text.show=e,this.show?(this.showView&&3!=this.showView?this.text&&(this.text.show=!1):this.text&&(this.text.show=e),this.options.text.position&&setTimeout((function(){t.options.text.position.alt?t.text&&(t.text.position=[t.options.text.position.lng,t.options.text.position.lat,t.options.text.position.alt]):t.getClampToHeight({lng:t.options.text.position.lng,lat:t.options.text.position.lat}).then((function(e){t.text&&(t.text.position=[t.options.text.position.lng,t.options.text.position.lat,e])}))}),0)):this.text&&(this.text.show=!1),this._elms.textShow&&this._elms.textShow.forEach((function(t){t.checked=e}))}},{key:"textColor",get:function(){return this.options.text.color},set:function(e){var t=this;this.options.text.color=e,this.text&&(this.text.color=e),this._elms.textColor&&this._elms.textColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.textColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.textColor=e},clear:function(){t.textColor="rgba(255,255,255,1)"}});t._elms.textColor[i]=n}))}},{key:"textFontSize",get:function(){return this.options.text.fontSize},set:function(e){this.options.text.fontSize=e,this.text&&(this.text.fontSize=e,this.text.pixelOffset=e),this._elms.textFontSize&&this._elms.textFontSize.forEach((function(t){t.value=e}))}},{key:"textScaleByDistance",get:function(){return this.options.text.scaleByDistance},set:function(e){this.options.text.scaleByDistance=e,this.text&&(this.text.scaleByDistance=e),this._elms.textScaleByDistance&&this._elms.textScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"textNear",get:function(){return this.options.text.near},set:function(e){var t=e;t>this.textFar&&(t=this.textFar),this.options.text.near=t,this.text&&(this.text.near=t),this._elms.textNear&&this._elms.textNear.forEach((function(e){e.value=t}))}},{key:"textFar",get:function(){return this.options.text.far},set:function(e){var t=e;t<this.textNear&&(t=this.textNear),this.options.text.far=t,this.text&&(this.text.far=t),this._elms.textFar&&this._elms.textFar.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(e){this.options.attributeType=e,this._elms.attributeType&&this._elms.attributeType.forEach((function(t){t.value=e}));for(var t=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<t.length;i++)t[i].className.indexOf("attribute-content-"+e)>-1?t[i].style.display="block":t[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(e){var t=this;if(this.options.attribute.link.content=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),h={linkEdit:(c=o()(a.a.mark((function e(i){var n,o,s,r,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.options.attribute.link.content;case 2:t.attributeLink=e.sent,n=t._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function e(n){var o,r,l,c,u,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==n){e.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){e.next=35;break}if(l[c]&&l[c].attributes){e.next=14;break}return e.abrupt("continue",32);case 14:u=sy(l[c].attributes),e.prev=15,d=a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("@click"!==(t=p.value).name){e.next=5;break}return l[c].addEventListener("click",(function(e){"function"==typeof h[t.value]&&h[t.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(t.name),e.abrupt("return",1);case 5:case"end":return e.stop()}}),e)})),u.s();case 18:if((p=u.n()).done){e.next=24;break}return e.delegateYield(d(),"t0",20);case 20:if(!e.t0){e.next=22;break}return e.abrupt("break",24);case 22:e.next=18;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(15),u.e(e.t1);case 29:return e.prev=29,u.f(),e.finish(29);case 32:c++,e.next=11;break;case 35:return e.abrupt("return",1);case 36:case"end":return e.stop()}}),e,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){e.next=15;break}return e.delegateYield(r(l),"t0",10);case 10:if(!e.t0){e.next=12;break}return e.abrupt("break",15);case 12:l++,e.next=8;break;case 15:case"end":return e.stop()}}),e)}))),function(e){return c.apply(this,arguments)}),linkDelete:function(e){t.options.attribute.link.content.splice(e,1),t.attributeLink=t.options.attribute.link.content},confirmEdit:function(e,i){var n=e.name&&e.name.replace(/\s/g,""),o=e.url&&e.url.replace(/\s/g,"");n&&o?t.options.attribute.link.content[i]=e:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),t.attributeLink=t.options.attribute.link.content},cancelEdit:function(){t.attributeLink=t.options.attribute.link.content},fileSelect:function(e,t){var i=u[t].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",p),i.addEventListener("change",p)}},p=function(e){e.target.value&&(u[e.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=e.target.value,e.target.value=null)},d=function(e){for(var t=u[e].getElementsByTagName("button"),i=0;i<t.length;i++)if(t[i]&&t[i].attributes){var n,o=sy(t[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return t[i].addEventListener("click",(function(t){"function"==typeof h[o.value]&&h[o.value](e)})),t[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(e){o.e(e)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"init",value:function(){var e=this,i=this.replaceHost(this.options.url,this.options.host);Mt(this.sdk,this.options.id),this.hierarchys=[],this.originalOptions=this.deepCopyObj(this.options);var n=[];(new SVGLoader).load(i,(function(i){if(e.sdk&&e.sdk.viewer&&e.sdk.viewer.entities){i.xml.style.width="0",i.xml.style.height="0",document.body.appendChild(i.xml);var o,s=sy(i.paths);try{for(s.s();!(o=s.n()).done;){var a=o.value,r=a.userData.style.fill,l=window.getComputedStyle(a.userData.node);if(l.strokeWidth&&(a.userData.style.strokeWidth=Number(l.strokeWidth.replace(/[a-zA-Z]/g,""))),void 0!==r&&"none"!==r){var c,u=sy(SVGLoader.createShapes(a));try{for(u.s();!(c=u.n()).done;){var h=c.value,p=new THREE.ShapeGeometry(h),d=new THREE.Mesh(p);n.push({geometry:d.geometry,color:r})}}catch(e){u.e(e)}finally{u.f()}}var m=a.userData.style.stroke;if(void 0!==m&&"none"!==m){var f,v=sy(a.subPaths);try{for(v.s();!(f=v.n()).done;){var g=f.value,y=SVGLoader.pointsToStroke(g.getPoints(),a.userData.style);if(y){var b=new THREE.Mesh(y);n.push({geometry:b.geometry,color:m})}}}catch(e){v.e(e)}finally{v.f()}}}}catch(e){s.e(e)}finally{s.f()}document.body.removeChild(i.xml);for(var C,w=0,k=0,_=0;_<n.length;_++){var x=n[_].geometry;if(x&&x.attributes&&x.attributes.position)for(var E=x.attributes.position.array,S=0;S<E.length;S++)w>E[S]&&(w=E[S]),k<E[S]&&(k=E[S])}(w=Math.abs(w))>(k=Math.abs(k))&&(k=w);var P=k,D=4e3/(k=k*(10/3)*100)/5;P*=D;for(var M=0;M<n.length;M++)n[M].geometry.scale(D,D,1),n[M].geometry.rotateX(THREE.MathUtils.degToRad(180));e._worker.postMessage({code:"\n let geometryArray = e.data.options.geometryArray\n let max2 = e.data.options.max2\n for (let key = 0; key < geometryArray.length; key++) {\n let feature\n let positions = []\n let position = []\n let geometry = geometryArray[key].geometry;\n let array = geometry.attributes.position.array\n\n for (let i = 0; i < array.length; i += 3) {\n let x = array[i] - (max2 / 2)\n let y = array[i + 1] + (max2 / 2)\n position.push([x, y, array[i + 1]])\n }\n if (geometry.index && geometry.index.array) {\n let index = geometry.index.array\n for (let i = 0; i < index.length; i += 3) {\n positions.push([position[index[i]], position[index[i + 1]], position[index[i + 2]]])\n }\n }\n else {\n for (let i = 0; i < position.length; i += 3) {\n positions.push([position[i], position[i + 1], position[i + 2]])\n }\n }\n\n\n let polygons = []\n // 组合多边形\n for (let i = 0; i < positions.length; i++) {\n let polygon = turf.polygon([[\n ...positions[i],\n positions[i][0]\n ]]);\n polygons.push(polygon)\n\n if (feature) {\n feature = turf.union(feature, polygon);\n }\n else {\n feature = polygon\n }\n }\n feature.properties.color = geometryArray[key].color\n features.push(feature)\n }\n ",options:{geometryArray:n,max2:P}}),e._worker.onmessage=function(i){if(e.sdk&&e.sdk.viewer&&e.sdk.viewer.entities){var n=i.data;C=turf.featureCollection(n),e.geojson=JSON.parse(JSON.stringify(C));var o=turf.bbox(C),s=Math.abs(o[2]-o[0]),a=Math.abs(o[3]-o[1]),r=turf.square(o);r[0]=r[0]+e.options.position.lng-s/5,r[1]=r[1]+e.options.position.lat-a/5,r[2]=r[2]+e.options.position.lng+s/5,r[3]=r[3]+e.options.position.lat+a/5,e.bbox=r,e.geojson.features.forEach((function(t){var i=[],n=JSON.parse(JSON.stringify(t));if(n.properties.directionDistance=[],"MultiPolygon"===n.geometry.type)for(var o=0;o<n.geometry.coordinates.length;o++){for(var s=[],a=0;a<n.geometry.coordinates[o].length;a++){for(var r=[],l=0;l<n.geometry.coordinates[o][a].length;l++){var c=turf.point([0,n.geometry.coordinates[o][a][l][1]]),u=turf.point(A()(n.geometry.coordinates[o][a][l])),h=turf.distance(c,u,{units:"kilometers"}),p=turf.rhumbBearing(c,u);r.push({origin:n.geometry.coordinates[o][a][l],distance:h,angle:p})}s.push(r)}n.properties.directionDistance.push(s)}else for(var d=0;d<n.geometry.coordinates.length;d++){for(var m=[],f=0;f<n.geometry.coordinates[d].length;f++){var v=turf.point([0,n.geometry.coordinates[d][f][1]]),g=turf.point(A()(n.geometry.coordinates[d][f])),y=turf.distance(v,g,{units:"kilometers"}),b=turf.rhumbBearing(v,g);m.push({origin:n.geometry.coordinates[d][f],distance:y,angle:b})}n.properties.directionDistance.push(m)}if("MultiPolygon"===n.geometry.type)for(var C=0;C<n.geometry.coordinates.length;C++){var w=e.getHierarchyPolygon(n,C);i.push(w)}else{var k=e.getHierarchyPolygon(n);i.push(k)}e.hierarchys.push(i)})),e.entity=new Cesium.EntityCollection,at(e.sdk,e.options.id);var l=!1;"cesium-viewer 2d"===e.sdk.viewer._element.className&&(l=!0);for(var c=function(t){for(var i=function(i){var n=e.options.id+"-".concat(t,"_").concat(i,"}"),o=e.sdk.viewer.entities.getById(n);o&&e.sdk.viewer.entities.remove(o);var s=e.sdk.viewer.entities.add({id:e.options.id+"-".concat(t,"_").concat(i,"}"),show:e.options.show,polygon:{hierarchy:new Cesium.CallbackProperty((function(){for(var n=e.hierarchys[t][i],o=[],s=0;s<n.holes.length;s++)o.push({positions:n.holes[s]});return{positions:n.positions,holes:o}}),!0),perPositionHeight:l,zIndex:e.sdk._entityZIndex,material:new Cesium.CustomColorMaterialSource({color:e.options.color||e.geojson.features[t].properties.color})},properties:{id:e.options.id}});e.sdk._entityZIndex++,e.geojson.features[t].properties.color&&(s.properties={id:e.options.id,color:e.geojson.features[t].properties.color}),e._entityArray.push(s),e.entity.add(s)},n=0;n<e.hierarchys[t].length;n++)i(n)},u=0;u<e.hierarchys.length;u++)c(u);e.loaded=!0,e._loaded=!0,e._loadEvent&&e._loadEvent(),e.scale=e.scale,t.createText(e)}}}}))}},{key:"edit",value:(r=o()(a.a.mark((function e(t){var i,n,s,r,l,c,u,h,p,d,m=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._loaded){e.next=2;break}return e.abrupt("return");case 2:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=42;break}return e.next=7,new pn(this.sdk,this.originalOptions,{title:"军标属性",left:"180px",top:"100px",confirmCallBack:function(e){m.name=m.name.trim(),m.name||(m.name="未命名对象"),m.text&&(m.options.text.position={lng:m.text.position[0],lat:m.text.position[1],alt:m.text.position[2]}),m.originalOptions=m.deepCopyObj(m.options),m._DialogObject.close();var t=m.deepCopyObj(m.options);t.host="",m.Dialog.confirmCallBack&&m.Dialog.confirmCallBack(t),Mt(m.sdk,m.options.id),at(m.sdk,m.options.id)},resetCallBack:function(){m.reset(),m.Dialog.resetCallBack&&m.Dialog.resetCallBack()},removeCallBack:function(){m.Dialog.removeCallBack&&m.Dialog.removeCallBack()},closeCallBack:function(){m._DialogObject=null,m.drag(!1),m.reset(),m.Dialog.closeCallBack&&m.Dialog.closeCallBack()},showCallBack:function(e){m.show=e,m.Dialog.showCallBack&&m.Dialog.showCallBack()},addFootElm:[{tagName:"button",className:"flipe-over-y",innerHTML:"Y轴翻转",event:["click",function(){m.flipeY=!m.flipeY}]},{tagName:"button",className:"flipe-over-x",innerHTML:"X轴翻转",event:["click",function(){m.flipeX=!m.flipeX}]},{tagName:"button",className:"drag",innerHTML:"编辑",event:["click",function(){m.drag(!m._isdrag)}]}]},!0);case 7:return this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" ground-svg",(i=document.createElement("div")).innerHTML=Fp(this),e.next=13,this._DialogObject.contentAppChild(i);case 13:this.attributeType=this.options.attributeType,n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color||void 0,disabled:!1,openPickerAni:"opacity",sure:function(e){m.color=e},clear:function(){m.color=""}}),s=new YJColorPicker({el:i.getElementsByClassName("textColor")[0],size:"mini",alpha:!0,defaultColor:this.textColor,disabled:!1,openPickerAni:"opacity",sure:function(e){m.textColor=e},clear:function(){m.textColor="rgba(255,255,255,1)"}}),r=i.getElementsByTagName("*"),this._EventBinding.on(this,r),this._elms=this._EventBinding.element,this._elms.color=[n],this._elms.textColor=[s],setTimeout(o()(a.a.mark((function e(){var t,n,o,s,r,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(m.sdk&&m.sdk.tabHide&&Array.isArray(m.sdk.tabHide))){e.next=9;break}t=0;case 2:if(!(t<m.sdk.tabHide.length)){e.next=9;break}if("属性信息"!==m.sdk.tabHide[t]){e.next=6;break}return i.getElementsByClassName("attribute-info")[0].style.display="none",e.abrupt("break",9);case 6:t++,e.next=2;break;case 9:if(m.attributeLink=m.options.attribute.link.content,n=m.attributeSelect,!(o=m._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0])){e.next=26;break}(s=q(o,".attribute-select")).legp_search(n),r=m._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],l=0;case 17:if(!(l<n.length)){e.next=25;break}if(n[l].key!==m.options.attributeType){e.next=22;break}return r.value=n[l].value,s.legp_searchActive(n[l].value),e.abrupt("break",25);case 22:l++,e.next=17;break;case 25:r.addEventListener("input",(function(){for(var e=0;e<n.length;e++)if(n[e].value===r.value){m.attributeType=n[e].key;break}}));case 26:case"end":return e.stop()}}),e)}))),0),l=i.getElementsByClassName("x-scale")[0],c=i.getElementsByClassName("y-scale")[0],u=l.getElementsByTagName("input")[0],h=l.getElementsByTagName("input")[1],p=c.getElementsByTagName("input")[0],d=c.getElementsByTagName("input")[1],u.value=this.scale.x,h.value=this.scale.x,p.value=this.scale.y,d.value=this.scale.y,this._elms.xRange=u,this._elms.yRange=p,this._elms.xInput=h,this._elms.yInput=d,u.addEventListener("input",(function(e){m.scale={x:u.value,y:m.scale.y}})),p.addEventListener("input",(function(e){m.scale={x:m.scale.x,y:p.value}})),h.addEventListener("input",(function(e){var t=e.target.value;t=Number(t),"."==e.data||"-"==e.data&&!e.target.value||(!e.target.max&&!e.target.min||t<=Number(e.target.max)&&t>=Number(e.target.min))&&(m.scale={x:t,y:m.scale.y})})),h.addEventListener("blur",(function(e){var t=e.target.value;t=Number(t),e.target.max&&t>Number(e.target.max)&&(t=Number(e.target.max)),e.target.min&&t<Number(e.target.min)&&(t=Number(e.target.min)),m.scale={x:t,y:m.scale.y}})),d.addEventListener("input",(function(e){var t=e.target.value;t=Number(t),"."==e.data||"-"==e.data&&!e.target.value||(!e.target.max&&!e.target.min||t<=Number(e.target.max)&&t>=Number(e.target.min))&&(m.scale={x:m.scale.x,y:t})})),d.addEventListener("blur",(function(e){var t=e.target.value;t=Number(t),e.target.max&&t>Number(e.target.max)&&(t=Number(e.target.max)),e.target.min&&t<Number(e.target.min)&&(t=Number(e.target.min)),m.scale={x:m.scale.x,y:t}}));case 42:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"reset",value:function(){this._loaded&&(this.options=this.deepCopyObj(this.originalOptions),this.position=this.originalOptions.position,this.name=this.originalOptions.name,this.angle=this.originalOptions.angle,this.scale=this.originalOptions.scale,this.color=this.originalOptions.color,this.text&&!this.originalOptions.text.position&&(this.text.remove(),this.text=null),this.attributeLink=this.options.attribute.link.content,this.textShow=this.originalOptions.text.show,this.textValue=this.originalOptions.text.value,this.textColor=this.originalOptions.text.color,this.textFontSize=this.originalOptions.text.fontSize,this.textScaleByDistance=this.originalOptions.text.scaleByDistance,this.textNear=this.originalOptions.text.near,this.textFar=this.originalOptions.text.far)}},{key:"drag",value:function(e,t){var i=this;if(this._loaded&&this.sdk&&this.sdk.viewer)if(this.ismove=!1,this._isdrag=e,this.ScreenSpaceEventHandler&&(this.ScreenSpaceEventHandler.destroy(),this.ScreenSpaceEventHandler=null),e){this.ScreenSpaceEventHandler=new Cesium.ScreenSpaceEventHandler(this.sdk.viewer.canvas);var n=Math.abs(this.bbox[0]-this.bbox[2]),s=Math.abs(this.bbox[1]-this.bbox[3]);this.ScreenSpaceEventHandler.setInputAction(function(){var e=o()(a.a.mark((function e(t){var o,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w,k,_,x,E,S,P,D,M,T,O,N,B,A,L,I,j,R,F,z,H,V;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i.pickPoint){e.next=114;break}if(o=i.pickPoint.position.getValue(),(r=i.sdk.viewer.scene.pickPosition(t.endPosition))||(l=i.sdk.viewer.camera.getPickRay(t.endPosition),r=i.sdk.viewer.scene.globe.pick(l,i.sdk.viewer.scene)),o&&r){e.next=6;break}return e.abrupt("return");case 6:c=i.cartesian3Towgs84(o,i.sdk.viewer),u=i.cartesian3Towgs84(r,i.sdk.viewer),h=0,p=0,f=3.5*i.scale.x,v=3.5*i.scale.y,g=Math.sqrt(Math.pow(f/2,2)+Math.pow(v/2,2)),y=Math.atan(f/2/(v/2))*(180/Math.PI),isNaN(y)&&(y=0),w=turf.point([i.position.lng,i.position.lat]),k={units:"kilometers"},(_=[])[0]=turf.destination(w,v/2*1.5,0+i.options.angle,k).geometry.coordinates,_[1]=turf.destination(w,g,180+y+i.options.angle,k).geometry.coordinates,_[2]=turf.destination(w,v/2,180+i.options.angle,k).geometry.coordinates,_[3]=turf.destination(w,g,180-y+i.options.angle,k).geometry.coordinates,_[4]=turf.destination(w,f/2,270+i.options.angle,k).geometry.coordinates,_[5]=[i.position.lng,i.position.lat],_[6]=turf.destination(w,f/2,90+i.options.angle,k).geometry.coordinates,_[7]=turf.destination(w,g,360-y+i.options.angle,k).geometry.coordinates,_[8]=turf.destination(w,v/2,0+i.options.angle,k).geometry.coordinates,_[9]=turf.destination(w,g,0+y+i.options.angle,k).geometry.coordinates,x=turf.point([c.lng,c.lat]),E=turf.point([u.lng,u.lat]),S=turf.point([i.position.lng,i.position.lat]),P=turf.rhumbBearing(S,x),D=turf.rhumbBearing(S,E),M=(D+360-i.angle)%360,N=turf.rhumbDistance(S,E,k),B=!1,A=!1,e.t0=i.pickPoint.id,e.next="svg-control-points_0"===e.t0?40:"svg-control-points_1"===e.t0||"svg-control-points_7"===e.t0?43:"svg-control-points_2"===e.t0||"svg-control-points_8"===e.t0?57:"svg-control-points_3"===e.t0||"svg-control-points_9"===e.t0?64:"svg-control-points_4"===e.t0?78:"svg-control-points_5"===e.t0?85:"svg-control-points_6"===e.t0?95:102;break;case 40:return y=D-P,i.angle+=y,e.abrupt("break",102);case 43:return O=(turf.rhumbBearing(S,turf.point(_[4]))+360-i.angle)%360,T=(turf.rhumbBearing(S,turf.point(_[2]))+360-i.angle)%360,((b=M-O)>-360&&b<-90||b<360&&b>90)&&(b+=180,B=!0),((C=M-T)>-360&&C<-90||C<360&&C>90)&&(C+=180,A=!0),B&&A?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#ff0000")):B?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")):A?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")):(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")),d=Math.PI/180*b,m=Math.PI/180*C,f=Math.cos(d)*N*2,v=Math.cos(m)*N*2,i.scale.x=Math.abs(f)/3.5,i.scale.y=Math.abs(v)/3.5,e.abrupt("break",102);case 57:return T=(turf.rhumbBearing(S,turf.point(_[2]))+360-i.angle)%360,(C=M-T)>-360&&C<-90||C<360&&C>90?(C+=180,i.pointEntityCollection.values[2].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[8].point.color=Cesium.Color.fromCssColorString("#ff0000")):(i.pointEntityCollection.values[2].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[8].point.color=Cesium.Color.fromCssColorString("#00ff0a")),m=Math.PI/180*C,v=Math.cos(m)*N*2,i.scale.y=v/3.5,e.abrupt("break",102);case 64:return O=(turf.rhumbBearing(S,turf.point(_[6]))+360-i.angle)%360,T=(turf.rhumbBearing(S,turf.point(_[2]))+360-i.angle)%360,((b=M-O)>-360&&b<-90||b<360&&b>90)&&(b+=180,B=!0),((C=M-T)>-360&&C<-90||C<360&&C>90)&&(C+=180,A=!0),B&&A?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")):B?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")):A?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#ff0000")):(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")),d=Math.PI/180*b,m=Math.PI/180*C,f=Math.cos(d)*N*2,v=Math.cos(m)*N*2,i.scale.x=Math.abs(f)/3.5,i.scale.y=Math.abs(v)/3.5,e.abrupt("break",102);case 78:return O=(turf.rhumbBearing(S,turf.point(_[4]))+360-i.angle)%360,(b=M-O)>-360&&b<-90||b<360&&b>90?(b+=180,i.pointEntityCollection.values[4].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[6].point.color=Cesium.Color.fromCssColorString("#ff0000")):(i.pointEntityCollection.values[6].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[4].point.color=Cesium.Color.fromCssColorString("#ff0000")),d=Math.PI/180*b,f=Math.cos(d)*N*2,i.scale.x=f/3.5,e.abrupt("break",102);case 85:return u.lat>83.5&&(u.lat=83.5),u.lat<-83.5&&(u.lat=-83.5),i.position={lng:u.lng,lat:u.lat},L=u.lng-c.lng,I=u.lat-c.lat,i.bbox[0]=i.bbox[0]+L,i.bbox[1]=i.bbox[1]+I,i.bbox[2]=i.bbox[2]+L,i.bbox[3]=i.bbox[3]+I,e.abrupt("break",102);case 95:return O=(turf.rhumbBearing(S,turf.point(_[6]))+360-i.angle)%360,(b=M-O)>-360&&b<-90||b<360&&b>90?(b+=180,i.pointEntityCollection.values[6].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[4].point.color=Cesium.Color.fromCssColorString("#ff0000")):(i.pointEntityCollection.values[4].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[6].point.color=Cesium.Color.fromCssColorString("#ff0000")),d=Math.PI/180*b,f=Math.cos(d)*N*2,i.scale.x=f/3.5,e.abrupt("break",102);case 102:h=h/(n/2)*100,p=p/(s/2)*100,(j=oy({},i.scale)).x=j.x+h,j.y=j.y-p,j.y>200&&(j.y=200),j.y<.001&&(j.y=.001),j.x>200&&(j.x=200),j.x<.001&&(j.x=.001),i.scale=oy({},j),e.next=141;break;case 114:R=i.sdk.viewer.scene.drillPick(t.endPosition),z=0;case 116:if(!(z<R.length)){e.next=124;break}if(!((H=R[z])&&H.primitive&&H.primitive._id&&H.primitive._id.id&&-1!==H.primitive._id.id.indexOf("svg-control-points_"))){e.next=121;break}return F=H.primitive._id,e.abrupt("break",124);case 121:z++,e.next=116;break;case 124:V=0;case 125:if(!(V<i.pointEntityCollection.values.length)){e.next=141;break}if(!F||i.pointEntityCollection.values[V].id!==F.id){e.next=130;break}F.point.color=Cesium.Color.fromCssColorString("#ffff00"),e.next=138;break;case 130:e.t1=i.pointEntityCollection.values[V].id,e.next="svg-control-points_5"===e.t1?133:"svg-control-points_0"===e.t1?135:137;break;case 133:return i.pointEntityCollection.values[V].point.color=Cesium.Color.fromCssColorString("#ffff00"),e.abrupt("break",138);case 135:return i.pointEntityCollection.values[V].point.color=Cesium.Color.fromCssColorString("#ff0000"),e.abrupt("break",138);case 137:i.pointEntityCollection.values[V].point.color=Cesium.Color.fromCssColorString("#00ff0a");case 138:V++,e.next=125;break;case 141:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.ScreenSpaceEventHandler.setInputAction((function(e){for(var t=i.sdk.viewer.scene.drillPick(e.position),n=0;n<t.length;n++){var o=t[n];if(o&&o.primitive&&o.primitive._id&&o.primitive._id.objectId===i.options.id&&o.primitive._id.id&&-1!==o.primitive._id.id.indexOf("svg-control-points_")){YJ.Global.CameraController(i.sdk,!1),i.pickPoint=o.primitive._id,i.pickPoint.point.color=Cesium.Color.fromCssColorString("#ff0000");break}}}),Cesium.ScreenSpaceEventType.LEFT_DOWN),this.ScreenSpaceEventHandler.setInputAction((function(e){if(i.pickPoint){switch(YJ.Global.CameraController(i.sdk,!0),i.pickPoint.id){case"svg-control-points_4":i.pickPoint.point.color=Cesium.Color.fromCssColorString("#ffff00");break;case"svg-control-points_9":i.pickPoint.point.color=Cesium.Color.fromCssColorString("#ff0000");break;default:i.pickPoint.point.color=Cesium.Color.fromCssColorString("#00ff0a")}i.pickPoint=null}}),Cesium.ScreenSpaceEventType.LEFT_UP),this.ScreenSpaceEventHandler.setInputAction((function(e){i.drag(!1),t&&t(i.options),Mt(i.sdk,i.options.id),at(i.sdk,i.options.id)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK),this.pointEntityCollection=new Cesium.EntityCollection;var r=3.5*this.scale.x,l=3.5*this.scale.y,c=Math.sqrt(Math.pow(r/2,2)+Math.pow(l/2,2)),u=Math.atan(r/2/(l/2))*(180/Math.PI);isNaN(u)&&(u=0);var h=turf.point([this.position.lng,this.position.lat]),p={units:"kilometers"},d=[];if(d[0]=turf.destination(h,l/2*1.5,0,p).geometry.coordinates,d[1]=turf.destination(h,c,180+u,p).geometry.coordinates,d[2]=turf.destination(h,l/2,180,p).geometry.coordinates,d[3]=turf.destination(h,c,180-u,p).geometry.coordinates,d[4]=turf.destination(h,r/2,270,p).geometry.coordinates,d[5]=[this.position.lng,this.position.lat],d[6]=turf.destination(h,r/2,90,p).geometry.coordinates,d[7]=turf.destination(h,c,360-u,p).geometry.coordinates,d[8]=turf.destination(h,l/2,0,p).geometry.coordinates,d[9]=turf.destination(h,c,0+u,p).geometry.coordinates,this.controlPoints=d,!this.sdk||!this.sdk.viewer)return;for(var m=function(e){var t="#00ff0a";5===e&&(t="#ffff00"),0===e&&(t="#ff0000");var n=i.sdk.viewer.entities.getOrCreateEntity("svg-control-points_"+e);n.show=!0,n.objectId=i.options.id,n.position=new Cesium.CallbackProperty((function(){var t;return(t=Cesium.Cartesian3).fromDegrees.apply(t,A()(i.controlPoints[e]))})),n.point=new Cesium.PointGraphics({color:Cesium.Color.fromCssColorString(t),pixelSize:10,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,scaleByDistance:new Cesium.NearFarScalar(0,1,1e10,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}),i.pointEntityCollection.add(n)},f=0;f<this.controlPoints.length;f++)m(f);this._update()}else for(var v=0;v<this.controlPoints.length;v++){var g=this.sdk.viewer.entities.getById("svg-control-points_"+v);g&&g.objectId===this.options.id&&(g.show=!1)}}},{key:"getHierarchyPolygon",value:function(e,t){if(e){var i={},n=[],o=e.properties.directionDistance;void 0!==t&&(o=e.properties.directionDistance[t]);for(var s=0;s<o.length;s++){for(var a=[],r=0;r<o[s].length;r++){var l,c=this.options.position.lng,u=o[s][r].origin[1]+this.options.position.lat;u>90&&(c+=180);var h=[c,u],p=turf.point(h),d=turf.rhumbDestination(p,o[s][r].distance,o[s][r].angle,{units:"kilometers"}),m=A()(d.geometry.coordinates);m[2]=10,a.push((l=Cesium.Cartesian3).fromDegrees.apply(l,A()(m)))}0===s?i.positions=a:n.push(a)}return i.holes=n,i}}},{key:"_updateGeojson",value:function(e,t,i){if(this._loaded){var n=Math.abs(this.bbox[0]-this.bbox[2]),o=Math.abs(this.bbox[1]-this.bbox[3]);if("object"===N()(e[0]))for(var s=0;s<e.length;s++)this._updateGeojson(e[s],t,i);else{for(var a=0;a<e.length;a+=2)e[a]=e[a]+e[a]/(n/2)*t;for(var r=1;r<e.length;r+=2)e[r]=e[r]-e[r]/(o/2)*i}}}},{key:"_update",value:function(){var e=this;if(this._loaded){var t,i=turf.point([this.position.lng,this.position.lat]),n={units:"kilometers"},o=A()(this.bbox),s=Math.abs(o[2]-o[0]),a=Math.abs(o[3]-o[1]),r=s/2*this.options.scale.x/100-s/2,l=a/2*-this.options.scale.y/100+a/2;o[0]=o[0]-r,o[1]=o[1]+l,o[2]=o[2]+r,o[3]=o[3]-l,o[0]>o[2]&&(t=o[0],o[0]=o[2],o[2]=t),o[1]>o[3]&&(t=o[1],o[1]=o[3],o[3]=t);for(var c=[],u=JSON.parse(JSON.stringify(this.geojson)),h=function(t){for(var i=0;i<t.length;i++)"number"==typeof t[i]?(e.options.flipe.x&&1===i&&(t[i]=-t[i]),e.options.flipe.y&&0===i&&(t[i]=-t[i])):h(t[i])},p=0;p<u.features.length;p++)h(u.features[p].geometry.coordinates);if(u.features.forEach((function(t){var o=[],s=JSON.parse(JSON.stringify(t));e._updateGeojson(s.geometry.coordinates,r,l);var a=[];if("MultiPolygon"===(s=turf.transformRotate(s,e.angle,{pivot:[0,0]})).geometry.type)for(var u=0;u<s.geometry.coordinates.length;u++){for(var h=[],p=0;p<s.geometry.coordinates[u].length;p++){for(var d=[],m=0;m<s.geometry.coordinates[u][p].length;m++){var f=turf.point([0,s.geometry.coordinates[u][p][m][1]]),v=turf.point(A()(s.geometry.coordinates[u][p][m])),g=turf.distance(f,v,{units:"kilometers"}),y=turf.rhumbBearing(f,v);d.push({origin:s.geometry.coordinates[u][p][m],distance:g,angle:y})}h.push(d)}a.push(h)}else for(var b=0;b<s.geometry.coordinates.length;b++){for(var C=[],w=0;w<s.geometry.coordinates[b].length;w++){var k=turf.point([0,s.geometry.coordinates[b][w][1]]),_=turf.point(A()(s.geometry.coordinates[b][w])),x=turf.distance(k,_,{units:"kilometers"}),E=turf.rhumbBearing(k,_);C.push({origin:s.geometry.coordinates[b][w],distance:x,angle:E})}a.push(C)}s.properties.directionDistance=a;var S=3.5*e.scale.x,P=3.5*e.scale.y,D=Math.sqrt(Math.pow(S/2,2)+Math.pow(P/2,2)),M=Math.atan(S/2/(P/2))*(180/Math.PI);isNaN(M)&&(M=0);var T=[];T[0]=turf.destination(i,P/2*1.5,0+e.options.angle,n).geometry.coordinates,T[1]=turf.destination(i,D,180+M+e.options.angle,n).geometry.coordinates,T[2]=turf.destination(i,P/2,180+e.options.angle,n).geometry.coordinates,T[3]=turf.destination(i,D,180-M+e.options.angle,n).geometry.coordinates,T[4]=turf.destination(i,S/2,270+e.options.angle,n).geometry.coordinates,T[5]=[e.position.lng,e.position.lat],T[6]=turf.destination(i,S/2,90+e.options.angle,n).geometry.coordinates,T[7]=turf.destination(i,D,360-M+e.options.angle,n).geometry.coordinates,T[8]=turf.destination(i,P/2,0+e.options.angle,n).geometry.coordinates,T[9]=turf.destination(i,D,0+M+e.options.angle,n).geometry.coordinates;var O=turf.points(T);T=[];for(var N=0;N<O.features.length;N++)T.push(O.features[N].geometry.coordinates);if(e.controlPoints=T,"MultiPolygon"===s.geometry.type)for(var B=0;B<s.geometry.coordinates.length;B++){var L=e.getHierarchyPolygon(s,B);o.push(L)}else{var I=e.getHierarchyPolygon(s);o.push(I)}c.push(o)})),this.hierarchys=[].concat(c),this.entity){if(this._DialogObject||this._isdrag)for(var d=0,m=function(t){for(var i=function(i){e.entity.values[d].polygon.hierarchy.isConstant&&(e.entity.values[d].polygon.hierarchy=new Cesium.CallbackProperty((function(){for(var n=e.hierarchys[t][i],o=[],s=0;s<n.holes.length;s++)o.push({positions:n.holes[s]});return{positions:n.positions,holes:o}}),!1)),d++},n=0;n<e.hierarchys[t].length;n++)i(n)},f=0;f<this.hierarchys.length;f++)m(f);else for(var v=0,g=function(t){for(var i=function(i){e.entity.values[v].polygon.hierarchy=new Cesium.CallbackProperty((function(){for(var n=e.hierarchys[t][i],o=[],s=0;s<n.holes.length;s++)o.push({positions:n.holes[s]});return{positions:n.positions,holes:o}}),!e.ismove),v++},n=0;n<e.hierarchys[t].length;n++)i(n)},y=0;y<this.hierarchys.length;y++)g(y);if(this.textObject&&this.textObject.geojson){for(var b=[],C=JSON.parse(JSON.stringify(this.textObject.geojson)),w=0;w<C.features.length;w++)h(C.features[w].geometry.coordinates);C.features.forEach((function(t){var o=[],s=JSON.parse(JSON.stringify(t));e._updateGeojson(s.geometry.coordinates,r,l);var a=[];if("MultiPolygon"===(s=turf.transformRotate(s,e.angle,{pivot:[0,0]})).geometry.type)for(var c=0;c<s.geometry.coordinates.length;c++){for(var u=[],h=0;h<s.geometry.coordinates[c].length;h++){for(var p=[],d=0;d<s.geometry.coordinates[c][h].length;d++){var m=turf.point([0,s.geometry.coordinates[c][h][d][1]]),f=turf.point(A()(s.geometry.coordinates[c][h][d])),v=turf.distance(m,f,{units:"kilometers"}),g=turf.rhumbBearing(m,f);p.push({origin:s.geometry.coordinates[c][h][d],distance:v,angle:g})}u.push(p)}a.push(u)}else for(var y=0;y<s.geometry.coordinates.length;y++){for(var C=[],w=0;w<s.geometry.coordinates[y].length;w++){var k=turf.point([0,s.geometry.coordinates[y][w][1]]),_=turf.point(A()(s.geometry.coordinates[y][w])),x=turf.distance(k,_,{units:"kilometers"}),E=turf.rhumbBearing(k,_);C.push({origin:s.geometry.coordinates[y][w],distance:x,angle:E})}a.push(C)}s.properties.directionDistance=a;var S=3.5*e.scale.x,P=3.5*e.scale.y,D=Math.sqrt(Math.pow(S/2,2)+Math.pow(P/2,2)),M=Math.atan(S/2/(P/2))*(180/Math.PI);isNaN(M)&&(M=0);var T=[];T[0]=turf.destination(i,P/2*1.5,0+e.options.angle,n).geometry.coordinates,T[1]=turf.destination(i,D,180+M+e.options.angle,n).geometry.coordinates,T[2]=turf.destination(i,P/2,180+e.options.angle,n).geometry.coordinates,T[3]=turf.destination(i,D,180-M+e.options.angle,n).geometry.coordinates,T[4]=turf.destination(i,S/2,270+e.options.angle,n).geometry.coordinates,T[5]=[e.position.lng,e.position.lat],T[6]=turf.destination(i,S/2,90+e.options.angle,n).geometry.coordinates,T[7]=turf.destination(i,D,360-M+e.options.angle,n).geometry.coordinates,T[8]=turf.destination(i,P/2,0+e.options.angle,n).geometry.coordinates,T[9]=turf.destination(i,D,0+M+e.options.angle,n).geometry.coordinates;var O=turf.points(T);T=[];for(var N=0;N<O.features.length;N++)T.push(O.features[N].geometry.coordinates);if(e.controlPoints=T,"MultiPolygon"===s.geometry.type)for(var B=0;B<s.geometry.coordinates.length;B++){var L=e.getHierarchyPolygon(s,B);o.push(L)}else{var I=e.getHierarchyPolygon(s);o.push(I)}b.push(o)})),this.textObject.hierarchys=[].concat(b)}}}}},{key:"textPosPick",value:function(){var e=this;new qr(this.sdk).start(function(){var i=o()(a.a.mark((function i(n,o){var s,r,l,c;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:s=turf.point([e.position.lng,e.position.lat]),r=turf.point([o.lng,o.lat]),l=turf.distance(s,r,{units:"kilometers"}),c=turf.rhumbBearing(s,r),e._textToCenter={distance:l,angle:c},e.options.text.position=o,e.text?e.text.position=[o.lng,o.lat,o.alt]:t.createText(e);case 7:case"end":return i.stop()}}),i)})));return function(e,t){return i.apply(this,arguments)}}())}},{key:"load",value:function(e){this._loaded?e():this._loadEvent=e}},{key:"remove",value:(s=o()(a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._worker.onmessage=function(e){},e.next=3,this.sdk.removeIncetance(this.options.id);case 3:if(this.entity){e.next=5;break}return e.abrupt("return");case 5:if(this.drag(!1),this.sdk&&this.sdk.viewer){e.next=8;break}return e.abrupt("return");case 8:for(this.sdk.viewer.entities.remove(this.entity),this.text&&this.text.remove(),t=this.entity.values.length;t>=0;t--)this.sdk.viewer.entities.remove(this.entity.values[t]);return this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=14,Mt(this.sdk,this.options.id);case 14:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(e){this.options.attribute.link.content.push({name:"链接",url:e}),this.attributeLink=this.options.attribute.link.content}},{key:"openRichTextEditor",value:function(e){var t=this;Bn.open(this.options.id,this.options.name,this.options.richTextContent),Bn.primaryCallBack=function(e){t.options.richTextContent=e}}},{key:"setPosition",value:function(e){if(e){this.ismove=!0;var t={};t.lng=e.position.lng,t.lat=e.position.lat,this.position=t}else this.ismove=!1;this._update()}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=m.length>0&&void 0!==m[0]?m[0]:{},!this._error){e.next=3;break}return e.abrupt("return");case 3:if(pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=24;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),(l=oy({},this.options.position)).hasOwnProperty("alt")){e.next=17;break}return e.next=16,this.getClampToHeight(l);case 16:l.alt=e.sent;case 17:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=37;break;case 24:c=[],u=0;case 26:if(!(u<this.controlPoints.length)){e.next=35;break}return e.next=29,this.getClampToHeight({lng:this.controlPoints[u][0],lat:this.controlPoints[u][1]});case 29:h=e.sent,p=Cesium.Cartesian3.fromDegrees(this.controlPoints[u][0],this.controlPoints[u][1],h),c.push(p.x,p.y,p.z);case 32:u++,e.next=26;break;case 35:d=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(d,{offset:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}});case 37:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})}],[{key:"createText",value:(i=o()(a.a.mark((function e(t){var i;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.options.text.position){e.next=10;break}if(!t.options.text.position.alt){e.next=5;break}i=t.options.text.position.alt,e.next=8;break;case 5:return e.next=7,t.getClampToHeight({lng:t.options.text.position.lng,lat:t.options.text.position.lat});case 7:i=e.sent;case 8:t.text=new Xn(t.sdk,C()(C()(C()({id:t.options.id,show:!!t.options.show&&!!t.options.text.show&&t.options.text.show,position:[t.options.text.position.lng,t.options.text.position.lat,i],text:t.options.text.value,fontSize:t.options.text.fontSize,color:t.options.text.color,pixelOffset:t.options.text.fontSize,backgroundColor:t.options.text.backgroundColor,lineColor:"#ffffff00",lineWidth:0,scaleByDistance:t.options.text.scaleByDistance},"backgroundColor",["#ffffff00","#ffffff00"]),"near",t.options.text.near),"far",t.options.text.far)),t.text.entity.billboard.verticalOrigin=Cesium.VerticalOrigin.CENTER;case 10:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}]);var i,n,s,r}(Vn);function cy(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return uy(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)?uy(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function uy(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 hy(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var py,dy=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),i=hy(this,t,[e,n]),YJ.RoutePlanningArrays.push(i),i.options.width=n.width||4,i.options.color=n.color||"#ff0000",i.options.gps=n.gps||!1,i.Dialog=o,i._elms={},i.start={lng:null,lat:null},i.end={lng:null,lat:null},i.tools=new vi(e),i.init(),i}return un()(t,e),x()(t,[{key:"init",value:function(){var e=this;this.startEntity=this.sdk.viewer.entities.getOrCreateEntity("YJ-route-planning-start"),!this.start||!this.start.lng&&0!==this.start.lng||!this.start.lat&&0!==this.start.lat?this.startEntity.show=!1:this.startEntity.show=!0,this.startEntity.position=new Cesium.CallbackProperty((function(){var t=e.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(e.startLng,e.startLat));return e.clickCallBack({start:t,end:e.endEntity.position}),t}),!1),this.startEntity.billboard={image:this.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32},this.endEntity=this.sdk.viewer.entities.getOrCreateEntity("YJ-route-planning-end"),!this.end||!this.end.lng&&0!==this.end.lng||!this.end.lat&&0!==this.end.lat?this.endEntity.show=!1:this.endEntity.show=!0,this.endEntity.position=new Cesium.CallbackProperty((function(){var t=e.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(e.endLng,e.endLat));return e.clickCallBack({start:e.startEntity.position,end:t}),t}),!1),this.endEntity.billboard={image:this.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32},this.edit(!0),this.clear()}},{key:"onEnd",get:function(){return this.clickCallBack},set:function(e){e&&"function"!=typeof e?console.error("val:",e,"不是一个function"):this.clickCallBack=e}},{key:"startLng",get:function(){return this.start.lng},set:function(e){this.start.lng=e,!this.start||!this.start.lng&&0!==this.start.lng||!this.start.lat&&0!==this.start.lat?this.startEntity&&(this.startEntity.show=!1):this.startEntity&&(this.startEntity.show=!0),this._elms.startLng&&this._elms.startLng.forEach((function(t){t.value=e}))}},{key:"startLat",get:function(){return this.start.lat},set:function(e){this.start.lat=e,!this.start||!this.start.lng&&0!==this.start.lng||!this.start.lat&&0!==this.start.lat?this.startEntity&&(this.startEntity.show=!1):this.startEntity&&(this.startEntity.show=!0),this._elms.startLat&&this._elms.startLat.forEach((function(t){t.value=e}))}},{key:"endLng",get:function(){return this.end.lng},set:function(e){this.end.lng=e,!this.end||!this.end.lng&&0!==this.end.lng||!this.end.lat&&0!==this.end.lat?this.endEntity&&(this.endEntity.show=!1):this.endEntity&&(this.endEntity.show=!0),this._elms.endLng&&this._elms.endLng.forEach((function(t){t.value=e}))}},{key:"endLat",get:function(){return this.end.lat},set:function(e){this.end.lat=e,!this.end||!this.end.lng&&0!==this.end.lng||!this.end.lat&&0!==this.end.lat?this.endEntity&&(this.endEntity.show=!1):this.endEntity&&(this.endEntity.show=!0),this._elms.endLat&&this._elms.endLat.forEach((function(t){t.value=e}))}},{key:"edit",value:(i=o()(a.a.mark((function e(i){var n,o,s,r=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.originalOptions=this.deepCopyObj(this.options),this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),i?(this._element_style=document.createElement("style"),this._element_style.type="text/css",this._element_style.setAttribute("data-name","YJ_style_dialog"),document.getElementById("routeQuery").addEventListener("click",(function(){!r.startLng&&0!==r.startLng||!r.startLat&&0!==r.startLat||!r.endLng&&0!==r.endLng||!r.endLat&&0!==r.endLat?r.tools.message({type:"warning",text:"请先设置起点和终点坐标!"}):(!r.startEntity&&(r.startEntity=r.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return r.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(r.startLng,r.startLat))}),!1),billboard:{image:r.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),r.startEntity.show=!0,!r.endEntity&&(r.endEntity=r.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return r.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(r.endLng,r.endLat))}),!1),billboard:{image:r.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),r.endEntity.show=!0,r.Dialog.queryCallBack&&r.Dialog.queryCallBack({start:[r.startLng,r.startLat],end:[r.endLng,r.endLat]}))})),document.getElementById("clearRoute").addEventListener("click",(function(){r.clear()})),document.getElementsByTagName("head")[0].appendChild(this._element_style),n=document.getElementsByClassName("RoutePlanning")[0],this.options.gps&&((o=document.createElement("button")).innerHTML="当前位置",o.style.marginLeft="10px",o.setAttribute("data-is","start"),o.addEventListener("click",(function(e){r.getLocateCurrent(e)})),n.getElementsByClassName("start-col")[0].appendChild(o),n._element.body.getElementsByClassName("end-pick-btn")[0].style.marginRight="91px"),s=n.getElementsByTagName("*"),t.EventBinding(this,s)):(this._element_style&&(document.getElementsByTagName("head")[0].removeChild(this._element_style),this._element_style=null),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"clear",value:function(){this.startEntity&&(this.sdk.viewer.entities.remove(this.startEntity),this.startEntity=null),this.endEntity&&(this.sdk.viewer.entities.remove(this.endEntity),this.endEntity=null),this.entity&&(this.sdk.viewer.entities.remove(this.entity),this.entity=null),this.startExtensionEntity&&(this.sdk.viewer.entities.remove(this.startExtensionEntity),this.startExtensionEntity=null),this.endExtensionEntity&&(this.sdk.viewer.entities.remove(this.endExtensionEntity),this.endExtensionEntity=null)}},{key:"destroy",value:function(){this.clear(),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"getLocateCurrent",value:function(e){var t=this;this.reconnecting&&this.reconnecting.close(),this.options.host=this.options.host||p();var i;i=this.options.host+"/yjearth4.0/api/v1/gps/state",this.reconnecting=new ReconnectingWebSocket("ws://"+i),this.reconnecting.onopen=function(i){t.reconnecting.onmessage=function(i){t.data=JSON.parse(i.data),t.data&&t.data.rmc&&(t.reconnecting.close(),"start"===e.srcElement.getAttribute("data-is")?(t.startLng=t.data.rmc.lng,t.startLat=t.data.rmc.lat,!t.startEntity&&(t.startEntity=t.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(t.startLng,t.startLat))}),!1),billboard:{image:t.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),t.startEntity.show=!0):(t.endLng=t.data.rmc.lng,t.endLat=t.data.rmc.lat,!t.endEntity&&(t.endEntity=t.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(t.endLng,t.endLat))}),!1),billboard:{image:t.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),t.endEntity.show=!0))}}}},{key:"createRoute",value:function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i].lng,e[i].lat);!this.startLng&&0!==this.startLng||!this.startLat&&0!==this.startLat||this.startLng===e[0].lng&&this.startLat===e[0].lat||(this.startExtension=[this.startLng,this.startLat,e[0].lng,e[0].lat],this.startExtensionEntity?this.startExtensionEntity.polyline.positions=Cesium.Cartesian3.fromDegreesArray(this.startExtension):this.startExtensionEntity=this.sdk.viewer.entities.add({show:this.options.show,polyline:{positions:Cesium.Cartesian3.fromDegreesArray(this.startExtension),width:this.options.width,clampToGround:!0,material:this.getMaterial(this.options.color,2),zIndex:99999999}})),!this.endLng&&0!==this.endLng||!this.endLat&&0!==this.endLat||this.endLng===e[e.length-1].lng&&this.endLat===e[e.length-1].lat||(this.endExtension=[this.endLng,this.endLat,e[e.length-1].lng,e[e.length-1].lat],this.endExtensionEntity?this.endExtensionEntity.polyline.positions=Cesium.Cartesian3.fromDegreesArray(this.endExtension):this.endExtensionEntity=this.sdk.viewer.entities.add({show:this.options.show,polyline:{positions:Cesium.Cartesian3.fromDegreesArray(this.endExtension),width:this.options.width,clampToGround:!0,material:this.getMaterial(this.options.color,2),zIndex:99999999}})),this.entity?this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArray(t):this.entity=this.sdk.viewer.entities.add({show:this.options.show,polyline:{positions:Cesium.Cartesian3.fromDegreesArray(t),width:this.options.width,clampToGround:!0,material:this.getMaterial(this.options.color,0),zIndex:99999999}})}},{key:"pickStartPos",value:function(e){var t=this;this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=new Q("左键选择起点坐标,右键取消",this.sdk),this.event=new K(this.sdk),this.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)}));var i=function(i,n){var o=t.cartesian3Towgs84(n,t.sdk.viewer);t.startLng=o.lng,t.startLat=o.lat,e(o),!t.startEntity&&(t.startEntity=t.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(t.startLng,t.startLat))}),!1),billboard:{image:t.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),t.startEntity.show=!0,t.tip&&t.tip.destroy(),t.event&&t.event.destroy()};this.event.mouse_left(i),this.event.mouse_right((function(e,i){t.tip&&t.tip.destroy(),t.event&&t.event.destroy()})),this.event.gesture_pinck_start((function(e,n){var o=new Date;e.position1.x,e.position2.x,e.position1.y,e.position2.y;t.event.gesture_pinck_end((function(){new Date-o>=500?(t.tip&&t.tip.destroy(),t.event&&t.event.destroy()):i(0,n)}))}))}},{key:"pickEndPos",value:function(e){var t=this;this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=new Q("左键选择终点坐标,右键取消",this.sdk),this.event=new K(this.sdk),this.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(i,n){var o=t.cartesian3Towgs84(n,t.sdk.viewer);t.endLng=o.lng,t.endLat=o.lat,e(o),!t.endEntity&&(t.endEntity=t.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(t.endLng,t.endLat))}),!1),billboard:{image:t.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),t.endEntity.show=!0,t.tip&&t.tip.destroy(),t.event&&t.event.destroy()})),this.event.mouse_right((function(e,i){t.tip&&t.tip.destroy(),t.event&&t.event.destroy()}))}},{key:"flicker",value:function(){}}],[{key:"EventBinding",value:function(e,t){for(var i=function(){var i=[],o=!1,s=[];if(!t[n]||!t[n].attributes)return 1;var a,r=cy(t[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==t[n].type?(i.push((function(t){e[r.value]=t.target.checked})),t[n].checked=e[r.value]):(i.push((function(t){var i=t.target.value;"number"==t.target.type?"."==t.data||"-"==t.data&&!t.target.value||(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),e[r.value]=i):e[r.value]=i})),"IMG"==t[n].nodeName?t[n].src=e[r.value]:t[n].value=e[r.value]),e._elms[r.value]?e._elms[r.value].push(t[n]):e._elms[r.value]=[t[n]],s.push(r.name);break;case"@click":t[n].addEventListener("click",(function(t){"function"==typeof e[r.value]&&e[r.value](t)})),s.push(r.name);break;case"@change":o=!0,i.push((function(t){var i=t.target.value;"number"==t.target.type&&""!=i&&(i=Number(i),t.target.value=i),"function"==typeof e[r.value]&&e[r.value](t,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(e){r.e(e)}finally{r.f()}for(var c=0;c<s.length;c++)t[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==t[n].tagName&&"checkbox"!=t[n].type||(u="change"),t[n].addEventListener(u,(function(e){for(var t=0;t<i.length;t++)i[t](e)}))}},n=0;n<t.length;n++)i()}}]);var i}(Vn);function my(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 fy(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?my(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):my(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var vy,gy=function(){var e=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w,k,_;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=0,n=1,o=20,s=[],py&&!py.isDestroy&&(py.close(),py=null),r=function(){for(var e="",t=0;t<s.length;t++){var i='<tr class="el-table__row">',n="";for(var o in"fid"in s[t].properties&&(n='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(t,' el-table__cell"><div class="cell">').concat(s[t].properties.fid,"</div></td>")),s[t].properties)"id"!==o&&"ID"!==o&&"fid"!==o&&(n+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(t,' el-table__cell"><div class="cell">').concat(s[t].properties[o],"</div></td>"));e+=i=i+n+"</tr>"}return e},e.next=8,new J(t.viewer._container,{title:"",left:"17%",top:"100px"});case 8:return py=e.sent,e.next=11,py.init();case 11:for(y in l=A()(t.geojson.features),i=l.length,s=l.slice(o*(n-1),o*n),c=r(),(u=document.createElement("div")).style.height="100%",'<div class="search-box" style="display: flex;margin-bottom: 10px;"><input class="input" type="text" placeholder="输入关键字搜索" style="width: 180px; margin-right: 10px;"><button class="btn search">搜索</button><button type="button" style="position: absolute;right:20px;" class="el-button el-button--primary is-plain export"><span>导出</span></button></div>',h='<div class="el-table el-table--fit el-table--border el-table--scrollable-x el-table--scrollable-y el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%; height: calc(100% - 100px);">',p='<div class="el-table__header-wrapper"><table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 1213px;">',d="<colgroup>",m='<thead class="has-gutter"><tr>',f='<div class="el-table__body-wrapper is-scrolling-none" style="height: 620px;"><table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 1186px;">',v="<colgroup>",g=1,"fid"in t.geojson.features[0].properties&&(d+='<col name="el-table_1_column_'.concat(g,'" width="150">'),v+='<col name="el-table_1_column_'.concat(g,'" width="150">'),m+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(g,' is-leaf el-table__cell"><div class="cell">fid</div></th>'),g++),t.geojson.features[0].properties)"id"!==y&&"ID"!==y&&"fid"!==y&&(d+='<col name="el-table_1_column_'.concat(g,'" width="150">'),v+='<col name="el-table_1_column_'.concat(g,'" width="150">'),m+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(g,' is-leaf el-table__cell"><div class="cell">').concat(y,"</div></th>"),g++);'<div class="el-table__empty-block" style="height: 100%;"><span class="el-table__empty-text">暂无数据</span></div>',h=h+(p=p+(d+='<col name="gutter" width="17"></colgroup>')+(m+="</tr></thead>")+"</table></div>")+(f=f+(v+="</colgroup>")+("<tbody>"+c+"</tbody>")+'</table><div class="el-table__empty-block" style="height: 100%;"><span class="el-table__empty-text">暂无数据</span></div></div>')+"</div>",u.innerHTML='<div class="search-box" style="display: flex;margin-bottom: 10px;"><input class="input" type="text" placeholder="输入关键字搜索" style="width: 180px; margin-right: 10px;"><button class="btn search">搜索</button><button type="button" style="position: absolute;right:20px;" class="el-button el-button--primary is-plain export"><span>导出</span></button></div>'+h+'<div class="pagination"></div>',b=u.getElementsByClassName("el-table__empty-block")[0],0==s.length?b.style.display="flex":b.style.display="none",py.contentAppChild(u),C=u.getElementsByClassName("el-table__header-wrapper")[0],(w=u.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(e){C.scrollLeft=e.target.scrollLeft})),py._element.title.style.height="40px",py._element.body.style.width="65%",py._element.body.style.height="80%",py._element.content.style.height="calc(100% - 40px)",py._element.content.style.overflow="hidden",py._element.foot.style.display="none",w.style.height="calc(100% - ".concat(C.offsetHeight,"px)"),An(k=u.getElementsByClassName("pagination")[0],i,o,n,(function(e){n=e,s=l.slice(o*(n-1),o*n);var t=r();u.getElementsByTagName("tbody")[0].innerHTML=t,0==s.length?b.style.display="flex":b.style.display="none"})),_=function(){for(var e=u.getElementsByClassName("search-box")[0].getElementsByTagName("input")[0],a=[],c=0;c<t.geojson.features.length;c++)for(var h in t.geojson.features[c].properties){if(-1!=(t.geojson.features[c].properties[h]+"").indexOf(e.value)){a.push(t.geojson.features[c]);break}}i=(l=a).length,0==(s=l.slice(o*(n-1),o*n)).length?b.style.display="flex":b.style.display="none";var p=r();u.getElementsByTagName("tbody")[0].innerHTML=p,An(k,i,o,n,(function(e){n=e,s=l.slice(o*(n-1),o*n);var t=r();u.getElementsByTagName("tbody")[0].innerHTML=t,0==s.length?b.style.display="flex":b.style.display="none"}))},u.getElementsByClassName("search")[0].addEventListener("click",(function(){o=20,n=1,_()})),u.getElementsByClassName("export")[0].addEventListener("click",(function(){for(var e=[],i=0;i<t.geojson.features.length;i++)e.push(fy(fy({},t.geojson.features[i].properties),{},{positions:JSON.stringify(t.geojson.features[i].geometry.positions)}));t.exportExcel(e)}));case 55:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),yy=function(){var e=o()(a.a.mark((function e(t,i){var n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w,k,_,x,E,S,P;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:vy&&!vy.isDestroy&&(vy.close(),vy=null),n=[],o=function(){for(var e="",t=0;t<n.length;t++){var i='<tr class="el-table__row">',o="";for(var s in"fid"in n[t].properties&&(o='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(t,' el-table__cell"><div class="cell">').concat(n[t].properties.fid,"</div></td>")),n[t].properties)"id"!==s&&"ID"!==s&&"fid"!==s&&(o+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(t,' el-table__cell"><div class="cell">').concat(n[t].properties[s],"</div></td>"));e+=i=i+o+"</tr>"}return e},s=!1,r=0;case 5:if(!(r<t.geojson.features.length)){e.next=13;break}if(!t.geojson.features[r].properties.id||t.geojson.features[r].properties.id!=i){e.next=10;break}return n=[t.geojson.features[r]],s=!0,e.abrupt("break",13);case 10:r++,e.next=5;break;case 13:if(s){e.next=16;break}return window.ELEMENT&&window.ELEMENT.Message({message:"数据不存在!",type:"warning",duration:1500}),e.abrupt("return");case 16:return e.next=18,new J(t.viewer._container,{title:i,left:"17%",top:"100px"});case 18:return vy=e.sent,e.next=21,vy.init();case 21:for(g in l=o(t),(c=document.createElement("div")).style.height="100%",u='<div class="el-table el-table--fit el-table--border el-table--scrollable-x el-table--scrollable-y el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%; height: 100%;">',h='<div class="el-table__header-wrapper"><table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 930px;">',p="<colgroup>",d='<thead class="has-gutter"><tr>',m='<div class="el-table__body-wrapper is-scrolling-none" style="height: 620px;"><table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 913px;">',f="<colgroup>",v=1,"fid"in t.geojson.features[0].properties&&(p+='<col name="el-table_1_column_'.concat(v,'" width="150">'),f+='<col name="el-table_1_column_'.concat(v,'" width="150">'),d+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(v,' is-leaf el-table__cell"><div class="cell">fid</div></th>'),v++),t.geojson.features[0].properties)"id"!==g&&"ID"!==g&&"fid"!==g&&(p+='<col name="el-table_1_column_'.concat(v,'" width="150">'),f+='<col name="el-table_1_column_'.concat(v,'" width="150">'),d+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(v,' is-leaf el-table__cell"><div class="cell">').concat(g,"</div></th>"),v++);if(y='\n <DIV-cy-tabs id="shp-list-id-tabs">\n <DIV-cy-tab-pane label="属性列表">\n '.concat((u=u+(h=h+(p+='<col name="gutter" width="17"></colgroup>')+(d+="</tr></thead>")+"</table></div>")+(m=m+(f+="</colgroup>")+("<tbody>"+l+"</tbody>")+"</table></div>")+"</div>")+'<div class="pagination"></div>',"\n </DIV-cy-tab-pane>\n "),n[0].content&&n[0].content.richTextContent&&(b='\n <DIV-cy-tab-pane class="editor-content-view" label="富文本信息">\n '.concat(n[0].content.richTextContent,"\n </DIV-cy-tab-pane>\n "),y+=b),n[0].content&&n[0].content.link&&n[0].content.link.content&&n[0].content.link.content.length>0)for(C=0;C<n[0].content.link.content.length;C++)w=n[0].content.link.content[C].url,k='\n <DIV-cy-tab-pane class="editor-content-view" label="'.concat(n[0].content.link.content[C].name,'">\n <iframe src="').concat(w,'"></iframe>\n </DIV-cy-tab-pane>\n '),y+=k;for(y+="</DIV-cy-tabs>",c.innerHTML=y,vy.contentAppChild(c),new En("shp-list-id-tabs"),(_=c.getElementsByClassName("DIV-cy-tabs")[0]).style.height="100%",_.style.display="flex",_.style.flexDirection="column",_.getElementsByClassName("DIV-cy-tab-content")[0].style.flex="1",x=_.getElementsByClassName("DIV-cy-tab-content-pane"),E=0;E<x.length;E++)x[E].style.height="100%";S=c.getElementsByClassName("el-table__header-wrapper")[0],(P=c.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(e){S.scrollLeft=e.target.scrollLeft})),vy._element.title.style.height="40px",vy._element.body.style.width="65%",vy._element.body.style.height="80%",vy._element.content.style.height="calc(100% - 40px)",vy._element.foot.style.display="none",P.style.height="calc(100% - ".concat(S.offsetHeight,"px)");case 64:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}();function by(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Cy(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)?Cy(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Cy(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 wy(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 ky(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?wy(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):wy(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function _y(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var xy,Ey=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(i=_y(this,t,[e,n])).viewer=e.viewer,i.options.path?(i.options.fileName=n.fileName||"未命名对象",i.options.field=n.field||"id",i.options.color=n.color||"rgba(0,255,184,0.5)",i.options.show=!n.show&&!1!==n.show||n.show,i.total=0,i.page=1,i.pageSize=20,i.currentData=[],i.data=[],i.list=[],i.imgEntity=[],i.Dialog=o,i._elms={},i):(i.error="未提供路径!",window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:i.error,type:"warning",duration:1500})),console.warn(i.error),an()(i))}return un()(t,e),x()(t,[{key:"show",get:function(){return this.options.show},set:function(e){this.setShow(e)}},{key:"on",value:function(){if(this.options.path)return this.init()}},{key:"init",value:(r=o()(a.a.mark((function e(){var i,n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i="",this.options.host=this.options.host||p(),i=this.options.host.endsWith("yjearth4.0")?this.options.host+"/api/v1/vector/load":this.options.host+"/yjearth4.0/api/v1/vector/load",i+="?path="+this.options.path,e.next=6,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 6:if(200!==(n=e.sent).status){e.next=19;break}return e.next=10,n.json();case 10:if(200!==(o=e.sent).code&&0!==o.code){e.next=18;break}return this.data=o.data,e.next=15,this.formatData();case 15:return e.abrupt("return",t.create(this));case 18:return e.abrupt("return",console.error(o.message));case 19:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"formatData",value:(s=o()(a.a.mark((function e(){var t,i,n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=function(e){if(e.data){var o;(o=i.list).push.apply(o,A()(e.data));for(var s=0;s<e.data.length;s++){var a=void 0,r=void 0,l=void 0,c=void 0,u=void 0;if(e.data[s].points){a=A()(e.data[s].points);for(var h=0;h<a.length;h++)t.push({id:a[h].attr.id,type:"Feature",geometry:{type:"Point",coordinates:[a[h].x,a[h].y,a[h].z],range:a[h].range,positions:{x:a[h].x,y:a[h].y,z:a[h].z}},properties:a[h].attr?ky({},a[h].attr):{}})}if(e.data[s].polylines){r=A()(e.data[s].polylines);for(var p=0;p<r.length;p++){for(var d=[],m=0;m<r[p].positions.length;m++)d.push([r[p].positions[m].x,r[p].positions[m].y,r[p].positions[m].z]);t.push({id:r[p].attr.id,type:"Feature",geometry:{type:"LineString",coordinates:d,range:r[p].range,positions:r[p].positions},properties:r[p].attr?ky({},r[p].attr):{}})}}if(e.data[s].polygons){l=A()(e.data[s].polygons);for(var f=0;f<l.length;f++){for(var v=[],g=0;g<l[f].positions.length;g++)v.push([l[f].positions[g].x,l[f].positions[g].y]);t.push({id:l[f].attr.id,type:"Feature",geometry:{type:"Polygon",coordinates:[v],range:l[f].range,positions:l[f].positions},properties:l[f].attr?ky({},l[f].attr):{}})}}if(e.data[s].multi_polylines){c=A()(e.data[s].multi_polylines);for(var y=0;y<c.length;y++){for(var b=[],C=[],w=0;w<c[y].polylines.length;w++){var k=[];C.push(c[y].polylines[w].positions);for(var _=0;_<c[y].polylines[w].positions.length;_++)k.push([c[y].polylines[w].positions[_].x,c[y].polylines[w].positions[_].y,c[y].polylines[w].positions[_].z]);b.push(k)}t.push({id:c[y].attr.id,type:"Feature",geometry:{type:"MultiLineString",coordinates:b,range:c[y].range,positions:C},properties:c[y].attr?ky({},c[y].attr):{}})}}if(e.data[s].multi_polygons){u=A()(e.data[s].multi_polygons);for(var x=0;x<u.length;x++){for(var E=[],S=[],P=0;P<u[x].polygons.length;P++){var D=[];S.push(u[x].polygons[P].positions);for(var M=0;M<u[x].polygons[P].positions.length;M++)D.push([u[x].polygons[P].positions[M].x,u[x].polygons[P].positions[M].y,u[x].polygons[P].positions[M].z]);E.push(D)}t.push({id:u[x].attr.id,type:"Feature",geometry:{type:"MultiPolygon",coordinates:[E],range:u[x].range,positions:S},properties:u[x].attr?ky({},u[x].attr):{}})}}}}if(e.children)for(var T=0;T<e.children.length;T++)n(e.children[T])},t=[],i=this,n(this.data),t.sort((function(e,t){return Number(e.properties.fid)-Number(t.properties.fid)})),this.geojson={type:"FeatureCollection",features:t};case 6:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"fileName",get:function(){return this.options.fileName},set:function(e){this.options.fileName=e,this._elms.fileName&&(this._elms.fileName.value=e)}},{key:"field",get:function(){return this.options.field},set:function(e){this.options.field=e,this._elms.field&&(this._elms.field.value=e)}},{key:"onClick",get:function(){return this.clickCallBack},set:function(e){e&&"function"!=typeof e?console.error("val:",e,"不是一个function"):this.clickCallBack=e}},{key:"img",get:function(){return this.options.img},set:function(e){Array.isArray(e)||(e=[e]),this.options.img=e,t.createImage(this)}},{key:"color",get:function(){return this.options.color},set:function(e){this.options.color=e,this.entity.entities.values.forEach((function(t){t.billboard&&(t.billboard.color=e),t.polygon&&(t.polygon.material=Cesium.Color.fromCssColorString(e)),t.polyline&&(t.polyline.material=Cesium.Color.fromCssColorString(e))}))}},{key:"leftClickCB",value:function(e,t,i,n){n.clickCallBack&&"function"==typeof n.clickCallBack&&n.clickCallBack(e,t,i)}},{key:"edit",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h=this,p=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=p.length>0&&void 0!==p[0]&&p[0],i=p.length>1&&void 0!==p[1]?p[1]:{},this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=25;break}return e.next=7,new pn(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(e){h.fileName=h.fileName.trim(),h.fileName||(h.fileName="未命名对象"),h.originalOptions.fileName=h.fileName,h.originalOptions.field=h.field,h._DialogObject.close(),i.confirmCallBack&&i.confirmCallBack({id:h.options.id,fileName:h.originalOptions.fileName,field:h.originalOptions.field})},closeCallBack:function(){h.reset(),i.closeCallBack&&i.closeCallBack()}});case 7:for(c in this._DialogObject=e.sent,n='\n <div class="row">\n <div class="col">\n <span class="label">文件名称:</span>\n <input class="input flie-name" type="text">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">名称字段选择:</span>\n <select class="input input-select">\n </select>\n </div>\n </div>\n ',(o=document.createElement("div")).innerHTML=n,this._DialogObject.contentAppChild(o),(s=o.getElementsByClassName("flie-name")[0]).value=this.options.fileName,s.addEventListener("input",(function(){h.options.fileName=s.value})),r=o.getElementsByClassName("input-select")[0],l="",this.geojson.features[0].properties)u='<option value="'.concat(c,'">').concat(c,"</option>"),l+=u;r.innerHTML=l,r.value=this.options.field,r.addEventListener("input",(function(){h.options.field=r.value})),this._elms.fileName=s,this._elms.field=r,e.next=26;break;case 25:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 26:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"editById",value:(i=o()(a.a.mark((function e(){var t,i,n,s,r,l,c,u,h,p,d,m,f,v,g,y,b=this,C=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=C.length>0&&void 0!==C[0]&&C[0],i=C.length>1?C[1]:void 0,n=C.length>2&&void 0!==C[2]?C[2]:{},this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),s="",!t){e.next=48;break}l={},c=0;case 8:if(!(c<this.geojson.features.length)){e.next=16;break}if(this.geojson.features[c].properties.id!==i){e.next=13;break}return this.geojson.features[c].content&&(l=this.deepCopyObj(this.geojson.features[c].content)),r=c,e.abrupt("break",16);case 13:c++,e.next=8;break;case 16:return l.id=l.id||i,l.link||(l.link={}),l.link.content||(l.link.content=[]),l.camera||(l.camera=[]),l.richTextContent||(l.richTextContent=""),l.attributeType=l.attributeType||"richText",e.next=24,new pn(this.sdk,l,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(){b._DialogObject.close(),b.geojson.features[r].content=b.deepCopyObj(b._DialogObject.attribute),n.confirmCallBack&&n.confirmCallBack(b._DialogObject.attribute)},closeCallBack:function(){n.closeCallBack&&n.closeCallBack()}});case 24:for(this._DialogObject=e.sent,this._DialogObject.event=n,this._DialogObject.attribute=this.deepCopyObj(l),u='\n <div class="row">\n <div class="col">\n <span class="label">内容类型:</span>\n <select class="input input-select attribute-select" style="width: 120px;">\n <option value="richText">富文本</option>\n \x3c!--<option value="link">链接</option>\n <option value="camera">摄像头</option>\n <option value="sensor">传感器</option>\n <option value="vr">全景图</option>--\x3e\n </select>\n </div>\n <div class="col attribute-content attribute-content-link">\n <div class="input-group">\n <input class="input link_add" type="text">\n <button class="link_add_btn">+</button>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-richText">\n <span>编辑内容:<button class="open-richText-btn">打开文本编辑器</button></span>\n </div>\n <div class="attribute-content attribute-content-link">\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">名称</div>\n <div class="th">链接</div>\n <div class="th">操作</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-camera">\n <div class="row">\n <div class="col">\n <span class="label">编辑内容:</span>\n <input class="input camera-name" type="text" style="width: 100px;">\n <button class="select btn camera-select">搜索</button>\n </div>\n </div>\n <div>\n <div class="table camera-table">\n <div class="table-head">\n <div class="tr">\n <div class="th">操作</div>\n <div class="th">设备名称</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备类型</div>\n <div class="th" style="width: 126px; flex: 0 126px;min-width: 126px;">设备IP</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备端口</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">用户名</div>\n <div class="th">密码</div>\n </div>\n </div>\n <div class="table-body" style="display:none;">\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="2">\n <span>绑定</span>\n </div>\n <div class="td">设备名称</div>\n <div class="td">设备类型</div>\n <div class="td">设备IP</div>\n <div class="td">设备端口</div>\n <div class="td">用户名</div>\n <div class="td">密码</div>\n </div>\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class=""row>\n <ul class="pagination"></ul>\n </div>\n </div>\n ',(h=document.createElement("div")).innerHTML=u,this._DialogObject.contentAppChild(h),h.getElementsByTagName("*"),this._DialogObject._element.body.style.width="600px",p=h.getElementsByClassName("attribute-select")[0],d=h.getElementsByClassName("link_add_btn")[0],m=h.getElementsByClassName("open-richText-btn")[0],f=this._DialogObject._element.content.getElementsByClassName("attribute-content"),v=0;v<f.length;v++)f[v].className.indexOf("attribute-content-"+this._DialogObject.attribute.attributeType)>-1?f[v].style.display="block":f[v].style.display="none";p.addEventListener("change",(function(){b._DialogObject.attribute.attributeType=p.value;for(var e=0;e<f.length;e++)f[e].className.indexOf("attribute-content-"+b._DialogObject.attribute.attributeType)>-1?f[e].style.display="block":f[e].style.display="none"})),d.addEventListener("click",o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(b._DialogObject.attribute.link.content.push({name:"链接",url:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),b._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",b.setAttributeLinkById(i,b._DialogObject.attribute.link.content)):n.clickAddLink&&n.clickAddLink(i);case 1:case"end":return e.stop()}}),e)})))),m.addEventListener("click",(function(){Bn.open(i,i,b._DialogObject.attribute.richTextContent),Bn.primaryCallBack=function(e){b._DialogObject.attribute.richTextContent=e}})),g=h.getElementsByClassName("camera-name")[0],y=h.getElementsByClassName("camera-select")[0],g.addEventListener("input",(function(){s=g.value})),this.cameraSelect&&this.cameraSelect(s),y.addEventListener("click",(function(){b.cameraSelect&&b.cameraSelect(s)})),e.next=49;break;case 48:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 49:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"editContentById",value:function(e,t){for(var i=0;i<this.geojson.features.length;i++)if(this.geojson.features[i].properties.id===e){this.geojson.features[i].content=t;break}}},{key:"reset",value:function(){this.fileName=this.originalOptions.fileName,this.field=this.originalOptions.field}},{key:"addAttributeLinkById",value:function(e,t,i){this._DialogObject&&this._DialogObject.attribute&&this._DialogObject.attribute.id==e&&(i||0===i?this._DialogObject._element.body.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("tr")[i+1].getElementsByClassName("file-select")[0].value=t:(this._DialogObject.attribute.link.content.push({name:"链接",url:t}),this.setAttributeLinkById(e,this._DialogObject.attribute.link.content)))}},{key:"setAttributeLinkById",value:function(e,t){var i,n=this;if(this._DialogObject&&this._DialogObject.attribute&&this._DialogObject.attribute.id==e){this._DialogObject.attribute.link.content=t;var s=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],r=s.getElementsByClassName("table-body")[0];r.innerHTML="",this._DialogObject.attribute.link.content.length>0?s.getElementsByClassName("table-empty")[0].style.display="none":s.getElementsByClassName("table-empty")[0].style.display="flex";for(var l=0;l<this._DialogObject.attribute.link.content.length;l++){var c='\n <div class="tr">\n <div class="td">'+this._DialogObject.attribute.link.content[l].name+'</div>\n <div class="td">'+this._DialogObject.attribute.link.content[l].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',u=document.createRange().createContextualFragment(c);r.appendChild(u)}for(var h=r.getElementsByClassName("tr"),p={linkEdit:(i=o()(a.a.mark((function t(i){var o,s,r,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.setAttributeLinkById(e,n._DialogObject.attribute.link.content);case 2:o=n._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],s=o.getElementsByClassName("table-body")[0],r=s.getElementsByClassName("tr"),l=a.a.mark((function e(t){var o,s,l,c,u,h;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==t){e.next=33;break}r[t].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <div class="input-group">\n <input class="input file-select" type="text" style="width: 200px;">\n <button @click="fileSelect">...</button>\n </div>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',(o=r[t].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].name,o[1].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].url,s=r[t].getElementsByTagName("button"),l=0;case 8:if(!(l<s.length)){e.next=32;break}if(s[l]&&s[l].attributes){e.next=11;break}return e.abrupt("continue",29);case 11:c=by(s[l].attributes),e.prev=12,h=a.a.mark((function e(){var i;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("@click"!==(i=u.value).name){e.next=5;break}return s[l].addEventListener("click",(function(e){"function"==typeof p[i.value]&&p[i.value]({name:o[0].getElementsByClassName("input")[0].value,url:o[1].getElementsByClassName("input")[0].value},t)})),s[l].attributes.removeNamedItem(i.name),e.abrupt("return",1);case 5:case"end":return e.stop()}}),e)})),c.s();case 15:if((u=c.n()).done){e.next=21;break}return e.delegateYield(h(),"t0",17);case 17:if(!e.t0){e.next=19;break}return e.abrupt("break",21);case 19:e.next=15;break;case 21:e.next=26;break;case 23:e.prev=23,e.t1=e.catch(12),c.e(e.t1);case 26:return e.prev=26,c.f(),e.finish(26);case 29:l++,e.next=8;break;case 32:return e.abrupt("return",1);case 33:case"end":return e.stop()}}),e,null,[[12,23,26,29]])})),c=0;case 7:if(!(c<r.length)){t.next=14;break}return t.delegateYield(l(c),"t0",9);case 9:if(!t.t0){t.next=11;break}return t.abrupt("break",14);case 11:c++,t.next=7;break;case 14:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),linkDelete:function(t){n._DialogObject.attribute.link.content.splice(t,1),n.setAttributeLinkById(e,n._DialogObject.attribute.link.content)},confirmEdit:function(t,i){n._DialogObject.attribute.link.content[i]=t,n.setAttributeLinkById(e,n._DialogObject.attribute.link.content)},cancelEdit:function(){n.setAttributeLinkById(e,n._DialogObject.attribute.link.content)},fileSelect:function(t,i){n._DialogObject.event&&n._DialogObject.event.clickAddLink&&n._DialogObject.event.clickAddLink(e,i)}},d=function(e){for(var t=h[e].getElementsByTagName("button"),i=0;i<t.length;i++)if(t[i]&&t[i].attributes){var n,o=by(t[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return t[i].addEventListener("click",(function(t){"function"==typeof p[o.value]&&p[o.value](e)})),t[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(e){o.e(e)}finally{o.f()}}},m=0;m<h.length;m++)d(m)}for(var f=0;f<this.dataArray.length;f++)if(this.dataArray[f].attr.id===e){this.dataArray[f].content&&(this.opt_DialogObject.attribute.link.content=v);break}}},{key:"getAllNode",value:function(){return this.data}},{key:"openAllNodeList",value:function(){gy(this)}},{key:"openNodeListById",value:function(e){yy(this,e)}},{key:"flyTo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e){for(var i=0;i<this.geojson.features.length;i++)if(this.geojson.features[i].properties.id===e){var n=this.geojson.features[i].geometry.range;n&&(pi(0),ni(this.sdk),oi(this.sdk),this.viewer.camera.flyTo({orientation:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},destination:Cesium.Rectangle.fromDegrees(n.min_x,n.min_y,n.max_x,n.max_y)}))}}else this.range&&(pi(0),ni(this.sdk),oi(this.sdk),this.viewer.camera.flyTo({orientation:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},destination:Cesium.Rectangle.fromDegrees(this.range.min_x,this.range.min_y,this.range.max_x,this.range.max_y)}))}},{key:"setShow",value:function(e,t){if(t)for(var i=0;i<this.entity.entities.values.length;i++)this.entity.entities.values[i].id&&this.entity.entities.values[i].id.startsWith(t)&&(this.entity.entities.values[i].show=e);else{this.options.show=e;for(var n=0;n<this.entity.entities.values.length;n++)this.entity.entities.values[n].show=e}}},{key:"setShowImg",value:function(e,t){if(t||0===t){for(var i=0;i<this.imgEntity.length;i++)if(i==t){this.imgEntity[i].show=e;break}}else for(var n=0;n<this.imgEntity.length;n++)this.imgEntity[n].show=e}},{key:"remove",value:function(){this.viewer.dataSources.remove(this.entity,!0),this.removeImage(),this.entity=null,this.geojson={},this.data={}}},{key:"removeImage",value:function(){for(var e=0;e<this.imgEntity.length;e++)this.sdk.viewer.entities.remove(this.imgEntity[e]);this.imgEntity=[]}},{key:"cameraSelect",value:function(e,t){var i=this,n={1:"海康",2:"大华"},o=this.options.host;if(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content){var s=that._DialogObject._element.content.getElementsByClassName("pagination")[0],a=that._DialogObject._element.content.getElementsByClassName("attribute-content-camera")[0];if(s&&a){An(s,1,10,1);var r="",l={cameraName:e,page:t&&"object"!==N()(t)?t:1,pageSize:5},c=new URLSearchParams(l).toString();r=o.endsWith("yjearth4.0")?"".concat(o,"/api/v1/cameraData/list?").concat(c):"".concat(o,"/yjearth4.0/api/v1/cameraData/list?").concat(c),fetch(r,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(t){200===t.status&&t.json().then((function(t){if(200===t.code||0===t.code){if(!i._DialogObject||!i._DialogObject._element||!i._DialogObject._element.content)return;var o=i._DialogObject._element.content.getElementsByClassName("pagination")[0],s=i._DialogObject._element.content.getElementsByClassName("camera-table")[0],a=s.getElementsByClassName("table-body")[0];if(a.innerHTML="",t.data){if(t.data.list&&t.data.list.length>0){An(o,t.data.total,10,1,(function(t){i.cameraSelect&&i.cameraSelect(e,t)})),s.getElementsByClassName("table-empty")[0].style.display="none",a.style.display="inline-flex";for(var r=function(e){var o='\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="'.concat(t.data.list[e].ID,'">\n <span>绑定</span>\n </div>\n <div class="td">').concat(t.data.list[e].cameraName,'</div>\n <div class="td" style="width: 80px; flex: 0 80px; min-width: 80px;">').concat(n[t.data.list[e].type],'</div>\n <div class="td" style="width: 126px; flex: 0 126px;min-width: 126px;">').concat(t.data.list[e].ip,'</div>\n <div class="td" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(t.data.list[e].port,'</div>\n <div class="td" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(t.data.list[e].userName,'</div>\n <div class="td">').concat(t.data.list[e].passWord,"</div>\n </div>"),s=document.createRange().createContextualFragment(o),r=s.querySelector('input[type="checkbox"]');r.addEventListener("change",(function(){if(r.checked)i._DialogObject.attribute.camera.push(t.data.list[e]);else{var n=i._DialogObject.attribute.camera.filter((function(i){return i.ID!==t.data.list[e].ID}));i._DialogObject.attribute.camera=n}})),a.appendChild(s);for(var l=0;l<i._DialogObject.attribute.camera.length;l++)if(i._DialogObject.attribute.camera[l].ID===t.data.list[e].ID){r.checked=!0;break}},l=0;l<t.data.list.length;l++)r(l)}t.data&&t.data.total&&An(o,t.data.total,10,1,(function(t){i.cameraSelect&&i.cameraSelect(e,t)}))}else An(o,1,10,1),s.getElementsByClassName("table-empty")[0].style.display="flex",a.style.display="none"}else console.error(t.message)}))}))}}}},{key:"flicker",value:function(){}}],[{key:"create",value:function(e){var i=turf.bbox(e.geojson);e.range={max_x:i[2],max_y:i[3],min_x:i[0],min_y:i[1]},e.options.img&&t.createImage(e);var n=function(t){var i=e.options.color;if(t){switch(t._value){case 1:i="rgba(255,0,0,1)";break;case 2:i="rgba(255,126,0,1)";break;case 3:i="rgba(255,250,0,1)";break;case 4:i="rgba(0,102,255,1)";break;case 5:i="rgba(0,255,0,1)"}return i}return i};return(new Cesium.GeoJsonDataSource).load(e.geojson,{clampToGround:!0}).then((function(t){e.entity=t,e.viewer.dataSources.add(t),t.entities.values.forEach((function(t){if(t.show=e.options.show,t.billboard&&(t.billboard.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND,t.point=new Cesium.PointGraphics({show:!0,color:Cesium.Color.fromCssColorString(n(t.properties.level)),pixelSize:10,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY})),t.polygon&&(t.polygon.perPositionHeight=!1,t.polygon.material=Cesium.Color.fromCssColorString(n(t.properties.level))),t.polyline){e.options.color;t.polyline.material=Cesium.Color.fromCssColorString(n(t.properties.level))}}))}))}},{key:"createImage",value:function(e){e.removeImage();for(var t=0;t<e.options.img.length;t++){var i=e.sdk.viewer.entities.add({show:e.options.show,rectangle:{coordinates:Cesium.Rectangle.fromDegrees(e.range.min_x,e.range.min_y,e.range.max_x,e.range.max_y),material:new Cesium.ImageMaterialProperty({image:e.options.img[t],transparent:!0})}});e.imgEntity.push(i)}}},{key:"calculationScope",value:function(e,t){var i=[];if(t.points)for(var n=0;n<t.points.length;n++)i.push(turf.point([t.points[n].position.x,t.points[n].position.y]));if(t.polylines)for(var o=0;o<t.polylines.length;o++)if(t.polylines[o].positions)for(var s=0;s<t.polylines[o].positions.length;s++)i.push(turf.point([t.polylines[o].positions[s].x,t.polylines[o].positions[s].y]));if(t.polygons)for(var a=0;a<t.polygons.length;a++)if(t.polygons[a].positions)for(var r=0;r<t.polygons[a].positions.length;r++)i.push(turf.point([t.polygons[a].positions[r].x,t.polygons[a].positions[r].y]));if(i.length>0){var l=turf.featureCollection(i),c=turf.envelope(l);c&&c.bbox&&4==c.bbox.length&&(e.range={max_x:c.bbox[2],max_y:c.bbox[3],min_x:c.bbox[0],min_y:c.bbox[1]})}}},{key:"createPoints",value:function(e,t){if(t){for(var i=new Cesium.PointPrimitiveCollection({scene:e.viewer.scene}),n=0;n<t.length;n++)t[n].attr.id||(t[n].attr.id=e.randomString()),i.add({id:t[n].attr.id,position:Cesium.Cartesian3.fromDegrees(t[n].x,t[n].y,t[n].z),color:Cesium.Color.RED,pixelSize:10,disableDepthTestDistance:Number.POSITIVE_INFINITY}),fe(t[n].attr.id,e.leftClickCB,e);e.entity.add(i)}}},{key:"createPolylines",value:function(e,t){if(t){for(var i=[],n=0;n<t.length;n++){t[n].attr.id||(t[n].attr.id=e.randomString());for(var o=t[n].positions,s=[],a=0;a<o.length;a++)s.push(o[a].x,o[a].y,o[a].z);var r=new Cesium.GroundPolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArrayHeights(s),width:4}),l=new Cesium.GeometryInstance({id:t[n].attr.id,geometry:r,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(t[n].COLOR||"rgba(0,255,184,0.5)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});i.push(l),fe(t[n].attr.id,e.leftClickCB,e)}i.length>0&&e.entity.add(new Cesium.GroundPolylinePrimitive({geometryInstances:i,appearance:new Cesium.PolylineColorAppearance}))}}},{key:"createPolygons",value:function(e,t){if(t){for(var i=[],n=0;n<t.length;n++){t[n].attr.id||(t[n].attr.id=e.randomString());for(var o=t[n].positions,s=[],a=0;a<o.length;a++)s.push(o[a].x,o[a].y,o[a].z);var r=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(s))}),l=new Cesium.GeometryInstance({id:t[n].attr.id,geometry:r,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(t[n].COLOR||"rgba(0,255,184,0.5)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});i.push(l),fe(t[n].attr.id,e.leftClickCB,e)}if(i.length>0){var c=new Cesium.GroundPrimitive({geometryInstances:i,appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,closed:!1})});e.entity.add(c)}}}},{key:"createTableContent",value:function(e){for(var t="",i=0;i<e.currentData.length;i++){var n='<tr class="el-table__row">',o="";for(var s in e.currentData[i].attr)o+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(i,' el-table__cell"><div class="cell">').concat(e.currentData[i].attr[s],"</div></td>");t+=n=n+o+"</tr>"}return t}}]);var i,n,s,r}(Vn);function Sy(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 Py(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Sy(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Sy(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Dy,My=function(){var e=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w,k,_;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=0,n=1,o=20,s=[],xy&&!xy.isDestroy&&(xy.close(),xy=null),r=function(){for(var e="",t=0;t<s.length;t++){var i='<tr class="el-table__row">',n="";for(var o in"fid"in s[t].properties&&(n='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(t,' el-table__cell"><div class="cell">').concat(s[t].properties.fid,"</div></td>")),s[t].properties)"id"!==o&&"ID"!==o&&"fid"!==o&&(n+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(t,' el-table__cell"><div class="cell">').concat(s[t].properties[o],"</div></td>"));e+=i=i+n+"</tr>"}return e},e.next=8,new J(t.viewer._container,{title:"",left:"17%",top:"100px"});case 8:return xy=e.sent,e.next=11,xy.init();case 11:for(y in l=A()(t.geojson.features),i=l.length,s=l.slice(o*(n-1),o*n),c=r(),(u=document.createElement("div")).style.height="100%",'<div class="search-box" style="display: flex;margin-bottom: 10px;"><input class="input" type="text" placeholder="输入关键字搜索" style="width: 180px; margin-right: 10px;"><button class="btn search">搜索</button><button type="button" style="position: absolute;right:20px;" class="el-button el-button--primary is-plain export"><span>导出</span></button></div>',h='<div class="el-table el-table--fit el-table--border el-table--scrollable-x el-table--scrollable-y el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%; height: calc(100% - 100px);">',p='<div class="el-table__header-wrapper"><table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 1213px;">',d="<colgroup>",m='<thead class="has-gutter"><tr>',f='<div class="el-table__body-wrapper is-scrolling-none" style="height: 620px;"><table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 1186px;">',v="<colgroup>",g=1,"fid"in t.geojson.features[0].properties&&(d+='<col name="el-table_1_column_'.concat(g,'" width="150">'),v+='<col name="el-table_1_column_'.concat(g,'" width="150">'),m+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(g,' is-leaf el-table__cell"><div class="cell">fid</div></th>'),g++),t.geojson.features[0].properties)"id"!==y&&"ID"!==y&&"fid"!==y&&(d+='<col name="el-table_1_column_'.concat(g,'" width="150">'),v+='<col name="el-table_1_column_'.concat(g,'" width="150">'),m+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(g,' is-leaf el-table__cell"><div class="cell">').concat(y,"</div></th>"),g++);'<div class="el-table__empty-block" style="height: 100%;"><span class="el-table__empty-text">暂无数据</span></div>',h=h+(p=p+(d+='<col name="gutter" width="17"></colgroup>')+(m+="</tr></thead>")+"</table></div>")+(f=f+(v+="</colgroup>")+("<tbody>"+c+"</tbody>")+'</table><div class="el-table__empty-block" style="height: 100%;"><span class="el-table__empty-text">暂无数据</span></div></div>')+"</div>",u.innerHTML='<div class="search-box" style="display: flex;margin-bottom: 10px;"><input class="input" type="text" placeholder="输入关键字搜索" style="width: 180px; margin-right: 10px;"><button class="btn search">搜索</button><button type="button" style="position: absolute;right:20px;" class="el-button el-button--primary is-plain export"><span>导出</span></button></div>'+h+'<div class="pagination"></div>',b=u.getElementsByClassName("el-table__empty-block")[0],0==s.length?b.style.display="flex":b.style.display="none",xy.contentAppChild(u),C=u.getElementsByClassName("el-table__header-wrapper")[0],(w=u.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(e){C.scrollLeft=e.target.scrollLeft})),xy._element.title.style.height="40px",xy._element.body.style.width="65%",xy._element.body.style.height="80%",xy._element.content.style.height="calc(100% - 40px)",xy._element.content.style.overflow="hidden",xy._element.foot.style.display="none",w.style.height="calc(100% - ".concat(C.offsetHeight,"px)"),An(k=u.getElementsByClassName("pagination")[0],i,o,n,(function(e){n=e,s=l.slice(o*(n-1),o*n);var t=r();u.getElementsByTagName("tbody")[0].innerHTML=t,0==s.length?b.style.display="flex":b.style.display="none"})),_=function(){for(var e=u.getElementsByClassName("search-box")[0].getElementsByTagName("input")[0],a=[],c=0;c<t.geojson.features.length;c++)for(var h in t.geojson.features[c].properties){if(-1!=(t.geojson.features[c].properties[h]+"").indexOf(e.value)){a.push(t.geojson.features[c]);break}}i=(l=a).length,0==(s=l.slice(o*(n-1),o*n)).length?b.style.display="flex":b.style.display="none";var p=r();u.getElementsByTagName("tbody")[0].innerHTML=p,An(k,i,o,n,(function(e){n=e,s=l.slice(o*(n-1),o*n);var t=r();u.getElementsByTagName("tbody")[0].innerHTML=t,0==s.length?b.style.display="flex":b.style.display="none"}))},u.getElementsByClassName("search")[0].addEventListener("click",(function(){o=20,n=1,_()})),u.getElementsByClassName("export")[0].addEventListener("click",(function(){for(var e=[],i=0;i<t.geojson.features.length;i++)e.push(Py(Py({},t.geojson.features[i].properties),{},{positions:JSON.stringify(t.geojson.features[i].geometry.coordinates)}));t.exportExcel(e)}));case 55:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ty=function(){var e=o()(a.a.mark((function e(t,i){var n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C,w,k,_,x,E,S,P;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Dy&&!Dy.isDestroy&&(Dy.close(),Dy=null),n=[],o=function(){for(var e="",t=0;t<n.length;t++){var i='<tr class="el-table__row">',o="";for(var s in"fid"in n[t].properties&&(o='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(t,' el-table__cell"><div class="cell">').concat(n[t].properties.fid,"</div></td>")),n[t].properties)"id"!==s&&"ID"!==s&&"fid"!==s&&(o+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(t,' el-table__cell"><div class="cell">').concat(n[t].properties[s],"</div></td>"));e+=i=i+o+"</tr>"}return e},s=!1,r=0;case 5:if(!(r<t.geojson.features.length)){e.next=13;break}if(!t.geojson.features[r].properties.id||t.geojson.features[r].properties.id!=i){e.next=10;break}return n=[t.geojson.features[r]],s=!0,e.abrupt("break",13);case 10:r++,e.next=5;break;case 13:if(s){e.next=16;break}return window.ELEMENT&&window.ELEMENT.Message({message:"数据不存在!",type:"warning",duration:1500}),e.abrupt("return");case 16:return e.next=18,new J(t.viewer._container,{title:i,left:"17%",top:"100px"});case 18:return Dy=e.sent,e.next=21,Dy.init();case 21:for(g in l=o(t),(c=document.createElement("div")).style.height="100%",u='<div class="el-table el-table--fit el-table--border el-table--scrollable-x el-table--scrollable-y el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%; height: 100%;">',h='<div class="el-table__header-wrapper"><table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 930px;">',p="<colgroup>",d='<thead class="has-gutter"><tr>',m='<div class="el-table__body-wrapper is-scrolling-none" style="height: 620px;"><table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 913px;">',f="<colgroup>",v=1,"fid"in t.geojson.features[0].properties&&(p+='<col name="el-table_1_column_'.concat(v,'" width="150">'),f+='<col name="el-table_1_column_'.concat(v,'" width="150">'),d+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(v,' is-leaf el-table__cell"><div class="cell">fid</div></th>'),v++),t.geojson.features[0].properties)"id"!==g&&"ID"!==g&&"fid"!==g&&(p+='<col name="el-table_1_column_'.concat(v,'" width="150">'),f+='<col name="el-table_1_column_'.concat(v,'" width="150">'),d+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(v,' is-leaf el-table__cell"><div class="cell">').concat(g,"</div></th>"),v++);if(y='\n <DIV-cy-tabs id="shp-list-id-tabs">\n <DIV-cy-tab-pane label="属性列表">\n '.concat((u=u+(h=h+(p+='<col name="gutter" width="17"></colgroup>')+(d+="</tr></thead>")+"</table></div>")+(m=m+(f+="</colgroup>")+("<tbody>"+l+"</tbody>")+"</table></div>")+"</div>")+'<div class="pagination"></div>',"\n </DIV-cy-tab-pane>\n "),n[0].content&&n[0].content.richTextContent&&(b='\n <DIV-cy-tab-pane class="editor-content-view" label="富文本信息">\n '.concat(n[0].content.richTextContent,"\n </DIV-cy-tab-pane>\n "),y+=b),n[0].content&&n[0].content.link&&n[0].content.link.content&&n[0].content.link.content.length>0)for(C=0;C<n[0].content.link.content.length;C++)w=n[0].content.link.content[C].url,k='\n <DIV-cy-tab-pane class="editor-content-view" label="'.concat(n[0].content.link.content[C].name,'">\n <iframe src="').concat(w,'"></iframe>\n </DIV-cy-tab-pane>\n '),y+=k;for(y+="</DIV-cy-tabs>",c.innerHTML=y,Dy.contentAppChild(c),new En("shp-list-id-tabs"),(_=c.getElementsByClassName("DIV-cy-tabs")[0]).style.height="100%",_.style.display="flex",_.style.flexDirection="column",_.getElementsByClassName("DIV-cy-tab-content")[0].style.flex="1",x=_.getElementsByClassName("DIV-cy-tab-content-pane"),E=0;E<x.length;E++)x[E].style.height="100%";S=c.getElementsByClassName("el-table__header-wrapper")[0],(P=c.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(e){S.scrollLeft=e.target.scrollLeft})),Dy._element.title.style.height="40px",Dy._element.body.style.width="65%",Dy._element.body.style.height="80%",Dy._element.content.style.height="calc(100% - 40px)",Dy._element.foot.style.display="none",P.style.height="calc(100% - ".concat(S.offsetHeight,"px)");case 64:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}();function Oy(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Ny(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)?Ny(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ny(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 By(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 Ay(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?By(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):By(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Ly(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function Iy(e,t,i){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,i)}function jy(e,t){return e.get(Fy(e,t))}function Ry(e,t,i){return e.set(Fy(e,t),i),i}function Fy(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var zy=i(38),Hy=new WeakMap,Vy=new WeakMap,Gy=new WeakMap,Wy=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,t),Iy(i=Ly(this,t,[e,n]),Hy,void 0),Iy(i,Vy,!1),Iy(i,Gy,[]),i.viewer=e.viewer,!i.options.path)return i.error="未提供路径!",window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:i.error,type:"warning",duration:1500})),console.warn(i.error),an()(i);for(var s in i.colors=zy,i.options.head_tables=n.head_tables||[],i.options.fileName=n.fileName||"未命名对象",i.options.path.endsWith(".kml")||(i.options.color=n.color||"rgba(0,255,184,0.5)",i.options.opacity=n.opacity||0===n.opacity?n.opacity:1),i.options.show=!n.show&&!1!==n.show||n.show,i.total=0,i.page=1,i.pageSize=20,i.currentData=[],i.data=[],i.list=[],i.imgEntity=[],i.Dialog=o,i._elms={},i.sdk.addIncetance(i.options.id,i),i.disaster_type_colors=zy[i.options.disaster_type]?Ay({},zy[i.options.disaster_type]):void 0,i.disaster_type_colors)i.disaster_type_colors[s]=i.cmykToRgb(i.disaster_type_colors[s]);return i}return un()(t,e),x()(t,[{key:"type",get:function(){return"vector"}},{key:"show",get:function(){return this.options.show},set:function(e){this.setShow(e)}},{key:"opacity",get:function(){return this.options.opacity},set:function(e){this.options.opacity=e,this.entity&&this.entity.entities.values.forEach((function(t){t.point&&(t.point.color=t.point.color._value.withAlpha(e)),t.polygon&&(t.polygon.material=t.polygon.material.color._value.withAlpha(e)),t.polyline&&(t.polyline.material=t.polyline.material.color._value.withAlpha(e))}))}},{key:"on",value:function(){if(this.sdk&&this.viewer&&this.options.path)return this.init()}},{key:"init",value:(l=o()(a.a.mark((function e(){var i,n,o,s,r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i="",this.options.host=this.options.host||p(),i=this.options.host.endsWith("yjearth4.0")?this.options.host+"/api/v1/vector/load2":this.options.host+"/yjearth4.0/api/v1/vector/load2",i+="?path="+this.options.path,e.next=6,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 6:if(200!==(n=e.sent).status){e.next=17;break}return e.next=10,n.arrayBuffer();case 10:return o=e.sent,s=new Uint8Array(o),r=this.decompressGzip(s),0===this.data.length&&(this.data=JSON.parse(r)),e.next=16,this.formatData();case 16:return e.abrupt("return",t.create(this));case 17:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"formatData",value:(r=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=[],i=function(e,t,n){if(e)if(Array.isArray(e)){for(var o=!1,s=0;s<e.length;s++){if("object"!==N()(e[s])){o=!0;break}i(e[s],t,n)}if(o){var a=Number(e[0]),r=Number(e[1]),l=proj4(t,n,[a,r]);e[0]=Number(l[0].toFixed(10)),e[1]=Number(l[1].toFixed(10))}}else e instanceof Object&&(i(e.coordinates,t,n),i(e.geometries,t,n))},n=0;n<this.data.list.length;n++){o=Oy(this.name_map);try{for(o.s();!(s=o.n()).done;)(r=y()(s.value,2))[0],(l=r[1]).def===this.data.list[n].crs_src&&l.epsg,l.def===this.data.list[n].crs_dst&&l.epsg}catch(e){o.e(e)}finally{o.f()}for(c=0;c<this.data.list[n].features.length;c++)this.data.list[n].features[c].properties.id,this.data.list[n].features[c].properties||(this.data.list[n].features[c].properties={}),this.data.list[n].features[c].properties.id||(this.data.list[n].features[c].properties.id=Cesium.createGuid()),this.data.list[n].features[c].id=this.data.list[n].features[c].properties.id,i(this.data.list[n].features[c].geometry,this.data.list[n].crs_src,this.data.list[n].crs_dst||"+proj=longlat +datum=WGS84 +no_defs"),this.data.list[n].features[c].geometry.geometries||(this.data.list[n].features[c].geometry.geometries=[]),(u=turf.bbox(this.data.list[n].features[c].geometry))&&u[0]&&u[0]!=1/0&&(this.data.list[n].features[c].geometry.range=turf.bbox(this.data.list[n].features[c])),t.push(this.data.list[n].features[c])}this.geojson={type:"FeatureCollection",features:t};case 5:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"fileName",get:function(){return this.options.fileName},set:function(e){this.options.fileName=e,this._elms.fileName&&(this._elms.fileName.value=e)}},{key:"field",get:function(){return this.options.field},set:function(e){this.options.field=e;for(var t=e,i=0;i<this.options.head_tables.length;i++)if(this.options.head_tables[i].key===e){t=this.options.head_tables[i].label;break}this._elms.field&&(this._elms.field.value=t)}},{key:"img",get:function(){return this.options.img},set:function(e){Array.isArray(e)||(e=[e]),this.options.img=e,t.createImage(this)}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;this.options.color=e,this.entity&&this.entity.entities.values.forEach((function(i){i.point&&(i.point.color=Cesium.Color.fromCssColorString(e).withAlpha(t.opacity)),i.polygon&&(i.polygon.material=Cesium.Color.fromCssColorString(e).withAlpha(t.opacity)),i.polyline&&(i.polyline.material=Cesium.Color.fromCssColorString(e).withAlpha(t.opacity))}))}},{key:"onRightClick",set:function(e){e&&"function"!=typeof e?console.error("val:",e,"不是一个function"):(null==this.rightClickCallBack&&this.options&&this.options.id&&ve(this.options.id,this.rightClickCB,this),this.rightClickCallBack=e)}},{key:"leftClickCB",value:function(e,t,i,n){n.clickCallBack&&"function"==typeof n.clickCallBack&&n.clickCallBack(e,t,i)}},{key:"edit",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b,C=this,w=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=w.length>0&&void 0!==w[0]&&w[0],i=w.length>1&&void 0!==w[1]?w[1]:{},this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=74;break}return e.next=7,new pn(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(e){C.fileName=C.fileName.trim(),C.fileName||(C.fileName="未命名对象"),C.originalOptions.fileName=C.fileName,C.originalOptions.field=C.field,C._DialogObject.close(),i.confirmCallBack&&i.confirmCallBack({id:C.options.id,fileName:C.originalOptions.fileName,field:C.originalOptions.field})},closeCallBack:function(){C.reset(),i.closeCallBack&&i.closeCallBack()}});case 7:this._DialogObject=e.sent,n='\n <div class="row">\n <div class="col">\n <span class="label">文件名称:</span>\n <input class="input flie-name" type="text">\n </div>\n </div>\n <div class="row">\n <div class="col key-box">\n <span class="label">名称字段选择:</span>\n <div class="key"></div>\n </div>\n </div>\n ',(o=document.createElement("div")).innerHTML=n,this._DialogObject.contentAppChild(o),(s=o.getElementsByClassName("flie-name")[0]).value=this.options.fileName,s.addEventListener("input",(function(){C.options.fileName=s.value})),r=[],e.t0=a.a.keys(this.geojson.features[0].properties);case 17:if((e.t1=e.t0()).done){e.next=31;break}l=e.t1.value,c=l,u=0;case 21:if(!(u<this.options.head_tables.length)){e.next=28;break}if(this.options.head_tables[u].key!==l){e.next=25;break}return c=this.options.head_tables[u].label,e.abrupt("break",28);case 25:u++,e.next=21;break;case 28:r.push({name:c,value:c,key:l}),e.next=17;break;case 31:if(!(h=q(o.getElementsByClassName("key-box")[0],".key"))){e.next=47;break}h.legp_search(r),(p=o.getElementsByClassName("key")[0].getElementsByTagName("input")[0]).value=this.field,d=0;case 37:if(!(d<r.length)){e.next=45;break}if(r[d].key!=this.field){e.next=42;break}return p.value=r[d].value,h.legp_searchActive(r[d].value),e.abrupt("break",45);case 42:d++,e.next=37;break;case 45:p.addEventListener("input",(function(){for(var e=0;e<r.length;e++)if(r[e].value===p.value){C.options.field=r[e].key;break}})),this._elms.field=p;case 47:return this._elms.fileName=s,e.abrupt("return");case 52:if((e.t3=e.t2()).done){e.next=67;break}v=e.t3.value,g=v,y=0;case 56:if(!(y<this.options.head_tables.length)){e.next=63;break}if(this.options.head_tables[y].key!==v){e.next=60;break}return g=this.options.head_tables[y].label,e.abrupt("break",63);case 60:y++,e.next=56;break;case 63:b='<option value="'.concat(v,'">').concat(g,"</option>"),f+=b,e.next=52;break;case 67:m.innerHTML=f,m.value=this.options.field,m.addEventListener("input",(function(){C.options.field=m.value})),this._elms.fileName=s,this._elms.field=m,e.next=75;break;case 74:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 75:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"editById",value:(n=o()(a.a.mark((function e(){var t,i,n,s,r,l,c,u,h,p,d,m,f,v,g,y,b=this,C=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=C.length>0&&void 0!==C[0]&&C[0],i=C.length>1?C[1]:void 0,n=C.length>2&&void 0!==C[2]?C[2]:{},this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),s="",!t){e.next=48;break}l={},c=0;case 8:if(!(c<this.geojson.features.length)){e.next=16;break}if(this.geojson.features[c].id!==i){e.next=13;break}return this.geojson.features[c].content&&(l=this.deepCopyObj(this.geojson.features[c].content)),r=c,e.abrupt("break",16);case 13:c++,e.next=8;break;case 16:return l.id=l.id||i,l.link||(l.link={}),l.link.content||(l.link.content=[]),l.camera||(l.camera=[]),l.richTextContent||(l.richTextContent=""),l.attributeType=l.attributeType||"richText",e.next=24,new pn(this.sdk,l,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(){b._DialogObject.close(),b.geojson.features[r].content=b.deepCopyObj(b._DialogObject.attribute),n.confirmCallBack&&n.confirmCallBack(b._DialogObject.attribute)},closeCallBack:function(){n.closeCallBack&&n.closeCallBack()}});case 24:for(this._DialogObject=e.sent,this._DialogObject.event=n,this._DialogObject.attribute=this.deepCopyObj(l),u='\n <div class="row">\n <div class="col">\n <span class="label">内容类型:</span>\n <select class="input input-select attribute-select" style="width: 120px;">\n <option value="richText">富文本</option>\n \x3c!--<option value="link">链接</option>\n <option value="camera">摄像头</option>\n <option value="sensor">传感器</option>\n <option value="vr">全景图</option>--\x3e\n </select>\n </div>\n <div class="col attribute-content attribute-content-link">\n <div class="input-group">\n <input class="input link_add" type="text">\n <button class="link_add_btn">+</button>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-richText">\n <span>编辑内容:<button class="open-richText-btn">打开文本编辑器</button></span>\n </div>\n <div class="attribute-content attribute-content-link">\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">名称</div>\n <div class="th">链接</div>\n <div class="th">操作</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-camera">\n <div class="row">\n <div class="col">\n <span class="label">编辑内容:</span>\n <input class="input camera-name" type="text" style="width: 100px;">\n <button class="select btn camera-select">搜索</button>\n </div>\n </div>\n <div>\n <div class="table camera-table">\n <div class="table-head">\n <div class="tr">\n <div class="th">操作</div>\n <div class="th">设备名称</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备类型</div>\n <div class="th" style="width: 126px; flex: 0 126px;min-width: 126px;">设备IP</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备端口</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">用户名</div>\n <div class="th">密码</div>\n </div>\n </div>\n <div class="table-body" style="display:none;">\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="2">\n <span>绑定</span>\n </div>\n <div class="td">设备名称</div>\n <div class="td">设备类型</div>\n <div class="td">设备IP</div>\n <div class="td">设备端口</div>\n <div class="td">用户名</div>\n <div class="td">密码</div>\n </div>\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class=""row>\n <ul class="pagination"></ul>\n </div>\n </div>\n ',(h=document.createElement("div")).innerHTML=u,this._DialogObject.contentAppChild(h),h.getElementsByTagName("*"),this._DialogObject._element.body.style.width="600px",p=h.getElementsByClassName("attribute-select")[0],d=h.getElementsByClassName("link_add_btn")[0],m=h.getElementsByClassName("open-richText-btn")[0],f=this._DialogObject._element.content.getElementsByClassName("attribute-content"),v=0;v<f.length;v++)f[v].className.indexOf("attribute-content-"+this._DialogObject.attribute.attributeType)>-1?f[v].style.display="block":f[v].style.display="none";p.addEventListener("change",(function(){b._DialogObject.attribute.attributeType=p.value;for(var e=0;e<f.length;e++)f[e].className.indexOf("attribute-content-"+b._DialogObject.attribute.attributeType)>-1?f[e].style.display="block":f[e].style.display="none"})),d.addEventListener("click",o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(b._DialogObject.attribute.link.content.push({name:"链接",url:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),b._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",b.setAttributeLinkById(i,b._DialogObject.attribute.link.content)):n.clickAddLink&&n.clickAddLink(i);case 1:case"end":return e.stop()}}),e)})))),m.addEventListener("click",(function(){Bn.open(i,i,b._DialogObject.attribute.richTextContent),Bn.primaryCallBack=function(e){b._DialogObject.attribute.richTextContent=e}})),g=h.getElementsByClassName("camera-name")[0],y=h.getElementsByClassName("camera-select")[0],g.addEventListener("input",(function(){s=g.value})),this.cameraSelect&&this.cameraSelect(s),y.addEventListener("click",(function(){b.cameraSelect&&b.cameraSelect(s)})),e.next=49;break;case 48:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 49:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"editContentById",value:function(e,t){for(var i=0;i<this.geojson.features.length;i++)if(this.geojson.features[i].id===e){this.geojson.features[i].content=t;break}}},{key:"reset",value:function(){this.fileName=this.originalOptions.fileName,this.field=this.originalOptions.field}},{key:"addAttributeLinkById",value:function(e,t,i){this._DialogObject&&this._DialogObject.attribute&&this._DialogObject.attribute.id==e&&(i||0===i?this._DialogObject._element.body.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("tr")[i+1].getElementsByClassName("file-select")[0].value=t:(this._DialogObject.attribute.link.content.push({name:"链接",url:t}),this.setAttributeLinkById(e,this._DialogObject.attribute.link.content)))}},{key:"setAttributeLinkById",value:function(e,t){var i,n=this;if(this._DialogObject&&this._DialogObject.attribute&&this._DialogObject.attribute.id==e){this._DialogObject.attribute.link.content=t;var s=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],r=s.getElementsByClassName("table-body")[0];r.innerHTML="",this._DialogObject.attribute.link.content.length>0?s.getElementsByClassName("table-empty")[0].style.display="none":s.getElementsByClassName("table-empty")[0].style.display="flex";for(var l=0;l<this._DialogObject.attribute.link.content.length;l++){var c='\n <div class="tr">\n <div class="td">'+this._DialogObject.attribute.link.content[l].name+'</div>\n <div class="td">'+this._DialogObject.attribute.link.content[l].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',u=document.createRange().createContextualFragment(c);r.appendChild(u)}for(var h=r.getElementsByClassName("tr"),p={linkEdit:(i=o()(a.a.mark((function t(i){var o,s,r,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.setAttributeLinkById(e,n._DialogObject.attribute.link.content);case 2:o=n._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],s=o.getElementsByClassName("table-body")[0],r=s.getElementsByClassName("tr"),l=a.a.mark((function e(t){var o,s,l,c,u,h;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==t){e.next=33;break}r[t].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <div class="input-group">\n <input class="input file-select" type="text" style="width: 200px;">\n <button @click="fileSelect">...</button>\n </div>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',(o=r[t].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].name,o[1].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].url,s=r[t].getElementsByTagName("button"),l=0;case 8:if(!(l<s.length)){e.next=32;break}if(s[l]&&s[l].attributes){e.next=11;break}return e.abrupt("continue",29);case 11:c=Oy(s[l].attributes),e.prev=12,h=a.a.mark((function e(){var i;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("@click"!==(i=u.value).name){e.next=5;break}return s[l].addEventListener("click",(function(e){"function"==typeof p[i.value]&&p[i.value]({name:o[0].getElementsByClassName("input")[0].value,url:o[1].getElementsByClassName("input")[0].value},t)})),s[l].attributes.removeNamedItem(i.name),e.abrupt("return",1);case 5:case"end":return e.stop()}}),e)})),c.s();case 15:if((u=c.n()).done){e.next=21;break}return e.delegateYield(h(),"t0",17);case 17:if(!e.t0){e.next=19;break}return e.abrupt("break",21);case 19:e.next=15;break;case 21:e.next=26;break;case 23:e.prev=23,e.t1=e.catch(12),c.e(e.t1);case 26:return e.prev=26,c.f(),e.finish(26);case 29:l++,e.next=8;break;case 32:return e.abrupt("return",1);case 33:case"end":return e.stop()}}),e,null,[[12,23,26,29]])})),c=0;case 7:if(!(c<r.length)){t.next=14;break}return t.delegateYield(l(c),"t0",9);case 9:if(!t.t0){t.next=11;break}return t.abrupt("break",14);case 11:c++,t.next=7;break;case 14:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),linkDelete:function(t){n._DialogObject.attribute.link.content.splice(t,1),n.setAttributeLinkById(e,n._DialogObject.attribute.link.content)},confirmEdit:function(t,i){n._DialogObject.attribute.link.content[i]=t,n.setAttributeLinkById(e,n._DialogObject.attribute.link.content)},cancelEdit:function(){n.setAttributeLinkById(e,n._DialogObject.attribute.link.content)},fileSelect:function(t,i){n._DialogObject.event&&n._DialogObject.event.clickAddLink&&n._DialogObject.event.clickAddLink(e,i)}},d=function(e){for(var t=h[e].getElementsByTagName("button"),i=0;i<t.length;i++)if(t[i]&&t[i].attributes){var n,o=Oy(t[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return t[i].addEventListener("click",(function(t){"function"==typeof p[o.value]&&p[o.value](e)})),t[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(e){o.e(e)}finally{o.f()}}},m=0;m<h.length;m++)d(m)}for(var f=0;f<this.dataArray.length;f++)if(this.dataArray[f].attr.id===e){this.dataArray[f].content&&(this.opt_DialogObject.attribute.link.content=v);break}}},{key:"getAllNode",value:function(){return this.data}},{key:"openAllNodeList",value:function(){My(this)}},{key:"openNodeListById",value:function(e){Ty(this,e)}},{key:"flyTo",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(pi(0),ni(this.sdk),oi(this.sdk),e)for(var n=function(n){if(t.geojson.features[n].id===e)if("Point"===t.geojson.features[n].geometry.type)t.getClampToHeight({lng:t.geojson.features[n].geometry.coordinates[0],lat:t.geojson.features[n].geometry.coordinates[1]}).then((function(e){t.sdk.viewer.camera.flyTo({orientation:i.orientation,destination:Cesium.Cartesian3.fromDegrees(t.geojson.features[n].geometry.coordinates[0],t.geojson.features[n].geometry.coordinates[1],e+(i.height||500))})}));else{var o=t.geojson.features[n].geometry.range;if(o){var s=[];t.getClampToHeight({lng:o[0],lat:o[1]}).then((function(e){var n=Cesium.Cartesian3.fromDegrees(o[0],o[1],e);s.push(n.x,n.y,n.z),t.getClampToHeight({lng:o[2],lat:o[3]}).then((function(e){var n=Cesium.Cartesian3.fromDegrees(o[2],o[3],e);s.push(n.x,n.y,n.z);var a=Cesium.BoundingSphere.fromVertices(s);t.sdk.viewer.camera.flyToBoundingSphere(a,{offset:i.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}})}))}))}}},o=0;o<this.geojson.features.length;o++)n(o);else if(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation){var s={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},a=this.options.customView.relativePosition.lng,r=this.options.customView.relativePosition.lat,l=this.options.customView.relativePosition.alt,c=Cesium.Cartesian3.fromDegrees(a,r,l);this.sdk.viewer.camera.flyTo({destination:c,orientation:s})}else if(this.range){var u=[];this.getClampToHeight({lng:this.range[0],lat:this.range[1]}).then((function(e){var n=Cesium.Cartesian3.fromDegrees(t.range[0],t.range[1],e);u.push(n.x,n.y,n.z),t.getClampToHeight({lng:t.range[2],lat:t.range[3]}).then((function(e){var n=Cesium.Cartesian3.fromDegrees(t.range[2],t.range[3],e);u.push(n.x,n.y,n.z);var o=Cesium.BoundingSphere.fromVertices(u);t.sdk.viewer.camera.flyToBoundingSphere(o,{offset:i.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}})}))}))}}},{key:"setShow",value:function(e,t){if(t){if(!this.entity)return;for(var i=0;i<this.entity.entities.values.length;i++)if(this.entity.entities.values[i].id&&this.entity.entities.values[i].id.startsWith(t)){this.entity.entities.values[i].show=e,this.entity.entities.values[i]._customShow=e,at(this.sdk,this.options.id,this.entity.entities.values[i].id);break}Mt(this.sdk,this.options.id)}else{if(this.options.show=e,!this.entity)return;for(var n=0;n<this.entity.entities.values.length;n++)this.entity.entities.values[n].show=e,this.entity.entities.values[n]._customShow=e,at(this.sdk,this.options.id,this.entity.entities.values[n].id);Mt(this.sdk,this.options.id)}}},{key:"setShowImg",value:function(e,t){if(t||0===t){for(var i=0;i<this.imgEntity.length;i++)if(i==t){this.imgEntity[i].show=e;break}}else for(var n=0;n<this.imgEntity.length;n++)this.imgEntity[n].show=e}},{key:"remove",value:(i=o()(a.a.mark((function e(){var t=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.entity&&this.entity.entities.values.forEach((function(e){yi(t.sdk.viewer,e)})),Ry(Gy,this,[]),this.removeImage(),this.entity=null,this.geojson={},this.data={},e.next=8,this.sdk.removeIncetance(this.options.id);case 8:return e.next=10,at(this.sdk,this.options.id);case 10:return e.next=12,Mt(this.sdk,this.options.id);case 12:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"removeImage",value:function(){for(var e=0;e<this.imgEntity.length;e++)this.sdk.viewer.entities.remove(this.imgEntity[e]);this.imgEntity=[]}},{key:"cameraSelect",value:function(e,t){var i=this,n={1:"海康",2:"大华"},o=this.options.host;if(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content){var s=that._DialogObject._element.content.getElementsByClassName("pagination")[0],a=that._DialogObject._element.content.getElementsByClassName("attribute-content-camera")[0];if(s&&a){An(s,1,10,1);var r="",l={cameraName:e,page:t&&"object"!==N()(t)?t:1,pageSize:5},c=new URLSearchParams(l).toString();r=o.endsWith("yjearth4.0")?"".concat(o,"/api/v1/cameraData/list?").concat(c):"".concat(o,"/yjearth4.0/api/v1/cameraData/list?").concat(c),fetch(r,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(t){200===t.status&&t.json().then((function(t){if(200===t.code||0===t.code){if(!i._DialogObject||!i._DialogObject._element||!i._DialogObject._element.content)return;var o=i._DialogObject._element.content.getElementsByClassName("pagination")[0],s=i._DialogObject._element.content.getElementsByClassName("camera-table")[0],a=s.getElementsByClassName("table-body")[0];if(a.innerHTML="",t.data){if(t.data.list&&t.data.list.length>0){An(o,t.data.total,10,1,(function(t){i.cameraSelect&&i.cameraSelect(e,t)})),s.getElementsByClassName("table-empty")[0].style.display="none",a.style.display="inline-flex";for(var r=function(e){var o='\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="'.concat(t.data.list[e].ID,'">\n <span>绑定</span>\n </div>\n <div class="td">').concat(t.data.list[e].cameraName,'</div>\n <div class="td" style="width: 80px; flex: 0 80px; min-width: 80px;">').concat(n[t.data.list[e].type],'</div>\n <div class="td" style="width: 126px; flex: 0 126px;min-width: 126px;">').concat(t.data.list[e].ip,'</div>\n <div class="td" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(t.data.list[e].port,'</div>\n <div class="td" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(t.data.list[e].userName,'</div>\n <div class="td">').concat(t.data.list[e].passWord,"</div>\n </div>"),s=document.createRange().createContextualFragment(o),r=s.querySelector('input[type="checkbox"]');r.addEventListener("change",(function(){if(r.checked)i._DialogObject.attribute.camera.push(t.data.list[e]);else{var n=i._DialogObject.attribute.camera.filter((function(i){return i.ID!==t.data.list[e].ID}));i._DialogObject.attribute.camera=n}})),a.appendChild(s);for(var l=0;l<i._DialogObject.attribute.camera.length;l++)if(i._DialogObject.attribute.camera[l].ID===t.data.list[e].ID){r.checked=!0;break}},l=0;l<t.data.list.length;l++)r(l)}t.data&&t.data.total&&An(o,t.data.total,10,1,(function(t){i.cameraSelect&&i.cameraSelect(e,t)}))}else An(o,1,10,1),s.getElementsByClassName("table-empty")[0].style.display="flex",a.style.display="none"}else console.error(t.message)}))}))}}}},{key:"load",value:function(e){jy(Vy,this)?e():Ry(Hy,this,e)}},{key:"flicker",value:function(){}}],[{key:"create",value:function(e){var i=turf.bbox(e.geojson);i&&i[0]&&i[0]!=1/0&&(e.range=i),e.options.img&&t.createImage(e);if(!e.options.path.endsWith(".kml")&&!e.options.path.endsWith(".kmz")){return(new Cesium.GeoJsonDataSource).load(e.geojson,{clampToGround:!0}).then((function(e){o(e)}))}var n="";function o(t){if(e.entity=t,t.entities.values.forEach((function(t,i){t.show=e.options.show,t.type="vector",t.parentId=e.options.id,t.properties||(t.properties={}),gi(e.sdk,t);var n=function(t){var i=e.options.color;return e.disaster_type_colors&&e.disaster_type_colors.hasOwnProperty(t)&&(i=e.disaster_type_colors[t]),i}(t.properties&&t.properties[e.options.fxdj]&&t.properties[e.options.fxdj]._value);if(t.billboard&&(t.billboard.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND,t.point=new Cesium.PointGraphics({show:!0,color:Cesium.Color.fromCssColorString(n||"rgba(0,255,184,0.5)").withAlpha(e.opacity),pixelSize:10,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ii()?void 0:Number.POSITIVE_INFINITY}),!1)})),t.polyline){var o=t.polyline.material;n&&(o=Cesium.Color.fromCssColorString(n).withAlpha(e.opacity)),t.polyline=new Cesium.PolylineGraphics({positions:t.polyline.positions._value,width:t.polyline.width&&t.polyline.width.getValue(),clampToGround:!0,material:o,zIndex:e.sdk._entityZIndex})}if(t.polygon&&t.polygon.material){t.polygon.perPositionHeight=!1,t.polygon.extrudedHeight=void 0;var s=t.polygon.material.color._value;n&&(s=Cesium.Color.fromCssColorString(n)),(e.opacity||0===e.opacity)&&(s=s.withAlpha(e.opacity));var a=t.kml||t.kmz;if(a){var r=a.extendedData&&a.extendedData.BaseTexturePath&&a.extendedData.BaseTexturePath.value?a.extendedData.BaseTexturePath.value:void 0;r&&(t.polygon.material.image=r,t.polygon.material.repeat=new Cesium.Cartesian2(1,1)),t.polygon.material=new Cesium.ImageMaterialProperty({image:r,repeat:new Cesium.Cartesian2(1,1),color:s})}if(t.polygon.zIndex=e.sdk._entityZIndex,e.options.path.endsWith(".kml")||e.options.path.endsWith(".kmz")){var l=n?Cesium.Color.fromCssColorString("#000000"):t.polygon.outlineColor.getValue();(e.opacity||0===e.opacity)&&(l=l.withAlpha(e.opacity)),t.polygon.outlineWidth&&(t.polyline=new Cesium.PolylineGraphics({positions:t.polygon.hierarchy._value.positions,width:t.polygon.outlineWidth.getValue(),clampToGround:!0,material:l,zIndex:e.sdk._entityZIndex}))}else t.polyline=new Cesium.PolylineGraphics({positions:t.polygon.hierarchy._value.positions,width:1,clampToGround:!0,material:Cesium.Color.fromCssColorString("#000000").withAlpha(e.opacity),zIndex:e.sdk._entityZIndex}),t.point&&(t.label=new Cesium.LabelGraphics({text:new Cesium.CallbackProperty((function(){return t.properties[e.options.field]&&t.properties[e.options.field]._value+""}),!1),outlineColor:Cesium.Color.BLACK,outlineWidth:10,font:"16px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#ffeb3b"),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(0,-15),style:Cesium.LabelStyle.FILL_AND_OUTLINE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ii()?void 0:Number.POSITIVE_INFINITY}),!1)}));e.sdk._entityZIndex++}if(e.options.path.endsWith(".kml")||e.options.path.endsWith(".kmz")){if(t.label){t.label.font="16px Microsoft YaHei";var c=e.geojson.features[i];t.billboard.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND,t.properties=c?c.properties:{},t.properties.id||t.properties.Id||t.properties.ID||t.properties.addProperty("id",t.id),t.label.text=new Cesium.CallbackProperty((function(){return t.properties[e.options.field]&&t.properties[e.options.field]._value+""}),!1)}}else t.point&&(t.label=new Cesium.LabelGraphics({text:new Cesium.CallbackProperty((function(){return t.properties[e.options.field]&&t.properties[e.options.field]._value+""}),!1),outlineColor:Cesium.Color.BLACK,outlineWidth:10,font:"16px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#ffeb3b"),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(0,-15),style:Cesium.LabelStyle.FILL_AND_OUTLINE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ii()?void 0:Number.POSITIVE_INFINITY}),!1)}))})),!e.options.field){var i=["id","Id","ID","name","Name","NAME","address","Address","ADDRESS","text","Text","TEXT","label","Label","LABEL"].find((function(t){return void 0!==e.geojson.features[0].properties[t]}));if(i)e.options.field=i;else for(var n in e.geojson.features[0].properties){e.options.field=n;break}}Ry(Vy,e,!0),jy(Hy,e)&&jy(Hy,e).call(e)}e.options.host=e.options.host||p(),n=e.options.host.endsWith("yjearth4.0")?e.options.host+"/api/v1/vector/getKml":e.options.host+"/yjearth4.0/api/v1/vector/getKml",n+="?path="+e.options.path,fetch(n,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(t){200===t.status&&t.blob().then((function(t){t.text().then((function(t){if(e.options.path.endsWith(".kmz"))t=n;else for(var i=(t=(new DOMParser).parseFromString(t,"text/xml")).getElementsByTagName("Placemark"),s=0;s<i.length;s++)i[s].id=e.geojson.features[s].id;Cesium.KmlDataSource.load(t,{camera:e.viewer.scene.camera,canvas:e.viewer.scene.canvas,clampToGround:!0}).then((function(e){o(e)}))}))}))}))}},{key:"createImage",value:function(e){if(e.removeImage(),e.range)for(var t=0;t<e.options.img.length;t++){var i,n=e.sdk.viewer.entities.add({show:e.options.show,rectangle:{coordinates:(i=Cesium.Rectangle).fromDegrees.apply(i,A()(e.range)),material:new Cesium.ImageMaterialProperty({image:e.options.img[t],transparent:!0})}});e.imgEntity.push(n)}}},{key:"getcanvas",value:function(e){var t=document.createElement("canvas"),i=t.getContext("2d");i.font="16px YaHei";for(var n=e.split("\n"),o=0,s=0,a=0;a<n.length;a++){var r=n[a],l=i.measureText(r).width;l>o&&(o=l),s+=16}s=s+10+5*(n.length-1),o+=30,t.width=o,t.height=s;var c=i.createLinearGradient(0,0,o,s);return i.fillStyle=c,i.fillRect(0,0,o,s),i.fillStyle="#ffffff",i.font="16px YaHei",i.strokeStyle="#000000",i.strokeText(n,15,16*n.length+6.25+5*n.length),i.fillText(n,15,16*n.length+6.25+n.length-5),i.moveTo(o/2,s),i.stroke(),i.closePath(),t.toDataURL()}},{key:"createTableContent",value:function(e){for(var t="",i=0;i<e.currentData.length;i++){var n='<tr class="el-table__row">',o="";for(var s in e.currentData[i].attr)o+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(i,' el-table__cell"><div class="cell">').concat(e.currentData[i].attr[s],"</div></td>");t+=n=n+o+"</tr>"}return t}}]);var i,n,s,r,l}(Vn);function Uy(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 Yy(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Uy(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Uy(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Jy(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var qy=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,t),(i=Jy(this,t,[e,n])).options.text=n.text||"未命名对象";for(var s=i.options.text.split("\n"),a=0;a<s.length;a++)s[a].length>80&&(s[a]=s[a].slice(0,80-s[a].length));if(s.length>70&&s.splice(70-s.length),i.options.text=s.join("\n"),i.options.show=!n.show&&!1!==n.show||n.show,i.options.angle=n.angle||0,i.options.scale=n.scale||0===n.scale?n.scale:1,i.options.speed=n.speed||0===n.speed?n.speed:1,i.options.color=n.color||"#FFC107",i.options.position=n.position,delete i.options.name,!i.options.position&&i.options.positions){var r=function(e,t){var i=t[0]-e[0],n=t[1]-e[1];return Math.atan2(n,i)};i.options.position={lng:(i.options.positions[0].lng+i.options.positions[1].lng)/2,lat:(i.options.positions[0].lat+i.options.positions[1].lat)/2};var l=turf.point([i.options.positions[0].lng,i.options.positions[0].lat]),c=turf.point([i.options.positions[1].lng,i.options.positions[1].lat]),u={units:"miles"},h=turf.rhumbDistance(l,c,u),p=r([i.options.positions[0].lng,i.options.positions[0].lat],[i.options.positions[1].lng,i.options.positions[1].lat]);i.options.angle=(360+Cesium.Math.toDegrees(p))%360;var d=1e-4*Math.abs(Math.cos(Math.PI/180*i.options.position.lat)),m=i.getcanvas(),f=m.height/m.width,v=i.options.position.lng-1e-4/f,g=i.options.position.lat-d,y=i.options.position.lng+1e-4/f,b=i.options.position.lat+d,C=(g+b)/2,w=turf.point([v,C]),_=turf.point([y,C]),x=turf.rhumbDistance(w,_,u),E=Cesium.Math.toRadians(i.options.position.lat);x*=1+Math.abs(Math.sin(p)*Math.tan(E)*Math.sin(E)*Math.sin(E)),i.options.scale=h/x}return i.duration=5e4,i.entity,i._positionEditing=!1,i.Dialog=o,i._EventBinding=new xn,i._elms={},i.previous={position:Yy({},i.options.position)},i.event=new K(i.sdk),i.sdk.addIncetance(i.options.id,i),i.create(),i}return un()(t,e),x()(t,[{key:"lng",get:function(){return this.options.position.lng},set:function(e){this.options.position.lng=e,this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e}))}},{key:"lat",get:function(){return this.options.position.lat},set:function(e){this.options.position.lat=e,this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e}))}},{key:"name",get:function(){}},{key:"text",get:function(){return this.options.text},set:function(e){var t=this;this.options.text=e;for(var i=this.options.text.split("\n"),n=0;n<i.length;n++)if(i[n].length>80){window.ELEMENT&&window.ELEMENT.Message({message:"行超过80个字符,请按回车(Enter)后,继续输入",type:"warning",duration:1e3}),i[n]=i[n].slice(0,80-i[n].length)}if(i.length>70){i.splice(70-i.length);window.ELEMENT&&window.ELEMENT.Message({message:"超过最大输入字符",type:"warning",duration:1e3})}if(this.options.text=i.join("\n"),this.entity){var o=this.getcanvas(),s=o.height/o.width;this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:o.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this.entity.rectangle.coordinates=new Cesium.CallbackProperty((function(){var e,i=Math.abs(Math.cos(Math.PI/180*t.options.position.lat))*(1e-4*t.options.scale),n=[t.options.position.lng-1e-4*t.options.scale/s,t.options.position.lat-i,t.options.position.lng+1e-4*t.options.scale/s,t.options.position.lat+i];return(e=Cesium.Rectangle).fromDegrees.apply(e,n)}),!1)}this._elms.text&&this._elms.text.forEach((function(e){e.value=t.options.text}))}},{key:"angle",get:function(){return this.options.angle},set:function(e){this.options.angle=Number(e),this._elms.angle&&this._elms.angle.forEach((function(t){t.value=e}))}},{key:"scale",get:function(){return this.options.scale},set:function(e){this.options.scale=Number(e),this._elms.scale&&this._elms.scale.forEach((function(t){t.value=e}))}},{key:"speed",get:function(){return this.options.speed},set:function(e){this.options.speed=Number(e);var t=this.getcanvas();this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:t.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this._elms.speed&&this._elms.speed.forEach((function(t){t.value=e}))}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;this.options.color=e;var i=this.getcanvas();this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:i.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,255,255,1)"}});t._elms.color[n]=o}))}},{key:"create",value:function(){var e=this,t=this.getcanvas(),i=t.height/t.width;this.entity=this.sdk.viewer.entities.add({id:this.options.id,show:this.options.show,rectangle:{coordinates:new Cesium.CallbackProperty((function(){var t,n=Math.abs(Math.cos(Math.PI/180*e.options.position.lat))*(1e-4*e.options.scale),o=[e.options.position.lng-1e-4*e.options.scale/i,e.options.position.lat-n,e.options.position.lng+1e-4*e.options.scale/i,e.options.position.lat+n];return(t=Cesium.Rectangle).fromDegrees.apply(t,o)}),!1),material:new Cesium.CustomMaterialSource({image:t.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),rotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(e.options.angle)}),!1),stRotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(e.options.angle)}),!1)}}),"cesium-viewer 2d"===this.sdk.viewer._element.className&&(this.entity.rectangle.height=10),Mt(this.sdk,this.options.id),this.options.show&&Qe(0,this.options.id)}},{key:"edit",value:(s=o()(a.a.mark((function e(t){var i,n,o,s=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=18;break}return e.next=6,new pn(this.sdk,this.originalOptions,{title:"贴地文字属性",left:"180px",top:"100px",confirmCallBack:function(e){s.text=s.text.trim(),s.text||(s.text="未命名对象"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),Mt(s.sdk,s.options.id),at(s.sdk,s.options.id)},resetCallBack:function(){s.reset(),s.Dialog.resetCallBack&&s.Dialog.resetCallBack()},removeCallBack:function(){s.Dialog.removeCallBack&&s.Dialog.removeCallBack()},closeCallBack:function(){s.reset(),s.positionEditing=!1,s.Dialog.closeCallBack&&s.Dialog.closeCallBack()},showCallBack:function(e){s.show=e,s.Dialog.showCallBack&&s.Dialog.showCallBack()},translationalCallBack:function(){s.positionEditing=!s.positionEditing}},!0);case 6:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" ground-text",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <textarea @model="text"></textarea>\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">旋转角度</span>\n <input type="range" max="360" min="0" step="1" @model="angle">\n <div class="input-number input-number-unit" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="360" step="1" @model="angle">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">调整大小</span>\n <input type="range" max="100000" min="0" step="0.01" @model="scale">\n <div class="input-number" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="100000" step="0.01" @model="scale">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">滚动速度</span>\n <input type="range" max="100" min="0" step="1" @model="speed">\n <div class="input-number" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="100" step="1" @model="speed">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,o=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){s.color=e},clear:function(){s.color="rgba(255,255,255,1)"}}),this._elms.color=[o],e.next=19;break;case 18:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 19:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"positionEditing",get:function(){return this._positionEditing},set:function(e){var t=this;this.sdk&&this.sdk.viewer&&this.entity&&(this._positionEditing=e,this.previous={position:Yy({},this.options.position)},!0===e?(this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.event.mouse_move((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=n.lng,t.lat=n.lat,t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=n.lng,t.lat=n.lat,t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.positionEditing=!1})),this.event.mouse_right((function(e,i){t.lng=t.previous.position.lng,t.lat=t.previous.position.lat,t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.lng=t.previous.position.lng,t.lat=t.previous.position.lat,t.positionEditing=!1;else{var e=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=e.lng,t.lat=e.lat,t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.positionEditing=!1}}))}))):(this._positionEditingCallback&&(this._positionEditingCallback(),this._positionEditingCallback=null),this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy()))}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=b.length>0&&void 0!==b[0]?b[0]:{},i=this.getcanvas(),n=i.height/i.width,pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(o={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},s=this.options.customView.relativePosition.lng,r=this.options.customView.relativePosition.lat,l=this.options.customView.relativePosition.alt,c=Cesium.Cartesian3.fromDegrees(s,r,l),u={lng:0,lat:0},this.options.position?u=Yy({},this.options.position):this.options.positions?u=Yy({},this.options.positions[0]):this.options.center?u=Yy({},this.options.center):this.options.start?u=Yy({},this.options.start):(this.options.hasOwnProperty("lng")&&(u.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(u.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(u.alt=this.options.alt)),u.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(u);case 17:u.alt=e.sent;case 18:s=this.options.customView.relativePosition.lng+u.lng,r=this.options.customView.relativePosition.lat+u.lat,l=this.options.customView.relativePosition.alt+u.alt,c=Cesium.Cartesian3.fromDegrees(s,r,l),this.sdk.viewer.camera.flyTo({destination:c,orientation:o}),e.next=34;break;case 25:return h=Math.abs(Math.cos(Math.PI/180*this.options.position.lat))*(1e-4*this.options.scale),p=[[this.options.position.lng-1e-4*this.options.scale/n,this.options.position.lat-h],[this.options.position.lng+1e-4*this.options.scale/n,this.options.position.lat+h]],e.next=29,this.getClampToHeight(this.options.position);case 29:for(d=e.sent,m=[],f=0;f<p.length;f++)g=(v=Cesium.Cartesian3).fromDegrees.apply(v,A()(p[f]).concat([d])),m.push(g.x,g.y,g.z);y=Cesium.BoundingSphere.fromVertices(m),this.sdk.viewer.camera.flyToBoundingSphere(y,{offset:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 34:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.options=this.deepCopyObj(this.originalOptions),this.text=this.originalOptions.text,this.angle=this.originalOptions.angle,this.scale=this.originalOptions.scale,this.color=this.originalOptions.color)}},{key:"remove",value:(i=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=7,this.sdk.removeIncetance(this.options.id);case 7:return e.next=9,Mt(this.sdk,this.options.id);case 9:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"getcanvas",value:function(){for(var e=document.createElement("canvas"),t=e.getContext("2d"),i=this.options.text.split("\n"),n=0;n<i.length;n++)i[n].length>80&&(i[n]=i[n].slice(0,80-i[n].length));i.length>70&&i.splice(70-i.length),this.options.text=i.join("\n");for(var o=0,s=0;s<i.length;s++){t.font="200px serif";var a=t.measureText(i[s]).width;o<a&&(o=a)}e.width=o,e.height=220*i.length;for(var r=0;r<i.length;r++)t.font="200px serif",t.fillStyle="rgba(255, 255, 255, 0)",t.fillRect(0,0,o+30,210),t.fillStyle="rgba(255, 255, 255, 1)",t.font="200px serif",t.fillText(i[r],0,210*(r+1));return e}}]);var i,n,s}(Vn);function Xy(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Zy=function(e){function t(e,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,t),(n=Xy(this,t,[e,i])).options.text=i.text||"未命名对象";for(var s=n.options.text.split("\n"),a=0;a<s.length;a++)s[a].length>80&&(s[a]=s[a].slice(0,80-s[a].length));return s.length>70&&s.splice(70-s.length),n.options.text=s.join("\n"),n.options.color=i.color||"#FFC107",n.options.positions=i.positions,n.options.speed=i.speed||0===i.speed?i.speed:1,n.options.show=!i.show&&!1!==i.show||i.show,n.nodePoints=[],n.entity,delete n.options.name,n.extrudedHeight,n._EventBinding=new xn,n.Dialog=o,n._elms={},n.sdk.addIncetance(n.options.id,n),t.create(n),n}return un()(t,e),x()(t,[{key:"name",get:function(){}},{key:"text",get:function(){return this.options.text},set:function(e){this.options.text=e;for(var t=this.options.text.split("\n"),i=0;i<t.length;i++)if(t[i].length>80){window.ELEMENT&&window.ELEMENT.Message({message:"行超过80个字符,请按回车(Enter)后,继续输入",type:"warning",duration:1e3}),t[i]=t[i].slice(0,80-t[i].length)}if(t.length>70){t.splice(70-t.length);window.ELEMENT&&window.ELEMENT.Message({message:"超过最大输入字符",type:"warning",duration:1e3})}if(this.options.text=t.join("\n"),this.entity){for(var n=this.options.positions,o=[],s=[],a=[],r=this.getMaterial(),l=this.computeDistance2(n),c=this.aspectRatio?l/this.aspectRatio:0,u=0;u<n.length;u++)o.push(n[u].lng,n[u].lat),s.push(n[u].alt),a.push(n[u].alt+c);this.entity.wall.material=r,this.entity.wall.maximumHeights=a,this.entity.wall.minimumHeights=s}this._elms.text&&this._elms.text.forEach((function(t){t.value=e}))}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;this.options.color=e,this.entity.wall.material=this.getMaterial(),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,255,255,1)"}});t._elms.color[n]=o}))}},{key:"speed",get:function(){return this.options.speed},set:function(e){this.options.speed=Number(e),this.entity.wall.material=this.getMaterial(),this._elms.speed&&this._elms.speed.forEach((function(t){t.value=e}))}},{key:"edit",value:(s=o()(a.a.mark((function e(t){var i,n,o,s=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=18;break}return e.next=6,new pn(this.sdk,this.options,{title:"立体文字属性",left:"180px",top:"100px",confirmCallBack:function(e){s.text=s.text.trim(),s.text||(s.text="未命名对象"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),Mt(s.sdk,s.options.id),at(s.sdk,s.options.id)},resetCallBack:function(){s.reset(),s.Dialog.resetCallBack&&s.Dialog.resetCallBack()},removeCallBack:function(){s.Dialog.removeCallBack&&s.Dialog.removeCallBack()},closeCallBack:function(){s.reset(),s.Dialog.closeCallBack&&s.Dialog.closeCallBack();for(var e=0;e<s.nodePoints.length;e++)s.sdk.viewer.entities.remove(s.nodePoints[e]);s.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),s.event&&s.event.destroy(),s.tip&&s.tip.destroy()},showCallBack:function(e){s.options.show=e,s.originalOptions.show=e,s.show=e,s.Dialog.showCallBack&&s.Dialog.showCallBack()},secondaryEditCallBack:function(){s.nodeEdit()}});case 6:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" stand-text",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <textarea @model="text"></textarea>\n </div>\n <div class="col" style="margin-right: 20px;">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">滚动速度</span>\n <input type="range" max="100" min="0" step="1" @model="speed">\n <input style="font-size: 13px;width: 100px;margin-left: 10px;" type="number" title="" min="0" max="100" @model="speed">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){s.color=e},clear:function(){s.color="rgba(255,255,255,1)"}}),o=i.getElementsByTagName("*"),this._EventBinding.on(this,o),this._elms=this._EventBinding.element,this._elms.color=[n],e.next=19;break;case 18:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 19:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"reset",value:function(){if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.text=this.originalOptions.text,this.color=this.originalOptions.color,this.speed=this.originalOptions.speed;for(var e=this.options.positions,t=[],i=[],n=[],o=this.computeDistance2(e),s=this.aspectRatio?o/this.aspectRatio:0,a=0;a<e.length;a++)t.push(e[a].lng,e[a].lat),i.push(e[a].alt),n.push(e[a].alt+s);this.entity.wall.positions=Cesium.Cartesian3.fromDegreesArray(t)}}},{key:"remove",value:(n=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=7,this.sdk.removeIncetance(this.options.id);case 7:return e.next=9,Mt(this.sdk,this.options.id);case 9:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"getMaterial",value:function(){var e=this.getcanvas();return new Cesium.CustomMaterialSource({image:e.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:5e4/this.options.speed,fltr:!1})}},{key:"getcanvas",value:function(){for(var e=document.createElement("canvas"),t=e.getContext("2d"),i=this.options.text.split("\n"),n=0;n<i.length;n++)i[n].length>80&&(i[n]=i[n].slice(0,80-i[n].length));i.length>70&&i.splice(70-i.length),this.options.text=i.join("\n");for(var o=0,s=0;s<i.length;s++){t.font="200px serif";var a=t.measureText(i[s]).width;o<a&&(o=a)}e.width=o,e.height=220*i.length;for(var r=0;r<i.length;r++)t.font="200px serif",t.fillStyle="rgba(255, 255, 255, 0)",t.fillRect(0,0,o+30,210),t.fillStyle="rgba(255, 255, 255, 1)",t.font="200px serif",t.fillText(i[r],0,210*(r+1));return this.aspectRatio=this.options.text?e.width/e.height:0,e}},{key:"openRichTextEditor",value:function(e){var t=this;Bn.open(this.options.id,this.options.text,this.options.richTextContent),Bn.primaryCallBack=function(e){t.options.richTextContent=e}}},{key:"nodeEdit",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var i,n;YJ.Measure.SetMeasureStatus(!0),this._nodeEditCallback=t,this.tip=new Q("请选择一个顶点,右键取消",this.sdk),this.event=new K(this.sdk),this.nodePoints=[];for(var o=this.options.positions,s=[],a=[],r=[],l=this.computeDistance2(o),c=this.aspectRatio?l/this.aspectRatio:0,u=0;u<o.length;u++)s.push(o[u].lng,o[u].lat),a.push(o[u].alt),r.push(o[u].alt+c);var h=!1,p=function(t,o){if(i){h=!0;var u=e.sdk.viewer.scene.clampToHeight(o,[e.entity]);e.options.positions[i.index]=e.cartesian3Towgs84(u,e.sdk.viewer),n=e.options.positions[i.index];var p=e.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(e.options.positions[i.index].lng,e.options.positions[i.index].lat,e.options.positions[i.index].alt),billboard:{image:e.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});e.nodePoints.splice(i.index,0,p),e.options.positions.splice(i.index,0,e.options.positions[i.index]);var d=e.options.positions;s=[],a=[],r=[],l=e.computeDistance2(d),c=e.aspectRatio?l/e.aspectRatio:0;for(var m=0;m<d.length;m++)s.push(d[m].lng,d[m].lat),a.push(d[m].alt),r.push(d[m].alt+c);e.tip.setPosition(o,t.position.x,t.position.y)}else{var f=e.sdk.viewer.scene.pick(t.position);f&&f.id&&f.id.name&&"node-secondary-edit-point"===f.id.name&&(i=f.id,e.nodePoints.splice(f.id.index,1),e.sdk.viewer.entities.remove(f.id),e.tip.set_text("左键开始,右键结束,CTRL+右键撤销"),n=e.cartesian3Towgs84(o,e.sdk.viewer),e.entity.wall.positions=new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArray(s)}),!1),e.entity.wall.maximumHeights=new Cesium.CallbackProperty((function(){return r}),!1),e.entity.wall.minimumHeights=new Cesium.CallbackProperty((function(){return a}),!1))}},d=function(o,u){i&&(e.options.positions[i.index]=n,h&&e.options.positions.splice(i.index,1),t(null,e.options.positions));var p=e.options.positions;s=[],a=[],r=[],l=e.computeDistance2(p),c=e.aspectRatio?l/e.aspectRatio:0;for(var d=0;d<p.length;d++)s.push(p[d].lng,p[d].lat),a.push(p[d].alt),r.push(p[d].alt+c);e.entity.wall.positions=Cesium.Cartesian3.fromDegreesArray(s);for(var m=0;m<e.nodePoints.length;m++)e.sdk.viewer.entities.remove(e.nodePoints[m]);e.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),e.event.destroy(),e.tip.destroy()};this.event.mouse_left(p),this.event.mouse_right(d),this.event.mouse_move((function(t,n){if(i){var o=e.sdk.viewer.scene.clampToHeight(n,[e.entity]);e.options.positions[i.index]=e.cartesian3Towgs84(o,e.sdk.viewer);var u=e.options.positions;s=[],a=[],r=[],l=e.computeDistance2(u),c=e.aspectRatio?l/e.aspectRatio:0;for(var h=0;h<u.length;h++)s.push(u[h].lng,u[h].lat),a.push(u[h].alt),r.push(u[h].alt+c)}e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_right_keyboard_ctrl((function(t,n){i&&(e.options.positions.pop(),e.sdk.viewer.entities.remove(e.nodePoints[e.nodePoints.length-1]),e.nodePoints.pop(),i.index===e.options.positions.length&&(e.nodePoints[i.index-1]?i=e.nodePoints[i.index-1]:i.index=0))})),this.event.gesture_pinck_start((function(t,i){var n=new Date,o={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};e.event.gesture_pinck_end((function(){new Date-n>=500?d(o,i):p(o,i)}))}));for(var m=0;m<this.options.positions.length;m++){var f=this.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:m,position:Cesium.Cartesian3.fromDegrees(this.options.positions[m].lng,this.options.positions[m].lat,this.options.positions[m].alt),billboard:{image:this.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});this.nodePoints.push(f)}}}}],[{key:"create",value:(i=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(i=t.options.positions,n=[],o=[],s=[],r=t.getMaterial(),l=t.computeDistance2(i),c=t.aspectRatio?l/t.aspectRatio:0,u=0;u<i.length;u++)n.push(i[u].lng,i[u].lat),o.push(i[u].alt),s.push(i[u].alt+c);t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,wall:{positions:Cesium.Cartesian3.fromDegreesArray(n),cornerType:Cesium.CornerType.MITERED,maximumHeights:s,minimumHeights:o,material:r}}),Mt(t.sdk,t.options.id),t.options.show&&Qe(0,t.options.id);case 11:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}]);var i,n,s}(Vn);function Ky(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 Qy(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ky(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ky(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function $y(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var eb=function(e){function t(e,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(n=$y(this,t)).sdk=e,n.viwer=e.viewer,n.options=Qy({},i),n.options.host=i.host||p(),n.options.name=i.name||"未命名对象",n.options.show=!i.show&&!1!==i.show||i.show,"number"==typeof i.scale?(n.options.scale={},n.options.scale.x=i.scale,n.options.scale.y=i.scale,n.options.scale.z=i.scale):(n.options.scale=i.scale||{},n.options.scale.x=n.options.scale.x||0===n.options.scale.x?n.options.scale.x:1,n.options.scale.y=n.options.scale.y||0===n.options.scale.y?n.options.scale.y:1,n.options.scale.z=n.options.scale.z||0===n.options.scale.z?n.options.scale.z:1),n.primitive=null,n._loadEvent=void 0,n._loaded=!1,n._elms={},n.Dialog=o,n._EventBinding=new xn,t.setDefaultValue(n),n.requestResource(),n.ControllerObject=new Ho(n.sdk,{position:Qy({},n.options.position),rotate:{x:(360+n.options.roll%360)%360,y:(360+-n.options.pitch%360)%360,z:(360+-n.options.heading%360)%360}}),n.ControllerObject.controllerCallBack=n.controllerCallBack,n.HeadingPitchRollCallBack=n.Dialog.HeadingPitchRollCallBack,n}return un()(t,e),x()(t,[{key:"requestResource",value:function(){this.addResource().then((function(e){}))}},{key:"addResource",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=this).options.xmlURL=t.options.objUrl.replace(".obj",".xml"),""===t.options.xmlURL){e.next=34;break}return e.next=5,fetch(t.options.xmlURL);case 5:if(!(i=e.sent).ok){e.next=32;break}return e.next=9,i.text();case 9:return n=e.sent,o=new DOMParser,s=o.parseFromString(n,"text/xml"),r=s.getElementsByTagName("Position")[0].textContent.split(","),l=s.getElementsByTagName("Crs")[0].textContent,c=t.convert([{x:r[0],y:r[1],z:r[2]}],l,"EPSG:4326"),t.options.position=t.options.position||{lng:c.points[0].x,lat:c.points[0].y,alt:c.points[0].z},t.ControllerObject.position=t.options.position,u=t.viwer.scene,h=Cesium.Cartesian3.fromDegrees(t.options.position.lng,t.options.position.lat,t.options.position.alt),p=Cesium.Transforms.headingPitchRollToFixedFrame(h,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(.85),Cesium.Math.toRadians(0),Cesium.Math.toRadians(0))),e.next=22,window.objLoader.Load(t.options.objUrl);case 22:(d=e.sent).show=t.options.show,d.modelMatrix=p,d.setFlvVideo(t.options.videoUrl),u.primitives.add(d),t.primitive=d,t.controllerCallBack({rotate:{x:t.options.roll,y:-t.options.pitch,z:-t.options.heading},position:Qy({},t.options.position)}),this.loaded=!0,this._loaded=!0,this._loadEvent&&this._loadEvent();case 32:e.next=36;break;case 34:return console.error("请填写xml路径"),e.abrupt("return");case 36:if(""!==t.options.objUrl){e.next=39;break}return console.error("请填写obj模型路径"),e.abrupt("return");case 39:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=h.length>0&&void 0!==h[0]?h[0]:{},!this._error){e.next=3;break}return e.abrupt("return");case 3:if(pi(0),ni(this.sdk),oi(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Qy({},this.options.position):this.options.positions?l=Qy({},this.options.positions[0]):this.options.center?l=Qy({},this.options.center):this.options.start?l=Qy({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(l);case 17:l.alt=e.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=28;break;case 25:c=100*Math.tan(60),u=c/111319.55,this.sdk.viewer.camera.flyTo({destination:new Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat-u,this.options.position.alt+100),orientation:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}});case 28:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"edit",value:(i=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u=this,h=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h.length>0&&void 0!==h[0]&&h[0],t=!1,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),e.next=6,new pn(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(e){u.name=u.name.trim(),u.name||(u.name="未命名对象"),u.originalOptions=u.deepCopyObj(u.options),u._DialogObject.close(),u.Dialog.confirmCallBack&&u.Dialog.confirmCallBack(u.originalOptions)},resetCallBack:function(){u.reset(),u.Dialog.resetCallBack&&u.Dialog.resetCallBack()},removeCallBack:function(){u.Dialog.removeCallBack&&u.Dialog.removeCallBack()},closeCallBack:function(){u.reset(),u.positionEditing=!1,u.Dialog.closeCallBack&&u.Dialog.closeCallBack()},rotateCallBack:function(){u.rotationEditing?u.rotationEditing=!1:u.rotationEditing=!0},translationalCallBack:function(){u.positionEditing?u.positionEditing=!1:u.positionEditing=!0}},!0);case 6:for(this._DialogObject=e.sent,(i=document.createElement("div")).style.width="448px",i.innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input name" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">海拔高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" step="0.01" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="lable-left-line">\n <span>缩放</span>\n <div class="checkbox-box" style="display: flex;align-items: center;margin-left: 20px;">\n <input type="checkbox" style="width: 14px;height: 14px;margin-top: 2px;margin-right: 5px;cursor: pointer;">\n <span>是否等比例缩放</span>\n </div>\n </div>\n </div>\n <div class="row no-equal" style="display: none;">\n <div class="row">\n <div class="col">\n <span class="label">x 轴</span>\n <input class="scale-x" style="flex: 1;margin-right: 15px;" type="range" max="99" min="0.0001" step="0.01" @model="scaleX">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input class="scale-x" style="width: 100px;" type="number" title="" min="0" max="99" step="0.01" @model="scaleX">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">y 轴</span>\n <input class="scale-y" style="flex: 1;margin-right: 15px;" type="range" max="99" min="0.0001" step="0.01" @model="scaleY">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input class="scale-y" style="width: 100px;" type="number" title="" min="0" max="99" step="0.01" @model="scaleY">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">z 轴</span>\n <input class="scale-z" style="flex: 1;margin-right: 15px;" type="range" max="99" min="0.0001" step="0.01" @model="scaleZ">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input class="scale-z" style="width: 100px;" type="number" title="" min="0" max="99" step="0.01" @model="scaleZ">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="row equal" style="display: none;">\n <div class="row">\n <div class="col">\n <span class="label">等比例缩放</span>\n <input class="scale-all" style="flex: 1;margin-right: 15px;" type="range" max="99" min="0.0001" step="0.01">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input class="scale-all" style="width: 100px;" type="number" title="" min="0" max="99" step="0.01">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=this._DialogObject._element.content.getElementsByClassName("checkbox-box")[0].querySelector("input"),o=this._DialogObject._element.content.getElementsByClassName("equal")[0],s=this._DialogObject._element.content.getElementsByClassName("no-equal")[0],n.checked=t,n.addEventListener("change",(function(e){(t=e.target.checked)?(o.style.display="flex",s.style.display="none"):(o.style.display="none",s.style.display="flex")})),(r=o.getElementsByTagName("input"))[0].value=this.scaleX,r[1].value=this.scaleX,r[0].addEventListener("input",(function(e){u.scaleX=e.target.value,u.scaleY=e.target.value,u.scaleZ=e.target.value})),r[1].addEventListener("input",(function(e){u.scaleX=e.target.value,u.scaleY=e.target.value,u.scaleZ=e.target.value})),t?(o.style.display="flex",s.style.display="none"):(o.style.display="none",s.style.display="flex"),setTimeout((function(){if(u._DialogObject._element.foot){var e=u._DialogObject._element.foot.getElementsByClassName("rotate")[0];e&&(e.style.position="absolute",e.style.left="100px")}}),0),l=i.getElementsByTagName("*"),c=0;c<l.length;c++)l[c].addEventListener("input",(function(e){if("0"===e.target.value&&"0"===e.target.min)switch(e.target.className){case"scale-x":u.scaleX=1e-4;break;case"scale-y":u.scaleY=1e-4;break;case"scale-z":u.scaleZ=1e-4;case"scale-all":u.scaleX=1e-4,u.scaleY=1e-4,u.scaleZ=1e-4}}));this._EventBinding.on(this,l),this._elms=this._EventBinding.element,this._elms.scaleX.push(r[0],r[1]);case 28:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"reset",value:function(){if(this.ControllerObject.destroy(),this.options=this.deepCopyObj(this.originalOptions),this.name=this.options.name,this.primitive){var e=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt));this.primitive.modelMatrix=e,this.primitive.modelMatrix=Cesium.Matrix4.multiplyByMatrix3(this.primitive.modelMatrix,Cesium.Matrix3.fromHeadingPitchRoll(Cesium.HeadingPitchRoll.fromDegrees(this.options.heading,this.options.pitch,this.options.roll)),this.primitive.modelMatrix);var t=this.options.scale.x,i=this.options.scale.y,n=this.options.scale.z;0===t&&(t=1e-5),0===i&&(i=1e-5),0===n&&(n=1e-5),Cesium.Matrix4.multiplyByScale(this.primitive.modelMatrix,new Cesium.Cartesian3(t,i,n),this.primitive.modelMatrix)}}},{key:"remove",value:function(){this.sdk.viewer.scene.primitives.remove(this.primitive),this.primitive=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"controllerCallBack",get:function(){var e=this;return function(t){e.options.heading=-t.rotate.z,e.options.pitch=-t.rotate.y,e.options.roll=t.rotate.x,e.HeadingPitchRollCallBack&&e.HeadingPitchRollCallBack(t);var i=Number(Number(t.position.lng).toFixed(8)),n=Number(Number(t.position.lat).toFixed(8)),o=Number(Number(t.position.alt).toFixed(2));e.options.position={lng:i,lat:n,alt:o};var s=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t.position.lng,t.position.lat,t.position.alt));e.primitive.modelMatrix=s,Cesium.Matrix4.multiplyByMatrix3(e.primitive.modelMatrix,Cesium.Matrix3.fromHeadingPitchRoll(Cesium.HeadingPitchRoll.fromDegrees(-t.rotate.z,-t.rotate.y,t.rotate.x)),e.primitive.modelMatrix);var a=e.options.scale.x,r=e.options.scale.y,l=e.options.scale.z;0===a&&(a=1e-5),0===r&&(r=1e-5),0===l&&(l=1e-5),Cesium.Matrix4.multiplyByScale(e.primitive.modelMatrix,new Cesium.Cartesian3(a,r,l),e.primitive.modelMatrix),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.position.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.position.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.position.alt}))}},set:function(e){this._controllerCallBack=e}},{key:"name",get:function(){return this.options.name},set:function(e){this.options.name=e,this._elms.name&&this._elms.name.forEach((function(t){t.value=e}))}},{key:"rotationEditing",get:function(){return"rtation"===this.ControllerObject.getActiveState()},set:function(e){e?this.ControllerObject.editRtation():this.ControllerObject.destroy()}},{key:"scaleX",get:function(){return this.options.scale.x},set:function(e){var t=this;this.options.scale.x=Number(Number(e).toFixed(4)),this.controllerCallBack({position:Qy({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}}),this._elms.scaleX&&this._elms.scaleX.forEach((function(e){e.value=t.options.scale.x}))}},{key:"scaleY",get:function(){return this.options.scale.y},set:function(e){var t=this;this.options.scale.y=Number(Number(e).toFixed(4)),this.controllerCallBack({position:Qy({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}}),this._elms.scaleY&&this._elms.scaleY.forEach((function(e){e.value=t.options.scale.y}))}},{key:"scaleZ",get:function(){return this.options.scale.z},set:function(e){var t=this;this.options.scale.z=Number(Number(e).toFixed(4)),this.controllerCallBack({position:Qy({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}}),this._elms.scaleZ&&this._elms.scaleZ.forEach((function(e){e.value=t.options.scale.z}))}},{key:"positionEditing",get:function(){return"translational"===this.ControllerObject.getActiveState()},set:function(e){this.sdk&&this.sdk.viewer&&this.ControllerObject&&(e?this.ControllerObject.editTranslational():this.ControllerObject.destroy())}},{key:"lng",get:function(){return this.options.position.lng},set:function(e){this.options.position.lng=e,this.ControllerObject.position={lng:this.options.position.lng,lat:this.options.position.lat,alt:this.options.position.alt},this.controllerCallBack({position:Qy({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}})}},{key:"lat",get:function(){return this.options.position.lat},set:function(e){this.options.position.lat=e,this.ControllerObject.position={lng:this.options.position.lng,lat:this.options.position.lat,alt:this.options.position.alt},this.controllerCallBack({position:Qy({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}})}},{key:"alt",get:function(){return this.options.position.alt},set:function(e){this.options.position.alt=e,this.ControllerObject.position={lng:this.options.position.lng,lat:this.options.position.lat,alt:this.options.position.alt},this.controllerCallBack({position:Qy({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}})}},{key:"show",get:function(){return this.options.show},set:function(e){"boolean"==typeof e?(this.options.show=e,this.primitive.show=e):console.error("参数必须为boolean")}},{key:"playDistance",get:function(){return this.options.playDistance},set:function(e){this.options.playDistance=e}},{key:"flicker",value:function(){}},{key:"load",value:function(e){this._loaded?e():this._loadEvent=e}},{key:"customView",get:function(){this.options.customView}},{key:"setCustomView",value:function(e){if(e)this.options.customView=e;else{var t=this.sdk.viewer.camera;this.options.customView={orientation:{heading:t.heading,pitch:t.pitch,roll:t.roll},position:{x:t.position.x,y:t.position.y,z:t.position.z}},this.originalOptions&&(this.originalOptions.customView=this.options.customView)}}},{key:"resetCustomView",value:function(){this.options.customView=void 0}}],[{key:"setDefaultValue",value:function(e){e.options.id=e.options.id||e.randomString(),e.options.position=e.options.position,e.options.objUrl=e.options.objUrl||"",e.options.videoUrl=e.options.videoUrl||"",e.options.xmlURL=e.options.xmlURL||"",e.options.heading=e.options.heading||0,e.options.pitch=e.options.pitch||0,e.options.roll=e.options.roll||0}}]);var i,n,s}(vi);function tb(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 ib(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?tb(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):tb(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function nb(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var ob=function(e){function t(e,i,n){var o;return k()(this,t),(o=nb(this,t,[e,i,n]))._loadEvent=void 0,o._loaded=!1,o.options.objId=i.objId,o.options.videoId=i.videoId,o.options.videoType=i.videoType||"flv",o}return un()(t,e),x()(t,[{key:"addResource",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=this).options.xmlURL=t.options.objUrl.replace(".obj",".xml"),""===t.options.xmlURL){e.next=35;break}return e.next=5,fetch(t.options.xmlURL);case 5:if(!(i=e.sent).ok){e.next=33;break}return e.next=9,i.text();case 9:return n=e.sent,o=new DOMParser,s=o.parseFromString(n,"text/xml"),r=s.getElementsByTagName("Position")[0].textContent.split(","),l=s.getElementsByTagName("Crs")[0].textContent,c=t.convert([{x:r[0],y:r[1],z:r[2]}],l,"EPSG:4326"),t.options.position=t.options.position||{lng:c.points[0].x,lat:c.points[0].y,alt:c.points[0].z},t.ControllerObject.position=t.options.position,u=t.viwer.scene,h=Cesium.Cartesian3.fromDegrees(t.options.position.lng,t.options.position.lat,t.options.position.alt),p=Cesium.Transforms.headingPitchRollToFixedFrame(h,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(.85),Cesium.Math.toRadians(0),Cesium.Math.toRadians(0))),d=new ji(t.viwer.scene.context),e.next=23,d.Load(t.options.objUrl,t.options.videoId,t.options.host);case 23:(m=e.sent).modelMatrix=p,m.show=t.options.show,m.setFlvVideo(t.options.videoUrl),u.primitives.add(m),t.primitive=m,t.controllerCallBack({rotate:{x:t.options.roll,y:-t.options.pitch,z:-t.options.heading},position:ib({},t.options.position)}),t.loaded=!0,t._loaded=!0,t._loadEvent&&t._loadEvent();case 33:e.next=36;break;case 35:return e.abrupt("return");case 36:if(""!==t.options.objUrl){e.next=38;break}return e.abrupt("return");case 38:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"requestResource",value:(i=o()(a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=this)._loaded){e.next=12;break}if(!t.options.objId){e.next=6;break}return e.next=5,t.requestObjResource();case 5:t.options.objUrl=e.sent;case 6:if(!t.options.videoId){e.next=10;break}return e.next=9,t.requestVideoResource();case 9:t.options.videoUrl=e.sent;case 10:return e.next=12,t.addResource();case 12:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"requestObjResource",value:function(){var e="",t=(e=this.options.host.endsWith("yjearth4.0")?this.options.host:this.options.host+"/yjearth4.0")+"/obj/"+this.options.objId;return fetch(t,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then(function(){var t=o()(a.a.mark((function t(i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.text();case 2:if(n=t.sent,n=JSON.parse(n),![0,200].includes(n.code)){t.next=13;break}if(!n.data.objPath.length){t.next=9;break}return t.abrupt("return",e+"/obj/wirte/file/"+n.data.objPath);case 9:console.warn("资源不存在");case 10:return t.abrupt("return");case 13:return console.warn(n.msg||n.message),t.abrupt("return");case 15:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},{key:"requestVideoResource",value:function(){var e="",t=(e=this.options.host.endsWith("yjearth4.0")?this.options.host:this.options.host+"/yjearth4.0")+"/videoFusion/"+this.options.videoId;return fetch(t,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then(function(){var t=o()(a.a.mark((function t(i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.text();case 2:if(n=t.sent,n=JSON.parse(n),![0,200].includes(n.code)){t.next=13;break}if(!n.data.deviceCode.length){t.next=9;break}return t.abrupt("return",fetch(e+"/videoFusion/vide/stream",{method:"post",body:JSON.stringify({type:"flv",deviceCode:n.data.deviceCode}),headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then(function(){var e=o()(a.a.mark((function e(t){var i;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.text();case 2:if(i=e.sent,i=JSON.parse(i),![0,200].includes(i.code)){e.next=13;break}if(!i.data.flv||!i.data.flv.length){e.next=9;break}return e.abrupt("return",i.data.flv);case 9:console.warn("地址不存在");case 10:return e.abrupt("return");case 13:return console.warn(i.msg||i.message),e.abrupt("return");case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 9:console.warn("设备不存在");case 10:return t.abrupt("return");case 13:return console.warn(n.msg||n.message),t.abrupt("return");case 15:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},{key:"load",value:function(e){this._loaded?e():this._loadEvent=e}}]);var i,n}(eb);function sb(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 ab(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?sb(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):sb(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var rb=function(){return x()((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,e),this.sdk=t,this.options=ab({},i),this.options.show=!i.show&&!1!==i.show||i.show,this.options.host=this.options.host||p(),this.objModelObject=[],this._loaded=!1,this._loadEvent=void 0,this.on()}),[{key:"show",get:function(){return this.options.show},set:function(e){var t=this;if("boolean"==typeof e){this.options.show=e;for(var i=function(i){t.objModelObject[i].load((function(){t.objModelObject[i].show=e}))},n=0;n<this.objModelObject.length;n++)i(n)}else console.error("参数必须为boolean")}},{key:"on",value:(e=o()(a.a.mark((function e(){var t,i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="",t=this.options.host.endsWith("yjearth4.0")?this.options.host+"/api/v1/source/obj":this.options.host+"/yjearth4.0/api/v1/source/obj",this.options.code&&(t=t+"?code="+this.options.code),e.next=5,fetch(t,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 5:if(!(i=e.sent).ok){e.next=15;break}return this.objModelObject=[],e.next=10,i.json();case 10:for(this.list=e.sent.data,this.options.count&&(this.list=this.list.splice(0,this.options.count)),n=0;n<this.list.length;n++)(o=JSON.parse(this.list[n].detail)).host=this.options.host,(this.options.show||!1===this.options.show)&&(o.show=this.options.show),s=new ob(this.sdk,o),this.objModelObject.push(s);this._loaded=!0,this._loadEvent&&this._loadEvent();case 15:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"remove",value:function(){for(var e=this,t=function(t){e.objModelObject[t].load((function(){e.objModelObject[t].remove()}))},i=0;i<this.objModelObject.length;i++)t(i)}},{key:"load",value:function(e){this._loaded?e():this._loadEvent=e}}]);var e}();function lb(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var cb=function(e){function t(e,i){var n;if(k()(this,t),(n=lb(this,t,[e,i])).viewer=e.viewer,n.options.show=!i.show&&!1!==i.show||i.show,n.options.positions=n.options.positions||[],n.options.data=n.options.data,n.options.gradient=i.gradient||{.9:"red",.8:"orange",.7:"yellow",.5:"blue",.3:"green"},n.entity={id:n.options.id},!n.options.positions||n.options.positions.length<3)n._error="最少需要三个坐标!",console.warn(n._error),window.ELEMENT&&window.ELEMENT.Message({message:n._error,type:"warning",duration:1500});else{for(var o=[],s=0;s<n.options.positions.length;s++)o.push([n.options.positions[s].lng,n.options.positions[s].lat]);var a=turf.lineString(o),r=turf.bbox(a);n.bounds={west:r[0],south:r[1],east:r[2],north:r[3]},t.add(n)}return n}return un()(t,e),x()(t,[{key:"remove",value:function(){this.viewer.entities.remove(this.entity),this.entity=null}},{key:"createHeatMap",value:function(e,t){var i=CesiumHeatmap.create(this.bounds,{backgroundColor:"rgba(0,0,0,0)",radius:20,maxOpacity:.5,minOpacity:0,blur:.75,gradient:this.options.gradient});return i.setWGS84Data(0,e,t),i}}],[{key:"add",value:function(e){var i=[];e.options.positions.forEach((function(e){i.push(e.lng,e.lat)}));var n=t.getData(e),o=e.createHeatMap(n.max,n.data);e.entity=new Cesium.Entity({id:e.options.id,show:e.options.show,polygon:{hierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(i)),material:o._heatmap._renderer.canvas,zIndex:e.sdk._entityZIndex}}),e.sdk._entityZIndex++,e.viewer.entities.add(e.entity)}},{key:"getData",value:function(e){var t=1e3,i=[];if(e.options.data&&Array.isArray(e.options.data)){for(var n=e.options.data[0].value,o=0;o<e.options.data.length;o++){var s=e.options.data[o].value;n=Math.max(n,s),i.push({x:e.options.data[o].lng,y:e.options.data[o].lat,value:s})}return{max:n,data:i}}for(var a=0;t--;){var r=Math.floor(1e3*Math.random());a=Math.max(a,r);var l={x:Math.random()*(e.bounds.east-e.bounds.west)+e.bounds.west,y:Math.random()*(e.bounds.north-e.bounds.south)+e.bounds.south,value:r};i.push(l)}return{max:a,data:i}}}])}(Vn);function ub(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}function hb(e,t,i){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,i)}function pb(e,t,i){return e.set(mb(e,t),i),i}function db(e,t){return e.get(mb(e,t))}function mb(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var fb=new WeakMap,vb=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),hb(i=ub(this,t,[e,n]),fb,void 0),i.options.id=n.id||i.randomString(),i.options.name=n.name||"漫游路径",i.options.points=n.points||[],i.options.repeat&&(i.options.repeat=Number(i.options.repeat)),i.Dialog=o,i}return un()(t,e),x()(t,[{key:"repeat",get:function(){return this.options.repeat},set:function(e){if(this.options.repeat!=Number(e)&&(this.options.repeat=Number(e),this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content)){var t=this._DialogObject._element.content.querySelector("input[name='repeat']");t.checked=e===1/0,this.Dialog.changeRepeatStateCallBack&&this.Dialog.changeRepeatStateCallBack(t.checked)}}},{key:"edit",value:(i=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h,p,d,m,f,v,g=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this,n=this.sdk.viewer,o=0,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=44;break}return s=function(e){var t=l.getElementsByClassName("tr");t.length>0&&(t[t.length-1].querySelector("input[name='time']").disabled=void 0);var s=l.getElementsByClassName("tr active")[0];s&&(s.className="tr");var a=document.createElement("div");a.className="tr active",a.innerHTML='\n <div class="td" style="justify-content: center;">视点'.concat(u+1,'</div>\n <div class="td">\n <input class="input time" type="number" title="" min="0" max="999.99" step="0.01" name="time" value="').concat(e.duration,'">\n </div>\n <div class="td action">\n <button class="play">播放</span>\n <button class="delete">删除</span>\n </div>\n '),a.addEventListener("click",(function(e){if(e.target.parentNode===a){var i=l.getElementsByClassName("tr active")[0];i&&(i.className="tr"),a.className="tr active";for(var n=0;n<t.length;n++)if(t[n]===a){o=n+1;break}}})),a.addEventListener("dblclick",(function(e){if(e.target.parentNode===a)for(var i=0;i<t.length;i++)if(t[i]===a){n.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(h[i].position.lng,h[i].position.lat,h[i].position.alt),orientation:h[i].orientation,duration:1});break}}));var r=a.getElementsByClassName("play")[0],c=a.getElementsByClassName("delete")[0],p=a.querySelector("input[name='time']");r.addEventListener("click",(function(){for(var e=0;e<t.length;e++)t[e]===c.parentNode.parentNode&&i.flyTo(e)})),c.addEventListener("click",(function(e){for(var n=0;n<t.length;n++)if(t[n]===c.parentNode.parentNode){if(h.splice(n,1),h[h.length-1].duration=0,i.options.points.splice(n,1),l.removeChild(a),o>n+1?(o--,t[o-1].className="tr active"):o==n+1&&(t.length==n&&(o-=1),0!=t.length&&(t[o-1].className="tr active")),t.length>0){var s=t[t.length-1].querySelector("input[name='time']");s.disabled="disabled",s.value=0}break}})),p.addEventListener("input",(function(t){f.checked=!1,e.duration=Number(p.value),e.duration<0&&(e.duration=0)})),p.addEventListener("blur",(function(){p.value=Number(Number(p.value).toFixed(2)),p.value<0&&(p.value=0)})),l.insertBefore(a,t[o]),o++,t[t.length-1].querySelector("input[name='time']").disabled="disabled"},e.next=8,new J(n._container,{title:"飞行漫游",left:"180px",top:"100px",closeCallBack:function(){g.cease()}});case 8:return this._DialogObject=e.sent,e.next=11,this._DialogObject.init();case 11:for((r=document.createElement("div")).className="fly-roam",r.innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" type="text" name="name">\n </div>\n <div class="col"></div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <input type="checkbox" name="isTotalTime" style="width: 16px; line-height: 15px; height: 15px; cursor: pointer; width: auto; margin-right: 5px;">\n <span class="label">设置总时长</span>\n <div class="input-number input-number-unit-3">\n <input class="input total-time" type="number" title="" min="0" max="999999.99" step="0.01" name="totalTime" value="0">\n <span class="unit" style="top: 6px;">秒(s)</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <input type="checkbox" name="repeat" style="width: 16px; line-height: 15px; height: 15px; cursor: pointer; width: auto; margin-right: 5px;">\n <span class="label">是否循环播放</span>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <button class="add-point"><svg class="icon-add"><use xlink:href="#yj-icon-add"></use></svg>增加视点</button>\n </div>\n <div class="col">\n <button class="modify-point"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>调整视点</button>\n </div>\n <div class="col">\n <button class="afreshPlay"><svg class="icon-play"><use xlink:href="#yj-icon-play"></use></svg>播放</button>\n </div>\n <div class="col">\n <button class="cease"><svg class="icon-pause"><use xlink:href="#yj-icon-pause"></use></svg>结束</button>\n </div>\n </div>\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">序号</div>\n <div class="th">时长(s)</div>\n <div class="th">操作</div>\n </div>\n </div>\n <div class="table-body">\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(r),r.getElementsByTagName("*"),l=r.getElementsByClassName("table-body")[0],c=r.getElementsByClassName("table-empty")[0],u=0,h=new Proxy([],{set:function(e,t,i){return e[t]=i,e.length>0?c.style.display="none":c.style.display="flex",!0}}),u=0;u<this.options.points.length;u++)h.push(this.options.points[u]),s(this.options.points[u]);(p=r.querySelector("input[name='name']")).value=this.name,p.addEventListener("input",(function(){g.name=p.value})),(d=document.createElement("button")).innerHTML="保存",d.addEventListener("click",(function(){g.name||(g.name="漫游路径",p.value=g.name);var e=[];h.map((function(t){e.push(t)})),g._DialogObject.close(),g.Dialog.confirmCallBack&&g.Dialog.confirmCallBack({id:g.options.id,name:g.name,points:e,repeat:g.repeat+""})})),this._DialogObject.footAppChild(d),r.getElementsByClassName("cease")[0].addEventListener("click",(function(){n.camera.cancelFlight()})),r.getElementsByClassName("afreshPlay")[0].addEventListener("click",(function(){h.length>0&&g.flyTo(0)})),r.getElementsByClassName("add-point")[0].addEventListener("click",(function(){var e={duration:0,position:g.cartesian3Towgs84(n.camera.position,n),orientation:{heading:n.camera.heading,pitch:n.camera.pitch,roll:n.camera.roll}};h.splice(o,0,e),g.options.points.splice(o,0,e),s(e),u++})),r.getElementsByClassName("modify-point")[0].addEventListener("click",(function(){if(o){var e=g.cartesian3Towgs84(n.camera.position,n);g.options.points[o-1].position=h[o-1].position=e,g.options.points[o-1].orientation=h[o-1].orientation={heading:n.camera.heading,pitch:n.camera.pitch,roll:n.camera.roll},g.message({text:"操作成功"})}})),m=r.querySelector("input[name='totalTime']"),f=r.querySelector("input[name='isTotalTime']"),v=r.querySelector("input[name='repeat']"),f.addEventListener("change",(function(){var e=l.getElementsByClassName("tr");if(f.checked&&e.length>0){for(var t=Number((Number(m.value)/(e.length-1)).toFixed(2)),i=0;i<e.length-1;i++)h[i].duration=t,g.options.points[i].duration=t,e[i].querySelector("input[name='time']").value=t;e[e.length-1].querySelector("input[name='time']").value=0}})),m.addEventListener("blur",(function(){var e=l.getElementsByClassName("tr");if(m.value=Number(m.value),m.value<0&&(m.value=0),f.checked&&e.length>0){for(var t=Number((Number(m.value)/(e.length-1)).toFixed(2)),i=0;i<e.length-1;i++)h[i].duration=t,g.options.points[i].duration=t,e[i].querySelector("input[name='time']").value=t;e[e.length-1].querySelector("input[name='time']").value=0}})),v.checked=this.repeat===1/0,v.addEventListener("change",(function(){v.checked?g.repeat=1/0:g.repeat=0}));case 44:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"flyTo",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;pi(0);var i=this,n=this.options.points,s=this.repeat;ni(i.sdk);var r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1?arguments[1]:void 0;db(fb,e)&&db(fb,e).destroy();var l=e;pb(fb,e,new Cesium.ScreenSpaceEventHandler(l.sdk.viewer.canvas)),db(fb,e).setInputAction((function(t){e.cease()}),Cesium.ScreenSpaceEventType.RIGHT_CLICK);var c,u=l.sdk.viewer;pi(0),u.camera.cancelFlight(),u.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(n[t].position.lng,n[t].position.lat,n[t].position.alt),orientation:n[t].orientation,duration:i?n[t-1].duration:.5,maximumHeight:n[t].position.alt,complete:(c=o()(a.a.mark((function i(){return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:t++,e.repeat===1/0?s=1/0:s===1/0&&(s=e.repeat),t<=n.length-1?r(t,!0):s?(s--,r(0)):db(fb,e)&&db(fb,e).destroy();case 3:case"end":return i.stop()}}),i)}))),function(){return c.apply(this,arguments)}),easingFunction:i?Cesium.EasingFunction.LINEAR_NONE:Cesium.EasingFunction.EXPONENTIAL_OUT})};r(t)}},{key:"cease",value:function(){this.sdk&&this.sdk.viewer&&this.sdk.viewer.camera.cancelFlight(),db(fb,this)&&db(fb,this).destroy()}},{key:"remove",value:function(){this._DialogObject&&this._DialogObject.close?(this._DialogObject.close(),this._DialogObject=null):this.cease()}}]);var i}(Vn);function gb(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}var yb=function(){return x()((function e(t,i,n){k()(this,e),this.options=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?gb(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):gb(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},t),this.viewer=i,this.viewer1=n,this.head=0,this.pitch=90,this.po=1e-5,this.position=null,this.hpr=null,this.currentFrustumOutline=null,this.frustum=null,this.setInterval1=null,this.webrtc=null,e.setDefaultValue(this),this.create()}),[{key:"create",value:function(){this.frustum=new Cesium.PerspectiveFrustum({fov:Cesium.Math.toRadians(this.options.fov),aspectRatio:this.options.aspectRatio,near:this.options.near,far:this.options.far});var e=this.options.position,t=e.lng,i=e.lat,n=e.alt,o=this.options,s=o.heading,a=o.pitch,r=o.roll;this.position=Cesium.Cartesian3.fromDegrees(t,i,n+this.options.normalHeight),this.hpr=new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(s),Cesium.Math.toRadians(a),Cesium.Math.toRadians(r)),this.drawFrustumOutline(),this.drawFrustumFilled(),this.monitorKeyboard(),this.updateFrustumSquareBase(40),this.syncHpr(),this.options.videoUrl&&this.addVideoToFrustumTop2()}},{key:"monitorKeyboard",value:function(){var e=this,t={KeyQ:function(){return e.setIntervalhpr(-.45)},KeyE:function(){return e.setIntervalhpr(.45)},KeyB:function(){return e.setIntervalhprr(-.45)},KeyN:function(){return e.setIntervalhprr(.45)},KeyW:function(){return e.updateFrustumPosition("move",-1e-5)},KeyS:function(){return e.updateFrustumPosition("move",1e-5)},KeyA:function(){return e.updateFrustumPosition("move",-1e-5,0)},KeyD:function(){return e.updateFrustumPosition("move",1e-5,0)},KeyC:function(){return e.updateFrustumHeight(1)},KeyZ:function(){return e.updateFrustumHeight(-1)}};this.keydownHandler=function(e){t[e.code]&&t[e.code]()},this.keyupHandler=function(){return e.stopFrustumRotation()},document.addEventListener("keydown",this.keydownHandler),document.addEventListener("keyup",this.keyupHandler)}},{key:"addVideoToFrustumTop",value:function(){var e=this,t=document.createElement("video");if(t.width=640,t.height=360,t.autoplay=!0,t.loop=!0,t.muted=!0,document.body.appendChild(t),flvjs.isSupported()){var i=flvjs.createPlayer({type:"flv",isLive:!0,hasAudio:!1,enableStashBuffer:!0,enableWorker:!0,autoCleanupSourceBuffer:!0,url:this.options.videoUrl});i.attachMediaElement(t),i.load(),i.play()}else console.error("FLV.js is not supported in this browser.");var n=this.computeFrustumCorners(this.frustum,this.position,this.hpr),o=new Cesium.PolygonHierarchy([n.bottomLeft,n.bottomRight,n.topRight,n.topLeft]);this.videoEntity=this.viewer.entities.add(new Cesium.Entity({id:"22222222",show:!0,polygon:{hierarchy:o}})),t.addEventListener("loadeddata",(function(){e.videoEntity.polygon.material=t}))}},{key:"addVideoToFrustumTop2",value:(t=o()(a.a.mark((function e(){var t,i,n,o=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=document.createElement("video")).width=640,t.height=360,t.autoplay=!0,t.loop=!0,t.muted=!0,document.body.appendChild(t),e.next=9,this.startPlay(t,this.options.videoUrl);case 9:i=this.computeFrustumCorners(this.frustum,this.position,this.hpr),n=new Cesium.PolygonHierarchy([i.bottomLeft,i.bottomRight,i.topRight,i.topLeft]),this.videoEntity=this.viewer.entities.add(new Cesium.Entity({id:"22222222",show:!0,polygon:{hierarchy:n}})),t.addEventListener("loadeddata",(function(){o.videoEntity.polygon.material=t}));case 13:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"startPlay",value:(e=o()(a.a.mark((function e(t,i){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.webrtc&&this.webrtc.close(),this.webrtc=new SrsRtcWhipWhepAsync,t.srcObject=this.webrtc.stream,e.prev=3,e.next=6,this.webrtc.play(i);case 6:n=e.sent,console.log(n),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),this.webrtc.close();case 13:case"end":return e.stop()}}),e,this,[[3,10]])}))),function(t,i){return e.apply(this,arguments)})},{key:"computeFrustumCorners",value:function(e,t,i){var n=Math.tan(.5*e.fov),o=e.far*n,s=o*e.aspectRatio,a=new Cesium.Cartesian3(-s,o,-e.far),r=new Cesium.Cartesian3(s,o,-e.far),l=new Cesium.Cartesian3(-s,-o,-e.far),c=new Cesium.Cartesian3(s,-o,-e.far),u=Cesium.Transforms.headingPitchRollToFixedFrame(t,i);return{topLeft:Cesium.Matrix4.multiplyByPoint(u,a,new Cesium.Cartesian3),topRight:Cesium.Matrix4.multiplyByPoint(u,r,new Cesium.Cartesian3),bottomLeft:Cesium.Matrix4.multiplyByPoint(u,l,new Cesium.Cartesian3),bottomRight:Cesium.Matrix4.multiplyByPoint(u,c,new Cesium.Cartesian3)}}},{key:"updatePolygonPosition",value:function(){var e=this.computeFrustumCorners(this.frustum,this.position,this.hpr);this.videoEntity.polygon.hierarchy=new Cesium.CallbackProperty((function(t){return new Cesium.PolygonHierarchy([e.bottomLeft,e.bottomRight,e.topRight,e.topLeft])}))}},{key:"updateFrustumSquareBase",value:function(e){var t=(56-e)/55*9900+100;this.frustum.aspectRatio=1;var i=Math.sqrt(t),n=this.frustum.far,o=2*Math.atan(i/(2*n));this.frustum.fov=o,this.drawFrustumOutline(),this.drawFrustumFilled(),this.syncHpr()}},{key:"updateFrustumHeight",value:function(e){var t=Cesium.Cartographic.fromCartesian(this.position);t.height+=e,this.position=Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(t.longitude),Cesium.Math.toDegrees(t.latitude),t.height),this.options.position.alt=t.height,this.syncHpr(),this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"updatePositionHeight",value:function(e){this.options.position=this.cartesian3Towgs84(e),this.syncHpr(),this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"cartesian3Towgs84",value:function(e){var t=this.viewer.scene.globe.ellipsoid,i=new Cesium.Cartesian3(e.x,e.y,e.z),n=t.cartesianToCartographic(i),o=Cesium.Math.toDegrees(n.latitude);return{lng:Cesium.Math.toDegrees(n.longitude),lat:o,alt:n.height<0?0:n.height}}},{key:"setIntervalhpr",value:function(e){var t=this;this.stopFrustumRotation(),this.setInterval1=setInterval((function(){t.head+=e,t.updateFrustumHPR(Cesium.Math.toRadians(t.head),t.pitch)}),10)}},{key:"setIntervalhprr",value:function(e){var t=this;this.stopFrustumRotation(),this.setInterval1=setInterval((function(){t.pitch=Math.max(60,Math.min(180,t.pitch+e)),t.updateFrustumHPR(t.head,Cesium.Math.toRadians(t.pitch))}),10)}},{key:"stopFrustumRotation",value:function(){this.setInterval1&&(clearInterval(this.setInterval1),this.setInterval1=null)}},{key:"drawFrustumFilled",value:function(){var e=Cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpr),t=new Cesium.FrustumGeometry({frustum:this.frustum,origin:Cesium.Matrix4.getTranslation(e,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(e,new Cesium.Matrix3))});this.currentFrustumFilled&&this.viewer.scene.primitives.remove(this.currentFrustumFilled),this.currentFrustumFilled=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:t,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromAlpha(Cesium.Color.YELLOW,.4))}}),appearance:new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.fromAlpha(Cesium.Color.YELLOW,.4)}),translucent:!0}),asynchronous:!1,show:this.options.show}),this.viewer.scene.primitives.add(this.currentFrustumFilled)}},{key:"drawFrustumOutline",value:function(){var e=Cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpr),t=new Cesium.FrustumOutlineGeometry({frustum:this.frustum,origin:Cesium.Matrix4.getTranslation(e,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(e,new Cesium.Matrix3))});this.currentFrustumOutline&&this.viewer.scene.primitives.remove(this.currentFrustumOutline),this.currentFrustumOutline=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:t,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW)}}),appearance:new Cesium.PolylineColorAppearance({translucent:!1}),asynchronous:!1,show:this.options.show}),this.viewer.scene.primitives.add(this.currentFrustumOutline)}},{key:"updateFrustumPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"move",t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:90,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if("move"===e){var o=turf.point([this.options.position.lng,this.options.position.lat]),s=Cesium.Math.toDegrees(this.hpr.heading),a=s+i,r={units:"degrees"},l=turf.destination(o,t,a,r).geometry.coordinates;this.position=Cesium.Cartesian3.fromDegrees(l[0],l[1],this.options.position.alt+this.options.normalHeight),this.options.position.lng=l[0],this.options.position.lat=l[1],this.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(l[0],l[1],this.viewer.camera.positionCartographic.height)})}"update"===e&&(this.position=t,this.options.videoUrl&&this.updatePolygonPosition()),n&&(this.syncHpr(),this.updateFrustumAttributes())}},{key:"syncHpr",value:function(){if(this.viewer1){var e=this.options.position,t=e.lng,i=e.lat,n=e.alt,o=-this.hpr.pitch-Cesium.Math.toRadians(-90);this.viewer1.camera.setView({destination:Cesium.Cartesian3.fromDegrees(t,i,n+this.options.normalHeight),orientation:{heading:this.hpr.heading+Cesium.Math.toRadians(-90),pitch:o,roll:this.hpr.roll}})}}},{key:"updateFrustumHPR",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.head,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.pitch,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";function s(e){return e*Math.PI/180}"alone"==o?(this.hpr.heading=s(e),this.hpr.pitch=s(t),this.hpr.roll=s(i)):(this.hpr.heading=Cesium.Math.negativePiToPi(e),this.hpr.pitch=Cesium.Math.negativePiToPi(t),this.hpr.roll=Cesium.Math.negativePiToPi(i)),n&&(this.syncHpr(),this.updateFrustumAttributes())}},{key:"updateFrustumAttributes",value:function(){if(this.position&&this.hpr){var e=Cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpr);if(e)try{var t=new Cesium.FrustumOutlineGeometry({frustum:this.frustum,origin:Cesium.Matrix4.getTranslation(e,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(e,new Cesium.Matrix3))}),i=new Cesium.PolylineColorAppearance({translucent:!1}),n=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW),o=new Cesium.FrustumGeometry({frustum:this.frustum,origin:Cesium.Matrix4.getTranslation(e,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(e,new Cesium.Matrix3))}),s=new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.YELLOW.withAlpha(.5)}),translucent:!0}),a=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED.withAlpha(.5));this.currentFrustumOutline&&this.viewer.scene.primitives.remove(this.currentFrustumOutline),this.currentFrustumFilled&&this.viewer.scene.primitives.remove(this.currentFrustumFilled),this.currentFrustumOutline=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:t,attributes:{color:n}}),appearance:i,asynchronous:!1,show:this.options.show}),this.viewer.scene.primitives.add(this.currentFrustumOutline),this.currentFrustumFilled=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:o,attributes:{color:a}}),appearance:s,asynchronous:!1,show:this.options.show}),this.viewer.scene.primitives.add(this.currentFrustumFilled)}catch(e){console.error("Error in drawFrustum:",e)}else console.error("Transform generation failed.")}else console.error("Position or HPR is not defined:",this.position,this.hpr)}},{key:"updateFrustumNearFar",value:function(e,t){this.frustum.near=e,this.frustum.far=t,this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"updateFrustumFov",value:function(e){this.frustum.fov=Cesium.Math.toRadians(e),this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"show",get:function(){return this.options.show},set:function(e){"boolean"==typeof e&&(this.options.show=e,this.currentFrustumOutline.show=e,this.currentFrustumFilled.show=e)}},{key:"remove",value:function(){document.removeEventListener("keydown",this.keydownHandler),document.removeEventListener("keyup",this.keyupHandler),this.currentFrustumFilled&&this.viewer.scene.primitives.remove(this.currentFrustumFilled),this.currentFrustumOutline&&this.viewer.scene.primitives.remove(this.currentFrustumOutline),this.videoEntity&&this.viewer.entities.remove(this.videoEntity)}}],[{key:"setDefaultValue",value:function(e){var t;e.options.position=e.options.position||{},e.options.fov=e.options.fov||30,e.options.aspectRatio=e.options.aspectRatio||1,e.options.near=e.options.near||1,e.options.far=e.options.far||120,e.options.heading=e.options.heading||0,e.options.pitch=e.options.pitch||90,e.options.roll=e.options.roll||0,e.options.show=null===(t=e.options.show)||void 0===t||t,e.options.videoUrl=e.options.videoUrl||"",e.options.index=e.options.index||0,e.options.arr=e.options.arr||[],e.options.normalHeight=e.options.normalHeight||100}}]);var e,t}();function bb(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}var Cb=function(){return x()((function e(t,i){k()(this,e),this.options=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?bb(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):bb(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},t),this.pointEntity=null,this.billboardEntity=null,this.lineEntity=null,this.updatedPosition=[],this.pointUpdatedPosition=[],this.viewer=i,this.handler=new Cesium.ScreenSpaceEventHandler(i.scene.canvas),this.pinBuilder=new Cesium.PinBuilder,this.index=null,e.setDefaultValue(this),e.init(this)}),[{key:"changeAltitude",value:function(){var e,t,i=!1,n=this,o=!1;document.addEventListener("keydown",(function(e){"h"===e.key&&(o=!0)})),document.addEventListener("keyup",(function(e){o=!1})),this.handler.setInputAction((function(o){var s=n.viewer.scene.pick(o.position);if(Cesium.defined(s)&&Cesium.defined(s.id)&&s.id===n.billboardEntity){i=!0,e=o.position;var a=Cesium.Cartographic.fromCartesian(n.billboardEntity.position.getValue());t=a.height}}),Cesium.ScreenSpaceEventType.LEFT_DOWN),this.handler.setInputAction((function(s){if(i&&0==o){var a=n.viewer.scene.pickPosition(s.endPosition);if(n.disableCameraDrag(n.viewer,!1),a){var r=Cesium.Cartographic.fromCartesian(a),l=r.longitude,c=r.latitude,u=Cesium.Cartesian3.fromRadians(l,c,t),h=Cesium.Cartesian3.fromRadians(l,c,0);n.billboardEntity.position=new Cesium.CallbackProperty((function(){return u}),!1),n.billboardEntity.label.text="Lat: ".concat(Cesium.Math.toDegrees(l).toFixed(6),"\nLon: ").concat(Cesium.Math.toDegrees(c).toFixed(6),"\nAlt: ").concat(t.toFixed(2),"m"),n.pointEntity.position=new Cesium.CallbackProperty((function(){return h}),!1)}}if(i&&o){console.log(o);var p=s.endPosition,d=e.y-p.y,m=t+d,f=Cesium.Cartographic.fromCartesian(n.billboardEntity.position.getValue()),v=Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(f.longitude),Cesium.Math.toDegrees(f.latitude),m);n.disableCameraDrag(n.viewer,!1),n.billboardEntity.position=new Cesium.CallbackProperty((function(){return v}),!1),n.billboardEntity.label.text="Lat: ".concat(Cesium.Math.toDegrees(f.longitude).toFixed(6),"\nLon: ").concat(Cesium.Math.toDegrees(f.latitude).toFixed(6),"\nAlt: ").concat(m.toFixed(2),"m")}}),Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction((function(e){var t=n.viewer.scene.pick(e.position);i=!1,o=!1,n.disableCameraDrag(n.viewer,!0),Cesium.defined(t)&&Cesium.defined(t.id)&&t.id===n.billboardEntity&&(n.options.saveFun&&n.options.saveFun(null,!1),n.options.selectFun&&n.options.selectFun(n.billboardEntity.index-1),n.options.frustum.updatePositionHeight(n.billboardEntity.position.getValue()))}),Cesium.ScreenSpaceEventType.LEFT_UP)}},{key:"disableCameraDrag",value:function(e,t){e.scene.screenSpaceCameraController.enableRotate=t,e.scene.screenSpaceCameraController.enableTranslate=t,e.scene.screenSpaceCameraController.enableZoom=t,e.scene.screenSpaceCameraController.enableTilt=t,e.scene.screenSpaceCameraController.enableLook=t}},{key:"show",get:function(){return this.options.show},set:function(e){"boolean"==typeof e&&(this.pointEntity.show=e,this.billboardEntity.show=e,this.lineEntity.show=e)}},{key:"remove",value:function(){this.viewer.entities.remove(this.pointEntity),this.viewer.entities.remove(this.billboardEntity),this.viewer.entities.remove(this.lineEntity)}}],[{key:"setDefaultValue",value:function(e){var t;e.options.positions=e.options.positions||{},e.options.normalHeight=e.options.normalHeight||100,e.options.airHeight=e.options.airHeight||100,e.options.image=e.options.image||"/static/img/cluster2.png",e.options.show=e.options.show||!0,e.options.index=e.options.index||1,e.options.saveFun=e.options.saveFun||null,e.options.selectFun=e.options.selectFun||null,e.options.keyboard=null===(t=e.options.keyboard)||void 0===t||t,e.options.updateFrustumFun=e.options.updateFrustumFun||null,e.options.frustum=e.options.frustum||null}},{key:"init",value:function(e){var t=e.options.positions;e.pointEntity=e.viewer.entities.add({show:e.options.show,position:Cesium.Cartesian3.fromDegrees(t.lng,t.lat,0),point:{pixelSize:8,color:Cesium.Color.WITHE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:0}});var i=e.pinBuilder.fromText(e.options.index,Cesium.Color.fromCssColorString("#00d590"),36).toDataURL(),n=0;n=t.altitude?t.altitude:e.options.normalHeight,e.billboardEntity=e.viewer.entities.add({show:e.options.show,position:Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt+e.options.normalHeight),label:{text:"Lat: ".concat(t.lng.toFixed(8),"\nLon: ").concat(t.lat.toFixed(8),"\nAlt: ").concat(n.toFixed(8),"m"),font:"14px sans-serif",fillColor:Cesium.Color.YELLOW,outlineColor:Cesium.Color.BLACK,outlineWidth:2,pixelOffset:new Cesium.Cartesian2(0,-60),heightReference:Cesium.HeightReference.RELATIVE_TO_TERRAIN,show:!1},billboard:{image:i,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,width:36,height:36},index:e.options.index}),e.lineEntity=e.viewer.entities.add({show:e.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){return[e.pointEntity.position.getValue(),e.billboardEntity.position.getValue()]}),!1),width:1,material:new Cesium.PolylineOutlineMaterialProperty({outlineColor:Cesium.Color.GAINSBORO,outlineWidth:1,color:Cesium.Color.WITHE}),zIndex:99999999}}),e.options.keyboard&&e.changeAltitude(),e.handler.setInputAction((function(t){var i=e.viewer.scene.pick(t.position);Cesium.defined(i)&&Cesium.defined(i.id)&&i.id===e.billboardEntity&&e.options.selectFun&&e.options.selectFun(e.billboardEntity.index-1)}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}}])}();function wb(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 kb(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?wb(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):wb(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var _b=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;k()(this,e),this.options=kb({},t),this.viewer=i,this.viewer1=n,this.entity=null,this.frustum=null,this.billordPointLineMaps=[],this.index=0,this.positions=[],e.setDefaultValue(this),this.create()}),[{key:"create",value:function(){var e=this;if(!(this.options.positions.length<2)){var t=this.options.frustumShow;this.entity=this.viewer.entities.add({show:this.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){for(var t=[],i=0;i<e.billordPointLineMaps.length;i++){var n=e.billordPointLineMaps[i];t.push(n.billboardEntity.position.getValue())}return t}),!1),width:3,material:Cesium.Color.fromCssColorString(this.options.color)}});for(var i=0;i<this.options.positions.length;i++){var n=this.options.positions[i];t&&i==this.index&&(this.frustum=new yb({position:n,show:!1,arr:this.options.positions,index:i,normalHeight:this.options.normalHeight},this.viewer,this.viewer1));var o=new Cb({positions:n,index:i+1,saveFun:this.options.saveFun,selectFun:this.options.selectFun,keyboard:this.options.keyboard,updateFrustumFun:this.updateFrustumPosition,normalHeight:this.options.normalHeight,frustum:this.frustum,airHeight:this.options.airHeight},this.viewer);this.billordPointLineMaps.push(o)}this.onKey()}}},{key:"show",get:function(){return this.options.show},set:function(e){"boolean"==typeof e&&(this.frustum.currentFrustumOutline.show=e,this.billordPointLineMaps.forEach((function(t){t.show=e})),this.entity.show=e)}},{key:"onKey",value:function(){var e=this;document.addEventListener("keydown",(function(t){switch(t.key){case"ArrowUp":e.index+=1,e.updateFrustum(!0);break;case"ArrowDown":e.index-=1,e.updateFrustum(!1)}}))}},{key:"updateFrustum",value:function(e){if(console.log(this.index),this.index>this.options.positions.length-1||this.index<0){var t=this.index>0?"已选中最后一个航点":"已选中第一个航点";alert(t)}else for(var i=0;i<this.billordPointLineMaps.length;i++){var n=this.billordPointLineMaps[i];if(i==this.index){var o=n.billboardEntity.position.getValue();0!==this.index&&(this.direction(this.billordPointLineMaps[i-1].billboardEntity.position.getValue(),n.billboardEntity.position.getValue()).hpr,kn()("hpr")),0==this.index&&(this.direction(this.billordPointLineMaps[0].billboardEntity.position.getValue(),this.billordPointLineMaps[1].billboardEntity.position.getValue()).hpr,kn()("hpr")),o&&this.frustum.updateFrustumPosition("update",o)}}}},{key:"cartesian3Towgs84",value:function(e){var t=this.viewer.scene.globe.ellipsoid,i=new Cesium.Cartesian3(e.x,e.y,e.z),n=t.cartesianToCartographic(i),o=Cesium.Math.toDegrees(n.latitude);return{lng:Cesium.Math.toDegrees(n.longitude),lat:o,alt:n.height<0?0:n.height}}},{key:"direction",value:function(e,t){var i=Cesium.Cartesian3.subtract(e,t,new Cesium.Cartesian3),n=Cesium.Cartesian3.normalize(i,new Cesium.Cartesian3),o=Cesium.Transforms.rotationMatrixFromPositionVelocity(e,n,Cesium.Ellipsoid.WGS84),s=Cesium.Matrix4.fromRotationTranslation(o,e),a=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Matrix4.getTranslation(s,new Cesium.Cartesian3),Cesium.Ellipsoid.WGS84,new Cesium.Matrix4),r=Cesium.Matrix4.multiply(Cesium.Matrix4.inverse(a,new Cesium.Matrix4),s,new Cesium.Matrix4),l=Cesium.Matrix4.getMatrix3(r,new Cesium.Matrix3),c=Cesium.Quaternion.fromRotationMatrix(l),u=Cesium.HeadingPitchRoll.fromQuaternion(c);return u.pitch=90,{hpr:u,orientation:Cesium.Transforms.headingPitchRollQuaternion(e,u)}}},{key:"delPosition",value:function(e){this.options.positions.splice(e,1),this.remove(),this.create()}},{key:"getNewPositions",value:function(){for(var e=[],t=0;t<this.billordPointLineMaps.length;t++){var i=this.billordPointLineMaps[t],n=this.cartesian3Towgs84(i.billboardEntity.position.getValue());e.push(n)}return e}},{key:"remove",value:function(){this.billordPointLineMaps.forEach((function(e,t){e.remove()})),this.frustum&&this.frustum.remove(),this.viewer.entities.remove(this.entity),this.billordPointLineMaps=[]}},{key:"addPoint",value:function(e){this.options.positions=e,this.remove(),this.create()}},{key:"updateFrustumPosition",value:function(e){if(this.billordPointLineMaps&&0!==this.billordPointLineMaps.length){this.frustum&&(this.frustum.show=!0);var t=this.billordPointLineMaps[e].billboardEntity.position.getValue();if(0!==e){var i=e===this.billordPointLineMaps.length-1?this.billordPointLineMaps[e-1].billboardEntity.position.getValue():this.billordPointLineMaps[e+1].billboardEntity.position.getValue(),n=this.direction(e===this.billordPointLineMaps.length-1?i:t,e===this.billordPointLineMaps.length-1?t:i).hpr;this.frustum.updateFrustumHPR(n.heading,Cesium.Math.toRadians(this.frustum.pitch),n.roll)}else{var o=this.billordPointLineMaps[1].billboardEntity.position.getValue(),s=this.direction(t,o).hpr;this.frustum.updateFrustumHPR(s.heading,Cesium.Math.toRadians(this.frustum.pitch),s.roll)}t&&this.frustum.updateFrustumPosition("update",t);var a=this.cartesian3Towgs84(t);this.billordPointLineMaps.forEach((function(e){e.billboardEntity.label.show=!1}));var r=this.billordPointLineMaps.find((function(t){return t.billboardEntity.index==e+1}));return r&&(r.billboardEntity.label.show=!0),a}}},{key:"flyTo",value:function(){for(var e=[],t=0;t<this.options.positions.length;t++){var i=Cesium.Cartesian3.fromDegrees(this.options.positions[t].lng,this.options.positions[t].lat,this.options.positions[t].alt+this.options.height);e.push(i.x,i.y,i.z)}var n=Cesium.BoundingSphere.fromVertices(e);this.viewer.camera.flyToBoundingSphere(n,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-80),roll:Cesium.Math.toRadians(0)}})}},{key:"countLength",value:function(){if(this.options.positions.length<2)return 0;var e=[];this.options.positions.forEach((function(t){e.push([t.lng,t.lat])}));var t=turf.lineString(e);return(1e3*turf.length(t)).toFixed(2)}},{key:"countTime",value:function(){var e=Math.floor(Number(this.countLength()))/this.options.speed,t=Math.floor(e%60);return Math.floor(e/60)+"分"+t+"秒"}}],[{key:"setDefaultValue",value:function(e){var t,i;e.options.positions=e.options.positions||[],e.options.show=e.options.show||!0,e.options.color=e.options.color||"#00d590",e.options.height=e.options.height||500,e.options.speed=e.options.speed||1,e.options.frustumShow=null===(t=e.options.frustumShow)||void 0===t||t,e.options.saveFun=e.options.saveFun||null,e.options.selectFun=e.options.selectFun||null,e.options.keyboard=null===(i=e.options.keyboard)||void 0===i||i,e.options.normalHeight=e.options.normalHeight||100,e.options.airHeight=e.options.airHeight||100}}])}();function xb(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Eb=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=xb(this,t,[e,n])).options.tipText=n.tipText?n.tipText:"左键确定,右键结束;",i}return un()(t,e),x()(t,[{key:"start",value:function(e){var t=this;if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i=void 0;YJ.Measure.SetMeasureStatus(!0),this.tip=new Q(this.options.tipText,this.sdk),this.event=new K(this.sdk),this.isEntity=!1,this.event.mouse_left((function(n,o){t.end();var s=t.cartesian3Towgs84(i||o,t.viewer),a=t.viewer.scene.pick(n.position);Cesium.defined(a)&&Cesium.defined(a.id)&&a.id.id===window.airportEntity.options.id&&(t.isEntity=!0),e(null,s,t.isEntity)})),this.event.mouse_right((function(i,n){t.end(),e(!1)})),this.event.mouse_move((function(e,n){i=n,t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),this.event.gesture_pinck_start((function(n,o){var s=new Date;t.event.gesture_pinck_end((function(){if(new Date-s>=500)t.end(),e(!1);else{t.end();var n=t.cartesian3Towgs84(i||o,t.viewer);e(null,n)}}))}))}}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event.destroy(),this.tip.destroy()}}])}(la);function Sb(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 Pb(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Sb(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Sb(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Db(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Mb=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(i=Db(this,t,[e,n])).viewer=i.sdk.viewer,i.options.name=n.name||"飞线",i.options.pointNumber=n.pointNumber||200,i.options.height=n.height||200,i.options.heightDifference=n.heightDifference||3e3,i.options.width=n.width||2,i.options.duration=n.duration||10,i.options.color=n.color||"rgba(255,255,255,1)",i.options.lineBackAlpha=n.lineBackAlpha||.05,i.options.positions=n.positions||[],i.options.show=!n.show&&!1!==n.show||n.show,i.Dialog=o,i._EventBinding=new xn,i._elms={},i.positionArea=[],i.positions=[],i.sdk.addIncetance(i.options.id,i),t.drawLine(i),i}return un()(t,e),x()(t,[{key:"getRandomPointsInCesiumPolygon",value:function(e,t){var i=[],n=[],o=[];e.forEach((function(e){i.push(e.lng),n.push(e.lat),o.push([e.lng,e.lat])})),o.push([o[0][0],o[0][1]]);for(var s=Math.min.apply(Math,i),a=Math.max.apply(Math,i),r=Math.min.apply(Math,n),l=Math.max.apply(Math,n),c=[];c.length<t;){var u=s+Math.random()*(a-s),h=r+Math.random()*(l-r),p=turf.point([u,h]),d=turf.polygon([o]);if(turf.booleanPointInPolygon(p,d)){var m=Cesium.Cartesian3.fromDegrees(u,h),f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(m).height;c.push([u,h,f])}}return c}},{key:"getLine",value:function(e,t){var i;e.viewer.entities.getById(e.options.id)&&(e.viewer.entities.getById(e.options.id)._children.forEach((function(t){e.viewer.entities.remove(t)})),e.viewer.entities.remove(e.viewer.entities.getById(e.options.id))),i=e.viewer.entities.add(new Cesium.Entity({id:e.options.id,show:e.options.show})),t.forEach((function(t,n){var o=t,s=Cesium.Cartesian3.fromDegrees(o[0],o[1],o[2]),a=Cesium.Cartesian3.fromDegrees(o[0],o[1],o[2]+e.options.height+Math.random()*e.options.heightDifference);e.viewer.entities.add({parent:i,id:e.options.id+"-"+(new Date).getTime()+n,polyline:{positions:[s,a],width:e.options.width,material:new Cesium.FlowLineMaterialProperty({color:e.options.color,duration:e.options.duration,lineBackAlpha:e.options.lineBackAlpha,num:0})}})}))}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;this.options.color=e;var i=this.viewer.entities.getById(this.options.id);i&&i._children.forEach((function(t){t.polyline.material.color=Cesium.Color.fromCssColorString(e)})),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,255,255,1)"}});t._elms.color[n]=o}))}},{key:"pointNumber",get:function(){return this.options.pointNumber},set:function(e){if(this.options.pointNumber=e,this.viewer.entities.getById(this.options.id)){var t=this.getRandomPointsInCesiumPolygon(this.positionArea,this.options.pointNumber);this.positions=t,this.getLine(this,t)}}},{key:"height",get:function(){return this.options.height},set:function(e){this.options.height=e,this.viewer.entities.getById(this.options.id)&&this.getLine(this,this.positions)}},{key:"show",get:function(){return this.options.show},set:function(e){this.options.show=e;var t=this.viewer.entities.getById(this.options.id);t&&(t.show=e)}},{key:"heightDifference",get:function(){return this.options.heightDifference},set:function(e){this.options.heightDifference=e,this.viewer.entities.getById(this.options.id)&&this.getLine(this,this.positions)}},{key:"width",get:function(){return this.options.width},set:function(e){this.options.width=e;var t=this.viewer.entities.getById(this.options.id);t&&t._children.forEach((function(t){t.polyline.width=e}))}},{key:"duration",get:function(){return this.options.duration},set:function(e){this.options.duration=e;var t=this.viewer.entities.getById(this.options.id);t&&t._children.forEach((function(t){t.polyline.material.duration=e}))}},{key:"lineBackAlpha",get:function(){return this.options.lineBackAlpha},set:function(e){this.options.lineBackAlpha=e;var t=this.viewer.entities.getById(this.options.id);t&&t._children.forEach((function(t){t.polyline.material.lineBackAlpha=e}))}},{key:"edit",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s=this,r=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.length>0&&void 0!==r[0]&&r[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=19;break}return e.next=7,new pn(this.sdk,this.originalOptions,{title:"飞线属性",left:"180px",top:"100px",confirmCallBack:function(e){s.name=s.name.trim(),s.name||(s.name="飞线"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),Mt(s.sdk,s.options.id),at(s.sdk,s.options.id)},resetCallBack:function(){s.reset(),s.Dialog.resetCallBack&&s.Dialog.resetCallBack()},removeCallBack:function(){s.Dialog.removeCallBack&&s.Dialog.removeCallBack()},closeCallBack:function(){s.reset(),s.Dialog.closeCallBack&&s.Dialog.closeCallBack()},showCallBack:function(e){s.show=e,s.Dialog.showCallBack&&s.Dialog.showCallBack()}},!0);case 7:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" flow-line-surface",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="flowLine-color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">飞线数量</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999" @model="pointNumber">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">飞线宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="99999" min="1" step="1" @model="width">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n\n <div class="col">\n <span class="label">飞线高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999" step="1" @model="height">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">飞线高度差</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="99999" min="0" step="1" @model="heightDifference">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">单次运动时长(s)</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="999999999" min="1" step="1" @model="duration">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">轨迹透明度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="1" min="0.01" step="0.01" @model="lineBackAlpha">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("flowLine-color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){s.color=e},clear:function(){s.color="rgba(255,255,255,1)"}}),o=i.getElementsByTagName("*"),this._EventBinding.on(this,o),this._elms=this._EventBinding.element,this._elms.color=[n],e.next=19;break;case 19:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"reset",value:function(){this.viewer.entities.getById(this.options.id)&&(this.name=this.originalOptions.name,this.pointNumber=this.originalOptions.pointNumber,this.height=this.originalOptions.height,this.heightDifference=this.originalOptions.heightDifference,this.width=this.originalOptions.width,this.duration=this.originalOptions.duration,this.color=this.originalOptions.color,this.lineBackAlpha=this.originalOptions.lineBackAlpha)}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p.length>0&&void 0!==p[0]&&p[0],pi(0),ni(this.sdk),oi(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)t={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Pb({},this.options.position):this.options.positions?r=Pb({},this.options.positions[0]):this.options.center?r=Pb({},this.options.center):this.options.start?r=Pb({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:t});else{for(l=[],c=0;c<this.positions.length;c++)u=Cesium.Cartesian3.fromDegrees(this.positions[c][0],this.positions[c][1],this.positions[c][2]+this.options.height+this.options.heightDifference/2),l.push(u.x,u.y,u.z);h=Cesium.BoundingSphere.fromVertices(l),this.viewer.camera.flyToBoundingSphere(h,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-20),roll:Cesium.Math.toRadians(0)}})}case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"getSphere",value:function(){var e=this;return new Promise((function(t){var i=setInterval((function(){var t=new Cesium.BoundingSphere;e.sdk.viewer._dataSourceDisplay.getBoundingSphere(e.viewer.entities.getById(e.options.id),!1,t)===Cesium.BoundingSphereState.DONE&&clearInterval(i)}),1e3)}))}},{key:"remove",value:(i=o()(a.a.mark((function e(){var t=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.viewer.entities.getById(this.options.id)&&(this.viewer.entities.getById(this.options.id)._children.forEach((function(e){t.viewer.entities.remove(e)})),this.viewer.entities.remove(this.viewer.entities.getById(this.options.id))),this.positions=[],this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=6,this.sdk.removeIncetance(this.options.id);case 6:return e.next=8,Mt(this.sdk,this.options.id);case 8:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"create",value:function(e){new pa(e.sdk).start((function(t,i){e.positionArea=i;var n=e.getRandomPointsInCesiumPolygon(i,e.options.pointNumber);e.positions=n,e.getLine(e,n),e.edit(!0)}))}},{key:"drawLine",value:function(e){e.positionArea=e.options.positions;var t=e.getRandomPointsInCesiumPolygon(e.options.positions,e.options.pointNumber);e.positions=t,e.getLine(e,t)}}]);var i,n,s}(Vn);function Tb(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Ob(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)?Ob(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ob(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}var Nb=function(){function e(){k()(this,e),this.element={}}return x()(e,[{key:"getEvent",value:function(t){return e.event[t]}},{key:"getEventAll",value:function(){return e.event}},{key:"setEvent",value:function(t,i){e.event[t]=i}},{key:"on",value:function(e,t){var i=this;this.element={};for(var n=function(){if(!t[o]||!t[o].attributes)return 1;var n,s={input:[],change:[],blur:[],click:[]},a=!1,r=[],l=Tb(t[o].attributes);try{var c=function(){var l=n.value;switch(l.name){case"@model":a=!0,"checkbox"==t[o].type?(s.change.push((function(t){e[l.value]=t.target.checked})),t[o].checked=e[l.value]):("number"==t[o].type?(s.input.push((function(t){if(t.target.value||0===t.target.value){var i=t.target.value;i=Number(i),"."==t.data||"-"==t.data&&!t.target.value||((!t.target.max&&!t.target.min||i<=Number(t.target.max)&&i>=Number(t.target.min))&&(i=i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),e[l.value]=i)}})),s.blur.push((function(t){var i=t.target.value;(t.target.value||"undefined"!==t.target.dataset.null&&""!==t.target.dataset.null&&!Boolean(t.target.dataset.null))&&(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),t.target.dataset.min&&i<Number(t.target.dataset.min)&&(i=Number(t.target.dataset.min))),e[l.value]=i}))):s.input.push((function(t){e[l.value]=t.target.value})),"IMG"==t[o].nodeName?t[o].src=e[l.value]:t[o].value=e[l.value]),i.element[l.value]?i.element[l.value].push(t[o]):i.element[l.value]=[t[o]],r.push(l.name);break;case"@click":a=!0,s.click.push((function(t){"function"==typeof e[l.value]&&e[l.value](t)})),r.push(l.name)}};for(l.s();!(n=l.n()).done;)c()}catch(e){l.e(e)}finally{l.f()}for(var u=0;u<r.length;u++)t[o].attributes.removeNamedItem(r[u]);if(a){var h=function(e){s[e].length>0&&t[o].addEventListener(e,(function(t){for(var i=0;i<s[e].length;i++)s[e][i](t)}))};for(var p in s)h(p)}},o=0;o<t.length;o++)n()}}])}();C()(Nb,"event",{});var Bb=Nb;function Ab(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}var Lb=function(){return x()((function e(t,i){k()(this,e),this.sdk=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ab(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ab(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},t),this.progress=document.getElementById("progress"),this.handle=document.getElementById("handle"),this.timeline=document.getElementsByClassName("timeline-container")[0],this.currentTime=document.getElementById("currentTime"),this.timelineCon=document.getElementsByClassName("timeline-container")[0],this.speed=i,this.animationId,this.startTime=performance.now(),this.manualPosition=null,this.isDragging=!1,this.pauseed=!1,this.time="",this.update=this.update.bind(this),e.init(this)}),[{key:"moveComplay",value:function(e){var t=this;document.addEventListener("mouseup",(function(){t.isDragging&&(t.isDragging=!1,null!==t.manualPosition&&(t.startTime=performance.now()-86400*t.manualPosition*1e3/t.speed,t.manualPosition=null,t.changeDate&&(t.changeDateGrag=!0),t.pauseed?(t.pausedTime=performance.now(),e(t.currentTime.textContent)):(t.update(),e(t.time))))}))}},{key:"formatTime",value:function(e){var t=Math.floor(e/3600).toString().padStart(2,"0"),i=Math.floor(e%3600/60).toString().padStart(2,"0"),n=Math.floor(e%60).toString().padStart(2,"0");return"".concat(t,":").concat(i,":").concat(n)}},{key:"update",value:function(){if(null===this.manualPosition){this.changeDate&&(this.startTime=performance.now());var e=(performance.now()-this.startTime)*this.speed/1e3%86400,t=e/86400;this.progress.style.width="".concat(100*t,"%"),this.time=this.formatTime(e),this.currentTime.textContent=this.time,this.pauseed||(this.animationId&&cancelAnimationFrame(this.animationId),this.animationId=requestAnimationFrame(this.update))}}},{key:"setSpeed",value:function(e){var t=performance.now();if(this.pauseed){var i,n=t-this.pausedTime;this.startTime+=n;var o=null!==(i=this.manualPosition)&&void 0!==i?i:(t-this.startTime)*this.speed/864e5;this.speed=e,this.startTime=t-86400*o*1e3/this.speed,this.pausedTime=t}else{var s,a=null!==(s=this.manualPosition)&&void 0!==s?s:(performance.now()-this.startTime)*this.speed/864e5;this.speed=e,this.startTime=performance.now()-86400*a*1e3/this.speed}this.manualPosition=null}},{key:"updateTime",value:function(){this.manualPosition=null,this.startTime=performance.now()-86400*(this.manualPosition||0)*1e3/this.speed,this.pauseed&&(this.changeDate=!0),this.changeDateGrag=void 0,this.update()}},{key:"clear",value:function(){this.animationId&&cancelAnimationFrame(this.animationId),this.progress.style.width="0%",this.currentTime.textContent="00:00:00"}}],[{key:"init",value:function(e){for(var t=0;t<=24;t++)if(t%6==0){var i=document.createElement("div");i.className="time-mark",i.textContent="".concat(t,":00"),i.style.left="".concat(t/24*100,"%"),document.getElementsByClassName("time-marks")[0].appendChild(i)}e.startTime=performance.now()-86400*(e.manualPosition||0)*1e3/e.speed,e.timeline.addEventListener("mousedown",(function(t){"handle"===t.srcElement.className&&(e.isDragging=!0),t.preventDefault()})),e.timeline.addEventListener("mousemove",(function(t){if(e.isDragging){var i=e.timeline.getBoundingClientRect(),n=(t.clientX-i.left)/i.width;n=Math.max(0,Math.min(1,n)),e.manualPosition=n,e.progress.style.width="".concat(100*n,"%");var o=86400*n;e.currentTime.textContent=e.formatTime(o)}})),e.update(),document.getElementById("timePause").addEventListener("click",(function(){if(e.pauseed=!e.pauseed,e.pauseed)e.pausedTime=performance.now(),document.getElementById("timePause").textContent="播放",e.animationId&&cancelAnimationFrame(e.animationId),e.sdk.viewer.clock.shouldAnimate=!1;else{var t=performance.now(),i=t-e.pausedTime;document.getElementById("timePause").textContent="暂停",e.manualPosition=null,e.startTime+=i,e.changeDate&&(e.changeDateGrag?e.changeDateGrag=void 0:e.startTime=t,e.changeDate=void 0),e.sdk.viewer.clock.shouldAnimate=!0,e.update()}}))}}])}();function Ib(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 jb(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ib(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ib(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Rb=function(){return x()((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,e),this.viewer=t.viewer,this.options=jb({},i),this.sdk=jb({},t),this.options.time=i.time||new Date,this.options.speed=i.speed||1e3,this.options.darkness=i.darkness||.4,this.options.softShadow=i.softShadow||!0,this.options.show=!0===i.show,this.Dialog=n,this.timeLine,this._EventBinding=new Bb,this._elms={},e.start(this)}),[{key:"darkness",get:function(){return this.options.darkness},set:function(e){this.options.darkness=e,this.viewer.shadowMap.darkness=1-this.options.darkness,this._elms.darkness&&this._elms.darkness.forEach((function(t){t.value=e}))}},{key:"speed",get:function(){return this.options.speed},set:function(e){this.options.speed=e,this._elms.speed&&this._elms.speed.forEach((function(t){t.value=e})),this.viewer.clock.multiplier=this.options.speed,this.timeLine.setSpeed(e)}},{key:"softShadow",get:function(){return this.options.softShadow},set:function(e){this.options.softShadow=e,this.viewer.shadowMap.softShadows=this.options.softShadow}},{key:"edit",value:(i=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u=this,h=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=h.length>0&&void 0!==h[0]&&h[0],i=new vi,this.originalOptions=i.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=25;break}return n=this,e.next=8,new pn(this.sdk,this.originalOptions,{title:"光照属性",left:"180px",top:"100px",resetCallBack:function(){u.reset(),u.Dialog.resetCallBack&&u.Dialog.resetCallBack()},closeCallBack:function(){u.reset(),n.remove(),u.Dialog.closeCallBack&&u.Dialog.closeCallBack()},showCallBack:function(e){u.show=e,u.Dialog.showCallBack&&u.Dialog.showCallBack()}},!0);case 8:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" sun-shine-surface",(o=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">播放倍数</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0.01" max="999999" step="10" @model="speed">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">阴影柔和度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="1" step="0.1" @model="darkness">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">阴影优化</span>\n <input class="btn-switch" type="checkbox" @model="softShadow">\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">日期选择</span>\n <input class="sunshine-date" type="text" placeholder="YYYY-MM-DD" @model="time">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="timeline-container">\n <div class="timeline" id="timeline">\n <div class="progress" id="progress">\n <div class="handle" id="handle"></div>\n <div class="current-time" id="currentTime">00:00:00</div>\n </div>\n </div>\n <div class="time-marks">\n </div>\n <button id="timePause">暂停</button>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(o),s=this,this.timeLine=new Lb(this.sdk,this.options.speed),this.timeLine.moveComplay((function(e){var t=s.time+" "+e;s.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date(t)),s.viewer.scene.requestRender()})),l=o.getElementsByClassName("sunshine-date")[0],r=jeDate(l,{format:"YYYY-MM-DD",isinitVal:!0,isClear:!1,donefun:function(e){this.time=e.val;var t=(new Date).setHours(0,0,0,0);s.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date(t)),s.timeLine.updateTime(t)}}),this.time?r.setValue(this.time):(r.nowBtn&&r.nowBtn(),this.time=r.getValue()),c=o.getElementsByTagName("*"),this._EventBinding.on(this,c),this._elms=this._EventBinding.element,this._elms.color=[r],e.next=25;break;case 25:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"reset",value:function(){this.viewer.entities.getById(this.options.id)&&(this.time=this.originalOptions.time,this.speed=this.originalOptions.speed,this.darkness=this.originalOptions.darkness)}},{key:"flyTo",value:(t=o()(a.a.mark((function e(){var t=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:!(t.length>0&&void 0!==t[0])||t[0];case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})},{key:"remove",value:(e=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.viewer.scene.globe.enableLighting=!1,this.viewer.shadows=!1,this.viewer.clock.multiplier=1,this.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date),this.entity=null,this.timeLine.clear(),this.viewer.shadowMap.cascadesEnabled=!1,this.viewer.shadowMap.size=1024,this.viewer.shadowMap.numberOfCascades=3,this.viewer.shadowMap._lightCamera,this.viewer.shadowMap.normalOffset=!1,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=14,Mt(this.sdk,this.options.id);case 14:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"start",value:function(e){e.viewer.scene.globe.enableLighting=!0,e.viewer.shadows=!0,e.viewer.scene.globe.enableLighting=!0,e.viewer.terrainShadows=Cesium.ShadowMode.RECEIVE_ONLY,e.viewer.shadowMap.darkness=1-e.options.darkness;var t=new Date;t.setHours(0,0,0,0),e.viewer.clock.currentTime=Cesium.JulianDate.fromDate(t),e.viewer.clock.multiplier=e.options.speed,e.viewer.shadowMap.softShadows=e.options.softShadow,e.viewer.shadowMap.cascadesEnabled=!0,e.viewer.shadowMap.size=2048,e.viewer.shadowMap.numberOfCascades=4,e.viewer.shadowMap.maximumDistance=5e3;var i=e.viewer.shadowMap._lightCamera;i.frustum.near=.1,i.frustum.far=1e4,e.viewer.shadowMap.normalOffset=!0,e.edit(!0)}}]);var e,t,i}();function Fb(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 zb(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Fb(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Fb(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Hb(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Vb=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function s(e,t,i){for(var n=[],o=[],s=[],a=0;a<t.length;a++){var r=t[a],l=t[a+1];if(l){var c=Cesium.Cartesian3.subtract(l,r,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(c,c);var u=Cesium.Cartesian3.cross(c,Cesium.Cartesian3.UNIT_Z,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(u,u);var h=Cesium.Cartesian3.multiplyByScalar(u,i/2,new Cesium.Cartesian3),p=Cesium.Cartesian3.add(r,h,new Cesium.Cartesian3);n.push(p.x,p.y,p.z);var d=Cesium.Cartesian3.subtract(r,h,new Cesium.Cartesian3);o.push(d.x,d.y,d.z);var m=Cesium.Cartesian3.clone(r);m.z+=100,s.push(m.x,m.y,m.z)}}var f=new Float64Array([].concat(n,o,s)),v=new Cesium.Geometry({attributes:{position:new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})},indices:new Uint16Array([0,1,3,1,4,3,2,5,6,2,6,7,8,9,10,8,10,11]),primitiveType:Cesium.PrimitiveType.TRIANGLES,boundingSphere:Cesium.BoundingSphere.fromVertices(f)}),g=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:v}),appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!1}),asynchronous:!1});return e.scene.primitives.add(g),g}k()(this,t),(i=Hb(this,t,[e,n])).viewer=i.sdk.viewer,i.options.name=n.name||"道路",i.options.carRoadWidth=n.carRoadWidth||10,i.options.sideWidth=n.sideWidth||5,i.options.positions=n.positions||[],i.options.roadImage=n.roadImage||i.getSourceRootPath()+"/img/roadPhoto.png",i.options.sideImage=n.sideImage||i.getSourceRootPath()+"/img/sidePhoto.png",i.options.show=!n.show&&!1!==n.show||n.show,i.Dialog=o,i._EventBinding=new xn,i._elms={},i.positionArea=[],i.positions=[],i.lineEntity="",i.crossArr=[],i.pointArr=[],i.sdk.addIncetance(i.options.id,i);var a=Cesium.Cartesian3.fromDegreesArray([-75,39,-74.5,39.5,-74,40]);return s(i.sdk.viewer,a,1e3),i.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(-75,39,100)}),i}return un()(t,e),x()(t,[{key:"createCorridor",value:function(e){var t=Cesium.Cartesian3.fromDegreesArray([116.391,39.907,116.404,39.914,116.417,39.921,116.43,39.928]),i=new Cesium.GeometryInstance({geometry:new Cesium.CorridorGeometry({positions:t,width:200,vertexFormat:Cesium.VertexFormat.POSITION_AND_ST,cornerType:Cesium.CornerType.ROUNDED}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE)}}),n=new Cesium.Primitive({geometryInstances:i,appearance:new Cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Image",uniforms:{image:e}}}),translucent:!1}),asynchronous:!1});return this.sdk.viewer.scene.primitives.add(n),this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(116.404,39.914,2e3),orientation:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-30),roll:0}}),n}},{key:"getSideRectangle",value:function(e,t){var i=[],n=[];e.forEach((function(e){i.push([e[0],e[1]]),n.push([e[2],e[3]])}));var o=this.getRectangle(i,t,"side");return{left:this.getRectangle(n,t,"side"),right:o}}},{key:"getRectangle",value:function(e,t,i){for(var n=[],o=[],s=this,a=function(){var i=e[r][0],a=e[r][1];n[r]=[];for(var l=[],c=new Cesium.CorridorGeometry({positions:[i,a],width:t,cornerType:Cesium.CornerType.MITERED,vertexFormat:Cesium.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),u=Cesium.CorridorGeometry.createGeometry(c),h=0;h<u.attributes.position.values.length;h+=3){var p=s.cartesian3Towgs84(new Cesium.Cartesian3(u.attributes.position.values[h],u.attributes.position.values[h+1],u.attributes.position.values[h+2]),s.sdk.viewer);l.push([p.lng,p.lat])}for(var d=0;d<u.indices.length;d+=3)n[r].push(turf.polygon([[l[u.indices[d]],l[u.indices[d+1]],l[u.indices[d+2]],l[u.indices[d]]]]));var m,f=turf.union(n[r][0],n[r][1]),v=[];f.geometry.coordinates[0].pop(),f.geometry.coordinates[0].forEach((function(e){v.push(new Cesium.Cartesian3.fromDegrees(e[0],e[1]))}));var g=new Cesium.Cartesian3,y=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(s.pointArr[r][1],s.pointArr[r][0],g),g),b=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(v[1],v[0],new Cesium.Cartesian3),new Cesium.Cartesian3);if(.999<(m=Cesium.Cartesian3.dot(y,b))&&m<1.001||-.999>m&&m>-1.001)o.push(v);else{var C=[];C[0]=v[1],C[1]=v[2],C[2]=v[3],C[3]=v[0],o.push(C)}},r=0;r<e.length;r++)a();return o}},{key:"getExtendPoint",value:function(e,t,i){var n=Cesium.Cartesian3.subtract(t,e,new Cesium.Cartesian3),o=Cesium.Cartesian3.normalize(n,new Cesium.Cartesian3),s=new Cesium.Ray(e,o);return Cesium.Ray.getPoint(s,10*i)}},{key:"getArr",value:function(e,t){t=t.reverse();for(var i=[],n=0;n<e.length-1;n++)i.push([e[n],e[n+1],t[n+1],t[n]]);return i}},{key:"calculateRoadAngle2",value:function(e,t){var i=this.sdk.viewer.scene.globe.ellipsoid.geodeticSurfaceNormal(e,new Cesium.Cartesian3),n=Cesium.Transforms.eastNorthUpToFixedFrame(e,this.sdk.viewer.scene.globe.ellipsoid,i),o=Cesium.Matrix4.inverse(n,new Cesium.Matrix4),s=Cesium.Matrix4.multiplyByPoint(o,t,new Cesium.Cartesian3),a=Math.abs(s.z)/1e3,r=Math.atan2(s.y,s.x)-.01*a,l=Cesium.Math.toDegrees(r);return console.log(l,"result"),l}},{key:"calculateRoadAngle",value:function(e,t){var i=Cesium.Ellipsoid.WGS84.geodeticSurfaceNormal(e),n=Cesium.Transforms.eastNorthUpToFixedFrame(e,void 0,i),o=Cesium.Matrix4.inverse(n,new Cesium.Matrix4),s=Cesium.Matrix4.multiplyByPoint(o,t,new Cesium.Cartesian3),a=new Cesium.Cartesian2(s.x,s.y);Cesium.Cartesian2.normalize(a,a);var r=new Cesium.Cartesian2(1,0),l=Cesium.Cartesian2.angleBetween(r,a);return Cesium.Cartesian2.cross(r,a,new Cesium.Cartesian2)<0?l:-l}},{key:"calculatePolygonOrientation",value:function(e){var t=e[0],i=Cesium.Transforms.eastNorthUpToFixedFrame(t).getColumn(1,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(i,i);var n=Cesium.Cartesian3.subtract(e[0],e[1],new Cesium.Cartesian3);Cesium.Cartesian3.normalize(n,n);var o=Cesium.Cartesian3.dot(i,n),s=Cesium.Cartesian3.magnitude(i),a=Cesium.Cartesian3.magnitude(n);return Math.acos(o/(s*a))}},{key:"calculateTextureRepeat",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;if(!t.width||!t.height)throw new Error("Texture size must contain width and height in pixels");for(var n=Cesium.PolygonGeometry.createGeometry(new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(e),vertexFormat:Cesium.VertexFormat.POSITION_ONLY})),o=0,s=n.indices,a=n.attributes.position.values,r=0;r<s.length;r+=3){var l=3*s[r],c=3*s[r+1],u=3*s[r+2],h=new Cesium.Cartesian3(a[l],a[l+1],a[l+2]),p=new Cesium.Cartesian3(a[c],a[c+1],a[c+2]),d=new Cesium.Cartesian3(a[u],a[u+1],a[u+2]),m=Cesium.Cartesian3.cross(Cesium.Cartesian3.subtract(p,h,new Cesium.Cartesian3),Cesium.Cartesian3.subtract(d,h,new Cesium.Cartesian3),new Cesium.Cartesian3);o+=.5*Cesium.Cartesian3.magnitude(m)}var f=t.width*i,v=t.height*i,g=Math.sqrt(o)/f;Math.sqrt(o);return new Cesium.Cartesian2(Math.max(1,Math.ceil(g)),1)}},{key:"swapLastElements",value:function(e,t){var i=e[e.length-1],n=t[0];return e[e.length-1]=n,t[0]=i,[e,t]}},{key:"createLineBufferPolygonSide",value:function(e,t){for(var i=[],n=0;n<e.length;n++){var o=e[n],s=Cesium.Cartesian3.subtract(o[1],o[0],new Cesium.Cartesian3);Cesium.Cartesian3.normalize(s,s);var a=Cesium.Cartesian3.cross(s,Cesium.Cartesian3.UNIT_Z,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(a,a);var r=Cesium.Cartesian3.multiplyByScalar(a,t,new Cesium.Cartesian3),l=Cesium.Cartesian3.add(o[0],r,new Cesium.Cartesian3),c=Cesium.Cartesian3.add(o[1],r,new Cesium.Cartesian3);i.push([o[0],l,c,o[1]])}return i}},{key:"createLineBufferPolygon2",value:function(e,t){for(var i=[],n=[],o=[],s=0;s<e.length-1;s++){var a=e[s],r=e[s+1],l=Cesium.Cartesian3.subtract(r,a,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(l,l);var c=Cesium.Cartesian3.cross(l,Cesium.Cartesian3.UNIT_Z,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(c,c);var u=Cesium.Cartesian3.subtract(a,r,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(u,u);var h=Cesium.Cartesian3.cross(u,Cesium.Cartesian3.UNIT_Z,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(h,h);var p=Cesium.Cartesian3.multiplyByScalar(c,t,new Cesium.Cartesian3),d=Cesium.Cartesian3.multiplyByScalar(c,-t,new Cesium.Cartesian3),m=Cesium.Cartesian3.multiplyByScalar(h,-t,new Cesium.Cartesian3),f=Cesium.Cartesian3.multiplyByScalar(h,t,new Cesium.Cartesian3),v=Cesium.Cartesian3.add(a,p,new Cesium.Cartesian3),g=Cesium.Cartesian3.add(a,d,new Cesium.Cartesian3),y=Cesium.Cartesian3.add(r,m,new Cesium.Cartesian3),b=Cesium.Cartesian3.add(r,f,new Cesium.Cartesian3);i.push([v,y,b,g]),o.push([v,y]),n.push([g,b])}console.log(i,o,"rightPositions");return[i,o,n]}},{key:"getIntersects",value:function(e,t,i,n){var o=this.getLonLat(e),s=this.getLonLat(t),a=this.getLonLat(i),r=this.getLonLat(n),l=turf.lineString([[o.lon,o.lat],[s.lon,s.lat]]),c=turf.lineString([[a.lon,a.lat],[r.lon,r.lat]]),u=turf.lineIntersect(l,c);if(u.features.length>0)return Cesium.Cartesian3.fromDegrees(u.features[0].geometry.coordinates[0],u.features[0].geometry.coordinates[1])}},{key:"getLonLat",value:function(e){var t=Cesium.Cartographic.fromCartesian(e);return{lon:Cesium.Math.toDegrees(t.longitude),lat:Cesium.Math.toDegrees(t.latitude)}}},{key:"createLineBufferPolygon",value:function(e,t,i){for(var n=[],o=0;o<t.length;o++){var s=t[o],a=t[o+1]||t[o-1],r=Cesium.Cartesian3.subtract(a,s,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(r,r);var l=Cesium.Cartesian3.UNIT_Z,c=Cesium.Cartesian3.cross(r,l,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(c,c);var u=Cesium.Cartesian3.multiplyByScalar(c,i,new Cesium.Cartesian3);i>0?n.unshift(Cesium.Cartesian3.add(s,u,new Cesium.Cartesian3)):i<0&&n.push(Cesium.Cartesian3.add(s,u,new Cesium.Cartesian3))}return n}},{key:"calculateAangle",value:function(e){function t(e,t){var i=Math.PI/180,n=e.y*i,o=t.y*i,s=e.x*i,a=t.x*i,r=Math.sin(a-s)*Math.cos(o),l=Math.cos(n)*Math.sin(o)-Math.sin(n)*Math.cos(o)*Math.cos(a-s),c=Math.atan2(r,l)%(2*Math.PI);return 360-(450-(180*c/Math.PI<0?360+180*c/Math.PI:180*c/Math.PI)-90)%360}var i=e[0],n=e[1],o=e[2],s={x:i.lng,y:i.lat},a={x:n.lng,y:n.lat},r={x:o.lng,y:o.lat};return{angle1:t(s,a),angle2:t(s,r)}}},{key:"carRoadWidth",get:function(){return this.options.carRoadWidth},set:function(e){this.options.carRoadWidth=e,t.create(this)}},{key:"sideWidth",get:function(){return this.options.sideWidth},set:function(e){this.options.sideWidth=e,t.create(this)}},{key:"edit",value:(s=o()(a.a.mark((function e(){var t,i,n,o=this,s=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.length>0&&void 0!==s[0]&&s[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=17;break}return e.next=7,new pn(this.sdk,this.originalOptions,{title:"道路属性",left:"180px",top:"100px",confirmCallBack:function(e){o.name=o.name.trim(),o.name||(o.name="道路"),o.originalOptions=o.deepCopyObj(o.options),o._DialogObject.close(),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(o.originalOptions),Mt(o.sdk,o.options.id),at(o.sdk,o.options.id)},resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},closeCallBack:function(){o.reset(),o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(e){o.show=e,o.Dialog.showCallBack&&o.Dialog.showCallBack()}},!0);case 7:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" road-surface",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col road-box">\n <span class="label" style="flex: 0 0 56px;">道路类型</span>\n <div class="road-type"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">车道宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="99999" min="1" step="1" @model="carRoadWidth">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">人行道宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="99999" min="1" step="1" @model="sideWidth">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,e.next=17;break;case 17:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"reset",value:function(){this.viewer.entities.getById(this.options.id)&&(this.name=this.originalOptions.name,this.carRoadWidth=this.originalOptions.carRoadWidth,this.sideWidth=this.originalOptions.sideWidth,this.positions=this.originalOptions.positions,this.roadImage=this.originalOptions.roadImage,this.sideImage=this.originalOptions.sideImage)}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p.length>0&&void 0!==p[0]&&p[0],pi(0),ni(this.sdk),oi(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)t={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=zb({},this.options.position):this.options.positions?r=zb({},this.options.positions[0]):this.options.center?r=zb({},this.options.center):this.options.start?r=zb({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:t});else{for(l=[],c=0;c<this.positions.length;c++)u=Cesium.Cartesian3.fromDegrees(this.positions[c][0],this.positions[c][1],this.options.height+this.options.heightDifference/2),l.push(u.x,u.y,u.z);h=Cesium.BoundingSphere.fromVertices(l),this.viewer.camera.flyToBoundingSphere(h,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-20),roll:Cesium.Math.toRadians(0)}})}case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"getSphere",value:function(){var e=this;return new Promise((function(t){var i=setInterval((function(){var t=new Cesium.BoundingSphere;e.sdk.viewer._dataSourceDisplay.getBoundingSphere(e.viewer.entities.getById(e.options.id),!1,t)===Cesium.BoundingSphereState.DONE&&clearInterval(i)}),1e3)}))}},{key:"remove",value:(i=o()(a.a.mark((function e(){var t=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.positions=[],this.lineEntity=null,this.viewer.entities.getById(this.options.id)&&(this.viewer.entities.getById(this.options.id)._children.forEach((function(e){t.viewer.entities.remove(e)})),this.viewer.entities.remove(this.viewer.entities.getById(this.options.id))),this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=6,this.sdk.removeIncetance(this.options.id);case 6:return e.next=8,Mt(this.sdk,this.options.id);case 8:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"create",value:function(e){var t=[];e.options.positions.forEach((function(e){t.push(new Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt))}));for(var i=[],n=0;n<t.length-1;n++){var o=t[n],s=t[n+1];i.push([o,s]),e.pointArr=i}var a=[[],[],[]];a[1][0]=e.getRectangle(i,e.options.carRoadWidth);var r=e.getSideRectangle(a[1][0],e.options.sideWidth);a[0]=r.left,a[2]=r.right;for(var l=0;l<a[0].length-1;l++){var c=a[0][l],u=a[0][l+1],h=a[2][l],p=a[2][l+1],d=a[1][0][l],m=a[1][0][l+1],f=e.getIntersects(c[2],c[3],u[2],u[3]),v=e.getIntersects(h[0],h[1],p[0],p[1]);if(!f&&!v)for(var g=0;g<4;g++){var y=[];0===g?y.push(c[2],c[3]):1===g?y.push(u[2],u[3]):2===g?y.push(h[0],h[1]):y.push(p[0],p[1]),e.sdk.viewer.entities.add({polyline:{positions:y,width:10,material:new Cesium.PolylineGlowMaterialProperty({color:0===g?Cesium.Color.RED:1===g?Cesium.Color.BLUE:2===g?Cesium.Color.YELLOW:Cesium.Color.GREEN,glowPower:.25})}})}if(console.log(f,v,"leftLine"),f){var b=e.getExtendPoint(h[0],h[1],1e3),C=e.getExtendPoint(p[1],p[0],1e3);console.log("aaaa");var w=e.getIntersects(h[0],b,p[1],C),k=e.getExtendPoint(c[0],c[1],1e3),_=e.getExtendPoint(d[3],d[2],1e3),x=e.getExtendPoint(d[0],d[1],1e3),E=e.getExtendPoint(h[3],h[2],1e3);console.log(f,w,c[0],k,"bbbb");var S=e.getIntersects(f,w,c[0],k);console.log(S,"leftLineNei");var P=e.getIntersects(f,w,d[3],_),D=e.getIntersects(f,w,d[0],x),M=e.getIntersects(f,w,h[3],E);console.log("ccc"),c[2]=f,c[1]=S,d[2]=P,d[1]=D,h[2]=M,h[1]=w,console.log(c,d,h,"leftItemleft");var T=e.getExtendPoint(u[1],u[0],1e3),O=e.getExtendPoint(m[2],m[3],1e3),N=e.getExtendPoint(m[1],m[0],1e3),B=e.getExtendPoint(p[2],p[3],1e3);e.getIntersects(f,w,u[1],T),e.getIntersects(f,w,m[2],O),e.getIntersects(f,w,m[1],N),e.getIntersects(f,w,p[2],B);u[3]=f,u[0]=S,m[3]=P,m[0]=D,p[3]=M,p[0]=w,console.log(u,m,p,"leftItem2left")}else if(v){var A=e.getExtendPoint(c[3],c[2],1e3),L=e.getExtendPoint(u[2],u[3],1e3),I=e.getIntersects(c[3],A,u[2],L);if(!I)return;var j=e.getExtendPoint(c[0],c[1],1e3),R=e.getExtendPoint(d[3],d[2],1e3),F=e.getExtendPoint(d[0],d[1],1e3),z=e.getExtendPoint(h[3],h[2],1e3),H=e.getIntersects(v,I,c[0],j),V=e.getIntersects(v,I,d[3],R),G=e.getIntersects(v,I,d[0],F),W=e.getIntersects(v,I,h[3],z);c[2]=I,c[1]=H,d[2]=V,d[1]=G,h[2]=W,h[1]=v,console.log(c,d,h,"leftItemright");var U=e.getExtendPoint(u[2],u[3],1e3),Y=e.getExtendPoint(m[2],m[3],1e3),J=e.getExtendPoint(m[1],m[0],1e3),q=e.getExtendPoint(p[2],p[3],1e3);e.getIntersects(v,I,u[1],U),e.getIntersects(v,I,m[2],Y),e.getIntersects(v,I,m[1],J),e.getIntersects(v,I,p[2],q);u[3]=I,u[0]=H,m[3]=V,m[0]=G,p[3]=W,p[0]=v,console.log(u,m,p,"leftItem2right")}}e.viewer.entities.getById(e.options.id)&&(e.viewer.entities.getById(e.options.id)._children.forEach((function(t){e.viewer.entities.remove(t)})),e.viewer.entities.remove(e.viewer.entities.getById(e.options.id))),e.lineEntity=e.viewer.entities.add(new Cesium.Entity({id:e.options.id,show:e.options.show}));var X=new Image;X.src=e.options.roadImage,X.onload=function(){console.log(a[1][0],e.options.roadImage,"llll"),a[1][0].forEach((function(i,n){e.viewer.entities.add({parent:e.lineEntity,polygon:{hierarchy:new Cesium.PolygonHierarchy(i),material:new Cesium.ImageMaterialProperty({image:e.options.roadImage,transparent:!0,repeat:e.calculateTextureRepeat(i,X)}),stRotation:e.calculateRoadAngle(t[n],t[n+1])}})}))};var Z=new Image;Z.src=e.options.sideImage,Z.onload=function(){a[0].forEach((function(i,n){e.viewer.entities.add({parent:e.lineEntity,polygon:{hierarchy:new Cesium.PolygonHierarchy(i),material:new Cesium.ImageMaterialProperty({image:e.options.sideImage,transparent:!0,repeat:e.calculateTextureRepeat(i,Z)}),stRotation:e.calculateRoadAngle(t[n],t[n+1])}})})),a[2].forEach((function(i,n){e.viewer.entities.add({polygon:{hierarchy:new Cesium.PolygonHierarchy(i),material:new Cesium.ImageMaterialProperty({image:e.options.sideImage,transparent:!0,repeat:e.calculateTextureRepeat(i,Z)}),stRotation:e.calculateRoadAngle(t[n],t[n+1])}})}))}}}]);var i,n,s}(Vn);function Gb(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 Wb(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Gb(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Gb(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Ub(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Yb=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return k()(this,t),(i=Ub(this,t,[e,n])).options.position=n.position||[],i.options.text=n.text||"",i.options.show=!n.show&&!1!==n.show||n.show,i.clickTextDom=void 0,i.handler=void 0,i.textDom=void 0,i.create(i),i.sdk.addIncetance(i.options.id,i),i.callback=o,i}return un()(t,e),x()(t,[{key:"type",get:function(){return"TextBox"}},{key:"create",value:(h=o()(a.a.mark((function e(t){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=t.sdk.viewer,(n=document.createElement("span")).id=t.options.id,n.className="popup-textarea",n.style.zIndex=1,(o=document.createElement("textarea")).className="textarea",o.value=t.options.text,o.rows=6,o.style.resize="none",n.appendChild(o),!t.options.show&&(n.style.display="none"),i.cesiumWidget.container.appendChild(n),s=Cesium.Cartesian3.fromDegrees(t.options.position.lng,t.options.position.lat,t.options.position.alt),t.handler=function(){var e=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.scene,s);if(e){var t=1*n.clientWidth,o=1*n.clientHeight;n.style.left="".concat(e.x-t/2,"px"),n.style.top="".concat(e.y-o,"px")}},i.scene.postRender.addEventListener(t.handler),t.textDom=n;case 17:case"end":return e.stop()}}),e)}))),function(e){return h.apply(this,arguments)})},{key:"isClick",value:(u=o()(a.a.mark((function e(t,i){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.clickCallBack({position:t},i,null);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"setHandeler",value:(c=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this,(n=this.sdk.viewer.scene.pickPosition(new Cesium.Cartesian2(t.x,t.y)))||(o=this.sdk.viewer.camera.getPickRay(new Cesium.Cartesian2(t.x,t.y)),n=this.sdk.viewer.scene.globe.pick(o,this.sdk.viewer.scene)),!Cesium.defined(n)){e.next=15;break}return i.sdk.viewer.scene.postRender.removeEventListener(i.handler),s=Cesium.Cartographic.fromCartesian(n),r=Cesium.Math.toDegrees(s.longitude),l=Cesium.Math.toDegrees(s.latitude),e.next=10,i.getClampToHeight({lng:r,lat:l});case 10:e.sent,i.position={lng:r,lat:l,alt:s.height},c=Cesium.Cartesian3.fromDegrees(r,l,s.height),i.handler=function(){var e=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.sdk.viewer.scene,c);if(e){var t=1*i.textDom.clientWidth,n=1*i.textDom.clientHeight;i.textDom.style.left="".concat(e.x-t/2,"px"),i.textDom.style.top="".concat(e.y-n,"px")}},i.sdk.viewer.scene.postRender.addEventListener(i.handler);case 15:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"getwords",value:(l=o()(a.a.mark((function e(t){var i,n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.options.text=t,this.callback(this.options),i=Ht(),n=i.sdkP,this.sdk===n&&n?Mt(this.sdk,this.options.id):n?(n.entityMap.get(this.options.id).text=t,n.entityMap.get(this.options.id).twoToThree(this.options.position)):n||Mt(this.sdk,this.options.id);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"twoToThree",value:(r=o()(a.a.mark((function e(t){var i,n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(i=this).sdk.viewer.scene.postRender.removeEventListener(i.handler),n=Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt),i.handler=function(){var e=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.sdk.viewer.scene,n);if(e){var t=1*i.textDom.clientWidth,o=1*i.textDom.clientHeight;i.textDom.style.left="".concat(e.x-t/2,"px"),i.textDom.style.top="".concat(e.y-o,"px")}},i.sdk.viewer.scene.postRender.addEventListener(i.handler);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"returnFun",value:(s=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.handler);case 1:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"text",get:function(){return this.options.text},set:function(e){this.options.text=e,this.textDom.querySelector("textarea").value=e,this.callback(this.options)}},{key:"onClick",get:function(){return this.clickCallBack},set:function(e){e&&"function"!=typeof e?console.error("val:",e,"不是一个function"):this.clickCallBack=e}},{key:"show",get:function(){return this.options.show},set:function(e){this.options.show=e,this.textDom&&(this.textDom.style.display=e?"block":"none"),Mt(this.sdk,this.options.id)}},{key:"position",get:function(){return this.options.position},set:function(e){this.options.position=e}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.length>0&&void 0!==h[0]&&h[0],pi(0),ni(this.sdk),oi(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation?(t={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Wb({},this.options.position):this.options.position?r=Wb({},this.options.position[0]):this.options.center?r=Wb({},this.options.center):this.options.start?r=Wb({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:t})):(l=[],c=Cesium.Cartesian3.fromDegrees(this.position.lng,this.position.lat,this.position.alt),l.push(c.x,c.y,c.z),u=Cesium.BoundingSphere.fromVertices(l),this.viewer.camera.flyToBoundingSphere(u,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-20),roll:Cesium.Math.toRadians(0)}}));case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:(i=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.handler&&(this.sdk.viewer.scene.postRender.removeEventListener(this.handler),this.handler=void 0),this.textDom&&this.textDom.parentNode&&this.sdk.viewer.cesiumWidget.container.removeChild(this.textDom),e.next=4,this.sdk.removeIncetance(this.options.id);case 4:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}]);var i,n,s,r,l,c,u,h}(Vn);function Jb(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 qb(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Jb(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Jb(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Xb(e,t,i){return t=ln()(t),an()(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,i||[],ln()(e).constructor):t.apply(e,i))}var Zb=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};k()(this,t),(i=Xb(this,t,[e,n])).viewer=i.sdk.viewer,i.options.name=n.name||"批量模型",i.options.type=n.type||"面",i.options.url=n.url||"",i.options.spacing=1*n.spacing||50,i.options.positions=n.positions||[],i.options.show=!n.show&&!1!==n.show||n.show,i.callback=o,i.Dialog=s,i._EventBinding=new xn,i._elms={},i.pointArr=[],i.sdk.addIncetance(i.options.id,i);var a=new vi(e);if(i.options.spacing<0||1*n.spacing==0)return a.message({type:"warning",text:"请输入正确的间距!"}),an()(i);if(n.type&&null!=n.spacing||"点"==n.type){var r;switch(n.type){case"点":r=new qr(i.sdk);break;case"线":r=new Vr(i.sdk);break;case"面":r=new Yr(i.sdk)}r&&r.start((function(e,o){if(i.options.positions=o,"面"==n.type){var s=o.map((function(e){return Cesium.Cartesian3.fromDegrees(e.lng,e.lat)})),r=Cesium.Cartesian3.distance(s[0],s[1]),l=Cesium.Cartesian3.distance(s[1],s[2]);if(r/i.options.spacing*(l/i.options.spacing)>100)return void a.message({type:"warning",text:"数量大于100,请重新绘制"})}else if("线"==n.type){for(var c=o.map((function(e){return Cesium.Cartesian3.fromDegrees(e.lng,e.lat)})),u=0,h=0;h<c.length-2;h++)u+=Cesium.Cartesian3.distance(c[h],c[h+1]);if(u/i.options.spacing>100)return void a.message({type:"warning",text:"数量大于100,请重新绘制"})}(i.options.positions.length||i.options.positions.lng)&&t.computeDis(i)}))}else i.edit(!0);return i}return un()(t,e),x()(t,[{key:"linePoint",value:(u=o()(a.a.mark((function e(t,i){var n,o,s,r,l,c,u,h,p,d,m,f,v,g;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],o=[],s=0;case 3:if(!(s<t.length-1)){e.next=27;break}r=t[s],l=t[(s+1)%t.length],c=Cesium.Cartesian3.distance(r,l),u=Math.ceil(c/i),h=0;case 9:if(!(h<=u)){e.next=24;break}return p=h/u,d=Cesium.Cartesian3.lerp(r,l,p,new Cesium.Cartesian3),m=Cesium.Cartographic.fromCartesian(d),f=Cesium.Math.toDegrees(m.longitude),v=Cesium.Math.toDegrees(m.latitude),e.next=17,this.getClampToHeight({lng:f,lat:v});case 17:g=e.sent,d=Cesium.Cartesian3.fromDegrees(f,v,g),n.push(d),h==u&&s!=t.length-2||o.push(this.calculateRoadAngle(r,l));case 21:h++,e.next=9;break;case 24:s++,e.next=3;break;case 27:return e.abrupt("return",[A()(new Set(n.map((function(e){return"".concat(e.x,",").concat(e.y,",").concat(e.z)})))).map((function(e){var t=e.split(",").map(Number),i=y()(t,3),n=i[0],o=i[1],s=i[2];return new Cesium.Cartesian3(n,o,s)})),o]);case 28:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"calculateRoadAngle",value:function(e,t){var i=Cesium.Ellipsoid.WGS84.geodeticSurfaceNormal(e),n=Cesium.Transforms.eastNorthUpToFixedFrame(e,void 0,i),o=Cesium.Matrix4.inverse(n,new Cesium.Matrix4),s=Cesium.Matrix4.multiplyByPoint(o,t,new Cesium.Cartesian3),a=new Cesium.Cartesian2(s.x,s.y);Cesium.Cartesian2.normalize(a,a);var r=new Cesium.Cartesian2(1,0),l=Cesium.Cartesian2.angleBetween(r,a);return l=Cesium.Math.toDegrees(l),Cesium.Cartesian2.cross(r,a,new Cesium.Cartesian2)<0?-l:l}},{key:"generateInterpolatedPoints",value:function(e,t){for(var i=[],n=0;n<e.length;n++)for(var o=e[n],s=e[(n+1)%e.length],a=Cesium.Cartesian3.distance(o,s),r=Math.ceil(a/t),l=0;l<=r;l++){var c=l/r,u=Cesium.Cartesian3.lerp(o,s,c,new Cesium.Cartesian3);i.push(u)}var h=this.computePolygonExtent(e),p=this.createGridFromBBox(h,this.options.spacing),d=[],m=[];this.options.positions.forEach((function(e){m.push([e.lng,e.lat])})),m.push(m[0]);for(var f=h.west;f<=h.east;f+=p.lonStep)for(var v=h.south;v<=h.north;v+=p.latStep){var g=Cesium.Cartesian3.fromDegrees(f,v),b=turf.point([f,v]),C=turf.polygon([m]);turf.booleanPointInPolygon(b,C)&&d.push(g)}return A()(new Set([].concat(d).map((function(e){return"".concat(e.x,",").concat(e.y,",").concat(e.z)})))).map((function(e){var t=e.split(",").map(Number),i=y()(t,3),n=i[0],o=i[1],s=i[2];return new Cesium.Cartesian3(n,o,s)}))}},{key:"createGridFromBBox",value:function(e,t){var i=Cesium.Cartesian3.distance(Cesium.Cartesian3.fromDegrees(e.west,(e.south+e.north)/2,0),Cesium.Cartesian3.fromDegrees(e.east,(e.south+e.north)/2,0)),n=Math.ceil(i/t),o=Cesium.Cartesian3.distance(Cesium.Cartesian3.fromDegrees((e.west+e.east)/2,e.south,0),Cesium.Cartesian3.fromDegrees((e.west+e.east)/2,e.north,0)),s=Math.ceil(o/t);return{lonStep:(e.east-e.west)/n,latStep:(e.north-e.south)/s}}},{key:"computePolygonExtent",value:function(e){var t=e.map((function(e){return Cesium.Cartographic.fromCartesian(e)})),i=t.map((function(e){return Cesium.Math.toDegrees(e.longitude)})),n=t.map((function(e){return Cesium.Math.toDegrees(e.latitude)}));return{west:Math.min.apply(Math,A()(i)),east:Math.max.apply(Math,A()(i)),south:Math.min.apply(Math,A()(n)),north:Math.max.apply(Math,A()(n))}}},{key:"computedArea",value:(c=o()(a.a.mark((function e(t,i){var n,o,s,r,l,c,u,h,p,d,m;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Cesium.Cartesian3.distance(t[0],t[1]),o=Cesium.Cartesian3.distance(t[1],t[2]),Cesium.Cartesian3.subtract(t[1],t[0],new Cesium.Cartesian3),Cesium.Cartesian3.subtract(t[2],t[1],new Cesium.Cartesian3),s=Math.ceil(n/i),r=Math.ceil(o/i),l=[],c=0;case 8:if(!(c<s)){e.next=17;break}return e.t0=l,e.next=12,this.calculatePointB(t[0],t[1],c*i);case 12:e.t1=e.sent,e.t0.push.call(e.t0,e.t1);case 14:c++,e.next=8;break;case 17:u=[],h=0;case 19:if(!(h<s)){e.next=28;break}return e.t2=u,e.next=23,this.calculatePointB(t[3],t[2],h*i);case 23:e.t3=e.sent,e.t2.push.call(e.t2,e.t3);case 25:h++,e.next=19;break;case 28:p=[],d=0;case 30:if(!(d<l.length)){e.next=44;break}m=0;case 32:if(!(m<r)){e.next=41;break}return e.t4=p,e.next=36,this.calculatePointB(l[d],u[d],m*i);case 36:e.t5=e.sent,e.t4.push.call(e.t4,e.t5);case 38:m++,e.next=32;break;case 41:d++,e.next=30;break;case 44:return e.abrupt("return",p);case 45:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"calculatePointB",value:(l=o()(a.a.mark((function e(t,i,n){var o,s,r,l,c,u,h,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=Cesium.Cartesian3.subtract(i,t,new Cesium.Cartesian3),Cesium.Cartesian3.magnitude(o),s=Cesium.Cartesian3.normalize(o,new Cesium.Cartesian3),r=Cesium.Cartesian3.multiplyByScalar(s,n,new Cesium.Cartesian3),l=Cesium.Cartesian3.add(t,r,new Cesium.Cartesian3),c=Cesium.Cartographic.fromCartesian(l),u=Cesium.Math.toDegrees(c.longitude),h=Cesium.Math.toDegrees(c.latitude),e.next=10,this.getClampToHeight({lng:u,lat:h});case 10:return p=e.sent,d=Cesium.Cartesian3.fromDegrees(u,h,p),e.abrupt("return",d);case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,i){return l.apply(this,arguments)})},{key:"show",get:function(){return this.options.show},set:function(e){this.options.show=e;for(var t=0;t<this.pointArr.length;t++)this.pointArr[t].show=e}},{key:"type",get:function(){return this.options.type},set:function(e){this.options.type=e,this._elms.type&&this._elms.type.forEach((function(t){t.value=e}))}},{key:"spacing",get:function(){return this.options.spacing},set:function(e){this.options.spacing=e,this._elms.spacing&&this._elms.spacing.forEach((function(t){t.value=e}))}},{key:"edit",value:(r=o()(a.a.mark((function e(){var i,n,o,s,r,l,c,u=this,h=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=h.length>0&&void 0!==h[0]&&h[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){e.next=33;break}return e.next=7,new pn(this.sdk,this.originalOptions,{title:"默认模型参数设置",left:"180px",top:"100px",confirmCallBack:function(e){var i;switch(u.name=u.name.trim(),u.name||(u.name="飞线"),u.options.type){case"点":i=new qr(u.sdk);break;case"线":i=new Vr(u.sdk);break;case"面":i=new Yr(u.sdk)}i&&i.start((function(e,i){u.options.positions=i,(u.options.positions.length||u.options.positions.lng)&&t.computeDis(u)})),u.originalOptions=u.deepCopyObj(u.options),u._DialogObject.close(),u.Dialog.confirmCallBack&&u.Dialog.confirmCallBack(u.originalOptions),Mt(u.sdk,u.options.id),at(u.sdk,u.options.id)},closeCallBack:function(){u.reset(),u.Dialog.closeCallBack&&u.Dialog.closeCallBack()},addFootElm:[{tagName:"button",className:"flipe-over-y",innerHTML:"重置",event:["click",function(){u.reset()}]}]},!0);case 7:if(this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" flow-line-surface",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col add-type-box">\n <span class="label" style="flex: 0 0 56px;">添加方式</span>\n <div class="add-type"></div>\n </div>\n <div class="col">\n <span class="label">间距</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999" @model="spacing">\n <span class="unit">米</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(n),o=n.getElementsByTagName("*"),this._EventBinding.on(this,o),this._elms=this._EventBinding.element,s=[{name:"点",value:"点"},{name:"线",value:"线"},{name:"面",value:"面"}],!(r=q(this._DialogObject._element.content.getElementsByClassName("add-type-box")[0],".add-type"))){e.next=31;break}r.legp_search(s),l=this._DialogObject._element.content.getElementsByClassName("add-type")[0].getElementsByTagName("input")[0],this._elms.type=[l],l.value=this.options.type,c=0;case 23:if(!(c<s.length)){e.next=30;break}if(s[c].value!==l.value){e.next=27;break}return r.legp_searchActive(s[c].value),e.abrupt("break",30);case 27:c++,e.next=23;break;case 30:l.addEventListener("input",(function(){for(var e=0;e<s.length;e++)if(s[e].value===l.value){u.type=s[e].value;break}}));case 31:e.next=33;break;case 33:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"drawArea",value:function(){}},{key:"reset",value:function(){this.name=this.originalOptions.name,this.type=this.originalOptions.type,this.spacing=this.originalOptions.spacing,this.show=this.originalOptions.show,this.options.spacing=this.originalOptions.spacing}},{key:"flyTo",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p.length>0&&void 0!==p[0]&&p[0],pi(0),ni(this.sdk),oi(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)t={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=qb({},this.options.position):this.options.positions?r=qb({},this.options.positions[0]):this.options.center?r=qb({},this.options.center):this.options.start?r=qb({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:t});else if(l=[],this.options.positions.length>0){for(c=0;c<this.options.positions.length;c++)u=Cesium.Cartesian3.fromDegrees(this.options.positions[c].lng,this.options.positions[c].lat,this.options.positions[c].alt),l.push(u.x,u.y,u.z);h=Cesium.BoundingSphere.fromVertices(l),this.viewer.camera.flyToBoundingSphere(h,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-20),roll:Cesium.Math.toRadians(0)}})}else this.options.positions.lng&&(Cesium.Math.toRadians(0),Cesium.Math.toRadians(-60),Cesium.Math.toRadians(0),this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat,this.options.positions.alt+100)}));case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"remove",value:(n=o()(a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=0;t<this.pointArr.length;t++)this.pointArr[t].remove();return this.pointArr=[],this.positions=[],this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=7,this.sdk.removeIncetance(this.options.id);case 7:return e.next=9,Mt(this.sdk,this.options.id);case 9:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"computeDis",value:(i=o()(a.a.mark((function e(t){var i,n,o,s,r,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=[],o=[],s=[],"面"!=t.options.type){e.next=13;break}return t.options.positions.forEach((function(e){i.push(e.lng,e.lat)})),e.next=7,t.computedArea(Cesium.Cartesian3.fromDegreesArray(i),t.options.spacing);case 7:n=e.sent,s[0]=n,s[1]=t.calculateRoadAngle(Cesium.Cartesian3.fromDegreesArray(i)[0],Cesium.Cartesian3.fromDegreesArray(i)[3]),n.forEach((function(e,t){var i=Cesium.Cartographic.fromCartesian(e),n=Cesium.Math.toDegrees(i.longitude),s=Cesium.Math.toDegrees(i.latitude),a=i.height;o.push({lng:n,lat:s,alt:a})})),e.next=29;break;case 13:if("线"!=t.options.type){e.next=23;break}return t.options.positions.forEach((function(e){i.push(e.lng,e.lat)})),e.next=17,t.linePoint(Cesium.Cartesian3.fromDegreesArray(i),t.options.spacing);case 17:s=e.sent,n=s[0],t.pointArr=n,n.forEach((function(e,t){var i=Cesium.Cartographic.fromCartesian(e),n=Cesium.Math.toDegrees(i.longitude),s=Cesium.Math.toDegrees(i.latitude),a=i.height;o.push({lng:n,lat:s,alt:a})})),e.next=29;break;case 23:if("点"!=t.options.type){e.next=29;break}return e.next=26,t.getClampToHeight({lng:t.options.positions.lng,lat:t.options.positions.lat});case 26:r=e.sent,o=[{lng:t.options.positions.lng,lat:t.options.positions.lat,alt:r}],t.pointArr=o;case 29:l={type:t.options.type,positions:o,rotate:"点"==t.options.type?void 0:s[1]},t.callback(l);case 31:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}]);var i,n,s,r,l,c,u}(Vn),Kb=Symbol("测量状态");Symbol("录屏对象");window.YJ||(window.YJ={on:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isc:!1,excel:!1,flv:!1,rtsp:!1,hls:!1,host:"",username:"",password:""};return new Promise((function(t,i){var n=f(),o=["/custom/css/index.css","/arrow/algorithm.js","/arrow/plotUtil.js","/3rdparty/turf.min.js","/3rdparty/fabric.min.js","/3rdparty/proj4.js","/3rdparty/pako.min.js","/3rdparty/heatmap.js","/3rdparty/tween.umd.js","/Cesium/Cesium.js","/Cesium/Widgets/widgets.css","/3rdparty/ewPlugins.min.js","/3rdparty/wangeditor/index.js","/3rdparty/wangeditor/style.css","/3rdparty/html2canvas.min.js","/3rdparty/kriging.js","/3rdparty/echarts.min.js","/3rdparty/clipboard.min.js","/3rdparty/libgif.js","/3rdparty/liveplayer/liveplayer-element.min.js","/3rdparty/jedate/jedate.min.js","/3rdparty/jedate/skin/jedate.css"];window.YJSDK3rdpartyResourceAddress=n+"/3rdparty",e.ws&&o.push("/3rdparty/reconnecting-websocket.js"),(e.flv||e.rtsp)&&o.push("/3rdparty/flv.min.js");var s=document.createElement("script");s.setAttribute("type","module"),s.textContent="\n import * as THREE from '".concat(n,"/3rdparty/three/three.module.min.js';\n window.THREE = THREE\n "),document.querySelector("html").appendChild(s);var a=document.createElement("script");a.setAttribute("type","module"),a.textContent="\n import { SVGLoader } from '".concat(n,"/3rdparty/three/jsm/loaders/SVGLoader.js';\n window.SVGLoader = SVGLoader\n "),document.querySelector("html").appendChild(a);var r=[];o.forEach((function(e){var t;e.endsWith(".js")?((t=document.createElement("script")).setAttribute("type","text/javascript"),t.setAttribute("src",n+e)):((t=document.createElement("link")).setAttribute("rel","stylesheet"),t.setAttribute("href",n+e)),document.querySelector("html").appendChild(t);var i=new Promise((function(e,i){t.onload=function(){e()}})).then((function(e){return e}));r.push(i)})),Promise.all(r).then((function(i){var o,s;(o=document.createElement("script")).setAttribute("type","text/javascript"),o.setAttribute("src",n+"/3rdparty/viewerCesiumNavigationMixin.min.js"),document.querySelector("html").appendChild(o),o.onload=function(){h(e.host),e.username?c(e).then((function(e){t()})):t()},(s=document.createElement("script")).setAttribute("type","text/javascript"),s.setAttribute("src",n+"/3rdparty/CesiumHeatmap.js"),document.querySelector("html").appendChild(s)})).catch((function(e){i(e)}))}))},Obj:{ArcgisWXImagery:Sl,ArcgisBLUEImagery:Pl,ArcgisLWImagery:Dl,GDLWImagery:Ol,GDWXImagery:Nl,GDSLImagery:Bl,Tileset:ql,BIM:sc,Layer:Tc,Layer3rdparty:Nc,Terrain:Gc,Flame:Qc,Smoke:ru,Fountain:vu,Spout:_u,WaterSurface:lp,CircleDiffuse:ao,CircleObject:lh,EllipseObject:fh,RadarScan:go,RadarScanStereoscopic:Jh,SectorObject:ep,WallStereoscopic:kh,WallRealStereoscopic:Mh,KML:ip,GeoJson:op,BillboardObject:Do,PolygonObject:Bo,PolyhedronObject:Ou,AssembleObject:Iu,AttackArrowObject:Gu,PincerArrowObject:qu,StraightArrowObject:th,PolylineObject:Uo,CurvelineObject:Rh,Explosion:Vh,Model:yc,Model2:Sc,TrajectoryMotion:gp,TrajectoryMotionObject:Dp,Graffiti:Tp,GroundImage:Rp,GroundSvg:ly,RoutePlanning:dy,Shp:Ey,Vector:Wy,GroundText:qy,StandText:Zy,RichText:Bn,LocateCurrent:oa,LoadObjModel:eb,Heatmap:cb,FlyRoam:vb,newAirLine:_b,FRUSTUN:yb,Dialog:pn,FlowLine:Mb,Road2:Vb,TextBox:Yb,BatchModel:Zb},YJEarth:$i,Tools:vi,Proj:R,Global:{getCurrentView:function(e){var t=new vi,i=e.viewer;return JSON.parse(JSON.stringify({position:t.cartesian3Towgs84(i.camera.position,i),orientation:{heading:Cesium.Math.toDegrees(i.camera.heading),pitch:Cesium.Math.toDegrees(i.camera.pitch),roll:Cesium.Math.toDegrees(i.camera.roll)}}))},setDefaultView:function(e,t){var i=e.viewer;t?i.CAMERA_DEFAULT_VIEW_RECTANGLE={destination:t.destination||{},orientation:t.orientation||{}}:(i.CAMERA_DEFAULT_VIEW_RECTANGLE=void 0,Cesium.Camera.DEFAULT_VIEW_RECTANGLE=Cesium.Rectangle.fromDegrees(89.5,10.4,110.4,61.2))},switchCluster:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=e.viewer,n=0;n<i.dataSources._dataSources.length;n++)if("sdk-dataSource1"===i.dataSources._dataSources[n].name){i.dataSources._dataSources[n].clustering.enabled=t;break}},openLeftClick:de,closeLeftClick:me,closeRightClick:function(){ae&&(ae.destroy(),ae=null)},openRightClick:function(e){e&&e.viewer&&(ae=new Cesium.ScreenSpaceEventHandler(e.viewer.canvas)).setInputAction((function(t){if(!YJ.Measure.GetMeasureStatus()){var i,n=e.viewer.scene.pick(t.position);if(n&&n.id)if(n.id.type&&"vector"===n.id.type&&n.id.parentId){var o=ce.get(n.id.parentId);if(o.that.picking&&o.that.geojson)for(var s=0;s<o.that.geojson.features.length;s++)o.that.geojson.features[s].id===n.id._id&&o.callback(t,o.that.geojson.features[s].id,he(pe(e,t),e.viewer),o.that)}else if(i="string"==typeof n.id?n.id:n.id.id,ce.has(i)){var a=ce.get(i);if(a.that.picking){var r=pe(e,t);if(!r)return;a.callback(t,i,he(r,e.viewer),a.that)}}if(n&&n.content&&ce.has(n.content.tileset.id)){var l=ce.get(n.content.tileset.id);if(l.that.picking)if("bim"===l.that.type){if(YJ.Global.getBimPickStatus(e)){var c=pe(e,t);if(!c)return;l.callback(t,n.getProperty("id"),he(c,e.viewer),l.that)}}else{var u=pe(e,t);if(!u)return;l.callback(t,n.content.tileset.id,he(u,e.viewer),l.that)}}}}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)},openMove:function(e){(re=new Cesium.ScreenSpaceEventHandler(e.viewer.canvas)).setInputAction((function(t){e.viewer.scene.pick(t.endPosition)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)},closeMove:function(){re&&(re.destroy(),re=null)},ScreenRecord:{start:function(){return function(){if(YJ.Global.ScreenRecord.screenRecord)return"录屏任务进行中";YJ.Global.ScreenRecord.screenRecord=new on}()},stop:function(){YJ.Global.ScreenRecord&&YJ.Global.ScreenRecord.screenRecord&&YJ.Global.ScreenRecord.screenRecord&&(YJ.Global.ScreenRecord.screenRecord.mediaRecorder.stop(),YJ.Global.ScreenRecord.screenRecord=null)},screenRecord:null},MapX:{open:function(e){if(ys.viewer){ys.viewer.container.style.display="block";for(var t=ys.viewer.entities.values,i=0;i<t.length;i++)if("mapX rectangle"===t[i].name){t[i];break}e.viewer.scene.preRender.addEventListener(_s,ks)}else!function(e){Zo=new vi;var t=document.createElement("div");t.id="mapxDiv",t.style.width="222px",t.style.height="112px",t.style.position="absolute",t.style.right="10px",t.style.bottom="82px",t.style.zIndex="1",document.getElementById(e.div_id).appendChild(t);var i={imageryProvider:new Cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII")}),sceneMode:Cesium.SceneMode.SCENE2D,baseLayerPicker:!1,geocoder:!1,animation:!1,fullscreenButton:!1,navigationHelpButton:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,shouldAnimate:!0};ys.viewer=new Cesium.Viewer("mapxDiv",i),ys.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(0,0,4e7)}),ys.viewer.trackedEntity=void 0,ys.viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),ys.viewer.scene.screenSpaceCameraController.enableRotate=!1,ys.viewer.scene.screenSpaceCameraController.enableTranslate=!1,ys.viewer.scene.screenSpaceCameraController.enableZoom=!1,ys.viewer.scene.screenSpaceCameraController.enableTilt=!1,ys.viewer.scene.screenSpaceCameraController.enableLook=!1;var n,o=ys.viewer.entities.add({name:"mapX rectangle",position:new Cesium.CallbackProperty((function(){return Cs||Cesium.Cartesian3.fromDegrees(0,0,0)}),!1),rectangle:{coordinates:new Cesium.CallbackProperty((function(){return bs||Cesium.Rectangle.fromDegrees(0,0,.01,.01)}),!1),material:Cesium.Color.RED.withAlpha(.01),outline:!0,outlineColor:Cesium.Color.RED,outlineWidth:2,height:1},billboard:{image:Zo.getSourceRootPath()+"/img/cross.svg",scale:1,width:16,height:16}});ks={sdk:e,entity:o},ys.viewer.camera.percentageChanged=.001,e.viewer.scene.preRender.addEventListener(_s,ks),(Ko=new K({viewer:ys.viewer})).mouse_left_down((function(e,t){ws=!0,n=ys.viewer.scene.pick(e.position)})),Ko.mouse_left_up((function(e,t){ws=!1})),Ko.mouse_move((function(t,i){if(n&&ws){var o=Zo.cartesian3Towgs84(e.viewer.camera.position,e.viewer).alt,s=Zo.cartesian3Towgs84(i,ys.viewer);e.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(s.lng,s.lat,o),duration:0})}}))}(e)},close:function(e){if(ys.viewer){ys.viewer.container.style.display="none";for(var t=ys.viewer.entities.values,i=0;i<t.length;i++)if("mapX rectangle"===t[i].name){t[i];break}e.viewer.scene.preRender.removeEventListener(_s,ks)}}},ScreenShot:function(e){return bn.apply(this,arguments)},ScreenShotHD:function(e){return Cn.apply(this,arguments)},ExportKml:Jo,FlyRoam:{open:es,close:function(){for(var e=document.getElementsByClassName("fly-roam")[0].getElementsByClassName("table-body")[0],t=e.getElementsByClassName("tr"),i=t.length-1;i>=0;i--)e.removeChild(t[i]);Qo=0,$o=0},flyTo:is,setRepeat:function(e){Qo!=Number(e)&&(Qo=Number(e),$o=Qo)},cease:ns},flyTo:Zt,efflect:{rain:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];os&&e.viewer.scene.postProcessStages.remove(os),t&&(os=new Cesium.PostProcessStage({name:"rain",fragmentShader:ls,uniforms:{tiltAngle:-.4,rainSize:.3,rainWidth:40,rainSpeed:100}}),e.viewer.scene.postProcessStages.add(os))},snow:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];ss&&e.viewer.scene.postProcessStages.remove(ss),t&&(ss=new Cesium.PostProcessStage({name:"snow",fragmentShader:cs,uniforms:{snowSize:2,snowSpeed:60}}),e.viewer.scene.postProcessStages.add(ss))},fog:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];as&&e.viewer.scene.postProcessStages.remove(as),t&&(as=new Cesium.PostProcessStage({name:"fog",fragmentShader:us,uniforms:{visibility:.2,fogColor:Cesium.Color.WHITE}}),e.viewer.scene.postProcessStages.add(as))},nightVision:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];rs&&e.viewer.scene.postProcessStages.remove(rs),t&&(rs=Cesium.PostProcessStageLibrary.createNightVisionStage(),e.viewer.scene.postProcessStages.add(rs))},skyStarry:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.viewer.scene.skyAtmosphere.show=!t},illumination:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.viewer.shadows=t,e.viewer._shadows=t},Sunshine:Rb},CameraController:Qt,CesiumContainer:$t,setBillboardDefaultUrl:ei,getBillboardDefaultUrl:ti,multiViewportMode:{on:function(e){return Et.apply(this,arguments)},off:St,get2DView:Rt,getSdk:Ht},MouseCoordinate:function(e,t){if(e&&e.viewer){vs=e,(gs=Ht().sdkD)||(gs=rt().sdkD);var i=new vi(e);if(t){var n=function(){ms=requestAnimationFrame(n),a()};hs&&hs.destroy(),ps&&(ps.destroy(),ps=void 0),hs=new K(e),fs=null;var o,s={x:"",y:"",z:""};ds?o=ds:((o=document.createElement("div")).style.position="absolute",o.style["z-index"]=777,o.style.color="#ff0000",o.style.left="0px",o.style.top="0px",o.style.width="100%",o.style.height="100%",o.style["font-size"]="12px",o.style["pointer-events"]="none",o.style.background="url(".concat(i.getSourceRootPath(),"/img/cross.png) no-repeat 100% 100%"),o.style["background-size"]="200% 200%",ds=o),e.viewer.container.appendChild(o),hs.mouse_move((function(t,i){vs=e,fs=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?xs(Object(i),!0).forEach((function(t){C()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):xs(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},t.endPosition)}));var a=function(){if(vs){var t=e.viewer._element.getElementsByTagName("canvas")[0];if((gs=Ht().sdkD)||(gs=rt().sdkD),!ps&&gs&&(ps=new K(gs)).mouse_move((function(e,t){vs=gs,fs={x:e.endPosition.x,y:e.endPosition.y}})),fs){var n,a=fs.x,r=fs.y;if(2===vs.viewer.scene.mode)a+=t.width,n=vs.viewer.camera.pickEllipsoid(fs,vs.viewer.scene.globe.ellipsoid);else if(!(n=vs.viewer.scene.pickPosition(fs))){for(var l=vs.viewer.camera.getPickRay(s),c=vs.viewer.scene.drillPickFromRay(l,10),u={},h=0;h<c.length;h++)if(c[h].position){u=c[h];break}(n=u.position)||(n=vs.viewer.scene.globe.pick(l,vs.viewer.scene))}if(o.style["background-position-x"]="".concat(-e.viewer.container.clientWidth+a+4,"px"),o.style["background-position-y"]="".concat(-e.viewer.container.clientHeight+r-2,"px"),n){var p=i.cartesian3Towgs84(n,e.viewer),d=ci();if("EPSG:4326"===d)s={x:p.lng,y:p.lat,z:p.alt},o.innerHTML="<div style='width: 150px;position: absolute; z-index: 777; color: #ff0000; font-size: 12px; left:".concat(a+20,"px; top:").concat(r+10,"px;'><p style='margin: 0;'>经度:").concat(p.lng.toFixed(6),"°</p><p style='margin: 0;'>维度:").concat(p.lat.toFixed(6),"°</p><p style='margin: 0;'>海拔:").concat(p.alt.toFixed(2)," m</p></div>");else{var m=i.convert([{x:p.lng,y:p.lat,z:p.alt}],"EPSG:4326",d);s=m.points[0],o.innerHTML="<div style='width: 150px;position: absolute; z-index: 777; color: #ff0000; font-size: 12px; left:".concat(a+20,"px; top:").concat(r+10,"px;'><p style='margin: 0;'>x:").concat(s.x.toFixed(6),"</p><p style='margin: 0;'>y:").concat(s.y.toFixed(6),"</p><p style='margin: 0;'>z:").concat(s.z.toFixed(6),"</p></div>")}}else{var f=ci();o.innerHTML="EPSG:4326"===f?"<div style='width: 150px;position: absolute; z-index: 777; color: #ff0000; font-size: 12px; left:".concat(a+20,"px; top:").concat(r+10,"px;'><p style='margin: 0;'>经度:-</p><p style='margin: 0;'>维度:-</p><p style='margin: 0;'>海拔:-</p></div>"):"<div style='width: 150px;position: absolute; z-index: 777; color: #ff0000; font-size: 12px; left:".concat(a+20,"px; top:").concat(r+10,"px;'><p style='margin: 0;'>x:-</p><p style='margin: 0;'>y:-</p><p style='margin: 0;'>z:-</p></div>")}}}};n()}else hs&&hs.destroy(),ps&&(ps.destroy(),ps=void 0),ds&&(e.viewer.container.removeChild(ds),ds=void 0),ms&&cancelAnimationFrame(ms)}},MouseRightMenu:ne,setGroundCover:function(e,t){Yt=!!t,function(e){if(!e)return;for(var t=0;t<e.dataSources._dataSources.length;t++)if("sdk-dataSource1"===e.dataSources._dataSources[t].name){e.dataSources._dataSources[t].clustering._cluster();break}}(e.viewer)},getGroundCover:ii,setBimPickStatus:function(e,t){e&&e.viewer&&(Jt[e.viewer._element.className]||(Jt[e.viewer._element.className]={}),Jt[e.viewer._element.className].status=t,Jt[e.viewer._element.className].MoveHandler&&Jt[e.viewer._element.className].MoveHandler.destroy(),t&&(Jt[e.viewer._element.className].MoveHandler=new Cesium.ScreenSpaceEventHandler(e.viewer.canvas),Jt[e.viewer._element.className].MoveHandler.setInputAction((function(t){var i=e.viewer.scene.pick(t.endPosition),n=Jt[e.viewer._element.className].selectedId,o=e.entityMap.get(Jt[e.viewer._element.className].id);if(o&&o.features.has(n)){var s=o.features.get(n).features;for(var a in s)if(s[a].content._model){var r=s[a].customColor||Cesium.Color.fromCssColorString("#fff");s[a].color=Cesium.Color.fromCssColorString("rgba(".concat(Cesium.Color.floatToByte(r.red),",").concat(Cesium.Color.floatToByte(r.green),",").concat(Cesium.Color.floatToByte(r.blue),",").concat(r.alpha*(s[a].customAlpha||0===s[a].customAlpha?s[a].customAlpha:1),")"))}}if(i&&i.content)if("bim"===e.getIncetance(i.content.tileset.id).type){if(i.primitive&&i.primitive.id){var l=e.entityMap.get(i.primitive.id);if(n=i.getProperty("id"),l.features.has(n)){var c=l.features.get(n).features;for(var u in c)c[u].content._model&&(c[u].color=Cesium.Color.fromCssColorString("#ffeb3b"))}Jt[e.viewer._element.className].id=i.primitive.id,Jt[e.viewer._element.className].selectedId=n}}else i.primitive.id=null}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)))},getBimPickStatus:function(e){if(e&&e.viewer)return!!Jt[e.viewer._element.className]&&Jt[e.viewer._element.className].status},FlwStatusSwitch:si,JwwStatusSwitch:ri,rotateAround:function(e,t){if(e&&e.viewer)if(pi(0),e.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY),e.entityMap.forEach((function(e){e.editObj&&e.editObj.destroy(),e.ControllerObject&&e.ControllerObject.destroy()})),Xt[e.viewer._element.className]||(Xt[e.viewer._element.className]={}),Xt[e.viewer._element.className].animate&&TWEEN.remove(Xt[e.viewer._element.className].animate),Xt[e.viewer._element.className].event&&Xt[e.viewer._element.className].event.destroy(),t){var i=Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt),n=Cesium.Math.toDegrees(e.viewer.camera.heading),s=Cesium.Cartesian3.distance(e.viewer.camera.position,i);Qt(e,!1);var r=e.viewer.camera.pitch;Cesium.Math.toDegrees(r)<-89.99&&(r=Cesium.Math.toRadians(-89.99)),Xt[e.viewer._element.className].animate=new TWEEN.Tween({angle:n}).to({angle:n-360},3e4).easing(TWEEN.Easing.Linear.None).repeat(1/0).onUpdate(function(){var t=o()(a.a.mark((function t(n,o){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.viewer){t.next=3;break}return TWEEN.remove(Xt[e.viewer._element.className].animate),t.abrupt("return");case 3:e.viewer.camera.lookAt(i,new Cesium.HeadingPitchRange(Cesium.Math.toRadians(n.angle),r,s)),e.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);case 5:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}()).start();var l=new K(e);Xt[e.viewer._element.className].event=l,l.mouse_left_down((function(){Xt[e.viewer._element.className].animate&&TWEEN.remove(Xt[e.viewer._element.className].animate),Xt[e.viewer._element.className].event&&Xt[e.viewer._element.className].event.destroy(),Qt(e,!0),e.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)}))}else Qt(e,!0)},getCoordinateSystem:ci,setCoordinateSystem:function(e,t){if(Ut=t||"EPSG:4326",e&&e.viewer&&e.viewer._element){var i=e.viewer._element.getElementsByClassName("cesium-info")[0];if(Wt&&i){var n=new vi,o=e.proj,s=n.cartesian3Towgs84(Wt,e.viewer);if("EPSG:4326"===Ut)i.innerHTML="\n <span>经度:</span><span>".concat(Number(s.lng.toFixed(6)),"° </span>\n <span>纬度:</span><span>").concat(Number(s.lat.toFixed(6)),"° </span>\n <span>海拔高度:</span><span>").concat(Number(s.alt.toFixed(2)),"米</span>\n ");else{var a=o.convert([{x:s.lng,y:s.lat,z:s.alt}],"EPSG:4326",Ut);i.innerHTML="\n <span>x:</span><span>".concat(Number(a.points[0].x.toFixed(6)),'</span>\n <span style="margin-left: 5px;">y:</span><span>').concat(Number(a.points[0].y.toFixed(6)),'</span>\n <span style="margin-left: 5px;">z:</span><span>').concat(Number(a.points[0].z.toFixed(6)),"</span>\n ")}}}},DTH:nn,cameraChanged:function(e,t){var i=new vi;return e.viewer.camera.changed.addEventListener((function(n){t({position:i.cartesian3Towgs84(e.viewer.camera.position,e.viewer),orientation:{heading:e.viewer.camera.heading,pitch:e.viewer.camera.pitch,roll:e.viewer.camera.roll}})}))},setMaximumRequestsPerServer:function(e){"number"==typeof e&&(Cesium.RequestScheduler.maximumRequestsPerServer=e)},setKeyboardEventActive:function(e,t){e&&(e.viewer._disableKeyboardEvent=!t)},setSkin:function(e){document.documentElement.style.setProperty("--color-sdk-base","rgba(0, 55, 55, 1)")},getTheme:function(){return te},setTheme:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=Array.from(te[e].keys());t.forEach((function(t){document.documentElement.style.setProperty(t,te[e].get(t))}))},getCesiumManageIndexexDBState:ui,setCesiumManageIndexexDBState:hi,getCesiumIndexedDBMaxSize:function(){var e=Number(Number(localStorage.getItem("IndexedDBMaxSize")).toFixed(0));return(isNaN(e)||e<1073741824)&&(e=1073741824),e},setCesiumIndexedDBMaxSize:function(e){var t=Number(Number(e).toFixed(0));(isNaN(t)||t<1073741824)&&(t=1073741824),Cesium.ManageIndexedDB&&Cesium.ManageIndexedDB.SetIndexedDBMaxSize(t),localStorage.setItem("IndexedDBMaxSize",t)},getCesiumIndexedDBCurrentSize:function(){return Cesium.ManageIndexedDB&&Cesium.ManageIndexedDB.GetIndexedDBCurrentSize()},enablePerspective:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t||0==t||(t=1),e.viewer.scene.globe.translucency.frontFaceAlpha=t},closeRotateAround:ni,SheetIndexStatusSwitch:Ne,SheetIndexShangeScale:Be,splitScreen:{on:function(e){return qe.apply(this,arguments)},off:Xe,setActiveId:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(We=Array.isArray(e)?e:[e],Ve&&He){var t=Ve.viewer._element.getElementsByClassName("YJ-custom-checkbox-left")[0],i=Ve.viewer._element.getElementsByClassName("YJ-custom-checkbox-right")[0];if(e&&0!==e.length){if(t&&i){t.style.display="none",i.style.display="none";for(var n=0,o=0,s=0;s<We.length;s++){var a=Je.get(We[s]);a||(a={P:!0,D:!1},Je.set(We[s],a)),a.P&&n++,a.D&&o++;var r=Ve.entityMap.get(We[s]);r&&"terrain"!==r.type&&r.show&&"TextBox"!==r.type&&(t.style.display="unset",i.style.display="unset",t.checked=!1,i.checked=!1)}n||o||n++,t.checked=!!n,i.checked=!!o}}else t&&i&&(t.style.display="none",i.style.display="none")}},getSdk:rt},Contour:function(e){return qs.apply(this,arguments)},ContourStartDraw:function(e,t){if(Os=t,Object.keys(Ys).forEach((function(e){Ps.uniforms[e]=Ys[e]})),Os){if(e.viewer.camera.positionCartographic.height>16360){var i=e.viewer.camera.positionCartographic;Zt(e,{position:{lng:Cesium.Math.toDegrees(i.longitude),lat:Cesium.Math.toDegrees(i.latitude),alt:16360}},.5)}Xs(e)}else Zs(e)},ContourReset:function(){Ts=19,Ns=10,Bs="#ffd000",As=!0,Ls=2.5,Is="#43cf7c",js=!0,Rs=1.8,Fs="#ff0000",zs=!1,Hs=1,Vs="#64b6d9",Gs=!1,Ws=1,Us="#d084d1"}},Measure:{GetMeasureStatus:function(){return YJ.Measure[Kb]},SetMeasureStatus:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];YJ.Measure[Kb]=e},Clear:function(){YJ.Measure.Measures.forEach((function(e){e.destroy()})),YJ.Measure.Measures=[]},Measures:[],MeasureDistance:sr,MeasureProjectionDistance:ur,MeasureSlopeDistance:fr,MeasureTyArea:Cr,MeasureTdArea:Er,MeasureTriangle:Dr,MeasureLocation:Or,MeasureHeight:Ar,MeasureAngle:jr,MeasureAzimuth:zr},Draw:{DrawPolyline:Vr,DrawPolygon:pa,DrawPoint:qr,DrawCircle:Zr,DrawElliptic:Qr,DrawAttackArrow:el,DrawPincerArrow:il,DrawStraightArrow:sl,DrawRect:rl,DrawAssemble:ul,DrawSector:pl,DrawTakeOff:Eb,DrawThreeRect:Yr},Analysis:{Clear:function(){YJ.Analysis.AnalysesResults.forEach((function(e){e.destroy()}))},CutFillAnalysis:da,Submerge:ga,ViewShed:wa,CircleViewShed:Ma,SlopeAspect:Ba,Profile:La,Visibility:ja,Contour:Ra,Section:Va,TerrainExcavation:Ua,Flat:Za,AnalysesResults:[],SectionResults:[],ClearSection:function(){YJ.Analysis.SectionResults.forEach((function(e){e.destroy()}))}},CoordTransform:vl,RoutePlanningArrays:[],ClearAllRoutePlanning:function(){YJ.RoutePlanningArrays.forEach((function(e){e.destroy()})),YJ.RoutePlanningArrays=[]}},window.YJ.Obj.LoadObjModel=ob,window.YJ.Obj.BatchLoadObjModel=rb)}]); |