diff --git a/.env.production b/.env.production index e1eaa1a..62b1323 100644 --- a/.env.production +++ b/.env.production @@ -14,7 +14,7 @@ VITE_APP_MONITOR_ADMIN = '/admin/applications' VITE_APP_SNAILJOB_ADMIN = '/snail-job' # 生产环境 -VITE_APP_BASE_API = 'http://58.17.134.85:8899' +VITE_APP_BASE_API = 'http://192.168.110.2:8899' # 是否在打包时开启压缩,支持 gzip 和 brotli VITE_BUILD_COMPRESS = gzip diff --git a/index.html b/index.html index 59a15ef..ad7c2e9 100644 --- a/index.html +++ b/index.html @@ -216,8 +216,8 @@ - - + + diff --git a/public/js/YJEarth.min.js b/public/js/YJEarth.min.js new file mode 100644 index 0000000..ba394d0 --- /dev/null +++ b/public/js/YJEarth.min.js @@ -0,0 +1,19 @@ +/*! update time: 2025/4/29 11:47:39*/!function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=22)}([function(t,e,i){var n=i(24)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(15);function o(t,e){for(var i=0;it.length)&&(e=t.length);for(var i=0,n=Array(e);i>2]|=t[s]<>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&t.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>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(r[o>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=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 t=this.blocks,e=this.lastByteIndex;t[e>>2]|=EXTRA[3&e],e>=56&&(this.hashed||this.hash(),t[0]=t[16],t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.bytes<<3,t[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var t,e,i,n,o,s,a=this.blocks;this.first?e=((e=((t=((t=a[0]-680876937)<<7|t>>>25)-271733879<<0)^(i=((i=(-271733879^(n=((n=(-1732584194^2004318071&t)+a[1]-117830708)<<12|n>>>20)+t<<0)&(-271733879^t))+a[2]-1126478375)<<17|i>>>15)+n<<0)&(n^t))+a[3]-1316259209)<<22|e>>>10)+i<<0:(t=this.h0,e=this.h1,i=this.h2,e=((e+=((t=((t+=((n=this.h3)^e&(i^n))+a[0]-680876936)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[1]-389564586)<<12|n>>>20)+t<<0)&(t^e))+a[2]+606105819)<<17|i>>>15)+n<<0)&(n^t))+a[3]-1044525330)<<22|e>>>10)+i<<0),e=((e+=((t=((t+=(n^e&(i^n))+a[4]-176418897)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[5]+1200080426)<<12|n>>>20)+t<<0)&(t^e))+a[6]-1473231341)<<17|i>>>15)+n<<0)&(n^t))+a[7]-45705983)<<22|e>>>10)+i<<0,e=((e+=((t=((t+=(n^e&(i^n))+a[8]+1770035416)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[9]-1958414417)<<12|n>>>20)+t<<0)&(t^e))+a[10]-42063)<<17|i>>>15)+n<<0)&(n^t))+a[11]-1990404162)<<22|e>>>10)+i<<0,e=((e+=((t=((t+=(n^e&(i^n))+a[12]+1804603682)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[13]-40341101)<<12|n>>>20)+t<<0)&(t^e))+a[14]-1502002290)<<17|i>>>15)+n<<0)&(n^t))+a[15]+1236535329)<<22|e>>>10)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[1]-165796510)<<5|t>>>27)+e<<0)^e))+a[6]-1069501632)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[11]+643717713)<<14|i>>>18)+n<<0)^n))+a[0]-373897302)<<20|e>>>12)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[5]-701558691)<<5|t>>>27)+e<<0)^e))+a[10]+38016083)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[15]-660478335)<<14|i>>>18)+n<<0)^n))+a[4]-405537848)<<20|e>>>12)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[9]+568446438)<<5|t>>>27)+e<<0)^e))+a[14]-1019803690)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[3]-187363961)<<14|i>>>18)+n<<0)^n))+a[8]+1163531501)<<20|e>>>12)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[13]-1444681467)<<5|t>>>27)+e<<0)^e))+a[2]-51403784)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[7]+1735328473)<<14|i>>>18)+n<<0)^n))+a[12]-1926607734)<<20|e>>>12)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[5]-378558)<<4|t>>>28)+e<<0))+a[8]-2022574463)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[11]+1839030562)<<16|i>>>16)+n<<0))+a[14]-35309556)<<23|e>>>9)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[1]-1530992060)<<4|t>>>28)+e<<0))+a[4]+1272893353)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[7]-155497632)<<16|i>>>16)+n<<0))+a[10]-1094730640)<<23|e>>>9)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[13]+681279174)<<4|t>>>28)+e<<0))+a[0]-358537222)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[3]-722521979)<<16|i>>>16)+n<<0))+a[6]+76029189)<<23|e>>>9)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[9]-640364487)<<4|t>>>28)+e<<0))+a[12]-421815835)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[15]+530742520)<<16|i>>>16)+n<<0))+a[2]-995338651)<<23|e>>>9)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[0]-198630844)<<6|t>>>26)+e<<0)|~i))+a[7]+1126891415)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[14]-1416354905)<<15|i>>>17)+n<<0)|~t))+a[5]-57434055)<<21|e>>>11)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[12]+1700485571)<<6|t>>>26)+e<<0)|~i))+a[3]-1894986606)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[10]-1051523)<<15|i>>>17)+n<<0)|~t))+a[1]-2054922799)<<21|e>>>11)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[8]+1873313359)<<6|t>>>26)+e<<0)|~i))+a[15]-30611744)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[6]-1560198380)<<15|i>>>17)+n<<0)|~t))+a[13]+1309151649)<<21|e>>>11)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[4]-145523070)<<6|t>>>26)+e<<0)|~i))+a[11]-1120210379)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[2]+718787259)<<15|i>>>17)+n<<0)|~t))+a[9]-343485551)<<21|e>>>11)+i<<0,this.first?(this.h0=t+1732584193<<0,this.h1=e-271733879<<0,this.h2=i-1732584194<<0,this.h3=n+271733878<<0,this.first=!1):(this.h0=this.h0+t<<0,this.h1=this.h1+e<<0,this.h2=this.h2+i<<0,this.h3=this.h3+n<<0)},Md5.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,i=this.h2,n=this.h3;return 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[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[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 t=this.h0,e=this.h1,i=this.h2,n=this.h3;return[255&t,t>>8&255,t>>16&255,t>>24&255,255&e,e>>8&255,e>>16&255,e>>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 t=new ArrayBuffer(16),e=new Uint32Array(t);return e[0]=this.h0,e[1]=this.h1,e[2]=this.h2,e[3]=this.h3,t},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var t,e,i,n="",o=this.array(),s=0;s<15;)t=o[s++],e=o[s++],i=o[s++],n+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[63&(t<<4|e>>>4)]+BASE64_ENCODE_CHAR[63&(e<<2|i>>>6)]+BASE64_ENCODE_CHAR[63&i];return t=o[s],n+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[t<<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__(28),__webpack_require__(29))},function(t,e,i){var n=i(18),o=i(7);function s(t,e,i,a){return(s="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,i,s){var a,r=n(t,e);if(r){if((a=Object.getOwnPropertyDescriptor(r,e)).set)return a.set.call(s,i),!0;if(!a.writable)return!1}if(a=Object.getOwnPropertyDescriptor(s,e)){if(!a.writable)return!1;a.value=i,Object.defineProperty(s,e,a)}else o(s,e,i);return!0})(t,e,i,a)}t.exports=function(t,e,i,n,o){if(!s(t,e,i,n||t)&&o)throw new TypeError("failed to set property");return i},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(5),o=i(14),s=i(34),a=i(35);function r(e){var i="function"==typeof Map?new Map:void 0;return t.exports=r=function(t){if(null===t||!s(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(t))return i.get(t);i.set(t,e)}function e(){return a(t,arguments,n(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),o(e,t)},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){t.exports=i(39)},function(t,e,i){var n=i(11).default;t.exports=function(t,e){if("object"!=n(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var o=i.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,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 */t.exports=o=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var e,i={},s=Object.prototype,a=s.hasOwnProperty,r=Object.defineProperty||function(t,e,i){t[e]=i.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",p=l.toStringTag||"@@toStringTag";function h(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(e){h=function(t,e,i){return t[e]=i}}function d(t,e,i,n){var o=e&&e.prototype instanceof b?e:b,s=Object.create(o.prototype),a=new N(n||[]);return r(s,"_invoke",{value:P(t,i,a)}),s}function m(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}i.wrap=d;var f="suspendedStart",v="executing",g="completed",y={};function b(){}function C(){}function w(){}var k={};h(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(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function i(o,s,r,l){var c=m(t[o],t,s);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==n(p)&&a.call(p,"__await")?e.resolve(p.__await).then((function(t){i("next",t,r,l)}),(function(t){i("throw",t,r,l)})):e.resolve(p).then((function(t){u.value=t,r(u)}),(function(t){return i("throw",t,r,l)}))}l(c.arg)}var o;r(this,"_invoke",{value:function(t,n){function s(){return new e((function(e,o){i(t,n,e,o)}))}return o=o?o.then(s,s):s()}})}function P(t,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:e,done:!0}}for(n.method=s,n.arg=a;;){var r=n.delegate;if(r){var l=O(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(t,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 O(t,i){var n=i.method,o=t.iterator[n];if(o===e)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=e,O(t,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,t.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[t.resultName]=a.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,y):a:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function M(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function B(t){if(t||""===t){var i=t[c];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,s=function i(){for(;++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=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),T(i),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var o=n.arg;T(i)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:B(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),y}},i}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(16);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.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.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){var i,n,o=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function r(t){if(i===setTimeout)return setTimeout(t,0);if((i===s||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:s}catch(t){i=s}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var l,c=[],u=!1,p=-1;function h(){u&&l&&(u=!1,l.length?c=l.concat(c):p=-1,c.length&&d())}function d(){if(!u){var t=r(h);u=!0;for(var e=c.length;e;){for(l=c,c=[];++p1)for(var i=1;i0&&void 0!==o[0]?o[0]:{},t.next=3,fetch((e.host||"")+"/yjearth4.0/api/v1/user/sign-in",{method:"post",body:JSON.stringify({username:e.username,password:e.password}),headers:{"Content-Type":"application/json"}});case 3:return i=t.sent,t.next=6,i.text();case 6:n=t.sent,0===(n=JSON.parse(n)).code&&(d(e.host),n.token?f(n.token):f(n.data.token));case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function d(t){localStorage.setItem(u,t||"")}function m(){return localStorage.getItem(u)||""}function f(t){localStorage.setItem(c,t)}function g(){return localStorage.getItem(c)}function y(){var t=document.querySelectorAll("script"),e="";return t.forEach((function(t){if(t.src.indexOf("YJEarth.min.js")>-1){var i=t.src.split("/");i.pop(),e=i.join("/")}})),e}var b=i(1),C=i.n(b),w=i(2),k=i.n(w);function _(t){document.addEventListener("keydown",S.bind(t),!1),document.addEventListener("keyup",D.bind(t),!1),t&&t.clock.onTick.addEventListener((function(){!function(t){var e=t.camera,i=t.scene.globe.ellipsoid.cartesianToCartographic(e.position).height,n=i/20;x.moveForward&&e.moveForward(n);x.moveBackward&&e.moveBackward(n);x.moveLeft&&e.moveLeft(n);x.moveRight&&e.moveRight(n);x.moveUp&&e.moveUp(n);x.moveDown&&e.moveDown(n);x.lookUp&&e.lookUp();x.lookDown&&e.lookDown();x.lookLeft&&e.lookLeft();x.lookRight&&e.lookRight();x.twistLeft&&e.twistLeft();x.twistRight&&e.twistRight();x.zoomIn&&e.zoomIn(i/2);x.zoomOut&&e.zoomOut(i/2)}(t)}))}var x={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 E(t){switch(t){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 S(t){var e;if("input"===(e=document.activeElement).tagName.toLowerCase()&&"checkbox"!==e.type||"textarea"===e.tagName.toLowerCase()||"textarea"===e.getAttribute("role"));else if(this.trackedEntity);else if(this._firstPersonView);else if(this._disableKeyboardEvent);else if(t.ctrlKey&&t.altKey){if("v"===t.key||"V"===t.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"===t.key||"F"===t.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=E(t.keyCode);void 0!==o&&(x[o]=!0)}}function D(t){var e=E(t.keyCode);void 0!==e&&(x[e]=!1)}var O=i(11),M=i.n(O),T=i(6),N=i.n(T),B=i(19),A=i.n(B),L=[{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"}],j=function(){return k()((function t(){C()(this,t),this.name_map=new Map,this.epsg_map=new Map,this.initProj()}),[{key:"initProj",value:function(){var t=this;L.forEach((function(e){proj4.defs(e.epsg,e.def),t.name_map.set(e.name,e),t.epsg_map.set(e.epsg,e)}))}},{key:"convert",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=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(e)&&!this.epsg_map.has(e))return n.code=1,n.message="不支持的坐标系:"+e,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(e)||this.epsg_map.get(e)).epsg,s=(this.name_map.get(i)||this.epsg_map.get(i)).epsg,a=proj4.defs(o),r=proj4.defs(s);return t.forEach((function(t){var e=Number(t.x),i=Number(t.y),o=Number(t.z||0),s=proj4(a,r,[e,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(t){return this.name_map.has(t)||this.epsg_map.has(t)}},{key:"degreesToDMS",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function i(t){var e=t.toString(),i=e.indexOf(".");return-1!==i?e.length-i-1:0}function n(t){return Math.pow(10,t)}var o=Math.floor(t),s=n(i(t)),a=Math.floor((t-o)*s*60)/s,r=Math.floor(a),l=n(i(a)),c=Math.floor((a-r)*l)/l*60;return e?o+"°"+Number(a.toFixed(4))+"'":o+"°"+r+"'"+c.toFixed(2)+'"'}},{key:"dmsToDecimal",value:function(t,e){var i,n,o;if(e){var s=t.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=t.split("°"),u=c[1].split("'"),p=u[1].split('"');i=c[0],n=u[0],o=p[0],console.log(i,n,o);var h=Math.pow(10,8),d=Number(i*h)+n*h/60+o*h/3600;return Math.round(d)/h}}])}();function I(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function R(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};C()(this,t),this.container=e,this.options=R({},i),this.closeCallBack=i.closeCallBack,this._element={},this._element_style=void 0}),[{key:"init",value:(t=a()(l.a.mark((function t(){var e,i,n=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.closeAll(),H.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=''.concat(this.options.title||"","")+'',this._element.body.appendChild(this._element.title),t.next=16,document.createElement("div");case 16:return this._element.content=t.sent,this._element.content.className="content",this._element.body.appendChild(this._element.content),t.next=21,document.createElement("div");case 21:for(this._element.foot=t.sent,this._element.foot.className="foot",this._element.foot.innerHTML='\n \n ',this._element.body.appendChild(this._element.foot),this._element.body.getElementsByClassName("close-box")[0].addEventListener("click",(function(){n.close()})),e=this._element.body.getElementsByClassName("close"),i=0;i=0;e--)t[e].dataset&&"YJ_style_dialog"===t[e].dataset.name&&document.getElementsByTagName("head")[0].removeChild(t[e]);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 t=H.length-1;t>=0;t--)H[t].close(),H.splice(t,1)}},{key:"titleAppChild",value:function(t){this._element.title.appendChild(t)}},{key:"contentAppChild",value:function(t){this._element.content.appendChild(t)}},{key:"footAppChild",value:function(t,e){e?this._element.foot.insertBefore(t,e):this._element.foot.prepend(t)}},{key:"moveDiv",value:function(){var t=this,e=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=t._element.body.offsetHeight,l=t._element.body.offsetWidth;e=s.clientX,i=s.clientY;var c=window.getComputedStyle(t._element.body).left,u=window.getComputedStyle(t._element.body).top;n=1*c.substr(0,c.indexOf("px")),o=1*u.substr(0,u.indexOf("px"));var p=document.documentElement.clientHeight,h=document.documentElement.clientWidth;window.onmousemove=function(t){t.preventDefault();var s=t.clientX,c=t.clientY,u=s-(e-n),d=c-(i-o);u<0?u=0:u+l>h&&(u=h-l),d<=0?d=0:d+r>p&&(d=p-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"}}},window.onmouseup=function(t){window.onmousemove=null}}}]);var t}(),H=[],G=V,U=function(t,e){var i=null;return{that:Array.prototype.slice.call(t.querySelectorAll(e),0),stopPropagation:function(t){(t=t||window.event).stopPropagation?t.stopPropagation():t.cancelBubble=!0},hide:function(){U(t,e).that.forEach((function(t){t.style.cssText+="display:none;"}))},show:function(){U(t,e).that.forEach((function(t){t.style.cssText+="display:block;"}))},legp_searchList:function(e){var i=[];return U(t,"input[name="+e+"]").that.forEach((function(t){i.push(t.value)})),i},legp_search:function(n){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=U(t,e).that[0];if(s){var a='
\n '.concat(o?'':'','\n
\n
\n
');s.innerHTML=a,U(t,".cy_datalist input").that[0].oninput=function(){var e=this.value;if(n.length>0){U(t,".cy_datalist dl").show();var o=new RegExp(e),s=!1;U(t,".cy_datalist dl").that[0].innerHTML="",n.forEach((function(e){o.test(e.name)&&(s=!0,U(t,".cy_datalist dl").that[0].innerHTML+='
'+e.name+"
")})),s||(U(t,".cy_datalist dl").that[0].innerHTML='
暂无数据
'),r()}},U(t,".cy_datalist input").that[0].onclick=function(e){"none"===U(t,".cy_datalist dl").that[0].style.display&&(0==n.length?this.innerHTML="暂无数据":U(t,".cy_datalist dl").show(),U(t,".cy_datalist dl").that[0].innerHTML="",n.forEach((function(e){U(t,".cy_datalist dl").that[0].innerHTML+='
'+e.name+"
"})),r()),e.stopPropagation()},document.addEventListener("click",(function(){U(t,".cy_datalist dl").hide()}))}function r(){U(t,".cy_datalist dl dd").that.forEach((function(t){t.onclick=function(t){var e=this.attributes.value.value;i=e,t.currentTarget.parentNode.previousElementSibling.value=e;var n=new Event("input",{bubbles:!0});t.currentTarget.parentNode.previousElementSibling.dispatchEvent(n)}}))}},legp_searchActive:function(t){i=t}}},W=function(){var t=a()(l.a.mark((function t(e,i){var n,o,s,a,r,c,u,p,h,d,m;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new j,z&&z.close&&(z.close(),z=null),t.next=4,new G(e.viewer._container,{title:"功能转换",left:"180px",top:"100px",closeCallBack:function(){i&&i()}});case 4:return z=t.sent,t.next=7,z.init();case 7:o='\n \n
\n
\n
\n 输入格式\n
\n
\n
\n
\n
\n \n

\n \n 例如116.6°, 39.9°\n

\n
\n
\n 经度\n \n
\n
\n 纬度\n \n
\n
\n \n \n \n \n
\n
\n
\n
\n \n

\n 度分\n 例如95°10.1702\', 49°12.4015\'\n

\n
\n
\n
\n 经度\n \n \n \n \n \n
\n
\n 纬度\n \n \n \n \n \n
\n
\n
\n \n \n \n \n
\n
\n
\n
\n \n

\n 度分秒\n 例如11°18\'54.37", 39°13\'46.57"\n

\n
\n
\n
\n 经度\n \n \n \n \n \n \n \n
\n
\n 纬度\n \n \n \n \n \n \n \n
\n
\n
\n \n \n \n \n
\n
\n
\n \n '),z._element.body.className=z._element.body.className+" proj-convert",(s=document.createElement("div")).style.width="460px",s.style.display="flex",s.style.flexDirection="column",s.innerHTML=o,z.contentAppChild(s),a=s.getElementsByClassName("item"),r=l.a.mark((function t(e){var i,o,r,c;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=a[e].getAttribute("data-type"),o=a[e].getElementsByClassName("convert")[0],r=a[e].getElementsByClassName("icon-copy-box")[0],(c=new ClipboardJS(r,{text:function(t){var n;switch(i){case 0:case"0":n=a[e].getElementsByClassName("lng")[0].value+"°,"+a[e].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(t){window.ELEMENT&&window.ELEMENT.Message({message:"已复制到剪切板",type:"success",duration:1500})})),c.on("error",(function(t){window.ELEMENT&&window.ELEMENT.Message({message:"复制失败",type:"warning",duration:1500})})),o.addEventListener("click",(function(){var t,o,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_,x;switch(i){case 0:case"0":t=a[e].getElementsByClassName("lng")[0].value,o=a[e].getElementsByClassName("lat")[0].value,p=n.degreesToDMS(t,!0),h=n.degreesToDMS(o,!0),v=(f=p.split("°"))[1].split("'"),y=(g=h.split("°"))[1].split("'"),s.getElementsByClassName("lng-dm-d")[0].value=f[0],s.getElementsByClassName("lng-dm-m")[0].value=v[0],s.getElementsByClassName("lat-dm-d")[0].value=g[0],s.getElementsByClassName("lat-dm-m")[0].value=y[0],d=n.degreesToDMS(t),m=n.degreesToDMS(o),w=(C=(b=d.split("°"))[1].split("'"))[1].split('"'),x=(_=(k=m.split("°"))[1].split("'"))[1].split('"'),s.getElementsByClassName("lng-dms-d")[0].value=b[0],s.getElementsByClassName("lng-dms-m")[0].value=C[0],s.getElementsByClassName("lng-dms-s")[0].value=w[0],s.getElementsByClassName("lat-dms-d")[0].value=k[0],s.getElementsByClassName("lat-dms-m")[0].value=_[0],s.getElementsByClassName("lat-dms-s")[0].value=x[0];break;case 1:case"1":r=a[e].getElementsByClassName("lng-dm-d")[0].value,l=a[e].getElementsByClassName("lng-dm-m")[0].value,c=a[e].getElementsByClassName("lat-dm-d")[0].value,u=a[e].getElementsByClassName("lat-dm-m")[0].value,t=n.dmsToDecimal(r+"°"+l+"'",!0),o=n.dmsToDecimal(c+"°"+u+"'",!0),s.getElementsByClassName("lng")[0].value=t,s.getElementsByClassName("lat")[0].value=o,d=n.degreesToDMS(t),m=n.degreesToDMS(o),w=(C=(b=d.split("°"))[1].split("'"))[1].split('"'),x=(_=(k=m.split("°"))[1].split("'"))[1].split('"'),s.getElementsByClassName("lng-dms-d")[0].value=b[0],s.getElementsByClassName("lng-dms-m")[0].value=C[0],s.getElementsByClassName("lng-dms-s")[0].value=w[0],s.getElementsByClassName("lat-dms-d")[0].value=k[0],s.getElementsByClassName("lat-dms-m")[0].value=_[0],s.getElementsByClassName("lat-dms-s")[0].value=x[0];break;case 2:case"2":d=(r=a[e].getElementsByClassName("lng-dms-d")[0].value)+"°"+(l=a[e].getElementsByClassName("lng-dms-m")[0].value)+"'"+a[e].getElementsByClassName("lng-dms-s")[0].value+'"',m=(c=a[e].getElementsByClassName("lat-dms-d")[0].value)+"°"+(u=a[e].getElementsByClassName("lat-dms-m")[0].value)+"'"+a[e].getElementsByClassName("lat-dms-s")[0].value+'"',t=n.dmsToDecimal(d),o=n.dmsToDecimal(m),s.getElementsByClassName("lng")[0].value=t,s.getElementsByClassName("lat")[0].value=o,p=n.degreesToDMS(t,!0),h=n.degreesToDMS(o,!0),v=(f=p.split("°"))[1].split("'"),y=(g=h.split("°"))[1].split("'"),s.getElementsByClassName("lng-dm-d")[0].value=f[0],s.getElementsByClassName("lng-dm-m")[0].value=v[0],s.getElementsByClassName("lat-dm-d")[0].value=g[0],s.getElementsByClassName("lat-dm-m")[0].value=y[0]}window.ELEMENT&&window.ELEMENT.Message({message:"转换成功",type:"success",duration:1500});for(var E=0;E1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}},{key:"mouse_right",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)}},{key:"mouse_right_down",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_DOWN)}},{key:"mouse_right_up",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_UP)}},{key:"mouse_wheel",value:function(t){this.handler&&this.handler.setInputAction((function(){t()}),Cesium.ScreenSpaceEventType.WHEEL)}},{key:"getcartesian",value:function(t){var e=t.position||t.endPosition;t.position1&&t.position2&&(e={x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2});var i=this.viewer.scene.pickPosition(e);if(!i){for(var n=this.viewer.camera.getPickRay(e),o=this.viewer.scene.drillPickFromRay(n,10),s={},a=0;a0&&void 0!==arguments[0]?arguments[0]:"左键开始,右键结束",i=arguments.length>1?arguments[1]:void 0;C()(this,t),this.point=void 0,this.text=e,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(t){this.div.getElementsByTagName("p")[0].innerText=t}},{key:"get_mouse_style",value:function(t){var e="";switch(t){case 1:e="move.png";break;default:e="arrow.png"}return"url(lib/img/"+e+"),auto"}},{key:"create_tip",value:function(t){this.create_tooltip()}},{key:"setPosition",value:function(t,e,i){this.position=t,this.move_tooltip(e,i)}},{key:"destroy",value:function(){this.viewer.entities.remove(this.point),this.remove_tooltip()}},{key:"create_tooltip",value:function(){var t=new ye;this.div=document.createElement("div");this.div.setAttribute("style","position: absolute;z-index: 777;color: #ec131a;left:10px;top:0px;pointer-events: none;");var e=document.createElement("p");e.style.margin="0px",e.style.padding="0px",e.innerText=this.text,this.div.appendChild(e);var i=document.createElement("div");i.style.width="12px",i.style.height="12px",i.style.background="url(".concat(t.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.appendChild(i),t=null,document.querySelector("body").appendChild(this.div)}},{key:"style_tip",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t._element.style.cursor=this.get_mouse_style(e)}},{key:"remove_tooltip",value:function(){document.querySelector("body").contains(this.div)&&document.querySelector("body").removeChild(this.div)}},{key:"move_tooltip",value:function(t,e){var i=0,n=0;if(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=t+30+n+"px",this.div.style.top=e+i+"px"}}])}(),X=function(){var t=a()(l.a.mark((function t(e,i){var n,o,s,a,r,c,u,p,h,d,m,f,v,g,y,b,C;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new ye,o=new j,F&&F.close&&(F.close(),F=null),t.next=5,new G(e.viewer._container,{title:"投影转换",left:"180px",top:"100px",closeCallBack:function(){i&&i()}});case 5:return F=t.sent,t.next=8,F.init();case 8:'\n \n
\n
\n
\n 源坐标\n \n
\n
\n
\n 椭圆基准\n
\n
\n
\n 经度(x)\n \n
\n
\n 纬度(y)\n \n
\n
\n
\n
\n \n
\n
\n
\n 目标坐标\n
\n
\n
\n 椭圆基准\n
\n
\n
\n 经度(x)\n \n
\n
\n 纬度(y)\n \n
\n
\n
\n
\n \n ',(r=document.createElement("div")).innerHTML='\n \n
\n
\n
\n 源坐标\n \n
\n
\n
\n 椭圆基准\n
\n
\n
\n 经度(x)\n \n
\n
\n 纬度(y)\n \n
\n
\n
\n
\n \n
\n
\n
\n 目标坐标\n
\n
\n
\n 椭圆基准\n
\n
\n
\n 经度(x)\n \n
\n
\n 纬度(y)\n \n
\n
\n
\n
\n \n ',F.contentAppChild(r),c=[],u=0,o.epsg_map.forEach((function(t,e){u++,c.push({name:"".concat(u,".  ").concat(e,"(").concat(t.name,")"),value:e})})),(p=U(r.getElementsByClassName("left")[0],".datalist_left")).legp_search(c,!0),(h=U(r.getElementsByClassName("right")[0],".datalist_right")).legp_search(c,!0),d=r.getElementsByClassName("pick")[0],(m=r.getElementsByClassName("datalist_left")[0].getElementsByTagName("input")[0]).value=c[0].value,p.legp_searchActive(c[0].value),(f=r.getElementsByClassName("datalist_right")[0].getElementsByTagName("input")[0]).value=c[0].value,h.legp_searchActive(c[0].value),v=r.getElementsByClassName("convert")[0],g=r.getElementsByClassName("left-x")[0],y=r.getElementsByClassName("left-y")[0],b=r.getElementsByClassName("right-x")[0],C=r.getElementsByClassName("right-y")[0],d.addEventListener("click",(function(){s&&s.destroy(),a&&a.destroy(),s=new q("左键选择起点坐标,右键取消",e),(a=new J(e)).mouse_move((function(t,e){s.setPosition(e,t.endPosition.x,t.endPosition.y)})),a.mouse_left((function(t,i){var r=n.cartesian3Towgs84(i,e.viewer);s&&s.destroy(),a&&a.destroy();var l=o.convert([{x:Number(r.lng),y:Number(r.lat)}],"EPSG:4326",m.value);0===l.code&&(g.value=l.points[0].x,y.value=l.points[0].y)})),a.mouse_right((function(t,e){s&&s.destroy(),a&&a.destroy()}))})),v.addEventListener("click",(function(){var t=o.convert([{x:Number(g.value),y:Number(y.value)}],m.value,f.value);0===t.code?(b.value=t.points[0].x,C.value=t.points[0].y):window.ELEMENT&&window.ELEMENT.Message({message:t.message,type:"warning",duration:1500})}));case 33:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}(),Z=function(){F&&F.close&&(F.close(),F=null)},K=i(10),$=i.n(K),Q=[new Map,new Map,new Map];function tt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function et(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i0)for(var s=0;s=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Pt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i=1;o--){for(s=!1,a=n.length-1;a>=1;a--)n[a].id&&i[a].id&&n[a].id===i[o].id&&(s=!0);s||lt.viewer.scene.primitives.remove(i[o])}for(r=n.length-1;r>=1;r--){for(c=!1,u=i.length-1;u>=1;u--)n[r].id&&i[r].id&&n[r].id===i[u].id&&(c=!0,i[u].show=n[r].show,i[u].startColor=n[r].startColor,i[u].endColor=n[r].endColor,i[u].minimumSpeed=n[r].minimumSpeed,i[u].maximumSpeed=n[r].maximumSpeed,i[u].minimumParticleLife=n[r].minimumParticleLife,i[u].maximumParticleLife=n[r].maximumParticleLife,i[u].startScale=n[r].startScale,i[u].endScale=n[r].endScale,i[u].emissionRate=n[r].emissionRate,i[u].particleSize=n[r].particleSize,i[u].modelMatrix=n[r].modelMatrix);c||lt.viewer.scene.primitives.add(n[r])}}case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ut(t,e,i){var n=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas);n.setInputAction((function(){ut=e}),Cesium.ScreenSpaceEventType.LEFT_DOWN),n.setInputAction((function(){ut=e}),Cesium.ScreenSpaceEventType.RIGHT_DOWN),n.setInputAction((function(){ut=e}),Cesium.ScreenSpaceEventType.WHEEL),Mt.push(n)}function Wt(){var t,e=this.sdks[ut];if(0===ut?t=this.sdks[1]:1===ut&&(t=this.sdks[0]),2===e.viewer.scene.mode)if(this.sdks[0].viewer.trackedEntity){var i=e.viewer.camera.positionCartographic.height;t.viewer.camera.lookAt(Cesium.Cartesian3.fromRadians(e.viewer.camera.positionCartographic.longitude,e.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(e.viewer.camera.positionCartographic.longitude,e.viewer.camera.positionCartographic.latitude,e.viewer.camera.positionCartographic.height),e.viewer);t.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt)})}else{var o=e.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(e.viewer.canvas.clientWidth/2,e.viewer.canvas.clientHeight/(2-(90+e.viewer.camera.pitch/(Cesium.Math.PI/180))/110)));o||(o=e.viewer.camera.positionWC);var s=this.tools.cartesian3Towgs84(e.viewer.camera.positionWC,e.viewer).alt,a=this.tools.cartesian3Towgs84(o,e.viewer);t.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(a.lng,a.lat,s)})}}function Yt(){return lt}function Jt(){lt&<.viewer.entities.add({show:!1,polygon:{hierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray([100,50,100.0001,50,100.0001,50.0001]))}})}function qt(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Xt(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Xt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==u[2]?u[2]:3,o=new ye(e),a=i.orientation,!i.position){t.next=13;break}if(0===i.position.alt||i.position.alt){t.next=8;break}return t.next=7,o.getClampToHeight(i.position);case 7:i.position.alt=t.sent;case 8:r=0,a||(r=500),s=Cesium.Cartesian3.fromDegrees(i.position.lng,i.position.lat,i.position.alt+r),t.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:re(e),e.viewer.camera.flyTo({destination:s,duration:n,orientation:a});case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ie(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t&&t.viewer){var i=t.viewer;i.scene.screenSpaceCameraController.enableRotate=e,i.scene.screenSpaceCameraController.enableTranslate=e,i.scene.screenSpaceCameraController.enableZoom=e,i.scene.screenSpaceCameraController.enableTilt=e,i.scene.screenSpaceCameraController.enableLook=e}}function ne(t,e){if(t&&t.div_id){Qt[t.div_id]||(Qt[t.div_id]={}),Qt[t.div_id].event&&Qt[t.div_id].event.destroy();var i=new ye,n=t.viewer._element,o=t.proj,s=function(){switch(a){case"compass":var s=n.getElementsByClassName("compass")[0],r=n.getElementsByClassName("navigation-controls")[0];e[a]?(s&&(s.style.display="block"),r&&(r.style.display="flex")):(s&&(s.style.display="none"),r&&(r.style.display="none"));break;case"legend":var l=n.getElementsByClassName("distance-legend")[0];e[a]?l&&(l.parentNode.style.display="block"):l&&(l.parentNode.style.display="none");break;case"info":var c=n.getElementsByClassName("cesium-info")[0];if(e[a]){c?c.style.display="block":((c=document.createElement("div")).className="cesium-info",c.style.position="absolute",c.style.bottom="32px",c.style.right="240px",c.style["font-size"]="14px",c.style["background-color"]="rgba(47,53,60,.8)",c.style.color="#fff",c.style.padding="4px 10px",c.style["border-radius"]="18px",c.innerHTML="EPSG:4326"===Zt?"\n 经度:-\n 纬度:-\n 海拔高度:-\n ":"\n x:-\n y:-\n z:-\n ",t.viewer._element.appendChild(c));var u=new J(t);Qt[t.div_id].event=u,u.mouse_move((function(e,n){var s=i.cartesian3Towgs84(n,t.viewer);if("EPSG:4326"===Zt)c.innerHTML="\n 经度:".concat(Number(s.lng.toFixed(6)),"° \n 纬度:").concat(Number(s.lat.toFixed(6)),"° \n 海拔高度:").concat(Number(s.alt.toFixed(6)),"米\n ");else{var a=o.convert([{x:s.lng,y:s.lat,z:s.alt}],"EPSG:4326",Zt);c.innerHTML="\n x:".concat(Number(a.points[0].x.toFixed(6)),'\n y:').concat(Number(a.points[0].y.toFixed(6)),'\n z:').concat(Number(a.points[0].z.toFixed(6)),"\n ")}}))}else c&&(c.style.display="none");break;case"frame":e[a]?(t.viewer.scene.debugShowFramesPerSecond=!0,setTimeout((function(){var e=t.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0],i=e.getElementsByClassName("cesium-performanceDisplay-defaultContainer")[0];e.appendChild(i)}),50)):t.viewer.scene.debugShowFramesPerSecond=!1}};for(var a in e)s()}}function oe(t,e){e=e?"billboard_default_url_"+e:"billboard_default_url",localStorage.setItem(e,t)}function se(t){return t=t?"billboard_default_url_"+t:"billboard_default_url",localStorage.getItem(t)}function ae(){return Kt}function re(t){te[t.div_id]&&(te[t.div_id].animate&&TWEEN.remove(te[t.div_id].animate),te[t.div_id].event&&te[t.div_id].event.destroy(),ie(t,!0),t.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY))}function le(t){var e,i=qt(t.entityMap);try{for(i.s();!(e=i.n()).done;){var n=$()(e.value,2),o=(n[0],n[1]);"TrajectoryMotion"===o.type&&o.viewFollow&&(o.viewFollow=!1)}}catch(t){i.e(t)}finally{i.f()}}function ce(t,e){for(var i,n=0;n-1){var i=t.src.split("/");i.pop(),e=i.join("/")}})),e}},{key:"cartesian3Towgs84",value:function(t,e){var i=e.scene.globe.ellipsoid,n=new Cesium.Cartesian3(t.x,t.y,t.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}}},{key:"computeDistance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t.length<2)return 0;var n=0;if(i){var o=[];t.forEach((function(t){o.push([t.lng,t.lat,t.alt])}));var s=turf.lineString(o);n=1e3*turf.length(s)}else for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:2;if(t.length<3)return 0;var i=[];t.forEach((function(t){i.push([t.lng,t.lat])})),i.push(i[0]);var n=turf.polygon([i]);return Number(turf.area(n).toFixed(e))}},{key:"computeSignedArea",value:function(t,e){for(var i=[],n=[],o=0;oc?l/10:c/10;var u=new Cesium.PolygonGeometry.fromPositions({positions:Cesium.Cartesian3.fromDegreesArray(i),vertexFormat:Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:s}),p=new Cesium.PolygonGeometry.createGeometry(u);if(!p.attributes||!p.attributes.position)return 0;var h=p.indices,d=p.attributes.position.values;function m(e,i){var n=new Cesium.Cartesian3(d[3*i],d[3*i+1],d[3*i+2]);return t.scene.clampToHeight(n)||n}for(var f=0,v=0;v1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{steps:360};Number(e)<=0&&(e=.01);var n=[Number(t.lng),Number(t.lat)],o=turf.circle(n,e/1e3,i).geometry.coordinates[0],s=[];return o.forEach((function(t){s=s.concat(t)})),s}},{key:"createEllipse",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{granularity:.1,semiMinorAxis:10,semiMajorAxis:20,bearing:0};e.granularity||(e.granularity=.1);for(var i=new Cesium.EllipseOutlineGeometry({center:Cesium.Cartesian3.fromDegrees(Number(t.lng),Number(t.lat)),semiMajorAxis:Number(e.semiMajorAxis),semiMinorAxis:Number(e.semiMinorAxis),granularity:Cesium.Math.toRadians(e.granularity),rotation:Cesium.Math.toRadians(e.bearing)}),n=Cesium.EllipseOutlineGeometry.createGeometry(i),o=n.attributes.position.values,s=[],a=0;a0&&void 0!==arguments[0]?arguments[0]:[],e=[];t.forEach((function(t){e.push(turf.point([t.lng,t.lat]))}));var i=turf.featureCollection(e),n=turf.center(i).geometry.coordinates;return{lng:n[0],lat:n[1]}}},{key:"computeMidpoint",value:function(t,e){var i=turf.point([t.lng,t.lat]),n=turf.point([e.lng,e.lat]),o=turf.midpoint(i,n).geometry.coordinates;return{lng:o[0],lat:o[1]}}},{key:"computeAttackArrow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.computeArrow(t,0)}},{key:"computePincerArrow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.computeArrow(t)}},{key:"computeArrow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(t.length<3)return[];for(var i,n=[],o=0;o0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.length<2)return[];t.length;var i=new Array;if(t.forEach((function(t){i.push([t.lng,t.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,p=[],h=0;h0&&void 0!==arguments[0]?arguments[0]:"#2ab0c2",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i="";switch(Number(e)){case 1:i=new Cesium.PolylineDashMaterialProperty({color:Cesium.Color.fromCssColorString(t),dashLength:10});break;case 2:i=new Cesium.PolylineGlowMaterialProperty({glowPower:.2,color:Cesium.Color.fromCssColorString(t)});break;default:i=Cesium.Color.fromCssColorString(t)}return i}},{key:"create_arrow1_picture",value:function(t){var e=new fabric.Canvas("canvas");e.width=150,e.height=75;var i=t,n=new fabric.Polygon([{x:e.width,y:e.height/2},{x:e.width-35,y:e.height},{x:e.width-35,y:e.height-20},{x:e.width/2,y:e.height-20},{x:e.width/2,y:20},{x:e.width-35,y:20},{x:e.width-35,y:0}],{fill:i});return e.add(n),e.toDataURL()}},{key:"create_arrow2_picture",value:function(t){var e=new fabric.Canvas("canvas");e.width=75,e.height=75;var i=t,n=new fabric.Polygon([{x:e.width,y:e.height/2},{x:e.width-35,y:e.height},{x:e.width-35-40,y:e.height},{x:e.width-40,y:e.height/2},{x:e.width-35-40,y:0},{x:e.width-35,y:0}],{fill:i});return e.add(n),e.toDataURL()}},{key:"sampleHeightMostDetailed",value:function(t){var e=[];return t.forEach((function(t){e.push(new Cesium.Cartographic.fromDegrees(t.lng,t.lat))})),this.sdk.viewer.scene.sampleHeightMostDetailed(e)}},{key:"flyHome",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(ve(0),re(this.sdk),le(this.sdk),this.sdk.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE){var e=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(e.lng,e.lat,e.alt),orientation:{heading:Cesium.Math.toRadians(i.heading||0),pitch:Cesium.Math.toRadians(i.pitch||0),roll:Cesium.Math.toRadians(i.roll||0)},duration:t})}else this.sdk.viewer.camera.flyHome(t)}},{key:"setPickStatus",value:function(){}},{key:"create_point_buffer",value:function(t){var e=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(t.lng),Number(t.lat)]),o=turf.buffer(n,Number(e)/1e3,i);return o.geometry.coordinates}},{key:"create_line_buffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(1===t.length)return this.create_point_buffer(t[0],e);if(0===t.length)return!1;var i=[];t.forEach((function(t){i.push([Number(t.lng),Number(t.lat)])}));var n=turf.lineString(i),o=turf.buffer(n,Number(e)/1e3);return o.geometry.coordinates}},{key:"create_area_buffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(1===t.length)return this.create_point_buffer(t[0],e);if(0===t.length)return!1;if(2===t.length)return this.create_line_buffer(t,e);var i=[];t.forEach((function(t){i.push([Number(t.lng),Number(t.lat)])})),i.push(i[0]);var n=turf.polygon([i]),o=turf.buffer(n,Number(e)/1e3);return o.geometry.coordinates}},{key:"cal_envelope",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!(t.length<2)){var e=[];t.forEach((function(t){e.push(turf.point([t.lng,t.lat]))}));var i=turf.featureCollection(e);return turf.envelope(i).geometry.coordinates[0]}console.error("坐标数量不能少于2个")}},{key:"chunkLine",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if(t.length<2)return[];var i=[];t.forEach((function(t){i.push([t.lng,t.lat])}));var n=turf.lineString(i),o=turf.lineChunk(n,e/1e3),s=new Map;return o.features.forEach((function(t){t.geometry.coordinates.forEach((function(t){var e=t.join(","),i={lng:t[0],lat:t[1]};s.set(e,i)}))})),o.features}},{key:"billboardAnimation",value:function(t,e){var i=e.id,n=e.offset,o=void 0===n?10:n,s=(e.times,t.entities.getById(i));if(s){var a=Math.PI,r=a/60,l=0,c=this.cartesian3Towgs84(s.position.getValue(),t),u=setInterval((function(){l+=r;var t=o*Math.sin(l)+c.alt;l>a&&(l=0),s.position=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,t)}),30);setTimeout((function(){clearInterval(u),s.position=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt)}),3e3)}}},{key:"calSector",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=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([t.lng,t.lat]),r=turf.sector(a,e/1e3,i,n,{steps:o}).geometry.coordinates,l=[];return r.forEach((function(t){t.forEach((function(t){var e;e=s?{lng:t[0],lat:t[1]}:Cesium.Cartesian3.fromDegrees(t[0],t[1]),l.push(e)}))})),l}},{key:"getClampToHeight",value:(t=a()(l.a.mark((function t(e){var i,n,o,s,a,r,c=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=c.length>1&&void 0!==c[1]?c[1]:[],this.sdk&&this.sdk.viewer){t.next=3;break}return t.abrupt("return",0);case 3:return n=new Cesium.Cartesian3.fromDegrees(e.lng,e.lat),t.prev=4,t.next=7,this.sdk.viewer.scene.clampToHeight(n,i);case 7:if(t.t0=t.sent,t.t0){t.next=10;break}t.t0=n;case 10:o=t.t0,t.next=16;break;case 13:t.prev=13,t.t1=t.catch(4),o=n;case 16:return t.next=18,this.cartesian3Towgs84(o,this.sdk.viewer).alt;case 18:if(s=t.sent,a=0,t.prev=20,!this.sdk.viewer.scene.terrainProvider.availability){t.next=26;break}return t.next=24,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(e.lng,e.lat)]);case 24:(r=t.sent)[0].height&&(a=r[0].height);case 26:t.next=31;break;case 28:t.prev=28,t.t2=t.catch(20),a=0;case 31:if(!(s>a)){t.next=35;break}return t.abrupt("return",Number(s.toFixed(2)));case 35:return t.abrupt("return",Number(a.toFixed(2)));case 36:case"end":return t.stop()}}),t,this,[[4,13],[20,28]])}))),function(e){return t.apply(this,arguments)})},{key:"deepCopyObj",value:function(t){var e=null;if("object"==M()(t)&&null!==t)for(var i in e=t instanceof Array?[]:{},t)"earth"!=i&&"Dialog"!=i&&(e[i]=this.deepCopyObj(t[i]));else e=t;return e}},{key:"projConvert",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t?W(this.sdk,e):Y()}},{key:"projectionConvert",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t?X(this.sdk,e):Z()}},{key:"exportExcel",value:function(t){var e="";for(var i in t[0])e+=''.concat(i,"");e+="";for(var n,o='{rows}
',s=function(t,e){return t.replace(/{(\w+)}/g,(function(t,i){return e[i]}))},a="",r="",l=0;l",t[l])r+=s('{data}',{nameType:"String",data:t[l][c]});r+="",l>0&&l/6e4%1==0&&(a+=s(o,{rows:r,nameWS:"Sheet"+l}),r="",r+=e)}a+=s(o,{rows:r,nameWS:"Sheet"}),r="",n=s('Axel Richter{created}{worksheets}',{created:(new Date).getTime(),worksheets:a});var u,p=document.createElement("A");p.href="data:application/vnd.ms-excel;base64,"+(u=n,window.btoa(unescape(encodeURIComponent(u)))),p.download="矢量数据导出.xls",p.target="_blank",document.body.appendChild(p),p.click(),document.body.removeChild(p)}},{key:"decompressGzip",value:function(t){var e=pako.inflate(t);return(new TextDecoder).decode(e)}},{key:"cmykToRgb",value:function(t){var e=t.c,i=t.m,n=t.y,o=t.k,s={r:0,g:0,b:0};return s.c=e/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(t,e){var i=parseFloat(getComputedStyle(document.documentElement).fontSize),n=[],o=[];if(e){n=document.getElementById(t.div_id).querySelectorAll(e);for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{};this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=t.color,this.duration=t.duration,this.fltr=t.fltr,this.image=t.image,this._time=(new Date).getTime()}Object.defineProperties(t.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:Cesium.createPropertyDescriptor("repeat"),color:Cesium.createPropertyDescriptor("color")}),t.prototype.getType=function(t){return"PolylineTrailLink"},t.prototype.getValue=function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrClonedDefault(this._color,t,Cesium.Color.BROWN,e.color),this.image?e.image=this.image:e.image=Cesium.Material.PolylineTrailLinkImage,this.duration&&(e.time=((new Date).getTime()-this._time)%this.duration/this.duration),!1===this.fltr?e.fltr=this.fltr:e.fltr=!0,e},t.prototype.equals=function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)},Cesium.PolylineTrailLinkMaterialProperty=t,Cesium.Material.PolylineTrailLinkType="PolylineTrailLink",Cesium.Material.PolylineTrailLinkImage=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#fa2020",e=512,i=32,n=new fabric.Canvas("canvas",{width:e,height:i}),o=new fabric.Rect({width:e,height:i}),s=new fabric.Gradient({type:"linear",gradientUnits:"pixels",coords:{x1:0,y1:0,x2:e,y2:0},colorStops:[{offset:.01,color:"rgba(246,241,241,0)"},{offset:1,color:t}]});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 = (colorImage.rgb+color.rgb)/2.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(t){return!0}})}function ke(){var t,e;we(),t=new ye,"undefined"!=typeof Cesium&&function(e){e.CustomMaterialSource=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(e.Color,e.defaultValue),o=Object.defineProperties,s=e.Event,a=e.createPropertyDescriptor,r=e.Property,l=e.Material,c=i.MaterialType||"wallType"+parseInt(1e3*Math.random()),u={color:new e.Color(1,1,1,1),image:i.image||t.getSourceRootPath()+"/img/material/arrow.png",time:i.time||0,repeat:new e.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 p=e.Property.getValueOrDefault(i.repeats),h=0;h0&&void 0!==arguments[0]?arguments[0]:{};t=n(t,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=t.image,this.is2D=!!t.is2D,this.color=new e.Color.fromCssColorString(t.color||"rgba(4,253,231,0.87)"),this.repeat=t.repeat,this.repeats=t.repeats,this.duration=t.duration||0===t.duration?t.duration:1e3,this.fltr=!t.fltr&&!1!==t.fltr||t.fltr,this._time=(new Date).getTime()}return o(d.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:e.createPropertyDescriptor("repeat"),color:a("color")}),d.prototype.getType=function(t){return c},d.prototype.getValue=function(t,i){if(e.defined(i)||(i={}),i.color=e.Property.getValueOrClonedDefault(this._color,t,e.Color.WHITE,i.color),i.time=this.duration?e.getTimestamp()%this.duration/this.duration:0,i.image=this.image,i.is2D=!!this.is2D,this.repeat&&(i.repeat=e.Property.getValueOrDefault(this.repeat)),this.repeats)for(var n=e.Property.getValueOrDefault(this.repeats),o=0;o0&&void 0!==arguments[0]?arguments[0]:{},i=(t.Color,t.defaultValue),n=Object.defineProperties,o=t.Event,s=t.createPropertyDescriptor,a=t.Property,r=t.Material,l=e.MaterialType||"wallType"+parseInt(1e3*Math.random());function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this.color=new t.Color.fromCssColorString(e.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(t){return l},c.prototype.getValue=function(e,i){return t.defined(i)||(i={}),i.color=t.Property.getValueOrClonedDefault(this._color,e,t.Color.WHITE,i.color),i},c.prototype.equals=function(t){return this===t||t instanceof c&&a.equals(this._color,t._color)},r._materialCache.addMaterial(l,{fabric:{type:l,uniforms:{color:new t.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(t){return!0}}),new c(e)}}(Cesium),function(){var t=new ye;"undefined"!=typeof Cesium&&function(e){e.CustomImageMaterialSource=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(e.Color,e.defaultValue),o=Object.defineProperties,s=e.Event,a=e.createPropertyDescriptor,r=e.Property,l=e.Material,c=i.MaterialType||"wallType"+parseInt(1e3*Math.random());function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=n(t,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=t.image,this.color=new e.Color.fromCssColorString(t.color||"rgba(4,253,231,0.87)"),this.repeat=t.repeat}return o(u.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:e.createPropertyDescriptor("repeat"),color:a("color")}),u.prototype.getType=function(t){return c},u.prototype.getValue=function(t,i){return e.defined(i)||(i={}),i.color=e.Property.getValueOrClonedDefault(this._color,t,e.Color.WHITE,i.color),i.image=this.image,i.repeat=e.Property.getValueOrDefault(this.repeat),i},u.prototype.equals=function(t){return this===t||t instanceof u&&r.equals(this._color,t._color)&&r.equals(this.repeat,t._repeat)},l._materialCache.addMaterial(c,{fabric:{type:c,uniforms:{color:new e.Color(1,1,1,1),image:i.image||t.getSourceRootPath()+"/img/material/arrow.png",repeat:new e.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)}()}var _e=function(){return k()((function t(e,i){C()(this,t),this.dom=e,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(t,e,i){this.flvPlayer.on(flvjs[t][e],i)}},{key:"destroy",value:function(){this.flvPlayer.destroy(),this.flvPlayer=null}}])}(),xe=function(){return k()((function t(e,i){C()(this,t),this.dom=e,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(t,e){this.player.on(t,e)}},{key:"destroy",value:function(){this.player.destroy(),this.player=null}},{key:"getSourceRootPath",value:function(){var t=document.querySelectorAll("script"),e="";return t.forEach((function(t){if(t.src&&t.src.indexOf("YJEarth.min.js")>-1){var i=t.src.split("/");i.pop(),e=i.join("/")}})),e}}])}();function Ee(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function Se(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var De=/^[og]\s*(.+)?/,Pe=/^mtllib /,Oe=/^usemtl /,Me=/^usemap /,Te=/\s+/,Ne={red:1,green:1,blue:1,alpha:1};function Be(){var t={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(t,e){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=!1!==e);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:t||"",fromDeclaration:!1!==e,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(t,e){var i=this._finalize(!1);i&&(i.inherited||i.groupCount<=0)&&this.materials.splice(i.index,1);var n={index:this.materials.length,name:t||"",mtllib:Array.isArray(e)&&e.length>0?e[e.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(t){var e={index:"number"==typeof t?t:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return e.clone=this.clone.bind(e),e}};return this.materials.push(n),n},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&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 t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}},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(t,e){var i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},parseNormalIndex:function(t,e){var i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},parseUVIndex:function(t,e){var i=parseInt(t,10);return 2*(i>=0?i-1:i+e/2)},addVertex:function(t,e,i){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[i+0],n[i+1],n[i+2])},addVertexPoint:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addVertexLine:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addNormal:function(t,e,i){var n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[i+0],n[i+1],n[i+2])},addFaceNormal:function(t,e,i){console.warn("addFaceNormal")},addColor:function(t,e,i){var n=this.colors,o=this.object.geometry.colors;void 0!==n[t]&&o.push(n[t+0],n[t+1],n[t+2]),void 0!==n[e]&&o.push(n[e+0],n[e+1],n[e+2]),void 0!==n[i]&&o.push(n[i+0],n[i+1],n[i+2])},addUV:function(t,e,i){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[i+0],n[i+1])},addDefaultUV:function(){var t=this.object.geometry.uvs;t.push(0,0),t.push(0,0),t.push(0,0)},addUVLine:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])},addFace:function(t,e,i,n,o,s,a,r,l){var c=this.vertices.length,u=this.parseVertexIndex(t,c),p=this.parseVertexIndex(e,c),h=this.parseVertexIndex(i,c);if(this.addVertex(u,p,h),this.addColor(u,p,h),void 0!==a&&""!==a){var d=this.normals.length;u=this.parseNormalIndex(a,d),p=this.parseNormalIndex(r,d),h=this.parseNormalIndex(l,d),this.addNormal(u,p,h)}else this.addFaceNormal(u,p,h);if(void 0!==n&&""!==n){var m=this.uvs.length;u=this.parseUVIndex(n,m),p=this.parseUVIndex(o,m),h=this.parseUVIndex(s,m),this.addUV(u,p,h),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(t){this.object.geometry.type="Points";for(var e=this.vertices.length,i=0,n=t.length;i=7?(Cesium.Color.fromBytes(parseFloat(u[4]),parseFloat(u[5]),parseFloat(u[6]),1,Ne),n.colors.push(Ne.red,Ne.green,Ne.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 p=l.slice(1).trim().split(Te),h=[],d=0,m=p.length;d0){var v=f.split("/");h.push(v)}}for(var g=h[0],y=1,b=h.length-1;y1){var O=s[1].trim().toLowerCase();n.object.smooth="0"!==O&&"off"!==O}else n.object.smooth=!0;var M=n.object.currentMaterial();M&&(M.smooth=n.object.smooth)}else{if("\0"===l)continue;console.warn('Unexpected line: "'+l+'"')}}}n.finalize();var T=new Re(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;N0&&(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",p+="varying vec3 v_normal;\n",h+="v_normal = normal;\n"),m&&(u+="attribute vec3 color;\n",u+="varying vec2 v_color;\n",p+="varying vec2 v_color;\n",h+="v_color = color;\n"),f&&(u+="attribute vec2 uv;\n",u+="varying vec2 v_uv;\n",p+="varying vec2 v_uv;\n",h+="v_uv = uv;\n"),u+="\n void main() {\n gl_Position = czm_modelViewProjection * vec4(position, 1.);\n ".concat(h,"\n }\n "),p+="\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:e,vertexShaderSource:u,fragmentShaderSource:p}),this.uniformMap={};var v=this;c.then((function(t){for(var e=function(){var e=t[i].diffusemap;s.uniformMap.colorTexture=function(){return e}},i=0;i0){o++;var a=Cesium.Buffer.createVertexBuffer({context:e,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:e,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:e,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:e,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(t){this.material=t,t.setCommand(this.drawCommand)}},{key:"update",value:function(t){Cesium.defined(this.material)&&this.material.ready&&t.commandList.push(this.drawCommand)}},{key:"updateVideo",value:function(t,e,i){var n=!1;if(Cesium.defined(this.material)&&this.material.ready)if(i.computeVisibility(this.drawCommand.boundingVolume)>=0&&this.material.ready){var o=t.distanceToBoundingSphere(this.drawCommand.boundingVolume),s=e.width,a=e.height;o>=20&&o<100?(s=e.width/2,a=e.height/2):o>=100&&(s=e.width/10,a=e.height/10),n=!0,this.material.updateColorTexture(e,Math.floor(s),Math.floor(a))}else n=!1;this.lastState=n}}])}(),Ie=new WeakMap,Re=function(){return k()((function t(e,i,n,o,s){C()(this,t),Ee(this,Ie,!0),this.context=e,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 e=this,(t=Ie).get(Se(t,e));var t,e},set:function(t){var e,i,n;"boolean"==typeof t?(i=this,n=t,(e=Ie).set(Se(e,i),n),t?this.video.player&&this.video.player.getVueInstance().play():this.video.player&&this.video.player.getVueInstance().pause()):console.error("参数必须为boolean")}},{key:"requestVideoResource",value:function(){var t=this,e="",i=(e=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=a()(l.a.mark((function i(n){var o;return l.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,n.text();case 2:if(o=i.sent,o=JSON.parse(o),![0,200].includes(o.code)){i.next=13;break}if(!o.data.deviceCode.length){i.next=9;break}return i.abrupt("return",fetch(e+"/videoFusion/vide/stream",{method:"post",body:JSON.stringify({type:"flv",deviceCode:o.data.deviceCode}),headers:{"Content-Type":"application/json"}}).then(function(){var e=a()(l.a.mark((function e(i){var n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.text();case 2:if(n=e.sent,n=JSON.parse(n),![0,200].includes(n.code)){e.next=9;break}return n.data.url.length?(t.video.player.url=n.data.url,t.setFlvVideo(n.data.url)):console.warn("地址不存在"),e.abrupt("return");case 9:return console.warn(n.msg||n.message),e.abrupt("return");case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 9:console.warn("设备不存在");case 10:return i.abrupt("return");case 13:return console.warn(o.msg||o.message),i.abrupt("return");case 15:case"end":return i.stop()}}),i)})));return function(t){return i.apply(this,arguments)}}())}},{key:"modelMatrix",get:function(){return this._modelMatrix},set:function(t){this._modelMatrix=t.clone(),this.updateModelMatrix()}},{key:"updateModelMatrix",value:function(){for(var t=0;t=0;l--){var c=Array.from(We.keys())[l],u=We.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 p=turf.point([a.lng,a.lat]),h=[],d=0;d=3){for(var f=u.that.computeAssemble(u.that.options.positions,!0),v=turf.point([a.lng,a.lat]),g=[],y=0;y=3){for(var C=turf.point([a.lng,a.lat]),w=u.that.computeAttackArrow(u.that.options.positions),k=[],_=0;_=5){for(var S=turf.point([a.lng,a.lat]),D=u.that.computePincerArrow(u.that.options.positions),P=[],O=0;O1&&void 0!==arguments[1]?arguments[1]:{};C()(this,t),oi(this,ai,void 0),this.div_id=e,this.entityMap=new Map,this._entityZIndex=0,this.viewer=null,this.options=ni({},i),fe(me()),this.proj=new j,this.init(),Ve()}),[{key:"addIncetance",value:function(t,e){this.entityMap.set(t,e)}},{key:"getIncetance",value:function(t){return this.entityMap.get(t)}},{key:"removeIncetance",value:function(t){this.entityMap.delete(t),function(t){We.delete(t)}(t),function(t){Ye.delete(t)}(t),function(t){Je.delete(t)}(t),Et(this,t)}},{key:"setDefaultView",value:function(t){t?(this.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE={destination:t.destination||{},orientation:t.orientation||{}},re(this),le(this),this.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(t.destination.lng,t.destination.lat,t.destination.alt),orientation:{heading:Cesium.Math.toRadians(t.orientation.heading||0),pitch:Cesium.Math.toRadians(t.orientation.pitch||0),roll:Cesium.Math.toRadians(t.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 t=this,e=new Cesium.Ellipsoid(6378137,6378137,6356752.314140356),i=new Cesium.GeographicProjection(e),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:{alpha:!0,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 ye;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"}}),ke(),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,function(t){var e=new ye,i=new Cesium.CustomDataSource("sdk-dataSource1");t.dataSources.add(i).then((function(t){var i;t.clustering.enabled=!1,t.clustering.pixelRange=15,t.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=1e3?(i.billboard.scale=1.5,i.label.pixelOffset=new Cesium.Cartesian2(-28,-46)):t.length>=100?(i.billboard.scale=1.25,i.label.pixelOffset=new Cesium.Cartesian2(-21,-40)):t.length>=50?(i.billboard.scale=1.1,i.label.pixelOffset=new Cesium.Cartesian2(-16,-36)):t.length>=40?(i.billboard.scale=1.05,i.label.pixelOffset=new Cesium.Cartesian2(-16,-34)):t.length>=30?(i.billboard.scale=1,i.label.pixelOffset=new Cesium.Cartesian2(-16,-32)):t.length>=20?(i.billboard.scale=.95,i.label.pixelOffset=new Cesium.Cartesian2(-16,-30)):t.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=t.clustering.pixelRange;t.clustering.pixelRange=0,t.clustering.pixelRange=n}();var a={pixelRange:15,minimumClusterSize:2};function r(e){Cesium.knockout.getObservable(a,e).subscribe((function(i){t.clustering[e]=i}))}Cesium.knockout.track(a),r("pixelRange"),r("minimumClusterSize")}))}(this.viewer),_(this.viewer),Cesium.viewerCesiumNavigationMixin(this.viewer,{resetTooltip:"重置视图",zoomInTitle:"缩小",zoomOutTitle:"放大"}),setTimeout((function(){var e=document.getElementsByClassName("compass-outer-ring")[0],i=document.getElementsByClassName("navigation-controls")[0];e.addEventListener("mousedown",(function(){re(t),le(t)})),i.addEventListener("mousedown",(function(){re(t),le(t)}))}),0),this.viewer.imageryLayers.layerAdded.addEventListener((function(){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:{};C()(this,t),this.sdk=e,this.primitives={building:[],unit:[],dth:[]},this.options=ci({},i),this.options.host=this.options.host||m(),this.temporaryDth=[],this.dth={},this.PickBuildingEvent=new Cesium.Event,this.initEvents(),this.activeBuilding}),[{key:"PickCallback",value:function(t,e){this.PickBuildingEvent.addEventListener(e,t)}},{key:"initEvents",value:function(){var t=this;new Cesium.ScreenSpaceEventHandler(this.sdk.viewer.scene.canvas).setInputAction((function(e){if(!YJ.Measure.GetMeasureStatus()&&t.isActivate){var i=t.sdk.viewer.scene.pick(e.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 t.getIDBypickFeature(i);if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&"yj-dth-unit"==i.id.type)return t.highlightPrimitive&&t.sdk.viewer.scene.primitives.remove(t.highlightPrimitive),void t.handlePickEvent(i.id)}t.highlightPrimitive&&t.sdk.viewer.scene.primitives.remove(t.highlightPrimitive);var n=t.sdk.viewer.scene.pickPosition(e.position);if(n){var o=Cesium.Cartographic.fromCartesian(n),s=[Cesium.Math.toDegrees(o.longitude),Cesium.Math.toDegrees(o.latitude)];t.queryByPoint(s,o.height)}}}),Cesium.ScreenSpaceEventType.LEFT_CLICK);var e=this.sdk.viewer.entities.getOrCreateEntity("yj-dth-cover-label");e.show=!1,new Cesium.ScreenSpaceEventHandler(this.sdk.viewer.scene.canvas).setInputAction((function(i){if(!YJ.Measure.GetMeasureStatus()){var n=t.sdk.viewer.scene.pick(i.endPosition);if(n){var o="";if(n.primitive&&n.primitive instanceof Cesium.ClassificationPrimitive&&n.id&&("yj-dth-dth"===n.id.type||"yj-dth-highlight"===n.id.type))o=n.id.build_info.name+" - "+n.id.unit_info.name+" - "+n.id.room_num;else if(n.primitive&&n.primitive instanceof Cesium.ClassificationPrimitive&&n.id&&"yj-dth-unit"===n.id.type)n.id.build_info.name&&(o=n.id.build_info.name+" - "+n.id.name);else{if(!(n.primitive&&n.primitive instanceof Cesium.ClassificationPrimitive&&n.id&&"yj-dth-build"===n.id.type))return n.primitive&&n.primitive.id&&n.primitive.id.id&&"yj-dth-cover-label"===n.primitive.id.id?void(e.position=t.sdk.viewer.scene.pickPosition(i.endPosition)):void(e.show=!1);n.id.name&&(o=n.id.name)}o&&(e.position=t.sdk.viewer.scene.pickPosition(i.endPosition),e.label=new Cesium.LabelGraphics({text:o,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:1e8}),e.show=!0)}}}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}},{key:"queryByUserInfo",value:function(t){this.queryByPoint([t.position.lng,t.position.lat],t.position.alt,t.id)}},{key:"queryByPoint",value:(o=a()(l.a.mark((function t(e){var i,n,o;return l.a.wrap((function(t){for(;;)switch(t.prev=t.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:e[0],lat:e[1]}),t.next=5,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:g(),Authorization:"Bearer "+g()}});case 5:if(200!==(n=t.sent).status){t.next=11;break}return t.next=9,n.json();case 9:200===(o=t.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 t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"processQueryByPointResults",value:(n=a()(l.a.mark((function t(e,i){var n,o,s,a,r,c,u,p=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=p.length>2&&void 0!==p[2]?p[2]:{heading:0,pitch:-90,roll:0},e.build_info&&this.handlePickEvent(e),this.clearAllDthPrimitive(),this.clearAllUnitPrimitive(),this.activeBuilding&&(this.clearBuildingPrimitive(this.activeBuilding),this.activeBuilding=null),!e.build_info){t.next=26;break}if(o=JSON.parse(e.build_info.range),e.dan_yuan.length>0)for(s=0;s0?this.addDthPrimitive(e.dan_yuan[s].children,e.build_info,e.dan_yuan[s]):this.addUnitPrimitive([e.dan_yuan[s]],e.build_info,e.dan_yuan[s]);else this.activeBuilding=e.build_info.ID||e.build_info.id,this.addBuildingPrimitive([e.build_info]);if(!i){t.next=26;break}if(e.info&&e.info.dan_yuan&&(o=JSON.parse(e.info.dan_yuan.range)),!e.info||!e.info.hu){t.next=25;break}for(o=JSON.parse(e.info.hu.range),a=0;a=0;e--)if(t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.ID||t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.id){this.sdk.viewer.scene.primitives.remove(this.primitives.building[e]),this.primitives.building.splice(e,1);break}}},{key:"clearAllBuildingPrimitive",value:function(){for(var t=this.primitives.building.length-1;t>=0;t--)this.sdk.viewer.scene.primitives.remove(this.primitives.building[t]);this.primitives.building=[]}},{key:"addUnitPrimitive",value:(e=a()(l.a.mark((function t(e,i,n){var o,s,a,r,c,u;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(o=0;o=0;e--)if(t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.ID||t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.id){this.sdk.viewer.scene.primitives.remove(this.primitives.unit[e]),this.primitives.unit.splice(e,1);break}}},{key:"clearAllUnitPrimitive",value:function(){for(var t=this.primitives.unit.length-1;t>=0;t--)this.sdk.viewer.scene.primitives.remove(this.primitives.unit[t]);this.primitives.unit=[]}},{key:"addDthPrimitive",value:function(t,e,i){for(var n=0;n=0;e--)t!==this.primitives.dth[e]._primitiveOptions.geometryInstances[0].id.ID&&t!==this.primitives.dth[e]._primitiveOptions.geometryInstances[0].id.id||(this.sdk.viewer.scene.primitives.remove(this.primitives.dth[e]),this.primitives.dth.splice(e,1))}},{key:"clearAllDthPrimitive",value:function(){this.highlightPrimitive&&this.sdk.viewer.scene.primitives.remove(this.highlightPrimitive);for(var t=this.primitives.dth.length-1;t>=0;t--)this.sdk.viewer.scene.primitives.remove(this.primitives.dth[t]);this.primitives.dth=[]}},{key:"getIDBypickFeature",value:function(t){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:ci(ci({},t.id),{},{type:"yj-dth-highlight"}),geometry:t.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(){t.primitive.show=!1})),this.clickHighlightPrimitive=t.primitive;var e=t.id.range;"string"==typeof t.id.range&&(e=JSON.parse(t.id.range)),this.getHilightArea(e),this.handlePickEvent(t.id)}},{key:"handlePickEvent",value:function(t){this.PickBuildingEvent.raiseEvent(t)}},{key:"getHilightArea",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=[];t.forEach((function(t){i.push([t.lng,t.lat])})),i.push(i[0]);var n=turf.polygon([i]),o=turf.buffer(n,Number(e)/1e3);return o.geometry.coordinates}},{key:"flyTo",value:(t=a()(l.a.mark((function t(e){var i,n,o,s,a,r,c,u=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.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=[],a=0;case 5:if(!(a更新高程',s.style.width="auto",s.addEventListener("click",(function(){p.options.updateHeightCallBack()})),o.appendChild(s)),this.options.secondaryEditCallBack&&((a=document.createElement("button")).className="secondaryEdit",a.innerHTML='二次编辑',this.options.updateHeightCallBack&&(a.style.marginLeft="10px"),o.appendChild(a),a.addEventListener("click",(function(){p.options.secondaryEditCallBack&&p.options.secondaryEditCallBack()}))),this.options.translationalCallBack&&((r=document.createElement("button")).className="translational",r.innerHTML='平移',(this.options.updateHeightCallBack||this.options.secondaryEditCallBack)&&(r.style.marginLeft="10px"),o.appendChild(r),r.addEventListener("click",(function(){p.options.translationalCallBack&&p.options.translationalCallBack()})))),this.options.addFootElm)for(c=0;c=0;i--)for(var n in this.info.attribute)if(e[i].value===n){this.info.attribute[n].disabled&&(e[i].disabled=!0);break}}}]);var i}(G);var Ci;function wi(){return(wi=a()(l.a.mark((function t(e){var i,n,o=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=o.length>1&&void 0!==o[1]?o[1]:function(){},n=e.viewer.canvas.toDataURL(),i&&i(n);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ki(){return(ki=a()(l.a.mark((function t(e){var i,n,o,s,r,c,u,p,h,d,m,f,v,g,y,b,w,_,x,E,S,D=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(S=function(){var t=new Date,e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0"),r=String(t.getMilliseconds()).padStart(3,"0");return"".concat(e).concat(i).concat(n).concat(o).concat(s).concat(a).concat(r)},D.length>1&&void 0!==D[1]?D[1]:function(){},e){t.next=4;break}return t.abrupt("return");case 4:return Ci&&(Ci.close(),Ci=null),i=e.viewer.scene.screenSpaceCameraController.enableTranslate,n=e.viewer.scene.screenSpaceCameraController.enableTilt,o=e.viewer.scene.screenSpaceCameraController.enableLook,s=1,m=new ye,t.next=12,new bi(e,{},{title:"高清出图",left:"180px",top:"100px",confirmCallBack:function(t){d&&(d.desist(),d=null),c&&(c.style.width="0%"),p&&(p.style.left="0%"),u&&(u.style.width="0%"),h&&(h.innerHTML="0%"),d=new E},closeCallBack:function(){e.viewer.scene.screenSpaceCameraController.enableTranslate=i,e.viewer.scene.screenSpaceCameraController.enableTilt=n,e.viewer.scene.screenSpaceCameraController.enableLook=o,e.viewer._element.getElementsByClassName("compass")[0].style.pointerEvents="auto",d&&(d.desist(),d=null),Ci=void 0}});case 12:for((Ci=t.sent)._element.body.className=Ci._element.body.className+" screenShotHD",(f=document.createElement("div")).innerHTML='\n \n
\n
\n
\n 当前窗口长宽:'.concat(e.viewer.canvas.width,'*').concat(e.viewer.canvas.height,'像素\n
\n
\n
\n
\n 图片大小\n
\n 倍窗口\n
\n
\n
\n
\n 输出图片长宽:').concat(e.viewer.canvas.width*s,'*').concat(e.viewer.canvas.height*s,'像素\n
\n
\n
\n
\n 输出进度\n
\n
\n
\n
\n
\n
\n
\n 0%\n 100%\n
0%
\n
\n \n
\n
\n
\n
\n \n '),Ci.contentAppChild(f),e.viewer.scene.screenSpaceCameraController.enableTranslate=!1,e.viewer.scene.screenSpaceCameraController.enableTilt=!1,e.viewer.scene.screenSpaceCameraController.enableLook=!1,e.viewer._element.getElementsByClassName("compass")[0].style.pointerEvents="none",(v=e.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(e.viewer.canvas.clientWidth/2,e.viewer.canvas.clientHeight/2)))||(v=e.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(e.viewer.canvas.clientWidth/2,e.viewer.canvas.clientHeight/(2-(90+e.viewer.camera.pitch/(Cesium.Math.PI/180))/110))))||(v=e.viewer.camera.position),g=m.cartesian3Towgs84(e.viewer.camera.position,e.viewer).alt,y=m.cartesian3Towgs84(v,e.viewer),e.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=[],w=1;w<=10;w++)b.push({name:w,value:w});c=document.getElementsByClassName("progress-input")[0],u=document.getElementsByClassName("range-process")[0],p=f.getElementsByClassName("range-node-active")[0],h=f.getElementsByClassName("range-node-active-text")[0],(_=U(Ci._element.content.getElementsByClassName("scale-box")[0],".scale"))&&(_.legp_search(b),x=Ci._element.content.getElementsByClassName("scale")[0].getElementsByTagName("input")[0],s=b[0].value,_.legp_searchActive(b[0].value),x.value=b[0].value,x.addEventListener("input",(function(){for(var t=0;tg.maximumLevel&&(f=g.maximumLevel),f=y;q--)for(var X=_;X>=m;X--)J.push({x:X,y:q});var Z={count:0},K=0,$=-1,Q={count:0},tt=0;Object.defineProperty(Q,"count",{get:function(){return tt},set:function(t){(tt=t)>=30&&et()}}),Object.defineProperty(Z,"count",{get:function(){return K},set:function(o){K=o,C[i].value=v/D*E;var a=0;for(var r in C)a+=C[r].value;if(u.style.width=.99*a+"%",p.style.left=.99*a+"%",h.innerHTML=Math.floor(.99*a*100)/100+"%",K===(_-m+1)*(x-y+1)){var l=P.getContext("2d"),d=P.cloneNode(!0),f=d.getContext("2d"),g=l.getImageData(0,0,P.width,P.height);if(f.putImageData(g,0,0),P.width=e.viewer.canvas.width*s,P.height=e.viewer.canvas.height*s,l.drawImage(d,0,0,P.width,P.height),n){if(n.getContext("2d").drawImage(P,0,0),k!=w){var b=i+=1;return void t(b,n)}var O=n.toDataURL(),M=document.createElement("a");M.href=O,M.download="高清出图-".concat(S(),".png"),document.body.appendChild(M),M.click(),document.body.removeChild(M),URL.revokeObjectURL(O),u.style.width="100%",p.style.left="100%",h.innerHTML="100%",c.state=!1}else{if(k!=w){var T=i+=1;return void t(T,P)}var N=P.toDataURL(),B=document.createElement("a");B.href=N,B.download="高清出图-".concat(S(),".png"),document.body.appendChild(B),B.click(),document.body.removeChild(B),URL.revokeObjectURL(N),u.style.width="100%",p.style.left="100%",h.innerHTML="100%",c.state=!1}}}}),g._readyError?Z.count=(_-m+1)*(x-y+1):et()}function et(){Q.count=0,tt=0;for(var t=30*++$;t<30*($+1);t++){if(t>=J.length)return;it(t)}}function it(t){if(c.state)try{var e=J[t].x;e<0&&(e+=d);var i,n=new Image;n.setAttribute("crossOrigin","anonymous"),n.onload=a()(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:O.drawImage(n,256*(J[t].x-m)-parseFloat(H.toFixed(0)),256*(J[t].y-y)-parseFloat(G.toFixed(0)),256,256),v++,Z.count++,Q.count++;case 4:case"end":return e.stop()}}),e)}))),n.onerror=function(){v++,Z.count++,Q.count++},i=-1!==g.url.indexOf("{x}")&&-1!==g.url.indexOf("{y}")&&-1!==g.url.indexOf("{z}")?g.url.replace(/\{x\}/g,e).replace(/\{y\}/g,J[t].y).replace(/\{z\}/g,f):-1!==g.url.indexOf("{TileMatrix}")&&-1!==g.url.indexOf("{TileRow}")&&-1!==g.url.indexOf("{TileCol}")?g.url.replace(/\{TileCol\}/g,e).replace(/\{TileRow\}/g,J[t].y).replace(/\{TileMatrix\}/g,f):g._layer&&g._style&&g._tileMatrixSetID&&g._format?g.url+"&tilematrix=".concat(f,"&layer=").concat(g._layer,"&style=").concat(g._style,"&tilerow=").concat(Y,"&tilecol=").concat(e,"&tilematrixset=").concat(g._tileMatrixSetID,"&format=").concat(g._format):g.url+"tile/".concat(f,"/").concat(J[t].y,"/").concat(e),n.src=i}catch(t){v++,Z.count++,Q.count++}}}if(g._readyError)return C[i]={value:E},void _();g.readyPromise.then((function(){_()})).catch((function(t){g._readyError=!0,C[i]={value:E},_()}))}(0)}},{key:"desist",value:function(){this.state=!1}}])}();case 35:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _i(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return xi(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?xi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function xi(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i=Number(e.target.min))&&(t[l.value]=i)}})),s.blur.push((function(e){var i=e.target.value;(e.target.value||"undefined"!==e.target.dataset.null&&""!==e.target.dataset.null&&!Boolean(e.target.dataset.null))&&(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i0&&e[o].addEventListener(t,(function(e){for(var i=0;i',r='
',l=0,c=0;c\n
'+s[c].getAttribute("label")+"
\n
\n ",r=r+'
'+s[c].innerHTML+"
",l++}}a+="",r+="";var m=document.createElement("div");m.setAttribute("id",e),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;v1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=this;this.title=i,this.objectId=t,document.body.getElementsByClassName("richText-box")[0]&&document.body.removeChild(this.richTextBox),this.editor=null;var s='\n
\n
\n
\n

'.concat(i,'

\n \n
\n
\n
\n \n
\n ');this.richTextBox.innerHTML=s,document.body.appendChild(this.richTextBox);var r=window.wangEditor,c=r.createEditor,u=r.createToolbar,p={placeholder:"请输入正文...",MENU_CONF:{uploadImage:{fieldName:"file",maxFileSize:52428800,base64LimitSize:52428800,server:this.uploadImageServer},uploadVideo:{maxFileSize:524288e3,server:this.uploadVideoServer,allowedFileTypes:["video/mp4","video/mp3","video/ogg","video/webm","video/avi"],customUpload:function(t,e){return a()(l.a.mark((function i(){var n;return l.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,o.upload(t);case 2:n=i.sent,e((o.host=o.host||m())+"/"+n);case 4:case"end":return i.stop()}}),i)})))()}}},onChange:function(t){t.getHtml()}};this.editor=c({selector:"#editor-container",html:"


",config:p,mode:"default"});var h={excludeKeys:["emotion","insertImage","insertVideo"]};u({editor:this.editor,selector:"#toolbar-container",config:h,mode:"default"});this.editor.on("fullScreen",(function(){console.log("fullScreen")})),this.editor.setHtml(n);var d=this.richTextBox.getElementsByClassName("close")[0],f=this.richTextBox.getElementsByClassName("primary")[0],v=this.richTextBox.getElementsByClassName("cancel")[0];d.addEventListener("click",(function(){e.close()})),f.addEventListener("click",(function(){var t=e.editor.getHtml();e.primaryCallBack(t),e.close()})),v.addEventListener("click",(function(){e.close()}))}},{key:"close",value:function(){document.body.getElementsByClassName("richText-box")[0]&&document.body.removeChild(this.richTextBox),this.editor=null}},{key:"upload",value:(t=a()(l.a.mark((function t(e){var i,n,o,s;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="",this.host=this.host||m(),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",e),t.next=7,fetch(i,{method:"post",body:n,headers:{token:g(),Authorization:"Bearer "+g()}});case 7:if(200!==(o=t.sent).status){t.next=14;break}return t.next=11,o.json();case 11:if(200!==(s=t.sent).code&&0!==s.code){t.next=14;break}return t.abrupt("return",s.data.url);case 14:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})},{key:"customUploadVideo",get:function(){return Mi(Ni,this)},set:function(t){Oi(Ni,this,t)}},{key:"customUploadContent",get:function(){return Mi(Bi,this)},set:function(t){Oi(Bi,this,t)}},{key:"primaryCallBack",get:function(){return Mi(Ai,this)},set:function(t){Oi(Ai,this,t)}}]);var t}());function ji(t,e,i,n,o){var s=Math.ceil(e/i)||1;!function i(){var a,r="
  • 1
  • ",l="
  • ").concat(s,"
  • "),c="
  • ...
  • ",u="
  • ...
  • ",p="
    共 ".concat(e," 条
    ");if(a="
  • ",s<=6)for(var h=1;h<=s;h++)a+="
  • ").concat(h,"
  • ");else if(n<=4){for(var d=1;d<=5;d++)a+="
  • ").concat(d,"
  • ");a+=u,a+=l}else if(n>s-3){a+=r,a+=c;for(var m=s-4;m<=s;m++)a+="
  • ").concat(m,"
  • ")}else{a+=r,a+=c;for(var f=n-1;f<=n+1;f++)a+="
  • ").concat(f,"
  • ");a+=u,a+=l}a+="
  • ",a+=p,t.innerHTML=a,t.querySelector("li[pagenumber='"+n+"']").classList.add("active"),t.querySelectorAll("li[pagenumber]").forEach((function(e){e.onclick=function(){n=Number(this.innerHTML),t.querySelector("li[pagenumber='"+n+"']").classList.add("active"),a="",i(),o&&o(n)}})),t.getElementsByClassName("btnPrev")[0].addEventListener("click",(function(){n>1&&(n--,a="",i(),o&&o(n))})),t.getElementsByClassName("btnNext")[0].addEventListener("click",(function(){n10&&(n-=10,a="",i(),o&&o(n))})));var g=t.getElementsByClassName("btnGoRight")[0];g&&(g.addEventListener("mouseenter",(function(){this.innerHTML=">"})),g.addEventListener("mouseleave",(function(){this.innerHTML="..."})),g.addEventListener("click",(function(){n0){ji(o,e.data.total,5,1,(function(e){t.cameraSelect(e)})),s.getElementsByClassName("table-empty")[0].style.display="none",r.style.display="inline-flex";for(var l=[],c=function(n){var o='\n
    \n
    \n \n 绑定\n
    \n
    ').concat(e.data.list[n].cameraName,'
    \n
    ').concat(i[e.data.list[n].type],'
    \n
    ').concat(e.data.list[n].ip,'
    \n
    ').concat(e.data.list[n].port,'
    \n
    ').concat(e.data.list[n].userName,'
    \n
    ').concat(e.data.list[n].passWord||e.data.list[n].password,"
    \n
    "),s=document.createRange().createContextualFragment(o),a=s.querySelector('input[type="checkbox"]');l.push(a),a.addEventListener("change",(function(){if(a.checked){t.attributeCamera=[],t.attributeCamera.push(e.data.list[n]);for(var i=0;i=0;i--){for(var n=!1,o=0;o0){ji(n,e.data.total,5,1,(function(e){t.ISCSelect(e)})),o.getElementsByClassName("table-empty")[0].style.display="none",a.style.display="flex";for(var r=function(i){var n='\n
    \n
    \n \n 绑定\n
    \n
    ').concat(e.data.list[i].name,'
    \n
    ').concat(e.data.list[i].status?"在线":"离线","
    \n
    "),o=document.createRange().createContextualFragment(n),s=o.querySelector('input[type="checkbox"]');s.addEventListener("change",(function(){if(s.checked)t.attributeISC.push(e.data.list[i]);else{var n=t.attributeISC.filter((function(t){return"ID"in e.data.list[i]?t.ID!==e.data.list[i].ID:t.id!==e.data.list[i].id}));t.attributeISC=n}})),a.appendChild(o);for(var r=0;r0){t._allGoodsList=e.data.list;for(var o=t.attributeGoods.length-1;o>=0;o--){for(var a=!1,r=0;r\n
    ').concat(e.data.list[i].name,'
    \n
    \n '),s=document.createRange().createContextualFragment(o),a=s.querySelector('input[type="number"]');a.value=0;for(var r=0;r=0;r--)if("ID"in e.data.list[i]){if(e.data.list[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e.data.list[i]&&e.data.list[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e.data.list[i].name,cnt:o};"ID"in e.data.list[i]?l.ID=e.data.list[i].ID:"id"in e.data.list[i]&&(l.id=e.data.list[i].id),t.attributeGoods.push(Ri({},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=0;r--)if("ID"in e.data.list[i]){if(e.data.list[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e.data.list[i]&&e.data.list[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e.data.list[i].name,cnt:o};"ID"in e.data.list[i]?l.ID=e.data.list[i].ID:"id"in e.data.list[i]&&(l.id=e.data.list[i].id),t.attributeGoods.push(Ri({},l))}}})),n.appendChild(s)},c=0;c0){n.getElementsByClassName("table-empty")[0].style.display="none",o.style.display="block",o.style.maxHeight="150px";for(var s=function(i){var n='\n
    \n
    \n '.concat(i+1,'\n
    \n
    ').concat(e[i].name,'
    \n
    \n
    '),s=document.createRange().createContextualFragment(n),a=s.querySelector('input[type="number"]');a.value=0;for(var r=0;r=0;r--)if("ID"in e[i]){if(e[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e[i]&&e[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e[i].name,cnt:o};"ID"in e[i]?l.ID=e[i].ID:"id"in e[i]&&(l.id=e[i].id),t.attributeGoods.push(Ri({},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=0;r--)if("ID"in e[i]){if(e[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e[i]&&e[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e[i].name,cnt:o};"ID"in e[i]?l.ID=e[i].ID:"id"in e[i]&&(l.id=e[i].id),t.attributeGoods.push(Ri({},l))}}})),o.appendChild(s)},a=0;a\n
    \n
    \n 内容类型\n
    \n
    \n
    \n
    \n
    \n
    \n 编辑内容\n \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n 编辑内容\n \n \n
    \n
    \n
    \n
    \n
    \n
    \n
    操作
    \n
    设备名称
    \n
    设备类型
    \n
    设备IP
    \n
    设备端口
    \n
    用户名
    \n
    密码
    \n
    \n
    \n \n
    \n
    \n

    暂无数据

    \n
    \n
    \n
    \n
    \n
      \n
      \n
      \n
      \n \x3c!--
      \n
      \n 编辑内容\n \n \n
      \n
      --\x3e\n
      \n
      \n
      \n
      \n
      操作
      \n
      设备名称
      \n
      设备状态
      \n
      \n
      \n \n
      \n
      \n

      暂无数据

      \n
      \n
      \n
      \n
      \n
        \n
        \n
        \n
        \n
        \n 添加链接\n
        \n \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        名称
        \n
        链接
        \n
        操作
        \n
        \n
        \n
        \n
        \n
        \n
        \n

        暂无数据

        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n 编辑内容\n \n \n
        \n
        \n
        \n
        \n
        \n
        序号
        \n
        名称
        \n
        数量
        \n
        \n
        \n \n
        \n
        \n

        暂无数据

        \n
        \n
        \n
        \n
        \n '}function Fi(t){return'\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n

        WGS84坐标

        \n
        \n
        \n
        \n 经度\n \n
        \n
        \n
        \n
        \n 纬度\n \n
        \n
        \n
        \n
        \n 海拔高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        转换坐标选择\n
        \n
        \n
        \n
        \n
        \n X轴:\n \n
        \n
        \n
        \n
        \n Y轴:\n \n
        \n
        \n
        \n
        \n Z轴:\n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(zi(t),'\n \n \n
        \n
        \n 高度模式\n
        \n
        \n
        \n 高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n
        \n \n 小数格式\n
        \n
        \n
        \n
        \n \n 度分格式\n
        \n
        \n
        \n
        \n \n 度分秒格式\n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n 经度\n \n
        \n
        \n
        \n
        \n
        \n
        \n 纬度\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n 经度\n \n \n \n \n \n
        \n
        \n 纬度\n \n \n \n \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n 经度\n \n \n \n \n \n \n \n
        \n
        \n 纬度\n \n \n \n \n \n \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n

        图标设置

        \n
        \n
        \n 显隐\n \n
        \n
        \n 图标\n
        \n \n
        \n
        \n
        \n 默认图标\n
        \n \n
        \n
        \n
        \n 图标倍数\n \n
        \n
        \n
        \n
        \n

        文字设置

        \n
        \n
        \n 显隐\n \n
        \n
        \n 文字大小\n \n
        \n
        \n 文字颜色\n
        \n
        \n
        \n
        \n
        \n \x3c!-- \n
        \n
        \n
        \n 扩散\n \n
        \n
        \n 半径\n \n
        \n
        \n 时间\n \n
        \n
        \n 颜色\n
        \n
        \n
        \n
        \n
        \n 雷达\n \n
        \n
        \n 半径\n \n
        \n
        \n 时间\n \n
        \n
        \n 颜色\n
        \n
        \n
        \n
        \n
        --\x3e\n\x3c!-- --\x3e\n\x3c!--
        --\x3e\n\x3c!--
        --\x3e\n\x3c!--
        --\x3e\n\x3c!-- 指令--\x3e\n\x3c!-- --\x3e\n\x3c!-- --\x3e\n\x3c!--
        --\x3e\n\x3c!--
        --\x3e\n\x3c!--
        --\x3e\n\x3c!--
        --\x3e\n\x3c!-- --\x3e\n\x3c!--
        --\x3e\n\x3c!--
        --\x3e\n\x3c!--
        --\x3e\n\x3c!-- 设置操作点--\x3e\n\x3c!-- --\x3e\n\x3c!-- --\x3e\n\x3c!--
        --\x3e\n\x3c!--
        --\x3e\n\x3c!--
        --\x3e\n\x3c!--
        --\x3e\n
        \n
        \n \n ')}function Vi(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Hi(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),i=Gi(this,e,[t,n]),t&&t.viewer?(i.sdk=t,i.viewer=t.viewer,i.options=Hi({},n),i.options.id=n.id||i.randomString(),i.entity=null,i.clickCallBack=null,i.rightClickCallBack=null,i.picking=!0,i.setDefaultValue(),i):di()(i)}return gi()(e,t),k()(e,[{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this.label&&(this.label.text=t),this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t?(this.options.show=t,this.entity&&(this.entity.show=t),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),this.options.label&&this.options.label.show&&this.label&&(this.label.show=t),It(this.sdk,this.options.id),Et(this.sdk,this.options.id)):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 t=this,e=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},e/2).easing(TWEEN.Easing.Linear.None).repeat(i||0===i?2*i-1:1/0).yoyo(!0).onUpdate(function(){var e=a()(l.a.mark((function e(i,n){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.sdk.viewer){e.next=3;break}return TWEEN.remove(t.flickerAnimate),e.abrupt("return");case 3:t.show&&(1===i.degree&&(t.entity&&(t.entity.show=!0),t.labelShow&&t.label&&(t.label.show=!0),t.text&&t.text&&(t.text.show=!0)),0===i.degree&&(t.entity&&(t.entity.show=!1),t.labelShow&&t.label&&(t.label.show=!1),t.text&&t.text&&(t.text.show=!1)));case 4:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).onComplete((function(e){TWEEN.remove(t.flickerAnimate),t.flickerAnimate=void 0})).start()}},{key:"flyTo",value:(o=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=Hi({},this.options.position):this.options.positions?r=Hi({},this.options.positions[0]):this.options.line&&this.options.line.positions?r=Hi({},this.options.line.positions[0]):this.options.center?r=Hi({},this.options.center):this.options.start?r=Hi({},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")){t.next=18;break}return t.next=17,this.getClampToHeight(r);case 17:r.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.next=26;break;case 25:this.sdk.viewer.flyTo(this.entity,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"remove",value:(n=a()(l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sdk.removeIncetance(this.options.id);case 2:this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),It(this.sdk,this.options.id),Et(this.sdk,this.options.id);case 6:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"onClick",get:function(){return this.clickCallBack},set:function(t){"function"!=typeof t?console.error("val:",t,"不是一个function"):(null==this.clickCallBack&&this.options&&this.options.id&&$e(this.options.id,this.leftClickCB,this),this.clickCallBack=t)}},{key:"onRightClick",get:function(){return this.rightClickCallBack},set:function(t){"function"!=typeof t?console.error("val:",t,"不是一个function"):(null==this.rightClickCallBack&&this.entity&&this.entity.id&&Qe(this.entity.id,this.rightClickCB,this),this.rightClickCallBack=t)}},{key:"onMouseMove",get:function(){return this.mouseMoveCallBack},set:function(t){"function"!=typeof t?console.error("val:",t,"不是一个function"):(null==this.mouseMoveCallBack&&this.entity&&this.entity.id&&ti(this.entity.id,this.mouseMoveCB,this),this.mouseMoveCallBack=t)}},{key:"customView",get:function(){return this.options.customView}},{key:"setCustomView",value:(i=a()(l.a.mark((function t(e){var i,n,o,s;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=4;break}this.options.customView=e,t.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=Hi({},n),this.options.position?o=Hi({},this.options.position):this.options.positions?o=Hi({},this.options.positions[0]):this.options.line&&this.options.line.positions?o=Hi({},this.options.line.positions[0]):this.options.center?o=Hi({},this.options.center):this.options.start?o=Hi({},this.options.start):(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")){t.next=13;break}return t.next=12,this.getClampToHeight(o);case 12:o.alt=t.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 t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"resetCustomView",value:function(){this.options.customView=void 0}},{key:"edit",value:function(){}},{key:"leftClickCB",value:function(t,e,i,n){n.clickCallBack&&"function"==typeof n.clickCallBack&&n.clickCallBack(t,e,i)}},{key:"rightClickCB",value:function(t,e,i,n){n.rightClickCallBack&&"function"==typeof n.rightClickCallBack&&n.rightClickCallBack(t,e,i)}},{key:"mouseMoveCB",value:function(t,e,i,n){n.mouseMoveCallBack&&"function"==typeof n.mouseMoveCallBack&&n.mouseMoveCallBack(t,e,i)}},{key:"getGuid",value:function(){return Cesium.createGuid()}},{key:"setDefaultValue",value:function(){var t,e,i;this.options.id=null!==(t=this.options.id)&&void 0!==t?t:this.getGuid(),this.options.show=null===(e=this.options.show)||void 0===e||e,this.options.name=null!==(i=this.options.name)&&void 0!==i?i:"未命名对象"}},{key:"start",value:function(){}},{key:"end",value:function(){}}]);var i,n,o}(ye);function Wi(t){return'\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n 透明度\n \n
        \n
        \n
        \n \n
        \n
        \n
        \n 经度\n \n
        \n
        \n 波纹层数\n
        \n \n \n
        \n
        \n
        \n
        \n
        \n 纬度\n \n
        \n
        \n 扩散速度\n
        \n \n \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 半径单位\n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(zi(t),'\n \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n
        \n
        \n
        \n \n ')}function Yi(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}function Ji(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function qi(t,e){return t.get(Xi(t,e))}function Xi(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var Zi=new WeakMap,Ki=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;C()(this,e),Ji(i=Yi(this,e,[t,n]),Zi,void 0),i.model=o,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;a40&&(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.fontSize=n.fontSize||20,i.options.lineWidth=n.lineWidth||4,i.options.lineColor=n.lineColor||"#fff000",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||["#42c6ef","#42c6ef"],i.event=new J(i.sdk),i.entity,i.create(i.options.position),i.picking=!0,i}return gi()(e,t),k()(e,[{key:"create",value:(i=a()(l.a.mark((function t(){var e;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this,this.options.position[2]||0===this.options.position[2]){t.next=5;break}return t.next=4,this.getClampToHeight({lng:this.options.position[0],lat:this.options.position[1]});case 4:this.options.position[2]=t.sent;case 5:this.originalOptions=$i(this.options),this.entity=this.sdk.viewer.entities.add({show:this.options.show,id:this.options.id+"-label",position:new Cesium.CallbackProperty((function(){if(e.model){var t=e.model.customScale.x;e.model.customScale.y>t&&(t=e.model.customScale.y),e.model.customScale.z>t&&(t=e.model.customScale.z);for(var i=Cesium.Cartesian3.fromDegrees(e.options.position[0],e.options.position[1],e.options.position[2]+2*(e.model.originalBoundingSphereRadius||1)*(t||.01)),n=Cesium.Cartesian3.fromDegrees(e.options.position[0],e.options.position[1],e.options.position[2]-2*(e.model.originalBoundingSphereRadius||1)*(t||.01)),o=Cesium.Cartesian3.subtract(n,i,new Cesium.Cartesian3),s=Cesium.Cartesian3.normalize(o,o),a=new Cesium.Ray(i,s),r=e.viewer.scene.drillPickFromRay(a,5),l=0;l40&&(e[i]=e[i].slice(0,40-e[i].length));e.length>10&&e.splice(10-e.length),this.options.text=e.join("\n"),this.entity&&this.updateBillboardImage()}},{key:"color",get:function(){return this.options.color},set:function(t){this.options.color=t,this.entity&&(this.entity.billboard.image=this.getcanvas())}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(t){this.options.scaleByDistance=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:"near",get:function(){return this.options.near},set:function(t){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(t){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(t){this.options.fontSize=Number(t),this.entity&&this.updateBillboardImage()}},{key:"lineWidth",get:function(){return this.options.lineWidth},set:function(t){this.options.lineWidth=Number(t),this.entity&&this.updateBillboardImage()}},{key:"pixelOffset",get:function(){return this.options.pixelOffset},set:function(t){this.options.pixelOffset=Number(t),this.entity&&this.updateBillboardImage()}},{key:"updateBillboardImage",value:function(){var t,e,i,n=this;clearTimeout(qi(Zi,this)),t=Zi,e=this,i=setTimeout((function(){clearTimeout(qi(Zi,n)),n.entity.billboard.image=n.getcanvas()}),500),t.set(Xi(t,e),i)}},{key:"lineColor",get:function(){return this.options.pixelOffset},set:function(t){this.options.lineColor=t,this.entity&&(this.entity.billboard.image=this.getcanvas())}},{key:"backgroundColor",get:function(){return this.options.backgroundColor},set:function(t){this.options.backgroundColor=t,this.entity&&(this.entity.billboard.image=this.getcanvas())}},{key:"ground",get:function(){return this.options.ground},set:function(t){this.options.ground=t}},{key:"getcanvas",value:function(){var t=document.createElement("canvas"),e=t.getContext("2d");e.font=this.options.fontSize+"px serif";for(var i=this.options.text.split("\n"),n=0,o=0,s=0;sn&&(n=r),o+=this.options.fontSize}o=o+20+5*(i.length-1),n+=30,t.width=n,t.height=this.options.pixelOffset+o;var l=e.createLinearGradient(0,0,n,o+20);l.addColorStop(0,this.options.backgroundColor[0]),l.addColorStop(1,this.options.backgroundColor[1]),e.fillStyle=l,e.fillRect(0,0,n,o),e.fillStyle=this.options.color,e.font=this.options.fontSize+"px serif";for(var c=0;c0&&void 0!==arguments[0]?arguments[0]:{},e=null;if("object"==M()(t)&&null!==t)for(var i in e=t instanceof Array?[]:{},t)e[i]=$i(t[i]);else e=t;return e},Qi=function(){return k()((function t(e){C()(this,t),t.prototype.hasOwnProperty("color")||Object.defineProperties(t.prototype,{color:Cesium.createPropertyDescriptor("color")}),t.prototype.hasOwnProperty("speed")||Object.defineProperties(t.prototype,{speed:Cesium.createPropertyDescriptor("speed")}),t.prototype.hasOwnProperty("transparency")||Object.defineProperties(t.prototype,{transparency:Cesium.createPropertyDescriptor("transparency")}),t.prototype.hasOwnProperty("count")||Object.defineProperties(t.prototype,{count:Cesium.createPropertyDescriptor("count")}),t.prototype.hasOwnProperty("gradient")||Object.defineProperties(t.prototype,{gradient:Cesium.createPropertyDescriptor("gradient")}),this._definitionChanged=new Cesium.Event,this._speed=void 0,this.id=e.id,this.color=e.color||new Cesium.Color(1,1,1,1),this.colors=e.colors||{},this.speed=e.speed,this.transparency=e.transparency,this.count=e.count,this.gradient=e.gradient;var i="",n=[];for(var o in this.colors)Object.hasOwnProperty.call(this.colors,o)&&n.push(o);n.sort((function(t,e){return e-t}));for(var s=0;s 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(t){return!0}})}),[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return this._CircleRippleMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.transparency=this.transparency,e.count=this.count,e.gradient=this.gradient,e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(t){return this===t||t instanceof CircleRippleMaterialProperty&&Cesium.Property.equals(this._color,t._color)&&Cesium.Property.equals(this._speed,t._speed)&&Cesium.Property.equals(this.count,t.count)&&Cesium.Property.equals(this.transparency,t.transparency)&&Cesium.Property.equals(this.gradient,t.gradient)}}])}();function tn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function en(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function on(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};C()(this,e),(i=sn(this,e,[t,n])).options.lng=n.lng,i.options.lat=n.lat,i.options.color=n.color||"#1FA8E3",i.options.colors=n.colors||[],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}];for(var s=0;s999999&&(i.options.circle[s].radius=999999);i.options.show=!n.show&&!1!==n.show||n.show,i.event=new J(i.sdk),i.options.positionEditin=!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,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||["#42c6ef","#42c6ef"],lineColor:n.label.lineColor||"#fff000",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.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",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.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.attributeType=n.attributeType||"richText";for(var a=0,r=0;ra&&(a=Number(i.options.circle[r].radius));return i._radius=a,i.Dialog=o,i._EventBinding=new Si,i.sdk.addIncetance(i.options.id,i),e.create(i),i}return gi()(e,t),k()(e,[{key:"type",get:function(){return"CircleDiffuse"}},{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t?(this.options.show=t,this.entity.show=t,It(this.sdk,this.options.id),Et(this.sdk,this.options.id),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),this.options.label.show&&(this.label.show=t)):console.error("参数必须为boolean")}},{key:"positionEditing",get:function(){return this.options.positionEditing},set:function(t){var e=this;this.options.positionEditing=t,!0===t?(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(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=t.lng,e.lat=t.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1}}))}))):(setTimeout((function(){e.picking=!0}),500),this.label&&(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:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t,this.label.position=[t,this.lat],this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t,this.label.position=[this.lng,t],this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"radius",get:function(){return this._radius}},{key:"circle",get:function(){return this.options.circle},set:function(t){this.options.circle=t||[{radius:10}];for(var e=0;e999999&&(this.options.circle[e].radius=999999);this._createCircleElm()}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t,e.create(this),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t}))}},{key:"transparency",get:function(){return this.options.transparency},set:function(t){this.options.transparency=t>1?1:t,e.create(this),this._elms.transparency&&this._elms.transparency.forEach((function(e){e.value=t}))}},{key:"count",get:function(){return this.options.count},set:function(t){this.options.count=t>99?99:t,e.create(this),this._elms.count&&this._elms.count.forEach((function(e){e.value=t}))}},{key:"colors",get:function(){return this.options.colors},set:function(t){this.options.colors=t,e.create(this)}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){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(t){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(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(255,255,255,1)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var o=0;o\n
        '+this.options.attribute.vr.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==u[0]?u[0]:{},ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=en({},this.options.position):this.options.positions?r=en({},this.options.positions[0]):this.options.center?r=en({},this.options.center):this.options.start?r=en({},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")){t.next=16;break}return t.next=15,this.getClampToHeight(r);case 15:r.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.next=27;break;case 23:return t.next=25,this.getClampToHeight({lng:this.options.lng,lat:this.options.lat});case 25:c=t.sent,this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,6*this.radius+c),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},duration:1});case 27:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"edit",value:(o=a()(l.a.mark((function t(e){var i,n,o,s,a,r,c=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=28;break}return t.next=6,new bi(this.sdk,this.options,{title:"扩散光波属性",left:"180px",top:"100px",confirmCallBack:function(t){c.name=c.name.trim(),c.name||(c.name="未命名对象"),c.options.label.position={lng:c.label.position[0],lat:c.label.position[1],alt:c.label.position[2]},c.originalOptions=c.deepCopyObj(c.options),c._DialogObject.close(),c.Dialog.confirmCallBack&&c.Dialog.confirmCallBack(c.originalOptions),It(c.sdk,c.options.id),Et(c.sdk,c.options.id)},resetCallBack:function(){c.reset(),c.Dialog.resetCallBack&&c.Dialog.resetCallBack()},removeCallBack:function(){c.Dialog.removeCallBack&&c.Dialog.removeCallBack()},closeCallBack:function(){c.reset(),c.positionEditing=!1,c.Dialog.closeCallBack&&c.Dialog.closeCallBack()},showCallBack:function(t){c.options.show=t,c.originalOptions.show=t,c.show=t,c.Dialog.showCallBack&&c.Dialog.showCallBack()},translationalCallBack:function(){c.positionEditing=!c.positionEditing}},!0);case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" circle-ciffuse",(i=document.createElement("div")).innerHTML=Wi(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 Di("circle-diffuse-edit-tabs",void 0,this.sdk),n=new ewPlugins("colorpicker",{el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelColor=t},clear:function(){c.labelColor="rgba(255,255,255,1)"}}),o=new ewPlugins("colorpicker",{el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelLineColor=t},clear:function(){c.labelLineColor="rgba(255,255,255,1)"}}),s=new ewPlugins("colorpicker",{el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelBackgroundColorStart=t},clear:function(){c.labelBackgroundColorStart="rgba(255,255,255,1)"}}),a=new ewPlugins("colorpicker",{el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelBackgroundColorEnd=t},clear:function(){c.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),r=i.getElementsByTagName("*"),this._EventBinding.on(this,r),this._elms=this._EventBinding.element,this._elms.labelColor=[n],this._elms.labelLineColor=[o],this._elms.labelBackgroundColorStart=[s],this._elms.labelBackgroundColorEnd=[a],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 t=U(c._DialogObject._element.content.getElementsByClassName("input-radius-unit-box")[0],".input-radius-unit");if(t){t.legp_search([{name:"米",value:"米"},{name:"千米",value:"千米"}]);var e=c._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0];e.value="米",e.addEventListener("input",(function(){var t=c._DialogObject._element.content.getElementsByClassName("circle-content-box")[0].getElementsByClassName("input-number");switch(e.value){case"米":for(var i=0;it&&(t=Number(this.options.circle[i].radius));this._radius=t,e.create(this)}}},{key:"remove",value:(n=a()(l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return 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(),t.next=10,this.sdk.removeIncetance(this.options.id);case 10:return t.next=12,It(this.sdk,this.options.id);case 12:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_createCircleElm",value:function(){var t=this;if(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content){var i=this._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0],n=i?i.value:"米",o=this._DialogObject._element.content.getElementsByClassName("circle-content-box")[0];o.innerHTML="";for(var s=function(i){var s=document.createElement("div");s.className="row";var a="",r='';0===i&&i===t.options.circle.length-1&&(r=""),i===t.options.circle.length-1&&(a=''),s.innerHTML='\n
        \n 半径\n
        \n \n '.concat("米"===n?"m":"km",'\n \n
        \n
        \n
        \n
        \n 扩散颜色\n
        \n
        \n ').concat(a,"\n ").concat(r,"\n
        \n ");var l=s.getElementsByClassName("input")[0];l.value=t.options.circle[i].radius/("米"===n?1:1e3),l.addEventListener("input",(function(n){var o=t._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(n.target.value||0===n.target.value){var s=n.target.value;if(s=Number(s),"."!=n.data&&("-"!=n.data||n.target.value)&&(!n.target.max&&!n.target.min||s<=Number(n.target.max)/("米"===o?1:1e3)&&s>=Number(n.target.min))){s="米"===o?Math.floor(100*s)/100:Math.floor(1e5*s)/1e5,t.options.circle[i].radius=s*("米"===o?1:1e3);for(var a=0,r=0;ra&&(a=Number(t.options.circle[r].radius));t._radius=a,l.value=s,e.create(t)}}})),l.addEventListener("blur",(function(n){var o=t._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(n.target.value||0===n.target.value){var s=n.target.value;s=Number(s),n.target.max&&s>Number(n.target.max)/("米"===o?1:1e3)&&(s=Number(n.target.max)/("米"===o?1:1e3)),n.target.min&&sa&&(a=Number(t.options.circle[r].radius));t._radius=a,l.value=s,e.create(t)}}));new ewPlugins("colorpicker",{el:s.getElementsByClassName("color")[0],size:"mini",alpha:!1,defaultColor:t.options.circle[i].color,disabled:!1,openPickerAni:"opacity",sure:function(n){t.options.circle[i].color=n,e.create(t)},clear:function(){t.options.circle[i].color="rgba(255,255,255,1)",e.create(t)}});var c=s.getElementsByClassName("circle-minus")[0];c&&c.addEventListener("click",(function(){t.options.circle.splice(i,1);for(var n=0,o=0;on&&(n=Number(t.options.circle[o].radius));t._radius=n,e.create(t),t._createCircleElm()}));var u=s.getElementsByClassName("circle-add")[0];u&&u.addEventListener("click",(function(){t.options.circle.push({radius:0,color:"rgba(255,255,255,1)"});for(var i=0,n=0;ni&&(i=Number(t.options.circle[n].radius));t._radius=i,e.create(t),t._createCircleElm()})),o.appendChild(s)},a=0;a0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.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=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}}],[{key:"create",value:function(t){for(var i={},n=0;n\n
        \n
        \n
        \n 名称\n \n
        \n
        \n 扫描颜色\n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 经度\n \n
        \n
        \n 扫描半径\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n 纬度\n \n
        \n
        \n 扫描速度\n \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(zi(t),'\n \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n
        \n
        \n
        \n \n ')}function ln(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function cn(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function pn(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(i=hn(this,e,[t,n])).options.lng=n.lng,i.options.lat=n.lat,i.options.color=n.color||"#FFEB3B",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 J(i.sdk),i.options.positionEditin=!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,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||["#42c6ef","#42c6ef"],lineColor:n.label.lineColor||"#fff000",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.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",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.Dialog=o,i._EventBinding=new Si,i.sdk.addIncetance(i.options.id,i),e.create(i),i}return gi()(e,t),k()(e,[{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t?(this.options.show=t,this.entity.show=t,this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),this.options.label.show&&(this.label.show=t),It(this.sdk,this.options.id),Et(this.sdk,this.options.id)):console.error("参数必须为boolean")}},{key:"positionEditing",get:function(){return this.options.positionEditing},set:function(t){var e=this;this.options.positionEditing=t,!0===t?(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(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=t.lng,e.lat=t.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1}}))}))):(setTimeout((function(){e.picking=!0}),500),this.label&&(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:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t,this.label.position=[t,this.lat],this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t,this.label.position=[this.lng,t],this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"radius",get:function(){return this.options.radius},set:function(t){var e=Number(t.toFixed(2));(e>999999&&(e=999999),this.options.radius=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content)&&("千米"===this._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value&&(e=Number((e/1e3).toFixed(5))));this._elms.radius&&this._elms.radius.forEach((function(t){t.value=e}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t,this.changeMaterial(),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t}))}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.changeMaterial(),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){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(t){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(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(255,255,255,1)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var o=0;o\n
        '+this.options.attribute.vr.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==u[0]?u[0]:{},ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=cn({},this.options.position):this.options.positions?r=cn({},this.options.positions[0]):this.options.center?r=cn({},this.options.center):this.options.start?r=cn({},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")){t.next=16;break}return t.next=15,this.getClampToHeight(r);case 15:r.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.next=27;break;case 23:return t.next=25,this.getClampToHeight({lng:this.options.lng,lat:this.options.lat});case 25:c=t.sent,this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,6*this.options.radius+c),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},duration:1});case 27:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"edit",value:(o=a()(l.a.mark((function t(e){var i,n,o,s,a,r,c,u,p=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=34;break}return t.next=6,new bi(this.sdk,this.options,{title:"雷达光波属性",left:"180px",top:"100px",confirmCallBack:function(t){p.name=p.name.trim(),p.name||(p.name="未命名对象"),p.options.label.position={lng:p.label.position[0],lat:p.label.position[1],alt:p.label.position[2]},p.originalOptions=p.deepCopyObj(p.options),p._DialogObject.close(),p.Dialog.confirmCallBack&&p.Dialog.confirmCallBack(p.originalOptions),It(p.sdk,p.options.id),Et(p.sdk,p.options.id)},resetCallBack:function(){p.reset(),p.Dialog.resetCallBack&&p.Dialog.resetCallBack()},removeCallBack:function(){p.Dialog.removeCallBack&&p.Dialog.removeCallBack()},closeCallBack:function(){p.reset(),p.positionEditing=!1,p.Dialog.closeCallBack&&p.Dialog.closeCallBack()},showCallBack:function(t){p.options.show=t,p.originalOptions.show=t,p.show=t,p.Dialog.showCallBack&&p.Dialog.showCallBack()},translationalCallBack:function(){p.positionEditing=!p.positionEditing}},!0);case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" radar-scan",(i=document.createElement("div")).innerHTML=rn(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,new Di("radar-scan-edit-tabs",void 0,this.sdk),n=new ewPlugins("colorpicker",{el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){p.color=t},clear:function(){p.color="rgba(255,255,255,1)"}}),o=new ewPlugins("colorpicker",{el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelColor=t},clear:function(){p.labelColor="rgba(255,255,255,1)"}}),s=new ewPlugins("colorpicker",{el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelLineColor=t},clear:function(){p.labelLineColor="rgba(255,255,255,1)"}}),a=new ewPlugins("colorpicker",{el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelBackgroundColorStart=t},clear:function(){p.labelBackgroundColorStart="rgba(255,255,255,1)"}}),r=new ewPlugins("colorpicker",{el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelBackgroundColorEnd=t},clear:function(){p.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=[a],this._elms.labelBackgroundColorEnd=[r],(u=this._DialogObject._element.content.getElementsByClassName("input-radius")[0].getElementsByTagName("input")[0]).value=this.options.radius,this._elms.radius=[u],u.addEventListener("input",(function(t){var e=p._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;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)/("米"===e?1:1e3)&&i>=Number(t.target.min))&&(p.radius=i*("米"===e?1:1e3))}})),u.addEventListener("blur",(function(t){var e=p._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(t.target.value||0===t.target.value){var i=t.target.value;i=Number(i),t.target.max&&i>Number(t.target.max)/("米"===e?1:1e3)&&(i=Number(t.target.max)/("米"===e?1:1e3)),t.target.min&&i0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.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=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}}],[{key:"create",value:function(t){var i=function(t){if(/^#/.test(t)){var e=t.replace("#",""),i=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),o=parseInt(e.substring(4,6),16),s=parseInt(e.substring(6,8),16);s||0===s?s/=255:s=1,t="rgba(".concat(i,",").concat(n,",").concat(o,",").concat(s,")")}var a=t.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}(t.options.color),n="rgba(".concat(i[0],",").concat(i[1],",").concat(i[2],",1)");t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(t.options.lng,t.options.lat)}),!1),name:"雷达扫描",ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(){return t.options.radius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(){return t.options.radius}),!1),material:new Cesium.RadarScanMaterialProperty({color:Cesium.Color.fromCssColorString(n),transparency:i[3],speed:t.options.speed}),zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,"cesium-viewer 2d"===t.sdk.viewer._element.className&&(t.entity.ellipse.height=1e6),e.createLabel(t),It(t.sdk,t.options.id),t.options.show&>(0,t.options.id)}},{key:"createLabel",value:(i=a()(l.a.mark((function t(e){var i;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getClampToHeight({lng:e.options.lng,lat:e.options.lat});case 2:i=t.sent,e.options.label.position||(e.options.label.position={lng:e.options.lng,lat:e.options.lat,alt:i}),e.label=new Ki(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:!0});case 5:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"createBy2D",value:function(t){t.entity=new Cesium.EntityCollection;var i=0,n=r(t.options,t.options.radius,i),o=(new Date).getTime();t.viewer.clock.onTick.addEventListener((function(){var e=(new Date).getTime(),s=t.options.duration?360/t.options.duration:0,a=(e-o)*s;o=e,i+=a,n=r(t.options,t.options.radius,i)}));var s=t.sdk.viewer.entities.add({show:t.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){var e=t.createCircle({lng:t.options.lng,lat:t.options.lat},t.options.radius);return Cesium.Cartesian3.fromDegreesArray(e)}),!1),width:2,material:Cesium.Color.fromCssColorString(t.options.color),clampToGround:!0}}),a=t.sdk.viewer.entities.add({show:t.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArray(n)}),!1),width:2,material:Cesium.Color.fromCssColorString(t.options.color),clampToGround:!0}});function r(t,e,i){var n=t.lng,o=t.lat,s=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(n,o,0)),a=e*Math.cos(i*Math.PI/180),r=e*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)]}t.entity.add(s),t.entity.add(a),t.sdk.viewer.entities.add(t.entity),e.createLabel(t),It(t.sdk,t.options.id)}}]);var i,n,o,s}(Ui);function mn(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return fn(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?fn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function fn(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(i=yn(this,e,[t,n])).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.isSelect=n.billboard.isSelect||!1,i.options.billboard.show=!n.billboard.show&&!1!==n.billboard.show||n.billboard.show,i.options.billboard.image=n.billboard.image||se(n.billboard.defaultImage),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.fontSize=n.label.fontSize||39,i.options.label.color=n.label.color||"#FFFF00",i.options.positions=n.positions=n.positions||{},i.options.positions.lng=Number(Number(n.positions.lng||0).toFixed(8)),i.options.positions.lat=Number(Number(n.positions.lat||0).toFixed(8)),i.options.positions.alt=Number(Number(n.positions.alt||0).toFixed(2)),i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",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.attributeType=n.attributeType||"richText",i.options.coordinate=n.coordinate||"",i.operate={},i._elms={},i.previous={positions:gn({},i.options.positions)},i.entity,i._proj=i.sdk.proj,i.sdk.addIncetance(i.options.id,i),e.create(i),i.picking=!0,i.Dialog=o,i._EventBinding=new Si,i}return gi()(e,t),k()(e,[{key:"type",get:function(){return"BillboardObject"}},{key:"selectBillboard",value:function(){var t=this;this.sdk.viewer.screenSpaceEventHandler.setInputAction((function(e){var i=t.sdk.viewer.scene.pick(e.position);Cesium.defined(i)&&"airportBillboard"===i.id.id?t.entity.billboard.color=Cesium.Color.YELLOW:t.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(t){this.options.show=t,this.originalOptions.show=t,this.entity&&(this.entity.show=t),It(this.sdk,this.options.id),Et(this.sdk,this.options.id),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t)}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var e;this.options.heightMode=t||0,this.options.heightMode=t||0==t?t:3;var i,n="";switch(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(i=this._DialogObject._element.content.getElementsByClassName("alt-box")[0]),this.options.heightMode){case"0":case 0:i&&(i.className="input-number input-number-unit-1 alt-box"),this._elms.height&&(this._elms.height.style.display="flex"),e=Cesium.HeightReference.NONE,n="海拔高度";break;case"1":case 1:i&&(i.className="input-number input-number-unit-1 alt-box"),this._elms.height&&(this._elms.height.style.display="flex"),e=Cesium.HeightReference.NONE,n="相对地表";break;case"2":case 2:i&&(i.className="input-number input-number-unit-1 alt-box disabled"),n="依附地表",i&&(i.className="input-number input-number-unit-1 alt-box disabled"),n="依附地表",e=Cesium.HeightReference.CLAMP_TO_GROUND,this._elms.height&&(this._elms.height.style.display="none");break;case"3":case 3:i&&(i.className="input-number input-number-unit-1 alt-box disabled"),this._elms.height&&(this._elms.height.style.display="none"),e=Cesium.HeightReference.NONE,n="依附模型"}this.entity&&(this.entity.billboard.heightReference=e,this.entity.label.heightReference=e),this._elms.heightMode&&(this._elms.heightMode.value=n)}},{key:"labelText",get:function(){return this.options.label.text},set:function(t){this.options.label.text=t,this.options.name=t,this.entity&&(this.entity.label.text=t+""),this._elms.labelText&&this._elms.labelText.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.positions.lng},set:function(t){this.options.positions.lng=Number(Number(t).toFixed(8)),this.renewPoint(),this.coordinate=this.options.coordinate,this._projConvert&&this._projConvert(),this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.positions.lat},set:function(t){this.options.positions.lat=Number(Number(t).toFixed(8)),this.renewPoint(),this.coordinate=this.options.coordinate,this._projConvert&&this._projConvert(),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.positions.alt},set:function(t){var e=this;if(this.options.positions.alt=Number(Number(t).toFixed(2)),this.renewPoint(),this.coordinate=this.options.coordinate,this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.positions.alt})),this._elms.height){var i=this._elms.height.getElementsByClassName("height")[0];if(i)switch(this._elms.heightMode.value){case"海拔高度":i.value=this.options.positions.alt;break;case"相对地表":this.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.positions.lng,this.options.positions.lat)]).then((function(t){i.value=Number((e.options.positions.alt-t[0].height).toFixed(2))})):i.value=Number(Number(this.options.positions.alt).toFixed(2));break;case"依附地表":case"依附地表":break;case"依附模型":this.updateHeight()}}}},{key:"near",get:function(){return this.options.near},set:function(t){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(t){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(t){this.options.scaleByDistance=t,this.renewPoint(),this._elms.scaleByDistance&&this._elms.scaleByDistance.forEach((function(e){e.checked=t}))}},{key:"billboardShow",get:function(){return this.options.billboard.show},set:function(t){this.options.billboard.show=t,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(e){e.value=t}))}},{key:"billboardImage",get:function(){return this.options.billboard.image},set:function(t){var e=this;this.options.billboard.image=t;var i=this.options.billboard.image||se(this.options.billboard.defaultImage)||this.getSourceRootPath()+"/img/A-ablu-blank.png";this._elms.billboardImage&&this._elms.billboardImage.forEach((function(t){t.src=i}));var n=new Image;n.src=i;var o=36,s=document.createElement("canvas");n.onload=function(){var t=n.width/n.height;n.width=100,n.height=100/t;var i=n.width,a=n.height,r=s.getContext("2d",{willReadFrequently:!0});s.width=i,s.height=a,r.drawImage(n,0,0,i,a),o=a*(31/i),e.entity.billboard.imgWidth=i,e.entity.billboard.imgHeight=a,e.entity&&(e.entity.billboard.image=s),e.entity.billboard.height=new Cesium.CallbackProperty((function(){return o}),!1),e.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return e.options.billboard.show?new Cesium.Cartesian2(0,-o*e.options.billboard.scale-e.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-e.options.label.fontSize/2-5)}),!1),o=a*(31/i)}}},{key:"billboardScale",get:function(){return this.options.billboard.scale},set:function(t){this.options.billboard.scale=t,this.renewPoint(),this._elms.billboardScale&&this._elms.billboardScale.forEach((function(e){e.value=t}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.entity&&(this.entity.label.show=t),this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.value=t}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.renewPoint(),this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.renewPoint(),this._elms.labelColor&&this._elms.labelColor.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[n]=o}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var o=0;o\n
        '+this.options.attribute.vr.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==f[0]&&f[0],i=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=41;break}return t.next=7,new bi(this.sdk,this.options,{title:"点属性",left:"180px",top:"100px",confirmCallBack:function(t){m.labelText=m.labelText.trim(),m.labelText||(m.labelText="未命名对象"),m.originalOptions=m.deepCopyObj(m.options),m._DialogObject.close(),m.Dialog.confirmCallBack&&m.Dialog.confirmCallBack(m.originalOptions),It(m.sdk,m.options.id),Et(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.positionEditing=!1,setTimeout((function(){m.reset(),m.Dialog.closeCallBack&&m.Dialog.closeCallBack()}),0)},showCallBack:function(t){m.show=t,m.Dialog.showCallBack&&m.Dialog.showCallBack()},translationalCallBack:function(){m.positionEditing=!m.positionEditing},updateHeightCallBack:function(){m.updateHeight()}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" billboard-object",(n=document.createElement("div")).innerHTML=Fi(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 Di("point-object-edit-tabs",void 0,this.sdk),s=new ewPlugins("colorpicker",{el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelColor=t},clear:function(){m.labelColor="rgba(255,255,255,1)"}}),r=n.getElementsByTagName("*"),this._EventBinding.on(this,r),this._elms=this._EventBinding.element,this._elms.labelColor=[s],setTimeout(a()(l.a.mark((function t(){var e,i,n,s,a,r,c,u,p,h,d,f,v,g,y,b;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(m.attributeLink=m.options.attribute.link.content,m.attributeVr=m.options.attribute.vr.content,m.cameraSelect&&m.cameraSelect(),m.ISCSelect&&m.ISCSelect(),m.goodsSelect&&m.goodsSelect(),e=m.attributeSelect,!(i=m._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0])){t.next=21;break}(n=U(i,".attribute-select")).legp_search(e),s=m._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],a=0;case 12:if(!(a=0)){t.next=19;break}if(!p[h].position){t.next=16;break}return u=p[h],t.abrupt("break",19);case 16:h--,t.next=12;break;case 19:return u&&u.position&&(i=this.cartesian3Towgs84(u.position,this.sdk.viewer).alt),t.prev=20,t.next=23,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.positions.lng,this.options.positions.lat)]);case 23:d=t.sent,t.next=28;break;case 26:t.prev=26,t.t0=t.catch(20);case 28:if((void 0===i||i0&&void 0!==u[0]?u[0]:{},ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=gn({},this.options.position):this.options.positions?r=gn({},this.options.positions):this.options.center?r=gn({},this.options.center):this.options.start?r=gn({},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")){t.next=16;break}return t.next=15,this.getClampToHeight(r);case 15:r.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.next=27;break;case 23:return t.next=25,this.getClampToHeight(this.options.positions);case 25:c=t.sent,this.sdk.viewer.camera.flyTo({orientation:e.orientation,destination:Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat,c+(e.height||500))});case 27:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"setPosition",value:function(t){this.options.positions.lng=t.position.lng,this.options.positions.lat=t.position.lat,this.options.positions.alt=t.position.alt,this.renewPoint()}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.operate.positionEditing=t,this.event&&this.event.destroy(),this.event=new J(this.sdk),!0===t){this.picking=!1,this.tip&&this.tip.destroy(),this.tip=new q("点击鼠标左键确认,右键取消",this.sdk),this.previous={positions:gn({},this.options.positions)};var i=function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.alt=n.alt,e.previous={positions:gn({},e.options.positions)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.entity.position=new Cesium.CallbackProperty((function(){return i}),!1),e.positionEditing=!1};this.event.mouse_move((function(t,i){e.entity.position=new Cesium.CallbackProperty((function(){return i}),!1),e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left(i),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,n){var o=new Date;e.event.gesture_pinck_end((function(){var s=new Date;t.position1.x,t.position2.x,t.position1.y,t.position2.y;s-o>=500?e.positionEditing=!1:i(0,n)}))}))}else 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.positions.lng,this.lat=this.previous.positions.lat,this.alt=this.previous.positions.alt,this.renewPoint()}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}},{key:"setCustomView",value:(i=a()(l.a.mark((function t(e){var i,n,o,s;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=4;break}this.options.customView=e,t.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=gn({},n),this.options.positions?o=gn({},this.options.positions):(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")){t.next=13;break}return t.next=12,this.getClampToHeight(o);case 12:o.alt=t.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 t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})}],[{key:"create",value:function(t){var e=t.options.positions;t.originalOptions=t.deepCopyObj(t.options);var i=new Image;i.src=t.options.billboard.image||t.getSourceRootPath()+"/img/A-ablu-blank.png";var n,o=36;switch(t.options.heightMode){case 2:case"2":n=Cesium.HeightReference.CLAMP_TO_GROUND}var s=document.createElement("canvas");i.onload=function(){var e=i.width/i.height;i.width=100,i.height=100/e;var n=i.width,a=i.height,r=s.getContext("2d");s.width=n,s.height=a,r.drawImage(i,0,0,n,a),o=a*(31/n),t.entity&&(t.entity.billboard.imgWidth=n,t.entity.billboard.imgHeight=a,t.entity.billboard.image=s,be(t.sdk,t.entity))},t.entity=new Cesium.Entity({show:t.options.show,id:t.options.id,position:Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt),billboard:{image:s,scale:t.options.billboard.scale,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ae()?void 0:1e8}),!1),heightReference:n,color:t.options.billboard.show?void 0:new Cesium.Color(1,1,1,0),width:31,height:new Cesium.CallbackProperty((function(){return o}),!1),verticalOrigin:Cesium.VerticalOrigin.BOTTOM},label:{show:t.options.label.show,text:t.options.label.text,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ae()?void 0:1e8}),!1),heightReference:n,font:t.options.label.fontSize+"px Helvetica",fillColor:Cesium.Color.fromCssColorString(t.options.label.color),pixelOffset:new Cesium.CallbackProperty((function(){return t.options.billboard.show?new Cesium.Cartesian2(0,-o*t.options.billboard.scale-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}}),t.entity.billboard.imgWidth=31,t.entity.billboard.imgHeight=36,t.entity.position=Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt),3==t.options.heightMode&&t.updateHeight(),t.renewPoint(),It(t.sdk,t.options.id),t.options.show&>(0,t.options.id),t.options.billboard.isSelect&&t.selectBillboard()}}]);var i,n,s,r,c}(Ui);function Cn(t){return'\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n 投影面积:\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(zi(t),'\n \n \n
        \n
        \n 高度模式\n
        \n
        \n
        \n Z值统一增加\n
        \n \n m\n \n
        \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        经度(X)
        \n
        纬度(Y)
        \n
        高度(Z)
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n 面颜色\n
        \n
        \n
        \n 描边颜色\n
        \n
        \n
        \n 描边宽度\n
        \n \n px\n \n
        \n
        \n
        \n
        \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n
        \n
        \n
        \n \n ')}function wn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function kn(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(C()(this,e),(i=En(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#36c4ff",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||2,i.options.line.color=i.options.line.color||"rgba(155, 155, 124, 0.89)",i.options["area-unit"]=n["area-unit"]||"平方米",i.entity,i.event=new J(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,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||["#42c6ef","#42c6ef"],lineColor:n.label.lineColor||"#fff000",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.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-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var o=0;o\n
        '+this.options.attribute.vr.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c'.concat(i+1,'\n
        \n
        \n
        \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 p=o.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);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),e.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),e.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})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.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(h),n._elms.altInput.push(d),t.appendChild(o)},o=0;o0&&void 0!==v[0]?v[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=kn({},this.options.position):this.options.positions?r=kn({},this.options.positions[0]):this.options.center?r=kn({},this.options.center):this.options.start?r=kn({},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")){t.next=18;break}return t.next=17,this.getClampToHeight(r);case 17:r.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.next=51;break;case 25:c=[],t.t0=this.heightMode,t.next=0===t.t0||"0"===t.t0?29:1===t.t0||"1"===t.t0?31:2===t.t0||"2"===t.t0?33:35;break;case 29:case 31:return u=!1,t.abrupt("break",35);case 33:return u=!0,t.abrupt("break",35);case 35:if(!u){t.next=48;break}p=0;case 37:if(!(p=500?i.positionEditing=!1:y(0,e)}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(n.positions)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(N()(n.positions),[n.positions[0],n.positions[1]])}),!1)}else{this.previous?this.positions=N()(this.previous.positions):this.previous={positions:N()(this.positions)},this.label&&(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 b=[[]],C=0;C0?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(N()(o),[o[0],o[1]])}),!1)}},{key:"renewPositions",value:function(){var t=this;if(!this._error){for(var e=!1,i=[],n=this.options.positions,o=0;o0&&void 0!==p[0]?p[0]:{domid:"",x:10,y:10}).x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10,i=[[]],n=0;nNumber(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i1&&void 0!==arguments[1]?arguments[1]:function(){};t.positionEditing=!1,setTimeout((function(){if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n,o=function(){var e=a()(l.a.mark((function e(){var i,n,o;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=0;case 1:if(!(i=500?h():p(o,i)}))})),t.entity.polyline.clampToGround=!0,t.entity.polyline.arcType=Cesium.ArcType.GEODESIC,t.entity.polygon.perPositionHeight=!1,t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(s)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){return s.length>=3?[].concat(N()(s),[s[0],s[1],s[2]]):s}),!1),t.options.positions.length<3)t.getClampToHeight({lng:t.options.positions[0].lng,lat:t.options.positions[0].lat}).then((function(e){t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,e]}));else{for(var d=[[]],m=0;m\n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n
        \n 原始长度:\n \n
        \n
        \n
        \n
        \n
        \n 拟合长度:\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(zi(t),'\n \n \n
        \n
        \n 高度模式\n
        \n
        \n
        \n Z值统一增加\n
        \n \n m\n \n
        \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        经度(X)
        \n
        纬度(Y)
        \n
        高度(Z)
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n 线条颜色\n
        \n
        \n
        \n 线条宽度\n
        \n \n px\n \n
        \n
        \n
        \n 线条形式\n
        \n
        \n
        \n
        \n
        \n 首尾相连\n \n
        \n
        \n 线段圆滑\n \n
        \n
        \n
        \n
        \n
        \n
        \n 线段缓冲\n \n
        \n
        \n 缓冲宽度\n
        \n \n m\n \n
        \n
        \n
        \n 缓冲颜色\n
        \n
        \n
        \n
        \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n \x3c!-- --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!-- 指令--\x3e\n \x3c!-- --\x3e\n \x3c!-- --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!-- --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!-- 设置操作点--\x3e\n \x3c!-- --\x3e\n \x3c!-- --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n
        \n
        \n
        \n \n ')}function Pn(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return On(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?On(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function On(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);iNumber(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i1&&void 0!==arguments[1]?arguments[1]:{};C()(this,t),this.sdk=e,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 J(this.sdk)}),[{key:"position",get:function(){return this.options.position},set:function(t){this.options.position=t,this.againArrow(),this.againCircle()}},{key:"rotate",get:function(){return this.options.rotate},set:function(t){this.options.rotate=t}},{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},Bn(Bn({},this.options.position),this.options.rotate)}},{key:"editTranslational",value:(i=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c,u,p,h,d,m,f,v,g,y,b=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.destroy(),this.activeState="translational",this.MapEvent=new J(this.sdk),e=this,i=this.initParam(),n=i.lng,o=i.lat,s=i.alt,a=this.viwer,this.origin=Cesium.Cartesian3.fromDegrees(n,o,s),r=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,r),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),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(n,o,s)),h=a.camera.position,d=Cesium.Cartesian3.distance(h,this.origin),m=d/15,Cesium.Matrix4.multiplyByScale(p,new Cesium.Cartesian3(m,m,m),p),f=this.createAxisArrow("model_edit_xAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(1,0,0)],p,Cesium.Color.RED),v=this.createAxisArrow("model_edit_yAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,1,0)],p,Cesium.Color.LIME),g=this.createAxisArrow("model_edit_zAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,0,1)],p,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},this.MapEvent.mouse_move((function(t,i){if(e.activeAxis){var n=t.startPosition.y-t.endPosition.y,o={x:t.endPosition.x-y.x,y:t.endPosition.y-y.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=b.initParam(),p=90+Cesium.Math.toDegrees(Math.asin(l.z)),h=Cesium.Cartographic.fromCartesian(a.camera.position).height,d=b.activeModelParam.alt,m=h/Math.cos(Cesium.Math.toRadians(p));new Cesium.EllipsoidGeodesic(Cesium.Cartographic.fromCartesian(r),Cesium.Cartographic.fromCartesian(a.camera.position)),r=Cesium.Ray.getPoint(s,m*(1-d/h));var f=Cesium.Cartographic.fromCartesian(r),v=Cesium.Math.toDegrees(f.longitude),g=Cesium.Math.toDegrees(f.latitude);switch(e.activeAxis._name){case"model_edit_xAxis":b._params.tx=v,b._params.ty=b.activeModelParam.lat,b._params.tz=d,b.origin=Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt);var C=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(b.origin,Cesium.Cartesian3.fromDegrees(u.lng-.001,u.lat,u.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),w=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(b.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat-.001,u.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),k=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(b.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);b.rayX=new Cesium.Ray(b.origin,C),b.rayY=new Cesium.Ray(b.origin,w),b.rayZ=new Cesium.Ray(b.origin,k);break;case"model_edit_yAxis":b._params.tx=b.activeModelParam.lng,b._params.ty=g,b._params.tz=d,b.origin=Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt);var _=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(b.origin,Cesium.Cartesian3.fromDegrees(u.lng-.001,u.lat,u.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),x=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(b.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat-.001,u.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),E=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(b.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);b.rayX=new Cesium.Ray(b.origin,_),b.rayY=new Cesium.Ray(b.origin,x),b.rayZ=new Cesium.Ray(b.origin,E);break;case"model_edit_zAxis":b.activeModelParam.alt+=Cesium.Cartesian3.distance(a.camera.position,Cesium.Cartesian3.fromDegrees(b.options.position.lng,b.options.position.lat,b.options.position.alt))/4300*n*3,b._params.tx=b.activeModelParam.lng,b._params.ty=b.activeModelParam.lat,b._params.tz=b.activeModelParam.alt,b.origin=Cesium.Cartesian3.fromDegrees(u.lng,u.lat,b.activeModelParam.alt);var S=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(b.origin,Cesium.Cartesian3.fromDegrees(u.lng-.001,u.lat,b.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),D=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(b.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat-.001,b.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),P=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(b.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat,b.activeModelParam.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);b.rayX=new Cesium.Ray(b.origin,S),b.rayY=new Cesium.Ray(b.origin,D),b.rayZ=new Cesium.Ray(b.origin,P)}e.updateModel(b._params.tx,b._params.ty,b._params.tz,b._params.rx,b._params.ry,b._params.rz),b.againArrow()}else{for(var O=e.coordArrows,M=0;M=0;N--){var B=T[N];if(B&&B.primitive&&B.id)switch(B.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return void(B.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_down((function(t,i){var n=a.scene.cartesianToCanvasCoordinates(b.origin);y.x=t.position.x-Math.floor(n.x),y.y=t.position.y-Math.floor(n.y);for(var o=a.scene.drillPick(t.position,10),s=o.length-1;s>=0;s--){var r=o[s];if(r&&r.primitive&&r.primitive._name)if(e.activeAxis)e.activeAxis=null,e.activeModelParam=null,e.controllerCallBack;else switch(r.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return a.scene.screenSpaceCameraController.enableRotate=!1,e.activeAxis=r.primitive,e.activeModelParam=e.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(t){a.scene.screenSpaceCameraController.enableRotate=!0;for(var i=0;i360&&(D._params.rx=1),D._params.rx<0&&(D._params.rx=360),Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(D._params.rx)),D._params.ry-=i,D._params.ry>360&&(D._params.ry=1),D._params.ry<0&&(D._params.ry=360),Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(D._params.ry)),D._params.rz-=n,D._params.rz>360&&(D._params.rz=1),D._params.rz<0&&(D._params.rz=360),D.updateModel(D._params.tx,D._params.ty,D._params.tz,D._params.rx,D._params.ry,D._params.rz)}else{for(var c=s.coordCircles,u=0;u3&&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=t=parseFloat(parseFloat(t).toFixed(8)),this._params.ty=e=parseFloat(parseFloat(e).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=t,this.options.position.lat=e,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(t){this._controllerCallBack=t}},{key:"createAxisArrow",value:function(t,e,i,n){var o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,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=t,this.coordArrows.push(o),o}},{key:"createAxisCircular",value:function(t,e,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=t,this.coordArrows.push(o),o}},{key:"createAxisSphere",value:function(t,e,i,n,o){var s=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,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=t,this.coordCircles.push(s),s}},{key:"removeCoordArrows",value:function(){for(var t=0;t=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Rn(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(C()(this,e),(i=zn(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.width=n.width||10,i.options.color=n.color||"#0df89e",i.options.type=n.type?Number(n.type):0,i.options["nose-to-tail"]=n["nose-to-tail"]||!1,i.options.smooth=n.smooth||!1,i.options.extend=n.extend||!1,i.options["length-unit"]=n["length-unit"]||"米",i.options["fit-length-unit"]=n["fit-length-unit"]||"米",i.options["extend-width"]=n["extend-width"]||0===n["extend-width"]?n["extend-width"]:1,i.options["extend-color"]=n["extend-color"]||"#ffde00",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,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||["#42c6ef","#42c6ef"],lineColor:n.label.lineColor||"#fff000",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.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",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.operate={},i.nodePoints=[],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-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var o=0;o\n
        '+this.options.attribute.vr.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c'.concat(t+1,'\n
        \n
        \n
        \n ');var n=i.getElementsByClassName("lng")[0],o=document.createElement("span");o.innerHTML=h.options.positions[t].lng.toFixed(8),n.appendChild(o);var s=document.createElement("input");s.className="input",s.type="number",s.title="",s.min=-180,s.max=180,s.value=h.options.positions[t].lng.toFixed(8);var a=i.getElementsByClassName("lat")[0],r=document.createElement("span");r.innerHTML=h.options.positions[t].lat.toFixed(8),a.appendChild(r);var l=document.createElement("input");l.className="input",l.type="number",l.title="",l.min=-90,l.max=90,l.value=h.options.positions[t].lat.toFixed(8);var c=i.getElementsByClassName("alt")[0],u=document.createElement("span");u.innerHTML=h.options.positions[t].alt.toFixed(2),c.appendChild(u);var p=document.createElement("input");p.className="input",p.type="number",p.title="",p.min=-9999999,p.max=999999999,p.value=h.options.positions[t].alt.toFixed(2),n.addEventListener("dblclick",(function(){n.innerHTML="",s.value=Number(h.options.positions[t].lng.toFixed(8)),n.appendChild(s),s.focus(),h.positionEditing=!1,e.closeNodeEdit(h)})),s.addEventListener("blur",(function(){s.value=Number(h.options.positions[t].lng.toFixed(8)),n.innerHTML="",n.appendChild(o)})),s.addEventListener("input",(function(){h.options.positions[t].lng=Number(Number(s.value).toFixed(8)),o.innerHTML=h.options.positions[t].lng.toFixed(8);var e=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,e[2]]})),a.addEventListener("dblclick",(function(){a.innerHTML="",l.value=Number(h.options.positions[t].lat.toFixed(8)),a.appendChild(l),l.focus(),h.positionEditing=!1,e.closeNodeEdit(h)})),l.addEventListener("blur",(function(){l.value=Number(h.options.positions[t].lat.toFixed(8)),a.innerHTML="",a.appendChild(r)})),l.addEventListener("input",(function(){h.options.positions[t].lat=Number(Number(l.value).toFixed(8)),r.innerHTML=h.options.positions[t].lat.toFixed(8);var e=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,e[2]]})),c.addEventListener("dblclick",(function(){2!=h.heightMode&&(c.innerHTML="",p.value=Number(h.options.positions[t].alt.toFixed(2)),c.appendChild(p),p.focus(),h.positionEditing=!1,e.closeNodeEdit(h))})),p.addEventListener("blur",(function(){p.value=Number(h.options.positions[t].alt.toFixed(2)),c.innerHTML="",c.appendChild(u)})),p.addEventListener("input",(function(){h.options.positions[t].alt=Number(Number(p.value).toFixed(2)),u.innerHTML=h.options.positions[t].alt.toFixed(2);var e=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,e[2]]})),h._elms.lng.push(o),h._elms.lngInput.push(s),h._elms.lat.push(r),h._elms.latInput.push(l),h._elms.alt.push(u),h._elms.altInput.push(p),D.appendChild(i)},O=0;O0&&void 0!==y[0]?y[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=jn({},this.options.position):this.options.positions?r=jn({},this.options.positions[0]):this.options.center?r=jn({},this.options.center):this.options.start?r=jn({},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")){t.next=18;break}return t.next=17,this.getClampToHeight(r);case 17:r.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.next=43;break;case 25:c=[],t.t0=this.options.heightMode,t.next="0"===t.t0||0===t.t0?29:"1"===t.t0||1===t.t0?31:"2"===t.t0||2===t.t0?36:41;break;case 29:for(p=0;p=500?(i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),i.positionEditing=!1):leftEvent(s,e)}))})),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return l.length>0?l:n}),!1)}else{this.label&&(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 c=this.renewPositions(this.options.positions);switch(this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(c),this.renewPolygon(c),this.heightMode){case 0:case"0":case 1:case"1":this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat,c[2]],this.options.label.position={lng:this.options.positions[0].lng,lat:this.options.positions[0].lat,alt:c[2]}}}}},{key:"setDIV",value:function(){var t,e=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;o0&&void 0!==arguments[0]?arguments[0]:[],e=new Cesium.EntityCollection;if(t.forEach((function(t){(t instanceof bn||t instanceof Sn||t instanceof an||t instanceof Fn)&&e.add(t.entity)})),e.values.length){var i=Cesium.exportKml({entities:e});i.then((function(t){Vn(t.kml,(new Date).getTime()+".kml")}))}else console.error("允许导出为kml的对象为空")},Gn={yingguangse:new Map,gonganlan:new Map,hong:new Map};Gn.yingguangse.set("--color-sdk-base","#00ffff"),Gn.yingguangse.set("--color-sdk-auxiliary","#004242"),Gn.yingguangse.set("--color-sdk-auxiliary-public","#ffffff"),Gn.yingguangse.set("--color-sdk-warning-0","#1BF8C3"),Gn.yingguangse.set("--color-sdk-warning-1","#F16C55"),Gn.yingguangse.set("--color-sdk-warning-2","#FFA145"),Gn.yingguangse.set("--color-sdk-warning-3","#FFDF53"),Gn.yingguangse.set("--color-sdk-text-head","#FFFFFF"),Gn.yingguangse.set("--color-sdk-text-head-1","#E6F7FF"),Gn.yingguangse.set("--color-sdk-text-head-2","#ADF1FF"),Gn.yingguangse.set("--color-sdk-gradual","#00ffff 6.25%, #00ffff 100%"),Gn.yingguangse.set("--color-sdk-bg-gradual","#00ffff33 0%, #00ffff00 100%");var Un,Wn,Yn,Jn=null,qn=0,Xn=0,Zn=function(){var t=a()(l.a.mark((function t(e){var i,n,o,s,a,r,c,u,p,h,d,m,f,v,g,y,b,C,w=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return C=function(t){var i=u.getElementsByClassName("tr");i.length>0&&(i[i.length-1].querySelector("input[name='time']").disabled=void 0);var n=u.getElementsByClassName("tr active")[0];n&&(n.className="tr");var o=document.createElement("div");o.className="tr active",o.innerHTML='\n
        视点'.concat(d+1,'
        \n
        \n \n
        \n
        \n
        \n '),o.addEventListener("click",(function(t){if(t.target.parentNode===o){var e=u.getElementsByClassName("tr active")[0];e&&(e.className="tr"),o.className="tr active";for(var n=0;ne+1?(r--,i[r-1].className="tr active"):r==e+1&&(i.length==e&&(r-=1),0!=i.length&&(i[r-1].className="tr active")),i.length>0){var n=i[i.length-1].querySelector("input[name='time']");n.disabled="disabled",n.value=0}break}})),c.addEventListener("input",(function(e){y.checked=!1,t.duration=Number(c.value),t.duration<0&&(t.duration=0)})),c.addEventListener("blur",(function(){c.value=Number(Number(c.value).toFixed(2)),c.value<0&&(c.value=0)})),u.insertBefore(o,i[r]),r++,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=i.name||"漫游路径",i.points||(i.points=[]),i.repeat&&(qn=Number(i.repeat)),s=e.viewer,a=new ye(e),r=0,Jn&&Jn.close&&(Jn.close(),Jn=null),t.next=12,new G(s._container,{title:"飞行漫游",left:"180px",top:"100px",closeCallBack:function(){Qn({viewer:s})}});case 12:return Jn=t.sent,t.next=15,Jn.init();case 15:for((c=document.createElement("div")).className="fly-roam",c.innerHTML='\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n \n 设置总时长\n
        \n \n 秒(s)\n \n
        \n
        \n
        \n \n 是否循环播放\n
        \n
        \n
        \n \n
        \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n
        \n
        \n
        \n
        序号
        \n
        时长(s)
        \n
        操作
        \n
        \n
        \n
        \n
        \n
        \n

        暂无数据

        \n
        \n
        \n
        \n
        \n \n ',Jn.contentAppChild(c),c.getElementsByTagName("*"),u=c.getElementsByClassName("table-body")[0],p=c.getElementsByClassName("table-empty")[0],h={set:function(t,e,i){return t[e]=i,t.length>0?p.style.display="none":p.style.display="flex",!0}},d=0,m=new Proxy([],h),d=0;d0&&$n(e,m,0)})),c.getElementsByClassName("add-point")[0].addEventListener("click",(function(){var t={duration:0,position:a.cartesian3Towgs84(s.camera.position,s),orientation:{heading:s.camera.heading,pitch:s.camera.pitch,roll:s.camera.roll}};m.splice(r,0,t),C(t),d++})),c.getElementsByClassName("modify-point")[0].addEventListener("click",(function(){if(r){var t=a.cartesian3Towgs84(s.camera.position,s);m[r-1].position=t,m[r-1].orientation={heading:s.camera.heading,pitch:s.camera.pitch,roll:s.camera.roll}}})),g=c.querySelector("input[name='totalTime']"),y=c.querySelector("input[name='isTotalTime']"),b=c.querySelector("input[name='repeat']"),y.addEventListener("change",(function(){var t=u.getElementsByClassName("tr");if(y.checked&&t.length>0){for(var e=Number((Number(g.value)/(t.length-1)).toFixed(2)),i=0;i0){for(var e=Number((Number(g.value)/(t.length-1)).toFixed(2)),i=0;i1&&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;Un&&Un.destroy(),(Un=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas)).setInputAction((function(e){Qn(t)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK);var o,s=t.viewer;s.camera.cancelFlight(),re(t),le(t),s.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(e[i].position.lng,e[i].position.lat,e[i].position.alt),orientation:e[i].orientation,duration:n?e[i-1].duration:.5,maximumHeight:e[i].position.alt,complete:(o=a()(l.a.mark((function n(){return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:++i<=e.length-1?Kn(t,e,i,!0):Xn&&e.length>1?(Xn--,Kn(t,e,0)):Un&&Un.destroy();case 3:case"end":return n.stop()}}),n)}))),function(){return o.apply(this,arguments)}),easingFunction:n?Cesium.EasingFunction.LINEAR_NONE:Cesium.EasingFunction.EXPONENTIAL_OUT})},$n=function(t){var e=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;Xn=qn,Kn(t,e,i,n)},Qn=function(t){t&&t.viewer&&t.viewer.camera.cancelFlight(),Un&&Un.destroy()},to=null,eo=null,io=null,no=null,oo="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 }",so="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 ",ao="\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 ro,lo,co,uo={},po=void 0,ho=void 0,mo=!1,fo={};function vo(){(ho=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))))||(ho=this.sdk.viewer.camera.position);var t=Wn.cartesian3Towgs84(this.sdk.viewer.camera.position,this.sdk.viewer).alt,e=Wn.cartesian3Towgs84(ho,this.sdk.viewer);t>9e6&&(t=9e6),t<1e5?(this.entity.billboard.show=!0,this.entity.rectangle.show=!1):(this.entity.billboard.show=!1,this.entity.rectangle.show=!0),po=new Cesium.Rectangle(Cesium.Math.toRadians(e.lng-t/12e4),Cesium.Math.toRadians(e.lat-t/28e4),Cesium.Math.toRadians(e.lng+t/12e4),Cesium.Math.toRadians(e.lat+t/28e4))}function go(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var yo={};function bo(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function Co(t,e,i){return t.set(ko(t,e),i),i}function wo(t,e){return t.get(ko(t,e))}function ko(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var _o=new WeakMap,xo=new WeakMap,Eo=function(){return k()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;C()(this,t),bo(this,_o,null),bo(this,xo,{bgimg:null,img1:null,img2:null,img3:null,img4:null}),this.sdk=e,this.options=i,this.data={},this._webSocketCallback=n,this._tools=new ye(this.sdk),this.requestResource()}),[{key:"requestResource",value:function(){var t=this;this.options.host=this.options.host||m();var e;e=this.options.host+"/yjearth4.0/api/v1/gps/state",this.reconnecting=new ReconnectingWebSocket("ws://"+e,[],{maxReconnectAttempts:8}),this.reconnecting.onopen=function(e){t.reconnecting.onmessage=function(){var e=a()(l.a.mark((function e(i){var n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.data=JSON.parse(i.data),!t.data||!t.data.rmc){e.next=7;break}return e.next=4,t._tools.getClampToHeight(t.data.rmc);case 4:n=e.sent,t.position=new Cesium.Cartesian3.fromDegrees(t.data.rmc.lng,t.data.rmc.lat,n),t.create();case 7:t._webSocketCallback&&t._webSocketCallback(t.data);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}},{key:"create",value:function(){var t=this;if(this.getcanvas(),this.data&&this.data.rmc&&!this.entity){this.entity=new Cesium.CustomDataSource,this.sdk.viewer.dataSources.add(this.entity);var e=new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.position}),!1),billboard:{image:this._tools.getSourceRootPath()+"/img/locate2.png",scale:1,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ae()?void 0:1e8}),!1),width:31,height:36,pixelOffset:new Cesium.Cartesian2(0,-15)}}),i=new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.position}),!1),billboard:{image:new Cesium.CallbackProperty((function(){return t.lableCanvas})),scale:1,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ae()?void 0:1e8}),!1),width:220,height:140,pixelOffset:new Cesium.Cartesian2(0,-110)}});this.entity.entities.add(e),this.entity.entities.add(i)}}},{key:"loaded",value:function(t){var e;Object.defineProperty(this,"data",{get:function(){return e},set:function(i){e=i,t&&(t(),t=void 0)}})}},{key:"getcanvas",value:function(){var t=this,e=[{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(wo(_o,this)){var i=wo(_o,this).getContext("2d");i.clearRect(0,0,wo(_o,this).width,wo(_o,this).height),i.drawImage(wo(xo,this).bgimg,0,0,wo(_o,this).width,wo(_o,this).height);var n=0;e.forEach((function(o,s){i.drawImage(wo(xo,t)["img"+(s+1)],12,12+26*s),i.fillStyle="#fff",i.font="16px Arial",i.fillText(o.text,44,28+26*s),++n===e.length&&(t.lableCanvas=wo(_o,t).toDataURL())}))}else{Co(_o,this,document.createElement("canvas"));var o=wo(_o,this).getContext("2d");wo(_o,this).width=220,wo(_o,this).height=140;var s=new Image;wo(xo,this).bgimg=s,s.src=this._tools.getSourceRootPath()+"/img/bubble/bubble.png";var a=0;s.onload=function(){o.drawImage(s,0,0,wo(_o,t).width,wo(_o,t).height),e.forEach((function(i,n){var s=new Image;wo(xo,t)["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===e.length&&(t.lableCanvas=wo(_o,t).toDataURL())}}))}}}},{key:"flyTo",value:(t=a()(l.a.mark((function t(){var e,i,n=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=n.length>0&&void 0!==n[0]?n[0]:{},!this.data||!this.data.rmc){t.next=9;break}return t.next=4,this._tools.getClampToHeight(this.data.rmc);case 4:i=t.sent,ve(0),re(this.sdk),le(this.sdk),this.sdk.viewer.camera.flyTo({orientation:e.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+(e.height||500))});case 9:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})},{key:"remove",value:function(){Co(_o,this,null),Co(xo,this,{}),this.reconnecting&&this.reconnecting.close(),this.sdk.viewer.dataSources.remove(this.entity),this.entity=null}},{key:"flicker",value:function(){}}]);var t}();var So=i(9),Do=i.n(So);function Po(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}var Oo=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return C()(this,e),(i=Po(this,e,[t,n])).viewer=t.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=Yt(),i}return gi()(e,t),k()(e,[{key:"create_point",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.viewer,i=this.randomString();return e.entities.add(new Cesium.Entity({id:i,position:t,billboard:{image:this.getSourceRootPath()+"/img/point.png",color:Cesium.Color.WHITE.withAlpha(.99)}})),i}},{key:"remove_entity",value:function(t){this.viewer.entities.removeById(t),!this._is2D&&this._sdk2D&&this._sdk2D.viewer.entities.removeById(t)}},{key:"start",value:function(){}},{key:"end",value:function(){var t=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(e){t.remove_entity(e)}))}}])}(ye);function Mo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function To(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=No(this,e,[t,n])).polygonHasCreated=!1,i}return gi()(e,t),k()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{this.polygonHasCreated=!1,(i=e,n="start",o=this,s=3,a=Do()(fi()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new q("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new J(this.sdk),this.positions=[],this.points_ids=[];var l=[],c=[];this.event.mouse_left((function(t,i){if(r.positions=l.concat(To({},i)),r.tip.setPosition(i,t.position.x,t.position.y),!r.polygonHasCreated){var n=e.create_polygon(r);r.points_ids.push(n)}l.push(i),c.push(r.cartesian3Towgs84(i,r.viewer)),r.points_ids.push(r.create_point(i))})),this.event.mouse_right((function(e,i){t(null,c),r.end()})),this.event.mouse_move((function(t,e){r.positions=l.concat(To({},e)),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y)})),this.event.mouse_right_keyboard_ctrl((function(t,e){r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),l.pop(),c.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),l.pop(),c.pop(),r.positions=l.concat(cartesian))})),this.event.gesture_pinck_start((function(i,n){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)t(null,c),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=e.create_polygon(r);r.points_ids.push(s)}l.push(n),c.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n)),r.positions=l.concat(n)}}))})),!this._is2D&&this._sdk2D&&(this.event2D=new J(this._sdk2D),this.event2D.mouse_left((function(t,i){if(r.positions=l.concat(To({},i)),r.tip.setPosition(i,t.position.x+r.viewer.canvas.width,t.position.y),!r.polygonHasCreated){var n=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(n)}l.push(i),c.push(r.cartesian3Towgs84(i,r.viewer)),r.points_ids.push(r.create_point(i,r._sdk2D.viewer))})),this.event2D.mouse_right((function(e,i){t(null,c),r.end()})),this.event2D.mouse_move((function(t,e){r.positions=l.concat(To({},e)),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y)})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),l.pop(),c.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),l.pop(),c.pop(),r.positions=l.concat(cartesian))})),this.event2D.gesture_pinck_start((function(i,n){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)t(null,c),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=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(s)}l.push(n),c.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),r.positions=l.concat(n)}}))})))}}}],[{key:"create_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.polygonHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)})),material:Cesium.Color.fromCssColorString(t.color),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(e){return t.positions.concat(t.positions[0])})),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:99999999}})),i}}])}(Oo),Ao=function(){return k()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};C()(this,t),this.sdk=e,this.viewer=e.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.Draw=new Bo(this.sdk),YJ.Analysis.Analyses.push(this),t.EditBox(this)}),[{key:"create",value:function(){var t=this;this.clean(),this.Draw.start((function(e,i){if(!i||i.length<3){return console.warn("最少需要三个坐标!"),void(window.ELEMENT&&window.ELEMENT.Message({message:"最少需要三个坐标!",type:"warning",duration:1500}))}for(var n=[],o=0;othis.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:"clean",value:function(){this.Draw&&this.Draw.end();for(var t=0;t\n
        \n
        \n
        \n 绘制分析区域\n \n
        \n
        \n
        \n \n
        \n
        \n
        \n 基准高度\n
        \n \n m\n \n
        \n
        \n
        \n 精度\n
        \n \n \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 总分析面积:\n 0\n \n
        \n
        \n 无须填挖面积:\n 0\n \n
        \n
        \n
        \n
        \n 填方面积:\n 0\n \n
        \n
        \n 挖方面积:\n 0\n \n
        \n
        \n
        \n
        \n 填方体积:\n 0\n \n
        \n
        \n 挖方体积:\n 0\n \n
        \n
        \n
        \n \n ',e._DialogObject.contentAppChild(i),e._DialogObject._element.body.className=e._DialogObject._element.body.className+" cut-fill",(n=i.querySelector("input[name='height']")).value=e.height,n.addEventListener("blur",(function(t){var i=t.target.value;"."==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&&iNumber(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function jo(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(i=Io(this,e,[t,n])).sdk=t,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 Bo(i.sdk),i.positions,i.status=!0,i.area=0,i._elms={},YJ.Analysis.Analyses.push(i),e.EditBox(i),i}return gi()(e,t),k()(e,[{key:"move",value:function(){var t=this;this.TweenAnimate&&TWEEN.remove(this.TweenAnimate);var e=(this.options.maxWaterLevel-this.options.minWaterLevel)/this.options.risingSpeed*1e3;this.TweenAnimate=new TWEEN.Tween({waterLevel:this.options.minWaterLevel}).to({waterLevel:this.options.maxWaterLevel},e).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(function(){var e=a()(l.a.mark((function e(i,n){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.currentWaterLaver=i.waterLevel;case 1:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).start();var i=this._DialogObject._element.body,n=i.getElementsByClassName("pause")[0];i.getElementsByClassName("start")[0].style.display="none",n.style.display="flex"}},{key:"restart",value:function(){var t=this;this.currentWaterLaver=this.options.minWaterLevel;var e=!1;this.TweenAnimate&&(e=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 e=a()(l.a.mark((function e(i,n){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.currentWaterLaver=i.waterLevel;case 1:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).start(),e&&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){re(this.sdk),le(this.sdk);for(var t=[],e=0;ei[o].alt&&(t.options.minWaterLevel=i[o].alt),n.push(i[o].lng,i[o].lat);var s=Cesium.Cartesian3.fromDegreesArray(n);t.currentWaterLaver=t.options.minWaterLevel,t.entity=t.sdk.viewer.entities.add({polygon:{hierarchy:new Cesium.PolygonHierarchy(s),height:new Cesium.CallbackProperty((function(){return t.options.minWaterLevel}),!1),extrudedHeight:new Cesium.CallbackProperty((function(){return t.currentWaterLaver}),!1),material:Cesium.Color.fromCssColorString(t.color)}}),t.area=t.computeArea(i),t.TweenAnimate&&(TWEEN.remove(t.TweenAnimate),t.TweenAnimate=null);var a=t._DialogObject._element.body,r=a.getElementsByClassName("pause")[0];a.getElementsByClassName("start")[0].style.display="flex",r.style.display="none"}))}},{key:"EditBox",value:(i=a()(l.a.mark((function t(i){var n,o,s,a,r,c,u,p,h,d,m;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new G(i.sdk.viewer._container,{title:"淹没分析",left:"180px",top:"100px",closeCallBack:function(){i.destroy(),i.Dialog.closeCallBack&&i.Dialog.closeCallBack()}});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" submerge",(n=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 水量\n
        \n \n \n \n
        \n
        \n
        \n 最小水位\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n 水面面积\n
        \n \n \n \n
        \n
        \n
        \n 最大水位\n
        \n \n m\n \n
        \n
        \n
        \n
        \n \n
        \n
        \n 上升速度\n
        \n
        \n
        \n \n
        \n \n m/s\n \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n \n \n \n \n \n \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        序号
        \n
        经度
        \n
        纬度
        \n
        高程
        \n
        \n
        \n
        \n
        \n
        \n
        \n

        暂无数据

        \n
        \n
        \n \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(){e.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],a=n.getElementsByClassName("start")[0],s.addEventListener("click",(function(){i.pause(),s.style.display="none",a.style.display="flex"})),a.addEventListener("click",(function(){i.start(),a.style.display="none",s.style.display="flex"})),(r=n.querySelectorAll("input[name='risingSpeed']"))[0].value=i.options.risingSpeed,r[1].value=i.options.risingSpeed,r[0].addEventListener("input",(function(t){i.options.risingSpeed=Number(t.target.value)})),r[1].addEventListener("input",(function(t){if("."!=t.data){var e=Number(t.target.value),n=Number(r[0].max),o=Number(r[0].min);i.options.risingSpeed=e>n?n:e999999999&&(e=999999999),e<0&&(e=0),i.options.minWaterLevel=Math.floor(1e4*e)/1e4,i.options.maxWaterLevel=i.options.minWaterLevel+i.waterLevel}})),Object.defineProperty(i.options,"minWaterLevel",{get:function(){return Number(c.value)},set:function(t){c.value=Math.floor(1e4*Number(t))/1e4}}),(u=n.querySelector("input[name='maxWaterLevel']")).value=i.options.maxWaterLevel,u.addEventListener("input",(function(t){if("."!=t.data){var e=Number(t.target.value);e>999999999&&(e=999999999),e<0&&(e=0),e99999999999999&&(e=99999999999999),e<0&&(e=0),i.options.waterVolume=Math.floor(1e4*e)/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(p.value)},set:function(t){p.value=t}}),(h=n.getElementsByClassName("area")[0]).value=i.area,Object.defineProperty(i,"area",{get:function(){return Number(h.value)},set:function(t){h.value=t,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(t){if(t&&t.length>0){m.style.display="none";for(var e="",i=0;i\n
        '.concat(i+1,'
        \n
        ').concat(Number(t[i].lng.toFixed(10)),'
        \n
        ').concat(Number(t[i].lat.toFixed(10)),'
        \n
        ').concat(Number(t[i].alt.toFixed(4)),"
        \n ");d.innerHTML=e}else d.innerHTML="",m.style.display="flex"}});case 51:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"EventBinding",value:function(t,e){for(var i=function(){var i,o=[],s=!1,a=[],r=Lo(e[n].attributes);try{var l=function(){var r=i.value;switch(r.name){case"@model":s=!0,"checkbox"==e[n].type?(o.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(o.push((function(e){var i=e.target.value;"number"==e.target.type&&(i=Number(i)),t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],a.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),a.push(r.name);break;case"@change":s=!0,o.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(i=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(i=Go(this,e,[t,n])).viewer=t.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._EventBinding=new Si,i.html=null,YJ.Analysis.Analyses.push(i),e.edit(i),i}return gi()(e,t),k()(e,[{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(t){var e=Math.floor(10*Number(t))/10;isNaN(e)&&(e=1.8),e<0&&(e=0),this.options.viewPointHeight=e,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(t){t.value=e}))}},{key:"viewPosition",get:function(){return this.options.viewPosition},set:function(t){this.options.viewPosition=t,this.ids[0]&&(this.viewer.entities.getById(this.ids[0]).position=new Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt)),this.update()}},{key:"viewPositionEnd",get:function(){return this.options.viewPositionEnd},set:function(t){this.options.viewPositionEnd=t,this.ids[1]&&(this.viewer.entities.getById(this.ids[1]).position=new Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt)),this.update()}},{key:"horizontalViewAngle",get:function(){return this.options.horizontalViewAngle},set:function(t){if(this.options.horizontalViewAngle=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content){var e=this._DialogObject._element.content;e.querySelector("input[name='horizontalViewAngle']").value=t,e.getElementsByClassName("range-node-active")[0].getElementsByClassName("range-node-active-text")[0].innerHTML=t+"°",e.getElementsByClassName("range-process")[0].style.width=t/180*100+"%"}this.update()}},{key:"visibleAreaColor",get:function(){return this.options.visibleAreaColor},set:function(t){this.options.visibleAreaColor=t,this.update()}},{key:"invisibleAreaColor",get:function(){return this.options.invisibleAreaColor},set:function(t){this.options.invisibleAreaColor=t,this.update()}},{key:"verticalViewAngle",get:function(){return this.options.verticalViewAngle},set:function(t){this.options.verticalViewAngle=t,this.update()}},{key:"viewDistance",get:function(){var t=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),e=Cesium.Cartesian3.fromDegrees(this.options.viewPositionEnd.lng,this.options.viewPositionEnd.lat,this.options.viewPositionEnd.alt);return Cesium.Cartesian3.distance(t,e)}},{key:"viewHeading",get:function(){var t,e,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 t=o,e=s,i=new Cesium.Cartesian3,n=Cesium.Transforms.eastNorthUpToFixedFrame(t),Cesium.Matrix4.inverse(n,n),Cesium.Matrix4.multiplyByPoint(n,e,i),Cesium.Cartesian3.normalize(i,i),Cesium.Math.toDegrees(Math.atan2(i.x,i.y))}},{key:"viewPitch",get:function(){var t,e,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 t=o,e=s,i=new Cesium.Cartesian3,n=Cesium.Transforms.eastNorthUpToFixedFrame(t),Cesium.Matrix4.inverse(n,n),Cesium.Matrix4.multiplyByPoint(n,e,i),Cesium.Cartesian3.normalize(i,i),Cesium.Math.toDegrees(Math.asin(i.z))}},{key:"add",value:function(){this.createLightCamera(),this.createShadowMap(),this.createPostStage(),this.drawSketch(),e.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 t=this;this.clear(),this.editevent&&this.editevent.destroy(),this.ControllerObject&&this.ControllerObject.destroy(),this.ids.forEach((function(e){t.viewer.entities.removeById(e)})),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:"nodeEdit",value:function(){var t,e=this;YJ.Measure.GetMeasureStatus()?console.log("上一次测量未结束"):(this.editevent&&this.editevent.destroy(),this.ids.forEach((function(t){e.viewer.entities.getById(t).show=!0})),YJ.Measure.SetMeasureStatus(!0),this.editevent=new J(this.sdk),this.editevent.mouse_left((function(i,n){var o=e.viewer.scene.pick(i.position);o&&o.id&&o.id.id&&-1!=e.ids.indexOf(o.id.id)&&(!t||t.id!=o.id.id)&&(t=o.id,e.viewer.entities.getById(e.ids[0]).position=new Cesium.Cartesian3.fromDegrees(e.viewPosition.lng,e.viewPosition.lat,e.viewPosition.alt),e.viewer.entities.getById(e.ids[1]).position=new Cesium.Cartesian3.fromDegrees(e.viewPositionEnd.lng,e.viewPositionEnd.lat,e.viewPositionEnd.alt),e.ControllerObject&&e.ControllerObject.destroy(),e.ControllerObject=new An(e.sdk,{position:Ho({},e.cartesian3Towgs84(t.position._value,e.sdk.viewer))}),e.ControllerObject.controllerCallBack=function(i,n){i.position.alt<0&&(i.position.alt=0),t.position=new Cesium.Cartesian3.fromDegrees(i.position.lng,i.position.lat,i.position.alt),n&&(0==e.ids.indexOf(o.id.id)?e.viewPosition=i.position:e.viewPositionEnd=i.position,YJ.Measure.SetMeasureStatus(!0))},e.ControllerObject.editTranslational())})),this.editevent.mouse_right((function(i,n){YJ.Measure.SetMeasureStatus(!1),e.editevent&&e.editevent.destroy(),e.ControllerObject&&e.ControllerObject.destroy(),e.ids.forEach((function(t){e.viewer.entities.getById(t).show=!1})),t=null})),this.editevent.mouse_move((function(t,e){})),this.editevent.gesture_pinck_start((function(i,n){var o=new Date;e.editevent.gesture_pinck_end((function(){new Date-o>=500&&(YJ.Measure.SetMeasureStatus(!1),e.editevent&&e.editevent.destroy(),e.ControllerObject&&e.ControllerObject.destroy(),e.ids.forEach((function(t){e.viewer.entities.getById(t).show=!1})),t=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 t=Cesium.Math.toRadians(this.horizontalViewAngle),e=Cesium.Math.toRadians(this.verticalViewAngle),i=this.viewDistance*Math.tan(t/2)*2/(this.viewDistance*Math.tan(e/2)*2);this.lightCamera.frustum.aspectRatio=i,this.lightCamera.frustum.fov=t>e?t:e,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 t=this;Number(Cesium.VERSION.split(".")[1])>=102&&Fo()("fs");var e=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 t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState")),Reflect.get(t.shadowMap,"_shadowMapTexture")},shadowMap_matrix:function(){return t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState")),Reflect.get(t.shadowMap,"_shadowMapMatrix")},shadowMap_lightPositionEC:function(){return t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState")),Reflect.get(t.shadowMap,"_lightPositionEC")},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState"));var e=t.shadowMap._pointBias;return Cesium.Cartesian4.fromElements(e.normalOffsetScale,t.shadowMap._distance,t.shadowMap.maximumDistance,0,new Cesium.Cartesian4)},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState"));var e=t.shadowMap._pointBias,i=new Cesium.Cartesian2;return i.x=1/t.shadowMap._textureSize.x,i.y=1/t.shadowMap._textureSize.y,Cesium.Cartesian4.fromElements(i.x,i.y,e.depthBias,e.normalShadingSmooth,new Cesium.Cartesian4)},camera_projection_matrix:this.lightCamera.frustum.projectionMatrix,camera_view_matrix:this.lightCamera.viewMatrix,helsing_viewDistance:function(){return t.viewDistance},helsing_visibleAreaColor:Cesium.Color.fromCssColorString(this.visibleAreaColor),helsing_invisibleAreaColor:Cesium.Color.fromCssColorString(this.invisibleAreaColor)}});this.postStage=this.viewer.scene.postProcessStages.add(e)}},{key:"drawFrustumOutline",value:function(){var t=new Cesium.Cartesian3,e=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,t);var a=e;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(t){t.destroy();var i=0;function n(){t.ids.forEach((function(e){t.viewer.entities.getById(e).show=!1})),YJ.Measure.SetMeasureStatus(!1),t.tip.destroy(),t.event.destroy(),t.tip=null,t.event=null}YJ.Measure.GetMeasureStatus()?console.log("上一次测量未结束"):(t.event=new J(t.sdk),t.tip=new q("左键选择观测点位置,右键取消",t.sdk),YJ.Measure.SetMeasureStatus(!0),t.event.mouse_left((function(o,s){t.viewPosition||(t.options.viewPosition=t.cartesian3Towgs84(s,t.viewer),t.ids.push(e.create_point(t,s)),t.tip.set_text("左键选择最远观测点位置,右键取消")),2===++i&&(t.options.viewPositionEnd=t.cartesian3Towgs84(s,t.viewer),t.ids.push(e.create_point(t,s)),n(),t.update())})),t.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right((function(e,i){t.ids.forEach((function(e){t.viewer.entities.removeById(e)})),t.ids=[],n()})),t.event.gesture_pinck_start((function(e,i){var o=new Date;t.event.gesture_pinck_end((function(){new Date-o>=500&&(t.ids.forEach((function(e){t.viewer.entities.removeById(e)})),t.ids=[],n())}))})))}},{key:"create_point",value:function(t,e){var i=t.randomString(),n=t.cartesian3Towgs84(e,t.viewer),o={id:i,position:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:1e6,color:Cesium.Color.WHITE.withAlpha(.99)}};return t.viewer.entities.add(new Cesium.Entity(o)),i}},{key:"edit",value:(i=a()(l.a.mark((function t(i){var n,o,s,a,r,c,u,p,h;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new G(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(t){i.viewer.entities.removeById(t)}))}});case 3:return i._DialogObject=t.sent,t.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 \n
        \n
        \n
        \n 位置拾取(起点、终点)\n \n
        \n
        \n
        \n \n
        \n
        \n
        \n 视点高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n
        \n 视域夹角\n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n 45°\n 90°\n 135°\n 180°\n
        \n
        \n \n
        \n
        \n
        \n
        \n \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(){e.create(i)})),i._DialogObject.footAppChild(o),i.html=n,s=n.getElementsByTagName("*"),i._EventBinding.on(i,s),i._elms=i._EventBinding.element,(a=n.querySelector("input[name='horizontalViewAngle']")).value=i.options.horizontalViewAngle,r=n.getElementsByClassName("range-node-active")[0],c=r.getElementsByClassName("range-node-active-text")[0],u=n.getElementsByClassName("range-process")[0],p=i.horizontalViewAngle/180*100,r.style.left=p+"%",u.style.width=p+"%",c.innerHTML=i.horizontalViewAngle+"°",a.addEventListener("input",(function(){var t=a.value/180*100;r.style.left=t+"%",u.style.width=t+"%",c.innerHTML=a.value+"°"})),a.addEventListener("change",(function(){clearTimeout(h),h=setTimeout((function(){i.horizontalViewAngle=a.value}),300)}));case 31:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"getcanvas",value:function(t){if(t.viewPosition){t.viewBillboardPrimitive&&(t.viewer.scene.primitives.remove(t.viewBillboardPrimitive),t.viewBillboardPrimitive=null);var e=document.createElement("canvas"),i=e.getContext("2d");e.width=220,e.height=180,e.style.background="#000000";var n=new Image,o=[{images:t.getSourceRootPath()+"/img/bubble/lng.png",text:"经度:"+parseFloat(t.viewPosition.lng.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/lat.png",text:"纬度:"+parseFloat(t.viewPosition.lat.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/h.png",text:"高度:"+parseFloat(t.viewPosition.alt.toFixed(2))+" m"},{images:t.getSourceRootPath()+"/img/bubble/heading.png",text:"偏航角:"+parseFloat(t.viewHeading.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/pitch.png",text:"俯仰角:"+parseFloat(t.viewPitch.toFixed(10))+"°"}];n.src=t.getSourceRootPath()+"/img/bubble/bubble.png";var s=0;n.onload=function(){i.drawImage(n,0,0,e.width,e.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&&(t.viewBillboardPrimitive=t.viewer.scene.primitives.add(new Cesium.BillboardCollection),t.viewBillboardPrimitive.add({position:Cesium.Cartesian3.fromDegrees(t.viewPosition.lng,t.viewPosition.lat,t.viewPosition.alt+t.viewPointHeight),image:e,width:200,height:180,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:1e8}))}}))}}}}]);var i}(ye);function Wo(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Yo(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Yo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),qo(i=Jo(this,e,[t,n]),Ko,new Map),i.viewer=t.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 Si,i.html=null,YJ.Analysis.Analyses.push(i),e.edit(i),i}return gi()(e,t),k()(e,[{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(t){var e=Math.floor(10*Number(t))/10;isNaN(e)&&(e=1.8),e<0&&(e=0),this.options.viewPointHeight=e,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(t){t.value=e}))}},{key:"precision",get:function(){return this.options.precision},set:function(t){var e=Math.floor(Number(t));isNaN(e)?e=20:e<1&&(e=1),this.options.precision=e,this._elms.precision&&this._elms.precision.forEach((function(t){t.value=e}))}},{key:"analyse",value:function(){var t=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=s.length){var e=Xo(Ko,t).get(f);e&&clearInterval(e.event)}else!function(t){for(var e=[],n=t,o=0;o.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(N()(a),N()(r),N()(l),N()(c),N()(a))),width:2}),_=new Cesium.GeometryInstance({geometry:k,name:"ViewershedPolygon",attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(w),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});e.push(_)}m.primitives.push(m.viewer.scene.primitives.add(new Cesium.GroundPolylinePrimitive({geometryInstances:e,appearance:new Cesium.PolylineColorAppearance})))}(d),d+=1}),0);Xo(Ko,this).set(f,{event:v})}},{key:"destroy",value:function(){var t,e,i,n,o=Wo(Xo(Ko,this));try{for(o.s();!(t=o.n()).done;){var s=$()(t.value,2),a=(s[0],s[1]);clearInterval(a.event)}}catch(t){o.e(t)}finally{o.f()}e=Ko,i=this,n=new Map,e.set(Zo(e,i),n);for(var r=0;r\n
        \n
        \n
        \n 视点高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n 采样精度\n \n
        \n
        \n
        \n ',i._DialogObject.contentAppChild(n),(o=document.createElement("button")).innerHTML="绘制",o.addEventListener("click",(function(){i.viewer.terrainProvider.availability?e.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 t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"getcanvas",value:function(t){var e=document.createElement("canvas"),i=e.getContext("2d");e.width=220,e.height=140,e.style.background="#000000";var n=new Image,o=[{images:t.getSourceRootPath()+"/img/bubble/lng.png",text:"经度:"+parseFloat(t.center.lng.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/lat.png",text:"纬度:"+parseFloat(t.center.lat.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/h.png",text:"视高:"+t.viewPointHeight+" m"},{images:t.getSourceRootPath()+"/img/bubble/radius.png",text:"半径:"+t.radius+" m"}];n.src=t.getSourceRootPath()+"/img/bubble/bubble.png";var s=0;return new Promise(function(){var t=a()(l.a.mark((function t(a,r){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.onload=function(){i.drawImage(n,0,0,e.width,e.height),o.forEach((function(t,n){var r=new Image;r.src=t.images,r.onload=function(){i.drawImage(r,12,12+26*n),i.fillStyle="#fff",i.font="12px Arial",i.fillText(t.text,44,28+26*n),++s===o.length&&a(e)}}))};case 1:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}())}}]);var i}(ye);function Qo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ts(t){for(var e=1;e35?35:200*t;this.arrowWidth=i<15?15:i;this.viewer;this.Draw.start((function(i,n){if(!n||n.length<=2)window.ELEMENT&&window.ELEMENT.Message({message:"至少拥有三个坐标位置!",type:"warning",duration:1500});else{for(var o=[],s=1e4,a=1e4,r=-1e4,l=-1e3,c=0;cr?p:r,l=h>l?h:l}o.push(o[0]);var d=[s,a,r,l],m=turf.polygon([o]),f=turf.squareGrid(d,t,{mask:m});e.createEllipse(f)}}))}},{key:"createNew4Num",value:function(t){var e=this,i=t;this.Draw.start((function(t,n){if(!n||n.length<=2)console.warn("至少拥有三个坐标位置!");else{for(var o=[],s=1e4,a=1e4,r=-1e4,l=-1e3,c=0;cr?p:r,l=h>l?h: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;e.arrowWidth=b<15?15:b;var C=turf.squareGrid(d,y,{units:"degrees",mask:v});e.createEllipse(C)}}))}},{key:"createEllipse",value:function(t){for(var e=[],i=0;i0&&function t(i){Cesium.sampleTerrainMostDetailed(h.viewer.scene.terrainProvider,i).then((function(i){m++;var n=e.slice(m*d,(m+1)*d);n.length>0&&t(n);var o=[],s=i.reduce((function(t,e,i,n){var s=10*i,a=s+10,r=n.slice(s,a);return 0!=r.length&&(o[i]=r),o}),[]);h.calculateSlope(s)}))}(f)}},{key:"createPolygonInsrance",value:function(t,e,i){for(var n=[],o=1;o0?[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(t){for(var e=this,i=[],n=[],o=0;or&&(r=u,l=c)}var p=new Cesium.Cartographic(a.longitude,a.latitude,0),h=new Cesium.Cartographic(s[l].longitude,s[l].latitude,0),d=Cesium.Cartesian3.distance(Cesium.Cartographic.toCartesian(p),Cesium.Cartographic.toCartesian(h)),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 J(this.sdk);var k=function(t,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
        坡度:
        \n \n ',document.body.appendChild(n));var o=n.getElementsByClassName("value")[0],s=ts({},t.position),a=e.sdk.viewer.scene.pick(s);if(a&&a.id&&a.id.type&&"SlopeAspect"===a.id.type){var r=0,l=0;if(e.sdk.viewer&&e.sdk.viewer._element){var c=e.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(t,e){var i={position:ts({},t.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 t=document.getElementById("SlopeAspect-box");t&&(t.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(t,e){return t<.00872686779075879?"rgba(85,182,43,"+e+")":t<.03492076949174773?"rgba(135,211,43,"+e+")":t<.08748866352592401?"rgba(204,244,44,"+e+")":t<.2679491924311227?"rgba(245,233,44,"+e+")":t<.7002075382097097?"rgba(255,138,43,"+e+")":t<1.4281480067421144?"rgba(255,84,43,"+e+")":"rgba(255,32,43,"+e+")"}},{key:"destroy",value:function(){var t=this;this.result&&this.result.forEach((function(e){t.viewer.scene.primitives.remove(e)})),this.result=[],this.sdk.viewer.scene.preRender.removeEventListener(this._watchEvent,this)}}])}(ye);function ns(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}var os=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),window.addEventListener("resize",(function(){i.echartsObject&&i.echartsObject.resize()})),(i=ns(this,e,[t])).viewer=t.viewer,i.Dialog=n,YJ.Analysis.Analyses.push(i),e.create(i),i}return gi()(e,t),k()(e,[{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(t){var i=this;this._currentId=Cesium.createGuid();var n=this._currentId;if(t.clean(),YJ.Measure.GetMeasureStatus())console.warn("上一次测量未结束");else{YJ.Measure.SetMeasureStatus(!0),t.tip=new q("左键确定,右键取消",t.sdk),t.event=new J(t.sdk),t.positions=[],t.points_ids=[];var o=[];t.event.mouse_left(function(){var s=a()(l.a.mark((function s(a,r){var c;return l.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:try{t.entityHasCreated||e.create_polyline(t),o.push(r),t.points_ids.push(t.create_point(r)),2==o.length&&(t.end(),c=[],o.forEach((function(e){c.push(t.cartesian3Towgs84(e,t.viewer))})),e.interPoints(t).then((function(o){i._currentId&&i._currentId===n&&(t._DialogObject?e.initEcharts(t,o):e.edit(t,o))})))}catch(t){console.log(t)}case 1:case"end":return s.stop()}}),s)})));return function(t,e){return s.apply(this,arguments)}}()),t.event.mouse_right((function(e,i){o=[],t.clean()})),t.event.mouse_move((function(e,i){t.positions=o.concat(i),t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500){o=[],t.end()}}))}))}}},{key:"create_polyline",value:function(t){t.entityHasCreated=!0;var e=t.randomString();return t.polyline=t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),width:5,material:Cesium.Color.fromCssColorString(t.color),clampToGround:!0,zIndex:99999999}})),e}},{key:"interPoints",value:(n=a()(l.a.mark((function t(e){var i,n,o,s,a,r,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_,x,E,S,D,P;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(i=e.viewer,n=e.positions,o=[],s=[],a=0;ab&&(b=y),(C=parseInt(b/2))>150&&(C=150),C<2&&(C=2),w=f/(C-1),k=0;case 24:if(!(k\n
        \n ',i._DialogObject.contentAppChild(o),(s=document.createElement("button")).innerHTML='重新绘制',s.style.width="auto",s.addEventListener("click",(function(){e.create(i),e.initEcharts(i)})),i._DialogObject.footAppChild(s),e.initEcharts(i,n);case 16:case"end":return t.stop()}}),t)}))),function(t,e){return i.apply(this,arguments)})},{key:"initEcharts",value:function(t,e){var i,n=[],o=[],s=e;if(s){for(var a=s[s.length-1].distance,r=Math.ceil(a),l=0;l高度:"+n[1]+"m
        坐标:"+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=t._DialogObject._element.content.getElementsByClassName("profile-echarts")[0];t.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"}}]}}]}}t.echartsObject.setOption(i)}}]);var i,n}(Oo);function ss(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}var as=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(i=ss(this,e,[t,n])).viewer=t.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 Si,YJ.Analysis.Analyses.push(i),e.edit(i),i}return gi()(e,t),k()(e,[{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(t){var e=Math.floor(10*Number(t))/10;isNaN(e)&&(e=1.8),e<0&&(e=0),this.options.viewPointHeight=e,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(t){t.value=e}))}},{key:"destroy",value:function(){var t=this;this.resultObject.entities.forEach((function(e){t.viewer.entities.remove(e)})),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(t){if(YJ.Measure.GetMeasureStatus())console.log("上一次测量未结束");else{t._DialogObject&&t._DialogObject.close&&(t._DialogObject.close(),t._DialogObject=null),t.event=new J(t.sdk),t.tip=new q("左键点击创建视角起点",t.sdk),YJ.Measure.SetMeasureStatus(!0);t.event.mouse_left((function(i,n){if(t.tip.set_text("左键创建视角终点,右键结束通视分析"),t.resultObject.viewPoint){t.resultObject.targetPoint=n;var o=t.viewer.entities.add({position:n,point:{color:Cesium.Color.YELLOW,pixelSize:5}});t.resultObject.objectExclude.push(o),t.resultObject.entities.push(o);for(var s=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.resultObject.targetPoint,t.resultObject.viewPoint,new Cesium.Cartesian3),new Cesium.Cartesian3),a=new Cesium.Ray(t.resultObject.viewPoint,s),r=t.viewer.scene.drillPickFromRay(a),l={},c=0;cp){var d=t.viewer.entities.add({polyline:{positions:[t.resultObject.viewPoint,l.position],material:Cesium.Color.GREEN,width:3,zIndex:99999999}});t.resultObject.entities.push(d);var m=t.viewer.entities.add({polyline:{positions:[l.position,t.resultObject.targetPoint],material:Cesium.Color.RED,width:3,zIndex:99999999}});t.resultObject.entities.push(m),t.resultObject.targetPoints.push({targetPoint:n,visual:!1,distance:[u,p,h]})}else{var f=t.viewer.entities.add({polyline:{positions:[t.resultObject.viewPoint,t.resultObject.targetPoint],material:Cesium.Color.GREEN,width:3,zIndex:99999999}});t.resultObject.entities.push(f),t.resultObject.targetPoints.push({targetPoint:n,visual:!0,distance:[u,p,h]})}}}else{var v=t.cartesian3Towgs84(n,t.viewer);v.alt=v.alt+t.viewPointHeight;var g=Cesium.Cartesian3.fromDegrees(v.lng,v.lat,v.alt);t.resultObject.viewPoint=g;var y=t.viewer.entities.add({position:g,point:{color:Cesium.Color.YELLOW,pixelSize:5}});t.resultObject.objectExclude.push(y),t.resultObject.entities.push(y)}})),t.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right((function(t,e){i()})),t.event.gesture_pinck_start((function(e,n){var o=new Date;t.event.gesture_pinck_end((function(){new Date-o>=500&&i()}))}))}function i(){YJ.Measure.SetMeasureStatus(!1),t.tip.destroy(),t.event.destroy(),t.tip=null,t.event=null}}},{key:"edit",value:(i=a()(l.a.mark((function t(i){var n,o,s;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new G(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=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" visibility",(n=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 视点高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n ',i._DialogObject.contentAppChild(n),(o=document.createElement("button")).innerHTML="绘制",o.addEventListener("click",(function(){e.create(i)})),i._DialogObject.footAppChild(o),s=n.getElementsByTagName("*"),i._EventBinding.on(i,s),i._elms=i._EventBinding.element;case 17:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"distance",value:function(t,e){var i=Cesium.Cartographic.fromCartesian(t),n=Cesium.Cartographic.fromCartesian(e),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}(ye),rs=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};C()(this,t),this.viewer=e.viewer;var n=this.viewer.terrainProvider.availability;if(!n)return this.error="未加载地形数据!",window.ELEMENT&&window.ELEMENT.Message({message:"未加载地形数据!",type:"warning",duration:1500}),void console.warn(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.Analyses.push(this),this.createNewLine()}return k()(t,[{key:"createNewLine",value:function(){t.interpolatePoint(this)}},{key:"getObjectIndex",value:function(t,e){for(var i=0;ie)return i}},{key:"clear",value:function(t){if(t){this.viewer.dataSources.remove(t);var e=this.countorLineList.indexOf(t);this.countorLineList.splice(e,1)}}},{key:"destroy",value:function(){var t=this;this.countorLineList.forEach((function(e){t.viewer.dataSources.remove(e)})),this.countorLineList=[]}}],[{key:"interpolatePoint",value:function(t){for(var e=t.positions,i=[],n={minX:360,maxX:-360,minY:180,maxY:-180},o=0;o2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(n=us(this,e,[t,o])).viewer=t.viewer,n.tiles3d=i,n.options=cs({},o),n.options.regionsType=n.options.regionsType||!1,n.Planes=[],e.start(n),n}return gi()(e,t),k()(e,[{key:"regionsType",get:function(){return this.options.regionsType},set:function(t){this.options.regionsType=t,this.Planes.length>0&&(this.Planes=[],e.planeCollection(this))}},{key:"destroy",value:function(){this.Planes=[],this.tiles3d.clippingPlanes&&(this.tiles3d.clippingPlanes.enabled=!1,this.tiles3d.clippingPlanes.removeAll())}}],[{key:"start",value:function(t){var i=t.options.positions||[];t.inverseTransform=function(t){var e,i=t.root.transform;e=i&&i.equals(Cesium.Matrix4.IDENTITY)||!i?Cesium.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center):Cesium.Matrix4.fromArray(t.root.transform);return Cesium.Matrix4.inverseTransformation(e,new Cesium.Matrix4)}(t.tiles3d),t.Planes=[];var n=[];if(i.length>0){for(var o=0;o=0;n--)0===n?t.Planes.push(a(e[n],e[e.length-1],t.inverseTransform)):t.Planes.push(a(e[n],e[n-1],t.inverseTransform));if(t.tiles3d.clippingPlanes){t.tiles3d.clippingPlanes.removeAll();for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:{};C()(this,e),(i=hs(this,e,[t])).viewer=t.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 Bo(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"))});var o=new Image,s=new Image;return o.src=i.bottomImg,s.src=i.wallImg,o.onload=function(){var t=document.createElement("canvas");t.width=o.width,t.height=o.height,t.getContext("2d").drawImage(o,0,0,o.width,o.height);var e=t.toDataURL("image/jpg");i.bottomMaterial=new Cesium.Material({fabric:{type:"Image",uniforms:{image:e}}}),i.bottomSurface&&(i.bottomSurface.appearance.material=i.bottomMaterial)},s.onload=function(){var t=document.createElement("canvas");t.width=s.width,t.height=s.height,t.getContext("2d").drawImage(s,0,0,s.width,s.height);var e=t.toDataURL("image/jpg");i.wallMaterial=new Cesium.Material({fabric:{type:"Image",uniforms:{image:e}}}),i.wellWall&&(i.wellWall.appearance.material=i.wallMaterial)},i.init(),i}return gi()(e,t),k()(e,[{key:"show",get:function(){return this.options.show},set:function(t){this.options.show=t,this.switchExcavate(t)}},{key:"height",get:function(){return this.options.height},set:function(t){this.options.height=t}},{key:"init",value:function(){e.edit(this,!0)}},{key:"startCreate",value:function(){var t=this;this.Draw.start((function(e,i){!i||i.length<=2?window.ELEMENT&&window.ELEMENT.Message({message:"至少拥有三个坐标位置!",type:"warning",duration:1500}):t.updateData(i)}))}},{key:"updateData",value:function(t){var e=this.viewer;this.clear();for(var i=[],n=[],o=0;o=0;t--)this.viewer.scene.primitives.remove(ds[t]);ds=[],this.Draw&&this.Draw.end()}},{key:"destroy",value:function(){this.clear()}},{key:"prepareWell",value:function(t){for(var e=t.length,i=this.excavateMinHeight-this.height,n=[],o=[],s=[],a=0;a\n
        \n
        \n
        \n 挖掘高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 绘制开挖区域\n \n
        \n
        \n 清除开挖区域\n \n
        \n
        \n
        \n ',e._DialogObject.contentAppChild(n),n.getElementsByClassName("start-excavation")[0].addEventListener("click",(function(){e.startCreate()})),n.getElementsByClassName("clean-excavation")[0].addEventListener("click",(function(){e.clear()})),(o=n.querySelector("input[name='height']")).value=e.height,o.addEventListener("change",(function(t){var i=t.target.value;(i=Number(i))<.01&&(i=.01,t.target.value=i,e.height=i)})),o.addEventListener("blur",(function(t){var i=t.target.value;i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),i<.01&&(i=.01),t.target.value=i,e.height=i})),t.next=22;break;case 21:e._DialogObject&&e._DialogObject.close&&(e._DialogObject.close(),e._DialogObject=null);case 22:case"end":return t.stop()}}),t)}))),function(t,e){return i.apply(this,arguments)})}]);var i}(ye);function fs(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function vs(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(C()(this,e),n=gs(this,e,[t]),o()(n,"getUniqueArray",(function(t){return t.filter((function(t,e,i){return i.indexOf(t,0)===e}))})),!i||!n.sdk||!n.sdk.viewer)return di()(n);if(n.options=vs({},s),n.options.id=s.id||n.randomString(),n.options.name=s.name||"压平面",n.options.positions=s.positions||[],n.options.show=!s.show&&!1!==s.show||s.show,n.tileset=i,n.Dialog=a,!n.options.height&&0!==n.options.height){for(var r=n.options.positions[0].alt,l=0;ln.options.positions[l].alt&&(r=n.options.positions[l].alt);n.options.height=r}return ys[n.tileset.id]?ys[n.tileset.id].push(vs({},n.options)):ys[n.tileset.id]=[vs({},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 gi()(e,t),k()(e,[{key:"show",get:function(){return this.options.show},set:function(t){this.options.show=t;for(var e=0;e= 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(t,e){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(t,"\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(e,"\n }")});this.tileset.customShader=i,this.sdk.viewer.scene.requestRender()}},{key:"cartesiansToLocal",value:function(t){for(var e=[],i=0;i\n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n 压平高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n ',this._DialogObject.contentAppChild(i),(n=i.getElementsByClassName("input-name")[0]).value=this.options.name,n.addEventListener("input",(function(){a.name=n.value})),(o=i.getElementsByClassName("flat-height")[0]).value=this.options.height,o.addEventListener("input",(function(){a.height=Number(o.value),a.addFlat()})),(s=document.createElement("button")).className="btn",s.innerHTML="确认",this._DialogObject.footAppChild(s),s.addEventListener("click",(function(){a.options.name||(a.options.name="压平面"),a.originalOptions=a.deepCopyObj(a.options),a._DialogObject.close(),a.Dialog.confirmCallBack&&a.Dialog.confirmCallBack(a.options)})),t.next=24;break;case 23:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 24:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{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(t){if(t){for(var e=that.options.positions,i=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:{text:"左键开始,右键结束;"};return C()(this,e),(i=ks(this,e,[t,n])).options=ws({},n),i.event=new J(t),i.tip=new q(n.text,t),i.viewer=t.viewer,i.defaultColor="rgba(246,49,49,0.55)",i.ids=[],YJ.Measure.Measures.push(i),i}return gi()(e,t),k()(e,[{key:"start",value:function(){this.setPickStatus(!1),YJ.Measure.SetMeasureStatus(!0)}},{key:"destroy",value:function(){var t=this;this.ids.forEach((function(e){t.remove_entity(e)}))}},{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(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.randomString(),n=this.cartesian3Towgs84(t,this.viewer);return this.viewer.entities.add(new Cesium.Entity({id:i,position:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),billboard:{show:e,image:this.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:1e6,color:Cesium.Color.WHITE.withAlpha(.99)}})),i}},{key:"remove_entity",value:function(t){this.viewer.entities.removeById(t)}}])}(ye);function xs(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Es(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Es(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Es(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=Ss(this,e,[t,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i}return gi()(e,t),k()(e,[{key:"clampToGroundMeasure",value:(s=a()(l.a.mark((function t(e,i){var n,o,s,a,r,c,u,p,h,d=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],this.ids.forEach((function(t,e){var i=d.viewer.entities.getById(t).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,e),s=[],o.forEach((function(t,e){0===e?s=N()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),a=s.length,r=xs(s),t.prev=7,r.s();case 9:if((c=r.n()).done){t.next=18;break}return u=c.value,p=s.indexOf(u),t.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},p,a);case 14:h=t.sent,i(null,h);case 16:t.next=9;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(7),r.e(t.t0);case 23:return t.prev=23,r.f(),t.finish(23);case 26:case"end":return t.stop()}}),t,this,[[7,20,23,26]])}))),function(t,e){return s.apply(this,arguments)})},{key:"computeDisByTowPoint",value:(o=a()(l.a.mark((function t(i,n){var o,s,r,c,u=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=this.computeDistance([i,n]),s=10,r=function(t){var i=u.getLabel("贴地距离:"+Number(t).toFixed(2)+"米");i.pixelOffset=new Cesium.Cartesian2(0,-32),u.ids.push(e.create_point(Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),{label:i},u))},c=function(){var t=a()(l.a.mark((function t(e){var o,s,a,c,p,h,d,m,f,v;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=u.chunkLine([i,n],e),s=[],o.forEach((function(t,e){0===e?s=N()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),a=[],c=xs(s),t.prev=5,c.s();case 7:if((p=c.n()).done){t.next=16;break}return h=p.value,d=s.indexOf(h),t.next=12,u.sampleHeight({lng:h[0],lat:h[1],alt:0},d);case 12:m=t.sent,a.push(m);case 14:t.next=7;break;case 16:t.next=21;break;case 18:t.prev=18,t.t0=t.catch(5),c.e(t.t0);case 21:return t.prev=21,c.f(),t.finish(21);case 24:f=0,v=a.length-1,a.forEach((function(t,e){if(e!==v){var i=u.computeDistance([t.position,a[e+1].position]),n=Math.abs(t.position.alt-a[e+1].position.alt),o=Math.sqrt(i*i+n*n);f+=o}})),r(f);case 28:case"end":return t.stop()}}),t,null,[[5,18,21,24]])})));return function(e){return t.apply(this,arguments)}}(),!(o>20)){t.next=10;break}return s=o/20,t.next=8,c(s);case 8:t.next=17;break;case 10:if(!(o<1)){t.next=14;break}r(o),t.next=17;break;case 14:return s=1,t.next=17,c(s);case 17:case"end":return t.stop()}}),t,this)}))),function(t,e){return o.apply(this,arguments)})},{key:"sampleHeight",value:(n=a()(l.a.mark((function t(e,i){var n;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:return n=t.sent,e.alt=n[0].height,t.abrupt("return",{position:e,index:i});case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"getHeight",value:(i=a()(l.a.mark((function t(e,i,n){var o,s;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:if(o=t.sent,e.alt=o[0].height,this.clampPositions.push({position:e,index:i}),n!==this.clampPositions.length){t.next=8;break}return s=this.startCompute(),t.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return t.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var t=this;this.clampPositions.sort((function(t,e){return t.index=500?n():i(a,o)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polyline_id,this.end_id,this.start_id].concat(N()(this.ids)).forEach((function(e){t.remove_entity(e)}))}},{key:"end",value:function(){Ds(e,"end",this,3)([])}}],[{key:"createPolyline",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),dashLength:20}),zIndex:99999999}})),e}},{key:"create_point",value:function(t,e,i){var n=e.label,o=e.image,s=void 0===o?"point.png":o,a=e.width,r=e.height,l=i.randomString(),c=i.cartesian3Towgs84(t,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,o,s}(_s);function Os(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ms(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ms(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ms(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=Ts(this,e,[t,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i}return gi()(e,t),k()(e,[{key:"clampToGroundMeasure",value:(o=a()(l.a.mark((function t(e,i){var n,o,s,a,r,c,u,p,h,d=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],this.ids.forEach((function(t,e){var i=d.viewer.entities.getById(t).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,e),s=[],o.forEach((function(t,e){0===e?s=N()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),a=s.length,r=Os(s),t.prev=7,r.s();case 9:if((c=r.n()).done){t.next=18;break}return u=c.value,p=s.indexOf(u),t.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},p,a);case 14:h=t.sent,i(null,h);case 16:t.next=9;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(7),r.e(t.t0);case 23:return t.prev=23,r.f(),t.finish(23);case 26:case"end":return t.stop()}}),t,this,[[7,20,23,26]])}))),function(t,e){return o.apply(this,arguments)})},{key:"sampleHeight",value:(n=a()(l.a.mark((function t(e,i){var n;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:return n=t.sent,e.alt=n[0].height,t.abrupt("return",{position:e,index:i});case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"getHeight",value:(i=a()(l.a.mark((function t(e,i,n){var o,s;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:if(o=t.sent,e.alt=o[0].height,this.clampPositions.push({position:e,index:i}),n!==this.clampPositions.length){t.next=8;break}return s=this.startCompute(),t.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return t.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var t=this;this.clampPositions.sort((function(t,e){return t.index=500?n():i(a,o)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polyline_id,this.end_id,this.start_id].concat(N()(this.ids)).forEach((function(e){t.remove_entity(e)}))}},{key:"end",value:function(){Ns(e,"end",this,3)([])}}],[{key:"createPolyline",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),dashLength:20})},zIndex:99999999})),e}},{key:"create_point",value:function(t,e,i){var n=e.label,o=e.image,s=void 0===o?"point.png":o,a=e.width,r=e.height,l=i.randomString(),c=i.cartesian3Towgs84(t,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,o}(_s);function As(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ls(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ls(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ls(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=js(this,e,[t,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i.event=new J(t),i}return gi()(e,t),k()(e,[{key:"clampToGroundMeasure",value:(o=a()(l.a.mark((function t(e,i){var n,o,s,a,r,c,u,p,h,d=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],this.ids.forEach((function(t,e){var i=d.viewer.entities.getById(t).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,e),s=[],o.forEach((function(t,e){0===e?s=N()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),a=s.length,r=As(s),t.prev=7,r.s();case 9:if((c=r.n()).done){t.next=18;break}return u=c.value,p=s.indexOf(u),t.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},p,a);case 14:h=t.sent,i(null,h);case 16:t.next=9;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(7),r.e(t.t0);case 23:return t.prev=23,r.f(),t.finish(23);case 26:case"end":return t.stop()}}),t,this,[[7,20,23,26]])}))),function(t,e){return o.apply(this,arguments)})},{key:"sampleHeight",value:(n=a()(l.a.mark((function t(e,i){var n;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:return n=t.sent,e.alt=n[0].height,t.abrupt("return",{position:e,index:i});case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"getHeight",value:(i=a()(l.a.mark((function t(e,i,n){var o,s;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:if(o=t.sent,e.alt=o[0].height,this.clampPositions.push({position:e,index:i}),n!==this.clampPositions.length){t.next=8;break}return s=this.startCompute(),t.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return t.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var t=this;this.clampPositions.sort((function(t,e){return t.index=500?n(0,o):i(a,o)}))}))}}},{key:"computeAngle",value:function(t,i){var n=this.computeDistance([t,i]),o=Math.abs(t.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(e.create_point(Cesium.Cartesian3.fromDegrees(i.lng,i.lat,i.alt),{label:l},this))}},{key:"destroy",value:function(){var t=this;[this.polyline_id,this.end_id,this.start_id].concat(N()(this.ids)).forEach((function(e){t.remove_entity(e)}))}},{key:"end",value:function(){Is(e,"end",this,3)([])}}],[{key:"createPolyline",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),dashLength:20}),zIndex:99999999}})),e}},{key:"create_point",value:function(t,e,i){var n=e.label,o=e.image,s=void 0===o?"point.png":o,a=e.width,r=e.height,l=i.randomString(),c=i.cartesian3Towgs84(t,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,o}(_s);function zs(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Fs(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=Vs(this,e,[t,n])).options.lineColor="#ffdf53",i.polygon_id="",i}return gi()(e,t),k()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Hs(e,"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===t.ids.length&&(t.polygon_id=e.create_polygon(t)),t.cachePositions.push(Fs({},a)),t.ids.push(t.create_point(Fs({},a),!1));var r=t.cartesian3Towgs84(Fs({},a),t.viewer);if(r.alt>n&&(n=r.alt),t.positions=t.cachePositions.concat(Fs({},a)),t.tip.setPosition(Fs({},a),s.position.x,s.position.y),t.positions.length>2){var l=[];t.positions.forEach((function(e){var i=t.cartesian3Towgs84(e,t.viewer);l.push({lng:i.lng,lat:i.lat})}));var c=t.computeCenter(l),u=t.computeArea(l);o=u,t.center=new Cesium.Cartesian3.fromDegrees(c.lng,c.lat,n),i=t.center,t.text="投影面积:"+u+" ㎡"}};this.event.mouse_left(s),this.event.mouse_move((function(e,i){if(t.tip.setPosition(Fs({},i),e.endPosition.x,e.endPosition.y),t.positions=t.cachePositions.concat(Fs({},i)),t.positions.length>2){var o=[];t.positions.forEach((function(e){var i=t.cartesian3Towgs84(e,t.viewer);o.push({lng:i.lng,lat:i.lat})}));var s=t.computeCenter(o),a=t.computeArea(o);t.center=new Cesium.Cartesian3.fromDegrees(s.lng,s.lat,n),t.text="投影面积:"+a+" ㎡"}})),this.event.mouse_right((function(e,n){if(t.positions=t.cachePositions,t.center=i,t.positions.length<3){t.text="";console.warn("面积计算至少需要三个坐标!"),window.ELEMENT&&window.ELEMENT.Message({message:"面积计算至少需要三个坐标!",type:"warning",duration:1500}),t.destroy()}else t.text="投影面积:"+o+" ㎡";t.end()})),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.positions=t.cachePositions,t.end()):s(o,i)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polygon_id].concat(N()(this.ids)).forEach((function(e){t.remove_entity(e)}))}},{key:"end",value:function(){Hs(e,"end",this,3)([])}}],[{key:"create_polygon",value:function(t){var e=t.randomString();new Cesium.NearFarScalar(2e3,1,1e5,0),t.viewer.entities.add(new Cesium.Entity({id:e,label:{text:new Cesium.CallbackProperty((function(){return t.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 t.center}),!1),polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)}),!1),material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions.length?t.positions.concat(t.positions[0]):t.positions}),!1),width:2,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.lineColor||t.defaultColor),dashLength:20}),clampToGround:!0,zIndex:99999999}}));return e}}])}(_s);function Us(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ws(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=Ys(this,e,[t,n])).options.lineColor="#ffdf53",i.polygon_id="",i}return gi()(e,t),k()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Js(e,"start",this,3)([]),this.ids=[],this.positions=[],this.text="",this.center=new Cesium.Cartesian3,this.cachePositions=[];var i=0,n=function(n,o){0===t.ids.length&&(t.polygon_id=e.create_polygon(t)),t.cachePositions.push(Ws({},o)),t.ids.push(t.create_point(Ws({},o),!1));var s=t.cartesian3Towgs84(Ws({},o),t.viewer);s.alt>i&&(i=s.alt),t.positions=t.cachePositions.concat(Ws({},o)),t.tip.setPosition(Ws({},o),n.position.x,n.position.y)},o=function(e,n){if(t.positions=t.cachePositions,t.positions.length>2){var o=[];t.positions.forEach((function(e){var i=t.cartesian3Towgs84(e,t.viewer);o.push({lng:i.lng,lat:i.lat})})),setTimeout((function(){var e=t.computeCenter(o),n=t.computeSignedArea(t.viewer,o);t.center=new Cesium.Cartesian3.fromDegrees(e.lng,e.lat,i),t.text="贴地面积:"+n+" ㎡"}),0)}else{console.warn("面积计算至少需要三个坐标!"),window.ELEMENT&&window.ELEMENT.Message({message:"面积计算至少需要三个坐标!",type:"warning",duration:1500}),t.destroy()}t.end()};this.event.mouse_left(n),this.event.mouse_move((function(e,i){t.tip.setPosition(Ws({},i),e.endPosition.x,e.endPosition.y),t.positions=t.cachePositions.concat(Ws({},i))})),this.event.mouse_right(o),this.event.gesture_pinck_start((function(e,i){var s=new Date,a={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-s>=500?o():n(a,i)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polygon_id].concat(N()(this.ids)).forEach((function(e){t.remove_entity(e)}))}},{key:"end",value:function(){Js(e,"end",this,3)([])}}],[{key:"create_polygon",value:function(t){var e=t.randomString();new Cesium.NearFarScalar(2e3,1,1e5,0),t.viewer.entities.add(new Cesium.Entity({id:e,label:{text:new Cesium.CallbackProperty((function(){return t.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 t.center}),!1),polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)}),!1),material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions.length?t.positions.concat(t.positions[0]):t.positions}),!1),width:2,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.lineColor||t.defaultColor),dashLength:20}),clampToGround:!0,zIndex:99999999}}));return e}}])}(_s);function Xs(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}function Zs(t,e,i,n){var o=Do()(fi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Ks=function(t){function e(t){return C()(this,e),Xs(this,e,[t])}return gi()(e,t),k()(e,[{key:"cal_center",value:function(t){var e=this.cartesian3Towgs84(t[0],this.viewer),i=this.cartesian3Towgs84(t[1],this.viewer),n=this.computeCenter([e,i]);return Cesium.Cartesian3.fromDegrees(n.lng,n.lat,(e.alt+i.alt)/2)}},{key:"cal_distance",value:function(t){var e=this.cartesian3Towgs84(t[0],this.viewer),i=this.cartesian3Towgs84(t[1],this.viewer),n=this.computeDistance([e,i]);return e.alt=e.alt.toFixed(2),i.alt=i.alt.toFixed(2),e.alt===i.alt?n:0===Number(n)?Math.abs(e.alt-i.alt).toFixed(2):Math.sqrt(n*n+Math.pow(Math.abs(e.alt-i.alt).toFixed(2),2)).toFixed(2)}},{key:"createPolyline",value:function(t){var e=this,i=this.id_map.get(t);this.viewer.entities.add(new Cesium.Entity({id:t,position:new Cesium.CallbackProperty((function(){return 2===i.positions.length?e.cal_center(i.positions):Cesium.Cartesian3()}),!1),label:{text:new Cesium.CallbackProperty((function(){return 2===i.positions.length?e.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(t)}},{key:"create_angle_label",value:function(t,e,i,n){var o=this,s=new Cesium.Entity({id:i,position:new Cesium.CallbackProperty((function(){return 2===t.length?o.cal_point(t,e):Cesium.Cartesian3()})),label:{text:new Cesium.CallbackProperty((function(){return 2===t.length?o.cal_angle(t,e,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(t,e){for(var i=0;i=500?t.end():r(o,i)}))}))}}},{key:"end",value:function(){Zs(e,"end",this,3)([])}},{key:"destroy",value:function(){Zs(e,"destroy",this,3)([])}}])}(_s);function $s(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}function Qs(t,e,i,n){var o=Do()(fi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var ta=function(t){function e(t){var i;return C()(this,e),(i=$s(this,e,[t,{text:""}])).defaultColor="#f11515",i.locationID=i.randomString(),i.position=new Cesium.Cartesian3,i.text="",i}return gi()(e,t),k()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Qs(e,"start",this,3)([]),this.cache_id=e.create_point(this),e.createLocation(this);var i=function(e,i){t.position=i;var n=t.viewer.entities.getById(t.locationID);n&&(n.show=!0);var o=t.cartesian3Towgs84(i,t.viewer),s=de();if("EPSG:4326"===s)t.text="经度:".concat(Number(o.lng.toFixed(8)),"\n纬度:").concat(Number(o.lat.toFixed(8)),"\n海拔:").concat(Number(o.alt.toFixed(2)));else{var a=t.convert([{x:o.lng,y:o.lat,z:o.alt}],"EPSG:4326",s);t.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)))}t.end()};this.event.mouse_left(i),this.event.mouse_right((function(e,i){t.destroy(),t.end()})),this.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y);var n=t.viewer.entities.getById(t.locationID);n&&(n.show=!0),t.position=i;var o=t.cartesian3Towgs84(i,t.viewer),s=de();if("EPSG:4326"===s)t.text="经度:".concat(Number(o.lng.toFixed(8)),"\n纬度:").concat(Number(o.lat.toFixed(8)),"\n海拔:").concat(Number(o.alt.toFixed(2)));else{var a=t.convert([{x:o.lng,y:o.lat,z:o.alt}],"EPSG:4326",s);t.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(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.destroy(),t.end()):i(0,n)}))}))}}},{key:"destroy",value:function(){this.remove_entity(this.locationID),this.remove_entity(this.cache_id)}},{key:"end",value:function(){Qs(e,"end",this,3)([])}}],[{key:"createLocation",value:function(t){t.viewer.entities.add(new Cesium.Entity({id:t.locationID,show:!1,position:new Cesium.CallbackProperty((function(){return t.position}),!1),label:{text:new Cesium.CallbackProperty((function(){return t.text}),!1),font:"22px Microsoft YaHei",fillColor:new Cesium.Color.fromCssColorString(t.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:t.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(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,position:new Cesium.CallbackProperty((function(){return t.position}),!1),billboard:o()({image:t.getSourceRootPath()+"/img/point.png",color:Cesium.Color.fromCssColorString("rgba(255,255,255,0.99)"),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:1e6},"color",Cesium.Color.WHITE.withAlpha(.99))})),e}}])}(_s);function ea(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}function ia(t,e,i,n){var o=Do()(fi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var na=function(t){function e(t){return C()(this,e),ea(this,e,[t,{text:"左键开始,右键取消"}])}return gi()(e,t),k()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){ia(e,"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===t.firstpoint&&(t.positions.push(o),t.firstpoint=t.cartesian3Towgs84(o,t.viewer),t.ids.push(e.create_polygon(t)),t.ids.push(e.create_point(t,o))),i++,t.tip.setPosition(o,n.position.x,n.position.y),2===i){if(t.firstpoint){var s=t.cartesian3Towgs84(o,t.viewer);t.positions[1]=Cesium.Cartesian3.fromDegrees(t.firstpoint.lng,t.firstpoint.lat,s.alt),t.positions[2]=o,t.position=t.positions[1],t.circleRadius=t.computeDistance([t.firstpoint,s]),t.height=Number((s.alt-t.firstpoint.alt).toFixed(2)),t.text="相对高度:"+t.height+" 米",t.tip.set_text("左键完成,右键取消;半径:"+t.circleRadius+" 米")}t.ids.push(e.create_point(t,o,{label:{text:"半径:"+t.circleRadius+" 米"}})),t.end()}};this.event.mouse_left(n),this.event.mouse_move((function(e,i){if(t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.firstpoint){var n=t.cartesian3Towgs84(i,t.viewer);t.positions[1]=Cesium.Cartesian3.fromDegrees(t.firstpoint.lng,t.firstpoint.lat,n.alt),t.positions[2]=i,t.position=t.positions[1],t.circleRadius=t.computeDistance([t.firstpoint,n]),t.height=Number((n.alt-t.firstpoint.alt).toFixed(2)),t.text="相对高度:"+t.height+" 米",t.tip.set_text("左键完成,右键取消;半径:"+t.circleRadius+" 米")}})),this.event.mouse_right((function(e,i){t.end(),t.destroy()})),this.event.gesture_pinck_start((function(e,i){var o=new Date,s={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-o>=500?(t.end(),t.destroy()):n(s,i)}))}))}}},{key:"end",value:function(){ia(e,"end",this,3)([])}},{key:"destroy",value:function(){ia(e,"destroy",this,3)([])}}],[{key:"create_polygon",value:function(t){var e=t.randomString();t.viewer.entities.add(new Cesium.Entity({id:e,billboard:{image:t.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)},position:new Cesium.CallbackProperty((function(){return t.position}),!1),label:{text:new Cesium.CallbackProperty((function(){return t.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(e){return t.positions}),!1),width:2,material:Cesium.Color.YELLOW,zIndex:99999999},ellipse:{height:new Cesium.CallbackProperty((function(){return t.height+t.firstpoint.alt}),!1),semiMinorAxis:new Cesium.CallbackProperty((function(e){return t.circleRadius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(e){return t.circleRadius}),!1),material:new Cesium.Color.fromCssColorString(t.defaultColor)}}));return e}},{key:"create_point",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.randomString(),o=t.cartesian3Towgs84(e,t.viewer),s={id:n,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:1e6,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)}),t.viewer.entities.add(new Cesium.Entity(s)),n}}])}(_s);function oa(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}function sa(t,e,i,n){var o=Do()(fi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var aa=function(t){function e(t){var i;return C()(this,e),(i=oa(this,e,[t,{text:"左键开始,右键取消"}])).cachePositions=[],i.positions=[],i.arcPositions=[],i.line_id="",i.label_id="",i.arc_id="",i.bearing=0,i}return gi()(e,t),k()(e,[{key:"createPolyline",value:function(){var t=this,e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999}})),e}},{key:"end",value:function(){sa(e,"end",this,3)([])}},{key:"destroy",value:function(){var t=this;sa(e,"destroy",this,3)([]),[this.line_id,this.label_id,this.arc_id].forEach((function(e){e&&t.remove_entity(e)}))}},{key:"cancel",value:function(){this.end(),this.destroy()}},{key:"caculateAngle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this.cartesian3Towgs84(t[0],this.viewer),i=this.cartesian3Towgs84(t[1],this.viewer),n=this.cartesian3Towgs84(t[2],this.viewer),o=turf.point([e.lng,e.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 p=turf.rhumbBearing(o,s),h=turf.rhumbBearing(a,s),d=Math.abs((p-h+360)%360);this.bearing=d>180?360-d:d,this.bearing=this.bearing.toFixed(2);var m=p-180,f=h-180,v=turf.lineArc(s,u/3,f,m);d>180&&(v=turf.lineArc(s,u/3,m,f));for(var g=[],y=0;y2&&t.caculateAngle([t.positions[0],t.positions[1],t.positions[2]])})),this.event.mouse_right((function(e,i){t.cancel()})),this.event.gesture_pinck_start((function(e,n){var o=new Date,s={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-o>=500?t.cancel():i(s,n)}))}))}}}])}(_s);function ra(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}function la(t,e,i,n){var o=Do()(fi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var ca=function(t){function e(t){var i;return C()(this,e),(i=ra(this,e,[t,{text:"左键开始,右键取消"}])).cachePositions=[],i.positions=[],i.arcPositions=[],i.line_id="",i.label_id="",i.arc_id="",i.bearing=0,i}return gi()(e,t),k()(e,[{key:"createPolyline",value:function(){var t=this,e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999}})),e}},{key:"end",value:function(){la(e,"end",this,3)([])}},{key:"destroy",value:function(){var t=this;la(e,"destroy",this,3)([]),[this.line_id,this.label_id,this.arc_id].forEach((function(e){e&&t.remove_entity(e)}))}},{key:"cancel",value:function(){this.end(),this.destroy()}},{key:"caculateAngle",value:function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=this.cartesian3Towgs84(t[1],this.viewer),i=this.cartesian3Towgs84(t[0],this.viewer),n=turf.point([e.lng,e.lat]),o=turf.point([i.lng,i.lat]),s=this.rhumbBearing(i,e);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;c2&&t.caculateAngle([t.positions[0],t.positions[1]],[t.positions[2],t.positions[1]]),!(t.ids.length>=2)){e.next=7;break}return t.end(),e.abrupt("return");case 7:if(t.ids.push(t.create_point(n)),t.ids.push(t.create_point(n)),2!==t.ids.length){e.next=18;break}return t.label_id=Cesium.createGuid(),t.arc_id=Cesium.createGuid(),d=t.cartesian3Towgs84(n,t.viewer),e.next=15,t.sampleHeightMostDetailed([d]);case 15:m=e.sent,t.viewer.entities.add({id:t.arc_id,polyline:{positions:new Cesium.CallbackProperty((function(){return t.arcPositions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999}}),t.viewer.entities.add({id:t.label_id,position:Cesium.Cartesian3.fromDegrees(d.lng,d.lat,(m[0].height||0)+.1),label:{text:new Cesium.CallbackProperty((function(){return"方位夹角:"+t.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 18:t.cachePositions.push(n),t.cachePositions.push(n);case 20:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}();this.event.mouse_left(i),this.event.mouse_move((function(e,i){if(t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.cachePositions.length){var n;t.positions=t.cachePositions.concat(i);var o=t.cartesian3Towgs84(i,t.viewer),s=t.cartesian3Towgs84(t.positions[1],t.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);t.positions[0]=(n=Cesium.Cartesian3).fromDegrees.apply(n,N()(u.geometry.coordinates))}t.positions.length>2&&t.caculateAngle([t.positions[0],t.positions[1]],[t.positions[2],t.positions[1]])})),this.event.mouse_right((function(e,i){t.cancel()})),this.event.gesture_pinck_start((function(e,n){var o=new Date,s={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-o>=500?t.cancel():i(s,n)}))}))}}}])}(_s);function ua(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}var pa=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};C()(this,e),(i=ua(this,e,[t,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 gi()(e,t),k()(e,[{key:"smoothHandle",value:function(t){if(t.length>1){for(var e=[],i=[],n=0;n=r.options.number){var s=[];l.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))})),t(null,s),r.end()}})),this.event.mouse_right((function(e,i){var n=[];l.forEach((function(t){n.push(r.cartesian3Towgs84(t,r.viewer))})),t(null,n),r.end()})),this.event.mouse_move((function(t,e){r.positions=l.concat(e),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y)})),this.event.mouse_right_keyboard_ctrl((function(t,e){r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),l.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),l.pop(),r.positions=l.concat(cartesian))})),this.event.gesture_pinck_start((function(i,n){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500){var s=[];l.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))})),t(null,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 a=e.create_polyline(r,r.viewer);r.points_ids.push(a)}l.push(n),r.points_ids.push(r.create_point(n,r.viewer)),r.positions=l.concat(n)}}))})),!this._is2D&&this._sdk2D&&(this.event2D=new J(this._sdk2D),this.event2D.mouse_left((function(t,i){if(r.positions=l.concat(i),r.tip.setPosition(i,t.position.x+r.viewer.canvas.width,t.position.y),!r.entityHasCreated){var n=e.create_polyline(r,r._sdk2D.viewer);r.points_ids.push(n)}l.push(i),r.points_ids.push(r.create_point(i,r._sdk2D.viewer))})),this.event2D.mouse_right((function(e,i){var n=[];l.forEach((function(t){n.push(r.cartesian3Towgs84(t,r.viewer))})),t(null,n),r.end()})),this.event2D.mouse_move((function(t,e){r.positions=l.concat(e),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y)})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),l.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),l.pop(),r.positions=l.concat(cartesian))})),this.event2D.gesture_pinck_start((function(i,n){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500){var s=[];l.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))})),t(null,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 a=e.create_polyline(r,r._sdk2D.viewer);r.points_ids.push(a)}l.push(n),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),r.positions=l.concat(n)}}))})))}}}],[{key:"create_polyline",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.entityHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polyline:{positions:new Cesium.CallbackProperty((function(){return t.options.curve?t.smoothHandle(t.positions):t.positions}),!1),width:5,material:Cesium.Color.fromCssColorString(t.color),clampToGround:!0,zIndex:99999999}})),i}}])}(Oo);function ha(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}var da=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return C()(this,e),ha(this,e,[t,i,n])}return gi()(e,t),k()(e,[{key:"start",value:function(t){var e=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var i=void 0;YJ.Measure.SetMeasureStatus(!0),this.tip=new q("左键确定,右键结束;",this.sdk),this.event=new J(this.sdk),this.event.mouse_left((function(n,o){e.end();var s=e.cartesian3Towgs84(i||o,e.viewer);t(null,s,Cesium)})),this.event.mouse_right((function(i,n){e.end(),t(!1)})),this.event.mouse_move((function(t,n){i=n,e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.gesture_pinck_start((function(n,o){var s=new Date;e.event.gesture_pinck_end((function(){if(new Date-s>=500)e.end(),t(!1);else{e.end();var n=e.cartesian3Towgs84(i||o,e.viewer);t(null,n)}}))})),!this._is2D&&this._sdk2D&&(this.event2D=new J(this._sdk2D),this.event2D.mouse_left((function(n,o){e.end();var s=e.cartesian3Towgs84(i||o,e.viewer);t(null,s,Cesium)})),this.event2D.mouse_right((function(i,n){e.end(),t(!1)})),this.event2D.mouse_move((function(t,n){i=n,e.tip.setPosition(n,t.endPosition.x+e.viewer.canvas.width,t.endPosition.y)})),this.event2D.gesture_pinck_start((function(n,o){var s=new Date;e.event2D.gesture_pinck_end((function(){if(new Date-s>=500)e.end(),t(!1);else{e.end();var n=e.cartesian3Towgs84(i||o,e.viewer);t(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()}}])}(Oo);function ma(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}var fa=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),ma(this,e,[t,i])}return gi()(e,t),k()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v.viewer;t.entities.add(new Cesium.Entity({id:v.circle_id,position:new Cesium.CallbackProperty((function(t){if(f){var e=v.computeMidpoint(m,f);return Cesium.Cartesian3.fromDegrees(e.lng,e.lat,f.alt)}return Cesium.Cartesian3()}),!1),label:{text:new Cesium.CallbackProperty((function(t){return h>1e3?"半径:"+(h/1e3).toFixed(2)+" 公里":"半径:"+h+" 米"}),!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(t){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(d))}),!1),material:Cesium.Color.fromCssColorString(v.color),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(t){return u}),!1),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:99999999}}))};(i=e,n="start",o=this,s=3,a=Do()(fi()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new q("左键开始,右键取消",this.sdk),this.event=new J(this.sdk);var c=0;this.circle_id=this.randomString();var u=[],p=[],h=1,d=[],m={},f=null;this.event.mouse_left((function(e,i){r.tip.set_text("再次左键,完成绘制;右键取消"),1===++c&&(r.point_id=r.create_point(i),m=r.cartesian3Towgs84(i,r.viewer),d=r.createCircle(m,.01),p.push(i),l()),2===c&&(u=p.concat(i),f=r.cartesian3Towgs84(i,r.viewer),h=r.computeDistance([m,f]),d=r.createCircle(m,h),r.end(),t(null,{center:m,radius:Number(h)}))})),this.event.mouse_right((function(e,i){r.end(),t(!1)})),this.event.mouse_move((function(t,e){r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),c&&(u=p.concat(e),f=r.cartesian3Towgs84(e,r.viewer),h=r.computeDistance([m,f]),d=r.createCircle(m,h))})),this.event.gesture_pinck_start((function(e,i){var n=new Date;r.event.gesture_pinck_end((function(){new Date-n>=500?(r.end(),t(!1)):(r.tip.set_text("再次左键,完成绘制;右键取消"),1===++c&&(r.point_id=r.create_point(i),m=r.cartesian3Towgs84(i,r.viewer),p.push(i),l(),r.tip.setPosition(i,(e.position1.x+e.position2.x)/2,(e.position1.y+e.position2.y)/2)),2===c&&(u=p.concat(i),f=r.cartesian3Towgs84(i,r.viewer),h=r.computeDistance([m,f]),d=r.createCircle(m,h),r.end(),t(null,{center:m,radius:Number(h)})))}))})),!this._is2D&&this._sdk2D&&(this.event2D=new J(this._sdk2D),this.event2D.mouse_left((function(e,i){r.tip.set_text("再次左键,完成绘制;右键取消"),1===++c&&(r.point_id=r.create_point(i,r._sdk2D.viewer),m=r.cartesian3Towgs84(i,r.viewer),d=r.createCircle(m,.01),p.push(i),l(r._sdk2D.viewer)),2===c&&(u=p.concat(i),f=r.cartesian3Towgs84(i,r.viewer),h=r.computeDistance([m,f]),d=r.createCircle(m,h),r.end(),t(null,{center:m,radius:Number(h)}))})),this.event2D.mouse_right((function(e,i){r.end(),t(!1)})),this.event2D.mouse_move((function(t,e){r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y),c&&(u=p.concat(e),f=r.cartesian3Towgs84(e,r.viewer),h=r.computeDistance([m,f]),d=r.createCircle(m,h))})),this.event2D.gesture_pinck_start((function(e,i){var n=new Date;r.event2D.gesture_pinck_end((function(){new Date-n>=500?(r.end(),t(!1)):(r.tip.set_text("再次左键,完成绘制;右键取消"),1===++c&&(r.point_id=r.create_point(i,r._sdk2D.viewer),m=r.cartesian3Towgs84(i,r.viewer),p.push(i),l(r._sdk2D.viewer),r.tip.setPosition(i,(e.position1.x+e.position2.x)/2+r.viewer.canvas.width,(e.position1.y+e.position2.y)/2)),2===c&&(u=p.concat(i),f=r.cartesian3Towgs84(i,r.viewer),h=r.computeDistance([m,f]),d=r.createCircle(m,h),r.end(),t(null,{center:m,radius:Number(h)})))}))})));var v=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()}}])}(Oo);function va(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}var ga=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),va(this,e,[t,i])}return gi()(e,t),k()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l=function(){var t=Cesium.Cartesian3.fromDegrees(h[0].lng,h[0].lat),e=Cesium.Cartesian3.fromDegrees(h[1].lng,h[1].lat),i=Cesium.Cartesian3.fromDegrees(h[2].lng,h[2].lat);if(1===c){f=Cesium.Cartesian3.distance(t,e),d=(m=f)/2;var n={x:u.lng,y:u.lat},o={x:h[1].lng,y:h[1].lat},s=Math.PI/180,a=n.y*s,r=o.y*s,l=n.x*s,p=o.x*s,y=Math.sin(p-l)*Math.cos(r),b=Math.cos(a)*Math.sin(r)-Math.sin(a)*Math.cos(r)*Math.cos(p-l),C=Math.atan2(y,b)%(2*Math.PI);g=450-(180*C/Math.PI<0?360+180*C/Math.PI:180*C/Math.PI)}if(2===c){Cesium.Cartesian3.distance(t,i),v=Cesium.Cartesian3.distance(e,i);var w=turf.point([h[0].lng,h[0].lat]),k=turf.point([h[1].lng,h[1].lat]),_=turf.point([h[2].lng,h[2].lat]),x=turf.rhumbBearing(w,k),E=turf.rhumbBearing(k,_),S=Math.abs(x-E),D=S>180?360-S:S;D=180-D,d=v*Math.sin(Cesium.Math.toRadians(D))}};(i=e,n="start",o=this,s=3,a=Do()(fi()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),this.entity_ids=[],YJ.Measure.SetMeasureStatus(!0),this.tip=new q("左键开始,右键取消",this.sdk),this.event=new J(this.sdk);var c=0;this.elliptic_id=this.randomString();var u,p=[],h=[],d=0,m=0,f=0,v=0,g=0;this.event.mouse_left((function(e,i){if(r.tip.set_text("再次左键,完成绘制;右键取消"),c++,r.points_ids.push(r.create_point(i)),p.push(i),1===c){p=[i,i,i];var n=r.cartesian3Towgs84(i,r.viewer);u=n,h=[n,n,n],l(),y.viewer.entities.add(new Cesium.Entity({id:y.elliptic_id,position:Cesium.Cartesian3.fromDegrees(u.lng,u.lat),ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(t){return d}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(t){return m}),!1),granularity:Cesium.Math.toRadians(.1),rotation:new Cesium.CallbackProperty((function(t){return Cesium.Math.toRadians(g)}),!1),material:Cesium.Color.fromCssColorString(y.color),zIndex:99999999}}))}if(2===c){p[1]=i,p[2]=i;var o=r.cartesian3Towgs84(i,r.viewer);h[1]=o,h[2]=o}c>=3&&(r.end(),t(null,{center:u,bearing:g,semiMajorAxis:m,semiMinorAxis:d}))})),this.event.mouse_right((function(e,i){r.end(),t(!1)})),this.event.mouse_move((function(t,e){r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),p[c]=e,h[c]=r.cartesian3Towgs84(e,r.viewer),0!==c&&l()}));var y=this}}},{key:"end",value:function(){var t=this;this.remove_entity(this.elliptic_id),this.points_ids.forEach((function(e){t.remove_entity(e)})),YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy()}}])}(Oo);function ya(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}var ba=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),ya(this,e,[t,i])}return gi()(e,t),k()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{(i=e,n="start",o=this,s=3,a=Do()(fi()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new q("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new J(this.sdk),this.positions=[],this.points_ids=[];var l=[],c=!1;this.event.mouse_left((function(t,i){if(!r.entityHasCreated){var n=e.create_arrow_polygon(r);r.points_ids.push(n)}r.points_ids.push(r.create_point(i)),l.push(r.cartesian3Towgs84(i,r.viewer)),c=!1})),this.event.mouse_right((function(e,i){var n=[];r.points_ids.length>2&&r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){n.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),c&&r.positions.pop(),t(null,r.positions,n)})),this.event.mouse_move((function(t,e){c=!0,r.positions=l.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y)})),this.event.mouse_right_keyboard_ctrl((function(t,e){r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),l.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),l.pop())})),this.event.gesture_pinck_start((function(i,n){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(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,r.positions,s)}else{if(!r.entityHasCreated){var a=e.create_arrow_polygon(r);r.points_ids.push(a)}r.points_ids.push(r.create_point(n)),l.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=l.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 J(this._sdk2D),this.event2D.mouse_left((function(t,i){if(!r.entityHasCreated){var n=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(n)}r.points_ids.push(r.create_point(i,r._sdk2D.viewer)),l.push(r.cartesian3Towgs84(i,r.viewer)),c=!1})),this.event2D.mouse_right((function(e,i){var n=[];r.points_ids.length>2&&r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){n.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),c&&r.positions.pop(),t(null,r.positions,n)})),this.event2D.mouse_move((function(t,e){c=!0,r.positions=l.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y)})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),l.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),l.pop())})),this.event2D.gesture_pinck_start((function(i,n){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(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,r.positions,s)}else{if(!r.entityHasCreated){var a=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(a)}r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),l.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=l.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(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.entityHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){var i=t.computeAttackArrow(t.positions);return new Cesium.PolygonHierarchy(i)}),!1),material:Cesium.Color.fromCssColorString(t.color),zIndex:99999999}})),i}}])}(Oo);function Ca(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}var wa=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),Ca(this,e,[t,i])}return gi()(e,t),k()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{(i=e,n="start",o=this,s=3,a=Do()(fi()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new q("左键确定,右键取消;CTRL+右键撤销",this.sdk),this.event=new J(this.sdk),this.positions=[],this.points_ids=[];var l=[];this.event.mouse_left((function(i,n){if(!r.entityHasCreated){var o=e.create_arrow_polygon(r);r.points_ids.push(o)}if(r.points_ids.push(r.create_point(n)),l.push(r.cartesian3Towgs84(n,r.viewer)),5===l.length){var s=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,l,s)}})),this.event.mouse_right((function(e,i){r.end(),t("取消绘制")})),this.event.mouse_move((function(t,e){r.positions=l.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y)})),this.event.mouse_right_keyboard_ctrl((function(t,e){r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),l.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),l.pop(),r.positions=l.concat(r.cartesian3Towgs84(cartesian,r.viewer)))})),this.event.gesture_pinck_start((function(i,n){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)r.end(),t("取消绘制");else{if(!r.entityHasCreated){var s=e.create_arrow_polygon(r);r.points_ids.push(s)}if(r.points_ids.push(r.create_point(n)),l.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=l.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===l.length){var a=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,l,a)}}}))})),!this._is2D&&this._sdk2D&&(this.event2D=new J(this._sdk2D),this.event2D.mouse_left((function(i,n){if(!r.entityHasCreated){var o=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(o)}if(r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),l.push(r.cartesian3Towgs84(n,r.viewer)),5===l.length){var s=[];if(r.points_ids.length>2)r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,l,s)}})),this.event2D.mouse_right((function(e,i){r.end(),t("取消绘制")})),this.event2D.mouse_move((function(t,e){r.positions=l.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y)})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),l.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),l.pop(),r.positions=l.concat(r.cartesian3Towgs84(cartesian,r.viewer)))})),this.event2D.gesture_pinck_start((function(i,n){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)r.end(),t("取消绘制");else{if(!r.entityHasCreated){var s=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(s)}if(r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),l.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=l.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===l.length){var a=[];if(r.points_ids.length>2)r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,l,a)}}}))})))}}}],[{key:"create_arrow_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.entityHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){var i=t.computePincerArrow(t.positions);return new Cesium.PolygonHierarchy(i)}),!1),material:Cesium.Color.fromCssColorString(t.color),zIndex:99999999}})),i}}])}(Oo);function ka(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}var _a=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=ka(this,e,[t,n])).rhumb=n.rhumb,i.polygonHasCreated=!1,i.rect=[],i.rectObj=[],i.entity=null,i}return gi()(e,t),k()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this,l=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{(i=e,n="start",o=this,s=3,a=Do()(fi()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new q("左键确定,右键取消",l.sdk),this.event=new J(l.sdk),this.positions=[],this.points_ids=[];var c=0,u=null,p=null;this.event.mouse_left((function(i,n){c++;var o=r.cartesian3Towgs84(n,r.viewer);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var s=e.create_polygon(r);r.points_ids.push(s),u=o}2==c&&(p=o,r.end(),t(null,l.rectObj,[u,p]))})),this.event.mouse_right((function(e,i){r.end(),t("取消","")})),this.event.mouse_move((function(t,e){if(r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),1==c){var i=r.cartesian3Towgs84(e,r.viewer);r.calrect(u,i)}})),this.event.gesture_pinck_start((function(i,n){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)t("取消",""),r.end();else{r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),c++;var s=r.cartesian3Towgs84(n);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var a=e.create_polygon(r);r.points_ids.push(a),u=s}2==c&&(r.calrect(u,s),p=s,r.end(),t(null,l.rectObj,[u,p]))}}))})),!this._is2D&&this._sdk2D&&(this.event2D=new J(this._sdk2D),this.event2D.mouse_left((function(i,n){c++;var o=r.cartesian3Towgs84(n,r.viewer);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var s=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(s),u=o}2==c&&(p=o,r.end(),t(null,l.rectObj,[u,p]))})),this.event2D.mouse_right((function(e,i){r.end(),t("取消","")})),this.event2D.mouse_move((function(t,e){if(r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y),1==c){var i=r.cartesian3Towgs84(e,r.viewer);r.calrect(u,i)}})),this.event2D.gesture_pinck_start((function(i,n){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)t("取消",""),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),c++;var s=r.cartesian3Towgs84(n);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var a=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(a),u=s}2==c&&(r.calrect(u,s),p=s,r.end(),t(null,l.rectObj,[u,p]))}}))})))}}},{key:"calrect",value:function(t,e){var i,n=[],o=[],s=[];if(n.push([t.lng,t.lat,t.alt],[e.lng,e.lat,e.alt]),2===n.length){var a=turf.lineString(n),r=turf.bbox(a);i=turf.bboxPolygon(r)}i&&(i.geometry.coordinates[0].forEach((function(e){o.push(e[0]),o.push(e[1]);var i={lng:e[0],lat:e[1],alt:t.alt};s.push(i)})),this.rect=[].concat(o),this.rectObj=[].concat(s),this.rectObj.pop())}}],[{key:"create_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer,i=t.randomString();return e.entities.add(this.entity=new Cesium.Entity({id:i,polygon:{hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(t.rect))}),!1),material:Cesium.Color.fromCssColorString(t.color),arcType:t.rhumb?Cesium.ArcType.RHUMB:Cesium.ArcType.GEODESIC,zIndex:99999999}})),i}}])}(Oo);function xa(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}function Ea(t,e,i,n){var o=Do()(fi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Sa=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=xa(this,e,[t,n])).points=null,i.polygonHasCreated=!1,i}return gi()(e,t),k()(e,[{key:"start",value:function(t){var i=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{Ea(e,"start",this,3)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new q("左键确定,右键取消;",this.sdk),this.event=new J(this.sdk),this.positions=[],this.points_ids=[];var n=[];this.anchorpoints=[],this.event.mouse_left((function(e,o){if(o&&(3===i.anchorpoints.length?i.anchorpoints[1]=o:i.anchorpoints.push(o),n.push(i.cartesian3Towgs84(o,i.viewer)),i.points_ids.push(i.create_point(o)),3===i.points_ids.length)){var s=[n[0],n[2],n[1]];t(null,s),i.end()}})),this.event.mouse_move((function(t,o){if(i.tip.setPosition(o,t.endPosition.x,t.endPosition.y),o&&0!==i.points_ids.length)if(n.length>1?i.positions=[n[0],i.cartesian3Towgs84(o,i.viewer),n[1]]:i.positions=[n[0],i.cartesian3Towgs84(o,i.viewer)],1!==i.points_ids.length||Cesium.defined(i.assemblePolygon)||(i.assemblePolygon=e.polygon(i)),i.anchorpoints.length>=2){if(1===i.points_ids.length){var s=new Array;i.positions.forEach((function(t){s.push([t.lng,t.lat])}));var a=P.PlotUtils.mid(s[0],s[1]),r=P.PlotUtils.distance(s[0],a)/.9,l=P.PlotUtils.getThirdPoint(s[0],a,P.Constants.HALF_PI,r,!0);i.positions=[i.positions[0],{lng:l[0],lat:l[1]},i.positions[1]]}i.anchorpoints[1]=o}else i.anchorpoints.push(o)})),this.event.mouse_right((function(e,n){t(null),i.end()})),this.event.gesture_pinck_start((function(o,s){var a=new Date;i.event.gesture_pinck_end((function(){if(new Date-a>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(s),t(null,i.positions),i.end();else{if(!s||Cesium.defined(i.assemblePolygon))return;i.tip.setPosition(s,(o.position1.x+o.position2.x)/2,(o.position1.y+o.position2.y)/2),i.anchorpoints.push(s),i.assemblePolygon=e.polygon(i),n.push(i.cartesian3Towgs84(s)),i.points_ids.push(i.create_point(s))}}))})),!this._is2D&&this._sdk2D&&(this.event2D=new J(this._sdk2D),this.event2D.mouse_left((function(e,o){if(o&&(3===i.anchorpoints.length?i.anchorpoints[1]=o:i.anchorpoints.push(o),n.push(i.cartesian3Towgs84(o,i.viewer)),i.points_ids.push(i.create_point(o,i._sdk2D.viewer)),3===i.points_ids.length)){var s=[n[0],n[2],n[1]];t(null,s),i.end()}})),this.event2D.mouse_move((function(t,o){if(i.tip.setPosition(o,t.endPosition.x+i.viewer.canvas.width,t.endPosition.y),o&&0!==i.points_ids.length)if(n.length>1?i.positions=[n[0],i.cartesian3Towgs84(o,i.viewer),n[1]]:i.positions=[n[0],i.cartesian3Towgs84(o,i.viewer)],1!==i.points_ids.length||Cesium.defined(i.assemblePolygon)||(i.assemblePolygon=e.polygon(i,i._sdk2D.viewer)),i.anchorpoints.length>=2){if(1===i.points_ids.length){var s=new Array;i.positions.forEach((function(t){s.push([t.lng,t.lat])}));var a=P.PlotUtils.mid(s[0],s[1]),r=P.PlotUtils.distance(s[0],a)/.9,l=P.PlotUtils.getThirdPoint(s[0],a,P.Constants.HALF_PI,r,!0);i.positions=[i.positions[0],{lng:l[0],lat:l[1]},i.positions[1]]}i.anchorpoints[1]=o}else i.anchorpoints.push(o)})),this.event2D.mouse_right((function(e,n){t(null),i.end()})),this.event2D.gesture_pinck_start((function(o,s){var a=new Date;i.event2D.gesture_pinck_end((function(){if(new Date-a>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(s),t(null,i.positions),i.end();else{if(!s||Cesium.defined(i.assemblePolygon))return;i.tip.setPosition(s,(o.position1.x+o.position2.x)/2+i.viewer.canvas.width,(o.position1.y+o.position2.y)/2),i.anchorpoints.push(s),i.assemblePolygon=e.polygon(i,i._sdk2D.viewer),n.push(i.cartesian3Towgs84(s)),i.points_ids.push(i.create_point(s,i._sdk2D.viewer))}}))})))}}},{key:"end",value:function(){Ea(e,"end",this,3)([]),this.viewer.entities.remove(this.assemblePolygon),!this._is2D&&this._sdk2D&&this._sdk2D.viewer.entities.remove(this.assemblePolygon)}},{key:"calculateVector",value:function(t,e,i){var n,o,s,a,r,l;e||(e=Math.PI/2),i||(i=1);var c=Math.sqrt(t.x*t.x+t.y*t.y);if(0==t.y)n=o=c*i*Math.cos(e)/t.x,t.x>0?a=-(s=Math.sqrt(i*i-n*n)):t.x<0&&(s=-(a=Math.sqrt(i*i-n*n))),r={x:n,y:s},l={x:o,y:a};else{var u=-t.x/t.y,p=i*c*Math.cos(e)/t.y,h=1+u*u,d=2*u*p,m=p*p-i*i;s=u*(n=(-d-Math.sqrt(d*d-4*h*m))/(2*h))+p,a=u*(o=(-d+Math.sqrt(d*d-4*h*m))/(2*h))+p,t.y>=0?(r={x:n,y:s},l={x:o,y:a}):t.y<0&&(r={x:o,y:a},l={x:n,y:s})}return[r,l]}},{key:"createCloseCardinal",value:function(t){if(null==t||t.length<3)return t;var e=t[0];t.push(e);for(var i=t,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},p={x:void 0,y:void 0},h={x:l.x-r.x,y:l.y-r.y},d={x:c.x-l.x,y:c.y-l.y},m=Math.sqrt(h.x*h.x+h.y*h.y),f=Math.sqrt(d.x*d.x+d.y*d.y),v={x:h.x/m,y:h.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,p.x=l.x+v.x*f*o,p.y=l.y+v.y*f*o):(u.x=l.x-C.x*m*o,u.y=l.y-C.y*m*o,p.x=l.x+C.x*f*o,p.y=l.y+C.y*f*o),a==s-1?(n[0]=l,n[1]=p,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]=p)}return n}},{key:"calculatePointsFBZ3",value:function(t,e){e||(e=20);var i=[],n=.05;e>0&&(n=1/e);for(var o=0;o=t.length&&i.push(s)}return i}}],[{key:"polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer,i=t.randomString();return e.entities.add(new Cesium.Entity({name:"AssemblePolygon",id:i,polygon:{hierarchy:new Cesium.CallbackProperty((function(e){var i=t.computeAssemble(t.positions);return new Cesium.PolygonHierarchy(i)}),!1),material:Cesium.Color.fromCssColorString(t.color),outline:!0,outlineColor:Cesium.Color.GREEN,zIndex:99999999}}))}}])}(Oo);function Da(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}var Pa=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),Da(this,e,[t,i])}return gi()(e,t),k()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this,l=this;YJ.Measure.GetMeasureStatus()?t("上一次测量未结束"):((i=e,n="start",o=this,s=3,a=Do()(fi()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new q("左键确认,右键取消",l.sdk),this.event=new J(l.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(e,i){if(r._positions.length<3?(r.points_ids.push(r.create_point(i)),r._positions.push(r.cartesian3Towgs84(i,r.viewer))):(r.end(),t(null,{center:r._positions[0],radius:r._radius,startAngle:r._startAngle,endAngle:r._endAngle})),2===r._positions.length){var n=Cesium.Cartesian3.fromDegrees(r._positions[0].lng,r._positions[0].lat,r._positions[0].alt),o=i;r._radius=Cesium.Cartesian3.distance(n,o)}})),this.event.mouse_move((function(t,e){if(r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),!(r._positions.length<2)&&(2==r._positions.length&&r._positions.push(r.cartesian3Towgs84(e,r.viewer)),3==r._positions.length)){r._positions.pop(),r._positions.push(r.cartesian3Towgs84(e,r.viewer)),Cesium.defined(r._sector_id)||(r._sector_id=r.createsector(),r.points_ids.push(r._sector_id));var i=l.calculateAangle(l._positions);l._startAngle=i.angle1,l._endAngle=i.angle2}})),this.event.mouse_right((function(e,i){r.end(),t(null)})))}},{key:"createsector",value:function(){var t=this,e=new Cesium.CallbackProperty((function(){var e=t.calSector(t._positions[0],t._radius,t._startAngle,t._endAngle);return new Cesium.PolygonHierarchy(e)})),i=t.randomString(),n=this.viewer.entities.add({id:i,position:Cesium.Cartesian3.fromDegrees(t._positions[0].lng,t._positions[0].lat),polygon:{hierarchy:e,show:!0,fill:!0,clampToGround:!0,material:Cesium.Color.fromCssColorString(t.color),zIndex:99999999}});return t._entities_sector.push(n),i}},{key:"cartesianToLatlng",value:function(t){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),i=Cesium.Math.toDegrees(e.latitude);return[Cesium.Math.toDegrees(e.longitude),i]}},{key:"lonLatToMercator",value:function(t){var e=t[0],i=t[1],n=20037508.34*e/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(t){var e=t[0]/20037508.34*180,i=t[1]/20037508.34*180;return[e,180/Math.PI*(2*Math.atan(Math.exp(i*Math.PI/180))-Math.PI/2)]}},{key:"calculateAangle",value:function(t){function e(t,e){var i=Math.PI/180,n=t.y*i,o=e.y*i,s=t.x*i,a=e.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=t[0],n=t[1],o=t[2],s={x:i.lng,y:i.lat},a={x:n.lng,y:n.lat},r={x:o.lng,y:o.lat};return{angle1:e(s,a),angle2:e(s,r)}}}])}(Oo),Oa=52.35987755982988,Ma=3.141592653589793,Ta=.006693421622965943,Na=function(){return k()((function t(){C()(this,t)}),null,[{key:"BD09ToGCJ02",value:function(t,e){var i=+t-.0065,n=+e-.006,o=Math.sqrt(i*i+n*n)-2e-5*Math.sin(n*Oa),s=Math.atan2(n,i)-3e-6*Math.cos(i*Oa);return[o*Math.cos(s),o*Math.sin(s)]}},{key:"GCJ02ToBD09",value:function(t,e){e=+e,t=+t;var i=Math.sqrt(t*t+e*e)+2e-5*Math.sin(e*Oa),n=Math.atan2(e,t)+3e-6*Math.cos(t*Oa);return[i*Math.cos(n)+.0065,i*Math.sin(n)+.006]}},{key:"WGS84ToGCJ02",value:function(t,e){if(e=+e,t=+t,this.out_of_china(t,e))return[t,e];var i=this.delta(t,e);return[t+i[0],e+i[1]]}},{key:"GCJ02ToWGS84",value:function(t,e){if(e=+e,t=+t,this.out_of_china(t,e))return[t,e];var i=this.delta(t,e);return[2*t-(t+i[0]),2*e-(e+i[1])]}},{key:"delta",value:function(t,e){var i=this.transformLng(t-105,e-35),n=this.transformLat(t-105,e-35),o=e/180*Ma,s=Math.sin(o);s=1-Ta*s*s;var a=Math.sqrt(s);return[i=180*i/(6378245/a*Math.cos(o)*Ma),n=180*n/(6378245*(1-Ta)/(s*a)*Ma)]}},{key:"transformLng",value:function(t,e){var i=300+(t=+t)+2*(e=+e)+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*Ma)+20*Math.sin(2*t*Ma))/3,i+=2*(20*Math.sin(t*Ma)+40*Math.sin(t/3*Ma))/3,i+=2*(150*Math.sin(t/12*Ma)+300*Math.sin(t/30*Ma))/3}},{key:"transformLat",value:function(t,e){var i=2*(t=+t)-100+3*(e=+e)+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*Ma)+20*Math.sin(2*t*Ma))/3,i+=2*(20*Math.sin(e*Ma)+40*Math.sin(e/3*Ma))/3,i+=2*(160*Math.sin(e/12*Ma)+320*Math.sin(e*Ma/30))/3}},{key:"out_of_china",value:function(t,e){return e=+e,!((t=+t)>73.66&&t<135.05&&e>3.86&&e<53.55)}}])}();function Ba(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}var Aa=function(t){function e(t,i){var n;return C()(this,e),(n=Ba(this,e,[t,i])).sdk.addIncetance(n.options.id,n),n}return gi()(e,t),k()(e,[{key:"setDefaultValue",value:function(){var t,i,n,o,s;(t=e,i="setDefaultValue",n=this,o=3,s=Do()(fi()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),this.options.host=this.options.host||m()}},{key:"requestResource",value:function(){var t="";return t=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(t,{method:"post",body:JSON.stringify({source_id:this.options.id}),headers:{"Content-Type":"application/json",token:g(),Authorization:"Bearer "+g()}})}}])}(Ui);function La(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ja(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(n=Ia(this,e,[t,i])).options.name=i.name||"未命名对象",n.Dialog=o,n._elms={},n}return gi()(e,t),k()(e,[{key:"setDefaultValue",value:function(){var t,i;Ra(e,"setDefaultValue",this,3)([]),this.options.alpha=null!==(t=this.options.alpha)&&void 0!==t?t:1,this.options.brightness=null!==(i=this.options.brightness)&&void 0!==i?i:1}},{key:"layerIndex",get:function(){return this.entity._layerIndex}},{key:"layer_index",get:function(){return this.entity._layerIndex}},{key:"brightness",get:function(){return this.options.brightness},set:function(t){this.options.brightness=t,this.entity.brightness=t}},{key:"alpha",get:function(){return this.options.alpha},set:function(t){Number(t)>1&&(t=1),Number(t)<0&&(t=0),this.entity.alpha=t,this.options.alpha=t,this._elms.alpha&&this._elms.alpha.forEach((function(e){e.value=t}))}},{key:"layerRaise",value:function(t){return this.sdk.viewer.imageryLayers.raise(this.entity),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(){return this.sdk.viewer.imageryLayers.raiseToTop(this.entity),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(){Ra(e,"remove",this,3)([]),this.sdk.viewer.scene.imageryLayers.remove(this.entity),this.entity=null}},{key:"flyTo",value:(n=a()(l.a.mark((function t(){var e,i,n,o,s,a,r=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r.length>0&&void 0!==r[0]&&r[0],!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(e={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),a={lng:0,lat:0},this.options.position?a=ja({},this.options.position):this.options.positions?a=ja({},this.options.positions[0]):this.options.center?a=ja({},this.options.center):this.options.start?a=ja({},this.options.start):(this.options.hasOwnProperty("lng")&&(a.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(a.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(a.alt=this.options.alt)),a.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(a);case 17:a.alt=t.sent;case 18:i=this.options.customView.relativePosition.lng+a.lng,n=this.options.customView.relativePosition.lat+a.lat,o=this.options.customView.relativePosition.alt+a.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e}),t.next=26;break;case 25:this.sdk.viewer.flyTo(this.entity);case 26:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"amapMercatorTilingScheme",value:function(t){return new(function(t){function e(t){var i;C()(this,e),i=Ia(this,e,[t]);var n=new Cesium.WebMercatorProjection;return i._projection.project=function(t,e){return e=Na.WGS84ToGCJ02(Cesium.Math.toDegrees(t.longitude),Cesium.Math.toDegrees(t.latitude)),e=n.project(new Cesium.Cartographic(Cesium.Math.toRadians(e[0]),Cesium.Math.toRadians(e[1]))),new Cesium.Cartesian2(e.x,e.y)},i._projection.unproject=function(t,e){var i=n.unproject(t);return e=Na.GCJ02ToWGS84(Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude)),new Cesium.Cartographic(Cesium.Math.toRadians(e[0]),Cesium.Math.toRadians(e[1]))},i}return gi()(e,t),k()(e)}(Cesium.WebMercatorTilingScheme))(t)}},{key:"edit",value:(i=a()(l.a.mark((function t(){var e,i,n,o,s=this,a=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a.length>0&&void 0!==a[0]&&a[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),t.next=5,new bi(this.sdk,this.options,{title:"底图属性",left:"180px",top:"100px",confirmCallBack:function(t){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),It(s.sdk,s.options.id),Et(s.sdk,s.options.id)},closeCallBack:function(){s.reset(),s.Dialog.closeCallBack&&s.Dialog.closeCallBack()},removeCallBack:function(){s.Dialog.removeCallBack&&s.Dialog.removeCallBack()}},!0);case 5:this._DialogObject=t.sent,(e=document.createElement("div")).style.width="300px",i='\n \n
        \n
        \n
        \n 名称:\n \n
        \n
        \n
        \n
        \n 透明度:\n \n
        \n
        \n
        \n ',e.innerHTML=i,n=e.getElementsByClassName("name")[0],o=e.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(e),this._elms.name=[n],this._elms.alpha=[o];case 19:case"end":return t.stop()}}),t,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}(Aa);function Fa(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}var Va=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),Fa(this,e,[t,i])}return gi()(e,t),k()(e,[{key:"type",get:function(){return"layer"}},{key:"createArcGis",value:function(t){var e=new Cesium.ArcGisMapServerImageryProvider({url:t});this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(e,this.options.layer_index):this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(e),this.show=this.options.show,this.alpha=this.options.alpha,this.brightness=this.options.brightness,this.options.show&>(0,this.options.id)}}])}(za),Ha=function(t){function e(t,i){var n;return C()(this,e),(n=Fa(this,e,[t,i])).createArcGis("https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"),n}return gi()(e,t),k()(e)}(Va),Ga=function(t){function e(t,i){var n;return C()(this,e),(n=Fa(this,e,[t,i])).createArcGis("https://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer"),n}return gi()(e,t),k()(e)}(Va),Ua=function(t){function e(t,i){var n;return C()(this,e),(n=Fa(this,e,[t,i])).createArcGis("https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"),n}return gi()(e,t),k()(e)}(Va);function Wa(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}var Ya=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),Wa(this,e,[t,i])}return gi()(e,t),k()(e,[{key:"type",get:function(){return"layer"}},{key:"createGD",value:function(t){var e=new Cesium.UrlTemplateImageryProvider({url:t,minimumLevel:3,maximumLevel:18,tilingScheme:this.amapMercatorTilingScheme()});this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(e,this.options.layer_index):this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(e),this.show=this.options.show,this.alpha=this.options.alpha,this.brightness=this.options.brightness,this.options.show&>(0,this.options.id)}}])}(za),Ja=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=Wa(this,e,[t,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 gi()(e,t),k()(e)}(Ya),qa=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=Wa(this,e,[t,n])).createGD("https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}"),i}return gi()(e,t),k()(e)}(Ya),Xa=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=Wa(this,e,[t,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 gi()(e,t),k()(e)}(Ya);function Za(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ka(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ka(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ka(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i=107)){t.next=19;break}return t.next=14,Cesium.Cesium3DTileset.fromUrl(n,a);case 14:r=t.sent,this.entity=r,this.entity.imageBasedLighting.luminanceAtZenith=.1,t.next=25;break;case 19:return a.url=n,r=new Cesium.Cesium3DTileset(a),t.next=23,r.readyPromise;case 23:this.entity=t.sent,this.entity.imageBasedLighting.luminanceAtZenith=.1;case 25:return t.next=27,this.loadSceneTree(n);case 27:if(c=function(t){if(t._contents)for(var e=0;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function lr(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),hr(i=pr(this,e,[t,n]),vr,void 0),i.picking=!1,i.Dialog=o,i._elms={},i._EventBinding=new Si,i}return gi()(e,t),k()(e,[{key:"type",get:function(){return"tileset"}},{key:"on",value:function(){return this.add()}},{key:"name",get:function(){return this.newData.name},set:function(t){this.newData.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"height",get:function(){return this.newData.height},set:function(t){this.newData.height=t,this.options.position.alt=t,this._elms.height&&this._elms.height.forEach((function(e){e.value=t})),this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch)}},{key:"lng",get:function(){return this.newData.lng},set:function(t){this.newData.lng=t,this.options.position.lng=t,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(t){this.newData.lat=t,this.options.position.lat=t,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(t){this.newData.roll=t,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(t){this.newData.heading=t,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(t){this.newData.pitch=t,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(t){if(this.newData){this.newData.transparency=Number(t),this._elms.transparency&&this._elms.transparency.forEach((function(e){e.value=t}));var e=this.newData.transparency;this.entity.style=new Cesium.Cesium3DTileStyle({color:{conditions:[["Boolean(${SIZE})","${COLOR} * color('rgba(255,255,255)', "+e+")"],["true","color('rgba(255,255,255,"+e+")')"]]},show:!0})}}},{key:"edit",value:(i=a()(l.a.mark((function t(){var e,i,n,o=this,s=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=s.length>0&&void 0!==s[0]&&s[0],this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=21;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: 420px;\n }\n .YJ-custom-base-dialog>.content .row .label {\n flex: 0 0 45px;\n }\n",t.next=11,new bi(this.sdk,this.newData,{title:"倾斜模型属性",left:"180px",top:"100px",confirmCallBack:function(t){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.transparency=o.newData.transparency,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.oldData.type=o.type,o._DialogObject.close(),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(ur(ur({},o.oldData),{},{type:o.type})),Et(o.sdk,o.oldData.id)},resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()},closeCallBack:function(){o.reset(),o.positionEditing&&(o.positionEditing=!1),o.rotationEditing&&(o.rotationEditing=!1),o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(t){o.newData.show=t,o.entity&&(o.entity.show=t),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}},!0);case 11:this._DialogObject=t.sent,document.getElementsByTagName("head")[0].appendChild(this._element_style),(i=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n \n
        \n
        \n
        \n 高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n 透视\n \n
        \n
        \n
        \n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,t.next=21;break;case 21:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"updateModel",value:function(t,e,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(t&&e&&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)),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),h=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=Cesium.Matrix4.fromRotationTranslation(u),f=new Cesium.Matrix4;Cesium.Matrix4.multiply(p,h,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:t,lat:e,alt:i}),this.editObj.activeCircle||(this.editObj.rotate={x:o,y:s,z:a}),this.editObj&&this.editObj.update(),clearTimeout(mr(vr,this)),dr(vr,this,setTimeout((function(){clearTimeout(mr(vr,n));var t,e=n.cartesian3Towgs84(n.entity.boundingSphere.center,n.sdk.viewer),i=turf.circle([e.lng,e.lat],n.entity.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),o=rr(n.sdk.entityMap);try{for(o.s();!(t=o.n()).done;){var s=$()(t.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(t){o.e(t)}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.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}(ar);function yr(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return br(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?br(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function br(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),_r(i=kr(this,e,[t,n]),Dr,void 0),i.picking=!1,i.features=n.features||[],i.exportStateArray=[],i.Dialog=o,i._elms={},i._EventBinding=new Si,i.Dialog.exportState=function(t){i.exportState(t)},i.Dialog.exportProperty=function(t){i.exportProperty(i.exportStateArray)},i.features=new Map,i}return gi()(e,t),k()(e,[{key:"type",get:function(){return"bim"}},{key:"name",get:function(){return this.newData.name},set:function(t){this.newData.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.newData.lng},set:function(t){this.newData.lng=t,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(e){e.value=t}))}},{key:"lat",get:function(){return this.newData.lat},set:function(t){this.newData.lat=t,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(e){e.value=t}))}},{key:"height",get:function(){return this.newData.height},set:function(t){this.newData.height=t,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(e){e.value=t}))}},{key:"roll",get:function(){return this.newData.roll},set:function(t){this.newData.roll=t,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(e){e.value=t}))}},{key:"heading",get:function(){return this.newData.heading},set:function(t){this.newData.heading=t,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(e){e.value=t}))}},{key:"pitch",get:function(){return this.newData.pitch},set:function(t){this.newData.pitch=t,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(e){e.value=t}))}},{key:"scale",get:function(){return this.newData.scale},set:function(t){this.newData.scale=t,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(e){e.value=t}))}},{key:"loadSceneTree",value:(s=a()(l.a.mark((function t(e){var i,n=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(i=e.split("/"))[i.length-1]="scenetree.json",t.next=4,Cesium.Resource.fetchJson({url:i.join("/")}).then((function(t){n.scenetree=t;var e=function(t){t.forEach((function(t){n.features.has(t.id)?n.features.get(t.id).sphere=t.sphere:n.features.set(t.id,{sphere:t.sphere}),t.children&&e(t.children)}))};e(t.scenes[0].children)}));case 4:case"end":return t.stop()}}),t)}))),function(t){return s.apply(this,arguments)})},{key:"edit",value:(o=a()(l.a.mark((function t(e){var i,n,o=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=16;break}return t.next=6,new bi(this.sdk,this.newData,{title:"BIM模型属性",left:"180px",top:"100px",resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},confirmCallBack:function(t){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 e=new Map;o.features.forEach((function(t,i){var n=wr({},t);delete n.features,e.set(i,n)})),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(wr(wr({},o.oldData),{},{features:e,type:o.type})),Et(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(t){o.newData.show=t,o.entity&&(o.entity.show=t),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=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" tileset-bim",(i=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 经度\n \n
        \n
        \n x轴\n \n
        \n
        \n
        \n
        \n 纬度\n \n
        \n
        \n y轴\n \n
        \n
        \n
        \n
        \n 高度\n
        \n \n m\n \n
        \n
        \n
        \n z轴\n \n
        \n
        \n
        \n
        \n 大小\n \n
        \n \n \n
        \n \n
        \n
        \n
        \n \n
        \n
        \n

        BIM属性导出选项

        \n
        \n
        \n
        \n
        \n
        \n \n 修建中\n
        \n
        \n \n 未完成\n
        \n
        \n \n 已完成\n
        \n
        \n
        \n \n
        \n
        \n \n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,t.next=17;break;case 16:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"featureEdit",value:(n=a()(l.a.mark((function t(e,i){var n,o,s,a,r,c,u,p,h,d,m=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this,this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=46;break}o=function(t){var e='
        \n
        \n \n \n \n \n
        \n
        '),i=document.createElement("div");i.innerHTML=e;var s=i.getElementsByClassName("property-item")[0],r=s.querySelector("input[name='key']"),l=s.querySelector("input[name='value']"),c=s.getElementsByClassName("add")[0],p=s.getElementsByClassName("delete")[0];r.addEventListener("input",(function(e){t.key=e.target.value})),l.addEventListener("input",(function(e){t.value=e.target.value})),c.addEventListener("click",(function(){var t={id:n.randomString(),key:"点击此处可编辑",value:""};a.descriptions.push(t),o(t)})),p.addEventListener("click",(function(e){for(var i=0;i.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",t.next=24,new G(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=t.sent,t.next=27,this._DialogObject.init();case 27:for(document.getElementsByTagName("head")[0].appendChild(this._element_style),(r=document.createElement("div")).innerHTML='\n
        \n
        \n 构件名称\n \n
        \n
        \n
        \n
        \n 选择状态\n \n
        \n
        \n
        \n
        \n

        自定义属性

        \n
        \n
        \n
        \n
        \n ',r.querySelector("input[name='name']").value=s,(c=r.querySelector("select[name='state-select']")).value=a.state,c.addEventListener("change",(function(t){switch(a.state=t.target.value,a.state){case"0":a.stateCH="";break;case"1":a.stateCH="已完成";break;case"2":a.stateCH="未完成";break;case"3":a.stateCH="修建中"}})),u=r.getElementsByClassName("property")[0],p=0;p3&&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("该模型不支持移动和旋转!");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)),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),h=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=Cesium.Matrix4.fromRotationTranslation(u),f=new Cesium.Matrix4;Cesium.Matrix4.multiply(p,h,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:t,lat:e,alt:i}),this.editObj&&this.editObj.update(),clearTimeout(Er(Dr,this)),xr(Dr,this,setTimeout((function(){clearTimeout(Er(Dr,n));var t,e=n.cartesian3Towgs84(n.entity.boundingSphere.center,n.sdk.viewer),i=turf.circle([e.lng,e.lat],n.entity.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),o=yr(n.sdk.entityMap);try{for(o.s();!(t=o.n()).done;){var s=$()(t.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(t){o.e(t)}finally{o.f()}}),300))}},{key:"getScenetree",value:function(){return this.scenetree}},{key:"featureColor",value:function(t,e){if(this.features.has(t)){var i=this.features.get(t).features;for(var n in i)i[n].content._model&&(i[n].color=Cesium.Color.fromCssColorString(e)),i[n].customColor=Cesium.Color.fromCssColorString(e);this.features.get(t).customColor=Cesium.Color.fromCssColorString(e)}}},{key:"getFeatureColor",value:function(t){if(this.features.has(t)){if(this.features.get(t).customColor)return this.features.get(t).customColor;var e=this.features.get(t).features;for(var i in e)if(e[i].content._model)return e[i].customColor||e[i].color}}},{key:"featureShow",value:function(t,e){if(this.features.has(t)){var i=this.features.get(t).features;for(var n in i)i[n].content._model&&(i[n].show=e),i[n].customShow=e;this.features.get(t).customShow=e}}},{key:"featureFlyto",value:(i=a()(l.a.mark((function t(e){var i,n,o,s,a,r,c,u,p=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.features.has(e)?(i=this.features.get(e).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,a=Cesium.Matrix4.multiply(s,o,new Cesium.Matrix4),r=Cesium.Matrix4.multiplyByPoint(a,n,new Cesium.Cartesian3),c=this.cartesian3Towgs84(r,this.sdk.viewer),u=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt+i[3]),ve(0),re(this.sdk),le(this.sdk),this.sdk.viewer.camera.flyTo({destination:u}),this.features.forEach((function(t,i){if(i===e){var n=p.getFeatureColor(e);if(p.features.has(e)&&n){var o=p.features.get(e).features;for(var s in o)o[s].content._model&&(o[s].color=n),o[s].customAlpha=1;p.features.get(e).customAlpha=1}}else{var a=p.getFeatureColor(i);if(p.features.has(i)&&a){var r=p.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;p.features.get(i).customAlpha=.2*a.alpha}}}))):this.features.forEach((function(t,e){var i=p.features.get(e).features,n=p.getFeatureColor(e);if(n){for(var o in i)i[o].content._model&&(i[o].color=n),i[o].customAlpha=1;p.features.get(e).customAlpha=.2*n.alpha}}));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"exportProperty",value:function(t){if(0!==this.exportStateArray.length){for(var e,i=["name","","","","","","","","","","","","stateCH","descriptions"],n='{rows}
        ',o=function(t,e){return t.replace(/{(\w+)}/g,(function(t,i){return e[i]}))},s="",a="",r="",l=0;l构件名称体积墩全高H墩身高h底部高程承台宽承台长承台高桩径桩长结构材质完成情况自定义属性'),r+="",i){if(Array.isArray(this.features[l][i[u]])){var p="";for(var h in this.features[l][i[u]])p+="".concat(this.features[l][i[u]][h].key+":"+this.features[l][i[u]][h].value," ");s={nameType:"String",data:p}}else s={nameType:"String",data:this.features[l][i[u]]||"0"};r+=o('{data}',s)}r+="",l>0&&l/6e4%1==0&&(a+=o(n,s={rows:r,nameWS:"Sheet"+l}),r="",r+='构件名称体积墩全高H墩身高h底部高程承台宽承台长承台高桩径桩长结构材质完成情况自定义属性')}a+=o(n,s={rows:r,nameWS:"Sheet"}),r="",e=o('Axel Richter{created}{worksheets}',s={created:(new Date).getTime(),worksheets:a});var d,m=document.createElement("A");m.href="data:application/vnd.ms-excel;base64,"+(d=e,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(t){var e=t.target.getElementsByTagName("input")[0];if(e.checked=!e.checked,e.checked)this.exportStateArray.push(e.value),this.exportStateArray=Array.from(new Set(this.exportStateArray));else for(var i=0;i\n
        \n
        \n
        \n 名称\n \n
        \n
        \n 颜色\n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 经度\n \n
        \n
        \n 最大比例\n
        \n \n \n \n
        \n
        \n
        \n
        \n
        \n 纬度\n \n
        \n
        \n 最小像素\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 高度\n
        \n \n m\n \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(zi(t),'\n \n \n
        \n
        \n

        旋转

        \n
        \n
        \n
        \n x 轴\n \n
        \n \n °\n \n
        \n
        \n
        \n
        \n
        \n y 轴\n \n
        \n \n °\n \n
        \n
        \n
        \n
        \n
        \n z 轴\n \n
        \n \n °\n \n
        \n
        \n
        \n \n
        \n
        \n 缩放\n
        \n \n 是否等比例缩放\n
        \n
        \n
        \n \n \n
        \n

        高度

        \n
        \n
        \n
        \n 高度\n \n
        \n \n m\n \n
        \n
        \n
        \n \n
        \n
        \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n
        \n
        \n
        \n \n ')}function Mr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Tr(t){for(var e=1;e=0;N--){var B=T[N];if(B&&B.primitive&&B.id)switch(B.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return void(B.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_down((function(i){var n=a.scene.cartesianToCanvasCoordinates(t.origin);v.x=i.position.x-Math.floor(n.x),v.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(e.activeAxis)e.activeAxis=null,e.activeModelParam=null,e.controllerCallBack;else switch(r.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return a.scene.screenSpaceCameraController.enableRotate=!1,e.activeAxis=r.primitive,e.activeModelParam=e.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(t){a.scene.screenSpaceCameraController.enableRotate=!0;for(var i=0;i360&&(o._params.rx=1),o._params.rx<0&&(o._params.rx=360);Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o._params.rx));o._params.ry-=n,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-=r,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{for(var u=s.coordCircles,p=0;p3&&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=t=parseFloat(parseFloat(t).toFixed(8)),this._params.ty=e=parseFloat(parseFloat(e).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(t,e,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(t,e,i)),u=Cesium.Matrix4.fromRotationTranslation(a),p=Cesium.Matrix4.fromRotationTranslation(r),h=Cesium.Matrix4.fromRotationTranslation(l),d=new Cesium.Matrix4;Cesium.Matrix4.multiply(c,u,d),Cesium.Matrix4.multiply(d,p,d),Cesium.Matrix4.multiply(d,h,this.model.modelMatrix),this.transformCallBack}},{key:"transformCallBack",get:function(){this._transformCallBack&&this._transformCallBack(this._params)},set:function(t){this._transformCallBack=t}},{key:"createAxisArrow",value:function(t,e,i,n){var o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,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=t,this.coordArrows.push(o),o}},{key:"createAxisSphere",value:function(t,e,i,n,o){var s=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,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=t,this.coordCircles.push(s),s}},{key:"removeCoordArrows",value:function(){for(var t=0;t=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function jr(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),i=zr(this,e,[t,n,o={}]),n.position?n.position.lng||0===n.position.lng?n.position.lat||0===n.position.lat?(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,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||["#42c6ef","#42c6ef"],lineColor:n.label.lineColor||"#fff000",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 Si,i.on(),i):(console.warn("lat is required!"),di()(i)):(console.warn("lng is required!"),di()(i)):(console.warn("position is required!"),di()(i))}return gi()(e,t),k()(e,[{key:"type",get:function(){return"glb"}},{key:"loadModel",value:(r=a()(l.a.mark((function t(e){var i,n,o,s,a=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(It(this.sdk,this.options.id),this.sdk&&this.sdk.viewer&&this.sdk.viewer.scene){t.next=3;break}return t.abrupt("return");case 3:if(e.startsWith("http")||e.includes(":")||this.options.host&&(i=new URL(e,this.options.host),e=i.href),this.originalOptions=this.deepCopyObj(this.options),n={id:this.options.id,url:e,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)){t.next=13;break}return t.next=10,Cesium.Model.fromGltfAsync(n);case 10:this.entity=t.sent,t.next=16;break;case 13:return t.next=15,Cesium.Model.fromGltf(n);case 15:this.entity=t.sent;case 16:return this.entity.imageBasedLighting.luminanceAtZenith=.6,this.entity.color=Cesium.Color.fromCssColorString(this.options.color),t.next=20,this.sdk.viewer.scene.primitives.add(this.entity);case 20:o=Cesium.Cartographic.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt),s=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(o),this.entity.position=s,this.entity.rotate=Rr({},this.options.rotate),this.entity.customScale=this.options.scale,this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(s),Number(Cesium.VERSION.split(".")[1])>=107?(this.entity.readyEvent.addEventListener((function(){a.entity.originalBoundingSphereRadius=a.entity.boundingSphere.radius,a.editObj=new Nr(a.sdk,a.entity),a.editObj.transformCallBack=a.rotationEditingCallBack,a.updateModel(a.options.position.lng,a.options.position.lat,a.options.position.alt,a.options.rotate.x,a.options.rotate.y,a.options.rotate.z,a.options.scale),a.label||(a.label=new Ki(a.sdk,{id:a.options.id,show:!!a.options.show&&a.options.label.show,position:[a.options.position.lng,a.options.position.lat,a.options.position.alt],text:a.options.name,fontSize:a.options.label.fontSize,color:a.options.label.color,pixelOffset:a.options.label.pixelOffset,backgroundColor:a.options.label.backgroundColor,lineColor:a.options.label.lineColor,scaleByDistance:a.options.label.scaleByDistance,near:a.options.label.near,far:a.options.label.far},a.entity))})),this.activeAnimate=this.options.activeAnimate,this.modelAnimations=this.entity.loader.components.animations):this.entity.readyPromise.then((function(t){a.entity.originalBoundingSphereRadius=a.entity.boundingSphere.radius,a.editObj=new Nr(a.sdk,a.entity),a.editObj.transformCallBack=a.rotationEditingCallBack,a.updateModel(a.options.position.lng,a.options.position.lat,a.options.position.alt,a.options.rotate.x,a.options.rotate.y,a.options.rotate.z,a.options.scale),a.label||(a.label=new Ki(a.sdk,{id:a.options.id,show:!!a.options.show&&a.options.label.show,position:[a.options.position.lng,a.options.position.lat,a.options.position.alt],text:a.options.name,fontSize:a.options.label.fontSize,color:a.options.label.color,pixelOffset:a.options.label.pixelOffset,backgroundColor:a.options.label.backgroundColor,lineColor:a.options.label.lineColor,scaleByDistance:a.options.label.scaleByDistance,near:a.options.label.near,far:a.options.label.far,ground:!1},a.entity)),a.activeAnimate=a.options.activeAnimate,a.modelAnimations=a.entity.loader.components.animations})),this.options.show&>(0,this.options.id);case 28:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"getModelAnimations",value:(s=a()(l.a.mark((function t(){var e=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,i){Number(Cesium.VERSION.split(".")[1])>=107?e.entity.readyEvent.addEventListener((function(){e.modelAnimations=e.entity.loader.components.animations,t(e.modelAnimations)})):e.entity.readyPromise.then((function(i){e.modelAnimations=e.entity.loader.components.animations,t(e.modelAnimations)}))})));case 1:case"end":return t.stop()}}),t)}))),function(){return s.apply(this,arguments)})},{key:"remove",value:function(){Fr(e,"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:(o=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=22;break}if(e={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),a={lng:0,lat:0},this.options.position?a=Rr({},this.options.position):this.options.positions?a=Rr({},this.options.positions[0]):this.options.center?a=Rr({},this.options.center):this.options.start?a=Rr({},this.options.start):(this.options.hasOwnProperty("lng")&&(a.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(a.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(a.alt=this.options.alt)),a.hasOwnProperty("alt")){t.next=15;break}return t.next=14,this.getClampToHeight(a);case 14:a.alt=t.sent;case 15:i=this.options.customView.relativePosition.lng+a.lng,n=this.options.customView.relativePosition.lat+a.lat,o=this.options.customView.relativePosition.alt+a.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e}),t.next=23;break;case 22:Number(Cesium.VERSION.split(".")[1])>=107?this.entity.ready&&(r=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(r)):this.entity.readyPromise.then((function(){var t=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(t)}));case 23:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"on",value:function(){return this.add()}},{key:"setDefaultValue",value:function(){Fr(e,"setDefaultValue",this,3)([]),this.options.host=this.options.host||m(),this.options.url=this.options.url||""}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.entity.color=Cesium.Color.fromCssColorString(t),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"lng",get:function(){return this.options.position.lng},set:function(t){this.options.position={lng:t,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(e){e.value=t}))}},{key:"lat",get:function(){return this.options.position.lat},set:function(t){this.options.position={lng:this.options.position.lng,lat:t,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(e){e.value=t}))}},{key:"alt",get:function(){return this.options.position.alt},set:function(t){this.options.position={lng:this.options.position.lng,lat:this.options.position.lat,alt:t},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(e){e.value=t}))}},{key:"maximumScale",get:function(){return this.options.maximumScale},set:function(t){this.options.maximumScale=t,this.entity.maximumScale=this.scaleByDistance?void 0:t,this._elms.maximumScale&&this._elms.maximumScale.forEach((function(e){e.value=t}))}},{key:"minimumPixelSize",get:function(){return this.options.minimumPixelSize},set:function(t){this.options.minimumPixelSize=t,this.entity.minimumPixelSize=this.scaleByDistance?void 0:this.options.minimumPixelSize,this._elms.minimumPixelSize&&this._elms.minimumPixelSize.forEach((function(e){e.value=t}))}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(t){this.options.scaleByDistance=t,this.entity.maximumScale=t?void 0:this.maximumScale,this.entity.minimumPixelSize=t?void 0:this.options.minimumPixelSize,this._elms.scaleByDistance&&this._elms.scaleByDistance.forEach((function(e){e.checked=t}))}},{key:"rotateX",get:function(){return this.options.rotate.x},set:function(t){this.options.rotate.x=t,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(e){e.value=t}))}},{key:"rotateY",get:function(){return this.options.rotate.y},set:function(t){this.options.rotate.y=t,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(e){e.value=t}))}},{key:"rotateZ",get:function(){return this.options.rotate.z},set:function(t){this.options.rotate.z=t,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(e){e.value=t}))}},{key:"scaleX",get:function(){return this.options.scale.x},set:function(t){var e=this;this.options.scale.x=Number(Number(t).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(t){t.value=e.options.scale.x}))}},{key:"scaleY",get:function(){return this.options.scale.y},set:function(t){var e=this;this.options.scale.y=Number(Number(t).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(t){t.value=e.options.scale.y}))}},{key:"scaleZ",get:function(){return this.options.scale.z},set:function(t){var e=this;this.options.scale.z=Number(Number(t).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(t){t.value=e.options.scale.z}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label&&(this.label.show=t):this.label&&(this.label.show=!1),this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label&&(this.label.color=t),this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label&&(this.label.fontSize=t),this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label&&(this.label.scaleByDistance=t),this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){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(t){this.options.label.far=t,this.label&&(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(t){this.options.label.lineWidth=t,this.label&&(this.label.lineWidth=t),this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label&&(this.label.pixelOffset=t),this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label&&(this.label.lineColor=t),this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(255,255,255,1)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label&&(this.label.backgroundColor=[t,this.label.backgroundColor[1]]),this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label&&(this.label.backgroundColor=[this.label.backgroundColor[0],t]),this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var o=0;o\n
        '+this.options.attribute.vr.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0))for(var e=0;e0&&void 0!==v[0]&&v[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=46;break}return i=!1,this.scaleX===this.scaleY&&this.scaleX===this.scaleZ&&(i=!0),t.next=9,new bi(this.sdk,this.originalOptions,{title:"模型属性",left:"180px",top:"100px",confirmCallBack:function(t){f.name=f.options.name||"未命名对象",f.originalOptions=f.deepCopyObj(f.options),f._DialogObject.close(),f.Dialog.confirmCallBack&&f.Dialog.confirmCallBack(f.originalOptions),It(f.sdk,f.options.id),Et(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(t){f.show=t,f.Dialog.showCallBack&&f.Dialog.showCallBack()},translationalCallBack:function(){f.positionEditing?f.positionEditing=!1:f.positionEditing=!0}},!0);case 9:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" model",(n=document.createElement("div")).innerHTML=Or(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 Di("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],a=this._DialogObject._element.content.getElementsByClassName("no-equal")[0],o.checked=i,o.addEventListener("change",(function(t){(i=t.target.checked)?(s.style.display="flex",a.style.display="none",f.scaleY=f.scaleX,f.scaleZ=f.scaleX):(s.style.display="none",a.style.display="flex")})),(r=s.getElementsByTagName("input"))[0].value=this.scaleX,r[1].value=this.scaleX,r[0].addEventListener("input",(function(t){f.scaleX=t.target.value,f.scaleY=t.target.value,f.scaleZ=t.target.value})),r[1].addEventListener("input",(function(t){f.scaleX=t.target.value,f.scaleY=t.target.value,f.scaleZ=t.target.value})),i?(s.style.display="flex",a.style.display="none"):(s.style.display="none",a.style.display="flex"),c=new ewPlugins("colorpicker",{el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){f.color=t},clear:function(){f.color="rgba(255,255,255,1)"}}),u=new ewPlugins("colorpicker",{el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelColor=t},clear:function(){f.labelColor="rgba(255,255,255,1)"}}),p=new ewPlugins("colorpicker",{el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelLineColor=t},clear:function(){f.labelLineColor="rgba(255,255,255,1)"}}),h=new ewPlugins("colorpicker",{el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelBackgroundColorStart=t},clear:function(){f.labelBackgroundColorStart="rgba(255,255,255,1)"}}),d=new ewPlugins("colorpicker",{el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelBackgroundColorEnd=t},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=[p],this._elms.labelBackgroundColorStart=[h],this._elms.labelBackgroundColorEnd=[d],this._elms.scaleX.push(r[0],r[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 t=f.attributeSelect,e=f._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=U(e,".attribute-select");i.legp_search(t);for(var n=f._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],o=0;o3&&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;t=parseFloat(t),e=parseFloat(e),i=parseFloat(parseFloat(i).toFixed(2)),n=parseFloat(n),o=parseFloat(o),s=parseFloat(s),a.x=parseFloat(a.x),a.y=parseFloat(a.y),a.z=parseFloat(a.z),this.entity.position=new Cesium.Cartesian3.fromDegrees(t,e,i),this.entity.rotate={x:n,y:o,z:s},this.entity.customScale=a;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=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),p=Cesium.Matrix4.fromRotationTranslation(r),h=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=new Cesium.Matrix4;Cesium.Matrix4.multiply(u,p,m),Cesium.Matrix4.multiply(m,h,m),Cesium.Matrix4.multiply(m,d,this.entity.modelMatrix);var f=a.x,v=a.y,g=a.z;0===f&&(f=1e-5),0===v&&(v=1e-5),0===g&&(g=1e-5),Cesium.Matrix4.multiplyByScale(this.entity.modelMatrix,new Cesium.Cartesian3(f,v,g),this.entity.modelMatrix),this.entity.minimumPixelSize=this.scaleByDistance?void 0:this.options.minimumPixelSize,this.editObj&&this.editObj.update()}},{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.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.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())}}]);var i,n,o,s,r}(Ar);function Hr(t){return'\n
        \n
        \n 名称\n \n
        \n
        \n 颜色\n
        \n
        \n
        \n
        \n
        \n 经度\n \n
        \n
        \n 最大比例\n \n
        \n
        \n
        \n
        \n 纬度\n \n
        \n
        \n 最小像素\n \n
        \n
        \n
        \n
        \n 高度\n \n
        \n
        \n 视野缩放\n \n
        \n
        \n
        \n \n \n '.concat(zi(t),'\n \n \n
        \n
        \n
        \n x轴\n \n \n
        \n
        \n
        \n
        \n y轴\n \n \n
        \n
        \n
        \n
        \n z轴\n \n \n
        \n
        \n
        \n
        \n 高度\n \n \n
        \n
        \n
        \n
        \n 缩放\n \n \n
        \n
        \n
        \n
        \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ',"\n
        \n
        \n
        \n ")}function Gr(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ur(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ur(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ur(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(i=Jr(this,e,[t,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 An(i.sdk),i.ControllerObject.controllerCallBack=function(t){i.lng=t.position.lng,i.lat=t.position.lat,i.alt=t.position.alt},i.Dialog=o,i._EventBinding=new Si,i.on(),i}return gi()(e,t),k()(e,[{key:"type",get:function(){return"glb"}},{key:"loadModel",value:(o=a()(l.a.mark((function t(e){var i,n,o,s,a,r,c,u,p,h,d,m,f,v,g=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(v=function(t){return new Worker("data:,(".concat(t.toString(),")(").concat(JSON.stringify(m),")"))},f=function(t){var e=t.type,i=t.interval,n=t.positions,o=t.optionsPositions,s=t.quantity,a=t.turfUrl;importScripts(a);var r=[];switch(e){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 p=0;pthis.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]),a=turf.polygon(n),r=turf.pointOnFeature(a),this.center={lng:r.geometry.coordinates[0],lat:r.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),p=document.scripts,h="",d=0;case 14:if(!(d-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==p[0]&&p[0],this.originalOptions=this.deepCopyObj(this.options),this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.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",t.next=12,new bi(this.sdk,this.originalOptions,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(t){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(t){u.show=t,u.Dialog.showCallBack&&u.Dialog.showCallBack()},translationalCallBack:function(){u.positionEditing?u.positionEditing=!1:u.positionEditing=!0}},!0);case 12:this._DialogObject=t.sent,document.getElementsByTagName("head")[0].appendChild(this._element_style),(i=document.createElement("div")).innerHTML=Hr(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera,new Di("model-edit-tabs",void 0,this.sdk),n=new ewPlugins("colorpicker",{el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){u.color=t},clear:function(){u.color="rgba(255,255,255,1)"}}),o=new ewPlugins("colorpicker",{el:i.getElementsByClassName("label_color")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){u.labelColor=t},clear:function(){u.labelColor="rgba(255,255,255,1)"}}),s=new ewPlugins("colorpicker",{el:i.getElementsByClassName("line_color")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){u.lineColor=t},clear:function(){u.lineColor="rgba(255,255,255,1)"}}),a=new ewPlugins("colorpicker",{el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){u.labelBackgroundColorStart=t},clear:function(){u.labelBackgroundColorStart="rgba(255,255,255,1)"}}),r=new ewPlugins("colorpicker",{el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){u.labelBackgroundColorEnd=t},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=[a],this._elms.labelBackgroundColorEnd=[r],setTimeout((function(){u.attributeLink=u.options.attribute.link.content,u.cameraSelect&&u.cameraSelect();var t=u.attributeSelect,e=u._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=U(e,".attribute-select");i.legp_search(t);for(var n=u._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],o=0;o3&&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;t=parseFloat(t),e=parseFloat(e),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(t,e,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(t,e,i)}},{key:"updateModelRotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=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;t=parseFloat(t),e=parseFloat(e),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;r1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=Kr(this,e,[t,n])).object={},i.options.host=i.options.host||m(),i}return gi()(e,t),k()(e,[{key:"type",get:function(){return"layer"}},{key:"on",value:function(){return this.add()}},{key:"add",value:(i=a()(l.a.mark((function t(){var e,i;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.requestResource();case 2:return e=t.sent,t.next=5,e.text();case 5:if(i=t.sent,i=JSON.parse(i),![0,200].includes(i.code)){t.next=11;break}return t.abrupt("return",this.loadLayer(i.data));case 11:return t.abrupt("return",new Promise((function(t,e){e(i.msg||i.message)})));case 12:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"loadLayer",value:function(t){this.object=function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=Qr(this,e,[t,n])).loadLayer(),i}return gi()(e,t),k()(e,[{key:"type",get:function(){return"layer"}},{key:"loadLayer",value:function(t){var e,i={url:this.options.url,mimmumLevel:this.options.minimumLevel||0,maximumLevel:this.options.maximumLevel||20,subdomains:["0","1","2","3","4","5","6","7"]};e=new Cesium.UrlTemplateImageryProvider(i),this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(e,this.options.layer_index):this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(e),this.show=this.options.show,this.alpha=this.options.alpha,this.brightness=this.options.brightness,this.options.show&>(0,this.options.id)}}])}(za);function el(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function il(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function ol(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&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 C()(this,e),al(i=sl(this,e,[t,n]),ul,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 gi()(e,t),k()(e,[{key:"type",get:function(){return"terrain"}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"show",get:function(){return!(this.sdk.viewer.scene.terrainProvider instanceof Cesium.EllipsoidTerrainProvider)},set:function(t){t?this.open():this.close()}},{key:"open",value:(s=a()(l.a.mark((function t(){var e,i;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.options.url){t.next=4;break}return t.abrupt("return",this.loadTerrain({url:this.options.url}));case 4:return t.next=6,this.requestResource();case 6:return e=t.sent,t.next=9,e.text();case 9:if(i=t.sent,i=JSON.parse(i),![0,200].includes(i.code)){t.next=19;break}if(!i.data.url.length){t.next=16;break}return t.abrupt("return",this.loadTerrain(i.data));case 16:return t.abrupt("return",new Promise((function(t,e){e("资源不存在")})));case 17:t.next=20;break;case 19:return t.abrupt("return",new Promise((function(t,e){e(i.msg||i.message)})));case 20:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"close",value:function(){var t=this;this.sdk.viewer.scene.terrainProvider=new Cesium.EllipsoidTerrainProvider({}),Et(this.sdk,this.options.id),clearTimeout(ll(ul,this)),rl(ul,this,setTimeout((function(){clearTimeout(ll(ul,t));var e,i=nl(t.sdk.entityMap);try{for(i.s();!(e=i.n()).done;){var n=$()(e.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(t){i.e(t)}finally{i.f()}}),500))}},{key:"loadTerrain",value:(o=a()(l.a.mark((function t(e){var i,n,o,s=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=il({},e),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)){t.next=9;break}return t.next=6,Cesium.CesiumTerrainProvider.fromUrl(n);case 6:this.terrainProvider=t.sent,t.next=10;break;case 9:this.terrainProvider=new Cesium.CesiumTerrainProvider({url:n});case 10:if(this.sdk&&this.sdk.viewer){t.next=12;break}return t.abrupt("return");case 12:this.sdk.viewer.terrainProvider=this.terrainProvider,clearTimeout(ll(ul,this)),rl(ul,this,setTimeout((function(){clearTimeout(ll(ul,s)),s.terrainProvider.readyPromise.then((function(){var t,e=nl(s.sdk.entityMap);try{for(e.s();!(t=e.n()).done;){var i=$()(t.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(t){e.e(t)}finally{e.f()}}))}),1e3)),Et(this.sdk,this.options.id);case 16:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"remove",value:function(){this.close()}},{key:"flyTo",value:(n=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c,u=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:3,!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=il({},this.options.position):this.options.positions?r=il({},this.options.positions[0]):this.options.center?r=il({},this.options.center):this.options.start?r=il({},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")){t.next=18;break}return t.next=17,this.getClampToHeight(r);case 17:r.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i,duration:e}),t.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:e});case 27:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"setDefaultValue",value:function(){var t,i,n,o,s;(t=e,i="setDefaultValue",n=this,o=3,s=Do()(fi()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),this.options.host=this.options.host||m(),this.options.url=this.options.url||""}},{key:"edit",value:(i=a()(l.a.mark((function t(){var e,i,n,o=this,s=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return 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.next=5,new bi(this.sdk,this.options,{title:"地形属性",left:"180px",top:"100px",confirmCallBack:function(t){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)},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()}},!0);case 5:this._DialogObject=t.sent,(e=document.createElement("div")).style.width="300px",i='\n \n
        \n
        \n
        \n 名称:\n \n
        \n
        \n
        \n ',e.innerHTML=i,(n=e.getElementsByClassName("name")[0]).value=this.name,n.addEventListener("input",(function(){o.name=n.value})),this._DialogObject.contentAppChild(e),this._elms.name=[n];case 15:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}]);var i,n,o,s}(Aa);function hl(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return dl(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?dl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function dl(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(n=yl(this,e,[t,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 J(n.sdk),n}return gi()(e,t),k()(e,[{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t?(this.options.show=t,this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=t),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),this.options.label&&this.options.label.show&&(this.label.show=t),It(this.sdk,this.options.id),Et(this.sdk,this.options.id)):console.error("参数必须为boolean")}},{key:"add",value:(s=a()(l.a.mark((function t(){var e,i,n,o,s,a=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.originalOptions=this.deepCopyObj(this.options),e=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=e.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(t){t._billboard.id=a.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},It(this.sdk,this.options.id),this.options.show&>(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(a.entity&&a.show){var t=a.sdk.viewer.camera.positionCartographic.height;a.entity.show=!(t>=1e7)}}));case 14:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"flyTo",value:(o=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=gl({},this.options.position):this.options.positions?r=gl({},this.options.positions[0]):this.options.center?r=gl({},this.options.center):(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")){t.next=18;break}return t.next=17,this.getClampToHeight(r);case 17:r.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.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:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"minimumSpeed",get:function(){return this.options.minimumSpeed},set:function(t){this.options.minimumSpeed=t,this.particleSystem.minimumSpeed=t,this._elms.minimumSpeed&&this._elms.minimumSpeed.forEach((function(e){e.value=t}))}},{key:"maximumSpeed",get:function(){return this.options.maximumSpeed},set:function(t){this.options.maximumSpeed=t,this.particleSystem.maximumSpeed=t,this._elms.maximumSpeed&&this._elms.maximumSpeed.forEach((function(e){e.value=t}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=t,this.particleSystem.minimumParticleLife=t,this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=t}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=t,this.particleSystem.maximumParticleLife=t,this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=t}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=t,this.particleSystem.startScale=t,this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=t}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=t,this.particleSystem.endScale=t,this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=t}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=t,this.particleSystem.emissionRate=t,this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=t}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=t,this.particleSystem.minimumImageSize=new Cesium.Cartesian2(t,t),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(t,t),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);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(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);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(e){e.value=t}))}},{key:"alt",get:function(){return this.options.alt},set:function(t){this.options.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);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(e){e.value=t}))}},{key:"edit",value:(n=a()(l.a.mark((function t(){var e,i,n,o,s,a=this,r=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=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){t.next=21;break}return t.next=7,new bi(this.sdk,this.originalOptions,{title:"火焰属性",left:"180px",top:"100px",confirmCallBack:function(t){a.name=a.name.trim(),a.name||(a.name="未命名对象"),a.originalOptions=a.deepCopyObj(a.options),a._DialogObject.close(),a.Dialog.confirmCallBack&&a.Dialog.confirmCallBack(a.originalOptions),It(a.sdk,a.options.id),Et(a.sdk,a.options.id)},resetCallBack:function(){a.reset(),a.Dialog.resetCallBack&&a.Dialog.resetCallBack()},removeCallBack:function(){a.Dialog.removeCallBack&&a.Dialog.removeCallBack()},closeCallBack:function(){a.reset(),a.positionEditing=!1,a.Dialog.closeCallBack&&a.Dialog.closeCallBack()},showCallBack:function(t){a.show=t,a.Dialog.showCallBack&&a.Dialog.showCallBack()},translationalCallBack:function(){a.positionEditing=!a.positionEditing}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(i=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 经度\n \n
        \n
        \n 纬度\n \n
        \n
        \n
        \n
        \n 高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n 起始颜色\n
        \n
        \n
        \n 结束颜色\n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n 最小初速度\n \n
        \n
        \n
        \n
        \n 最大初速度\n \n
        \n
        \n
        \n
        \n
        \n
        \n 最小存在时间\n \n
        \n
        \n
        \n
        \n 最大存在时间\n \n
        \n
        \n
        \n
        \n
        \n
        \n 起始比例\n \n
        \n
        \n
        \n
        \n 结束比例\n \n
        \n
        \n
        \n
        \n
        \n
        \n 发射速率(个/秒)\n \n
        \n
        \n
        \n
        \n 尺寸(像素)\n \n
        \n
        \n
        \n
        \n \n ',this._DialogObject.contentAppChild(i),n=new ewPlugins("colorpicker",{el:i.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(t){a.startColor=t},clear:function(){a.startColor="rgba(255,255,255,1)"}}),o=new ewPlugins("colorpicker",{el:i.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(t){a.endColor=t},clear:function(){a.endColor="rgba(255,255,255,1)"}}),s=i.getElementsByTagName("*"),fl.on(this,s),this._elms=fl.element,this._elms.startColor=[n],this._elms.endColor=[o],t.next=21;break;case 21:case"end":return t.stop()}}),t,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(t){Gt.apply(this,arguments)}(this.entity))}},{key:"remove",value:(i=a()(l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return bl(e,"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(),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,It(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.operate.positionEditing=t,!0===t){var i;this.tip&&this.tip.destroy(),this.tip=new q("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:gl({},this.entity.position)},this.event.mouse_move((function(t,n){i=t.endPosition;var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(e.options.lng,e.options.lat,e.options.alt),a=e.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);e.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.alt})),e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,n){if(!i||i.x!==t.position.x||i.y!==t.position.y-2){var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt}e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:gl({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.lng=t.lng,e.options.lat=t.lat,e.options.alt=t.alt,e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:gl({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))}else{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.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(t){t.value=e.options.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.alt}))}}},{key:"flicker",value:function(){}}]);var i,n,o,s}(Ui);function wl(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return kl(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?kl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function kl(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(n=Dl(this,e,[t,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 J(n.sdk),n}return gi()(e,t),k()(e,[{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t?(this.options.show=t,this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=t),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),this.options.label&&this.options.label.show&&(this.label.show=t),It(this.sdk,this.options.id),Et(this.sdk,this.options.id)):console.error("参数必须为boolean")}},{key:"add",value:(s=a()(l.a.mark((function t(){var e,i,n,o,s,a=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.originalOptions=this.deepCopyObj(this.options),e=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=e.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(t){t._billboard.id=a.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},It(this.sdk,this.options.id),this.options.show&>(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(a.entity&&a.show){var t=a.sdk.viewer.camera.positionCartographic.height;a.entity.show=!(t>=1e7)}}));case 14:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"flyTo",value:(o=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=Sl({},this.options.position):this.options.positions?r=Sl({},this.options.positions[0]):this.options.center?r=Sl({},this.options.center):(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")){t.next=18;break}return t.next=17,this.getClampToHeight(r);case 17:r.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.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:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"minimumSpeed",get:function(){return this.options.minimumSpeed},set:function(t){this.options.minimumSpeed=t,this.particleSystem.minimumSpeed=t,this._elms.minimumSpeed&&this._elms.minimumSpeed.forEach((function(e){e.value=t}))}},{key:"maximumSpeed",get:function(){return this.options.maximumSpeed},set:function(t){this.options.maximumSpeed=t,this.particleSystem.maximumSpeed=t,this._elms.maximumSpeed&&this._elms.maximumSpeed.forEach((function(e){e.value=t}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=t,this.particleSystem.minimumParticleLife=t,this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=t}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=t,this.particleSystem.maximumParticleLife=t,this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=t}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=t,this.particleSystem.startScale=t,this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=t}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=t,this.particleSystem.endScale=t,this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=t}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=t,this.particleSystem.emissionRate=t,this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=t}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=t,this.particleSystem.minimumImageSize=new Cesium.Cartesian2(t,t),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(t,t),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);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(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);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(e){e.value=t}))}},{key:"alt",get:function(){return this.options.alt},set:function(t){this.options.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);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(e){e.value=t}))}},{key:"edit",value:(n=a()(l.a.mark((function t(){var e,i,n,o,s,a=this,r=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=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){t.next=21;break}return t.next=7,new bi(this.sdk,this.originalOptions,{title:"烟雾属性",left:"180px",top:"100px",confirmCallBack:function(t){a.name=a.name.trim(),a.name||(a.name="未命名对象"),a.originalOptions=a.deepCopyObj(a.options),a._DialogObject.close(),a.Dialog.confirmCallBack&&a.Dialog.confirmCallBack(a.originalOptions),It(a.sdk,a.options.id),Et(a.sdk,a.options.id)},resetCallBack:function(){a.reset(),a.Dialog.resetCallBack&&a.Dialog.resetCallBack()},removeCallBack:function(){a.Dialog.removeCallBack&&a.Dialog.removeCallBack()},closeCallBack:function(){a.reset(),a.positionEditing=!1,a.Dialog.closeCallBack&&a.Dialog.closeCallBack()},showCallBack:function(t){a.show=t,a.Dialog.showCallBack&&a.Dialog.showCallBack()},translationalCallBack:function(){a.positionEditing=!a.positionEditing}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(i=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 经度\n \n
        \n
        \n 纬度\n \n
        \n
        \n
        \n
        \n 高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n 起始颜色\n
        \n
        \n
        \n 结束颜色\n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n 最小初速度\n \n
        \n
        \n
        \n
        \n 最大初速度\n \n
        \n
        \n
        \n
        \n
        \n
        \n 最小存在时间\n \n
        \n
        \n
        \n
        \n 最大存在时间\n \n
        \n
        \n
        \n
        \n
        \n
        \n 起始比例\n \n
        \n
        \n
        \n
        \n 结束比例\n \n
        \n
        \n
        \n
        \n
        \n
        \n 发射速率(个/秒)\n \n
        \n
        \n
        \n
        \n 尺寸(像素)\n \n
        \n
        \n
        \n
        \n \n ',this._DialogObject.contentAppChild(i),n=new ewPlugins("colorpicker",{el:i.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(t){a.startColor=t},clear:function(){a.startColor="rgba(255,255,255,1)"}}),o=new ewPlugins("colorpicker",{el:i.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(t){a.endColor=t},clear:function(){a.endColor="rgba(255,255,255,1)"}}),s=i.getElementsByTagName("*"),xl.on(this,s),this._elms=xl.element,this._elms.startColor=[n],this._elms.endColor=[o],t.next=21;break;case 21:case"end":return t.stop()}}),t,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=a()(l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Pl(e,"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(),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,It(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.operate.positionEditing=t,!0===t){var i;this.tip&&this.tip.destroy(),this.tip=new q("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:Sl({},this.entity.position)},this.event.mouse_move((function(t,n){i=t.endPosition;var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(e.options.lng,e.options.lat,e.options.alt),a=e.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);e.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.alt})),e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,n){if(!i||i.x!==t.position.x||i.y!==t.position.y-2){var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt}e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Sl({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.lng=t.lng,e.options.lat=t.lat,e.options.alt=t.alt,e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Sl({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))}else{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.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(t){t.value=e.options.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.alt}))}}},{key:"flicker",value:function(){}}]);var i,n,o,s}(Ui);function Ml(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Tl(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Tl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Tl(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(n=jl(this,e,[t,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.gravity=i.gravity||0===i.gravity?i.gravity:-3.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 J(n.sdk),n}return gi()(e,t),k()(e,[{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t?(this.options.show=t,this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=t),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),this.options.label&&this.options.label.show&&(this.label.show=t),It(this.sdk,this.options.id),Et(this.sdk,this.options.id)):console.error("参数必须为boolean")}},{key:"add",value:(s=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c,u,p,h=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:p=function(){var t=Cesium.HeadingPitchRoll.fromDegrees(0,0,0),e=new Cesium.TranslationRotationScale;//!!!发射粒子的方向 +return e.translation=Cesium.Cartesian3.fromElements(0,0,0),e.rotation=Cesium.Quaternion.fromHeadingPitchRoll(t),Cesium.Matrix4.fromTranslationRotationScale(e)},u=function(t,i){t._billboard.id=e.options.id;var n=t.position;Cesium.Cartesian3.normalize(n,r),Cesium.Cartesian3.multiplyByScalar(r,c*i,r),t.velocity=Cesium.Cartesian3.add(t.velocity,r,t.velocity)},e=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),a=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=i.primitives.add(new Cesium.ParticleSystem({show:!(a>=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:p(),updateCallback:u})),r=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},It(this.sdk,this.options.id),this.options.show&>(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(h.entity&&h.show){var t=h.sdk.viewer.camera.positionCartographic.height;h.entity.show=!(t>=1e7)}}));case 21:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"flyTo",value:(o=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=Ll({},this.options.position):this.options.positions?r=Ll({},this.options.positions[0]):this.options.center?r=Ll({},this.options.center):(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")){t.next=18;break}return t.next=17,this.getClampToHeight(r);case 17:r.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.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:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"minimumSpeed",get:function(){return this.options.minimumSpeed},set:function(t){this.options.minimumSpeed=t,this.particleSystem.minimumSpeed=t,this._elms.minimumSpeed&&this._elms.minimumSpeed.forEach((function(e){e.value=t}))}},{key:"maximumSpeed",get:function(){return this.options.maximumSpeed},set:function(t){this.options.maximumSpeed=t,this.particleSystem.maximumSpeed=t,this._elms.maximumSpeed&&this._elms.maximumSpeed.forEach((function(e){e.value=t}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=Number(t),this.particleSystem.minimumParticleLife=Number(t),this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=Number(t)}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=Number(t),this.particleSystem.maximumParticleLife=Number(t),this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=Number(t)}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=t,this.particleSystem.startScale=t,this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=t}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=t,this.particleSystem.endScale=t,this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=t}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=t,this.particleSystem.emissionRate=t,this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=t}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=t,this.particleSystem.minimumImageSize=new Cesium.Cartesian2(t,t),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(t,t),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);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(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);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(e){e.value=t}))}},{key:"alt",get:function(){return this.options.alt},set:function(t){this.options.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);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(e){e.value=t}))}},{key:"edit",value:(n=a()(l.a.mark((function t(){var e,i,n,o,s,a=this,r=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=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){t.next=21;break}return t.next=7,new bi(this.sdk,this.originalOptions,{title:"喷泉属性",left:"180px",top:"100px",confirmCallBack:function(t){a.name=a.name.trim(),a.name||(a.name="未命名对象"),a.originalOptions=a.deepCopyObj(a.options),a._DialogObject.close(),a.Dialog.confirmCallBack&&a.Dialog.confirmCallBack(a.originalOptions),It(a.sdk,a.options.id),Et(a.sdk,a.options.id)},resetCallBack:function(){a.reset(),a.Dialog.resetCallBack&&a.Dialog.resetCallBack()},removeCallBack:function(){a.Dialog.removeCallBack&&a.Dialog.removeCallBack()},closeCallBack:function(){a.reset(),a.positionEditing=!1,a.Dialog.closeCallBack&&a.Dialog.closeCallBack()},showCallBack:function(t){a.show=t,a.Dialog.showCallBack&&a.Dialog.showCallBack()},translationalCallBack:function(){a.positionEditing=!a.positionEditing}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(i=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 经度\n \n
        \n
        \n 纬度\n \n
        \n
        \n
        \n
        \n 高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n 起始颜色\n
        \n
        \n
        \n 结束颜色\n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n 最小初速度\n \n
        \n
        \n
        \n
        \n 最大初速度\n \n
        \n
        \n
        \n
        \n
        \n
        \n 最小存在时间\n \n
        \n
        \n
        \n
        \n 最大存在时间\n \n
        \n
        \n
        \n
        \n
        \n
        \n 起始比例\n \n
        \n
        \n
        \n
        \n 结束比例\n \n
        \n
        \n
        \n
        \n
        \n
        \n 发射速率(个/秒)\n \n
        \n
        \n
        \n
        \n 尺寸(像素)\n \n
        \n
        \n
        \n
        \n \n ',this._DialogObject.contentAppChild(i),n=new ewPlugins("colorpicker",{el:i.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(t){a.startColor=t},clear:function(){a.startColor="rgba(255,255,255,1)"}}),o=new ewPlugins("colorpicker",{el:i.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(t){a.endColor=t},clear:function(){a.endColor="rgba(255,255,255,1)"}}),s=i.getElementsByTagName("*"),Bl.on(this,s),this._elms=Bl.element,this._elms.startColor=[n],this._elms.endColor=[o],t.next=21;break;case 21:case"end":return t.stop()}}),t,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=a()(l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Il(e,"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(),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,It(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.operate.positionEditing=t,!0===t){var i;this.tip&&this.tip.destroy(),this.tip=new q("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:Ll({},this.entity.position)},this.event.mouse_move((function(t,n){i=t.endPosition;var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(e.options.lng,e.options.lat,e.options.alt),a=e.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);e.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.alt})),e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,n){if(!i||i.x!==t.position.x||i.y!==t.position.y-2){var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt}e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Ll({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.lng=t.lng,e.options.lat=t.lat,e.options.alt=t.alt,e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Ll({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))}else{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.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(t){t.value=e.options.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.alt}))}}},{key:"flicker",value:function(){}}]);var i,n,o,s}(Ui);function zl(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Fl(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Fl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Fl(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(n=Gl(this,e,[t,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 J(n.sdk),n}return gi()(e,t),k()(e,[{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t?(this.options.show=t,this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=t),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),this.options.label&&this.options.label.show&&(this.label.show=t),It(this.sdk,this.options.id),Et(this.sdk,this.options.id)):console.error("参数必须为boolean")}},{key:"add",value:(s=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c,u,p,h,d,m,f,v,g,y,b,C,w=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:C=function(t,e){var i=new Cesium.Cartesian3,n=Cesium.Transforms.eastNorthUpToFixedFrame(t);return Cesium.Matrix4.inverse(n,n),Cesium.Matrix4.multiplyByPoint(n,e,i),Cesium.Cartesian3.normalize(i,i),Cesium.Math.toDegrees(Math.atan2(i.x,i.y))},b=function(){var t=Cesium.HeadingPitchRoll.fromDegrees(e.options.heading+90,e.options.pitch,0),i=new Cesium.TranslationRotationScale;//!!!发射粒子的方向 +return i.translation=Cesium.Cartesian3.fromElements(0,0,1),i.rotation=Cesium.Quaternion.fromHeadingPitchRoll(t),Cesium.Matrix4.fromTranslationRotationScale(i)},y=function(t,i){t._billboard.id=e.options.id;var n=t.position;Cesium.Cartesian3.normalize(n,a),Cesium.Cartesian3.multiplyByScalar(a,r*i,a),t.velocity=Cesium.Cartesian3.add(t.velocity,a,t.velocity)},e=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),a=new Cesium.Cartesian3,r=-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||(Cesium.Cartesian3.distance(c,u),this.options.heading=C(c,u)),p=this.options.end.alt-this.options.start.alt,h=Cesium.Cartesian3.distance(c,Cesium.Cartesian3.fromDegrees(this.options.end.lng,this.options.end.lat,this.options.start.alt)),d=p?2*p/h:0,m=Math.atan(d)*(180/Math.PI),f=Math.sqrt(Math.abs(d)*h/-r),v=-r*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},It(this.sdk,this.options.id),this.options.show&>(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(w.entity&&w.show){var t=w.sdk.viewer.camera.positionCartographic.height;w.entity.show=!(t>=1e7)}}));case 31:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"flyTo",value:(o=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=Hl({},this.options.position):this.options.positions?r=Hl({},this.options.positions[0]):this.options.line&&this.options.line.positions?r=Hl({},this.options.line.positions[0]):this.options.center?r=Hl({},this.options.center):this.options.start?r=Hl({},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")){t.next=16;break}return t.next=15,this.getClampToHeight(r);case 15:r.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.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:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 24:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=Number(t),this.particleSystem.minimumSpeed=Number(t),this.particleSystem.maximumSpeed=Number(t),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=Number(t)}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=Number(t),this.particleSystem.minimumParticleLife=Number(t),this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=Number(t)}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=Number(t),this.particleSystem.maximumParticleLife=Number(t),this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=Number(t)}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=Number(t),this.particleSystem.startScale=Number(t),this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=Number(t)}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=Number(t),this.particleSystem.endScale=Number(t),this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=Number(t)}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=Number(t),this.particleSystem.emissionRate=Number(t),this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=Number(t)}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=Number(t),this.particleSystem.minimumImageSize=new Cesium.Cartesian2(Number(t),2*Number(t)),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(Number(t),2*Number(t)),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=Number(t)}))}},{key:"lng",get:function(){return this.options.start.lng},set:function(t){this.options.start.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);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(e){e.value=t}))}},{key:"lat",get:function(){return this.options.start.lat},set:function(t){this.options.start.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);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(e){e.value=t}))}},{key:"alt",get:function(){return this.options.start.alt},set:function(t){this.options.start.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);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(e){e.value=t}))}},{key:"heading",get:function(){return this.options.heading},set:function(t){this.options.heading=Number(t);var e=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(e);var n=Cesium.Matrix4.fromTranslationRotationScale(i);this.particleSystem.emitterModelMatrix=n,this._elms.heading&&this._elms.heading.forEach((function(e){e.value=Number(t)}))}},{key:"pitch",get:function(){return this.options.pitch},set:function(t){this.options.pitch=Number(t);var e=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(e);var n=Cesium.Matrix4.fromTranslationRotationScale(i);this.particleSystem.emitterModelMatrix=n,this._elms.pitch&&this._elms.pitch.forEach((function(e){e.value=Number(t)}))}},{key:"edit",value:(n=a()(l.a.mark((function t(){var i,n,o,s,a,r=this,c=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.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){t.next=20;break}return t.next=7,new bi(this.sdk,this.originalOptions,{title:"喷射水柱属性",left:"180px",top:"100px",confirmCallBack:function(t){r.name=r.name.trim(),r.name||(r.name="未命名对象"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.originalOptions),It(r.sdk,r.options.id),Et(r.sdk,r.options.id)},resetCallBack:function(){r.reset(),r.Dialog.resetCallBack&&r.Dialog.resetCallBack()},removeCallBack:function(){r.Dialog.removeCallBack&&r.Dialog.removeCallBack()},closeCallBack:function(){r.reset(),r.positionEditing=!1,r.Dialog.closeCallBack&&r.Dialog.closeCallBack()},showCallBack:function(t){r.show=t,r.Dialog.showCallBack&&r.Dialog.showCallBack()},translationalCallBack:function(){r.positionEditing=!r.positionEditing}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(n=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 经度\n \n
        \n
        \n 纬度\n \n
        \n
        \n
        \n
        \n 高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n 起始颜色\n
        \n
        \n
        \n 结束颜色\n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n 速度\n \n
        \n
        \n
        \n
        \n 发射速率(个/秒)\n \n
        \n
        \n
        \n
        \n
        \n
        \n 最小存在时间\n \n
        \n
        \n
        \n
        \n 最大存在时间\n \n
        \n
        \n
        \n
        \n
        \n
        \n 起始比例\n \n
        \n
        \n
        \n
        \n 结束比例\n \n
        \n
        \n
        \n
        \n
        \n
        \n 朝向\n \n
        \n
        \n
        \n
        \n 俯仰角度\n \n
        \n
        \n
        \n
        \n
        \n
        \n 尺寸(像素)\n \n
        \n
        \n
        \n
        \n
        \n
        \n \n ',this._DialogObject.contentAppChild(n),o=new ewPlugins("colorpicker",{el:n.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.startColor=t},clear:function(){r.startColor="rgba(255,255,255,1)"}}),s=new ewPlugins("colorpicker",{el:n.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.endColor=t},clear:function(){r.endColor="rgba(255,255,255,1)"}}),a=n.getElementsByTagName("*"),e.EventBinding(this,a),this._elms.startColor=[o],this._elms.endColor=[s],t.next=20;break;case 20:case"end":return t.stop()}}),t,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=a()(l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ul(e,"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(),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,It(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.operate.positionEditing=t,!0===t){var i;this.tip&&this.tip.destroy(),this.tip=new q("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:Hl({},this.entity.position)},this.event.mouse_move((function(t,n){i=t.endPosition;var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.start.lng=o.lng,e.options.start.lat=o.lat,e.options.start.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(e.options.start.lng,e.options.start.lat,e.options.start.alt),a=e.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);e.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.start.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.start.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.start.alt})),e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,n){if(!i||i.x!==t.position.x||i.y!==t.position.y-2){var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.start.lng=o.lng,e.options.start.lat=o.lat,e.options.start.alt=o.alt}e.entity.position={lng:e.options.start.lng,lat:e.options.start.lat,alt:e.options.start.alt},e.previous={positions:Hl({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.start.lng=e.entity.position.lng,e.options.start.lat=e.entity.position.lat,e.options.start.alt=e.entity.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.lng=t.lng,e.options.lat=t.lat,e.options.alt=t.alt,e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Hl({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))}else{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.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(t){t.value=e.options.start.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.start.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.start.alt}))}}},{key:"flicker",value:function(){}}],[{key:"EventBinding",value:function(t,e){for(var i=function(){var i,o=[],s=!1,a=[],r=zl(e[n].attributes);try{var l=function(){var r=i.value;switch(r.name){case"@model":s=!0,"checkbox"==e[n].type?(o.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(o.push((function(e){var i=e.target.value;"number"==e.target.type?"."==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\n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n 投影面积:\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n 多面体颜色\n
        \n
        \n
        \n 多面体高度\n
        \n \n m\n \n
        \n
        \n \x3c!--
        \n 拉伸高度\n \n
        --\x3e\n
        \n
        \n
        \n
        \n \n \n '.concat(zi(t),'\n \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n
        \n
        \n
        \n \n ')}function Jl(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return ql(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ql(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function ql(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);iNumber(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function $l(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(i=Ql(this,e,[t,n])).options.color=n.color||"#0df7f8",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={},i.options["area-unit"]=n["area-unit"]||"平方米",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,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||["#42c6ef","#42c6ef"],lineColor:n.label.lineColor||"#fff000",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._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),e.create(i)),i}return gi()(e,t),k()(e,[{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(!YJ.Measure.GetMeasureStatus()){var i=this;if(this.event&&this.event.destroy(),this.event=new J(this.sdk),this.operate.positionEditing=t,this.previous={positions:N()(this.positions)},!0===t){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=500)e.positionEditing=!1;else{e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.event.destroy();var t=e.cartesian3Towgs84(i,e.sdk.viewer),o=Cesium.Cartesian3.fromDegrees(t.lng,t.lat);f=[],e.options.positions=[];for(var s=0;s0?new Cesium.PolygonHierarchy(f):new Cesium.PolygonHierarchy(a)}),!1)}else{this.label&&(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-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var o=0;o\n
        '+this.options.attribute.vr.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;for(var i=[[]],n=0;ni[s].alt&&(o=i[s].alt);t.options.extrudedHeight=o;for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:function(){};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 J(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.options.areaByMeter=t.computeArea(t.options.positions);for(var r=[[]],l=0;l=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]}switch(t.options["area-unit"]){case"平方米":t.area=t.options.areaByMeter;break;case"平方千米":t.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.area=t.options.areaByMeter}}else{var p=t.sdk.viewer.scene.pick(e.position);p&&p.id&&p.id.name&&"node-secondary-edit-point"===p.id.name&&(i=p.id,t.nodePoints.splice(p.id.index,1),t.sdk.viewer.entities.remove(p.id),t.tip.set_text("左键确认,右键结束,CTRL+右键撤销"),n=t.cartesian3Towgs84(i.position._value,t.sdk.viewer))}},a=function(s,a){if(i){switch(t.options.positions[i.index]=n,o&&t.options.positions.splice(i.index,1),t.options.areaByMeter=t.computeArea(t.options.positions),t.options["area-unit"]){case"平方米":t.area=t.options.areaByMeter;break;case"平方千米":t.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.area=t.options.areaByMeter}for(var r=t.options.positions,l=[],c=0;c=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\n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n 投影面积:\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(zi(t),'\n \n \n
        \n
        \n 面颜色\n
        \n
        \n
        \n 边线颜色\n
        \n
        \n
        \n 边线宽度\n
        \n \n px\n \n
        \n
        \n
        \n
        \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n
        \n
        \n
        \n \n ')}function nc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function oc(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function ac(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(i=rc(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#36c4ff",i.options.show=!n.show&&!1!==n.show||n.show,i.options.positions=n.positions||[],i.options.line=n.line||{},i.options.line.width=i.options.line.width||2,i.options.line.color=i.options.line.color||"rgba(155, 155, 124, 0.89)",i.options["area-unit"]=n["area-unit"]||"平方米",i.entity,i.event=new J(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,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||["#42c6ef","#42c6ef"],lineColor:n.label.lineColor||"#fff000",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.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})):(i.sdk.addIncetance(i.options.id,i),e.create(i)),i}return gi()(e,t),k()(e,[{key:"type",get:function(){return"AssembleObject"}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t;var i=Cesium.Color.fromCssColorString(t);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:t})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t,this.entity.polyline.material=Cesium.Color.fromCssColorString(t),this._elms.lineColor&&this._elms.lineColor.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,255,255,1)"}});e._elms.lineColor[n]=o}))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){this.options.line.width=t,this.entity.polyline.width=t,this._elms.lineColor&&this._elms.lineColor.forEach((function(e){e.value=t}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){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(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){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(t){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(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(255,255,255,1)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var o=0;o\n
        '+this.options.attribute.vr.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==S[0]?S[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=oc({},this.options.position):this.options.positions?r=oc({},this.options.positions[0]):this.options.center?r=oc({},this.options.center):this.options.start?r=oc({},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")){t.next=18;break}return t.next=17,this.getClampToHeight(r);case 17:r.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.next=63;break;case 25:if(c=[],this.options.height||0===this.options.height){t.next=60;break}u=0,p=this.options.positions[0],h=Cesium.Cartesian3.fromDegrees(p.lng,p.lat,0),d=Cesium.Cartesian3.fromDegrees(p.lng,p.lat,1e7),m=Cesium.Cartesian3.subtract(d,h,new Cesium.Cartesian3),f=Cesium.Cartesian3.normalize(m,m),v=new Cesium.Ray(h,f),g={},y=this.sdk.viewer.scene.drillPickFromRay(v),b=0;case 37:if(!(b=500)e.positionEditing=!1;else{e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),m=[];for(var t=0;t0)for(var e=0;e0)for(var e=0;e=3?[].concat(N()(o),[o[0],o[1]]):N()(o)}),!1)}else{this.label&&(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();for(var f=[[]],v=0;v=3?[].concat(N()(t),[t[0],t[1]]):N()(t)}),!0)}}}},{key:"setPosition",value:function(t){for(var e,i=Cesium.Cartesian3.fromDegrees(t.position.lng,t.position.lat,t.position.alt),n=N()(this.positions),o=[],s=[],a=0;a0)for(var v=0;v=3?[].concat(N()(g),[g[0],g[1]]):N()(g)}),!1)}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;for(var i=this.computeAssemble(this.options.positions),n=[[]],o=0;oNumber(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i1&&void 0!==arguments[1]?arguments[1]:function(){};if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n,o=function(){var e=a()(l.a.mark((function e(){var i,n,o;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=0;case 1:if(!(i=3?t.entity.polyline.positions=[].concat(N()(r),[r[0],r[1]]):t.entity.polyline.positions=N()(r);for(var l=[[]],c=0;c=3?[].concat(N()(e),[e[0],e[1]]):N()(e)}),!0)};t.event.mouse_left(u),t.event.mouse_right(p),t.event.mouse_move(c),t.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){var t=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t-n>=500?p():u(o,i)}))})),t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var e=t.computeAssemble(t.options.positions);return new Cesium.PolygonHierarchy(e)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){var e=t.computeAssemble(t.options.positions);return e.length>=3?[].concat(N()(e),[e[0],e[1]]):N()(e)}),!1),o()}}}]);var i,n,o,s}(Ui);function cc(t){return'\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n 投影面积:\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n 动画时长\n
        \n \n ms\n \n
        \n
        \n
        \n
        \n
        \n 动画\n \n
        \n
        \n 动画重复\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(zi(t),'\n \n \n
        \n
        \n 高度模式\n
        \n
        \n
        \n Z值统一增加\n
        \n \n m\n \n
        \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        经度(X)
        \n
        纬度(Y)
        \n
        高度(Z)
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n 面颜色\n
        \n
        \n
        \n 边线颜色\n
        \n
        \n
        \n 边线宽度\n
        \n \n px\n \n
        \n
        \n
        \n
        \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n
        \n
        \n
        \n \n ')}function uc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function pc(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function dc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(C()(this,e),(i=mc(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#36c4ff",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||2,i.options.line.color=i.options.line.color||"rgba(155, 155, 124, 0.89)",i.options["area-unit"]=n["area-unit"]||"平方米",i.entity,i.event=new J(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,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||["#42c6ef","#42c6ef"],lineColor:n.label.lineColor||"#fff000",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.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-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var o=0;o\n
        '+this.options.attribute.vr.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c'.concat(i+1,'\n
        \n
        \n
        \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 p=o.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);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),e.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),e.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})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.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(h),n._elms.altInput.push(d),t.appendChild(o)},o=0;o0&&void 0!==S[0]?S[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=pc({},this.options.position):this.options.positions?r=pc({},this.options.positions[0]):this.options.center?r=pc({},this.options.center):this.options.start?r=pc({},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")){t.next=18;break}return t.next=17,this.getClampToHeight(r);case 17:r.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.next=63;break;case 25:if(c=[],this.options.height||0===this.options.height){t.next=60;break}u=0,p=this.options.positions[0],h=Cesium.Cartesian3.fromDegrees(p.lng,p.lat,0),d=Cesium.Cartesian3.fromDegrees(p.lng,p.lat,1e7),m=Cesium.Cartesian3.subtract(d,h,new Cesium.Cartesian3),f=Cesium.Cartesian3.normalize(m,m),v=new Cesium.Ray(h,f),g={},y=this.sdk.viewer.scene.drillPickFromRay(v),b=0;case 37:if(!(b=500)e.positionEditing=!1;else{e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),m=[];for(var t=0;t0)for(var e=0;e0)for(var v=0;v0)for(var v=0;v=3?[].concat(N()(g),[g[0],g[1]]):N()(g)}),!1)}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;for(var i=this.computeAttackArrow(this.options.positions),n=[[]],o=0;o9999999&&(e=9999999),this.options.spreadTime=e,this.spreadState&&this.setSpreadProgressByTime(),this._elms.spreadTime&&this._elms.spreadTime.forEach((function(t){t.value=e}))}},{key:"loop",get:function(){return this.options.loop},set:function(t){this.options.loop=t,this.TweenAnimate&&(t?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat()),this._elms.loop&&this._elms.loop.forEach((function(e){e.checked=t}))}},{key:"spreadState",get:function(){return this.options.spreadState},set:function(t){this.options.spreadState=t,this.TweenAnimate?t?(this.lineEdit=!1,this.setSpreadProgressByTime(this.TweenAnimate._object.distance/this.TweenAnimate._valuesEnd.distance*this.spreadTime)):this.TweenAnimate.pause():t&&this.setSpreadProgressByTime(),this._elms.spreadState&&this._elms.spreadState.forEach((function(e){e.checked=t}))}},{key:"setSpreadProgressByTime",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.entity){for(var i=this,n=0;n=0)){t.next=10;break}if(!(e.distance>=c[o])){t.next=7;break}return(n=n+o+1)>i.options.positions.length-1&&(n=i.options.positions.length-1),t.abrupt("break",10);case 7:o--,t.next=2;break;case 10:for(s=[],a=0;aNumber(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i1&&void 0!==arguments[1]?arguments[1]:function(){};if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n,o=function(){var e=a()(l.a.mark((function e(){var i,n,o;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=0;case 1:if(!(i2){for(var u=0;u3&&i.index===t.options.positions.length-1&&t.options.positions.splice(i.index+1,1)):t.options.positions.pop();var a=t.options.positions;t.options.positions=N()(t.options.positions);for(var r=[],l=0;l=3?t.entity.polyline.positions=[].concat(N()(c),[c[0],c[1]]):t.entity.polyline.positions=N()(c);for(var u=[[]],p=0;p=3?[].concat(N()(e),[e[0],e[1]]):N()(e)}),!0)};t.event.mouse_left(u),t.event.mouse_right(p),t.event.mouse_move(c),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]),t.nodePoints.pop(),i.index&&i.index===t.options.positions.length&&(t.nodePoints[i.index-1]?i=t.nodePoints[i.index-1]:i.index=i.index-1))})),t.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){var t=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t-n>=500?p(o,i):u(o,i)}))})),t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var e=t.computeAttackArrow(t.options.positions);return new Cesium.PolygonHierarchy(e)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){var e=t.computeAttackArrow(t.options.positions);return e.length>=3?[].concat(N()(e),[e[0],e[1]]):N()(e)}),!1),o()}}},{key:"closeNodeEdit",value:function(t){YJ.Measure.SetMeasureStatus(!1),t.ControllerObject&&t.ControllerObject.destroy(),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e\n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n 投影面积:\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n 动画时长\n
        \n \n ms\n \n
        \n
        \n
        \n
        \n
        \n 动画\n \n
        \n
        \n 动画重复\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(zi(t),'\n \n \n \n
        \n
        \n 面颜色\n
        \n
        \n
        \n 边线颜色\n
        \n
        \n
        \n 边线宽度\n
        \n \n px\n \n
        \n
        \n
        \n
        \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n
        \n
        \n
        \n \n ')}function gc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function yc(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Cc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(i=wc(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#36c4ff",i.options.show=!n.show&&!1!==n.show||n.show,i.options.positions=n.positions||[],i.options.line=n.line||{},i.options.line.width=i.options.line.width||2,i.options.line.color=i.options.line.color||"rgba(155, 155, 124, 0.89)",i.options["area-unit"]=n["area-unit"]||"平方米",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,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||["#42c6ef","#42c6ef"],lineColor:n.label.lineColor||"#fff000",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.positions||i.options.positions.length<5?(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),e.create(i)),i}return gi()(e,t),k()(e,[{key:"type",get:function(){return"PincerArrowObject"}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this.label.text=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t;var i=Cesium.Color.fromCssColorString(t);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:t})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t,this.entity.polyline.material=Cesium.Color.fromCssColorString(t),this._elms.lineColor&&this._elms.lineColor.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,255,255,1)"}});e._elms.lineColor[n]=o}))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){this.options.line.width=t,this.entity.polyline.width=t,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(e){e.value=t}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){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(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){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(t){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(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(255,255,255,1)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var o=0;o\n
        '+this.options.attribute.vr.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==v[0]?v[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=yc({},this.options.position):this.options.positions?r=yc({},this.options.positions[0]):this.options.center?r=yc({},this.options.center):this.options.start?r=yc({},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")){t.next=18;break}return t.next=17,this.getClampToHeight(r);case 17:r.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.next=42;break;case 25:if(c=[],this.options.height||0===this.options.height){t.next=39;break}u=0;case 28:if(!(u=500)e.positionEditing=!1;else{e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),m=[];for(var t=0;t0)for(var e=0;e0)for(var e=0;e=3?[].concat(N()(o),[o[0],o[1]]):N()(o)}),!1)}else{this.label&&(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 f=[[]],v=0;v=3?[].concat(N()(t),[t[0],t[1]]):N()(t)}),!0)}}}},{key:"setPosition",value:function(t){for(var e,i=Cesium.Cartesian3.fromDegrees(t.position.lng,t.position.lat,t.position.alt),n=N()(this.positions),o=[],s=[],a=0;a0)for(var v=0;v=3?[].concat(N()(g),[g[0],g[1]]):N()(g)}),!1)}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;for(var i=this.computePincerArrow(this.options.positions),n=[[]],o=0;o9999999&&(e=9999999),this.options.spreadTime=e,this.spreadState&&this.setSpreadProgressByTime(),this._elms.spreadTime&&this._elms.spreadTime.forEach((function(t){t.value=e}))}},{key:"loop",get:function(){return this.options.loop},set:function(t){this.options.loop=t,this.TweenAnimate&&(t?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat()),this._elms.loop&&this._elms.loop.forEach((function(e){e.checked=t}))}},{key:"spreadState",get:function(){return this.options.spreadState},set:function(t){this.options.spreadState=t,this.TweenAnimate?t?(this.lineEdit=!1,this.setSpreadProgressByTime(this.TweenAnimate._object.distance1/this.TweenAnimate._valuesEnd.distance1*this.spreadTime)):this.TweenAnimate.pause():t&&this.setSpreadProgressByTime(),this._elms.spreadState&&this._elms.spreadState.forEach((function(e){e.checked=t}))}},{key:"setSpreadProgressByTime",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.entity){for(var i=this,n=0;n=212;y--){var b=this.cartesian3Towgs84(r[y],this.sdk.viewer);u.push([b.lng,b.lat,b.alt])}f?u.push([this.options.positions[2].lng,this.options.positions[2].lat,this.options.positions[2].alt]):u.push([this.options.positions[3].lng,this.options.positions[3].lat,this.options.positions[3].alt]),p.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 C=this.deepCopyObj(this.options.positions),w=turf.lineString(c),k=turf.length(w,{units:"kilometers"}),_=turf.lineString(u),x=turf.length(_,{units:"kilometers"}),E=turf.lineString(p),S=turf.length(E,{units:"kilometers"}),D=e/this.spreadTime;this.TweenAnimate=new TWEEN.Tween({distance1:k*D,distance2:x*D,distance3:S*D}).to({distance1:k,distance2:x,distance3:S},this.spreadTime-e).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){e&&t.setSpreadProgressByTime()})).onUpdate(function(){var e=a()(l.a.mark((function e(i,n){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.TweenAnimate._duration!=1/0){e.next=2;break}return e.abrupt("return");case 2:if(t.sdk.viewer){e.next=6;break}return t.removeAnimate(),e.abrupt("return");case 6:P(i);case 7:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).onStart((function(){t.options.spreadState=!0,t._elms.spreadState&&t._elms.spreadState.forEach((function(t){t.checked=!0}))})).onComplete((function(e){t.removeAnimate()})),this.spreadState?this.TweenAnimate.start():P({distance1:k*D,distance2:x*D,distance3:S*D}),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(o)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return s}),!1)}function P(t){return O.apply(this,arguments)}function O(){return(O=a()(l.a.mark((function t(e){var n,a,r,c,u,h,d,m;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=2,a=3,f&&(n=3,a=2),e.distance1){t.next=8;break}C[n].lng=C[1].lng,C[n].lat=C[1].lat,t.next=14;break;case 8:return t.next=10,turf.lineSliceAlong(w,0,e.distance1,{units:"kilometers"});case 10:r=t.sent,c=N()(r.geometry.coordinates[r.geometry.coordinates.length-1]),C[n].lng=c[0],C[n].lat=c[1];case 14:if(e.distance2){t.next=19;break}C[a].lng=C[0].lng,C[3].lat=C[0].lat,t.next=25;break;case 19:return t.next=21,turf.lineSliceAlong(_,0,e.distance2,{units:"kilometers"});case 21:u=t.sent,h=N()(u.geometry.coordinates[u.geometry.coordinates.length-1]),C[a].lng=h[0],C[a].lat=h[1];case 25:if(e.distance3){t.next=30;break}C[4].lng=p[0][0],C[4].lat=p[0][1],t.next=36;break;case 30:return t.next=32,turf.lineSliceAlong(E,0,e.distance3,{units:"kilometers"});case 32:d=t.sent,m=N()(d.geometry.coordinates[d.geometry.coordinates.length-1]),C[4].lng=m[0],C[4].lat=m[1];case 36:o=i.computePincerArrow(C),s=o.length>=3?[].concat(N()(o),[o[0],o[1]]):N()(o);case 38:case"end":return t.stop()}}),t)})))).apply(this,arguments)}}},{key:"removeAnimate",value:function(){if(this.spreadState=!1,this.TweenAnimate){TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null;for(var t=this.options.positions,e=[[]],i=[],n=0;nNumber(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i1&&void 0!==arguments[1]?arguments[1]:function(){};if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n,o=function(){var e=a()(l.a.mark((function e(){var i,n,o;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=0;case 1:if(!(i=3?t.entity.polyline.positions=[].concat(N()(l),[l[0],l[1]]):t.entity.polyline.positions=N()(l);for(var c=[[]],u=0;u=3?[].concat(N()(e),[e[0],e[1]]):N()(e)}),!0)};t.event.mouse_left(u),t.event.mouse_right(p),t.event.mouse_move((function(e,n){if(i){t.positions[i.index]=n,s[i.index]=t.cartesian3Towgs84(n,t.sdk.viewer);for(var o=s,a=[],r=0;r=500?p():u(o,i)}))})),t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var e=t.computePincerArrow(s);return new Cesium.PolygonHierarchy(e)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){var e=t.computePincerArrow(s);return e.length>=3?[].concat(N()(e),[e[0],e[1]]):N()(e)}),!1),o()}}}]);var i,n,o,s}(Ui);function _c(t){return'\n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n 投影面积:\n \n
        \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(zi(t),'\n \n \n
        \n
        \n 面颜色\n
        \n
        \n
        \n 边线颜色\n
        \n
        \n
        \n 边线宽度\n
        \n \n px\n \n
        \n
        \n
        \n
        \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ',"\n
        \n
        \n
        \n ")}function xc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ec(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Dc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=Pc(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#36c4ff",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||2,i.options.line.color=i.options.line.color||"rgba(155, 155, 124, 0.89)",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,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||["#42c6ef","#42c6ef"],lineColor:n.label.lineColor||"#fff000",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.event=new J(i.sdk),i.nodePoints=[],i.operate={},i.Dialog={},i.sdk.addIncetance(i.options.id,i),e.create(i),i}return gi()(e,t),k()(e,[{key:"type",get:function(){return"CircleObject"}},{key:"radius",get:function(){return this.options.radius},set:function(t){this.options.radius=t,this.options.areaByMeter=Number((Cesium.Math.PI*this.options.radius*this.options.radius).toFixed(2)),this.areaUnit=this.areaUnit;var e=this.createCircle(this.options.center,this.options.radius);this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(e)),this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArray(e)}},{key:"center",get:function(){return this.options.center},set:function(t){this.options.center=t;var e=this.createCircle(this.options.center,this.options.radius);this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(e)),this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArray(e)}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t;var i=Cesium.Color.fromCssColorString(t);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:t})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t,this.entity.polyline.material=Cesium.Color.fromCssColorString(t),this._elms.lineColor&&this._elms.lineColor.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,255,255,1)"}});e._elms.lineColor[n]=o}))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){this.options.line.width=t,this.entity.polyline.width=t,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(e){e.value=t}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){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(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){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(t){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(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(255,255,255,1)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var o=0;o\n
        '+this.options.attribute.vr.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==E[0]?E[0]:{},ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=Ec({},this.options.position):this.options.positions?r=Ec({},this.options.positions[0]):this.options.center?r=Ec({},this.options.center):this.options.start?r=Ec({},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")){t.next=16;break}return t.next=15,this.getClampToHeight(r);case 15:r.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.next=60;break;case 23:c=this.entity.polygon.hierarchy.getValue(Cesium.JulianDate.now()).positions,u=[],p=0,h=this.cartesian3Towgs84(c[0],this.sdk.viewer),d=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,0),m=Cesium.Cartesian3.fromDegrees(h.lng,h.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=500)e.positionEditing=!1;else{i=[];var t=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.center.lng=t.lng,e.options.center.lat=t.lat,e.options.center.alt=t.alt,i=e.createCircle(e.options.center,e.options.radius),e.label.position=[t.lng,t.lat],e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.previous={positions:Ec({},e.options.center)},e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(i))}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArray(i)}),!1)}else{this.label&&(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 n;n=this.createCircle(this.options.center,this.options.radius),this.getClampToHeight({lng:this.previous.positions.lng,lat:this.previous.positions.lat}).then((function(t){e.label.position=[e.previous.positions.lng,e.previous.positions.lat,t]})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(n))}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArray(n)}),!0)}}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.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=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}}],[{key:"create",value:function(t){var i=t.createCircle(t.options.center,t.options.radius),n=!0,o=Cesium.Color.fromCssColorString(t.options.color);switch(2===t.sdk.viewer.scene.mode&&(n=!1,o=new Cesium.CustomColorMaterialSource({color:t.options.color})),t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,polygon:{hierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(i)),perPositionHeight:!n,material:o,zIndex:t.sdk._entityZIndex},polyline:{positions:Cesium.Cartesian3.fromDegreesArray(i),width:t.options.line.width,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!0,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t),t.options.areaByMeter=Number((Cesium.Math.PI*t.options.radius*t.options.radius).toFixed(2)),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}It(t.sdk,t.options.id),t.options.show&>(0,t.options.id)}},{key:"createLabel",value:(i=a()(l.a.mark((function t(e){var i;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getClampToHeight({lng:e.options.center.lng,lat:e.options.center.lat});case 2:i=t.sent,e.options.label.position||(e.options.label.position={lng:e.options.center.lng,lat:e.options.center.lat,alt:i}),e.label=new Ki(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far});case 5:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"nodeEdit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus());else{var i=function(){var e=a()(l.a.mark((function e(){var i,n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getClampToHeight(t.options.center);case 2:i=e.sent,n=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(t.options.center.lng,t.options.center.lat,i),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.push(n);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();t.event&&t.event.destroy(),t.event=new J(t.sdk),YJ.Measure.SetMeasureStatus(!0),t.tip=new q("左键确认,右键取消",t.sdk),t.event=new J(t.sdk),t.nodePoints=[];var n,o=[],s=Ec({},t.options.center),r=null;o=t.createCircle(t.options.center,t.options.radius),t.event.mouse_left((function(i,a){n&&(t.sdk.viewer.entities.remove(n),n=null),s=t.cartesian3Towgs84(a,t.viewer);var r=t.computeDistance([t.options.center,s]);t.radius=r,o=t.createCircle(t.options.center,r);for(var l=0;l1e3?"半径:"+(r/1e3).toFixed(2)+" 公里":"半径:"+r+" 米"}),!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(e){return Cesium.Cartesian3.fromDegreesArray([t.options.center.lng,t.options.center.lat,s.lng,s.lat])}),!1),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:99999999}}))}}},{key:"EventBinding",value:function(t,e){for(var i=function(){var i,o=[],s=!1,a=[],r=Sc(e[n].attributes);try{var l=function(){var r=i.value;switch(r.name){case"@model":s=!0,"checkbox"==e[n].type?(o.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(o.push((function(e){var i=e.target.value;"number"==e.target.type?"."==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\n
        \n 名称\n \n
        \n
        \n
        \n
        \n 投影面积:\n \n
        \n
        \n
        \n
        \n \n
        \n \n \n '.concat(zi(t),'\n \n \n
        \n
        \n 面颜色\n
        \n
        \n
        \n 边线颜色\n
        \n
        \n
        \n 边线宽度\n
        \n \n px\n \n
        \n
        \n
        \n
        \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ',"\n
        \n
        \n
        \n ")}function Tc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Nc(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ac(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=Lc(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#36c4ff",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||2,i.options.line.color=i.options.line.color||"rgba(155, 155, 124, 0.89)",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,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||["#42c6ef","#42c6ef"],lineColor:n.label.lineColor||"#fff000",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.event=new J(i.sdk),i.nodePoints=[],i.operate={},i.Dialog={},i.sdk.addIncetance(i.options.id,i),e.create(i),i}return gi()(e,t),k()(e,[{key:"type",get:function(){return"EllipseObject"}},{key:"semiMinorAxis",get:function(){return this.options.semiMinorAxis},set:function(t){this.options.semiMinorAxis=t,this.options.areaByMeter=Number((Cesium.Math.PI*this.options.semiMinorAxis*this.options.semiMajorAxis).toFixed(2)),this.areaUnit=this.areaUnit;var e=this.createEllipse(this.options.center,{bearing:this.options.bearing,semiMinorAxis:this.options.semiMinorAxis,semiMajorAxis:this.options.semiMajorAxis});this.entity.ellipse.semiMinorAxis=this.options.semiMinorAxis,this.entity.polyline.positions=e}},{key:"semiMajorAxis",get:function(){return this.options.semiMajorAxis},set:function(t){this.options.semiMajorAxis=t,this.options.areaByMeter=Number((Cesium.Math.PI*this.options.semiMinorAxis*this.options.semiMajorAxis).toFixed(2)),this.areaUnit=this.areaUnit;var e=this.createEllipse(this.options.center,{bearing:this.options.bearing,semiMinorAxis:this.options.semiMinorAxis,semiMajorAxis:this.options.semiMajorAxis});this.entity.ellipse.semiMajorAxis=this.options.semiMajorAxis,this.entity.polyline.positions=e}},{key:"center",get:function(){return this.options.center},set:function(t){this.options.center=t;var e=this.createEllipse(this.options.center,{bearing:this.options.bearing,semiMinorAxis:this.options.semiMinorAxis,semiMajorAxis:this.options.semiMajorAxis});this.entity.position=Cesium.Cartesian3.fromDegrees(this.options.center.lng,this.options.center.lat),this.entity.polyline.positions=e}},{key:"bearing",get:function(){return this.options.bearing},set:function(t){this.options.bearing=t;var e=this.createEllipse(this.options.center,{bearing:this.options.bearing,semiMinorAxis:this.options.semiMinorAxis,semiMajorAxis:this.options.semiMajorAxis});this.entity.ellipse.rotation=Cesium.Math.toRadians(this.options.bearing),this.entity.polyline.positions=e}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t;var i=Cesium.Color.fromCssColorString(t);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:t})),this.entity.ellipse.material=i,this.entity.polyline.width=this.lineWidth,this._elms.color&&this._elms.color.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t,this.entity.polyline.material=Cesium.Color.fromCssColorString(t),this._elms.lineColor&&this._elms.lineColor.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,255,255,1)"}});e._elms.lineColor[n]=o}))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){this.options.line.width=t,this.entity.polyline.width=t,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(e){e.value=t}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){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(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){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(t){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(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(255,255,255,1)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var o=0;o\n
        '+this.options.attribute.vr.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==E[0]?E[0]:{},ve(0),re(this.sdk),le(this.sdk),!this.options.customView){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=Nc({},this.options.position):this.options.positions?r=Nc({},this.options.positions[0]):this.options.center?r=Nc({},this.options.center):this.options.start?r=Nc({},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")){t.next=16;break}return t.next=15,this.getClampToHeight(r);case 15:r.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.next=60;break;case 23:c=this.entity.polyline.positions.getValue(),u=[],p=0,h=this.cartesian3Towgs84(c[0],this.sdk.viewer),d=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,0),m=Cesium.Cartesian3.fromDegrees(h.lng,h.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=500)e.positionEditing=!1;else{i=[];var t=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.center.lng=t.lng,e.options.center.lat=t.lat,e.options.center.alt=t.alt,i=e.createEllipse(e.options.center,{bearing:e.options.bearing,semiMinorAxis:e.options.semiMinorAxis,semiMajorAxis:e.options.semiMajorAxis}),e.label.position=[t.lng,t.lat],e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.previous={center:Nc({},e.options.center)},e.positionEditing=!1}}))})),this.entity.position=new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(e.options.center.lng,e.options.center.lat)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return i}),!1)}else{this.previous||(this.previous={center:this.deepCopyObj(this.options.center)}),this.options.center=this.deepCopyObj(this.previous.center),this.label&&(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 n;n=this.createEllipse(this.previous.center,{bearing:this.options.bearing,semiMinorAxis:this.options.semiMinorAxis,semiMajorAxis:this.options.semiMajorAxis}),this.getClampToHeight({lng:this.previous.center.lng,lat:this.previous.center.lat}).then((function(t){e.label.position=[e.previous.center.lng,e.previous.center.lat,t]})),this.entity.position=Cesium.Cartesian3.fromDegrees(this.previous.center.lng,this.previous.center.lat),this.entity.polyline.positions=n}}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.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=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}}],[{key:"create",value:function(t){var i=t.createEllipse(t.options.center,{bearing:t.options.bearing,semiMinorAxis:t.options.semiMinorAxis,semiMajorAxis:t.options.semiMajorAxis});i.push(i[0]);var n=Cesium.Color.fromCssColorString(t.options.color);switch(2===t.sdk.viewer.scene.mode&&(!1,n=new Cesium.CustomColorMaterialSource({color:t.options.color})),t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,position:Cesium.Cartesian3.fromDegrees(t.options.center.lng,t.options.center.lat),ellipse:{material:n,semiMinorAxis:t.options.semiMinorAxis,semiMajorAxis:t.options.semiMajorAxis,granularity:Cesium.Math.toRadians(.1),rotation:Cesium.Math.toRadians(t.options.bearing),zIndex:t.sdk._entityZIndex},polyline:{positions:i,width:t.options.line.width,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!0,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t),t.options.areaByMeter=Number((Cesium.Math.PI*t.options.semiMinorAxis*t.options.semiMajorAxis).toFixed(2)),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}It(t.sdk,t.options.id),t.options.show&>(0,t.options.id)}},{key:"createLabel",value:(i=a()(l.a.mark((function t(e){var i;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getClampToHeight({lng:e.options.center.lng,lat:e.options.center.lat});case 2:i=t.sent,e.options.label.position||(e.options.label.position={lng:e.options.center.lng,lat:e.options.center.lat,alt:i}),e.label=new Ki(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far});case 5:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"nodeEdit",value:function(t){if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus());else{var e,i=function(t,e){var i=Math.PI/180,n=t.y*i,o=e.y*i,s=t.x*i,a=e.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 e=a()(l.a.mark((function e(i,n){var o,s,a;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.cartesian3Towgs84(i,t.sdk.viewer),e.next=3,t.getClampToHeight(o);case 3:s=e.sent,a=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",type:n,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,s),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.push(a);case 6:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}();t.event&&t.event.destroy(),t.event=new J(t.sdk),YJ.Measure.SetMeasureStatus(!0),t.tip=new q("请选择一个编辑点,右键取消",t.sdk),t.event=new J(t.sdk),t.nodePoints=[];var o=Cesium.Cartesian3.fromDegrees(t.center.lng,t.center.lat),s=t.options.semiMinorAxis,r=t.options.semiMajorAxis,c=t.options.bearing,u=[];t.event.mouse_left((function(n,a){if(e)t.options.semiMinorAxis=s,t.options.semiMajorAxis=r,t.options.bearing=c,t.entity.ellipse.rotation=Cesium.Math.toRadians(c),t.entity.ellipse.semiMinorAxis=s,t.entity.ellipse.semiMajorAxis=r,t.entity.polyline.positions=u,t.options.areaByMeter=Number((Cesium.Math.PI*t.options.semiMinorAxis*t.options.semiMajorAxis).toFixed(2)),t.areaUnit=t.areaUnit,t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,e=null,YJ.Measure.SetMeasureStatus(!1);else{var l=t.sdk.viewer.scene.pick(n.position);if(l&&l.id&&l.id.name&&"node-secondary-edit-point"===l.id.name&&("semiMinorAxis"===l.id._type||"semiMajorAxis"===l.id._type)){t.tip.set_text("左键确认,右键取消"),e=l.id;for(var p=0;pNumber(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i\n
        \n
        \n
        \n 名称\n \n
        \n
        \n 颜色\n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 拉伸高度\n
        \n \n m\n \n
        \n
        \n
        \n 材质样式\n
        \n
        \n
        \n
        \n
        \n 墙体闭合\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(zi(t),'\n \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n
        \n
        \n
        \n \n ')}function Rc(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return zc(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?zc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function zc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);iNumber(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Gc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(n=Uc(this,e,[t,i])).options.color=i.color||"#00d9ff",n.options.extrudedHeight=i.extrudedHeight||2.4,n.options.positions=i.positions,n.options.material=Number(i.material)||0,n.options.duration=i.duration||0===i.duration?i.duration:1e3,n.options.show=!i.show&&!1!==i.show||i.show,n.options["nose-to-tail"]=i["nose-to-tail"]||!1,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,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||["#42c6ef","#42c6ef"],lineColor:i.label.lineColor||"#fff000",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.vr=n.options.attribute.vr||{},n.options.attribute.vr.content=n.options.attribute.vr.content||[],n.options.attribute.link=n.options.attribute.link||{},n.options.attribute.link.content=n.options.attribute.link.content||[],n.options.attribute.camera=n.options.attribute.camera||{},n.options.attribute.camera=n.options.attribute.camera.content||[],n.options.attribute.ISC=n.options.attribute.ISC||{},n.options.attribute.ISC.content=n.options.attribute.ISC.content||[],n.options.attribute.goods=n.options.attribute.goods||{},n.options.attribute.goods.content=n.options.attribute.goods.content||[],n.options.attributeType=i.attributeType||"richText",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),e.create(n)),n}return gi()(e,t),k()(e,[{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.entity.polylineVolume.material=this.getMaterial(),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"material",get:function(){return this.options.material},set:function(t){this.options.material=Number(t),this.entity.polylineVolume.material=this.getMaterial(),this._elms.material&&this._elms.material.forEach((function(e){e.value=t}))}},{key:"noseToTail",get:function(){return this.options["nose-to-tail"]},set:function(t){this.options["nose-to-tail"]=t;for(var e=this.options.positions,i=[],n=0;n-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var o=0;o\n
        '+this.options.attribute.vr.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c纯色墙',value:"纯色墙",key:0,icon:"icon-wall"},{name:'上升墙',value:"上升墙",key:1,icon:"icon-wall-gradient"},{name:'箭头墙',value:"箭头墙",key:2,icon:"icon-wall-arrow"},{name:'警戒墙',value:"警戒墙",key:3,icon:"icon-wall-warn"}],(s=U(n.getElementsByClassName("material-box")[0],".material")).legp_search(o),(a=document.createElement("i")).className="icon icon-active",n.getElementsByClassName("material")[0].getElementsByClassName("cy_datalist")[0].appendChild(a),r=n.getElementsByClassName("material")[0].getElementsByTagName("input")[0],c=0;case 23:if(!(c=1e5&&(s=!0),o.push(r),n+=r}var l=n/e.options.extrudedHeight;if(l/=1,s)for(var c=0;c0&&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;o1&&void 0!==arguments[1]?arguments[1]:function(){};if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n;YJ.Measure.SetMeasureStatus(!0),t.tip=new q("请选择一个顶点,右键取消",t.sdk),t.event=new J(t.sdk),t.nodePoints=[];for(var o=t.options.positions,s=[],a=0;a=500?c(o,i):l(o,i)}))}));for(var p=0;p\n
        \n
        \n
        \n 名称\n \n
        \n
        \n 颜色\n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 宽度\n
        \n \n m\n \n
        \n
        \n
        \n 拉伸高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n 拐角类型\n
        \n
        \n
        \n 材质样式\n
        \n
        \n
        \n
        \n
        \n 墙体闭合\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(zi(t),'\n \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n
        \n
        \n
        \n \n ')}function Jc(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return qc(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?qc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function qc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);iNumber(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function $c(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(n=Qc(this,e,[t,i]))._elms={},n.options.color=i.color||"#00d9ff",n.options.width=i.width||.24,n.options["nose-to-tail"]=i["nose-to-tail"]||!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,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||["#42c6ef","#42c6ef"],lineColor:i.label.lineColor||"#fff000",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.vr=n.options.attribute.vr||{},n.options.attribute.vr.content=n.options.attribute.vr.content||[],n.options.attribute.link=n.options.attribute.link||{},n.options.attribute.link.content=n.options.attribute.link.content||[],n.options.attribute.camera=n.options.attribute.camera||{},n.options.attribute.camera.content=n.options.attribute.camera.content||[],n.options.attribute.ISC=n.options.attribute.ISC||{},n.options.attribute.ISC.content=n.options.attribute.ISC.content||[],n.options.attribute.goods=n.options.attribute.goods||{},n.options.attribute.goods.content=n.options.attribute.goods.content||[],n.options.attributeType=i.attributeType||"richText",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),e.create(n)),n}return gi()(e,t),k()(e,[{key:"type",get:function(){return"WallRealStereoscopic"}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t,this.entity)for(var i=0;i-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var o=0;o\n
        '+this.options.attribute.vr.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0){var P=_;_=S+180,S=P+180,D=!1}var O=turf.sector([C.lng,C.lat,C.alt],this.options.width/1e3/2,_,S,{units:"kilometers"});if(console.log("sector",O),0==b&&(o.push(e[b]),s.push(i[b])),console.log("face",D),D){o.push(e[b+1],e[b+2]);for(var M=1;M0;T--)o.push([].concat(N()(O.geometry.coordinates[0][T]),[e[b+1][2]]));s.push(i[b+1],i[b+2])}b==e.length-4&&(o.push(e[b+3]),s.push(i[b+3]))}n=[].concat(o);for(var B=s.length-1;B>=0;B--)n.push(s[B]);return n.push(n[0]),console.log("positions",n),n}},{key:"calculatePositions2",value:function(){for(var t=[],e=0;e180&&(p=360-p),p}return t}},{key:"calculatePositions",value:function(){var t=this.deepCopyObj(this.options.positions);this.noseToTail&&t.push(t[0],t[1]);for(var e=[],i=[],n=0;n0){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}),D=turf.point([v.lng,v.lat]),P=turf.point(N()(S.geometry.coordinates[0][Math.ceil(S.geometry.coordinates[0].length/2)])),O=turf.bearing(D,P),M=turf.destination(D,E/1e3,O,{units:"kilometers"}),T=[];T.push([].concat(N()(S.geometry.coordinates[0][0]),[v.alt])),T.push([].concat(N()(S.geometry.coordinates[0][1]),[v.alt])),T.push([].concat(N()(M.geometry.coordinates),[v.alt])),T.push([].concat(N()(S.geometry.coordinates[0][S.geometry.coordinates[0].length-2]),[v.alt])),i.push(T),i.push(e[f])}else if(1===this.cornerType)for(var B=1;B0){var H=R;R=V+180,V=H+180}for(var G=turf.sector([L.lng,L.lat],this.options.width/1e3/2,R,V,{units:"kilometers"}),U=[],W=0;W直角',value:"直角",key:0,icon:"yj-icon-zj"},{name:'斜角',value:"斜角",key:1,icon:"yj-icon-xj"},{name:'圆角',value:"圆角",key:2,icon:"yj-icon-yj"}],(s=U(n.getElementsByClassName("corner-type-box")[0],".corner-type")).legp_search(o),(a=document.createElement("i")).className="icon-active",n.getElementsByClassName("corner-type")[0].getElementsByClassName("cy_datalist")[0].appendChild(a),r=n.getElementsByClassName("corner-type")[0].getElementsByTagName("input")[0],c=0;case 23:if(!(c'),t.abrupt("break",32);case 29:c++,t.next=23;break;case 32:r.addEventListener("input",(function(t,e){for(var i=0;i');break}})),u=[{name:'纯色墙',value:"纯色墙",key:0,icon:"icon-wall"},{name:'砖墙1',value:"砖墙1",key:1,icon:"icon-wall-brick1"},{name:'砖墙2',value:"砖墙2",key:2,icon:"icon-wall-brick2"},{name:'砖墙3',value:"砖墙3",key:3,icon:"icon-wall-brick3"}],(p=U(n.getElementsByClassName("material-box")[0],".material")).legp_search(u),(h=document.createElement("i")).className="icon icon-active",n.getElementsByClassName("material")[0].getElementsByClassName("cy_datalist")[0].appendChild(h),d=n.getElementsByClassName("material")[0].getElementsByTagName("input")[0],m=0;case 41:if(!(m0&&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;o1&&void 0!==arguments[1]?arguments[1]:function(){};if(YJ.Measure.GetMeasureStatus())i("上一次测量未结束");else{var n,o,s=function(){var i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t.entity){for(var n=t.calculatePositions(),o=0;o=500?u(o,i):c(o,i)}))}));for(var p=0;p\n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n
        \n 原始长度:\n \n
        \n
        \n
        \n
        \n
        \n 拟合长度:\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(zi(t),'\n \n \n
        \n
        \n 高度模式\n
        \n
        \n
        \n Z值统一增加\n
        \n \n m\n \n
        \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        经度(X)
        \n
        纬度(Y)
        \n
        高度(Z)
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n 线条颜色\n
        \n
        \n
        \n 线条宽度\n
        \n \n px\n \n
        \n
        \n
        \n 线条形式\n
        \n
        \n
        \n
        \n
        \n 线段缓冲\n \n
        \n
        \n 缓冲宽度\n
        \n \n m\n \n
        \n
        \n
        \n 缓冲颜色\n
        \n
        \n
        \n
        \n
        \n 首尾相连\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n \x3c!-- --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!-- 指令--\x3e\n \x3c!-- --\x3e\n \x3c!-- --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!-- --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!-- 设置操作点--\x3e\n \x3c!-- --\x3e\n \x3c!-- --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n \x3c!--
        --\x3e\n
        \n
        \n
        \n \n ')}function iu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return nu(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?nu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function nu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);iNumber(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function cu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(C()(this,e),(i=uu(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.width=n.width||10,i.options.color=n.color||"#0df89e",i.options.type=n.type?Number(n.type):0,i.options["nose-to-tail"]=n["nose-to-tail"]||!1,i.options.extend=n.extend||!1,i.options["length-unit"]=n["length-unit"]||"米",i.options["fit-length-unit"]=n["fit-length-unit"]||"米",i.options["extend-width"]=n["extend-width"]||0===n["extend-width"]?n["extend-width"]:1,i.options["extend-color"]=n["extend-color"]||"#ffde00",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,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||["#42c6ef","#42c6ef"],lineColor:n.label.lineColor||"#fff000",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.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",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.operate={},i.nodePoints=[],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-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var o=0;o\n
        '+this.options.attribute.vr.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c'.concat(t+1,'\n
        \n
        \n
        \n ');var n=i.getElementsByClassName("lng")[0],o=document.createElement("span");o.innerHTML=h.options.positions[t].lng.toFixed(8),n.appendChild(o);var s=document.createElement("input");s.className="input",s.type="number",s.title="",s.min=-180,s.max=180,s.value=h.options.positions[t].lng.toFixed(8);var a=i.getElementsByClassName("lat")[0],r=document.createElement("span");r.innerHTML=h.options.positions[t].lat.toFixed(8),a.appendChild(r);var l=document.createElement("input");l.className="input",l.type="number",l.title="",l.min=-90,l.max=90,l.value=h.options.positions[t].lat.toFixed(8);var c=i.getElementsByClassName("alt")[0],u=document.createElement("span");u.innerHTML=h.options.positions[t].alt.toFixed(2),c.appendChild(u);var p=document.createElement("input");p.className="input",p.type="number",p.title="",p.min=-9999999,p.max=999999999,p.value=h.options.positions[t].alt.toFixed(2),n.addEventListener("dblclick",(function(){n.innerHTML="",s.value=Number(h.options.positions[t].lng.toFixed(8)),n.appendChild(s),s.focus(),h.positionEditing=!1,e.closeNodeEdit(h)})),s.addEventListener("blur",(function(){s.value=Number(h.options.positions[t].lng.toFixed(8)),n.innerHTML="",n.appendChild(o)})),s.addEventListener("input",(function(){h.options.positions[t].lng=Number(Number(s.value).toFixed(8)),o.innerHTML=h.options.positions[t].lng.toFixed(8);var e=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,e[2]]})),a.addEventListener("dblclick",(function(){a.innerHTML="",l.value=Number(h.options.positions[t].lat.toFixed(8)),a.appendChild(l),l.focus(),h.positionEditing=!1,e.closeNodeEdit(h)})),l.addEventListener("blur",(function(){l.value=Number(h.options.positions[t].lat.toFixed(8)),a.innerHTML="",a.appendChild(r)})),l.addEventListener("input",(function(){h.options.positions[t].lat=Number(Number(l.value).toFixed(8)),r.innerHTML=h.options.positions[t].lat.toFixed(8);var e=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,e[2]]})),c.addEventListener("dblclick",(function(){2!=h.heightMode&&(c.innerHTML="",p.value=Number(h.options.positions[t].alt.toFixed(2)),c.appendChild(p),p.focus(),h.positionEditing=!1,e.closeNodeEdit(h))})),p.addEventListener("blur",(function(){p.value=Number(h.options.positions[t].alt.toFixed(2)),c.innerHTML="",c.appendChild(u)})),p.addEventListener("input",(function(){h.options.positions[t].alt=Number(Number(p.value).toFixed(2)),u.innerHTML=h.options.positions[t].alt.toFixed(2);var e=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,e[2]]})),h._elms.lng.push(o),h._elms.lngInput.push(s),h._elms.lat.push(r),h._elms.latInput.push(l),h._elms.alt.push(u),h._elms.altInput.push(p),D.appendChild(i)},O=0;O0&&void 0!==y[0]?y[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(re(this.sdk),le(this.sdk),ve(0),!this.options.customView){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=ru({},this.options.position):this.options.positions?r=ru({},this.options.positions[0]):this.options.center?r=ru({},this.options.center):this.options.start?r=ru({},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")){t.next=18;break}return t.next=17,this.getClampToHeight(r);case 17:r.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.next=43;break;case 25:c=[],t.t0=this.options.heightMode,t.next="0"===t.t0||0===t.t0?29:"1"===t.t0||1===t.t0?31:"2"===t.t0||2===t.t0?36:41;break;case 29:for(p=0;p=500?(i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),i.positionEditing=!1):leftEvent(s,e)}))})),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArrayHeights(o)}),!1)}else{this.label&&(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 p=this.renewPositions(this.options.positions);switch(this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(p),this.renewPolygon(p),this.heightMode){case 0:case"0":case 1:case"1":this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat,p[2]],this.options.label.position={lng:this.options.positions[0].lng,lat:this.options.positions[0].lat,alt:p[2]}}}}},{key:"setDIV",value:function(){var t,e=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;o1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(i=mu(this,e,[t,n])).viewer=t.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 J(i.sdk),i.Dialog=o,i.operate={},i._elms={},i._EventBinding=new Si,i.sdk.addIncetance(i.options.id,i),e.create(i),i}return gi()(e,t),k()(e,[{key:"type",get:function(){return"Explosion"}},{key:"edit",value:(o=a()(l.a.mark((function t(e){var i,n,o=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=15;break}return t.next=6,new bi(this.sdk,this.options,{title:"爆炸属性",left:"180px",top:"100px",confirmCallBack:function(t){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),It(o.sdk,o.options.id),Et(o.sdk,o.options.id)},resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()},closeCallBack:function(){o.reset(),o.positionEditing=!1,o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(t){o.options.show=t,o.originalOptions.show=t,o.show=t,o.Dialog.showCallBack&&o.Dialog.showCallBack()},translationalCallBack:function(){o.positionEditing=!o.positionEditing}});case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" explosion",(i=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n 随地图缩放\n \n
        \n
        \n
        \n \n
        \n
        \n
        \n 经度\n \n
        \n
        \n 爆炸范围\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n 纬度\n \n
        \n
        \n 高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n \n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,this.scaleByDistance=this.options.scaleByDistance;case 15:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"flyTo",value:(n=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=du({},this.options.position):this.options.positions?r=du({},this.options.positions[0]):this.options.center?r=du({},this.options.center):this.options.start?r=du({},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")){t.next=16;break}return t.next=15,this.getClampToHeight(r);case 15:r.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.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:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-85),roll:Cesium.Math.toRadians(0)}});case 24:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(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(t){this.options.scaleByDistance=t,this.entity.billboard.sizeInMeters=t,this._elms.scaleByDistance&&this._elms.scaleByDistance.forEach((function(e){e.checked=t}))}},{key:"lng",get:function(){return this.options.position.lng},set:function(t){this.options.position.lng=t,this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.position.lat},set:function(t){this.options.position.lat=t,this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.position.alt},set:function(t){this.options.position.alt=t,this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"size",get:function(){return this.options.size},set:function(t){this.options.size=t,this.entity.billboard.width=this.options.size,this.entity.billboard.height=this.options.size,this._elms.size&&this._elms.size.forEach((function(e){e.value=t}))}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;this.operate.positionEditing=t,!0===t?(this.tip&&this.tip.destroy(),this.tip=new q("点击鼠标左键确认,右键取消",this.sdk),this.previous={position:du({},this.options.position)},this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.alt=n.alt,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.alt=n.alt,e.previous={position:du({},e.options.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=t.lng,e.lat=t.lat,e.alt=t.alt,e.previous={position:du({},e.options.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.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:"remove",value:(i=a()(l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.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(),t.next=7,this.sdk.removeIncetance(this.options.id);case 7:return t.next=9,It(this.sdk,this.options.id);case 9:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"create",value:function(t){for(var e=[],i=10001;i<=10120;i++){var n=t.getSourceRootPath()+"/img/frameAnimation/explosion/b".concat(i,".png");e.push(n)}var o=new Cesium.Entity({id:t.options.id,show:t.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(t.options.position.lng,t.options.position.lat,t.options.position.alt)}),!1),billboard:{image:new Cesium.CallbackProperty((function(){var t=e[o.imgIndex];return o.imgIndex++,o.imgIndex>=e.length&&(o.imgIndex=0),t}),!1),width:t.options.size,height:t.options.size,sizeInMeters:t.options.scaleByDistance,pixelOffset:{x:0,y:-20}}});o.imgIndex=0,t.entity=t.viewer.entities.add(o),It(t.sdk,t.options.id),t.options.show&>(0,t.options.id)}}]);var i,n,o}(Ui);function vu(t){return'\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 经度\n \n
        \n
        \n 扩散半径\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n 纬度\n \n
        \n
        \n 持续时间\n
        \n \n ms\n \n
        \n
        \n
        \n
        \n
        \n 高度\n
        \n \n m\n \n
        \n
        \n
        \n
        \n
        \n 范围颜色\n
        \n
        \n
        \n 扫描颜色\n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(zi(t),'\n \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ','\n
        \n
        \n
        \n
        \n \n ')}function gu(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function yu(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Cu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(n=wu(this,e,[t,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 J(n.sdk),n.options.positionEditin=!1,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,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||["#42c6ef","#42c6ef"],lineColor:i.label.lineColor||"#fff000",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.vr=n.options.attribute.vr||{},n.options.attribute.vr.content=n.options.attribute.vr.content||[],n.options.attribute.link=n.options.attribute.link||{},n.options.attribute.link.content=n.options.attribute.link.content||[],n.options.attribute.camera=n.options.attribute.camera||{},n.options.attribute.camera=n.options.attribute.camera.content||[],n.options.attribute.ISC=n.options.attribute.ISC||{},n.options.attribute.ISC.content=n.options.attribute.ISC.content||[],n.options.attribute.goods=n.options.attribute.goods||{},n.options.attribute.goods.content=n.options.attribute.goods.content||[],n.options.attributeType=i.attributeType||"richText",n._elms={},n.Dialog=o,n._EventBinding=new Si,n.ControllerObject=new An(n.sdk),n.sdk.addIncetance(n.options.id,n),e.radarSolidScan(n),n}return gi()(e,t),k()(e,[{key:"positionEditing",get:function(){return"translational"===this.ControllerObject.getActiveState()},set:function(t){var e=this;t?(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(t){e.lng=t.position.lng,e.lat=t.position.lat,e.alt=t.position.alt}):(setTimeout((function(){e.picking=!0}),500),this.ControllerObject.destroy())}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=Number(t),this.label.position=[t,this.lat,this.alt+this.radius],this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t})),e.changeParam(this)}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=Number(t),this.label.position=[this.lng,t,this.alt+this.radius],this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t})),e.changeParam(this)}},{key:"alt",get:function(){return this.options.alt},set:function(t){this.options.alt=Number(t),this.label.position=[this.lng,this.lat,t+this.radius],this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t})),e.changeParam(this)}},{key:"radius",get:function(){return this.options.radius},set:function(t){var i=Number(t.toFixed(2));(i>999999&&(i=999999),this.options.radius=i,this.label.position=[this.lng,this.lat,this.alt+t],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(t){t.value=i})),e.changeParam(this)}},{key:"duration",get:function(){return this.options.duration},set:function(t){this.options.duration=t,this._elms.duration&&this._elms.duration.forEach((function(e){e.value=t})),e.changeParam(this)}},{key:"colorOut",get:function(){return this.options.colorOut},set:function(t){var e=this;this.options.colorOut=t,this.entity.ellipsoid.material=Cesium.Color.fromCssColorString(t),this.entity.ellipsoid.outlineColor=Cesium.Color.fromCssColorString(t),this._elms.colorOut&&this._elms.colorOut.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.colorOut=t},clear:function(){e.colorOut="rgba(255,255,255,1)"}});e._elms.colorOut[n]=o}))}},{key:"colorIn",get:function(){return this.options.colorIn},set:function(t){var e=this;this.options.colorIn=t,this.entity.wall.material=Cesium.Color.fromCssColorString(t),this._elms.colorIn&&this._elms.colorIn.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.colorIn=t},clear:function(){e.colorIn="rgba(255,255,255,1)"}});e._elms.colorIn[n]=o}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){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(t){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(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(255,255,255,1)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var o=0;o\n
        '+this.options.attribute.vr.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c=Number(t.target.min))&&(h.radius=i*("米"===e?1:1e3))}})),p.addEventListener("blur",(function(t){var e=h._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(t.target.value||0===t.target.value){var i=t.target.value;i=Number(i),t.target.max&&i>Number(t.target.max)/("米"===e?1:1e3)&&(i=Number(t.target.max)/("米"===e?1:1e3)),t.target.min&&i0&&void 0!==u[0]?u[0]:{},ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=yu({},this.options.position):this.options.positions?r=yu({},this.options.positions[0]):this.options.center?r=yu({},this.options.center):this.options.start?r=yu({},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")){t.next=16;break}return t.next=15,this.getClampToHeight(r);case 15:r.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.next=27;break;case 23:return t.next=25,this.getClampToHeight({lng:this.options.lng,lat:this.options.lat});case 25:c=t.sent,this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,6*this.options.radius+c),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},duration:1});case 27:case"end":return t.stop()}}),t,this)}))),function(){return o.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.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,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.positionEditing=!1,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect())}},{key:"remove",value:(n=a()(l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.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),t.next=6,this.sdk.removeIncetance(this.options.id);case 6:return t.next=8,It(this.sdk,this.options.id);case 8:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接"+(this.options.attribute.link.content.length+1),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(t){this.options.attribute.link.content.push({name:"链接"+(this.options.attribute.link.content.length+1),url:t}),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:"全景图"+(this.options.attribute.vr.content.length+1),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(t){this.options.attribute.vr.content.push({name:"全景图"+(this.options.attribute.vr.content.length+1),url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"openRichTextEditor",value:function(t){var e=this;Li.open(this.options.id,this.options.name,this.options.richTextContent),Li.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.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=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}}],[{key:"radarSolidScan",value:function(t){var i=t.sdk.viewer,n=t.options,o=(n.radius,n.lng,n.lat,n.alt,t.options.duration?360/t.options.duration*Cesium.getTimestamp():0),s=a(t.options,t.options.radius,o);(new Date).getTime();function a(t,e,i){var n=t.lng,o=t.lat,s=t.alt,a=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(n,o,s)),r=e*Math.cos(i*Math.PI/180),l=e*Math.sin(i*Math.PI/180),c=Cesium.Cartesian3.fromElements(r,l,s),u=Cesium.Matrix4.multiplyByPoint(a,c,new Cesium.Cartesian3),p=Cesium.Cartographic.fromCartesian(u);return function(t,e,i,n,o){var s=[],a=[];s.push(t,e,o),a.push(o);for(var r=Cesium.Cartesian3.distance(Cesium.Cartesian3.fromDegrees(t,e),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),p=(i-t)*u+t,h=(n-e)*u+e;s.push(p,h,c+o),a.push(o)}return{positionArr:s,bottomArr:a}}(n,o,Cesium.Math.toDegrees(p.longitude),Cesium.Math.toDegrees(p.latitude),s)}i.clock.onTick.addEventListener((function(){o=t.options.duration?360/t.options.duration*Cesium.getTimestamp():0,s=a(t.options,t.options.radius,o)})),t.entity=i.entities.add({id:t.options.id,show:t.options.show,position:new Cesium.CallbackProperty((function(){return new Cesium.Cartesian3.fromDegrees(t.options.lng,t.options.lat,t.options.alt)}),!1),ellipsoid:{radii:new Cesium.CallbackProperty((function(){return new Cesium.Cartesian3(t.options.radius,t.options.radius,t.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)}}),e.createLabel(t),It(t.sdk,t.options.id),t.options.show&>(0,t.options.id)}},{key:"createLabel",value:(i=a()(l.a.mark((function t(e){var i;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.options.alt){t.next=4;break}i=e.options.alt+e.options.radius,t.next=7;break;case 4:return t.next=6,e.getClampToHeight({lng:e.options.lng,lat:e.options.lat});case 6:i=t.sent;case 7:e.options.label.position||(e.options.label.position={lng:e.options.lng,lat:e.options.lat,alt:i}),e.label=new Ki(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,ground:!1,fontSize:e.options.label.fontSize,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far});case 9:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"changeParam",value:function(t){}}]);var i,n,o,s}(Ui);function _u(t){return'\n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n 投影面积:\n \n
        \n
        \n
        \n
        \n
        \n
        \n \n \n '.concat(zi(t),'\n \n \n
        \n
        \n 面颜色\n
        \n
        \n
        \n 边线颜色\n
        \n
        \n
        \n 边线宽度\n
        \n \n px\n \n
        \n
        \n
        \n
        \n \n ').concat('\n
        \n
        \n 标注开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n ','\n
        \n \n ').concat('\n
        \n
        \n 引线颜色\n
        \n
        \n
        \n 背景颜色\n
        \n
        \n
        \n
        \n
        \n
        \n 引线宽度\n
        \n \n px\n \n
        \n
        \n
        \n 引线长度\n
        \n \n px\n \n
        \n
        \n
        \n ',"\n
        \n
        \n
        \n ")}function xu(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Eu(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Du(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=Pu(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#36c4ff",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||2,i.options.line.color=i.options.line.color||"rgba(155, 155, 124, 0.89)",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,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||["#42c6ef","#42c6ef"],lineColor:n.label.lineColor||"#fff000",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.event=new J(i.sdk),i.nodePoints=[],i.operate={},i.Dialog={},i.sdk.addIncetance(i.options.id,i),e.create(i),i}return gi()(e,t),k()(e,[{key:"type",get:function(){return"SectorObject"}},{key:"startAngle",get:function(){return this.options.startAngle},set:function(t){this.options.startAngle=t;var e=this.calSector(this.options.center,this.options.radius,this.options.startAngle,this.options.endAngle);this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(e),this.entity.polyline.positions=e}},{key:"endAngle",get:function(){return this.options.endAngle},set:function(t){this.options.endAngle=t;var e=this.calSector(this.options.center,this.options.radius,this.options.startAngle,this.options.endAngle);this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(e),this.entity.polyline.positions=e}},{key:"center",get:function(){return this.options.center},set:function(t){this.options.center=t;var e=this.calSector(this.options.center,this.options.radius,this.options.startAngle,this.options.endAngle);this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(e),this.entity.polyline.positions=e}},{key:"radius",get:function(){return this.options.radius},set:function(t){this.options.radius=t;var e=this.calSector(this.options.center,this.options.radius,this.options.startAngle,this.options.endAngle);this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(e),this.entity.polyline.positions=e}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t;var i=Cesium.Color.fromCssColorString(t);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:t})),this.entity.polygon.material=i,this.entity.polyline.width=this.lineWidth,this._elms.color&&this._elms.color.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t,this.entity.polyline.material=Cesium.Color.fromCssColorString(t),this._elms.lineColor&&this._elms.lineColor.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,255,255,1)"}});e._elms.lineColor[n]=o}))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){this.options.line.width=t,this.entity.polyline.width=t,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(e){e.value=t}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){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(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){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(t){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(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(255,255,255,1)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var o=0;o\n
        '+this.options.attribute.vr.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c0&&void 0!==E[0]?E[0]:{},ve(0),re(this.sdk),le(this.sdk),!this.options.customView){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=Eu({},this.options.position):this.options.positions?r=Eu({},this.options.positions[0]):this.options.center?r=Eu({},this.options.center):this.options.start?r=Eu({},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")){t.next=16;break}return t.next=15,this.getClampToHeight(r);case 15:r.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.next=60;break;case 23:c=this.entity.polyline.positions.getValue(),u=[],p=0,h=this.cartesian3Towgs84(c[0],this.sdk.viewer),d=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,0),m=Cesium.Cartesian3.fromDegrees(h.lng,h.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=500)e.positionEditing=!1;else{i=[];var t=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.center.lng=t.lng,e.options.center.lat=t.lat,e.options.center.alt=t.alt,i=e.calSector(e.options.center,e.options.radius,e.options.startAngle,e.options.endAngle),e.label.position=[t.lng,t.lat],e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.previous={center:Eu({},e.options.center)},e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return i}),!1)}else{this.previous||(this.previous={center:this.deepCopyObj(this.options.center)}),this.options.center=this.deepCopyObj(this.previous.center),this.label&&(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 n;n=this.calSector(this.options.center,this.options.radius,this.options.startAngle,this.options.endAngle),this.getClampToHeight({lng:this.options.center.lng,lat:this.options.center.lat}).then((function(t){e.label.position=[e.options.center.lng,e.options.center.lat,t]})),this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(n),this.entity.polyline.positions=n,this.previous=null}}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.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=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}}],[{key:"create",value:function(t){var i=t.calSector(t.options.center,t.options.radius,t.options.startAngle,t.options.endAngle),n=!0,o=Cesium.Color.fromCssColorString(t.options.color);2===t.sdk.viewer.scene.mode&&(n=!1,o=new Cesium.CustomColorMaterialSource({color:t.options.color})),t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,polygon:{hierarchy:new Cesium.PolygonHierarchy(i),perPositionHeight:!n,material:o,zIndex:t.sdk._entityZIndex},polyline:{positions:i,width:t.options.line.width,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!0,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t);var s=t.options.endAngle-t.options.startAngle;switch(s<0&&(s=360+s),t.options.areaByMeter=Number((Cesium.Math.PI*t.options.radius*t.options.radius*(s/360)).toFixed(2)),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}It(t.sdk,t.options.id),t.options.show&>(0,t.options.id)}},{key:"createLabel",value:(i=a()(l.a.mark((function t(e){var i;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getClampToHeight({lng:e.options.center.lng,lat:e.options.center.lat});case 2:i=t.sent,e.options.label.position||(e.options.label.position={lng:e.options.center.lng,lat:e.options.center.lat,alt:i}),e.label=new Ki(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far});case 5:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"nodeEdit",value:function(t){if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus());else{var e,i=function(t){function e(t,e){var i=Math.PI/180,n=t.y*i,o=e.y*i,s=t.x*i,a=e.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=t[0],n=t[1],o=t[2],s={x:i.lng,y:i.lat},a={x:n.lng,y:n.lat},r={x:o.lng,y:o.lat};return{angle1:e(s,a),angle2:e(s,r)}},n=function(){var e=a()(l.a.mark((function e(i,n){var o,s,a;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.cartesian3Towgs84(i,t.sdk.viewer),e.next=3,t.getClampToHeight(o);case 3:s=e.sent,a=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",type:n,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,s),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),t.nodePoints.push(a);case 6:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}();t.event&&t.event.destroy(),t.event=new J(t.sdk),YJ.Measure.SetMeasureStatus(!0),t.tip=new q("请选择一个编辑点,右键取消",t.sdk),t.event=new J(t.sdk),t.nodePoints=[];var o=[],s=[],r=t.options.radius,c={angle1:t.options.startAngle,angle2:t.options.endAngle};t.event.mouse_left((function(i,n){if(e){t.options.startAngle=c.angle1,t.options.endAngle=c.angle2,t.options.radius=r,t.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(o),t.entity.polyline.positions=o;var s=t.options.endAngle-t.options.startAngle;s<0&&(s=360+s),t.options.areaByMeter=Number((Cesium.Math.PI*t.options.radius*t.options.radius*(s/360)).toFixed(2)),t.areaUnit=t.areaUnit,t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,e=null,YJ.Measure.SetMeasureStatus(!1)}else{var a=t.sdk.viewer.scene.pick(i.position);if(a&&a.id&&a.id.name&&"node-secondary-edit-point"===a.id.name&&("sector-start"===a.id._type||"sector-end"===a.id._type)){t.tip.set_text("左键确认,右键取消"),e=a.id;for(var l=0;lNumber(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=Mu(this,e,[t,n])).source=new Cesium.CustomDataSource(i.options.id),i.detail=[],i}return gi()(e,t),k()(e,[{key:"show",get:function(){return this.options.show},set:function(t){this.source&&(this.source.show=t,this.options.show=t)}},{key:"setDefaultValue",value:function(){var t;this.options.id=this.options.id||Cesium.createGuid(),this.options.url=this.options.url||"",this.options.show=null===(t=this.options.show)||void 0===t||t}},{key:"flyTo",value:(n=a()(l.a.mark((function t(){var e,i,n,o,s,a,r=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=r.length>0&&void 0!==r[0]?r[0]:3,ve(0),re(this.sdk),le(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,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i,duration:e})):this.source&&this.viewer.flyTo(this.source,{duration:e});case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:function(){var t,i,n,o,s;(t=e,i="remove",n=this,o=3,s=Do()(fi()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),this.viewer.dataSources.remove(this.source),this.source=null}},{key:"on",value:(i=a()(l.a.mark((function t(){var e=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.show=this.options.show,t.next=3,Cesium.KmlDataSource.load(this.options.url,{camera:this.viewer.scene.camera,canvas:this.viewer.scene.canvas});case 3:return t.sent.entities.values.forEach((function(t,i){if(e.detail.push({name:t.name,id:t.id}),t.label){var n=1;t.billboard&&(n=t.billboard.scale._value),t.label.pixelOffset=new Cesium.Cartesian2(0,-32*n-15),t.label.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.label.disableDepthTestDistance=Number.POSITIVE_INFINITY}if(t.polygon){var o={hierarchy:t.polygon.hierarchy.getValue().positions,material:t.polygon.material,classificationType:Cesium.ClassificationType.BOTH};if(t.polygon.outline.getValue()){var s=t.polygon.hierarchy.getValue().positions,a=new Cesium.Entity({id:e.getOutlineId(t.id),polyline:{positions:s,width:t.polygon.outlineWidth.getValue(),material:t.polygon.outlineColor.getValue(),clampToGround:!0,zIndex:e.sdk._entityZIndex}});e.source.entities.add(a)}t.polygon=o}t.billboard&&(t.billboard.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND),t.polyline&&(t.polyline={positions:t.polyline.positions.getValue(),material:t.polyline.material,clampToGround:!0,width:t.polyline.width?t.polyline.width.getValue():1}),t.show=!0,e.source.entities.add(t)})),t.next=7,this.viewer.dataSources.add(this.source);case 7:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"getOutlineId",value:function(t){return[t,"outline"].join("_")}}]);var i,n}(Ui);function Nu(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}var Bu=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=Nu(this,e,[t,n])).primitive=void 0,i.positions=[],i.loading=!0,i}return gi()(e,t),k()(e,[{key:"setDefaultValue",value:function(){var t,i,n,o,s;(t=e,i="setDefaultValue",n=this,o=3,s=Do()(fi()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),this.options.host=this.options.host||m(),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(t){if(this.options.show=t,this.entity)for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(i=ju(this,e,[t,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 Si,i._elms={},i.sdk.addIncetance(i.options.id,i),e.create(i),i}return gi()(e,t),k()(e,[{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.entity&&(this.entity.appearance.material.uniforms.baseWaterColor=Cesium.Color.fromCssColorString(t)),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"frequency",get:function(){return this.options.frequency},set:function(t){this.options.frequency=t,this.entity&&(this.entity.appearance.material.uniforms.frequency=10*t),this._elms.frequency&&this._elms.frequency.forEach((function(e){e.value=t}))}},{key:"animationSpeed",get:function(){return this.options.animationSpeed},set:function(t){this.options.animationSpeed=t,this.entity&&(this.entity.appearance.material.uniforms.animationSpeed=.01*t),this._elms.animationSpeed&&this._elms.animationSpeed.forEach((function(e){e.value=t}))}},{key:"amplitude",get:function(){return this.options.amplitude},set:function(t){this.options.amplitude=t,this.entity&&(this.entity.appearance.material.uniforms.amplitude=t),this._elms.amplitude&&this._elms.amplitude.forEach((function(e){e.value=t}))}},{key:"height",get:function(){return this.options.height},set:function(t){this.options.height=t;var e=this.options.positions[0],i=Cesium.Cartesian3.fromDegrees(e.lng,e.lat,t),n=Cesium.Cartesian3.fromDegrees(e.lng,e.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(e){e.value=t}))}},{key:"edit",value:(o=a()(l.a.mark((function t(){var e,i,n,o,s=this,a=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=a.length>0&&void 0!==a[0]&&a[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=19;break}return t.next=7,new bi(this.sdk,this.originalOptions,{title:"水面属性",left:"180px",top:"100px",confirmCallBack:function(t){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),It(s.sdk,s.options.id),Et(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(t){s.show=t,s.Dialog.showCallBack&&s.Dialog.showCallBack()}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" water-surface",(i=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n 颜色\n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 高度\n
        \n \n m\n \n
        \n
        \n
        \n 水面振幅\n
        \n \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n 动画速度\n
        \n \n \n
        \n
        \n
        \n 水面频率\n
        \n \n \n
        \n
        \n
        \n
        \n \n ',this._DialogObject.contentAppChild(i),n=new ewPlugins("colorpicker",{el:i.getElementsByClassName("water-color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){s.color=t},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],t.next=19;break;case 19:case"end":return t.stop()}}),t,this)}))),function(){return o.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=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c,u,p,h,d=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=d.length>0&&void 0!==d[0]?d[0]:{},ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=Lu({},this.options.position):this.options.positions?r=Lu({},this.options.positions[0]):this.options.center?r=Lu({},this.options.center):this.options.start?r=Lu({},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")){t.next=16;break}return t.next=15,this.getClampToHeight(r);case 15:r.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.next=28;break;case 23:c=Cesium.Rectangle.fromCartesianArray(this.entity.geometryInstances.geometry._polygonHierarchy.positions),u=this.sdk.viewer.camera.getRectangleCameraCoordinates(c),p=this.cartesian3Towgs84(u,this.sdk.viewer),h=Cesium.Cartesian3.fromDegrees(p.lng,p.lat,p.alt+this.entity.geometryInstances.geometry._height),this.sdk.viewer.camera.flyTo({orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},destination:h});case 28:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:(i=a()(l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.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),t.next=5,this.sdk.removeIncetance(this.options.id);case 5:return t.next=7,It(this.sdk,this.options.id);case 7:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"create",value:function(t){for(var e=t.options.positions,i=[],n=e[0].alt,o=0;o1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),Vu(i=Fu(this,e,[t,n]),Wu,!1),Vu(i,Yu,void 0),Vu(i,Ju,void 0),Vu(i,qu,void 0),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._elms={},i.Dialog=o,i.realTimeRouteArray=[],i.distance,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,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||["#42c6ef","#42c6ef"],lineColor:n.label.lineColor||"#fff000",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 An(i.sdk),i._EventBinding=new Si,i.options.viewFollow=!1,i.options.firstPersonView=!1,e.addLine(i),i.firstPersonView=!1),i}return gi()(e,t),k()(e,[{key:"type",get:function(){return"TrajectoryMotion"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){if(this.options.show=t,t){this.firstPersonView?this.model.show=!1:this.model.show=this.modelShow,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 e=0;e0)for(var i=0;i=500?(e.keyPointShow=!1,YJ.Measure.SetMeasureStatus(!1),e.event.destroy(),e.tip&&e.tip.destroy(),e.tip=null,e.ControllerObject.destroy()):s(o)}))})),this.line.polyline.positions=new Cesium.CallbackProperty((function(){return i}),!1),this.keyPointShow=t}else this.lineEdit&&(YJ.Measure.SetMeasureStatus(!1),this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=null),this.keyPointShow=t,this.ControllerObject.destroy();Hu(Wu,this,t),this._elms.lineEdit&&this._elms.lineEdit.forEach((function(e){e.checked=t}))}},{key:"routeDirection",get:function(){return this.options.routeDirection},set:function(t){this.options.routeDirection=t,this._elms.routeDirection&&this._elms.routeDirection.forEach((function(e){e.checked=t}))}},{key:"loop",get:function(){return this.options.loop},set:function(t){this.options.loop=t,t?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat(),this._elms.loop&&this._elms.loop.forEach((function(e){e.checked=t}))}},{key:"firstPersonView",get:function(){return this.options.firstPersonView},set:function(t){var e=this,i=St();if((Yt()||i.sdkD||!this.show)&&(t=!1),cancelAnimationFrame(Gu(Yu,this)),Gu(qu,this)&&Gu(qu,this).destroy(),this.sdk.viewer._firstPersonView=t,this.options.firstPersonView=t,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 n=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");n[0].className="btn is-active",n[1].className="btn"}this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null),ie(this.sdk,!1);var o,s=St(),a=(o=this.sdk===s.sdkP?s.sdkD:s.sdkP)?o.entityMap.get(this.options.id):void 0;this.sdk&&Hu(qu,this,new J(this.sdk)),Gu(qu,this).mouse_right_down((function(t,i){var n=zu({},t.position);Gu(qu,e).mouse_move((function(t,i){e.firstPersonHeadingPitch.heading=e.firstPersonHeadingPitch.heading+(t.endPosition.x-n.x)/20,e.firstPersonHeadingPitch.pitch=e.firstPersonHeadingPitch.pitch+(n.y-t.endPosition.y)/10,a&&(a.firstPersonHeadingPitch=zu({},e.firstPersonHeadingPitch)),n=zu({},t.endPosition)}),!0)}),!0),Gu(qu,this).mouse_right_up((function(t,i){Gu(qu,e).mouse_move((function(){}))}),!0)}else{if(ie(this.sdk,!0),this.model&&this.modelShow&&this.show&&(this.model.show=!0),this._DialogObject&&this._DialogObject._element.content){var r=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");r[0]&&r[1]&&(r[0].className="btn",r[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 l=this.sdk.viewer.entities.add({position:this.positions_smooth[0],point:{color:Cesium.Color.RED.withAlpha(0),pixelSize:0}});this.sdk.viewer.trackedEntity=l}this.viewFollow=this.viewFollow}}Et(this.sdk,this.options.id)}},{key:"viewFollow",get:function(){return this.options.viewFollow},set:function(t){St();var e=Yt();if(this.show||(t=!1),this.options.viewFollow=t,this.options.viewFollow?(re(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),t&&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=ct;if(o)if(this.sdk!=o){var s=o.entityMap.get(this.options.id);s&&s.viewFollow!=t&&(s.viewFollow=t)}else if(e){var a=e.entityMap.get(this.options.id);a&&a.viewFollow!=t&&(a.viewFollow=t,this.TweenAnimate&&a.setMovePositionByDistance(this.TweenAnimate._object.distance))}Et(this.sdk,this.options.id),this._elms.viewFollow&&this._elms.viewFollow.forEach((function(e){e.checked=t}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){var e=this;this.options.label.show=t,this.show?(this.label&&(this.label.show=t),this.options.label.position&&setTimeout((function(){e.options.label.position.alt?e.label&&(e.label.position=[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt]):e.getClampToHeight({lng:e.options.label.position.lng,lat:e.options.label.position.lat}).then((function(t){e.label&&(e.label.position=[e.options.label.position.lng,e.options.label.position.lat,t])}))}),0)):this.label&&(this.label.show=!1),this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label&&(this.label.color=t),this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label&&(this.label.fontSize=t),this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label&&(this.label.scaleByDistance=t),this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){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(t){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:(p=a()(l.a.mark((function t(e){var i,n,o,s,r,c,u,p,h,d,m,f,v,g,y,b,C=this,w=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(b=function(t,e){var i=Cesium.Transforms.eastNorthUpToFixedFrame(t);if(e){var n=Cesium.Cartesian3.subtract(e,t,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}}},y=function(){return(y=a()(l.a.mark((function t(e){var i,o,s,a,c,u,p,d,g,y,C,w,k,_,x,E,S,D,P,O,M,T,B,A,L,j,I,R,z;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=h,!(i=e)){t.next=10;break}return t.next=6,turf.lineSliceAlong(h,0,i,{units:"kilometers"});case 6:s=t.sent,o=N()(s.geometry.coordinates[s.geometry.coordinates.length-1]),t.next=11;break;case 10:o=N()(h.geometry.coordinates[0]);case 11:if(!n.ground){t.next=45;break}if(u=[],!(d=Yt())||n.sdk!=d){t.next=19;break}p=new Cesium.Cartesian3.fromDegrees(o[0],o[1]),a=p,t.next=23;break;case 19:return t.next=21,n.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(o[0],o[1]),[n.model].concat(u));case 21:p=t.sent,a=p;case 23:return p||(a=new Cesium.Cartesian3.fromDegrees(o[0],o[1])),g=n.cartesian3Towgs84(a,r),y=0,t.prev=26,t.next=29,Cesium.sampleTerrainMostDetailed(n.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(g.lng,g.lat)]);case 29:C=t.sent,y=C[0].height,t.next=36;break;case 33:t.prev=33,t.t0=t.catch(26),y=0;case 36:for(g.alte/n.distance)){t.next=56;break}return t.abrupt("break",61);case 56:S=n.spline.evaluate(E/1e3),x.push(S);case 58:E++,t.next=53;break;case 61:x.push(_),n.realTimePositions=x;case 63:if(m=b(n.model.position,a),v&&v.position&&(f=b(v.position,a),m.pitch=f.pitch),v.position=n.model.position,Cesium.HeadingPitchRoll.fromDegrees(n.options.model.heading,n.options.model.pitch,n.options.model.roll),D=0,P=0,O=0,M=Cesium.Transforms.eastNorthUpToFixedFrame(a),!n.options.routeDirection||n.lineEdit){t.next=81;break}if(D=m.heading*(180/Math.PI)-90-n.options.model.heading,P=m.pitch*(180/Math.PI)-n.options.model.pitch,O=n.options.model.roll,!(isNaN(D)||isNaN(P)||isNaN(O))){t.next=77;break}return t.abrupt("return");case 77:n.state||(D=n.model.heading||0===n.model.heading?n.model.heading:n.options.model.heading,P=n.model.pitch||0===n.model.pitch?n.model.pitch:n.options.model.pitch,O=n.model.roll||0===n.model.roll?n.model.roll:n.options.model.roll),n.model.modelMatrix=Cesium.Matrix4.multiplyByMatrix3(M,Cesium.Matrix3.fromHeadingPitchRoll(Cesium.HeadingPitchRoll.fromDegrees(D,P,O)),n.model.modelMatrix),t.next=97;break;case 81:if(!n.entity){t.next=97;break}if(D=n.options.model.heading,P=n.options.model.pitch,O=n.options.model.roll,!(isNaN(D)||isNaN(P)||isNaN(O))){t.next=87;break}return t.abrupt("return");case 87:T=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(O)),B=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(P)),A=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(D)),L=Cesium.Matrix4.fromRotationTranslation(T),j=Cesium.Matrix4.fromRotationTranslation(B),I=Cesium.Matrix4.fromRotationTranslation(A),R=new Cesium.Matrix4,Cesium.Matrix4.multiply(M,L,R),Cesium.Matrix4.multiply(R,j,R),Cesium.Matrix4.multiply(R,I,n.entity.modelMatrix);case 97:if(n.model.position=a,n.model.roll=O,n.model.pitch=P,n.model.heading=D,a){t.next=103;break}return t.abrupt("return");case 103:z=n.cartesian3Towgs84(a,n.sdk.viewer),n.label.position=[z.lng,z.lat,z.alt],n.realTimeRouteArray.push(a),n.viewFollow&&(n.options.firstPersonView?n.sdk.viewer.camera.setView({destination:c,orientation:{heading:Cesium.Math.toRadians(D+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=a):n.sdk.viewer.trackedEntity&&n.sdk.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,n.sdk.viewer.camera.positionCartographic.height),orientation:{heading:Cesium.Math.toRadians(-90),pitch:0,roll:0}}));case 108:case"end":return t.stop()}}),t,null,[[26,33]])})))).apply(this,arguments)},g=function(t){return y.apply(this,arguments)},i=w.length>1&&void 0!==w[1]?w[1]:{time:0},n=this,o=i.time||0,s=i.distance,r=this.sdk.viewer,this.model){t.next=10;break}return t.abrupt("return");case 10:for(this.removeModelAnimate(),c=[],u=0;uthis.distance&&(s=this.distance),o=s/this.distance*d):(s=1e-6,o&&(o>d&&(o=d),s=o/d*this.distance)),v={},this.TweenAnimate=new TWEEN.Tween({distance:s}).to({distance:this.distance},1e3*(d-o)).delay(this.delay).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){(o||s)&&C.modelMove(e)})).onUpdate(function(){var t=a()(l.a.mark((function t(e,i){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(C.TweenAnimate._duration!=1/0){t.next=2;break}return t.abrupt("return");case 2:if(C.sdk.viewer){t.next=6;break}return C.removeModelAnimate(),t.abrupt("return");case 6:isNaN(e.distance)||g(e.distance);case 7:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}()).onEveryStart((function(){C.realTimeRouteArray=[]})).onComplete((function(t){C.state=!1,C.removeModelAnimate()})),this.state?this.TweenAnimate.start():g(s);case 23:case"end":return t.stop()}}),t,this)}))),function(t){return p.apply(this,arguments)})},{key:"setMovePositionByDistance",value:function(t){var e=this.renewLinePositions(this.options.line.positions);this.modelMove(e,{distance:t})}},{key:"setMovePositionByTime",value:function(t){var e=this.renewLinePositions(this.options.line.positions);this.modelMove(e,{time:t})}},{key:"edit",value:(u=a()(l.a.mark((function t(e){var i,n,o,s,a,r,c=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._error){t.next=2;break}return t.abrupt("return");case 2:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=25;break}return t.next=8,new bi(this.sdk,this.options,{title:"轨迹运动属性",left:"180px",top:"100px",confirmCallBack:function(t){c.name=c.name.trim(),c.name||(c.name="未命名对象"),c.originalOptions=c.deepCopyObj(c.options),c._DialogObject.close(),c.Dialog.confirmCallBack&&c.Dialog.confirmCallBack(c.originalOptions),It(c.sdk,c.options.id),Et(c.sdk,c.options.id)},removeCallBack:function(){c.sdk.viewer.trackedEntity&&(c.sdk.viewer.entities.remove(c.sdk.viewer.trackedEntity),c.sdk.viewer.trackedEntity=null),c.Dialog.removeCallBack&&c.Dialog.removeCallBack()},closeCallBack:function(){c._DialogObject=null,c.reset(),c.Dialog.closeCallBack&&c.Dialog.closeCallBack(),c.editObj&&(c.editObj.destroy(),c.editObj=null),c.keyPointShow=!1,c.event&&c.event.destroy(),c.tip&&c.tip.destroy(),c.tip=null,c.ControllerObject.destroy(),c.firstPersonView=c.firstPersonView},showCallBack:function(t){c.show=t,c.Dialog.showCallBack&&c.Dialog.showCallBack()}});case 8:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" trajectory-motion",(i=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 起始点高度\n
        \n \n m\n \n
        \n
        \n
        \n 模型倍数\n
        \n \n \n \n
        \n
        \n
        \n
        \n
        \n 运行速度\n
        \n \n m/s\n \n
        \n
        \n
        \n 延迟运动\n
        \n \n ms\n \n
        \n
        \n
        \n
        \n
        \n 更换模型\n \n
        \n
        \n 调整模型方向\n \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n 路径显隐\n \n
        \n
        \n 模型显隐\n \n
        \n
        \n 实时路径\n \n
        \n
        \n
        \n
        \n 编辑\n \n
        \n
        \n 路径圆滑\n \n
        \n
        \n 环线\n \n
        \n
        \n
        \n
        \n 轨迹贴地\n \n
        \n
        \n 轨迹循环\n \n
        \n
        \n 轨迹动画\n \n
        \n
        \n
        \n
        \n 路径方向\n \n
        \n
        \n 视角跟随\n \n
        \n
        \n 模型动画\n
        \n
        \n
        \n
        \n
        \n 文字开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n
        \n \n ',this._DialogObject.contentAppChild(i),n=new ewPlugins("colorpicker",{el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelColor=t},clear:function(){c.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&&(a=function(){var t=c.model.loader.components.animations;if(c._DialogObject){if(t){for(var e=[{name:"无",value:"无"}],n=0;n=107?this.model.ready?a():this.model.readyEvent.addEventListener((function(){a()})):this.model.readyPromise.then((function(t){a()}))),(r=i.querySelectorAll("button[name='firstPerson']"))[0].addEventListener("click",(function(t){var e=St();Yt()||e.sdkD||(c.firstPersonView||(c.viewFollow=!0),c.firstPersonView=!0)})),r[1].addEventListener("click",(function(t){c.firstPersonView&&(c.viewFollow=!0),c.firstPersonView=!1})),this.options.firstPersonView?(r[0].className="btn is-active",r[1].className="btn",this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null)):(r[0].className="btn",r[1].className="btn is-active");case 25:case"end":return t.stop()}}),t,this)}))),function(t){return u.apply(this,arguments)})},{key:"flyTo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ve(0),re(this.sdk),this.options.customView?this.sdk.viewer.camera.flyTo({destination:this.options.customView.position,orientation:this.options.customView.orientation}):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)}})}},{key:"remove",value:(c=a()(l.a.mark((function t(){var e,i;return l.a.wrap((function(t){for(;;)switch(t.prev=t.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(),e=0;e=107)){t.next=15;break}return t.next=9,Cesium.Model.fromGltfAsync(o);case 9:this.model=t.sent,this.model.position=n,this.sdk.viewer.scene.primitives.add(this.model),this.model.readyEvent.addEventListener((function(){s(),a.model.modelMatrix=i})),t.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(t){s(),a.model.modelMatrix=i}));case 18:this.model.imageBasedLighting.luminanceAtZenith=.6;case 19:case"end":return t.stop()}}),t,this)}))),function(t){return s.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(t){}},set:function(t){this._controllerCallBack=t}},{key:"renewLinePositions",value:function(t){var e=t;this.noseToTail&&(e=[].concat(N()(t),[t[0]]));for(var i=[],n=[],o=[],s=0;s=107)){t.next=10;break}return t.next=4,Cesium.Model.fromGltfAsync(n);case 4:i.model=t.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})),t.next=13;break;case 10:i.model=i.sdk.viewer.scene.primitives.add(Cesium.Model.fromGltf(n)),i.model.originalBoundingSphereRadius=0,i.model.readyPromise.then((function(){i.model.originalBoundingSphereRadius=i.model.boundingSphere.radius,i.modelAnimate=i.options.model.animate}));case 13:for(i.model.imageBasedLighting.luminanceAtZenith=.6,o=Cesium.Cartographic.fromDegrees(103,65,100),i.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(o),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},a=i.options.line.positions,r=[],c=0;c=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ku(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),ep(i=tp(this,e,[t,n]),op,!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 An(i.sdk),i._EventBinding=new Si,e.addLine(i),i.firstPersonView=!1,i.options.viewFollow=!1),i}return gi()(e,t),k()(e,[{key:"type",get:function(){return"TrajectoryMotionObject"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){if(this.options.show=t,t){this.line.show=this.lineShow;for(var e=0;ee/n.distance)){t.next=47;break}return t.abrupt("break",52);case 47:D=n.spline.evaluate(S/100),x.push(D);case 49:S++,t.next=44;break;case 52:x.push(_),n.realTimePositions=x;case 54:if(m=E(n.current.position,c),v&&v.position&&(f=E(v.position,c),m.pitch=f.pitch),v.position=n.current.position,P=Cesium.HeadingPitchRoll.fromDegrees(n.current.heading,n.current.pitch,n.current.roll),O=0,M=0,T=0,n.options.routeDirection?(O=(m.heading-P.heading)*(180/Math.PI)-90+n.current.heading,M=m.pitch*(180/Math.PI)):(O=n.current.heading,M=n.current.pitch),T=n.current.roll,!(isNaN(O)||isNaN(M)||isNaN(T))){t.next=65;break}return t.abrupt("return");case 65:(O<0||O>180)&&(M=-M),n.current={position:c,heading:O,pitch:M,roll:T},k&&(k=!1,n._first={position:c,heading:O,pitch:M,roll:T}),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 t.stop()}}),t,null,[[19,26]])})))).apply(this,arguments)},_=function(t){return x.apply(this,arguments)},i=D.length>1&&void 0!==D[1]?D[1]:{time:0},n=this,o=i.time||0,s=i.distance||0,r=this.sdk.viewer,this.removeModelAnimate(),c=[],u=0;ud&&(o=d),s=o/d*this.distance),v={},g=[],y=Zu(this.sdk.entityMap);try{for(y.s();!(b=y.n()).done;)(C=$()(b.value,2))[0],(w=C[1]).type&&"glb"===w.type&&g.push(w.entity)}catch(t){y.e(t)}finally{y.f()}k=!0,this.TweenAnimate=new TWEEN.Tween({distance:s}).to({distance:this.distance},1e3*(d-o)).delay(this.delay).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){o&&S.modelMove(e)})).onUpdate(function(){var t=a()(l.a.mark((function t(e,i){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(S.TweenAnimate._duration!=1/0){t.next=2;break}return t.abrupt("return");case 2:if(S.sdk.viewer){t.next=6;break}return S.removeModelAnimate(),t.abrupt("return");case 6:_(e.distance);case 7:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}()).onEveryStart((function(){S.realTimeRouteArray=[]})).onComplete((function(t){S.state=!1,S.removeModelAnimate()})),this.state?this.TweenAnimate.start():_(s);case 26:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"setMovePositionByDistance",value:function(t){var e=this._renewLine(this.options.line.positions);this.modelMove(e,{distance:t})}},{key:"setMovePositionByTime",value:function(t){var e=this._renewLine(this.options.line.positions);this.modelMove(e,{time:t}),this.state||this.modelMove(e,{time:t+.01})}},{key:"pause",value:function(){this.state=!1}},{key:"resume",value:function(){this.state=!0}},{key:"flyTo",value:(n=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},ve(0),re(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},(r=Qu({},this.options.line.positions[0])).hasOwnProperty("alt")){t.next=15;break}return t.next=14,this.getClampToHeight(r);case 14:r.alt=t.sent;case 15:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.next=23;break;case 22: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)}});case 23:case"end":return t.stop()}}),t,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(t){this.options.line.positions=t;var e=t;this.noseToTail&&(e=[].concat(N()(t),[t[0]]));for(var i=[],n=[],o=[],s=0;s1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=ap(this,e,[t,n])).options.name=n.name||"",i.options.image=n.image,i.options.width=n.width||10,i.options.height=n.height||0,i}return gi()(e,t),k()(e,[{key:"create",value:function(t){this.computeRoad(t);for(var e=[],i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=lp(this,e,[t,n])).options.width=n.width||1,i.options.color=n.color||"#ff0000",i._elms={},i._EventBinding=new Si,e.edit(i,!0),i}return gi()(e,t),k()(e,[{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color&&(this.options.color=t,this._elms.color&&this._elms.color.forEach((function(i,n){var o=new ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o})))}},{key:"width",get:function(){return this.options.width},set:function(t){this.options.width=t,this._elms.width&&this._elms.width.forEach((function(e){e.value=t}))}},{key:"start",value:function(){var t,i,n,o,s,a=this;if(YJ.Measure.GetMeasureStatus())console.log("上一次测量未结束");else{this.sdk.viewer;ie(this.sdk,!1),(t=e,i="start",n=this,o=3,s=Do()(fi()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new q("长按左键,拖动鼠标进行涂鸦,右键结束涂鸦",this.sdk),this.event=new J(this.sdk),this.positions=[],this.points_ids=[];var r=[],l=[];this.event.mouse_left_down((function(t,e){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(t,e){a.tip.setPosition(e,t.endPosition.x,t.endPosition.y),l.push(e)}))})),this.event.mouse_left_up((function(t,e){r[r.length-1].polyline.positions=l,a.event.mouse_move((function(t,e){a.tip.setPosition(e,t.endPosition.x,t.endPosition.y)}))})),this.event.mouse_move((function(t,e){a.tip.setPosition(e,t.endPosition.x,t.endPosition.y)})),this.event.mouse_right((function(t,e){a.end()})),this.event.gesture_pinck_start((function(t,e){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,ie(this.sdk,!0)}},{key:"remove",value:function(){this.end(),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);for(var t=this.sdk.viewer.entities.values,e=t.length-1;e>=0;e--)"涂鸦"===t[e].name&&this.sdk.viewer.entities.remove(t[e])}},{key:"flicker",value:function(){}}],[{key:"edit",value:(i=a()(l.a.mark((function t(i,n){var o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n){t.next=22;break}return t.next=3,new G(i.sdk.viewer._container,{title:"涂鸦参数"});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:(o=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 涂鸦颜色\n
        \n
        \n
        \n 线条宽度\n
        \n \n px\n \n
        \n
        \n
        \n
        \n ',i._DialogObject.contentAppChild(o),s=new ewPlugins("colorpicker",{el:o.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:i.color,disabled:!1,openPickerAni:"opacity",sure:function(t){i.color=t},clear:function(){i.color="rgba(255,255,255,1)"}}),i._DialogObject._element.body.className=i._DialogObject._element.body.className+" graffiti",a=o.getElementsByTagName("*"),i._EventBinding.on(i,a),i._elms=i._EventBinding.element,i._elms.color=[s],(r=document.createElement("button")).className="confirm",r.innerHTML="确认",i._DialogObject.footAppChild(r),r.addEventListener("click",(function(){i.start(),e.edit(i,!1)})),t.next=23;break;case 22:i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null);case 23:case"end":return t.stop()}}),t)}))),function(t,e){return i.apply(this,arguments)})}]);var i}(Oo);function up(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function pp(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(i=hp(this,e,[t,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.positions=n.positions,i.options.flipe=n.flipe||{},i.options.flipe.x=i.options.flipe.x||!1,i.options.flipe.y=i.options.flipe.y||!1,i.entity={id:i.options.id},i._positionEditing=!1,i.Dialog=o,i._elms={},i.previous={positions:pp({},i.options.positions)},i._EventBinding=new Si,i.event=new J(i.sdk),i.sdk.addIncetance(i.options.id,i),i.create(),i}return gi()(e,t),k()(e,[{key:"angle",get:function(){return this.options.angle},set:function(t){this.options.angle=t,this._elms.angle&&this._elms.angle.forEach((function(e){e.value=t}))}},{key:"scale",get:function(){return this.options.scale},set:function(t){this.options.scale=t,this._elms.scale&&this._elms.scale.forEach((function(e){e.value=t}))}},{key:"flipeY",get:function(){return this.options.flipe.y},set:function(t){var e=this;if("boolean"==typeof t){if(this.options.flipe.y=t,!this.entity)return;var i=new Image;i.src=this.options.url,i.onload=function(){var t=document.createElement("canvas"),n=t.getContext("2d");t.width=i.width,t.height=i.height,e.flipeX&&(n.scale(1,-1),n.translate(0,-t.height)),e.flipeY&&(n.scale(-1,1),n.translate(-t.width,0)),n.drawImage(i,0,0),e.entity&&(e.entity.rectangle.material=new Cesium.ImageMaterialProperty({image:t,transparent:!0}))}}else console.error("参数必须为boolean")}},{key:"flipeX",get:function(){return this.options.flipe.x},set:function(t){var e=this;if("boolean"==typeof t){if(this.options.flipe.x=t,!this.entity)return;var i=new Image;i.src=this.options.url,i.onload=function(){var t=document.createElement("canvas"),n=t.getContext("2d");t.width=i.width,t.height=i.height,e.flipeX&&(n.scale(1,-1),n.translate(0,-t.height)),e.flipeY&&(n.scale(-1,1),n.translate(-t.width,0)),n.drawImage(i,0,0),e.entity.rectangle.material=new Cesium.ImageMaterialProperty({image:t,transparent:!0})}}else console.error("参数必须为boolean")}},{key:"create",value:(s=a()(l.a.mark((function t(){var e,i=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(this.options.url,{method:"get",headers:{"Content-Type":"application/json"}});case 2:t.sent.ok&&((e=new Image).src=this.options.url,e.onload=function(){var t=document.createElement("canvas"),n=t.getContext("2d");t.width=e.width,t.height=e.height,i.flipeX&&(n.scale(1,-1),n.translate(0,-t.height)),i.flipeY&&(n.scale(-1,1),n.translate(-t.width,0)),n.drawImage(e,0,0),i.entity=i.sdk.viewer.entities.add({id:i.options.id,show:i.options.show,rectangle:{coordinates:new Cesium.CallbackProperty((function(){var t,e=Math.abs(Math.cos(Math.PI/180*i.options.positions.lat))*(1e-4*i.options.scale),n=[i.options.positions.lng-1e-4*i.options.scale,i.options.positions.lat-e,i.options.positions.lng+1e-4*i.options.scale,i.options.positions.lat+e];return(t=Cesium.Rectangle).fromDegrees.apply(t,n)}),!1),material:new Cesium.ImageMaterialProperty({image:t,transparent:!0}),rotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(i.options.angle)}),!1),stRotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(i.options.angle)}),!1)}}),"cesium-viewer 2d"===i.sdk.viewer._element.className&&(i.entity.rectangle.height=0),It(i.sdk,i.options.id),i.options.show&>(0,i.options.id)});case 4:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"edit",value:(o=a()(l.a.mark((function t(e){var i,n,o=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=pp({},this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=16;break}return t.next=6,new bi(this.sdk,this.originalOptions,{title:"军标属性",left:"180px",top:"100px",confirmCallBack:function(t){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),It(o.sdk,o.options.id),Et(o.sdk,o.options.id)},resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()},closeCallBack:function(){o.reset(),o.positionEditing=!1,o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(t){o.show=t,o.Dialog.showCallBack&&o.Dialog.showCallBack()},translationalCallBack:function(){o.positionEditing=!o.positionEditing},addFootElm:[{tagName:"button",className:"flipe-over-y",innerHTML:"Y轴翻转",event:["click",function(){o.flipeY=!o.flipeY}]},{tagName:"button",className:"flipe-over-x",innerHTML:"X轴翻转",event:["click",function(){o.flipeX=!o.flipeX}]}]},!0);case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" ground-image",(i=document.createElement("div")).innerHTML='\n \n
        \n
        \n
        \n 名称\n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 旋转角度\n \n
        \n \n °\n \n
        \n
        \n
        \n
        \n
        \n 调整大小\n \n
        \n \n \n
        \n
        \n
        \n
        \n \n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,t.next=17;break;case 16:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"positionEditing",get:function(){return this._positionEditing},set:function(t){var e=this;this._positionEditing=t,this.previous={positions:pp({},this.options.positions)},!0===t?(this.tip&&this.tip.destroy(),this.tip=new q("点击鼠标左键确认,右键取消",this.sdk),this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.positions.lng=n.lng,e.options.positions.lat=n.lat,e.options.positions.alt=n.alt,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.positions.lng=n.lng,e.options.positions.lat=n.lat,e.options.positions.alt=n.alt,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.positions.lng=e.previous.positions.lng,e.options.positions.lat=e.previous.positions.lat,e.options.positions.alt=e.previous.positions.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.positions.lng=e.previous.positions.lng,e.options.positions.lat=e.previous.positions.lat,e.options.positions.alt=e.previous.positions.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.positions.lng=t.lng,e.options.positions.lat=t.lat,e.options.positions.alt=t.alt,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.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.options.positions.lng=this.previous.positions.lng,this.options.positions.lat=this.previous.positions.lat,this.options.positions.alt=this.previous.positions.alt)}},{key:"flyTo",value:(n=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_,x,E,S,D=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=D.length>0&&void 0!==D[0]?D[0]:{},ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=pp({},this.options.position):this.options.positions?r=pp({},this.options.positions[0]):this.options.center?r=pp({},this.options.center):this.options.start?r=pp({},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")){t.next=16;break}return t.next=15,this.getClampToHeight(r);case 15:r.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.next=59;break;case 23:c=Math.abs(Math.cos(Math.PI/180*this.options.positions.lat))*(1e-4*this.options.scale),u=[[this.options.positions.lng-1e-4*this.options.scale,this.options.positions.lat-c],[this.options.positions.lng+1e-4*this.options.scale,this.options.positions.lat+c]],p=[],h=0,d=this.options.positions,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\n
        \n
        \n
        \n 名称\n \n
        \n
        \n 颜色\n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 旋转角度\n \n
        \n \n °\n \n
        \n
        \n
        \n
        \n
        \n X 轴大小\n \n
        \n \n \n
        \n
        \n
        \n
        \n
        \n Y 轴大小\n \n
        \n \n \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n 文字内容\n \n
        \n
        \n
        \n
        \n
        \n
        \n 文字开关\n \n
        \n
        \n 字体颜色\n
        \n
        \n
        \n 字体大小\n
        \n \n px\n \n
        \n
        \n
        \n
        \n
        \n 视野缩放\n \n
        \n
        \n 最近距离\n
        \n \n m\n \n
        \n
        \n
        \n 最远距离\n
        \n \n m\n \n
        \n
        \n
        \n
        \n \n
        \n
        \n '.concat(zi(t),"\n
        \n
        \n ")}var gp=i(21),yp=i.n(gp),bp=i(12),Cp=i.n(bp);function wp(t,e,i,n){var o=Do()(fi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}function kp(t,e,i){return e=fi()(e),di()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()} +/** + * @license + * Copyright 2010-2024 Three.js Authors + * SPDX-License-Identifier: MIT + */()?Reflect.construct(e,i||[],fi()(t).constructor):e.apply(t,i))}var _p=1014,Ep=1020,Sp=2400,Dp=2401,Pp="srgb",Op="srgb-linear",Mp="display-p3",Tp="display-p3-linear",Np="linear",Bp="srgb",Ap="rec709",Lp=7680,jp=35044,Ip=2e3,Rp=2001,zp=function(){return k()((function t(){C()(this,t)}),[{key:"addEventListener",value:function(t,e){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}},{key:"hasEventListener",value:function(t,e){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)}},{key:"removeEventListener",value:function(t,e){if(void 0!==this._listeners){var i=this._listeners[t];if(void 0!==i){var n=i.indexOf(e);-1!==n&&i.splice(n,1)}}}},{key:"dispatchEvent",value:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var i=e.slice(0),n=0,o=i.length;n>8&255]+Fp[t>>16&255]+Fp[t>>24&255]+"-"+Fp[255&e]+Fp[e>>8&255]+"-"+Fp[e>>16&15|64]+Fp[e>>24&255]+"-"+Fp[63&i|128]+Fp[i>>8&255]+"-"+Fp[i>>16&255]+Fp[i>>24&255]+Fp[255&n]+Fp[n>>8&255]+Fp[n>>16&255]+Fp[n>>24&255]).toLowerCase()}function Gp(t,e,i){return Math.max(e,Math.min(i,t))}function Up(t,e){return(t%e+e)%e}function Wp(t,e,i){return(1-i)*t+i*e}function Yp(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Jp(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}var qp=function(){return k()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;C()(this,t),t.prototype.isVector2=!0,this.x=e,this.y=i}),[{key:"width",get:function(){return this.x},set:function(t){this.x=t}},{key:"height",get:function(){return this.y},set:function(t){this.y=t}},{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"setScalar",value:function(t){return this.x=t,this.y=t,this}},{key:"setX",value:function(t){return this.x=t,this}},{key:"setY",value:function(t){return this.y=t,this}},{key:"setComponent",value:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}},{key:"getComponent",value:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y)}},{key:"copy",value:function(t){return this.x=t.x,this.y=t.y,this}},{key:"add",value:function(t){return this.x+=t.x,this.y+=t.y,this}},{key:"addScalar",value:function(t){return this.x+=t,this.y+=t,this}},{key:"addVectors",value:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}},{key:"addScaledVector",value:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}},{key:"sub",value:function(t){return this.x-=t.x,this.y-=t.y,this}},{key:"subScalar",value:function(t){return this.x-=t,this.y-=t,this}},{key:"subVectors",value:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}},{key:"multiply",value:function(t){return this.x*=t.x,this.y*=t.y,this}},{key:"multiplyScalar",value:function(t){return this.x*=t,this.y*=t,this}},{key:"divide",value:function(t){return this.x/=t.x,this.y/=t.y,this}},{key:"divideScalar",value:function(t){return this.multiplyScalar(1/t)}},{key:"applyMatrix3",value:function(t){var e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this}},{key:"min",value:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}},{key:"max",value:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}},{key:"clamp",value:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}},{key:"clampScalar",value:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}},{key:"clampLength",value:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,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(t){return this.x*t.x+this.y*t.y}},{key:"cross",value:function(t){return this.x*t.y-this.y*t.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(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var i=this.dot(t)/e;return Math.acos(Gp(i,-1,1))}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceToSquared(t))}},{key:"distanceToSquared",value:function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i}},{key:"manhattanDistanceTo",value:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}},{key:"setLength",value:function(t){return this.normalize().multiplyScalar(t)}},{key:"lerp",value:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}},{key:"lerpVectors",value:function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}},{key:"equals",value:function(t){return t.x===this.x&&t.y===this.y}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.x,t[e+1]=this.y,t}},{key:"fromBufferAttribute",value:function(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}},{key:"rotateAround",value:function(t,e){var i=Math.cos(e),n=Math.sin(e),o=this.x-t.x,s=this.y-t.y;return this.x=o*i-s*n+t.x,this.y=o*n+s*i+t.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}},{key:Symbol.iterator,value:l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.x;case 2:return t.next=4,this.y;case 4:case"end":return t.stop()}}),t,this)}))}])}(),Xp=function(){return k()((function t(e,i,n,o,s,a,r,l,c){C()(this,t),t.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,i,n,o,s,a,r,l,c)}),[{key:"set",value:function(t,e,i,n,o,s,a,r,l){var c=this.elements;return c[0]=t,c[1]=n,c[2]=a,c[3]=e,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(t){var e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}},{key:"extractBasis",value:function(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}},{key:"multiply",value:function(t){return this.multiplyMatrices(this,t)}},{key:"premultiply",value:function(t){return this.multiplyMatrices(t,this)}},{key:"multiplyMatrices",value:function(t,e){var i=t.elements,n=e.elements,o=this.elements,s=i[0],a=i[3],r=i[6],l=i[1],c=i[4],u=i[7],p=i[2],h=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]=p*m+h*g+d*C,o[5]=p*f+h*y+d*w,o[8]=p*v+h*b+d*k,this}},{key:"multiplyScalar",value:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}},{key:"determinant",value:function(){var t=this.elements,e=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],r=t[6],l=t[7],c=t[8];return e*s*c-e*a*l-i*o*c+i*a*r+n*o*l-n*s*r}},{key:"invert",value:function(){var t=this.elements,e=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],r=t[6],l=t[7],c=t[8],u=c*s-a*l,p=a*r-c*o,h=l*o-s*r,d=e*u+i*p+n*h;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);var m=1/d;return t[0]=u*m,t[1]=(n*l-c*i)*m,t[2]=(a*i-n*s)*m,t[3]=p*m,t[4]=(c*e-n*r)*m,t[5]=(n*o-a*e)*m,t[6]=h*m,t[7]=(i*r-l*e)*m,t[8]=(s*e-i*o)*m,this}},{key:"transpose",value:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}},{key:"getNormalMatrix",value:function(t){return this.setFromMatrix4(t).invert().transpose()}},{key:"transposeIntoArray",value:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}},{key:"setUvTransform",value:function(t,e,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+t,-n*l,n*r,-n*(-l*s+r*a)+a+e,0,0,1),this}},{key:"scale",value:function(t,e){return this.premultiply(Zp.makeScale(t,e)),this}},{key:"rotate",value:function(t){return this.premultiply(Zp.makeRotation(-t)),this}},{key:"translate",value:function(t,e){return this.premultiply(Zp.makeTranslation(t,e)),this}},{key:"makeTranslation",value:function(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}},{key:"makeRotation",value:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}},{key:"makeScale",value:function(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}},{key:"equals",value:function(t){for(var e=this.elements,i=t.elements,n=0;n<9;n++)if(e[n]!==i[n])return!1;return!0}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0;i<9;i++)this.elements[i]=t[i+e];return this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}},{key:"clone",value:function(){return(new this.constructor).fromArray(this.elements)}}])}(),Zp=new Xp;function Kp(t){for(var e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function $p(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}var Qp={};function th(t){t in Qp||(Qp[t]=!0,console.warn(t))}var eh,ih=(new Xp).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),nh=(new Xp).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),oh=o()(o()(o()(o()({},Op,{transfer:Np,primaries:Ap,toReference:function(t){return t},fromReference:function(t){return t}}),Pp,{transfer:Bp,primaries:Ap,toReference:function(t){return t.convertSRGBToLinear()},fromReference:function(t){return t.convertLinearToSRGB()}}),Tp,{transfer:Np,primaries:"p3",toReference:function(t){return t.applyMatrix3(nh)},fromReference:function(t){return t.applyMatrix3(ih)}}),Mp,{transfer:Bp,primaries:"p3",toReference:function(t){return t.convertSRGBToLinear().applyMatrix3(nh)},fromReference:function(t){return t.applyMatrix3(ih).convertLinearToSRGB()}}),sh=new Set([Op,Tp]),ah={enabled:!0,_workingColorSpace:Op,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!sh.has(t))throw new Error('Unsupported working color space, "'.concat(t,'".'));this._workingColorSpace=t},convert:function(t,e,i){if(!1===this.enabled||e===i||!e||!i)return t;var n=oh[e].toReference;return(0,oh[i].fromReference)(n(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return oh[t].primaries},getTransfer:function(t){return""===t?Np:oh[t].transfer}};function rh(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function lh(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}var ch=function(){return k()((function t(){C()(this,t)}),null,[{key:"getDataURL",value:function(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;var e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===eh&&(eh=$p("canvas")),eh.width=t.width,eh.height=t.height;var i=eh.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=eh}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}},{key:"sRGBToLinear",value:function(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){var e=$p("canvas");e.width=t.width,e.height=t.height;var i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);for(var n=i.getImageData(0,0,t.width,t.height),o=n.data,s=0;s0&&void 0!==arguments[0]?arguments[0]:null;C()(this,t),this.isSource=!0,Object.defineProperty(this,"id",{value:uh++}),this.uuid=Hp(),this.data=e,this.dataReady=!0,this.version=0}),[{key:"needsUpdate",set:function(t){!0===t&&this.version++}},{key:"toJSON",value:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.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;s0&&void 0!==arguments[0]?arguments[0]:e.DEFAULT_IMAGE,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.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]:e.DEFAULT_ANISOTROPY,p=arguments.length>9&&void 0!==arguments[9]?arguments[9]:"";return C()(this,e),(t=kp(this,e)).isTexture=!0,Object.defineProperty(Cp()(t),"id",{value:dh++}),t.uuid=Hp(),t.name="",t.source=new ph(i),t.mipmaps=[],t.mapping=n,t.channel=0,t.wrapS=o,t.wrapT=s,t.magFilter=a,t.minFilter=r,t.anisotropy=u,t.format=l,t.internalFormat=null,t.type=c,t.offset=new qp(0,0),t.repeat=new qp(1,1),t.center=new qp(0,0),t.rotation=0,t.matrixAutoUpdate=!0,t.matrix=new Xp,t.generateMipmaps=!0,t.premultiplyAlpha=!1,t.flipY=!0,t.unpackAlignment=4,t.colorSpace=p,t.userData={},t.version=0,t.onUpdate=null,t.isRenderTargetTexture=!1,t.pmremVersion=0,t}return gi()(e,t),k()(e,[{key:"image",get:function(){return this.source.data},set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.source.data=t}},{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(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}},{key:"toJSON",value:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var i={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).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),e||(t.textures[this.uuid]=i),i}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"transformUv",value:function(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}},{key:"needsUpdate",set:function(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}},{key:"needsPMREMUpdate",set:function(t){!0===t&&this.pmremVersion++}}])}(zp);mh.DEFAULT_IMAGE=null,mh.DEFAULT_MAPPING=300,mh.DEFAULT_ANISOTROPY=1;var fh=function(){return k()((function t(){var e=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;C()(this,t),t.prototype.isVector4=!0,this.x=e,this.y=i,this.z=n,this.w=o}),[{key:"width",get:function(){return this.z},set:function(t){this.z=t}},{key:"height",get:function(){return this.w},set:function(t){this.w=t}},{key:"set",value:function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this}},{key:"setScalar",value:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}},{key:"setX",value:function(t){return this.x=t,this}},{key:"setY",value:function(t){return this.y=t,this}},{key:"setZ",value:function(t){return this.z=t,this}},{key:"setW",value:function(t){return this.w=t,this}},{key:"setComponent",value:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}},{key:"getComponent",value:function(t){switch(t){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: "+t)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}},{key:"add",value:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}},{key:"addScalar",value:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}},{key:"addVectors",value:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}},{key:"addScaledVector",value:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}},{key:"sub",value:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}},{key:"subScalar",value:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}},{key:"subVectors",value:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}},{key:"multiply",value:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}},{key:"multiplyScalar",value:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}},{key:"applyMatrix4",value:function(t){var e=this.x,i=this.y,n=this.z,o=this.w,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*o,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*o,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*o,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*o,this}},{key:"divideScalar",value:function(t){return this.multiplyScalar(1/t)}},{key:"setAxisAngleFromQuaternion",value:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}},{key:"setAxisAngleFromRotationMatrix",value:function(t){var e,i,n,o,s=.01,a=.1,r=t.elements,l=r[0],c=r[4],u=r[8],p=r[1],h=r[5],d=r[9],m=r[2],f=r[6],v=r[10];if(Math.abs(c-p)y&&g>b?gb?y1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}},{key:"fromBufferAttribute",value:function(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),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:l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.x;case 2:return t.next=4,this.y;case 4:return t.next=6,this.z;case 6:return t.next=8,this.w;case 8:case"end":return t.stop()}}),t,this)}))}])}(),vh=function(t){function e(){var t,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 C()(this,e),(t=kp(this,e,[null])).isDataArrayTexture=!0,t.image={data:i,width:n,height:o,depth:s},t.magFilter=1003,t.minFilter=1003,t.wrapR=1001,t.generateMipmaps=!1,t.flipY=!1,t.unpackAlignment=1,t}return gi()(e,t),k()(e)}(mh),gh=function(t){function e(){var t,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 C()(this,e),(t=kp(this,e,[null])).isData3DTexture=!0,t.image={data:i,width:n,height:o,depth:s},t.magFilter=1003,t.minFilter=1003,t.wrapR=1001,t.generateMipmaps=!1,t.flipY=!1,t.unpackAlignment=1,t}return gi()(e,t),k()(e)}(mh),yh=function(){return k()((function t(){var e=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;C()(this,t),this.isQuaternion=!0,this._x=e,this._y=i,this._z=n,this._w=o}),[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}},{key:"set",value:function(t,e,i,n){return this._x=t,this._y=e,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(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}},{key:"setFromEuler",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=t._x,n=t._y,o=t._z,s=t._order,a=Math.cos,r=Math.sin,l=a(i/2),c=a(n/2),u=a(o/2),p=r(i/2),h=r(n/2),d=r(o/2);switch(s){case"XYZ":this._x=p*c*u+l*h*d,this._y=l*h*u-p*c*d,this._z=l*c*d+p*h*u,this._w=l*c*u-p*h*d;break;case"YXZ":this._x=p*c*u+l*h*d,this._y=l*h*u-p*c*d,this._z=l*c*d-p*h*u,this._w=l*c*u+p*h*d;break;case"ZXY":this._x=p*c*u-l*h*d,this._y=l*h*u+p*c*d,this._z=l*c*d+p*h*u,this._w=l*c*u-p*h*d;break;case"ZYX":this._x=p*c*u-l*h*d,this._y=l*h*u+p*c*d,this._z=l*c*d-p*h*u,this._w=l*c*u+p*h*d;break;case"YZX":this._x=p*c*u+l*h*d,this._y=l*h*u+p*c*d,this._z=l*c*d-p*h*u,this._w=l*c*u-p*h*d;break;case"XZY":this._x=p*c*u-l*h*d,this._y=l*h*u-p*c*d,this._z=l*c*d+p*h*u,this._w=l*c*u+p*h*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===e&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(t,e){var i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(t){var e=t.elements,i=e[0],n=e[4],o=e[8],s=e[1],a=e[5],r=e[9],l=e[2],c=e[6],u=e[10],p=i+a+u;if(p>0){var h=.5/Math.sqrt(p+1);this._w=.25/h,this._x=(c-r)*h,this._y=(o-l)*h,this._z=(s-n)*h}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(t,e){var i=t.dot(e)+1;return iMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}},{key:"angleTo",value:function(t){return 2*Math.acos(Math.abs(Gp(this.dot(t),-1,1)))}},{key:"rotateTowards",value:function(t,e){var i=this.angleTo(t);if(0===i)return this;var n=Math.min(1,e/i);return this.slerp(t,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(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}},{key:"multiply",value:function(t){return this.multiplyQuaternions(this,t)}},{key:"premultiply",value:function(t){return this.multiplyQuaternions(t,this)}},{key:"multiplyQuaternions",value:function(t,e){var i=t._x,n=t._y,o=t._z,s=t._w,a=e._x,r=e._y,l=e._z,c=e._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(t,e){if(0===e)return this;if(1===e)return this.copy(t);var i=this._x,n=this._y,o=this._z,s=this._w,a=s*t._w+i*t._x+n*t._y+o*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),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-e;return this._w=l*s+e*this._w,this._x=l*i+e*this._x,this._y=l*n+e*this._y,this._z=l*o+e*this._z,this.normalize(),this}var c=Math.sqrt(r),u=Math.atan2(c,a),p=Math.sin((1-e)*u)/c,h=Math.sin(e*u)/c;return this._w=s*p+this._w*h,this._x=i*p+this._x*h,this._y=n*p+this._y*h,this._z=o*p+this._z*h,this._onChangeCallback(),this}},{key:"slerpQuaternions",value:function(t,e,i){return this.copy(t).slerp(e,i)}},{key:"random",value:function(){var t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),o=Math.sqrt(i);return this.set(n*Math.sin(t),n*Math.cos(t),o*Math.sin(e),o*Math.cos(e))}},{key:"equals",value:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}},{key:"fromBufferAttribute",value:function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}},{key:"toJSON",value:function(){return this.toArray()}},{key:"_onChange",value:function(t){return this._onChangeCallback=t,this}},{key:"_onChangeCallback",value:function(){}},{key:Symbol.iterator,value:l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._x;case 2:return t.next=4,this._y;case 4:return t.next=6,this._z;case 6:return t.next=8,this._w;case 8:case"end":return t.stop()}}),t,this)}))}],[{key:"slerpFlat",value:function(t,e,i,n,o,s,a){var r=i[n+0],l=i[n+1],c=i[n+2],u=i[n+3],p=o[s+0],h=o[s+1],d=o[s+2],m=o[s+3];if(0===a)return t[e+0]=r,t[e+1]=l,t[e+2]=c,void(t[e+3]=u);if(1===a)return t[e+0]=p,t[e+1]=h,t[e+2]=d,void(t[e+3]=m);if(u!==m||r!==p||l!==h||c!==d){var f=1-a,v=r*p+l*h+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+p*w,l=l*f+h*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}}t[e]=r,t[e+1]=l,t[e+2]=c,t[e+3]=u}},{key:"multiplyQuaternionsFlat",value:function(t,e,i,n,o,s){var a=i[n],r=i[n+1],l=i[n+2],c=i[n+3],u=o[s],p=o[s+1],h=o[s+2],d=o[s+3];return t[e]=a*d+c*u+r*h-l*p,t[e+1]=r*d+c*p+l*u-a*h,t[e+2]=l*d+c*h+a*p-r*u,t[e+3]=c*d-a*u-r*p-l*h,t}}])}(),bh=function(){return k()((function t(){var e=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;C()(this,t),t.prototype.isVector3=!0,this.x=e,this.y=i,this.z=n}),[{key:"set",value:function(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}},{key:"setScalar",value:function(t){return this.x=t,this.y=t,this.z=t,this}},{key:"setX",value:function(t){return this.x=t,this}},{key:"setY",value:function(t){return this.y=t,this}},{key:"setZ",value:function(t){return this.z=t,this}},{key:"setComponent",value:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}},{key:"getComponent",value:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}},{key:"add",value:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}},{key:"addScalar",value:function(t){return this.x+=t,this.y+=t,this.z+=t,this}},{key:"addVectors",value:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}},{key:"addScaledVector",value:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}},{key:"sub",value:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}},{key:"subScalar",value:function(t){return this.x-=t,this.y-=t,this.z-=t,this}},{key:"subVectors",value:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}},{key:"multiply",value:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}},{key:"multiplyScalar",value:function(t){return this.x*=t,this.y*=t,this.z*=t,this}},{key:"multiplyVectors",value:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}},{key:"applyEuler",value:function(t){return this.applyQuaternion(wh.setFromEuler(t))}},{key:"applyAxisAngle",value:function(t,e){return this.applyQuaternion(wh.setFromAxisAngle(t,e))}},{key:"applyMatrix3",value:function(t){var e=this.x,i=this.y,n=this.z,o=t.elements;return this.x=o[0]*e+o[3]*i+o[6]*n,this.y=o[1]*e+o[4]*i+o[7]*n,this.z=o[2]*e+o[5]*i+o[8]*n,this}},{key:"applyNormalMatrix",value:function(t){return this.applyMatrix3(t).normalize()}},{key:"applyMatrix4",value:function(t){var e=this.x,i=this.y,n=this.z,o=t.elements,s=1/(o[3]*e+o[7]*i+o[11]*n+o[15]);return this.x=(o[0]*e+o[4]*i+o[8]*n+o[12])*s,this.y=(o[1]*e+o[5]*i+o[9]*n+o[13])*s,this.z=(o[2]*e+o[6]*i+o[10]*n+o[14])*s,this}},{key:"applyQuaternion",value:function(t){var e=this.x,i=this.y,n=this.z,o=t.x,s=t.y,a=t.z,r=t.w,l=2*(s*n-a*i),c=2*(a*e-o*n),u=2*(o*i-s*e);return this.x=e+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(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}},{key:"unproject",value:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}},{key:"transformDirection",value:function(t){var e=this.x,i=this.y,n=this.z,o=t.elements;return this.x=o[0]*e+o[4]*i+o[8]*n,this.y=o[1]*e+o[5]*i+o[9]*n,this.z=o[2]*e+o[6]*i+o[10]*n,this.normalize()}},{key:"divide",value:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}},{key:"divideScalar",value:function(t){return this.multiplyScalar(1/t)}},{key:"min",value:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}},{key:"max",value:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}},{key:"clamp",value:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}},{key:"clampScalar",value:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}},{key:"clampLength",value:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}},{key:"lerp",value:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}},{key:"lerpVectors",value:function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}},{key:"cross",value:function(t){return this.crossVectors(this,t)}},{key:"crossVectors",value:function(t,e){var i=t.x,n=t.y,o=t.z,s=e.x,a=e.y,r=e.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(t){var e=t.lengthSq();if(0===e)return this.set(0,0,0);var i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}},{key:"projectOnPlane",value:function(t){return Ch.copy(this).projectOnVector(t),this.sub(Ch)}},{key:"reflect",value:function(t){return this.sub(Ch.copy(t).multiplyScalar(2*this.dot(t)))}},{key:"angleTo",value:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var i=this.dot(t)/e;return Math.acos(Gp(i,-1,1))}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceToSquared(t))}},{key:"distanceToSquared",value:function(t){var e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n}},{key:"manhattanDistanceTo",value:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}},{key:"setFromSpherical",value:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}},{key:"setFromSphericalCoords",value:function(t,e,i){var n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this}},{key:"setFromCylindrical",value:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}},{key:"setFromCylindricalCoords",value:function(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}},{key:"setFromMatrixPosition",value:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}},{key:"setFromMatrixScale",value:function(t){var e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this}},{key:"setFromMatrixColumn",value:function(t,e){return this.fromArray(t.elements,4*e)}},{key:"setFromMatrix3Column",value:function(t,e){return this.fromArray(t.elements,3*e)}},{key:"setFromEuler",value:function(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}},{key:"setFromColor",value:function(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}},{key:"equals",value:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}},{key:"fromBufferAttribute",value:function(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}},{key:"randomDirection",value:function(){var t=Math.random()*Math.PI*2,e=2*Math.random()-1,i=Math.sqrt(1-e*e);return this.x=i*Math.cos(t),this.y=e,this.z=i*Math.sin(t),this}},{key:Symbol.iterator,value:l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.x;case 2:return t.next=4,this.y;case 4:return t.next=6,this.z;case 6:case"end":return t.stop()}}),t,this)}))}])}(),Ch=new bh,wh=new yh,kh=function(){return k()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new bh(1/0,1/0,1/0),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bh(-1/0,-1/0,-1/0);C()(this,t),this.isBox3=!0,this.min=e,this.max=i}),[{key:"set",value:function(t,e){return this.min.copy(t),this.max.copy(e),this}},{key:"setFromArray",value:function(t){this.makeEmpty();for(var e=0,i=t.length;e1&&void 0!==arguments[1]&&arguments[1];return this.makeEmpty(),this.expandByObject(t,e)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){return this.min.copy(t.min),this.max.copy(t.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.x1&&void 0!==arguments[1]&&arguments[1];t.updateWorldMatrix(!1,!1);var i=t.geometry;if(void 0!==i){var n=i.getAttribute("position");if(!0===e&&void 0!==n&&!0!==t.isInstancedMesh)for(var o=0,s=n.count;othis.max.x||t.ythis.max.y||t.zthis.max.z)}},{key:"containsBox",value:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}},{key:"getParameter",value:function(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}},{key:"intersectsBox",value:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}},{key:"intersectsSphere",value:function(t){return this.clampPoint(t.center,xh),xh.distanceToSquared(t.center)<=t.radius*t.radius}},{key:"intersectsPlane",value:function(t){var e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}},{key:"intersectsTriangle",value:function(t){if(this.isEmpty())return!1;this.getCenter(Nh),Bh.subVectors(this.max,Nh),Sh.subVectors(t.a,Nh),Dh.subVectors(t.b,Nh),Ph.subVectors(t.c,Nh),Oh.subVectors(Dh,Sh),Mh.subVectors(Ph,Dh),Th.subVectors(Sh,Ph);var e=[0,-Oh.z,Oh.y,0,-Mh.z,Mh.y,0,-Th.z,Th.y,Oh.z,0,-Oh.x,Mh.z,0,-Mh.x,Th.z,0,-Th.x,-Oh.y,Oh.x,0,-Mh.y,Mh.x,0,-Th.y,Th.x,0];return!!jh(e,Sh,Dh,Ph,Bh)&&(!!jh(e=[1,0,0,0,1,0,0,0,1],Sh,Dh,Ph,Bh)&&(Ah.crossVectors(Oh,Mh),jh(e=[Ah.x,Ah.y,Ah.z],Sh,Dh,Ph,Bh)))}},{key:"clampPoint",value:function(t,e){return e.copy(t).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(t){return this.clampPoint(t,xh).distanceTo(t)}},{key:"getBoundingSphere",value:function(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(xh).length()),t}},{key:"intersect",value:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(t){return this.min.min(t.min),this.max.max(t.max),this}},{key:"applyMatrix4",value:function(t){return this.isEmpty()||(_h[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),_h[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),_h[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),_h[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),_h[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),_h[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),_h[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),_h[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(_h)),this}},{key:"translate",value:function(t){return this.min.add(t),this.max.add(t),this}},{key:"equals",value:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}])}(),_h=[new bh,new bh,new bh,new bh,new bh,new bh,new bh,new bh],xh=new bh,Eh=new kh,Sh=new bh,Dh=new bh,Ph=new bh,Oh=new bh,Mh=new bh,Th=new bh,Nh=new bh,Bh=new bh,Ah=new bh,Lh=new bh;function jh(t,e,i,n,o){for(var s=0,a=t.length-3;s<=a;s+=3){Lh.fromArray(t,s);var r=o.x*Math.abs(Lh.x)+o.y*Math.abs(Lh.y)+o.z*Math.abs(Lh.z),l=e.dot(Lh),c=i.dot(Lh),u=n.dot(Lh);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>r)return!1}return!0}var Ih=new kh,Rh=new bh,zh=new bh,Fh=function(){return k()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new bh,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;C()(this,t),this.isSphere=!0,this.center=e,this.radius=i}),[{key:"set",value:function(t,e){return this.center.copy(t),this.radius=e,this}},{key:"setFromPoints",value:function(t,e){var i=this.center;void 0!==e?i.copy(e):Ih.setFromPoints(t).getCenter(i);for(var n=0,o=0,s=t.length;othis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}},{key:"getBoundingBox",value:function(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}},{key:"applyMatrix4",value:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}},{key:"translate",value:function(t){return this.center.add(t),this}},{key:"expandByPoint",value:function(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Rh.subVectors(t,this.center);var e=Rh.lengthSq();if(e>this.radius*this.radius){var i=Math.sqrt(e),n=.5*(i-this.radius);this.center.addScaledVector(Rh,n/i),this.radius+=n}return this}},{key:"union",value:function(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(zh.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Rh.copy(t.center).add(zh)),this.expandByPoint(Rh.copy(t.center).sub(zh))),this)}},{key:"equals",value:function(t){return t.center.equals(this.center)&&t.radius===this.radius}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),Vh=new bh,Hh=new bh,Gh=new bh,Uh=new bh,Wh=new bh,Yh=new bh,Jh=new bh,qh=function(){return k()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new bh,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bh(0,0,-1);C()(this,t),this.origin=e,this.direction=i}),[{key:"set",value:function(t,e){return this.origin.copy(t),this.direction.copy(e),this}},{key:"copy",value:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}},{key:"at",value:function(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}},{key:"lookAt",value:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this}},{key:"recast",value:function(t){return this.origin.copy(this.at(t,Vh)),this}},{key:"closestPointToPoint",value:function(t,e){e.subVectors(t,this.origin);var i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,i)}},{key:"distanceToPoint",value:function(t){return Math.sqrt(this.distanceSqToPoint(t))}},{key:"distanceSqToPoint",value:function(t){var e=Vh.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Vh.copy(this.origin).addScaledVector(this.direction,e),Vh.distanceToSquared(t))}},{key:"distanceSqToSegment",value:function(t,e,i,n){Hh.copy(t).add(e).multiplyScalar(.5),Gh.copy(e).sub(t).normalize(),Uh.copy(this.origin).sub(Hh);var o,s,a,r,l=.5*t.distanceTo(e),c=-this.direction.dot(Gh),u=Uh.dot(this.direction),p=-Uh.dot(Gh),h=Uh.lengthSq(),d=Math.abs(1-c*c);if(d>0)if(s=c*u-p,r=l*d,(o=c*p-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*p)+h}else s=l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*p)+h;else s=-l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*p)+h;else s<=-r?a=-(o=Math.max(0,-(-c*l+u)))*o+(s=o>0?-l:Math.min(Math.max(-l,-p),l))*(s+2*p)+h:s<=r?(o=0,a=(s=Math.min(Math.max(-l,-p),l))*(s+2*p)+h):a=-(o=Math.max(0,-(c*l+u)))*o+(s=o>0?l:Math.min(Math.max(-l,-p),l))*(s+2*p)+h;else s=c>0?-l:l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*p)+h;return i&&i.copy(this.origin).addScaledVector(this.direction,o),n&&n.copy(Hh).addScaledVector(Gh,s),a}},{key:"intersectSphere",value:function(t,e){Vh.subVectors(t.center,this.origin);var i=Vh.dot(this.direction),n=Vh.dot(Vh)-i*i,o=t.radius*t.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,e):this.at(a,e)}},{key:"intersectsSphere",value:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}},{key:"distanceToPlane",value:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}},{key:"intersectPlane",value:function(t,e){var i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}},{key:"intersectsPlane",value:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0}},{key:"intersectBox",value:function(t,e){var i,n,o,s,a,r,l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,p=this.origin;return l>=0?(i=(t.min.x-p.x)*l,n=(t.max.x-p.x)*l):(i=(t.max.x-p.x)*l,n=(t.min.x-p.x)*l),c>=0?(o=(t.min.y-p.y)*c,s=(t.max.y-p.y)*c):(o=(t.max.y-p.y)*c,s=(t.min.y-p.y)*c),i>s||o>n?null:((o>i||isNaN(i))&&(i=o),(s=0?(a=(t.min.z-p.z)*u,r=(t.max.z-p.z)*u):(a=(t.max.z-p.z)*u,r=(t.min.z-p.z)*u),i>r||a>n?null:((a>i||i!=i)&&(i=a),(r=0?i:n,e)))}},{key:"intersectsBox",value:function(t){return null!==this.intersectBox(t,Vh)}},{key:"intersectTriangle",value:function(t,e,i,n,o){Wh.subVectors(e,t),Yh.subVectors(i,t),Jh.crossVectors(Wh,Yh);var s,a=this.direction.dot(Jh);if(a>0){if(n)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}Uh.subVectors(this.origin,t);var r=s*this.direction.dot(Yh.crossVectors(Uh,Yh));if(r<0)return null;var l=s*this.direction.dot(Wh.cross(Uh));if(l<0)return null;if(r+l>a)return null;var c=-s*Uh.dot(Jh);return c<0?null:this.at(c/a,o)}},{key:"applyMatrix4",value:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}},{key:"equals",value:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),Xh=function(){function t(e,i,n,o,s,a,r,l,c,u,p,h,d,m,f,v){C()(this,t),t.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,i,n,o,s,a,r,l,c,u,p,h,d,m,f,v)}return k()(t,[{key:"set",value:function(t,e,i,n,o,s,a,r,l,c,u,p,h,d,m,f){var v=this.elements;return v[0]=t,v[4]=e,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]=p,v[3]=h,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 t).fromArray(this.elements)}},{key:"copy",value:function(t){var e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}},{key:"copyPosition",value:function(t){var e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}},{key:"setFromMatrix3",value:function(t){var e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}},{key:"extractBasis",value:function(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(t){var e=this.elements,i=t.elements,n=1/Zh.setFromMatrixColumn(t,0).length(),o=1/Zh.setFromMatrixColumn(t,1).length(),s=1/Zh.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*o,e[5]=i[5]*o,e[6]=i[6]*o,e[7]=0,e[8]=i[8]*s,e[9]=i[9]*s,e[10]=i[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}},{key:"makeRotationFromEuler",value:function(t){var e=this.elements,i=t.x,n=t.y,o=t.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"===t.order){var p=s*c,h=s*u,d=a*c,m=a*u;e[0]=r*c,e[4]=-r*u,e[8]=l,e[1]=h+d*l,e[5]=p-m*l,e[9]=-a*r,e[2]=m-p*l,e[6]=d+h*l,e[10]=s*r}else if("YXZ"===t.order){var f=r*c,v=r*u,g=l*c,y=l*u;e[0]=f+y*a,e[4]=g*a-v,e[8]=s*l,e[1]=s*u,e[5]=s*c,e[9]=-a,e[2]=v*a-g,e[6]=y+f*a,e[10]=s*r}else if("ZXY"===t.order){var b=r*c,C=r*u,w=l*c,k=l*u;e[0]=b-k*a,e[4]=-s*u,e[8]=w+C*a,e[1]=C+w*a,e[5]=s*c,e[9]=k-b*a,e[2]=-s*l,e[6]=a,e[10]=s*r}else if("ZYX"===t.order){var _=s*c,x=s*u,E=a*c,S=a*u;e[0]=r*c,e[4]=E*l-x,e[8]=_*l+S,e[1]=r*u,e[5]=S*l+_,e[9]=x*l-E,e[2]=-l,e[6]=a*r,e[10]=s*r}else if("YZX"===t.order){var D=s*r,P=s*l,O=a*r,M=a*l;e[0]=r*c,e[4]=M-D*u,e[8]=O*u+P,e[1]=u,e[5]=s*c,e[9]=-a*c,e[2]=-l*c,e[6]=P*u+O,e[10]=D-M*u}else if("XZY"===t.order){var T=s*r,N=s*l,B=a*r,A=a*l;e[0]=r*c,e[4]=-u,e[8]=l*c,e[1]=T*u+A,e[5]=s*c,e[9]=N*u-B,e[2]=B*u-N,e[6]=a*c,e[10]=A*u+T}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(t){return this.compose($h,t,Qh)}},{key:"lookAt",value:function(t,e,i){var n=this.elements;return id.subVectors(t,e),0===id.lengthSq()&&(id.z=1),id.normalize(),td.crossVectors(i,id),0===td.lengthSq()&&(1===Math.abs(i.z)?id.x+=1e-4:id.z+=1e-4,id.normalize(),td.crossVectors(i,id)),td.normalize(),ed.crossVectors(id,td),n[0]=td.x,n[4]=ed.x,n[8]=id.x,n[1]=td.y,n[5]=ed.y,n[9]=id.y,n[2]=td.z,n[6]=ed.z,n[10]=id.z,this}},{key:"multiply",value:function(t){return this.multiplyMatrices(this,t)}},{key:"premultiply",value:function(t){return this.multiplyMatrices(t,this)}},{key:"multiplyMatrices",value:function(t,e){var i=t.elements,n=e.elements,o=this.elements,s=i[0],a=i[4],r=i[8],l=i[12],c=i[1],u=i[5],p=i[9],h=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],D=n[9],P=n[13],O=n[2],M=n[6],T=n[10],N=n[14],B=n[3],A=n[7],L=n[11],j=n[15];return o[0]=s*w+a*E+r*O+l*B,o[4]=s*k+a*S+r*M+l*A,o[8]=s*_+a*D+r*T+l*L,o[12]=s*x+a*P+r*N+l*j,o[1]=c*w+u*E+p*O+h*B,o[5]=c*k+u*S+p*M+h*A,o[9]=c*_+u*D+p*T+h*L,o[13]=c*x+u*P+p*N+h*j,o[2]=d*w+m*E+f*O+v*B,o[6]=d*k+m*S+f*M+v*A,o[10]=d*_+m*D+f*T+v*L,o[14]=d*x+m*P+f*N+v*j,o[3]=g*w+y*E+b*O+C*B,o[7]=g*k+y*S+b*M+C*A,o[11]=g*_+y*D+b*T+C*L,o[15]=g*x+y*P+b*N+C*j,this}},{key:"multiplyScalar",value:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}},{key:"determinant",value:function(){var t=this.elements,e=t[0],i=t[4],n=t[8],o=t[12],s=t[1],a=t[5],r=t[9],l=t[13],c=t[2],u=t[6],p=t[10],h=t[14];return t[3]*(+o*r*u-n*l*u-o*a*p+i*l*p+n*a*h-i*r*h)+t[7]*(+e*r*h-e*l*p+o*s*p-n*s*h+n*l*c-o*r*c)+t[11]*(+e*l*u-e*a*h-o*s*u+i*s*h+o*a*c-i*l*c)+t[15]*(-n*a*c-e*r*u+e*a*p+n*s*u-i*s*p+i*r*c)}},{key:"transpose",value:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}},{key:"setPosition",value:function(t,e,i){var n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=i),this}},{key:"invert",value:function(){var t=this.elements,e=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],r=t[6],l=t[7],c=t[8],u=t[9],p=t[10],h=t[11],d=t[12],m=t[13],f=t[14],v=t[15],g=u*f*l-m*p*l+m*r*h-a*f*h-u*r*v+a*p*v,y=d*p*l-c*f*l-d*r*h+s*f*h+c*r*v-s*p*v,b=c*m*l-d*u*l+d*a*h-s*m*h-c*a*v+s*u*v,C=d*u*r-c*m*r-d*a*p+s*m*p+c*a*f-s*u*f,w=e*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 t[0]=g*k,t[1]=(m*p*o-u*f*o-m*n*h+i*f*h+u*n*v-i*p*v)*k,t[2]=(a*f*o-m*r*o+m*n*l-i*f*l-a*n*v+i*r*v)*k,t[3]=(u*r*o-a*p*o-u*n*l+i*p*l+a*n*h-i*r*h)*k,t[4]=y*k,t[5]=(c*f*o-d*p*o+d*n*h-e*f*h-c*n*v+e*p*v)*k,t[6]=(d*r*o-s*f*o-d*n*l+e*f*l+s*n*v-e*r*v)*k,t[7]=(s*p*o-c*r*o+c*n*l-e*p*l-s*n*h+e*r*h)*k,t[8]=b*k,t[9]=(d*u*o-c*m*o-d*i*h+e*m*h+c*i*v-e*u*v)*k,t[10]=(s*m*o-d*a*o+d*i*l-e*m*l-s*i*v+e*a*v)*k,t[11]=(c*a*o-s*u*o-c*i*l+e*u*l+s*i*h-e*a*h)*k,t[12]=C*k,t[13]=(c*m*n-d*u*n+d*i*p-e*m*p-c*i*f+e*u*f)*k,t[14]=(d*a*n-s*m*n-d*i*r+e*m*r+s*i*f-e*a*f)*k,t[15]=(s*u*n-c*a*n+c*i*r-e*u*r-s*i*p+e*a*p)*k,this}},{key:"scale",value:function(t){var e=this.elements,i=t.x,n=t.y,o=t.z;return e[0]*=i,e[4]*=n,e[8]*=o,e[1]*=i,e[5]*=n,e[9]*=o,e[2]*=i,e[6]*=n,e[10]*=o,e[3]*=i,e[7]*=n,e[11]*=o,this}},{key:"getMaxScaleOnAxis",value:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}},{key:"makeTranslation",value:function(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}},{key:"makeRotationX",value:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}},{key:"makeRotationY",value:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(t,e){var i=Math.cos(e),n=Math.sin(e),o=1-i,s=t.x,a=t.y,r=t.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(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}},{key:"makeShear",value:function(t,e,i,n,o,s){return this.set(1,i,o,0,t,1,s,0,e,n,1,0,0,0,0,1),this}},{key:"compose",value:function(t,e,i){var n=this.elements,o=e._x,s=e._y,a=e._z,r=e._w,l=o+o,c=s+s,u=a+a,p=o*l,h=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]=(h+b)*C,n[2]=(d-y)*C,n[3]=0,n[4]=(h-b)*w,n[5]=(1-(p+v))*w,n[6]=(f+g)*w,n[7]=0,n[8]=(d+y)*k,n[9]=(f-g)*k,n[10]=(1-(p+m))*k,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}},{key:"decompose",value:function(t,e,i){var n=this.elements,o=Zh.set(n[0],n[1],n[2]).length(),s=Zh.set(n[4],n[5],n[6]).length(),a=Zh.set(n[8],n[9],n[10]).length();this.determinant()<0&&(o=-o),t.x=n[12],t.y=n[13],t.z=n[14],Kh.copy(this);var r=1/o,l=1/s,c=1/a;return Kh.elements[0]*=r,Kh.elements[1]*=r,Kh.elements[2]*=r,Kh.elements[4]*=l,Kh.elements[5]*=l,Kh.elements[6]*=l,Kh.elements[8]*=c,Kh.elements[9]*=c,Kh.elements[10]*=c,e.setFromRotationMatrix(Kh),i.x=o,i.y=s,i.z=a,this}},{key:"makePerspective",value:function(t,e,i,n,o,s){var a,r,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2e3,c=this.elements,u=2*o/(e-t),p=2*o/(i-n),h=(e+t)/(e-t),d=(i+n)/(i-n);if(l===Ip)a=-(s+o)/(s-o),r=-2*s*o/(s-o);else{if(l!==Rp)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]=h,c[12]=0,c[1]=0,c[5]=p,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(t,e,i,n,o,s){var a,r,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2e3,c=this.elements,u=1/(e-t),p=1/(i-n),h=1/(s-o),d=(e+t)*u,m=(i+n)*p;if(l===Ip)a=(s+o)*h,r=-2*h;else{if(l!==Rp)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);a=o*h,r=-1*h}return c[0]=2*u,c[4]=0,c[8]=0,c[12]=-d,c[1]=0,c[5]=2*p,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(t){for(var e=this.elements,i=t.elements,n=0;n<16;n++)if(e[n]!==i[n])return!1;return!0}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0;i<16;i++)this.elements[i]=t[i+e];return this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}])}(),Zh=new bh,Kh=new Xh,$h=new bh(0,0,0),Qh=new bh(1,1,1),td=new bh,ed=new bh,id=new bh,nd=new Xh,od=new yh,sd=function(){return k()((function t(){var e=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]:t.DEFAULT_ORDER;C()(this,t),this.isEuler=!0,this._x=e,this._y=i,this._z=n,this._order=o}),[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}},{key:"set",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=t,this._y=e,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(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=t.elements,o=n[0],s=n[4],a=n[8],r=n[1],l=n[5],c=n[9],u=n[2],p=n[6],h=n[10];switch(e){case"XYZ":this._y=Math.asin(Gp(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,h),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(p,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Gp(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(r,l)):(this._y=Math.atan2(-u,o),this._z=0);break;case"ZXY":this._x=Math.asin(Gp(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-u,h),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(r,o));break;case"ZYX":this._y=Math.asin(-Gp(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,h),this._z=Math.atan2(r,o)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(Gp(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,h));break;case"XZY":this._z=Math.asin(-Gp(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(p,l),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-c,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(t,e,i){return nd.makeRotationFromQuaternion(t),this.setFromRotationMatrix(nd,e,i)}},{key:"setFromVector3",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(t.x,t.y,t.z,e)}},{key:"reorder",value:function(t){return od.setFromEuler(this),this.setFromQuaternion(od,t)}},{key:"equals",value:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}},{key:"fromArray",value:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}},{key:"_onChange",value:function(t){return this._onChangeCallback=t,this}},{key:"_onChangeCallback",value:function(){}},{key:Symbol.iterator,value:l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._x;case 2:return t.next=4,this._y;case 4:return t.next=6,this._z;case 6:return t.next=8,this._order;case 8:case"end":return t.stop()}}),t,this)}))}])}();sd.DEFAULT_ORDER="XYZ";var ad=function(){return k()((function t(){C()(this,t),this.mask=1}),[{key:"set",value:function(t){this.mask=(1<>>0}},{key:"enable",value:function(t){this.mask|=1<1){for(var e=0;e1){for(var e=0;e2&&void 0!==arguments[2]?arguments[2]:[];this[t]===e&&i.push(this);for(var n=this.children,o=0,s=n.length;o0&&(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(t){return{boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.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(t),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(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=o(t.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;r0){n.children=[];for(var d=0;d0){n.animations=[];for(var m=0;m0&&(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(t){var e=[];for(var i in t){var n=t[i];delete n.metadata,e.push(n)}return e}}},{key:"clone",value:function(t){return(new this.constructor).copy(this,t)}},{key:"copy",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:new bh,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bh,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new bh;C()(this,t),this.a=e,this.b=i,this.c=n}return k()(t,[{key:"set",value:function(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}},{key:"setFromPointsAndIndices",value:function(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this}},{key:"setFromAttributeAndIndices",value:function(t,e,i,n){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,n),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}},{key:"getArea",value:function(){return _d.subVectors(this.c,this.b),xd.subVectors(this.a,this.b),.5*_d.cross(xd).length()}},{key:"getMidpoint",value:function(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}},{key:"getNormal",value:function(e){return t.getNormal(this.a,this.b,this.c,e)}},{key:"getPlane",value:function(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}},{key:"getBarycoord",value:function(e,i){return t.getBarycoord(e,this.a,this.b,this.c,i)}},{key:"getInterpolation",value:function(e,i,n,o,s){return t.getInterpolation(e,this.a,this.b,this.c,i,n,o,s)}},{key:"containsPoint",value:function(e){return t.containsPoint(e,this.a,this.b,this.c)}},{key:"isFrontFacing",value:function(e){return t.isFrontFacing(this.a,this.b,this.c,e)}},{key:"intersectsBox",value:function(t){return t.intersectsTriangle(this)}},{key:"closestPointToPoint",value:function(t,e){var i,n,o=this.a,s=this.b,a=this.c;Dd.subVectors(s,o),Pd.subVectors(a,o),Md.subVectors(t,o);var r=Dd.dot(Md),l=Pd.dot(Md);if(r<=0&&l<=0)return e.copy(o);Td.subVectors(t,s);var c=Dd.dot(Td),u=Pd.dot(Td);if(c>=0&&u<=c)return e.copy(s);var p=r*u-c*l;if(p<=0&&r>=0&&c<=0)return i=r/(r-c),e.copy(o).addScaledVector(Dd,i);Nd.subVectors(t,a);var h=Dd.dot(Nd),d=Pd.dot(Nd);if(d>=0&&h<=d)return e.copy(a);var m=h*l-r*d;if(m<=0&&l>=0&&d<=0)return n=l/(l-d),e.copy(o).addScaledVector(Pd,n);var f=c*d-h*u;if(f<=0&&u-c>=0&&h-d>=0)return Od.subVectors(a,s),n=(u-c)/(u-c+(h-d)),e.copy(s).addScaledVector(Od,n);var v=1/(f+m+p);return i=m*v,n=p*v,e.copy(o).addScaledVector(Dd,i).addScaledVector(Pd,n)}},{key:"equals",value:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}],[{key:"getNormal",value:function(t,e,i,n){n.subVectors(i,e),_d.subVectors(t,e),n.cross(_d);var o=n.lengthSq();return o>0?n.multiplyScalar(1/Math.sqrt(o)):n.set(0,0,0)}},{key:"getBarycoord",value:function(t,e,i,n,o){_d.subVectors(n,e),xd.subVectors(i,e),Ed.subVectors(t,e);var s=_d.dot(_d),a=_d.dot(xd),r=_d.dot(Ed),l=xd.dot(xd),c=xd.dot(Ed),u=s*l-a*a;if(0===u)return o.set(0,0,0),null;var p=1/u,h=(l*r-a*c)*p,d=(s*c-a*r)*p;return o.set(1-h-d,d,h)}},{key:"containsPoint",value:function(t,e,i,n){return null!==this.getBarycoord(t,e,i,n,Sd)&&Sd.x>=0&&Sd.y>=0&&Sd.x+Sd.y<=1}},{key:"getInterpolation",value:function(t,e,i,n,o,s,a,r){return null===this.getBarycoord(t,e,i,n,Sd)?(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,Sd.x),r.addScaledVector(s,Sd.y),r.addScaledVector(a,Sd.z),r)}},{key:"isFrontFacing",value:function(t,e,i,n){return _d.subVectors(i,e),xd.subVectors(t,e),_d.cross(xd).dot(n)<0}}])}(),Ad={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},Ld={h:0,s:0,l:0},jd={h:0,s:0,l:0};function Id(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}var Rd=function(){return k()((function t(e,i,n){return C()(this,t),this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,i,n)}),[{key:"set",value:function(t,e,i){if(void 0===e&&void 0===i){var n=t;n&&n.isColor?this.copy(n):"number"==typeof n?this.setHex(n):"string"==typeof n&&this.setStyle(n)}else this.setRGB(t,e,i);return this}},{key:"setScalar",value:function(t){return this.r=t,this.g=t,this.b=t,this}},{key:"setHex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pp;return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,ah.toWorkingColorSpace(this,e),this}},{key:"setRGB",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ah.workingColorSpace;return this.r=t,this.g=e,this.b=i,ah.toWorkingColorSpace(this,n),this}},{key:"setHSL",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ah.workingColorSpace;if(t=Up(t,1),e=Gp(e,0,1),i=Gp(i,0,1),0===e)this.r=this.g=this.b=i;else{var o=i<=.5?i*(1+e):i+e-i*e,s=2*i-o;this.r=Id(s,o,t+1/3),this.g=Id(s,o,t),this.b=Id(s,o,t-1/3)}return ah.toWorkingColorSpace(this,n),this}},{key:"setStyle",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pp;function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}if(e=/^(\w+)\(([^\)]*)\)/.exec(t)){var o,s=e[1],a=e[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 "+t)}}else if(e=/^\#([A-Fa-f\d]+)$/.exec(t)){var r=e[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 "+t)}else if(t&&t.length>0)return this.setColorName(t,i);return this}},{key:"setColorName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pp,i=Ad[t.toLowerCase()];return void 0!==i?this.setHex(i,e):console.warn("THREE.Color: Unknown color "+t),this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b)}},{key:"copy",value:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}},{key:"copySRGBToLinear",value:function(t){return this.r=rh(t.r),this.g=rh(t.g),this.b=rh(t.b),this}},{key:"copyLinearToSRGB",value:function(t){return this.r=lh(t.r),this.g=lh(t.g),this.b=lh(t.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 t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pp;return ah.fromWorkingColorSpace(zd.copy(this),t),65536*Math.round(Gp(255*zd.r,0,255))+256*Math.round(Gp(255*zd.g,0,255))+Math.round(Gp(255*zd.b,0,255))}},{key:"getHexString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pp;return("000000"+this.getHex(t).toString(16)).slice(-6)}},{key:"getHSL",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ah.workingColorSpace;ah.fromWorkingColorSpace(zd.copy(this),e);var i,n,o=zd.r,s=zd.g,a=zd.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+(s1&&void 0!==arguments[1]?arguments[1]:ah.workingColorSpace;return ah.fromWorkingColorSpace(zd.copy(this),e),t.r=zd.r,t.g=zd.g,t.b=zd.b,t}},{key:"getStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pp;ah.fromWorkingColorSpace(zd.copy(this),t);var e=zd.r,i=zd.g,n=zd.b;return t!==Pp?"color(".concat(t," ").concat(e.toFixed(3)," ").concat(i.toFixed(3)," ").concat(n.toFixed(3),")"):"rgb(".concat(Math.round(255*e),",").concat(Math.round(255*i),",").concat(Math.round(255*n),")")}},{key:"offsetHSL",value:function(t,e,i){return this.getHSL(Ld),this.setHSL(Ld.h+t,Ld.s+e,Ld.l+i)}},{key:"add",value:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}},{key:"addColors",value:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}},{key:"addScalar",value:function(t){return this.r+=t,this.g+=t,this.b+=t,this}},{key:"sub",value:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}},{key:"multiply",value:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}},{key:"multiplyScalar",value:function(t){return this.r*=t,this.g*=t,this.b*=t,this}},{key:"lerp",value:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}},{key:"lerpColors",value:function(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}},{key:"lerpHSL",value:function(t,e){this.getHSL(Ld),t.getHSL(jd);var i=Wp(Ld.h,jd.h,e),n=Wp(Ld.s,jd.s,e),o=Wp(Ld.l,jd.l,e);return this.setHSL(i,n,o),this}},{key:"setFromVector3",value:function(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}},{key:"applyMatrix3",value:function(t){var e=this.r,i=this.g,n=this.b,o=t.elements;return this.r=o[0]*e+o[3]*i+o[6]*n,this.g=o[1]*e+o[4]*i+o[7]*n,this.b=o[2]*e+o[5]*i+o[8]*n,this}},{key:"equals",value:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}},{key:"fromBufferAttribute",value:function(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}},{key:"toJSON",value:function(){return this.getHex()}},{key:Symbol.iterator,value:l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.r;case 2:return t.next=4,this.g;case 4:return t.next=6,this.b;case 6:case"end":return t.stop()}}),t,this)}))}])}(),zd=new Rd;Rd.NAMES=Ad;var Fd=0,Vd=function(t){function e(){var t;return C()(this,e),(t=kp(this,e)).isMaterial=!0,Object.defineProperty(Cp()(t),"id",{value:Fd++}),t.uuid=Hp(),t.name="",t.type="Material",t.blending=1,t.side=0,t.vertexColors=!1,t.opacity=1,t.transparent=!1,t.alphaHash=!1,t.blendSrc=204,t.blendDst=205,t.blendEquation=100,t.blendSrcAlpha=null,t.blendDstAlpha=null,t.blendEquationAlpha=null,t.blendColor=new Rd(0,0,0),t.blendAlpha=0,t.depthFunc=3,t.depthTest=!0,t.depthWrite=!0,t.stencilWriteMask=255,t.stencilFunc=519,t.stencilRef=0,t.stencilFuncMask=255,t.stencilFail=Lp,t.stencilZFail=Lp,t.stencilZPass=Lp,t.stencilWrite=!1,t.clippingPlanes=null,t.clipIntersection=!1,t.clipShadows=!1,t.shadowSide=null,t.colorWrite=!0,t.precision=null,t.polygonOffset=!1,t.polygonOffsetFactor=0,t.polygonOffsetUnits=0,t.dithering=!1,t.alphaToCoverage=!1,t.premultipliedAlpha=!1,t.forceSinglePass=!1,t.visible=!0,t.toneMapped=!0,t.userData={},t.version=0,t._alphaTest=0,t}return gi()(e,t),k()(e,[{key:"alphaTest",get:function(){return this._alphaTest},set:function(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}},{key:"onBuild",value:function(){}},{key:"onBeforeRender",value:function(){}},{key:"onBeforeCompile",value:function(){}},{key:"customProgramCacheKey",value:function(){return this.onBeforeCompile.toString()}},{key:"setValues",value:function(t){if(void 0!==t)for(var e in t){var i=t[e];if(void 0!==i){var n=this[e];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i:console.warn("THREE.Material: '".concat(e,"' is not a property of THREE.").concat(this.type,"."))}else console.warn("THREE.Material: parameter '".concat(e,"' has value of undefined."))}}},{key:"toJSON",value:function(t){var e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});var i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function n(t){var e=[];for(var i in t){var n=t[i];delete n.metadata,e.push(n)}return e}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(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).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(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).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(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).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(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).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!==Lp&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Lp&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Lp&&(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),e){var o=n(t.textures),s=n(t.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(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var e=t.clippingPlanes,i=null;if(null!==e){var n=e.length;i=new Array(n);for(var o=0;o!==n;++o)i[o]=e[o].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"needsUpdate",set:function(t){!0===t&&this.version++}}])}(zp),Hd=function(t){function e(t){var i;return C()(this,e),(i=kp(this,e)).isMeshBasicMaterial=!0,i.type="MeshBasicMaterial",i.color=new Rd(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 sd,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(t),i}return gi()(e,t),k()(e,[{key:"copy",value:function(t){return wp(e,"copy",this,3)([t]),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}])}(Vd);!function(){for(var t=new ArrayBuffer(4),e=new Float32Array(t),i=new Uint32Array(t),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 p=u<<13,h=0;0==(8388608&p);)p<<=1,h-=8388608;p&=-8388609,h+=947912704,r[u]=p|h}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 Gd=new bh,Ud=new qp,Wd=function(){return k()((function t(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(C()(this,t),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=i,this.count=void 0!==e?e.length/i:0,this.normalized=n,this.usage=jp,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=1015,this.version=0}),[{key:"onUploadCallback",value:function(){}},{key:"needsUpdate",set:function(t){!0===t&&this.version++}},{key:"updateRange",get:function(){return th("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}},{key:"setUsage",value:function(t){return this.usage=t,this}},{key:"addUpdateRange",value:function(t,e){this.updateRanges.push({start:t,count:e})}},{key:"clearUpdateRanges",value:function(){this.updateRanges.length=0}},{key:"copy",value:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}},{key:"copyAt",value:function(t,e,i){t*=this.itemSize,i*=e.itemSize;for(var n=0,o=this.itemSize;n1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(t,e),this}},{key:"getComponent",value:function(t,e){var i=this.array[t*this.itemSize+e];return this.normalized&&(i=Yp(i,this.array)),i}},{key:"setComponent",value:function(t,e,i){return this.normalized&&(i=Jp(i,this.array)),this.array[t*this.itemSize+e]=i,this}},{key:"getX",value:function(t){var e=this.array[t*this.itemSize];return this.normalized&&(e=Yp(e,this.array)),e}},{key:"setX",value:function(t,e){return this.normalized&&(e=Jp(e,this.array)),this.array[t*this.itemSize]=e,this}},{key:"getY",value:function(t){var e=this.array[t*this.itemSize+1];return this.normalized&&(e=Yp(e,this.array)),e}},{key:"setY",value:function(t,e){return this.normalized&&(e=Jp(e,this.array)),this.array[t*this.itemSize+1]=e,this}},{key:"getZ",value:function(t){var e=this.array[t*this.itemSize+2];return this.normalized&&(e=Yp(e,this.array)),e}},{key:"setZ",value:function(t,e){return this.normalized&&(e=Jp(e,this.array)),this.array[t*this.itemSize+2]=e,this}},{key:"getW",value:function(t){var e=this.array[t*this.itemSize+3];return this.normalized&&(e=Yp(e,this.array)),e}},{key:"setW",value:function(t,e){return this.normalized&&(e=Jp(e,this.array)),this.array[t*this.itemSize+3]=e,this}},{key:"setXY",value:function(t,e,i){return t*=this.itemSize,this.normalized&&(e=Jp(e,this.array),i=Jp(i,this.array)),this.array[t+0]=e,this.array[t+1]=i,this}},{key:"setXYZ",value:function(t,e,i,n){return t*=this.itemSize,this.normalized&&(e=Jp(e,this.array),i=Jp(i,this.array),n=Jp(n,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this}},{key:"setXYZW",value:function(t,e,i,n,o){return t*=this.itemSize,this.normalized&&(e=Jp(e,this.array),i=Jp(i,this.array),n=Jp(n,this.array),o=Jp(o,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this.array[t+3]=o,this}},{key:"onUpload",value:function(t){return this.onUploadCallback=t,this}},{key:"clone",value:function(){return new this.constructor(this.array,this.itemSize).copy(this)}},{key:"toJSON",value:function(){var t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==jp&&(t.usage=this.usage),t}}])}(),Yd=function(t){function e(t,i,n){return C()(this,e),kp(this,e,[new Uint16Array(t),i,n])}return gi()(e,t),k()(e)}(Wd),Jd=function(t){function e(t,i,n){return C()(this,e),kp(this,e,[new Uint32Array(t),i,n])}return gi()(e,t),k()(e)}(Wd),qd=function(t){function e(t,i,n){return C()(this,e),kp(this,e,[new Float32Array(t),i,n])}return gi()(e,t),k()(e)}(Wd),Xd=0,Zd=new Xh,Kd=new kd,$d=new bh,Qd=new kh,tm=new kh,em=new bh,im=function(t){function e(){var t;return C()(this,e),(t=kp(this,e)).isBufferGeometry=!0,Object.defineProperty(Cp()(t),"id",{value:Xd++}),t.uuid=Hp(),t.name="",t.type="BufferGeometry",t.index=null,t.attributes={},t.morphAttributes={},t.morphTargetsRelative=!1,t.groups=[],t.boundingBox=null,t.boundingSphere=null,t.drawRange={start:0,count:1/0},t.userData={},t}return gi()(e,t),k()(e,[{key:"getIndex",value:function(){return this.index}},{key:"setIndex",value:function(t){return Array.isArray(t)?this.index=new(Kp(t)?Jd:Yd)(t,1):this.index=t,this}},{key:"getAttribute",value:function(t){return this.attributes[t]}},{key:"setAttribute",value:function(t,e){return this.attributes[t]=e,this}},{key:"deleteAttribute",value:function(t){return delete this.attributes[t],this}},{key:"hasAttribute",value:function(t){return void 0!==this.attributes[t]}},{key:"addGroup",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:t,count:e,materialIndex:i})}},{key:"clearGroups",value:function(){this.groups=[]}},{key:"setDrawRange",value:function(t,e){this.drawRange.start=t,this.drawRange.count=e}},{key:"applyMatrix4",value:function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);var i=this.attributes.normal;if(void 0!==i){var n=(new Xp).getNormalMatrix(t);i.applyNormalMatrix(n),i.needsUpdate=!0}var o=this.attributes.tangent;return void 0!==o&&(o.transformDirection(t),o.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"applyQuaternion",value:function(t){return Zd.makeRotationFromQuaternion(t),this.applyMatrix4(Zd),this}},{key:"rotateX",value:function(t){return Zd.makeRotationX(t),this.applyMatrix4(Zd),this}},{key:"rotateY",value:function(t){return Zd.makeRotationY(t),this.applyMatrix4(Zd),this}},{key:"rotateZ",value:function(t){return Zd.makeRotationZ(t),this.applyMatrix4(Zd),this}},{key:"translate",value:function(t,e,i){return Zd.makeTranslation(t,e,i),this.applyMatrix4(Zd),this}},{key:"scale",value:function(t,e,i){return Zd.makeScale(t,e,i),this.applyMatrix4(Zd),this}},{key:"lookAt",value:function(t){return Kd.lookAt(t),Kd.updateMatrix(),this.applyMatrix4(Kd.matrix),this}},{key:"center",value:function(){return this.computeBoundingBox(),this.boundingBox.getCenter($d).negate(),this.translate($d.x,$d.y,$d.z),this}},{key:"setFromPoints",value:function(t){for(var e=[],i=0,n=t.length;i0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};var n=this.index;null!==n&&(t.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];t.data.attributes[s]=a.toJSON(t.data)}var r={},l=!1;for(var c in this.morphAttributes){for(var u=this.morphAttributes[c],p=[],h=0,d=u.length;h0&&(r[c]=p,l=!0)}l&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);var f=this.groups;f.length>0&&(t.data.groups=JSON.parse(JSON.stringify(f)));var v=this.boundingSphere;return null!==v&&(t.data.boundingSphere={center:v.center.toArray(),radius:v.radius}),t}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var e={};this.name=t.name;var i=t.index;null!==i&&this.setIndex(i.clone(e));var n=t.attributes;for(var o in n){var s=n[o];this.setAttribute(o,s.clone(e))}var a=t.morphAttributes;for(var r in a){for(var l=[],c=a[r],u=0,p=c.length;u0&&void 0!==arguments[0]?arguments[0]:new im,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Hd;return C()(this,e),(t=kp(this,e)).isMesh=!0,t.type="Mesh",t.geometry=i,t.material=n,t.updateMorphTargets(),t}return gi()(e,t),k()(e,[{key:"copy",value:function(t,i){return wp(e,"copy",this,3)([t,i]),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}},{key:"updateMorphTargets",value:function(){var t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){var i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var n=0,o=i.length;nMath.pow(t.far-t.near,2))return}nm.copy(o).invert(),om.copy(t.ray).applyMatrix4(nm),null!==i.boundingBox&&!1===om.intersectsBox(i.boundingBox)||this._computeIntersections(t,e,om)}}},{key:"_computeIntersections",value:function(t,e,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,p=o.groups,h=o.drawRange;if(null!==a)if(Array.isArray(s))for(var d=0,m=p.length;di.far?null:{distance:l,point:bm.clone(),object:t}}(t,e,i,n,rm,lm,cm,ym);if(u){o&&(hm.fromBufferAttribute(o,r),dm.fromBufferAttribute(o,l),mm.fromBufferAttribute(o,c),u.uv=Bd.getInterpolation(ym,rm,lm,cm,hm,dm,mm,new qp)),s&&(hm.fromBufferAttribute(s,r),dm.fromBufferAttribute(s,l),mm.fromBufferAttribute(s,c),u.uv1=Bd.getInterpolation(ym,rm,lm,cm,hm,dm,mm,new qp)),a&&(fm.fromBufferAttribute(a,r),vm.fromBufferAttribute(a,l),gm.fromBufferAttribute(a,c),u.normal=Bd.getInterpolation(ym,rm,lm,cm,fm,vm,gm,new bh),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));var p={a:r,b:l,c:c,normal:new bh,materialIndex:0};Bd.getNormal(rm,lm,cm,p.normal),u.face=p}return u}var km=function(t){function e(){var t,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;C()(this,e),(t=kp(this,e)).type="BoxGeometry",t.parameters={width:i,height:n,depth:o,widthSegments:s,heightSegments:a,depthSegments:r};var l=t;s=Math.floor(s),a=Math.floor(a),r=Math.floor(r);var c=[],u=[],p=[],h=[],d=0,m=0;function f(t,e,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,D=new bh,P=0;P0?1:-1,p.push(D.x,D.y,D.z),h.push(M/f),h.push(1-P/v),E+=1}for(var N=0;N0&&void 0!==arguments[0]?arguments[0]:new bh(1,0,0),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;C()(this,t),this.isPlane=!0,this.normal=e,this.constant=i}),[{key:"set",value:function(t,e){return this.normal.copy(t),this.constant=e,this}},{key:"setComponents",value:function(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this}},{key:"setFromNormalAndCoplanarPoint",value:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(t,e,i){var n=Dm.subVectors(i,e).cross(Pm.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this}},{key:"copy",value:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this}},{key:"normalize",value:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(t){return this.normal.dot(t)+this.constant}},{key:"distanceToSphere",value:function(t){return this.distanceToPoint(t.center)-t.radius}},{key:"projectPoint",value:function(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}},{key:"intersectLine",value:function(t,e){var i=t.delta(Dm),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;var o=-(t.start.dot(this.normal)+this.constant)/n;return o<0||o>1?null:e.copy(t.start).addScaledVector(i,o)}},{key:"intersectsLine",value:function(t){var e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}},{key:"intersectsBox",value:function(t){return t.intersectsPlane(this)}},{key:"intersectsSphere",value:function(t){return t.intersectsPlane(this)}},{key:"coplanarPoint",value:function(t){return t.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(t,e){var i=e||Om.getNormalMatrix(t),n=this.coplanarPoint(Dm).applyMatrix4(t),o=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(o),this}},{key:"translate",value:function(t){return this.constant-=t.dot(this.normal),this}},{key:"equals",value:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),Tm=new Fh,Nm=new bh,Bm=function(){return k()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Mm,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Mm,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Mm,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Mm,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Mm,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new Mm;C()(this,t),this.planes=[e,i,n,o,s,a]}),[{key:"set",value:function(t,e,i,n,o,s){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(i),a[3].copy(n),a[4].copy(o),a[5].copy(s),this}},{key:"copy",value:function(t){for(var e=this.planes,i=0;i<6;i++)e[i].copy(t.planes[i]);return this}},{key:"setFromProjectionMatrix",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=this.planes,n=t.elements,o=n[0],s=n[1],a=n[2],r=n[3],l=n[4],c=n[5],u=n[6],p=n[7],h=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,p-l,f-h,b-v).normalize(),i[1].setComponents(r+o,p+l,f+h,b+v).normalize(),i[2].setComponents(r+s,p+c,f+d,b+g).normalize(),i[3].setComponents(r-s,p-c,f-d,b-g).normalize(),i[4].setComponents(r-a,p-u,f-m,b-y).normalize(),e===Ip)i[5].setComponents(r+a,p+u,f+m,b+y).normalize();else{if(e!==Rp)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);i[5].setComponents(a,u,m,y).normalize()}return this}},{key:"intersectsObject",value:function(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),Tm.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{var e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),Tm.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Tm)}},{key:"intersectsSprite",value:function(t){return Tm.center.set(0,0,0),Tm.radius=.7071067811865476,Tm.applyMatrix4(t.matrixWorld),this.intersectsSphere(Tm)}},{key:"intersectsSphere",value:function(t){for(var e=this.planes,i=t.center,n=-t.radius,o=0;o<6;o++)if(e[o].distanceToPoint(i)0?t.max.x:t.min.x,Nm.y=n.normal.y>0?t.max.y:t.min.y,Nm.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(Nm)<0)return!1}return!0}},{key:"containsPoint",value:function(t){for(var e=this.planes,i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}();var Am=function(t){function e(){var t,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;C()(this,e),(t=kp(this,e)).type="PlaneGeometry",t.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,p=c+1,h=i/l,d=n/c,m=[],f=[],v=[],g=[],y=0;y 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 \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \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 \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 \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \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 \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},jm={common:{diffuse:{value:new Rd(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Xp},alphaMap:{value:null},alphaMapTransform:{value:new Xp},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Xp}},envmap:{envMap:{value:null},envMapRotation:{value:new Xp},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Xp}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Xp}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Xp},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Xp},normalScale:{value:new qp(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Xp},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Xp}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Xp}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Xp}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Rd(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 Rd(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Xp},alphaTest:{value:0},uvTransform:{value:new Xp}},sprite:{diffuse:{value:new Rd(16777215)},opacity:{value:1},center:{value:new qp(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Xp},alphaMap:{value:null},alphaMapTransform:{value:new Xp},alphaTest:{value:0}}},Im={basic:{uniforms:xm([jm.common,jm.specularmap,jm.envmap,jm.aomap,jm.lightmap,jm.fog]),vertexShader:Lm.meshbasic_vert,fragmentShader:Lm.meshbasic_frag},lambert:{uniforms:xm([jm.common,jm.specularmap,jm.envmap,jm.aomap,jm.lightmap,jm.emissivemap,jm.bumpmap,jm.normalmap,jm.displacementmap,jm.fog,jm.lights,{emissive:{value:new Rd(0)}}]),vertexShader:Lm.meshlambert_vert,fragmentShader:Lm.meshlambert_frag},phong:{uniforms:xm([jm.common,jm.specularmap,jm.envmap,jm.aomap,jm.lightmap,jm.emissivemap,jm.bumpmap,jm.normalmap,jm.displacementmap,jm.fog,jm.lights,{emissive:{value:new Rd(0)},specular:{value:new Rd(1118481)},shininess:{value:30}}]),vertexShader:Lm.meshphong_vert,fragmentShader:Lm.meshphong_frag},standard:{uniforms:xm([jm.common,jm.envmap,jm.aomap,jm.lightmap,jm.emissivemap,jm.bumpmap,jm.normalmap,jm.displacementmap,jm.roughnessmap,jm.metalnessmap,jm.fog,jm.lights,{emissive:{value:new Rd(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Lm.meshphysical_vert,fragmentShader:Lm.meshphysical_frag},toon:{uniforms:xm([jm.common,jm.aomap,jm.lightmap,jm.emissivemap,jm.bumpmap,jm.normalmap,jm.displacementmap,jm.gradientmap,jm.fog,jm.lights,{emissive:{value:new Rd(0)}}]),vertexShader:Lm.meshtoon_vert,fragmentShader:Lm.meshtoon_frag},matcap:{uniforms:xm([jm.common,jm.bumpmap,jm.normalmap,jm.displacementmap,jm.fog,{matcap:{value:null}}]),vertexShader:Lm.meshmatcap_vert,fragmentShader:Lm.meshmatcap_frag},points:{uniforms:xm([jm.points,jm.fog]),vertexShader:Lm.points_vert,fragmentShader:Lm.points_frag},dashed:{uniforms:xm([jm.common,jm.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Lm.linedashed_vert,fragmentShader:Lm.linedashed_frag},depth:{uniforms:xm([jm.common,jm.displacementmap]),vertexShader:Lm.depth_vert,fragmentShader:Lm.depth_frag},normal:{uniforms:xm([jm.common,jm.bumpmap,jm.normalmap,jm.displacementmap,{opacity:{value:1}}]),vertexShader:Lm.meshnormal_vert,fragmentShader:Lm.meshnormal_frag},sprite:{uniforms:xm([jm.sprite,jm.fog]),vertexShader:Lm.sprite_vert,fragmentShader:Lm.sprite_frag},background:{uniforms:{uvTransform:{value:new Xp},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Lm.background_vert,fragmentShader:Lm.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Xp}},vertexShader:Lm.backgroundCube_vert,fragmentShader:Lm.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Lm.cube_vert,fragmentShader:Lm.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Lm.equirect_vert,fragmentShader:Lm.equirect_frag},distanceRGBA:{uniforms:xm([jm.common,jm.displacementmap,{referencePosition:{value:new bh},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Lm.distanceRGBA_vert,fragmentShader:Lm.distanceRGBA_frag},shadow:{uniforms:xm([jm.lights,jm.fog,{color:{value:new Rd(0)},opacity:{value:1}}]),vertexShader:Lm.shadow_vert,fragmentShader:Lm.shadow_frag}};Im.physical={uniforms:xm([Im.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Xp},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Xp},clearcoatNormalScale:{value:new qp(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Xp},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Xp},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Xp},sheen:{value:0},sheenColor:{value:new Rd(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Xp},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Xp},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Xp},transmissionSamplerSize:{value:new qp},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Xp},attenuationDistance:{value:0},attenuationColor:{value:new Rd(0)},specularColor:{value:new Rd(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Xp},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Xp},anisotropyVector:{value:new qp},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Xp}}]),vertexShader:Lm.meshphysical_vert,fragmentShader:Lm.meshphysical_frag};new sd,new Xh;var Rm=function(t){function e(){var t,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 C()(this,e),(t=kp(this,e)).isOrthographicCamera=!0,t.type="OrthographicCamera",t.zoom=1,t.view=null,t.left=i,t.right=n,t.top=o,t.bottom=s,t.near=a,t.far=r,t.updateProjectionMatrix(),t}return gi()(e,t),k()(e,[{key:"copy",value:function(t,i){return wp(e,"copy",this,3)([t,i]),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}},{key:"setViewOffset",value:function(t,e,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=t,this.view.fullHeight=e,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 t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,o=i-t,s=i+t,a=n+e,r=n-e;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(t){var i=wp(e,"toJSON",this,3)([t]);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}}])}(Em),zm=(new Rm,new Rd,(1+Math.sqrt(5))/2),Fm=1/zm;new bh(-zm,Fm,0),new bh(zm,Fm,0),new bh(-Fm,0,zm),new bh(Fm,0,zm),new bh(0,zm,-Fm),new bh(0,zm,Fm),new bh(-1,1,-1),new bh(1,1,-1),new bh(-1,1,1),new bh(1,1,1);var Vm=function(t){function e(t,i,n,o,s,a,r,l,c,u){var p;if(C()(this,e),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=_p),void 0===n&&1027===u&&(n=Ep),(p=kp(this,e,[null,o,s,a,r,l,u,n,c])).isDepthTexture=!0,p.image={width:t,height:i},p.magFilter=void 0!==r?r:1003,p.minFilter=void 0!==l?l:1003,p.flipY=!1,p.generateMipmaps=!1,p.compareFunction=null,p}return gi()(e,t),k()(e,[{key:"copy",value:function(t){return wp(e,"copy",this,3)([t]),this.compareFunction=t.compareFunction,this}},{key:"toJSON",value:function(t){var i=wp(e,"toJSON",this,3)([t]);return null!==this.compareFunction&&(i.compareFunction=this.compareFunction),i}}])}(mh),Hm=(new mh,new Vm(1,1));Hm.compareFunction=515;new vh,new gh,new Sm,new Float32Array(16),new Float32Array(9),new Float32Array(4);new Map;new sd,new Xh;new bh,new bh,new bh,new bh,new qp,new qp,new Xh,new bh,new bh,new bh,new qp,new qp,new qp;new bh,new bh,new bh,new fh,new fh,new bh,new Xh,new bh,new Fh,new Xh,new qh,new Xh,new Xh,new Xh,new Xh,new kh,new Xh,new Cm,new Fh;var Gm=function(){return k()((function t(){C()(this,t),this.index=0,this.pool=[],this.list=[]}),[{key:"push",value:function(t,e){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=t.start,o.count=t.count,o.z=e}},{key:"reset",value:function(){this.list.length=0,this.index=0}}])}();new Xh,new Xh,new Xh,new Xh,new Bm,new kh,new Fh,new bh,new Gm,new Cm;new bh,new bh,new Xh,new qh,new Fh,new bh,new bh;new bh,new bh,new Xh,new qh,new Fh,new bh;var Um=function(){return k()((function t(){C()(this,t),this.type="Curve",this.arcLengthDivisions=200}),[{key:"getPoint",value:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}},{key:"getPointAt",value:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)}},{key:"getPoints",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}},{key:"getSpacedPoints",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,e=[],i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}},{key:"getLength",value:function(){var t=this.getLengths();return t[t.length-1]}},{key:"getLengths",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0),o=0;i.push(0);for(var s=1;s<=t;s++)o+=(e=this.getPoint(s/t)).distanceTo(n),i.push(o),n=e;return this.cacheArcLengths=i,i}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.getLengths()}},{key:"getUtoTmapping",value:function(t,e){var i,n=this.getLengths(),o=0,s=n.length;i=e||t*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(t,e){var i=1e-4,n=t-i,o=t+i;n<0&&(n=0),o>1&&(o=1);var s=this.getPoint(n),a=this.getPoint(o),r=e||(s.isVector2?new qp:new bh);return r.copy(a).sub(s).normalize(),r}},{key:"getTangentAt",value:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)}},{key:"computeFrenetFrames",value:function(t,e){for(var i=new bh,n=[],o=[],s=[],a=new bh,r=new Xh,l=0;l<=t;l++){var c=l/t;n[l]=this.getTangentAt(c,new bh)}o[0]=new bh,s[0]=new bh;var u=Number.MAX_VALUE,p=Math.abs(n[0].x),h=Math.abs(n[0].y),d=Math.abs(n[0].z);p<=u&&(u=p,i.set(1,0,0)),h<=u&&(u=h,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<=t;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(Gp(n[m-1].dot(n[m]),-1,1));o[m].applyMatrix4(r.makeRotationAxis(a,f))}s[m].crossVectors(n[m],o[m])}if(!0===e){var v=Math.acos(Gp(o[0].dot(o[t]),-1,1));v/=t,n[0].dot(a.crossVectors(o[0],o[t]))>0&&(v=-v);for(var g=1;g<=t;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(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}},{key:"toJSON",value:function(){var t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}},{key:"fromJSON",value:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}])}(),Wm=function(t){function e(){var t,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 C()(this,e),(t=kp(this,e)).isEllipseCurve=!0,t.type="EllipseCurve",t.aX=i,t.aY=n,t.xRadius=o,t.yRadius=s,t.aStartAngle=a,t.aEndAngle=r,t.aClockwise=l,t.aRotation=c,t}return gi()(e,t),k()(e,[{key:"getPoint",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new qp,i=e,n=2*Math.PI,o=this.aEndAngle-this.aStartAngle,s=Math.abs(o)n;)o-=n;o0&&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 C()(this,e),(t=kp(this,e)).isCatmullRomCurve3=!0,t.type="CatmullRomCurve3",t.points=i,t.closed=n,t.curveType=o,t.tension=s,t}return gi()(e,t),k()(e,[{key:"getPoint",value:function(t){var e,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bh,o=n,s=this.points,a=s.length,r=(a-(this.closed?0:1))*t,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?e=s[(l-1)%a]:(qm.subVectors(s[0],s[1]).add(s[0]),e=qm);var u=s[l%a],p=s[(l+1)%a];if(this.closed||l+20&&void 0!==arguments[0]?arguments[0]:new qp,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new qp,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new qp,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new qp;return C()(this,e),(t=kp(this,e)).isCubicBezierCurve=!0,t.type="CubicBezierCurve",t.v0=i,t.v1=n,t.v2=o,t.v3=s,t}return gi()(e,t),k()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new qp,i=e,n=this.v0,o=this.v1,s=this.v2,a=this.v3;return i.set(ef(t,n.x,o.x,s.x,a.x),ef(t,n.y,o.y,s.y,a.y)),i}},{key:"copy",value:function(t){return wp(e,"copy",this,3)([t]),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}},{key:"toJSON",value:function(){var t=wp(e,"toJSON",this,3)([]);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}},{key:"fromJSON",value:function(t){return wp(e,"fromJSON",this,3)([t]),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}])}(Um),of=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new bh,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bh,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new bh,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new bh;return C()(this,e),(t=kp(this,e)).isCubicBezierCurve3=!0,t.type="CubicBezierCurve3",t.v0=i,t.v1=n,t.v2=o,t.v3=s,t}return gi()(e,t),k()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bh,i=e,n=this.v0,o=this.v1,s=this.v2,a=this.v3;return i.set(ef(t,n.x,o.x,s.x,a.x),ef(t,n.y,o.y,s.y,a.y),ef(t,n.z,o.z,s.z,a.z)),i}},{key:"copy",value:function(t){return wp(e,"copy",this,3)([t]),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}},{key:"toJSON",value:function(){var t=wp(e,"toJSON",this,3)([]);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}},{key:"fromJSON",value:function(t){return wp(e,"fromJSON",this,3)([t]),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}])}(Um),sf=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new qp,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new qp;return C()(this,e),(t=kp(this,e)).isLineCurve=!0,t.type="LineCurve",t.v1=i,t.v2=n,t}return gi()(e,t),k()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new qp,i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}},{key:"getPointAt",value:function(t,e){return this.getPoint(t,e)}},{key:"getTangent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new qp;return e.subVectors(this.v2,this.v1).normalize()}},{key:"getTangentAt",value:function(t,e){return this.getTangent(t,e)}},{key:"copy",value:function(t){return wp(e,"copy",this,3)([t]),this.v1.copy(t.v1),this.v2.copy(t.v2),this}},{key:"toJSON",value:function(){var t=wp(e,"toJSON",this,3)([]);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}},{key:"fromJSON",value:function(t){return wp(e,"fromJSON",this,3)([t]),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}])}(Um),af=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new bh,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bh;return C()(this,e),(t=kp(this,e)).isLineCurve3=!0,t.type="LineCurve3",t.v1=i,t.v2=n,t}return gi()(e,t),k()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bh,i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}},{key:"getPointAt",value:function(t,e){return this.getPoint(t,e)}},{key:"getTangent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bh;return e.subVectors(this.v2,this.v1).normalize()}},{key:"getTangentAt",value:function(t,e){return this.getTangent(t,e)}},{key:"copy",value:function(t){return wp(e,"copy",this,3)([t]),this.v1.copy(t.v1),this.v2.copy(t.v2),this}},{key:"toJSON",value:function(){var t=wp(e,"toJSON",this,3)([]);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}},{key:"fromJSON",value:function(t){return wp(e,"fromJSON",this,3)([t]),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}])}(Um),rf=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new qp,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new qp,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new qp;return C()(this,e),(t=kp(this,e)).isQuadraticBezierCurve=!0,t.type="QuadraticBezierCurve",t.v0=i,t.v1=n,t.v2=o,t}return gi()(e,t),k()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new qp,i=e,n=this.v0,o=this.v1,s=this.v2;return i.set(tf(t,n.x,o.x,s.x),tf(t,n.y,o.y,s.y)),i}},{key:"copy",value:function(t){return wp(e,"copy",this,3)([t]),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}},{key:"toJSON",value:function(){var t=wp(e,"toJSON",this,3)([]);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}},{key:"fromJSON",value:function(t){return wp(e,"fromJSON",this,3)([t]),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}])}(Um),lf=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new bh,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bh,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new bh;return C()(this,e),(t=kp(this,e)).isQuadraticBezierCurve3=!0,t.type="QuadraticBezierCurve3",t.v0=i,t.v1=n,t.v2=o,t}return gi()(e,t),k()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bh,i=e,n=this.v0,o=this.v1,s=this.v2;return i.set(tf(t,n.x,o.x,s.x),tf(t,n.y,o.y,s.y),tf(t,n.z,o.z,s.z)),i}},{key:"copy",value:function(t){return wp(e,"copy",this,3)([t]),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}},{key:"toJSON",value:function(){var t=wp(e,"toJSON",this,3)([]);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}},{key:"fromJSON",value:function(t){return wp(e,"fromJSON",this,3)([t]),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}])}(Um),cf=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return C()(this,e),(t=kp(this,e)).isSplineCurve=!0,t.type="SplineCurve",t.points=i,t}return gi()(e,t),k()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new qp,i=e,n=this.points,o=(n.length-1)*t,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(Qm(a,r.x,l.x,c.x,u.x),Qm(a,r.y,l.y,c.y,u.y)),i}},{key:"copy",value:function(t){wp(e,"copy",this,3)([t]),this.points=[];for(var i=0,n=t.points.length;i0){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(t){return wp(e,"copy",this,3)([t]),this.currentPoint.copy(t.currentPoint),this}},{key:"toJSON",value:function(){var t=wp(e,"toJSON",this,3)([]);return t.currentPoint=this.currentPoint.toArray(),t}},{key:"fromJSON",value:function(t){return wp(e,"fromJSON",this,3)([t]),this.currentPoint.fromArray(t.currentPoint),this}}])}(function(t){function e(){var t;return C()(this,e),(t=kp(this,e)).type="CurvePath",t.curves=[],t.autoClose=!1,t}return gi()(e,t),k()(e,[{key:"add",value:function(t){this.curves.push(t)}},{key:"closePath",value:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){var i=!0===t.isVector2?"LineCurve":"LineCurve3";this.curves.push(new uf[i](e,t))}return this}},{key:"getPoint",value:function(t,e){for(var i=t*this.getLength(),n=this.getCurveLengths(),o=0;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,e)}o++}return null}},{key:"getLength",value:function(){var t=this.getCurveLengths();return t[t.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 t=[],e=0,i=0,n=this.curves.length;i0&&void 0!==arguments[0]?arguments[0]:40,e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}},{key:"getPoints",value:function(){for(var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,i=[],n=0,o=this.curves;n1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}},{key:"copy",value:function(t){wp(e,"copy",this,3)([t]),this.curves=[];for(var i=0,n=t.curves.length;i0&&void 0!==arguments[0]?arguments[0]:[new qp(0,-.5),new qp(.5,0),new qp(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;C()(this,e),(t=kp(this,e)).type="LatheGeometry",t.parameters={points:i,segments:n,phiStart:o,phiLength:s},n=Math.floor(n),s=Gp(s,0,2*Math.PI);for(var a=[],r=[],l=[],c=[],u=[],p=1/n,h=new bh,d=new qp,m=new bh,f=new bh,v=new bh,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 w=0;w<=n;w++)for(var k=o+w*p*s,_=Math.sin(k),x=Math.cos(k),E=0;E<=i.length-1;E++){h.x=i[E].x*_,h.y=i[E].y,h.z=i[E].x*x,r.push(h.x,h.y,h.z),d.x=w/n,d.y=E/(i.length-1),l.push(d.x,d.y);var S=c[3*E+0]*_,D=c[3*E+1],P=c[3*E+0]*x;u.push(S,D,P)}for(var O=0;O0&&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;C()(this,e);var a=new pf;return a.absarc(0,-n/2,i,1.5*Math.PI,0),a.absarc(0,n/2,i,0,.5*Math.PI),(t=kp(this,e,[a.getPoints(o),s])).type="CapsuleGeometry",t.parameters={radius:i,length:n,capSegments:o,radialSegments:s},t}return gi()(e,t),k()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.length,t.capSegments,t.radialSegments)}}])}(hf),mf=function(t){function e(){var t,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;C()(this,e),(t=kp(this,e)).type="CircleGeometry",t.parameters={radius:i,segments:n,thetaStart:o,thetaLength:s},n=Math.max(3,n);var a=[],r=[],l=[],c=[],u=new bh,p=new qp;r.push(0,0,0),l.push(0,0,1),c.push(.5,.5);for(var h=0,d=3;h<=n;h++,d+=3){var m=o+h/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),p.x=(r[d]/i+1)/2,p.y=(r[d+1]/i+1)/2,c.push(p.x,p.y)}for(var f=1;f<=n;f++)a.push(f,f+1,0);return t.setIndex(a),t.setAttribute("position",new qd(r,3)),t.setAttribute("normal",new qd(l,3)),t.setAttribute("uv",new qd(c,2)),t}return gi()(e,t),k()(e,[{key:"copy",value:function(t){return wp(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.radius,t.segments,t.thetaStart,t.thetaLength)}}])}(im),ff=function(t){function e(){var t,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;C()(this,e),(t=kp(this,e)).type="CylinderGeometry",t.parameters={radiusTop:i,radiusBottom:n,height:o,radialSegments:s,heightSegments:a,openEnded:r,thetaStart:l,thetaLength:c};var u=t;s=Math.floor(s),a=Math.floor(a);var p=[],h=[],d=[],m=[],f=0,v=[],g=o/2,y=0;function b(t){for(var e=f,o=new qp,a=new bh,r=0,v=!0===t?i:n,b=!0===t?1:-1,C=1;C<=s;C++)h.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,h.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;S0&&b(!0),n>0&&b(!1)),t.setIndex(p),t.setAttribute("position",new qd(h,3)),t.setAttribute("normal",new qd(d,3)),t.setAttribute("uv",new qd(m,2)),t}return gi()(e,t),k()(e,[{key:"copy",value:function(t){return wp(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}])}(im),vf=function(t){function e(){var t,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 C()(this,e),(t=kp(this,e,[0,i,n,o,s,a,r,l])).type="ConeGeometry",t.parameters={radius:i,height:n,radialSegments:o,heightSegments:s,openEnded:a,thetaStart:r,thetaLength:l},t}return gi()(e,t),k()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}])}(ff),gf=function(t){function e(){var t,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;C()(this,e),(t=kp(this,e)).type="PolyhedronGeometry",t.parameters={vertices:i,indices:n,radius:o,detail:s};var a=[],r=[];function l(t,e,i,n){for(var o=n+1,s=[],a=0;a<=o;a++){s[a]=[];for(var r=t.clone().lerp(i,a/o),l=e.clone().lerp(i,a/o),u=o-a,p=0;p<=u;p++)s[a][p]=0===p&&a===o?r:r.clone().lerp(l,p/u)}for(var h=0;h.9&&s<.1&&(e<.2&&(r[t+0]+=1),i<.2&&(r[t+2]+=1),n<.2&&(r[t+4]+=1))}}()}(),t.setAttribute("position",new qd(a,3)),t.setAttribute("normal",new qd(a.slice(),3)),t.setAttribute("uv",new qd(r,2)),0===s?t.computeVertexNormals():t.normalizeNormals(),t}return gi()(e,t),k()(e,[{key:"copy",value:function(t){return wp(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.vertices,t.indices,t.radius,t.details)}}])}(im),yf=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;C()(this,e);var o=(1+Math.sqrt(5))/2,s=1/o;return(t=kp(this,e,[[-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",t.parameters={radius:i,detail:n},t}return gi()(e,t),k()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.detail)}}])}(gf),bf=new bh,Cf=new bh,wf=new bh,kf=new Bd,_f=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(C()(this,e),(t=kp(this,e)).type="EdgesGeometry",t.parameters={geometry:i,thresholdAngle:n},null!==i){for(var o=4,s=Math.pow(10,o),a=Math.cos(Vp*n),r=i.getIndex(),l=i.getAttribute("position"),c=r?r.count:l.count,u=[0,0,0],p=["a","b","c"],h=new Array(3),d={},m=[],f=0;f0)for(s=e;s=e;s-=n)a=Yf(s,t[s],t[s+1],a);return a&&Ff(a,a.next)&&(Jf(a),a=a.next),a}function Sf(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!Ff(n,n.next)&&0!==zf(n.prev,n,n.next))n=n.next;else{if(Jf(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function Df(t,e,i,n,o,s,a){if(t){!a&&s&&function(t,e,i,n){var o=t;do{0===o.z&&(o.z=Lf(o.x,o.y,e,i,n)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,function(t){var e,i,n,o,s,a,r,l,c=1;do{for(i=t,t=null,s=null,a=0;i;){for(a++,n=i,r=0,e=0;e0||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:t=o,o.prevZ=s,s=o;i=n}s.nextZ=null,c*=2}while(a>1)}(o)}(t,n,o,s);for(var r,l,c=t;t.prev!==t.next;)if(r=t.prev,l=t.next,s?Of(t,n,o,s):Pf(t))e.push(r.i/i|0),e.push(t.i/i|0),e.push(l.i/i|0),Jf(t),t=l.next,c=l.next;else if((t=l)===c){a?1===a?Df(t=Mf(Sf(t),e,i),e,i,n,o,s,2):2===a&&Tf(t,e,i,n,o,s):Df(Sf(t),e,i,n,o,s,1);break}}}function Pf(t){var e=t.prev,i=t,n=t.next;if(zf(e,i,n)>=0)return!1;for(var o=e.x,s=i.x,a=n.x,r=e.y,l=i.y,c=n.y,u=os?o>a?o:a:s>a?s:a,d=r>l?r>c?r:c:l>c?l:c,m=n.next;m!==e;){if(m.x>=u&&m.x<=h&&m.y>=p&&m.y<=d&&If(o,r,s,l,a,c,m.x,m.y)&&zf(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Of(t,e,i,n){var o=t.prev,s=t,a=t.next;if(zf(o,s,a)>=0)return!1;for(var r=o.x,l=s.x,c=a.x,u=o.y,p=s.y,h=a.y,d=rl?r>c?r:c:l>c?l:c,v=u>p?u>h?u:h:p>h?p:h,g=Lf(d,m,e,i,n),y=Lf(f,v,e,i,n),b=t.prevZ,C=t.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&&If(r,u,l,p,c,h,b.x,b.y)&&zf(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&&If(r,u,l,p,c,h,C.x,C.y)&&zf(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&&If(r,u,l,p,c,h,b.x,b.y)&&zf(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&&If(r,u,l,p,c,h,C.x,C.y)&&zf(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function Mf(t,e,i){var n=t;do{var o=n.prev,s=n.next.next;!Ff(o,s)&&Vf(o,n,n.next,s)&&Uf(o,s)&&Uf(s,o)&&(e.push(o.i/i|0),e.push(n.i/i|0),e.push(s.i/i|0),Jf(n),Jf(n.next),n=t=s),n=n.next}while(n!==t);return Sf(n)}function Tf(t,e,i,n,o,s){var a=t;do{for(var r=a.next.next;r!==a.prev;){if(a.i!==r.i&&Rf(a,r)){var l=Wf(a,r);return a=Sf(a,a.next),l=Sf(l,l.next),Df(a,e,i,n,o,s,0),void Df(l,e,i,n,o,s,0)}r=r.next}a=a.next}while(a!==t)}function Nf(t,e){return t.x-e.x}function Bf(t,e){var i=function(t,e){var i,n=e,o=-1/0,s=t.x,a=t.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.x&&n.x>=u&&s!==n.x&&If(ai.x||n.x===i.x&&Af(i,n)))&&(i=n,h=l)),n=n.next}while(n!==c);return i}(t,e);if(!i)return e;var n=Wf(i,t);return Sf(n,n.next),Sf(i,i.next)}function Af(t,e){return zf(t.prev,t,e.prev)<0&&zf(e.next,t,t.next)<0}function Lf(t,e,i,n,o){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*o|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function jf(t){var e=t,i=t;do{(e.x=(t-a)*(s-r)&&(t-a)*(n-r)>=(i-a)*(e-r)&&(i-a)*(s-r)>=(o-a)*(n-r)}function Rf(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Vf(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(Uf(t,e)&&Uf(e,t)&&function(t,e){var i=t,n=!1,o=(t.x+e.x)/2,s=(t.y+e.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!==t);return n}(t,e)&&(zf(t.prev,t,e.prev)||zf(t,e.prev,e))||Ff(t,e)&&zf(t.prev,t,t.next)>0&&zf(e.prev,e,e.next)>0)}function zf(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Ff(t,e){return t.x===e.x&&t.y===e.y}function Vf(t,e,i,n){var o=Gf(zf(t,e,i)),s=Gf(zf(t,e,n)),a=Gf(zf(i,n,t)),r=Gf(zf(i,n,e));return o!==s&&a!==r||!(0!==o||!Hf(t,i,e))||!(0!==s||!Hf(t,n,e))||!(0!==a||!Hf(i,t,n))||!(0!==r||!Hf(i,e,n))}function Hf(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function Gf(t){return t>0?1:t<0?-1:0}function Uf(t,e){return zf(t.prev,t,t.next)<0?zf(t,e,t.next)>=0&&zf(t,t.prev,e)>=0:zf(t,e,t.prev)<0||zf(t,t.next,e)<0}function Wf(t,e){var i=new qf(t.i,t.x,t.y),n=new qf(e.i,e.x,e.y),o=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=o,o.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function Yf(t,e,i,n){var o=new qf(t,e,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 Jf(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function qf(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Xf=function(){function t(){C()(this,t)}return k()(t,null,[{key:"area",value:function(t){for(var e=t.length,i=0,n=e-1,o=0;o2&&void 0!==arguments[2]?arguments[2]:2,u=e&&e.length,p=u?e[0]*c:t.length,h=Ef(t,0,p,c,!0),d=[];if(!h||h.next===h.prev)return d;if(u&&(h=function(t,e,i,n){var o,s,a,r=[];for(o=0,s=e.length;o80*c){i=o=t[0],n=s=t[1];for(var m=c;mo&&(o=a),r>s&&(s=r);l=0!==(l=Math.max(o-i,s-n))?32767/l:0}return Df(h,d,c,i,n,l,0),d}(i,n),l=0;l2&&t[e-1].equals(t[0])&&t.pop()}function Kf(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:new xf([new qp(.5,.5),new qp(-.5,.5),new qp(-.5,-.5),new qp(.5,-.5)]),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};C()(this,e),(t=kp(this,e)).type="ExtrudeGeometry",t.parameters={shapes:i,options:n},i=Array.isArray(i)?i:[i];for(var o=t,s=[],a=[],r=0,l=i.length;rNumber.EPSILON){var h=Math.sqrt(u),d=Math.sqrt(l*l+c*c),m=e.x-r/h,f=e.y+a/h,v=((i.x-c/d-m)*c-(i.y+l/d-f)*l)/(a*c-r*l),g=(n=m+a*v-t.x)*n+(o=f+r*v-t.y)*o;if(g<=2)return new qp(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 qp(n/s,o/s)}for(var I=[],R=0,z=O.length,F=z-1,V=R+1;R=0;gt--){for(var yt=gt/y,bt=f*Math.cos(yt*Math.PI/2),Ct=v*Math.sin(yt*Math.PI/2)+g,wt=0,kt=O.length;wt=0;){var n=i,o=i-1;o<0&&(o=t.length-1);for(var s=0,a=h+2*y;s0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;C()(this,e);var o=(1+Math.sqrt(5))/2;return(t=kp(this,e,[[-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",t.parameters={radius:i,detail:n},t}return gi()(e,t),k()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.detail)}}])}(gf),ev=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return C()(this,e),(t=kp(this,e,[[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",t.parameters={radius:i,detail:n},t}return gi()(e,t),k()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.detail)}}])}(gf),iv=function(t){function e(){var t,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;C()(this,e),(t=kp(this,e)).type="RingGeometry",t.parameters={innerRadius:i,outerRadius:n,thetaSegments:o,phiSegments:s,thetaStart:a,thetaLength:r},o=Math.max(3,o);for(var l=[],c=[],u=[],p=[],h=i,d=(n-i)/(s=Math.max(1,s)),m=new bh,f=new qp,v=0;v<=s;v++){for(var g=0;g<=o;g++){var y=a+g/o*r;m.x=h*Math.cos(y),m.y=h*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,p.push(f.x,f.y)}h+=d}for(var b=0;b0&&void 0!==arguments[0]?arguments[0]:new xf([new qp(0,.5),new qp(-.5,-.5),new qp(.5,-.5)]),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;C()(this,e),(t=kp(this,e)).type="ShapeGeometry",t.parameters={shapes:i,curveSegments:n};var o=[],s=[],a=[],r=[],l=0,c=0;if(!1===Array.isArray(i))p(i);else for(var u=0;u0&&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;C()(this,e),(t=kp(this,e)).type="SphereGeometry",t.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,p=[],h=new bh,d=new bh,m=[],f=[],v=[],g=[],y=0;y<=o;y++){var b=[],w=y/o,k=0;0===y&&0===r?k=.5/n:y===o&&c===Math.PI&&(k=-.5/n);for(var _=0;_<=n;_++){var x=_/n;h.x=-i*Math.cos(s+x*a)*Math.sin(r+w*l),h.y=i*Math.cos(r+w*l),h.z=i*Math.sin(s+x*a)*Math.sin(r+w*l),f.push(h.x,h.y,h.z),d.copy(h).normalize(),v.push(d.x,d.y,d.z),g.push(x+k,1-w),b.push(u++)}p.push(b)}for(var E=0;E0)&&m.push(D,P,M),(E!==o-1||c0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return C()(this,e),(t=kp(this,e,[[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",t.parameters={radius:i,detail:n},t}return gi()(e,t),k()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.detail)}}])}(gf),av=function(t){function e(){var t,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;C()(this,e),(t=kp(this,e)).type="TorusGeometry",t.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=[],p=new bh,h=new bh,d=new bh,m=0;m<=o;m++)for(var f=0;f<=s;f++){var v=f/s*a,g=m/o*Math.PI*2;h.x=(i+n*Math.cos(g))*Math.cos(v),h.y=(i+n*Math.cos(g))*Math.sin(v),h.z=n*Math.sin(g),l.push(h.x,h.y,h.z),p.x=i*Math.cos(v),p.y=i*Math.sin(v),d.subVectors(h,p).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 w=(s+1)*y+b-1,k=(s+1)*(y-1)+b-1,_=(s+1)*(y-1)+b,x=(s+1)*y+b;r.push(w,k,x),r.push(k,_,x)}return t.setIndex(r),t.setAttribute("position",new qd(l,3)),t.setAttribute("normal",new qd(c,3)),t.setAttribute("uv",new qd(u,2)),t}return gi()(e,t),k()(e,[{key:"copy",value:function(t){return wp(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc)}}])}(im),rv=function(t){function e(){var t,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;C()(this,e),(t=kp(this,e)).type="TorusKnotGeometry",t.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=[],p=[],h=new bh,d=new bh,m=new bh,f=new bh,v=new bh,g=new bh,y=new bh,b=0;b<=o;++b){var w=b/o*a*Math.PI*2;N(w,a,r,i,m),N(w+.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 k=0;k<=s;++k){var _=k/s*Math.PI*2,x=-n*Math.cos(_),E=n*Math.sin(_);h.x=m.x+(x*y.x+E*v.x),h.y=m.y+(x*y.y+E*v.y),h.z=m.z+(x*y.z+E*v.z),c.push(h.x,h.y,h.z),d.subVectors(h,m).normalize(),u.push(d.x,d.y,d.z),p.push(b/o),p.push(k/s)}}for(var S=1;S<=o;S++)for(var D=1;D<=s;D++){var P=(s+1)*(S-1)+(D-1),O=(s+1)*S+(D-1),M=(s+1)*S+D,T=(s+1)*(S-1)+D;l.push(P,O,T),l.push(O,M,T)}function N(t,e,i,n,o){var s=Math.cos(t),a=Math.sin(t),r=i/e*t,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 t.setIndex(l),t.setAttribute("position",new qd(c,3)),t.setAttribute("normal",new qd(u,3)),t.setAttribute("uv",new qd(p,2)),t}return gi()(e,t),k()(e,[{key:"copy",value:function(t){return wp(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}}])}(im),lv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new lf(new bh(-1,-1,0),new bh(-1,1,0),new bh(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];C()(this,e),(t=kp(this,e)).type="TubeGeometry",t.parameters={path:i,tubularSegments:n,radius:o,radialSegments:s,closed:a};var r=i.computeFrenetFrames(n,a);t.tangents=r.tangents,t.normals=r.normals,t.binormals=r.binormals;var l=new bh,c=new bh,u=new qp,p=new bh,h=[],d=[],m=[],f=[];function v(t){p=i.getPointAt(t/n,p);for(var e=r.normals[t],a=r.binormals[t],u=0;u<=s;u++){var m=u/s*Math.PI*2,f=Math.sin(m),v=-Math.cos(m);c.x=v*e.x+f*a.x,c.y=v*e.y+f*a.y,c.z=v*e.z+f*a.z,c.normalize(),d.push(c.x,c.y,c.z),l.x=p.x+o*c.x,l.y=p.y+o*c.y,l.z=p.z+o*c.z,h.push(l.x,l.y,l.z)}}return function(){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:null;if(C()(this,e),(t=kp(this,e)).type="WireframeGeometry",t.parameters={geometry:i},null!==i){var n=[],o=new Set,s=new bh,a=new bh;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,p=c.length;u=o)break t;var r=e[1];t=(o=e[--i-1]))break e}s=i,i=0}for(;i>>1;te;)--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 t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var i=this.times,n=this.values,o=i.length;0===o&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!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),t=!1;break}if(null!==s&&s>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,r,s),t=!1;break}s=r}if(void 0!==n&&hv(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),t=!1;break}}return t}},{key:"optimize",value:function(){for(var t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),n=2302===this.getInterpolation(),o=t.length-1,s=1,a=1;a0){t[s]=t[o];for(var g=o*i,y=s*i,b=0;b!==i;++b)e[y+b]=e[g+b];++s}return s!==t.length?(this.times=t.slice(0,s),this.values=e.slice(0,s*i)):(this.times=t,this.values=e),this}},{key:"clone",value:function(){var t=this.times.slice(),e=this.values.slice(),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}],[{key:"toJSON",value:function(t){var e,i=t.constructor;if(i.toJSON!==this.toJSON)e=i.toJSON(t);else{e={name:t.name,times:pv(t.times,Array),values:pv(t.values,Array)};var n=t.getInterpolation();n!==t.DefaultInterpolation&&(e.interpolation=n)}return e.type=t.ValueTypeName,e}}])}();gv.prototype.TimeBufferType=Float32Array,gv.prototype.ValueBufferType=Float32Array,gv.prototype.DefaultInterpolation=2301;var yv=function(t){function e(){return C()(this,e),kp(this,e,arguments)}return gi()(e,t),k()(e)}(gv);yv.prototype.ValueTypeName="bool",yv.prototype.ValueBufferType=Array,yv.prototype.DefaultInterpolation=2300,yv.prototype.InterpolantFactoryMethodLinear=void 0,yv.prototype.InterpolantFactoryMethodSmooth=void 0;var bv=function(t){function e(){return C()(this,e),kp(this,e,arguments)}return gi()(e,t),k()(e)}(gv);bv.prototype.ValueTypeName="color";var Cv=function(t){function e(){return C()(this,e),kp(this,e,arguments)}return gi()(e,t),k()(e)}(gv);Cv.prototype.ValueTypeName="number";var wv=function(t){function e(t,i,n,o){return C()(this,e),kp(this,e,[t,i,n,o])}return gi()(e,t),k()(e,[{key:"interpolate_",value:function(t,e,i,n){for(var o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,r=(i-e)/(n-e),l=t*a,c=l+a;l!==c;l+=4)yh.slerpFlat(o,0,s,l-a,s,l,r);return o}}])}(dv),kv=function(t){function e(){return C()(this,e),kp(this,e,arguments)}return gi()(e,t),k()(e,[{key:"InterpolantFactoryMethodLinear",value:function(t){return new wv(this.times,this.values,this.getValueSize(),t)}}])}(gv);kv.prototype.ValueTypeName="quaternion",kv.prototype.DefaultInterpolation=2301,kv.prototype.InterpolantFactoryMethodSmooth=void 0;var _v=function(t){function e(){return C()(this,e),kp(this,e,arguments)}return gi()(e,t),k()(e)}(gv);_v.prototype.ValueTypeName="string",_v.prototype.ValueBufferType=Array,_v.prototype.DefaultInterpolation=2300,_v.prototype.InterpolantFactoryMethodLinear=void 0,_v.prototype.InterpolantFactoryMethodSmooth=void 0;var xv=function(t){function e(){return C()(this,e),kp(this,e,arguments)}return gi()(e,t),k()(e)}(gv);xv.prototype.ValueTypeName="vector";var Ev=k()((function t(e,i,n){C()(this,t);var o,s=this,a=!1,r=0,l=0,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=i,this.onError=n,this.itemStart=function(t){l++,!1===a&&void 0!==s.onStart&&s.onStart(t,r,l),a=!0},this.itemEnd=function(t){r++,void 0!==s.onProgress&&s.onProgress(t,r,l),r===l&&(a=!1,void 0!==s.onLoad&&s.onLoad())},this.itemError=function(t){void 0!==s.onError&&s.onError(t)},this.resolveURL=function(t){return o?o(t):t},this.setURLModifier=function(t){return o=t,this},this.addHandler=function(t,e){return c.push(t,e),this},this.removeHandler=function(t){var e=c.indexOf(t);return-1!==e&&c.splice(e,2),this},this.getHandler=function(t){for(var e=0,i=c.length;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Rv(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};C()(this,e),Fv(i=zv(this,e,[t,n]),Uv,void 0),Fv(i,Wv,!1);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.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 Si,i.sdk.addIncetance(i.options.id,i),i.picking=!0,i.init(),i}return gi()(e,t),k()(e,[{key:"attributeSelect",get:function(){return[{name:"富文本",value:"富文本",key:"richText"},{name:"链接",value:"链接",key:"link"}]}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"show",get:function(){return this.options.show},set:function(t){var i,n,o,s,a,r;"boolean"==typeof t?(i=e,n="show",o=t,s=this,a=1,r=1,fp()(fi()(r?i.prototype:i),n,o,s,a),this.text&&(this.text.show=t),It(this.sdk,this.options.id),Et(this.sdk,this.options.id)):console.error("参数必须为boolean")}},{key:"position",get:function(){return this.options.position},set:function(t){var e=this;if(this.options.position=t,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(t){var i=[n[0],n[1],t];e.text&&(e.text.position=i)}))}}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t,this.options.color)for(var i=0;i0&&0===i&&(this.options.angle=360),this._elms.angle&&this._elms.angle.forEach((function(t){t.value=e.options.angle})),this._update()}},{key:"scale",get:function(){return this.options.scale},set:function(t){this.options.scale.x=t.x,this.options.scale.y=t.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(t){"boolean"==typeof t?(this.options.flipe.y=t,this._update()):console.error("参数必须为boolean")}},{key:"flipeX",get:function(){return this.options.flipe.x},set:function(t){"boolean"==typeof t?(this.options.flipe.x=t,this._update()):console.error("参数必须为boolean")}},{key:"textValue",get:function(){return this.options.text.value},set:function(t){this.options.text.value=t,this.text&&(this.text.text=t),this._elms.textValue&&this._elms.textValue.forEach((function(e){e.value=t}))}},{key:"textShow",get:function(){return this.options.text.show},set:function(t){var e=this;this.options.text.show=t,this.show?(this.text&&(this.text.show=t),this.options.text.position&&setTimeout((function(){e.options.text.position.alt?e.text&&(e.text.position=[e.options.text.position.lng,e.options.text.position.lat,e.options.text.position.alt]):e.getClampToHeight({lng:e.options.text.position.lng,lat:e.options.text.position.lat}).then((function(t){e.text&&(e.text.position=[e.options.text.position.lng,e.options.text.position.lat,t])}))}),0)):this.text&&(this.text.show=!1),this._elms.textShow&&this._elms.textShow.forEach((function(e){e.checked=t}))}},{key:"textColor",get:function(){return this.options.text.color},set:function(t){var e=this;this.options.text.color=t,this.text&&(this.text.color=t),this._elms.textColor&&this._elms.textColor.forEach((function(t,i){var n=new ewPlugins("colorpicker",{el:t.el,size:"mini",alpha:!0,defaultColor:e.textColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.textColor=t},clear:function(){e.textColor="rgba(255,255,255,1)"}});e._elms.textColor[i]=n}))}},{key:"textFontSize",get:function(){return this.options.text.fontSize},set:function(t){this.options.text.fontSize=t,this.text&&(this.text.fontSize=t),this._elms.textFontSize&&this._elms.textFontSize.forEach((function(e){e.value=t}))}},{key:"textScaleByDistance",get:function(){return this.options.text.scaleByDistance},set:function(t){this.options.text.scaleByDistance=t,this.text&&(this.text.scaleByDistance=t),this._elms.textScaleByDistance&&this._elms.textScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"textNear",get:function(){return this.options.text.near},set:function(t){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(t){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(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,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 o=0;o\n
        '+this.options.attribute.link.content[o].url+'
        \n
        \n \n \n
        \n ',r=document.createRange().createContextualFragment(s);n.appendChild(r)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=a()(l.a.mark((function t(i){var n,o,s,a,r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),a=l.a.mark((function t(n){var o,a,r,c,u,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=34;break}o=s[n].offsetHeight,s[n].innerHTML='\n
        \n \n
        \n
        \n \n
        \n
        \n \n \n
        ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(a=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,a[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,r=s[n].getElementsByTagName("button"),c=0;case 11:if(!(cx[E]&&(w=x[E]),k(k=Math.abs(k))&&(k=w);var S=k,D=4e3/(k=k*(10/3)*100)/5;S*=D;for(var P=0;P=Number(t.target.min))&&(m.scale={x:e,y:m.scale.y})})),p.addEventListener("blur",(function(t){var e=t.target.value;e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e=Number(t.target.min))&&(m.scale={x:m.scale.x,y:e})})),d.addEventListener("blur",(function(t){var e=t.target.value;e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e-360&&b<-90||b<360&&b>90)&&(b+=180),((C=O-M)>-360&&C<-90||C<360&&C>90)&&(C+=180),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=f/3.5,i.scale.y=v/3.5,t.abrupt("break",98);case 54:return M=(turf.rhumbBearing(S,turf.point(_[2]))+360-i.angle)%360,((C=O-M)>-360&&C<-90||C<360&&C>90)&&(C+=180),m=Math.PI/180*C,v=Math.cos(m)*N*2,i.scale.y=v/3.5,t.abrupt("break",98);case 61:return T=(turf.rhumbBearing(S,turf.point(_[6]))+360-i.angle)%360,M=(turf.rhumbBearing(S,turf.point(_[2]))+360-i.angle)%360,((b=O-T)>-360&&b<-90||b<360&&b>90)&&(b+=180),((C=O-M)>-360&&C<-90||C<360&&C>90)&&(C+=180),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=f/3.5,i.scale.y=v/3.5,t.abrupt("break",98);case 74:return T=(turf.rhumbBearing(S,turf.point(_[4]))+360-i.angle)%360,((b=O-T)>-360&&b<-90||b<360&&b>90)&&(b+=180),d=Math.PI/180*b,f=Math.cos(d)*N*2,i.scale.x=f/3.5,t.abrupt("break",98);case 81: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},B=u.lng-c.lng,A=u.lat-c.lat,i.bbox[0]=i.bbox[0]+B,i.bbox[1]=i.bbox[1]+A,i.bbox[2]=i.bbox[2]+B,i.bbox[3]=i.bbox[3]+A,t.abrupt("break",98);case 91:return T=(turf.rhumbBearing(S,turf.point(_[6]))+360-i.angle)%360,((b=O-T)>-360&&b<-90||b<360&&b>90)&&(b+=180),d=Math.PI/180*b,f=Math.cos(d)*N*2,i.scale.x=f/3.5,t.abrupt("break",98);case 98:p=p/(n/2)*100,h=h/(o/2)*100,(L=jv({},i.scale)).x=L.x+p,L.y=L.y-h,L.y>200&&(L.y=200),L.y<0&&(L.y=0),L.x>200&&(L.x=200),L.x<0&&(L.x=0),i.scale=jv({},L),t.next=137;break;case 110:j=i.sdk.viewer.scene.drillPick(e.endPosition),R=0;case 112:if(!(R90&&(c+=180);var p=[c,u],h=turf.point(p),d=turf.rhumbDestination(h,o[s][r].distance,o[s][r].angle,{units:"kilometers"}),m=N()(d.geometry.coordinates);m[2]=10,a.push((l=Cesium.Cartesian3).fromDegrees.apply(l,N()(m)))}0===s?i.positions=a:n.push(a)}return i.holes=n,i}}},{key:"_updateGeojson",value:function(t,e,i){if(Vv(Wv,this)){var n=Math.abs(this.bbox[0]-this.bbox[2]),o=Math.abs(this.bbox[1]-this.bbox[3]);if("object"===M()(t[0]))for(var s=0;so[2]&&(e=o[0],o[0]=o[2],o[2]=e),o[1]>o[3]&&(e=o[1],o[1]=o[3],o[3]=e);for(var c=[],u=JSON.parse(JSON.stringify(this.geojson)),p=function(e){for(var i=0;i=0;e--)this.sdk.viewer.entities.remove(this.entity.values[e]);return this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=10,this.sdk.removeIncetance(this.options.id);case 10:return t.next=12,It(this.sdk,this.options.id);case 12:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接"+(this.options.attribute.link.content.length+1),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(t){this.options.attribute.link.content.push({name:"链接"+(this.options.attribute.link.content.length+1),url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"openRichTextEditor",value:function(t){var e=this;Li.open(this.options.id,this.options.name,this.options.richTextContent),Li.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"setPosition",value:function(t){if(t){this.ismove=!0;var e={};e.lng=t.position.lng,e.lat=t.position.lat,this.position=e}else this.ismove=!1;this._update()}}],[{key:"createText",value:(i=a()(l.a.mark((function t(e){var i;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.options.text.position){t.next=10;break}if(!e.options.text.position.alt){t.next=5;break}i=e.options.text.position.alt,t.next=8;break;case 5:return t.next=7,e.getClampToHeight({lng:e.options.text.position.lng,lat:e.options.text.position.lat});case 7:i=t.sent;case 8:e.text=new Ki(e.sdk,o()(o()(o()(o()(o()({id:e.options.id,show:!!e.options.show&&!!e.options.text.show&&e.options.text.show,position:[e.options.text.position.lng,e.options.text.position.lat,i],text:e.options.text.value,fontSize:e.options.text.fontSize,color:e.options.text.color,pixelOffset:e.options.text.pixelOffset,backgroundColor:e.options.text.backgroundColor,lineColor:e.options.text.lineColor},"pixelOffset",0),"scaleByDistance",e.options.text.scaleByDistance),"backgroundColor",["#ffffff00","#ffffff00"]),"near",e.options.text.near),"far",e.options.text.far)),e.text.entity.billboard.verticalOrigin=Cesium.VerticalOrigin.CENTER;case 10:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})}]);var i,n,s}(Ui);function Jv(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return qv(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?qv(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function qv(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),i=Xv(this,e,[t,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.init(),i}return gi()(e,t),k()(e,[{key:"init",value:function(){var t=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(){return Cesium.Cartesian3.fromDegrees(t.startLng,t.startLat)}),!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(){return Cesium.Cartesian3.fromDegrees(t.endLng,t.endLat)}),!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:"startLng",get:function(){return this.start.lng},set:function(t){this.start.lng=t,!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(e){e.value=t}))}},{key:"startLat",get:function(){return this.start.lat},set:function(t){this.start.lat=t,!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(e){e.value=t}))}},{key:"endLng",get:function(){return this.end.lng},set:function(t){this.end.lng=t,!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(e){e.value=t}))}},{key:"endLat",get:function(){return this.end.lat},set:function(t){this.end.lat=t,!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(e){e.value=t}))}},{key:"edit",value:(i=a()(l.a.mark((function t(i){var n,o,s,a,r,c,u=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=42;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: 460px;\n }\n .YJ-custom-base-dialog>.content>div>.row .col {\n margin: 0 10px;\n }\n .YJ-custom-base-dialog>.content .row .label {\n flex: auto;\n }\n",t.next=11,new G(this.sdk.viewer._container,{title:"路径规划",closeCallBack:function(){u.tip&&u.tip.destroy(),u.event&&u.event.destroy(),u.Dialog.closeCallBack&&u.Dialog.closeCallBack()}});case 11:return this._DialogObject=t.sent,t.next=14,this._DialogObject.init();case 14:(n=document.createElement("div")).style.position="absolute",n.style.left="24px",n.style.flet="0",n.style.display="flex",this._DialogObject.footAppChild(n),(o=document.createElement("button")).className="default",o.innerHTML='查询',o.style.width="auto",o.addEventListener("click",(function(){!u.startLng&&0!==u.startLng||!u.startLat&&0!==u.startLat||!u.endLng&&0!==u.endLng||!u.endLat&&0!==u.endLat?console.error("请先设置起点和终点坐标!"):(!u.startEntity&&(u.startEntity=u.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(u.startLng,u.startLat)}),!1),billboard:{image:u.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),u.startEntity.show=!0,!u.endEntity&&(u.endEntity=u.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(u.endLng,u.endLat)}),!1),billboard:{image:u.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),u.endEntity.show=!0,u.Dialog.queryCallBack&&u.Dialog.queryCallBack({start:[u.startLng,u.startLat],end:[u.endLng,u.endLat]}))})),n.appendChild(o),(s=document.createElement("button")).className="default",s.innerHTML='清除路线',s.style.width="auto",s.style.marginLeft="10px",s.addEventListener("click",(function(){u.clear()})),n.appendChild(s),document.getElementsByTagName("head")[0].appendChild(this._element_style),(a=document.createElement("div")).innerHTML='\n
        \n
        \n 起点\n \n \n \n
        \n
        \n
        \n
        \n 终点\n \n \n \n
        \n
        \n ',this._DialogObject.contentAppChild(a),this.options.gps&&((r=document.createElement("button")).innerHTML="当前位置",r.style.marginLeft="10px",r.setAttribute("data-is","start"),r.addEventListener("click",(function(t){u.getLocateCurrent(t)})),a.getElementsByClassName("start-col")[0].appendChild(r),this._DialogObject._element.body.getElementsByClassName("end-pick-btn")[0].style.marginRight="91px"),c=a.getElementsByTagName("*"),e.EventBinding(this,c),t.next=44;break;case 42: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 44:case"end":return t.stop()}}),t,this)}))),function(t){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(t){var e=this;this.reconnecting&&this.reconnecting.close(),this.options.host=this.options.host||m();var i;i=this.options.host+"/yjearth4.0/api/v1/gps/state",this.reconnecting=new ReconnectingWebSocket("ws://"+i),this.reconnecting.onopen=function(i){e.reconnecting.onmessage=function(i){e.data=JSON.parse(i.data),e.data&&e.data.rmc&&(e.reconnecting.close(),"start"===t.srcElement.getAttribute("data-is")?(e.startLng=e.data.rmc.lng,e.startLat=e.data.rmc.lat,!e.startEntity&&(e.startEntity=e.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return e.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(e.startLng,e.startLat))}),!1),billboard:{image:e.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),e.startEntity.show=!0):(e.endLng=e.data.rmc.lng,e.endLat=e.data.rmc.lat,!e.endEntity&&(e.endEntity=e.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return e.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(e.endLng,e.endLat))}),!1),billboard:{image:e.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),e.endEntity.show=!0))}}}},{key:"createRoute",value:function(t){for(var e=[],i=0;i=500?(e.tip&&e.tip.destroy(),e.event&&e.event.destroy()):i(0,n)}))}))}},{key:"pickEndPos",value:function(t){var e=this;this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=new q("左键选择终点坐标,右键取消",this.sdk),this.event=new J(this.sdk),this.event.mouse_move((function(t,i){e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.endLng=n.lng,e.endLat=n.lat,!e.endEntity&&(e.endEntity=e.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return e.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(e.endLng,e.endLat))}),!1),billboard:{image:e.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),e.endEntity.show=!0,e.tip&&e.tip.destroy(),e.event&&e.event.destroy()})),this.event.mouse_right((function(t,i){e.tip&&e.tip.destroy(),e.event&&e.event.destroy()}))}},{key:"flicker",value:function(){}}],[{key:"EventBinding",value:function(t,e){for(var i=function(){var i,o=[],s=!1,a=[],r=Jv(e[n].attributes);try{var l=function(){var r=i.value;switch(r.name){case"@model":s=!0,"checkbox"==e[n].type?(o.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(o.push((function(e){var i=e.target.value;"number"==e.target.type?"."==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
        ').concat(s[e].properties.fid,"
        ")),s[e].properties)"id"!==o&&"ID"!==o&&"fid"!==o&&(n+='
        ').concat(s[e].properties[o],"
        "));t+=i=i+n+""}return t},t.next=8,new G(e.viewer._container,{title:"",left:"17%",top:"100px"});case 8:return Zv=t.sent,t.next=11,Zv.init();case 11:for(y in r=N()(e.geojson.features),i=r.length,s=r.slice(o*(n-1),o*n),c=a(),(u=document.createElement("div")).style.height="100%",'',p='
        ',h='
        ',d="",m='',f='
        ',v="",g=1,"fid"in e.geojson.features[0].properties&&(d+=''),v+=''),m+=''),g++),e.geojson.features[0].properties)"id"!==y&&"ID"!==y&&"fid"!==y&&(d+=''),v+=''),m+='"),g++);'
        暂无数据
        ',p=p+(h=h+(d+='')+(m+="")+"
        fid
        ').concat(y,"
        ")+(f=f+(v+="")+(""+c+"")+'
        暂无数据
        ')+"",u.innerHTML=''+p+'',b=u.getElementsByClassName("el-table__empty-block")[0],0==s.length?b.style.display="flex":b.style.display="none",Zv.contentAppChild(u),C=u.getElementsByClassName("el-table__header-wrapper")[0],(w=u.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(t){C.scrollLeft=t.target.scrollLeft})),Zv._element.title.style.height="40px",Zv._element.body.style.width="65%",Zv._element.body.style.height="80%",Zv._element.content.style.height="calc(100% - 40px)",Zv._element.content.style.overflow="hidden",Zv._element.foot.style.display="none",w.style.height="calc(100% - ".concat(C.offsetHeight,"px)"),ji(k=u.getElementsByClassName("pagination")[0],i,o,n,(function(t){n=t,s=r.slice(o*(n-1),o*n);var e=a();u.getElementsByTagName("tbody")[0].innerHTML=e,0==s.length?b.style.display="flex":b.style.display="none"})),_=function(){for(var t=u.getElementsByClassName("search-box")[0].getElementsByTagName("input")[0],l=[],c=0;c
        ').concat(n[e].properties.fid,"
        ")),n[e].properties)"id"!==s&&"ID"!==s&&"fid"!==s&&(o+='
        ').concat(n[e].properties[s],"
        "));t+=i=i+o+""}return t},s=!1,a=0;case 5:if(!(a',p='
        ',h="",d='',m='
        ',f="",v=1,"fid"in e.geojson.features[0].properties&&(h+=''),f+=''),d+=''),v++),e.geojson.features[0].properties)"id"!==g&&"ID"!==g&&"fid"!==g&&(h+=''),f+=''),d+='"),v++);if(y='\n \n \n '.concat((u=u+(p=p+(h+='')+(d+="")+"
        fid
        ').concat(g,"
        ")+(m=m+(f+="")+(""+r+"")+"")+"")+'',"\n \n "),n[0].content&&n[0].content.richTextContent&&(b='\n \n '.concat(n[0].content.richTextContent,"\n \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 \n \n '),y+=k;for(y+="",c.innerHTML=y,tg.contentAppChild(c),new Di("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=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function og(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(i=rg(this,e,[t,n])).viewer=t.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),di()(i))}return gi()(e,t),k()(e,[{key:"show",get:function(){return this.options.show},set:function(t){this.setShow(t)}},{key:"on",value:function(){if(this.options.path)return this.init()}},{key:"init",value:(s=a()(l.a.mark((function t(){var i,n,o;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="",this.options.host=this.options.host||m(),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,t.next=6,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:g(),Authorization:"Bearer "+g()}});case 6:if(200!==(n=t.sent).status){t.next=19;break}return t.next=10,n.json();case 10:if(200!==(o=t.sent).code&&0!==o.code){t.next=18;break}return this.data=o.data,t.next=15,this.formatData();case 15:return t.abrupt("return",e.create(this));case 18:return t.abrupt("return",console.error(o.message));case 19:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"formatData",value:(o=a()(l.a.mark((function t(){var e,i,n;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=function(t){if(t.data){var o;(o=i.list).push.apply(o,N()(t.data));for(var s=0;s0&&void 0!==h[0]&&h[0],i=h.length>1&&void 0!==h[1]?h[1]:{},this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=25;break}return t.next=7,new bi(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(t){p.fileName=p.fileName.trim(),p.fileName||(p.fileName="未命名对象"),p.originalOptions.fileName=p.fileName,p.originalOptions.field=p.field,p._DialogObject.close(),i.confirmCallBack&&i.confirmCallBack({id:p.options.id,fileName:p.originalOptions.fileName,field:p.originalOptions.field})},closeCallBack:function(){p.reset(),i.closeCallBack&&i.closeCallBack()}});case 7:for(c in this._DialogObject=t.sent,n='\n
        \n
        \n 文件名称:\n \n
        \n
        \n
        \n
        \n 名称字段选择:\n \n
        \n
        \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(){p.options.fileName=s.value})),a=o.getElementsByClassName("input-select")[0],r="",this.geojson.features[0].properties)u='"),r+=u;a.innerHTML=r,a.value=this.options.field,a.addEventListener("input",(function(){p.options.field=a.value})),this._elms.fileName=s,this._elms.field=a,t.next=26;break;case 25:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 26:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"editById",value:(i=a()(l.a.mark((function t(){var e,i,n,o,s,r,c,u,p,h,d,m,f,v,g,y,b=this,C=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=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),o="",!e){t.next=48;break}r={},c=0;case 8:if(!(c\n
        \n 内容类型:\n \n
        \n \n \n
        \n 编辑内容:\n
        \n \n
        \n
        \n
        \n 编辑内容:\n \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        操作
        \n
        设备名称
        \n
        设备类型
        \n
        设备IP
        \n
        设备端口
        \n
        用户名
        \n
        密码
        \n
        \n
        \n \n
        \n
        \n

        暂无数据

        \n
        \n
        \n
        \n
        \n
          \n
          \n
          \n ',(p=document.createElement("div")).innerHTML=u,this._DialogObject.contentAppChild(p),p.getElementsByTagName("*"),this._DialogObject._element.body.style.width="600px",h=p.getElementsByClassName("attribute-select")[0],d=p.getElementsByClassName("link_add_btn")[0],m=p.getElementsByClassName("open-richText-btn")[0],f=this._DialogObject._element.content.getElementsByClassName("attribute-content"),v=0;v-1?f[v].style.display="block":f[v].style.display="none";h.addEventListener("change",(function(){b._DialogObject.attribute.attributeType=h.value;for(var t=0;t-1?f[t].style.display="block":f[t].style.display="none"})),d.addEventListener("click",a()(l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(b._DialogObject.attribute.link.content.push({name:"链接"+(b._DialogObject.attribute.link.content.length+1),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 t.stop()}}),t)})))),m.addEventListener("click",(function(){Li.open(i,i,b._DialogObject.attribute.richTextContent),Li.primaryCallBack=function(t){b._DialogObject.attribute.richTextContent=t}})),g=p.getElementsByClassName("camera-name")[0],y=p.getElementsByClassName("camera-select")[0],g.addEventListener("input",(function(){o=g.value})),this.cameraSelect&&this.cameraSelect(o),y.addEventListener("click",(function(){b.cameraSelect&&b.cameraSelect(o)})),t.next=49;break;case 48:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 49:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"editContentById",value:function(t,e){for(var i=0;i0?o.getElementsByClassName("table-empty")[0].style.display="none":o.getElementsByClassName("table-empty")[0].style.display="flex";for(var r=0;r\n
          '+this._DialogObject.attribute.link.content[r].url+'
          \n
          \n \n \n
          \n ',u=document.createRange().createContextualFragment(c);s.appendChild(u)}for(var p=s.getElementsByClassName("tr"),h={linkEdit:(i=a()(l.a.mark((function e(i){var o,s,a,r,c;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.setAttributeLinkById(t,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],a=s.getElementsByClassName("tr"),r=l.a.mark((function t(e){var o,s,r,c,u,p;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==e){t.next=31;break}a[e].innerHTML='\n
          \n \n
          \n
          \n
          \n \n \n
          \n
          \n
          \n \n \n
          ',(o=a[e].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=a[e].getElementsByTagName("button"),r=0;case 8:if(!(r1&&void 0!==arguments[1]?arguments[1]:{};if(t){for(var i=0;i0){ji(o,e.data.total,10,1,(function(e){i.cameraSelect&&i.cameraSelect(t,e)})),s.getElementsByClassName("table-empty")[0].style.display="none",a.style.display="inline-flex";for(var r=function(t){var o='\n
          \n
          \n \n 绑定\n
          \n
          ').concat(e.data.list[t].cameraName,'
          \n
          ').concat(n[e.data.list[t].type],'
          \n
          ').concat(e.data.list[t].ip,'
          \n
          ').concat(e.data.list[t].port,'
          \n
          ').concat(e.data.list[t].userName,'
          \n
          ').concat(e.data.list[t].passWord,"
          \n
          "),s=document.createRange().createContextualFragment(o),r=s.querySelector('input[type="checkbox"]');r.addEventListener("change",(function(){if(r.checked)i._DialogObject.attribute.camera.push(e.data.list[t]);else{var n=i._DialogObject.attribute.camera.filter((function(i){return i.ID!==e.data.list[t].ID}));i._DialogObject.attribute.camera=n}})),a.appendChild(s);for(var l=0;l0){var l=turf.featureCollection(i),c=turf.envelope(l);c&&c.bbox&&4==c.bbox.length&&(t.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(t,e){if(e){for(var i=new Cesium.PointPrimitiveCollection({scene:t.viewer.scene}),n=0;n0&&t.entity.add(new Cesium.GroundPolylinePrimitive({geometryInstances:i,appearance:new Cesium.PolylineColorAppearance}))}}},{key:"createPolygons",value:function(t,e){if(e){for(var i=[],n=0;n0){var c=new Cesium.GroundPrimitive({geometryInstances:i,appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,closed:!1})});t.entity.add(c)}}}},{key:"createTableContent",value:function(t){for(var e="",i=0;i
          ').concat(t.currentData[i].attr[s],"
          ");e+=n=n+o+""}return e}}]);var i,n,o,s}(Ui);function ug(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function pg(t){for(var e=1;e
          ').concat(s[e].properties.fid,"
          ")),s[e].properties)"id"!==o&&"ID"!==o&&"fid"!==o&&(n+='
          ').concat(s[e].properties[o],"
          "));t+=i=i+n+""}return t},t.next=8,new G(e.viewer._container,{title:"",left:"17%",top:"100px"});case 8:return lg=t.sent,t.next=11,lg.init();case 11:for(y in r=N()(e.geojson.features),i=r.length,s=r.slice(o*(n-1),o*n),c=a(),(u=document.createElement("div")).style.height="100%",'',p='
          ',h='
          ',d="",m='',f='
          ',v="",g=1,"fid"in e.geojson.features[0].properties&&(d+=''),v+=''),m+=''),g++),e.geojson.features[0].properties)"id"!==y&&"ID"!==y&&"fid"!==y&&(d+=''),v+=''),m+='"),g++);'
          暂无数据
          ',p=p+(h=h+(d+='')+(m+="")+"
          fid
          ').concat(y,"
          ")+(f=f+(v+="")+(""+c+"")+'
          暂无数据
          ')+"",u.innerHTML=''+p+'',b=u.getElementsByClassName("el-table__empty-block")[0],0==s.length?b.style.display="flex":b.style.display="none",lg.contentAppChild(u),C=u.getElementsByClassName("el-table__header-wrapper")[0],(w=u.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(t){C.scrollLeft=t.target.scrollLeft})),lg._element.title.style.height="40px",lg._element.body.style.width="65%",lg._element.body.style.height="80%",lg._element.content.style.height="calc(100% - 40px)",lg._element.content.style.overflow="hidden",lg._element.foot.style.display="none",w.style.height="calc(100% - ".concat(C.offsetHeight,"px)"),ji(k=u.getElementsByClassName("pagination")[0],i,o,n,(function(t){n=t,s=r.slice(o*(n-1),o*n);var e=a();u.getElementsByTagName("tbody")[0].innerHTML=e,0==s.length?b.style.display="flex":b.style.display="none"})),_=function(){for(var t=u.getElementsByClassName("search-box")[0].getElementsByTagName("input")[0],l=[],c=0;c
          ').concat(n[e].properties.fid,"
          ")),n[e].properties)"id"!==s&&"ID"!==s&&"fid"!==s&&(o+='
          ').concat(n[e].properties[s],"
          "));t+=i=i+o+""}return t},s=!1,a=0;case 5:if(!(a',p='
          ',h="",d='',m='
          ',f="",v=1,"fid"in e.geojson.features[0].properties&&(h+=''),f+=''),d+=''),v++),e.geojson.features[0].properties)"id"!==g&&"ID"!==g&&"fid"!==g&&(h+=''),f+=''),d+='"),v++);if(y='\n \n \n '.concat((u=u+(p=p+(h+='')+(d+="")+"
          fid
          ').concat(g,"
          ")+(m=m+(f+="")+(""+r+"")+"")+"")+'',"\n \n "),n[0].content&&n[0].content.richTextContent&&(b='\n \n '.concat(n[0].content.richTextContent,"\n \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 \n \n '),y+=k;for(y+="",c.innerHTML=y,hg.contentAppChild(c),new Di("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=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function vg(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(C()(this,e),Cg(i=bg(this,e,[t,n]),Eg,void 0),Cg(i,Sg,!1),Cg(i,Dg,[]),i.viewer=t.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),di()(i);for(var s in i.colors=xg,i.options.head_tables=n.head_tables||[],i.options.fileName=n.fileName||"未命名对象",i.options.field=n.field||"id",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=xg[i.options.disaster_type]?yg({},xg[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 gi()(e,t),k()(e,[{key:"type",get:function(){return"vector"}},{key:"show",get:function(){return this.options.show},set:function(t){this.setShow(t)}},{key:"opacity",get:function(){return this.options.opacity},set:function(t){this.options.opacity=t,this.entity&&this.entity.entities.values.forEach((function(e){e.point&&(e.point.color=e.point.color._value.withAlpha(t)),e.polygon&&(e.polygon.material=e.polygon.material.color._value.withAlpha(t)),e.polyline&&(e.polyline.material=e.polyline.material.color._value.withAlpha(t))}))}},{key:"on",value:function(){if(this.options.path)return this.init()}},{key:"init",value:(s=a()(l.a.mark((function t(){var i,n,o,s,a;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="",this.options.host=this.options.host||m(),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,t.next=6,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:g(),Authorization:"Bearer "+g()}});case 6:if(200!==(n=t.sent).status){t.next=17;break}return t.next=10,n.arrayBuffer();case 10:return o=t.sent,s=new Uint8Array(o),a=this.decompressGzip(s),this.data=JSON.parse(a),t.next=16,this.formatData();case 16:return t.abrupt("return",e.create(this));case 17:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"formatData",value:(o=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c,u;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(e=[],i=function(t,e,n){if(t)if(Array.isArray(t)){for(var o=!1,s=0;s0&&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),!e){t.next=74;break}return t.next=7,new bi(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(t){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=t.sent,n='\n
          \n
          \n 文件名称:\n \n
          \n
          \n
          \n
          \n 名称字段选择:\n
          \n
          \n
          \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})),a=[],t.t0=l.a.keys(this.geojson.features[0].properties);case 17:if((t.t1=t.t0()).done){t.next=31;break}r=t.t1.value,c=r,u=0;case 21:if(!(u').concat(g,""),f+=b,t.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,t.next=75;break;case 74:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 75:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"editById",value:(i=a()(l.a.mark((function t(){var e,i,n,o,s,r,c,u,p,h,d,m,f,v,g,y,b=this,C=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=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),o="",!e){t.next=48;break}r={},c=0;case 8:if(!(c\n
          \n 内容类型:\n \n
          \n \n \n
          \n 编辑内容:\n
          \n \n
          \n
          \n
          \n 编辑内容:\n \n \n
          \n
          \n
          \n
          \n
          \n
          \n
          操作
          \n
          设备名称
          \n
          设备类型
          \n
          设备IP
          \n
          设备端口
          \n
          用户名
          \n
          密码
          \n
          \n
          \n \n
          \n
          \n

          暂无数据

          \n
          \n
          \n
          \n
          \n
            \n
            \n
            \n ',(p=document.createElement("div")).innerHTML=u,this._DialogObject.contentAppChild(p),p.getElementsByTagName("*"),this._DialogObject._element.body.style.width="600px",h=p.getElementsByClassName("attribute-select")[0],d=p.getElementsByClassName("link_add_btn")[0],m=p.getElementsByClassName("open-richText-btn")[0],f=this._DialogObject._element.content.getElementsByClassName("attribute-content"),v=0;v-1?f[v].style.display="block":f[v].style.display="none";h.addEventListener("change",(function(){b._DialogObject.attribute.attributeType=h.value;for(var t=0;t-1?f[t].style.display="block":f[t].style.display="none"})),d.addEventListener("click",a()(l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(b._DialogObject.attribute.link.content.push({name:"链接"+(b._DialogObject.attribute.link.content.length+1),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 t.stop()}}),t)})))),m.addEventListener("click",(function(){Li.open(i,i,b._DialogObject.attribute.richTextContent),Li.primaryCallBack=function(t){b._DialogObject.attribute.richTextContent=t}})),g=p.getElementsByClassName("camera-name")[0],y=p.getElementsByClassName("camera-select")[0],g.addEventListener("input",(function(){o=g.value})),this.cameraSelect&&this.cameraSelect(o),y.addEventListener("click",(function(){b.cameraSelect&&b.cameraSelect(o)})),t.next=49;break;case 48:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 49:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"editContentById",value:function(t,e){for(var i=0;i0?o.getElementsByClassName("table-empty")[0].style.display="none":o.getElementsByClassName("table-empty")[0].style.display="flex";for(var r=0;r\n
            '+this._DialogObject.attribute.link.content[r].url+'
            \n
            \n \n \n
            \n ',u=document.createRange().createContextualFragment(c);s.appendChild(u)}for(var p=s.getElementsByClassName("tr"),h={linkEdit:(i=a()(l.a.mark((function e(i){var o,s,a,r,c;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.setAttributeLinkById(t,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],a=s.getElementsByClassName("tr"),r=l.a.mark((function t(e){var o,s,r,c,u,p;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==e){t.next=31;break}a[e].innerHTML='\n
            \n \n
            \n
            \n
            \n \n \n
            \n
            \n
            \n \n \n
            ',(o=a[e].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=a[e].getElementsByTagName("button"),r=0;case 8:if(!(r1&&void 0!==arguments[1]?arguments[1]:{};if(ve(0),re(this.sdk),le(this.sdk),t)for(var n=function(n){if(e.geojson.features[n].id===t)if("Point"===e.geojson.features[n].geometry.type)e.getClampToHeight({lng:e.geojson.features[n].geometry.coordinates[0],lat:e.geojson.features[n].geometry.coordinates[1]}).then((function(t){e.sdk.viewer.camera.flyTo({orientation:i.orientation,destination:Cesium.Cartesian3.fromDegrees(e.geojson.features[n].geometry.coordinates[0],e.geojson.features[n].geometry.coordinates[1],t+(i.height||500))})}));else{var o=e.geojson.features[n].geometry.range;if(o){var s=[];e.getClampToHeight({lng:o[0],lat:o[1]}).then((function(t){var n=Cesium.Cartesian3.fromDegrees(o[0],o[1],t);s.push(n.x,n.y,n.z),e.getClampToHeight({lng:o[2],lat:o[3]}).then((function(t){var n=Cesium.Cartesian3.fromDegrees(o[2],o[3],t);s.push(n.x,n.y,n.z);var a=Cesium.BoundingSphere.fromVertices(s);e.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;o0){ji(o,e.data.total,10,1,(function(e){i.cameraSelect&&i.cameraSelect(t,e)})),s.getElementsByClassName("table-empty")[0].style.display="none",a.style.display="inline-flex";for(var r=function(t){var o='\n
            \n
            \n \n 绑定\n
            \n
            ').concat(e.data.list[t].cameraName,'
            \n
            ').concat(n[e.data.list[t].type],'
            \n
            ').concat(e.data.list[t].ip,'
            \n
            ').concat(e.data.list[t].port,'
            \n
            ').concat(e.data.list[t].userName,'
            \n
            ').concat(e.data.list[t].passWord,"
            \n
            "),s=document.createRange().createContextualFragment(o),r=s.querySelector('input[type="checkbox"]');r.addEventListener("change",(function(){if(r.checked)i._DialogObject.attribute.camera.push(e.data.list[t]);else{var n=i._DialogObject.attribute.camera.filter((function(i){return i.ID!==e.data.list[t].ID}));i._DialogObject.attribute.camera=n}})),a.appendChild(s);for(var l=0;lo&&(o=l),s+=16}s=s+10+5*(n.length-1),o+=30,e.width=o,e.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(),e.toDataURL()}},{key:"createTableContent",value:function(t){for(var e="",i=0;i
            ').concat(t.currentData[i].attr[s],"
            ");e+=n=n+o+""}return e}}]);var i,n,o,s}(Ui);function Og(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Mg(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};C()(this,e),(i=Tg(this,e,[t,n])).options.text=n.text||"未命名对象";for(var s=i.options.text.split("\n"),a=0;a80&&(s[a]=s[a].slice(0,80-s[a].length));return s.length>70&&s.splice(70-s.length),i.options.text=s.join("\n"),i.options.name=i.options.text,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.fontSize=n.fontSize||20,i.options.duration=n.duration||0===n.duration?n.duration:5e4,i.options.speed=n.speed||0===n.speed?n.speed:1,i.options.color=n.color||"#FFC107",i.options.position=n.position,i.entity,i._positionEditing=!1,i.Dialog=o,i._EventBinding=new Si,i._elms={},i.previous={position:Mg({},i.options.position)},i.event=new J(i.sdk),i.sdk.addIncetance(i.options.id,i),i.create(),i}return gi()(e,t),k()(e,[{key:"lng",get:function(){return this.options.position.lng},set:function(t){this.options.position.lng=t,this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.position.lat},set:function(t){this.options.position.lat=t,this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"text",get:function(){return this.options.text},set:function(t){var e=this;this.options.text=t;for(var i=this.options.text.split("\n"),n=0;n80){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.options.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this.entity.rectangle.coordinates=new Cesium.CallbackProperty((function(){var t,i=Math.abs(Math.cos(Math.PI/180*e.options.position.lat))*(1e-4*e.options.scale),n=[e.options.position.lng-1e-4*e.options.scale/s,e.options.position.lat-i,e.options.position.lng+1e-4*e.options.scale/s,e.options.position.lat+i];return(t=Cesium.Rectangle).fromDegrees.apply(t,n)}),!1)}this._elms.text&&this._elms.text.forEach((function(t){t.value=e.options.text}))}},{key:"angle",get:function(){return this.options.angle},set:function(t){this.options.angle=t,this._elms.angle&&this._elms.angle.forEach((function(e){e.value=t}))}},{key:"scale",get:function(){return this.options.scale},set:function(t){this.options.scale=t,this._elms.scale&&this._elms.scale.forEach((function(e){e.value=t}))}},{key:"duration",get:function(){return this.options.duration},set:function(t){this.options.duration=t;var e=this.getcanvas();this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:e.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.options.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this._elms.duration&&this._elms.duration.forEach((function(e){e.value=t}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t;var e=this.getcanvas();this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:e.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.options.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t}))}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t;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.options.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 ewPlugins("colorpicker",{el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"create",value:function(){var t=this,e=this.getcanvas(),i=e.height/e.width;this.entity=this.sdk.viewer.entities.add({id:this.options.id,show:this.options.show,rectangle:{coordinates:new Cesium.CallbackProperty((function(){var e,n=Math.abs(Math.cos(Math.PI/180*t.options.position.lat))*(1e-4*t.options.scale),o=[t.options.position.lng-1e-4*t.options.scale/i,t.options.position.lat-n,t.options.position.lng+1e-4*t.options.scale/i,t.options.position.lat+n];return(e=Cesium.Rectangle).fromDegrees.apply(e,o)}),!1),material:new Cesium.CustomMaterialSource({image:e.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.options.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),rotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(t.options.angle)}),!1),stRotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(t.options.angle)}),!1)}}),"cesium-viewer 2d"===this.sdk.viewer._element.className&&(this.entity.rectangle.height=10),It(this.sdk,this.options.id),this.options.show&>(0,this.options.id)}},{key:"edit",value:(o=a()(l.a.mark((function t(e){var i,n,o,s=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=18;break}return t.next=6,new bi(this.sdk,this.originalOptions,{title:"贴地文字属性",left:"180px",top:"100px",confirmCallBack:function(t){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),It(s.sdk,s.options.id),Et(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(t){s.show=t,s.Dialog.showCallBack&&s.Dialog.showCallBack()},translationalCallBack:function(){s.positionEditing=!s.positionEditing}},!0);case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" ground-text",(i=document.createElement("div")).innerHTML='\n \n
            \n
            \n
            \n 名称\n \n
            \n
            \n 颜色\n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n 经度\n \n
            \n
            \n 纬度\n \n
            \n
            \n
            \n \n
            \n
            \n
            \n 旋转角度\n \n
            \n \n °\n \n
            \n
            \n
            \n
            \n
            \n 调整大小\n \n
            \n \n \n
            \n
            \n
            \n
            \n
            \n 滚动速度\n \n
            \n \n \n
            \n
            \n
            \n
            \n \n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,o=new ewPlugins("colorpicker",{el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){s.color=t},clear:function(){s.color="rgba(255,255,255,1)"}}),this._elms.color=[o],t.next=19;break;case 18:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 19:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"positionEditing",get:function(){return this._positionEditing},set:function(t){var e=this;this._positionEditing=t,this.previous={position:Mg({},this.options.position)},!0===t?(this.tip&&this.tip.destroy(),this.tip=new q("点击鼠标左键确认,右键取消",this.sdk),this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.lng=e.previous.position.lng,e.lat=e.previous.position.lat,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.lng=e.previous.position.lng,e.lat=e.previous.position.lat,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=t.lng,e.lat=t.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.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())}},{key:"flyTo",value:(n=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c,u,p,h,d,m,f,v,g,y,b=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=b.length>0&&void 0!==b[0]?b[0]:{},i=this.getcanvas(),n=i.height/i.width,ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=this.options.customView.relativePosition.lat,r=this.options.customView.relativePosition.alt,c=Cesium.Cartesian3.fromDegrees(s,a,r),u={lng:0,lat:0},this.options.position?u=Mg({},this.options.position):this.options.positions?u=Mg({},this.options.positions[0]):this.options.center?u=Mg({},this.options.center):this.options.start?u=Mg({},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")){t.next=18;break}return t.next=17,this.getClampToHeight(u);case 17:u.alt=t.sent;case 18:s=this.options.customView.relativePosition.lng+u.lng,a=this.options.customView.relativePosition.lat+u.lat,r=this.options.customView.relativePosition.alt+u.alt,c=Cesium.Cartesian3.fromDegrees(s,a,r),this.sdk.viewer.camera.flyTo({destination:c,orientation:o}),t.next=34;break;case 25:return p=Math.abs(Math.cos(Math.PI/180*this.options.position.lat))*(1e-4*this.options.scale),h=[[this.options.position.lng-1e-4*this.options.scale/n,this.options.position.lat-p],[this.options.position.lng+1e-4*this.options.scale/n,this.options.position.lat+p]],t.next=29,this.getClampToHeight(this.options.position);case 29:for(d=t.sent,m=[],f=0;f80&&(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;s2&&void 0!==arguments[2]?arguments[2]:{};C()(this,e),(n=Bg(this,e,[t,i])).options.text=i.text||"未命名对象";for(var s=n.options.text.split("\n"),a=0;a80&&(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,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||[],n.options.attribute.camera=n.options.attribute.camera||[],n.options.attributeType=i.attributeType||"richText",n.extrudedHeight,n._EventBinding=new Si,n.Dialog=o,n._elms={},n.sdk.addIncetance(n.options.id,n),e.create(n),n}return gi()(e,t),k()(e,[{key:"text",get:function(){return this.options.text},set:function(t){this.options.text=t;for(var e=this.options.text.split("\n"),i=0;i80){window.ELEMENT&&window.ELEMENT.Message({message:"行超过80个字符,请按回车(Enter)后,继续输入",type:"warning",duration:1e3}),e[i]=e[i].slice(0,80-e[i].length)}if(e.length>70){e.splice(70-e.length);window.ELEMENT&&window.ELEMENT.Message({message:"超过最大输入字符",type:"warning",duration:1e3})}if(this.options.text=e.join("\n"),this.entity){for(var n=this.options.positions,o=[],s=[],a=[],r=this.getMaterial(),l=this.computeDistance(n),c=this.aspectRatio?l/this.aspectRatio:0,u=0;u\n
            \n
            \n
            \n 名称\n \n
            \n
            \n 颜色\n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n 滚动速度\n \n \n
            \n
            \n
            \n \n ',this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera,o=new ewPlugins("colorpicker",{el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){p.color=t},clear:function(){p.color="rgba(255,255,255,1)"}}),s=new ewPlugins("colorpicker",{el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelColor=t},clear:function(){p.labelColor="rgba(255,255,255,1)"}}),a=new ewPlugins("colorpicker",{el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelLineColor=t},clear:function(){p.labelLineColor="rgba(255,255,255,1)"}}),r=new ewPlugins("colorpicker",{el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelBackgroundColorStart=t},clear:function(){p.labelBackgroundColorStart="rgba(255,255,255,1)"}}),c=new ewPlugins("colorpicker",{el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelBackgroundColorEnd=t},clear:function(){p.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),u=n.getElementsByTagName("*"),this._EventBinding.on(this,u),this._elms=this._EventBinding.element,this._elms.color=[o],this._elms.labelColor=[s],this._elms.labelLineColor=[a],this._elms.labelBackgroundColorStart=[r],this._elms.labelBackgroundColorEnd=[c],t.next=29;break;case 28:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 29:case"end":return t.stop()}}),t,this)}))),function(t){return o.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 t=this.options.positions,e=[],i=[],n=[],o=this.computeDistance(t),s=this.aspectRatio?o/this.aspectRatio:0,a=0;a80&&(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;s1&&void 0!==arguments[1]?arguments[1]:function(){};if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n;YJ.Measure.SetMeasureStatus(!0),t.tip=new q("请选择一个顶点,右键取消",t.sdk),t.event=new J(t.sdk),t.nodePoints=[];for(var o=t.options.positions,s=[],a=[],r=[],l=t.computeDistance(o),c=t.aspectRatio?l/t.aspectRatio:0,u=0;u=500?d(o,i):h(o,i)}))}));for(var m=0;m2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),(n=Ig(this,e)).sdk=t,n.viwer=t.viewer,n.options=jg({},i),n.options.host=i.host||m(),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 Si,e.setDefaultValue(n),n.requestResource(),n.ControllerObject=new An(n.sdk,{position:jg({},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 gi()(e,t),k()(e,[{key:"requestResource",value:function(){this.addResource().then((function(t){}))}},{key:"addResource",value:(o=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c,u,p,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=this).options.xmlURL=e.options.objUrl.replace(".obj",".xml"),""===e.options.xmlURL){t.next=34;break}return t.next=5,fetch(e.options.xmlURL);case 5:if(!(i=t.sent).ok){t.next=32;break}return t.next=9,i.text();case 9:return n=t.sent,o=new DOMParser,s=o.parseFromString(n,"text/xml"),a=s.getElementsByTagName("Position")[0].textContent.split(","),r=s.getElementsByTagName("Crs")[0].textContent,c=e.convert([{x:a[0],y:a[1],z:a[2]}],r,"EPSG:4326"),e.options.position=e.options.position||{lng:c.points[0].x,lat:c.points[0].y,alt:c.points[0].z},e.ControllerObject.position=e.options.position,u=e.viwer.scene,p=Cesium.Cartesian3.fromDegrees(e.options.position.lng,e.options.position.lat,e.options.position.alt),h=Cesium.Transforms.headingPitchRollToFixedFrame(p,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(.85),Cesium.Math.toRadians(0),Cesium.Math.toRadians(0))),t.next=22,window.objLoader.Load(e.options.objUrl);case 22:(d=t.sent).show=e.options.show,d.modelMatrix=h,d.setFlvVideo(e.options.videoUrl),u.primitives.add(d),e.primitive=d,e.controllerCallBack({rotate:{x:e.options.roll,y:-e.options.pitch,z:-e.options.heading},position:jg({},e.options.position)}),this.loaded=!0,this._loaded=!0,this._loadEvent&&this._loadEvent();case 32:t.next=36;break;case 34:return console.error("请填写xml路径"),t.abrupt("return");case 36:if(""!==e.options.objUrl){t.next=39;break}return console.error("请填写obj模型路径"),t.abrupt("return");case 39:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"flyTo",value:(n=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c,u,p=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=p.length>0&&void 0!==p[0]?p[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ve(0),re(this.sdk),le(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.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,a=Cesium.Cartesian3.fromDegrees(n,o,s),r={lng:0,lat:0},this.options.position?r=jg({},this.options.position):this.options.positions?r=jg({},this.options.positions[0]):this.options.center?r=jg({},this.options.center):this.options.start?r=jg({},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")){t.next=18;break}return t.next=17,this.getClampToHeight(r);case 17:r.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+r.lng,o=this.options.customView.relativePosition.lat+r.lat,s=this.options.customView.relativePosition.alt+r.alt,a=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:a,orientation:i}),t.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:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}});case 28:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"edit",value:(i=a()(l.a.mark((function t(){var e,i,n,o,s,a,r,c,u=this,p=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return p.length>0&&void 0!==p[0]&&p[0],e=!1,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),t.next=6,new bi(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(t){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=t.sent,(i=document.createElement("div")).style.width="448px",i.innerHTML='\n \n
            \n
            \n
            \n 名称\n \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n 经度\n \n
            \n
            \n 海拔高度\n
            \n \n m\n \n
            \n
            \n
            \n
            \n
            \n 纬度\n \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n 缩放\n
            \n \n 是否等比例缩放\n
            \n
            \n
            \n \n \n
            \n \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=e,n.addEventListener("change",(function(t){(e=t.target.checked)?(o.style.display="flex",s.style.display="none"):(o.style.display="none",s.style.display="flex")})),(a=o.getElementsByTagName("input"))[0].value=this.scaleX,a[1].value=this.scaleX,a[0].addEventListener("input",(function(t){u.scaleX=t.target.value,u.scaleY=t.target.value,u.scaleZ=t.target.value})),a[1].addEventListener("input",(function(t){u.scaleX=t.target.value,u.scaleY=t.target.value,u.scaleZ=t.target.value})),e?(o.style.display="flex",s.style.display="none"):(o.style.display="none",s.style.display="flex"),setTimeout((function(){if(u._DialogObject._element.foot){var t=u._DialogObject._element.foot.getElementsByClassName("rotate")[0];t&&(t.style.position="absolute",t.style.left="100px")}}),0),r=i.getElementsByTagName("*"),c=0;c1&&void 0!==arguments[1]?arguments[1]:{};C()(this,t),this.sdk=e,this.options=Ug({},i),this.options.show=!i.show&&!1!==i.show||i.show,this.options.host=this.options.host||m(),this.objModelObject=[],this._loaded=!1,this._loadEvent=void 0,this.on()}),[{key:"show",get:function(){return this.options.show},set:function(t){var e=this;if("boolean"==typeof t){this.options.show=t;for(var i=function(i){e.objModelObject[i].load((function(){e.objModelObject[i].show=t}))},n=0;n1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return C()(this,e),Xg(i=qg(this,e,[t,n]),Qg,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 gi()(e,t),k()(e,[{key:"repeat",get:function(){return this.options.repeat},set:function(t){if(this.options.repeat!=Number(t)&&(this.options.repeat=Number(t),this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content)){var e=this._DialogObject._element.content.querySelector("input[name='repeat']");e.checked=t===1/0,this.Dialog.changeRepeatStateCallBack&&this.Dialog.changeRepeatStateCallBack(e.checked)}}},{key:"edit",value:(i=a()(l.a.mark((function t(e){var i,n,o,s,a,r,c,u,p,h,d,m,f,v,g=this;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this,n=this.sdk.viewer,o=0,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=44;break}return s=function(t){var e=r.getElementsByClassName("tr");e.length>0&&(e[e.length-1].querySelector("input[name='time']").disabled=void 0);var s=r.getElementsByClassName("tr active")[0];s&&(s.className="tr");var a=document.createElement("div");a.className="tr active",a.innerHTML='\n
            视点'.concat(u+1,'
            \n
            \n \n
            \n
            \n
            \n '),a.addEventListener("click",(function(t){if(t.target.parentNode===a){var i=r.getElementsByClassName("tr active")[0];i&&(i.className="tr"),a.className="tr active";for(var n=0;nn+1?(o--,e[o-1].className="tr active"):o==n+1&&(e.length==n&&(o-=1),0!=e.length&&(e[o-1].className="tr active")),e.length>0){var s=e[e.length-1].querySelector("input[name='time']");s.disabled="disabled",s.value=0}break}})),h.addEventListener("input",(function(e){f.checked=!1,t.duration=Number(h.value),t.duration<0&&(t.duration=0)})),h.addEventListener("blur",(function(){h.value=Number(Number(h.value).toFixed(2)),h.value<0&&(h.value=0)})),r.insertBefore(a,e[o]),o++,e[e.length-1].querySelector("input[name='time']").disabled="disabled"},t.next=8,new G(n._container,{title:"飞行漫游",left:"180px",top:"100px",closeCallBack:function(){g.cease()}});case 8:return this._DialogObject=t.sent,t.next=11,this._DialogObject.init();case 11:for((a=document.createElement("div")).className="fly-roam",a.innerHTML='\n \n
            \n
            \n
            \n 名称\n \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n \n 设置总时长\n
            \n \n 秒(s)\n \n
            \n
            \n
            \n \n 是否循环播放\n
            \n
            \n
            \n \n
            \n
            \n
            \n \n
            \n
            \n \n
            \n
            \n \n
            \n
            \n \n
            \n
            \n
            \n
            \n
            \n
            序号
            \n
            时长(s)
            \n
            操作
            \n
            \n
            \n
            \n
            \n
            \n

            暂无数据

            \n
            \n
            \n
            \n
            \n \n ',this._DialogObject.contentAppChild(a),a.getElementsByTagName("*"),r=a.getElementsByClassName("table-body")[0],c=a.getElementsByClassName("table-empty")[0],u=0,p=new Proxy([],{set:function(t,e,i){return t[e]=i,t.length>0?c.style.display="none":c.style.display="flex",!0}}),u=0;u0&&g.flyTo(0)})),a.getElementsByClassName("add-point")[0].addEventListener("click",(function(){var t={duration:0,position:g.cartesian3Towgs84(n.camera.position,n),orientation:{heading:n.camera.heading,pitch:n.camera.pitch,roll:n.camera.roll}};p.splice(o,0,t),g.options.points.splice(o,0,t),s(t),u++})),a.getElementsByClassName("modify-point")[0].addEventListener("click",(function(){if(o){var t=g.cartesian3Towgs84(n.camera.position,n);g.options.points[o-1].position=p[o-1].position=t,g.options.points[o-1].orientation=p[o-1].orientation={heading:n.camera.heading,pitch:n.camera.pitch,roll:n.camera.roll}}})),m=a.querySelector("input[name='totalTime']"),f=a.querySelector("input[name='isTotalTime']"),v=a.querySelector("input[name='repeat']"),f.addEventListener("change",(function(){var t=r.getElementsByClassName("tr");if(f.checked&&t.length>0){for(var e=Number((Number(m.value)/(t.length-1)).toFixed(2)),i=0;i0){for(var e=Number((Number(m.value)/(t.length-1)).toFixed(2)),i=0;i0&&void 0!==arguments[0]?arguments[0]:0;ve(0);var i=this,n=this.options.points,o=this.repeat;re(i.sdk);var s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1?arguments[1]:void 0;Kg(Qg,t)&&Kg(Qg,t).destroy();var r=t;Zg(Qg,t,new Cesium.ScreenSpaceEventHandler(r.sdk.viewer.canvas)),Kg(Qg,t).setInputAction((function(e){t.cease()}),Cesium.ScreenSpaceEventType.RIGHT_CLICK);var c,u=r.sdk.viewer;ve(0),u.camera.cancelFlight(),u.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(n[e].position.lng,n[e].position.lat,n[e].position.alt),orientation:n[e].orientation,duration:i?n[e-1].duration:.5,maximumHeight:n[e].position.alt,complete:(c=a()(l.a.mark((function i(){return l.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:e++,t.repeat===1/0?o=1/0:o===1/0&&(o=t.repeat),e<=n.length-1?s(e,!0):o?(o--,s(0)):Kg(Qg,t)&&Kg(Qg,t).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})};s(e)}},{key:"cease",value:function(){this.sdk&&this.sdk.viewer&&this.sdk.viewer.camera.cancelFlight(),Kg(Qg,this)&&Kg(Qg,this).destroy()}},{key:"remove",value:function(){this._DialogObject&&this._DialogObject.close?(this._DialogObject.close(),this._DialogObject=null):this.cease()}}]);var i}(Ui);function ey(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var iy=function(){return k()((function t(e,i,n){C()(this,t),this.options=function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:"move",e=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"===t){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,e,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"===t&&(this.position=e,this.options.videoUrl&&this.updatePolygonPosition()),n&&(this.syncHpr(),this.updateFrustumAttributes())}},{key:"syncHpr",value:function(){if(this.viewer1){var t=this.options.position,e=t.lng,i=t.lat,n=t.alt,o=-this.hpr.pitch-Cesium.Math.toRadians(-90);this.viewer1.camera.setView({destination:Cesium.Cartesian3.fromDegrees(e,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 t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.head,e=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(t){return t*Math.PI/180}"alone"==o?(this.hpr.heading=s(t),this.hpr.pitch=s(e),this.hpr.roll=s(i)):(this.hpr.heading=Cesium.Math.negativePiToPi(t),this.hpr.pitch=Cesium.Math.negativePiToPi(e),this.hpr.roll=Cesium.Math.negativePiToPi(i)),n&&(this.syncHpr(),this.updateFrustumAttributes())}},{key:"updateFrustumAttributes",value:function(){if(this.position&&this.hpr){var t=Cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpr);if(t)try{var e=new Cesium.FrustumOutlineGeometry({frustum:this.frustum,origin:Cesium.Matrix4.getTranslation(t,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(t,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(t,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(t,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:e,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(t){console.error("Error in drawFrustum:",t)}else console.error("Transform generation failed.")}else console.error("Position or HPR is not defined:",this.position,this.hpr)}},{key:"updateFrustumNearFar",value:function(t,e){this.frustum.near=t,this.frustum.far=e,this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"updateFrustumFov",value:function(t){this.frustum.fov=Cesium.Math.toRadians(t),this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t&&(this.options.show=t,this.currentFrustumOutline.show=t,this.currentFrustumFilled.show=t)}},{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(t){var e;t.options.position=t.options.position||{},t.options.fov=t.options.fov||30,t.options.aspectRatio=t.options.aspectRatio||1,t.options.near=t.options.near||1,t.options.far=t.options.far||120,t.options.heading=t.options.heading||0,t.options.pitch=t.options.pitch||90,t.options.roll=t.options.roll||0,t.options.show=null===(e=t.options.show)||void 0===e||e,t.options.videoUrl=t.options.videoUrl||"",t.options.index=t.options.index||0,t.options.arr=t.options.arr||[],t.options.normalHeight=t.options.normalHeight||100}}]);var t,e}();function ny(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var oy=function(){return k()((function t(e,i){C()(this,t),this.options=function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;C()(this,t),this.options=ay({},e),this.viewer=i,this.viewer1=n,this.entity=null,this.frustum=null,this.billordPointLineMaps=[],this.index=0,this.positions=[],t.setDefaultValue(this),this.create()}),[{key:"create",value:function(){var t=this;if(!(this.options.positions.length<2)){var e=this.options.frustumShow;this.entity=this.viewer.entities.add({show:this.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){for(var e=[],i=0;ithis.options.positions.length-1||this.index<0){var e=this.index>0?"已选中最后一个航点":"已选中第一个航点";alert(e)}else for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return C()(this,e),(i=ly(this,e,[t,n])).options.tipText=n.tipText?n.tipText:"左键确定,右键结束;",i}return gi()(e,t),k()(e,[{key:"start",value:function(t){var e=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var i=void 0;YJ.Measure.SetMeasureStatus(!0),this.tip=new q(this.options.tipText,this.sdk),this.event=new J(this.sdk),this.isEntity=!1,this.event.mouse_left((function(n,o){e.end();var s=e.cartesian3Towgs84(i||o,e.viewer),a=e.viewer.scene.pick(n.position);Cesium.defined(a)&&Cesium.defined(a.id)&&a.id.id===window.airportEntity.options.id&&(e.isEntity=!0),t(null,s,e.isEntity)})),this.event.mouse_right((function(i,n){e.end(),t(!1)})),this.event.mouse_move((function(t,n){i=n,e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.gesture_pinck_start((function(n,o){var s=new Date;e.event.gesture_pinck_end((function(){if(new Date-s>=500)e.end(),t(!1);else{e.end();var n=e.cartesian3Towgs84(i||o,e.viewer);t(null,n)}}))}))}}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event.destroy(),this.tip.destroy()}}])}(Oo),uy=Symbol("测量状态");Symbol("录屏对象");window.YJ||(window.YJ={on:function(){var t=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(e,i){var n=y(),o=["/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/liveplayer/liveplayer-element.min.js","/custom/css/index.css"];window.YJSDK3rdpartyResourceAddress=n+"/3rdparty",t.ws&&o.push("/3rdparty/reconnecting-websocket.js"),(t.flv||t.rtsp)&&o.push("/3rdparty/flv.min.js");var s=[];o.forEach((function(t){var e;t.endsWith(".js")?((e=document.createElement("script")).setAttribute("type","text/javascript"),e.setAttribute("src",n+t)):((e=document.createElement("link")).setAttribute("rel","stylesheet"),e.setAttribute("href",n+t)),document.querySelector("html").appendChild(e);var i=new Promise((function(t,i){e.onload=function(){t()}})).then((function(t){return t}));s.push(i)}));var a=document.createElement("script");a.setAttribute("type","module"),a.textContent="\n import * as THREE from '".concat(n,"/3rdparty/three/three.module.min.js';\n window.THREE = THREE\n "),document.querySelector("html").appendChild(a);var r=document.createElement("script");r.setAttribute("type","module"),r.textContent="\n import { SVGLoader } from '".concat(n,"/3rdparty/three/jsm/loaders/SVGLoader.js';\n window.SVGLoader = SVGLoader\n "),document.querySelector("html").appendChild(r),Promise.all(s).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(){d(t.host),t.username?p(t).then((function(t){e()})):e()},(s=document.createElement("script")).setAttribute("type","text/javascript"),s.setAttribute("src",n+"/3rdparty/CesiumHeatmap.js"),document.querySelector("html").appendChild(s)})).catch((function(t){i(t)}))}))},Obj:{ArcgisWXImagery:Ha,ArcgisBLUEImagery:Ga,ArcgisLWImagery:Ua,GDLWImagery:Ja,GDWXImagery:qa,GDSLImagery:Xa,Tileset:gr,BIM:Pr,Layer:$r,Layer3rdparty:tl,Terrain:pl,Flame:Cl,Smoke:Ol,Fountain:Rl,Spout:Wl,WaterSurface:Iu,CircleDiffuse:an,CircleObject:Oc,EllipseObject:jc,RadarScan:dn,RadarScanStereoscopic:ku,SectorObject:Ou,WallStereoscopic:Wc,WallRealStereoscopic:tu,KML:Tu,GeoJson:Bu,BillboardObject:bn,PolygonObject:Sn,PolyhedronObject:ec,AssembleObject:lc,AttackArrowObject:fc,PincerArrowObject:kc,PolylineObject:Fn,CurvelineObject:pu,Explosion:fu,Model:Vr,Model2:Xr,TrajectoryMotion:Xu,TrajectoryMotionObject:sp,Road:rp,Graffiti:cp,GroundImage:dp,GroundSvg:Yv,RoutePlanning:Kv,Shp:cg,Vector:Pg,GroundText:Ng,StandText:Ag,RichText:Li,LocateCurrent:Eo,LoadObjModel:Rg,Heatmap:Jg,FlyRoam:ty,newAirLine:ry,FRUSTUN:iy,Dialog:bi},YJEarth:ri,Tools:ye,Proj:j,Global:o()({getCurrentView:function(t){var e=new ye,i=t.viewer;return JSON.parse(JSON.stringify({position:e.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(t,e){var i=t.viewer;e?i.CAMERA_DEFAULT_VIEW_RECTANGLE={destination:e.destination||{},orientation:e.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(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=t.viewer,n=0;n1&&void 0!==arguments[1]&&arguments[1];to&&t.viewer.scene.postProcessStages.remove(to),e&&(to=new Cesium.PostProcessStage({name:"rain",fragmentShader:oo,uniforms:{tiltAngle:-.4,rainSize:.3,rainWidth:40,rainSpeed:100}}),t.viewer.scene.postProcessStages.add(to))},snow:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];eo&&t.viewer.scene.postProcessStages.remove(eo),e&&(eo=new Cesium.PostProcessStage({name:"snow",fragmentShader:so,uniforms:{snowSize:2,snowSpeed:60}}),t.viewer.scene.postProcessStages.add(eo))},fog:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];io&&t.viewer.scene.postProcessStages.remove(io),e&&(io=new Cesium.PostProcessStage({name:"fog",fragmentShader:ao,uniforms:{visibility:.2,fogColor:Cesium.Color.WHITE}}),t.viewer.scene.postProcessStages.add(io))},nightVision:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];no&&t.viewer.scene.postProcessStages.remove(no),e&&(no=Cesium.PostProcessStageLibrary.createNightVisionStage(),t.viewer.scene.postProcessStages.add(no))},skyStarry:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.viewer.scene.skyAtmosphere.show=!e},illumination:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.viewer.shadows=e,t.viewer._shadows=e}},CameraController:ie,CesiumContainer:ne,setBillboardDefaultUrl:oe,getBillboardDefaultUrl:se,multiViewportMode:{on:function(t){return Bt.apply(this,arguments)},off:At,get2DView:Yt},MouseCoordinate:function(t,e){var i=new ye(t);if(e){var n=function(){co=requestAnimationFrame(n),l()};ro&&ro.destroy(),ro=new J(t);var s,a,r={x:"",y:"",z:""};lo?s=lo:((s=document.createElement("div")).style.position="absolute",s.style["z-index"]=777,s.style.color="white",s.style.left="0px",s.style.top="0px",s.style.width="100%",s.style.height="100%",s.style["font-size"]="12px",s.style["pointer-events"]="none",s.style.background="url(".concat(i.getSourceRootPath(),"/img/cross.png) no-repeat 100% 100%"),s.style["background-size"]="200% 200%",lo=s),t.viewer._element.appendChild(s),ro.mouse_move((function(t,e){a=function(t){for(var e=1;e

            经度:").concat(c.lng.toFixed(6),"°

            维度:").concat(c.lat.toFixed(6),"°

            海拔:").concat(c.alt.toFixed(2)," m

            ");else{var p=i.convert([{x:c.lng,y:c.lat,z:c.alt}],"EPSG:4326",u);r=p.points[0],s.innerHTML="

            x:").concat(r.x.toFixed(6),"

            y:").concat(r.y.toFixed(6),"

            z:").concat(r.z.toFixed(6),"

            ")}}else{var h=de();s.innerHTML="EPSG:4326"===h?"

            经度:-

            维度:-

            海拔:-

            "):"

            x:-

            y:-

            z:-

            ")}}};n()}else ro&&(ro.destroy(),ro=void 0),lo&&(t.viewer._element.removeChild(lo),lo=void 0),co&&cancelAnimationFrame(co)},MouseRightMenu:function(t,e,i){if(t&&t.div_id){var n=new ye;yo[t.div_id]||(yo[t.div_id]={}),yo[t.div_id].mousedown&&document.removeEventListener("mousedown",yo[t.div_id].mousedown),yo[t.div_id].click&&document.removeEventListener("click",yo[t.div_id].click),yo[t.div_id].mouseRightMenuEvent&&yo[t.div_id].mouseRightMenuEvent.destroy();var o=document.getElementById("custom-menu");o&&t.viewer._element.removeChild(o),e&&(yo[t.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 i=document.getElementById("custom-menu");i&&t.viewer._element.removeChild(i)}},document.addEventListener("mousedown",yo[t.div_id].mousedown),yo[t.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 i=document.getElementById("custom-menu");i&&t.viewer._element.removeChild(i)}},document.addEventListener("click",yo[t.div_id].click),yo[t.div_id].mouseRightMenuEvent=new J(t),yo[t.div_id].mouseRightMenuEvent.mouse_right((function(e,o){if(!YJ.Measure.GetMeasureStatus()&&!t.viewer.trackedEntity){var s=t.viewer.entities.getById("svg-control-points_0");if(!s||!s.show){var a=document.getElementById("custom-menu");a&&t.viewer._element.removeChild(a);var r,l=function(e){var i=t.viewer.scene.pick(e.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}(e);"[object Object]"===Object.prototype.toString.call(l)&&(r=l.id,l=l.parentId);var c="",u=t.entityMap.get(l);if(!u&&l){var p=l.split("-");p.splice(p.length-1,1),l=p.join("-"),u=t.entityMap.get(l)}u&&u.picking&&(c='\n \n
              \n
            • 属性
            • \n
            \n ');var h=n.cartesian3Towgs84(o,t.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
              \n
            • 绕鼠标点旋转
            • \n
            \n '.concat(c,"\n "),t.viewer._element.appendChild(a);var d=e.position.x,m=e.position.y;e.position.x+a.offsetWidth>t.viewer._element.offsetWidth&&(d=e.position.x-a.offsetWidth),e.position.y+a.offsetHeight>t.viewer._element.offsetHeight&&(m=e.position.y-a.offsetHeight),a.style.left=d+"px",a.style.top=m+"px",a.addEventListener("contextmenu",(function(t){t.preventDefault()}));for(var f=a.getElementsByTagName("li"),v={},g=function(e){f[e].addEventListener("mouseover",(function(){f[e].style.backgroundColor="#5e5e5e"})),f[e].addEventListener("mouseout",(function(){f[e].style.backgroundColor="unset"})),f[e].addEventListener("click",(function(){var n="";switch(f[e].innerHTML){case"绕鼠标点旋转":v.position=h,n="rotateAround";break;case"属性":r?(v.id=r,v.parentId=u.options.id):v.id=u.options.id,n="attribute"}i(n,v),t.viewer._element.removeChild(a)}))},y=0;y0&&void 0!==arguments[0]?arguments[0]:0,e=Array.from(Q[t].keys());e.forEach((function(e){document.documentElement.style.setProperty(e,Q[t].get(e))}))},getCesiumManageIndexexDBState:me,setCesiumManageIndexexDBState:fe,getCesiumIndexedDBMaxSize:function(){var t=Number(Number(localStorage.getItem("IndexedDBMaxSize")).toFixed(0));return(isNaN(t)||t<1073741824)&&(t=1073741824),t},setCesiumIndexedDBMaxSize:function(t){var e=Number(Number(t).toFixed(0));(isNaN(e)||e<1073741824)&&(e=1073741824),Cesium.ManageIndexedDB&&Cesium.ManageIndexedDB.SetIndexedDBMaxSize(e),localStorage.setItem("IndexedDBMaxSize",e)},getCesiumIndexedDBCurrentSize:function(){return Cesium.ManageIndexedDB&&Cesium.ManageIndexedDB.GetIndexedDBCurrentSize()},enablePerspective:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;e||0==e||(e=1),t.viewer.scene.globe.translucency.frontFaceAlpha=e}},"splitScreen",{on:function(t){return dt.apply(this,arguments)},off:mt,setActiveId:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(rt=Array.isArray(t)?t:[t],st&&ot){var e=st.viewer._element.getElementsByClassName("YJ-custom-checkbox-left")[0],i=st.viewer._element.getElementsByClassName("YJ-custom-checkbox-right")[0];if(t&&0!==t.length){if(e&&i)for(var n=0;n0&&void 0!==arguments[0]&&arguments[0];YJ.Measure[uy]=t},Clear:function(){YJ.Measure.Measures.forEach((function(t){t.destroy()})),YJ.Measure.Measures=[]},Measures:[],MeasureDistance:Ps,MeasureProjectionDistance:Bs,MeasureSlopeDistance:Rs,MeasureTyArea:Gs,MeasureTdArea:qs,MeasureTriangle:Ks,MeasureLocation:ta,MeasureHeight:na,MeasureAngle:aa,MeasureAzimuth:ca},Draw:{DrawPolyline:pa,DrawPolygon:Bo,DrawPoint:da,DrawCircle:fa,DrawElliptic:ga,DrawAttackArrow:ba,DrawPincerArrow:wa,DrawRect:_a,DrawAssemble:Sa,DrawSector:Pa,DrawTakeOff:cy},Analysis:{Clear:function(){YJ.Analysis.Analyses.forEach((function(t){t.destroy()}))},CutFillAnalysis:Ao,Submerge:Ro,ViewShed:Uo,CircleViewShed:$o,SlopeAspect:is,Profile:os,Visibility:as,Contour:rs,Section:ps,TerrainExcavation:ms,Flat:bs,Analyses:[]},CoordTransform:Na,RoutePlanningArrays:[],ClearAllRoutePlanning:function(){YJ.RoutePlanningArrays.forEach((function(t){t.destroy()})),YJ.RoutePlanningArrays=[]}},window.YJ.Obj.LoadObjModel=Hg,window.YJ.Obj.BatchLoadObjModel=Wg)}]); \ No newline at end of file diff --git a/public/js/reconnecting-websocket.js b/public/js/reconnecting-websocket.js new file mode 100644 index 0000000..40218d3 --- /dev/null +++ b/public/js/reconnecting-websocket.js @@ -0,0 +1,382 @@ +// MIT License: +// +// Copyright (c) 2010-2012, Joe Walnes +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +/** + * This behaves like a WebSocket in every way, except if it fails to connect, + * or it gets disconnected, it will repeatedly poll until it successfully connects + * again. + * + * It is API compatible, so when you have: + * ws = new WebSocket('ws://....'); + * you can replace with: + * ws = new ReconnectingWebSocket('ws://....'); + * + * The event stream will typically look like: + * onconnecting + * onopen + * onmessage + * onmessage + * onclose // lost connection + * onconnecting + * onopen // sometime later... + * onmessage + * onmessage + * etc... + * + * It is API compatible with the standard WebSocket API, apart from the following members: + * + * - `bufferedAmount` + * - `extensions` + * - `binaryType` + * + * Latest version: https://github.com/joewalnes/reconnecting-websocket/ + * - Joe Walnes + * + * Syntax + * ====== + * var socket = new ReconnectingWebSocket(url, protocols, options); + * + * Parameters + * ========== + * url - The url you are connecting to. + * protocols - Optional string or array of protocols. + * options - See below + * + * Options + * ======= + * Options can either be passed upon instantiation or set after instantiation: + * + * var socket = new ReconnectingWebSocket(url, null, { debug: true, reconnectInterval: 4000 }); + * + * or + * + * var socket = new ReconnectingWebSocket(url); + * socket.debug = true; + * socket.reconnectInterval = 4000; + * + * debug + * - Whether this instance should log debug messages. Accepts true or false. Default: false. + * + * automaticOpen + * - Whether or not the websocket should attempt to connect immediately upon instantiation. The socket can be manually opened or closed at any time using ws.open() and ws.close(). + * + * reconnectInterval + * - The number of milliseconds to delay before attempting to reconnect. Accepts integer. Default: 1000. + * + * maxReconnectInterval + * - The maximum number of milliseconds to delay a reconnection attempt. Accepts integer. Default: 30000. + * + * reconnectDecay + * - The rate of increase of the reconnect delay. Allows reconnect attempts to back off when problems persist. Accepts integer or float. Default: 1.5. + * + * timeoutInterval + * - The maximum time in milliseconds to wait for a connection to succeed before closing and retrying. Accepts integer. Default: 2000. + * + */ +// (function (global, factory) { +// if (typeof define === 'function' && define.amd) { +// define([], factory); +// } else if (typeof module !== 'undefined' && module.exports){ +// module.exports = factory(); +// } else { +// global.ReconnectingWebSocket = factory(); +// } +// })(this, function () { +// +// if (!('WebSocket' in window)) { +// return; +// } + +function ReconnectingWebSocket(url, protocols, options) { + + // Default settings + var settings = { + + /** Whether this instance should log debug messages. */ + debug: false, + + /** Whether or not the websocket should attempt to connect immediately upon instantiation. */ + automaticOpen: true, + + /** The number of milliseconds to delay before attempting to reconnect. */ + reconnectInterval: 1000, + /** The maximum number of milliseconds to delay a reconnection attempt. */ + maxReconnectInterval: 30000, + /** The rate of increase of the reconnect delay. Allows reconnect attempts to back off when problems persist. */ + reconnectDecay: 1.5, + + /** The maximum time in milliseconds to wait for a connection to succeed before closing and retrying. */ + timeoutInterval: 2000, + + /** The maximum number of reconnection attempts to make. Unlimited if null. */ + maxReconnectAttempts: null, + + /** The binary type, possible values 'blob' or 'arraybuffer', default 'blob'. */ + binaryType: 'blob' + } + if (!options) { + options = {}; + } + + // Overwrite and define settings with options if they exist. + for (var key in settings) { + if (typeof options[key] !== 'undefined') { + this[key] = options[key]; + } else { + this[key] = settings[key]; + } + } + + // These should be treated as read-only properties + + /** The URL as resolved by the constructor. This is always an absolute URL. Read only. */ + this.url = url; + + /** The number of attempted reconnects since starting, or the last successful connection. Read only. */ + this.reconnectAttempts = 0; + + /** + * The current state of the connection. + * Can be one of: WebSocket.CONNECTING, WebSocket.OPEN, WebSocket.CLOSING, WebSocket.CLOSED + * Read only. + */ + this.readyState = WebSocket.CONNECTING; + + /** + * A string indicating the name of the sub-protocol the server selected; this will be one of + * the strings specified in the protocols parameter when creating the WebSocket object. + * Read only. + */ + this.protocol = null; + + // Private state variables + + var self = this; + var ws; + var forcedClose = false; + var timedOut = false; + var eventTarget = document.createElement('div'); + + // Wire up "on*" properties as event handlers + + eventTarget.addEventListener('open', function (event) { + self.onopen(event); + }); + eventTarget.addEventListener('close', function (event) { + self.onclose(event); + }); + eventTarget.addEventListener('connecting', function (event) { + self.onconnecting(event); + }); + eventTarget.addEventListener('message', function (event) { + self.onmessage(event); + }); + eventTarget.addEventListener('error', function (event) { + self.onerror(event); + }); + + // Expose the API required by EventTarget + + this.addEventListener = eventTarget.addEventListener.bind(eventTarget); + this.removeEventListener = eventTarget.removeEventListener.bind(eventTarget); + this.dispatchEvent = eventTarget.dispatchEvent.bind(eventTarget); + + /** + * This function generates an event that is compatible with standard + * compliant browsers and IE9 - IE11 + * + * This will prevent the error: + * Object doesn't support this action + * + * http://stackoverflow.com/questions/19345392/why-arent-my-parameters-getting-passed-through-to-a-dispatched-event/19345563#19345563 + * @param s String The name that the event should use + * @param args Object an optional object that the event will use + */ + function generateEvent(s, args) { + var evt = document.createEvent("CustomEvent"); + evt.initCustomEvent(s, false, false, args); + return evt; + }; + + this.open = function (reconnectAttempt) { + ws = new WebSocket(self.url, protocols || []); + ws.binaryType = this.binaryType; + + if (reconnectAttempt) { + if (this.maxReconnectAttempts && this.reconnectAttempts > this.maxReconnectAttempts) { + return; + } + } else { + eventTarget.dispatchEvent(generateEvent('connecting')); + this.reconnectAttempts = 0; + } + + if (self.debug || ReconnectingWebSocket.debugAll) { + console.debug('ReconnectingWebSocket', 'attempt-connect', self.url); + } + + var localWs = ws; + var timeout = setTimeout(function () { + if (self.debug || ReconnectingWebSocket.debugAll) { + console.debug('ReconnectingWebSocket', 'connection-timeout', self.url); + } + timedOut = true; + localWs.close(); + timedOut = false; + }, self.timeoutInterval); + + ws.onopen = function (event) { + clearTimeout(timeout); + if (self.debug || ReconnectingWebSocket.debugAll) { + console.debug('ReconnectingWebSocket', 'onopen', self.url); + } + self.protocol = ws.protocol; + self.readyState = WebSocket.OPEN; + self.reconnectAttempts = 0; + var e = generateEvent('open'); + e.isReconnect = reconnectAttempt; + reconnectAttempt = false; + eventTarget.dispatchEvent(e); + }; + + ws.onclose = function (event) { + clearTimeout(timeout); + ws = null; + if (forcedClose) { + self.readyState = WebSocket.CLOSED; + eventTarget.dispatchEvent(generateEvent('close')); + } else { + self.readyState = WebSocket.CONNECTING; + var e = generateEvent('connecting'); + e.code = event.code; + e.reason = event.reason; + e.wasClean = event.wasClean; + eventTarget.dispatchEvent(e); + if (!reconnectAttempt && !timedOut) { + if (self.debug || ReconnectingWebSocket.debugAll) { + console.debug('ReconnectingWebSocket', 'onclose', self.url); + } + eventTarget.dispatchEvent(generateEvent('close')); + } + + var timeout = self.reconnectInterval * Math.pow(self.reconnectDecay, self.reconnectAttempts); + setTimeout(function () { + self.reconnectAttempts++; + self.open(true); + }, timeout > self.maxReconnectInterval ? self.maxReconnectInterval : timeout); + } + }; + ws.onmessage = function (event) { + if (self.debug || ReconnectingWebSocket.debugAll) { + console.debug('ReconnectingWebSocket', 'onmessage', self.url, event.data); + } + var e = generateEvent('message'); + e.data = event.data; + eventTarget.dispatchEvent(e); + }; + ws.onerror = function (event) { + if (self.debug || ReconnectingWebSocket.debugAll) { + console.debug('ReconnectingWebSocket', 'onerror', self.url, event); + } + eventTarget.dispatchEvent(generateEvent('error')); + }; + } + + // Whether or not to create a websocket upon instantiation + if (this.automaticOpen == true) { + this.open(false); + } + + /** + * Transmits data to the server over the WebSocket connection. + * + * @param data a text string, ArrayBuffer or Blob to send to the server. + */ + this.send = function (data) { + if (ws) { + if (self.debug || ReconnectingWebSocket.debugAll) { + console.debug('ReconnectingWebSocket', 'send', self.url, data); + } + return ws.send(data); + } else { + throw 'INVALID_STATE_ERR : Pausing to reconnect websocket'; + } + }; + + /** + * Closes the WebSocket connection or connection attempt, if any. + * If the connection is already CLOSED, this method does nothing. + */ + this.close = function (code, reason) { + // Default CLOSE_NORMAL code + if (typeof code == 'undefined') { + code = 1000; + } + forcedClose = true; + if (ws) { + ws.close(code, reason); + } + }; + + /** + * Additional public API method to refresh the connection if still open (close, re-open). + * For example, if the app suspects bad data / missed heart beats, it can try to refresh. + */ + this.refresh = function () { + if (ws) { + ws.close(); + } + }; +} + +/** + * An event listener to be called when the WebSocket connection's readyState changes to OPEN; + * this indicates that the connection is ready to send and receive data. + */ +ReconnectingWebSocket.prototype.onopen = function (event) { +}; +/** An event listener to be called when the WebSocket connection's readyState changes to CLOSED. */ +ReconnectingWebSocket.prototype.onclose = function (event) { +}; +/** An event listener to be called when a connection begins being attempted. */ +ReconnectingWebSocket.prototype.onconnecting = function (event) { +}; +/** An event listener to be called when a message is received from the server. */ +ReconnectingWebSocket.prototype.onmessage = function (event) { +}; +/** An event listener to be called when an error occurs. */ +ReconnectingWebSocket.prototype.onerror = function (event) { +}; + +/** + * Whether all instances of ReconnectingWebSocket should log debug messages. + * Setting this to true is the equivalent of setting all instances of ReconnectingWebSocket.debug to true. + */ +ReconnectingWebSocket.debugAll = false; + +ReconnectingWebSocket.CONNECTING = WebSocket.CONNECTING; +ReconnectingWebSocket.OPEN = WebSocket.OPEN; +ReconnectingWebSocket.CLOSING = WebSocket.CLOSING; +ReconnectingWebSocket.CLOSED = WebSocket.CLOSED; + +// return ReconnectingWebSocket; +// }); diff --git a/src/components/Process/approvalRecord.vue b/src/components/Process/approvalRecord.vue index 2413f08..01db986 100644 --- a/src/components/Process/approvalRecord.vue +++ b/src/components/Process/approvalRecord.vue @@ -77,6 +77,8 @@ const insId = ref(null); //初始化查询审批记录 const init = async (businessId: string | number) => { + console.log(323232); + visible.value = true; loading.value = true; tabActiveName.value = 'image'; diff --git a/src/components/Process/flowChart.vue b/src/components/Process/flowChart.vue index 01d96cb..52ed487 100644 --- a/src/components/Process/flowChart.vue +++ b/src/components/Process/flowChart.vue @@ -21,8 +21,9 @@ const iframeUrl = ref(''); const baseUrl = import.meta.env.VITE_APP_BASE_API; onMounted(async () => { - const url = `/warm-flow-ui/index.html?id=${props.insId}&type=FlowChart&t=${Date.now()}`; + const url = baseUrl + `/warm-flow-ui/index.html?id=${props.insId}&type=FlowChart&t=${Date.now()}`; iframeUrl.value = url + '&Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID; + console.log('🚀 ~ iframeUrl.value:', iframeUrl.value); });