earthsdk3 3.11.0-beta.13 → 3.11.0-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- var EarthSDK3=(function(w){"use strict";var SA=Object.defineProperty;var bA=(w,Qs,Dl)=>Qs in w?SA(w,Qs,{enumerable:!0,configurable:!0,writable:!0,value:Dl}):w[Qs]=Dl;var f=(w,Qs,Dl)=>bA(w,typeof Qs!="symbol"?Qs+"":Qs,Dl);function Qs(){var n;const i=((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)??"unknown";let t="Unknown";/Windows/.test(i)?t="Windows":/Macintosh/.test(i)?t="MacOS":/Linux/.test(i)?t="Linux":/Android/.test(i)?t="Android":/iOS|iPhone|iPad|iPod/.test(i)&&(t="iOS");let e="Unknown";return/x64|x86_64|Win64|WOW64/.test(i)?e="x64":/x86|i686|Win32/.test(i)?e="x86":/arm64|aarch64/.test(i)?e="arm64":/arm/.test(i)&&(e="arm"),{os:t.toLocaleLowerCase(),arch:e.toLocaleLowerCase()}}const Dl=Date.now();function p0(i){var a;const{os:t,arch:e}=Qs(),n={version:i.version,commitdate:i.date,commitId:i.commitId,runningTime:(Date.now()-Dl)/1e3/60|0,date:new Date().toLocaleString(),href:((a=window==null?void 0:window.location)==null?void 0:a.href)??"unknown",os:t,arch:e},s={method:"GET",headers:new Headers,redirect:"follow"},o=window.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(l=>l.text()).then(l=>console.log(l)).catch(l=>console.log("error",l))}w.copyright=void 0;try{const i="earthsdk3",t="3.11.0-beta.13",e="2026-07-11T06:47:33.000Z",n="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="f43979f70ec6c8bcbbbc2c0c4f5f4069d30c2ac2",a=((Date.now()-1783752453e3)/36e5).toFixed(1),l=`%c🌏 ${i}%c ${t}.${s.slice(0,8)}.${e} (距今${a}个小时)
1
+ var EarthSDK3=(function(w){"use strict";var SA=Object.defineProperty;var bA=(w,Qs,Dl)=>Qs in w?SA(w,Qs,{enumerable:!0,configurable:!0,writable:!0,value:Dl}):w[Qs]=Dl;var f=(w,Qs,Dl)=>bA(w,typeof Qs!="symbol"?Qs+"":Qs,Dl);function Qs(){var n;const i=((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)??"unknown";let t="Unknown";/Windows/.test(i)?t="Windows":/Macintosh/.test(i)?t="MacOS":/Linux/.test(i)?t="Linux":/Android/.test(i)?t="Android":/iOS|iPhone|iPad|iPod/.test(i)&&(t="iOS");let e="Unknown";return/x64|x86_64|Win64|WOW64/.test(i)?e="x64":/x86|i686|Win32/.test(i)?e="x86":/arm64|aarch64/.test(i)?e="arm64":/arm/.test(i)&&(e="arm"),{os:t.toLocaleLowerCase(),arch:e.toLocaleLowerCase()}}const Dl=Date.now();function p0(i){var a;const{os:t,arch:e}=Qs(),n={version:i.version,commitdate:i.date,commitId:i.commitId,runningTime:(Date.now()-Dl)/1e3/60|0,date:new Date().toLocaleString(),href:((a=window==null?void 0:window.location)==null?void 0:a.href)??"unknown",os:t,arch:e},s={method:"GET",headers:new Headers,redirect:"follow"},o=window.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(l=>l.text()).then(l=>console.log(l)).catch(l=>console.log("error",l))}w.copyright=void 0;try{const i="earthsdk3",t="3.11.0-beta.16",e="2026-09-23T08:35:50.000Z",n="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="8b67af7d2754df644ae0ebda2ce65fa36315ceaa",a=((Date.now()-179015255e4)/36e5).toFixed(1),l=`%c🌏 ${i}%c ${t}.${s.slice(0,8)}.${e} (距今${a}个小时)
2
2
  %c${r?r+`
3
3
  `:""}当前网站正在使用${i},此软件版权归${n}所有
4
- `;w.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","f43979f70ec6c8bcbbbc2c0c4f5f4069d30c2ac2")},get info(){return l},get date(){return"2026-07-11T06:47:33.000Z"},get author(){return"suplyang"},get version(){return"3.11.0-beta.13"},get name(){return"earthsdk3"},get commitId(){return"f43979f70ec6c8bcbbbc2c0c4f5f4069d30c2ac2"},print(){console.info(this.info,`
4
+ `;w.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","8b67af7d2754df644ae0ebda2ce65fa36315ceaa")},get info(){return l},get date(){return"2026-09-23T08:35:50.000Z"},get author(){return"suplyang"},get version(){return"3.11.0-beta.16"},get name(){return"earthsdk3"},get commitId(){return"8b67af7d2754df644ae0ebda2ce65fa36315ceaa"},print(){console.info(this.info,`
5
5
  font-size: 18px;
6
6
  font-weight: 1000;
7
7
  line-height: 1;
@@ -20,7 +20,7 @@ var EarthSDK3=(function(w){"use strict";var SA=Object.defineProperty;var bA=(w,Q
20
20
  padding-left: 35px;
21
21
  `)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[i]=w.copyright,window.g_XE3SendProductUsageInfo=window.g_XE3SendProductUsageInfo||!0,window.g_XE3SendProductUsageInfo&&(setTimeout(()=>p0(w.copyright),6e4),setInterval(()=>p0(w.copyright),864e5)),window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&w.copyright.print()}catch{console.warn("版本信息有误!")}const m0=new Set;function Rl(i,t=i){m0.has(t)||(m0.add(t),console.warn(i))}function yh(i){const t=ud(i),e=()=>t[0][t[1]],n=s=>{try{t[0][t[1]]=s}catch(o){Rl(`setValue error, obj(${t[0].constructor.name}) prop(${t[1]}) error(${o})`)}},r=t[0][t[2]];return[e,n,r]}function DS(){return!0}function RS(){throw new Error("throwOnDestroyed")}function v0(i){for(var t in i)typeof i[t]=="function"&&(i[t]=RS);i.isDestroyed=DS}const ug=class ug{constructor(){f(this,"_memId",++ug._lastMemId);f(this,"_disposers")}get __v_skip(){return!0}get memId(){return this._memId}get disposers(){return this._disposers||(this._disposers=[]),this._disposers}dispose(t){return this.disposers.push(t),t}d(t){return this.dispose(t)}disposeVar(t){return this.disposers.push(()=>t.destroy()),t}dv(t){return this.disposeVar(t)}tryDisposeVar(t){return this.disposers.push(()=>t.tryDestroy()),t}tdv(t){return this.tryDisposeVar(t)}autoDispose(t){return typeof t=="function"?this.dispose(t):this.disposeVar(t)}ad(t){return typeof t=="function"?this.dispose(t):this.disposeVar(t)}isDestroyed(){return!1}destroyImp(){}destroy(){if(this._toDestroyEvent&&this._toDestroyEvent.emit(),this.destroyImp(),this._disposers)try{const t=this._disposers,e=t.length;for(let n=e-1;n>=0;--n)t[n]();t.length=0,this._disposers=void 0}catch(t){console.error(`destroy get error! ${t}`)}return v0(this)}tryDestory(){if(!this.isDestroyed())return this.destroy()}};f(ug,"_lastMemId",-1);let B=ug,dg;function y0(i){dg=i}Object.defineProperties(B.prototype,{toDestroyEvent:{get(){if(this._toDestroyEvent===void 0){if(!dg)throw new Error("Destroyable EventCtor not registered yet!");this._toDestroyEvent=this.disposeVar(new dg)}return this._toDestroyEvent}}});class ad{constructor(t,e,n=!1){f(this,"_freeElements");f(this,"_usedElementsCount");f(this,"_usedElements");f(this,"_nextCreateID");f(this,"_scratchObjs");this._createDefaultFunc=t,this._destroyFunc=e,this._freeElements=[],this._usedElementsCount=0,this._nextCreateID=1,this._scratchObjs=[],n&&(this._usedElements=[])}get usedElementsCount(){return this._usedElementsCount}get freeElementsCount(){return this._freeElements.length}_getCreateID(){return this._nextCreateID++}_create(){let t;return this._freeElements.length>0?t=this._freeElements.pop():t=this._createDefaultFunc&&this._createDefaultFunc()||{},t._cid=this._getCreateID(),t}create(){return this._create()}multiCreate(t){this._scratchObjs.length=0;for(let e=0;e<t;++e)this._scratchObjs.push(this._create());return this._scratchObjs}_destroy(t){this._destroyFunc&&this._destroyFunc(t),t._cid=void 0}destroy(...t){const e=t.length;for(let n=0;n<e;++n)this._destroy(t[n])}}function AS(){return{item:void 0,previous:void 0,next:void 0}}function LS(i){i.item=void 0,i.previous=void 0,i.next=void 0}const _0=new ad(AS,LS,!0);function fg(i,t,e){const n=_0.create();return n.item=i,n.previous=t,n.next=e,n}function w0(i){if(!i)throw new Error("node is undefined!");_0.destroy(i)}function gg(i,t){t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=void 0,i.tail=t.previous):t.next?(t.next.previous=void 0,i.head=t.next):(i.head=void 0,i.tail=void 0),t.next=void 0,t.previous=void 0}class E0{constructor(t){f(this,"head");f(this,"tail");f(this,"_length");const{needLength:e}=t||{needLength:!0};this.head=void 0,this.tail=void 0,e&&(this._length=0)}_incrementLength(){typeof this._length=="number"&&++this._length}_decrementLength(){typeof this._length=="number"&&--this._length}_setLength(t){typeof this._length=="number"&&(this._length=t)}get length(){return this._length}get empty(){return!this.head}*[Symbol.iterator](){let t=this.head;for(;t;)yield t,t=t.next}remove(t){if(!t)throw new Error("node is undefined!");gg(this,t),this._decrementLength(),w0(t)}getNode(t){let e=this.head;for(;e!==null;){if(!e)throw new Error("current is undefined!");if(e.item===t)return e;e=e.next}}moveAfter(t,e){if(t!==e){gg(this,e);var n=t.next;t.next=e,this.tail===t?this.tail=e:n&&(n.previous=e),e.next=n,e.previous=t}}moveBefore(t,e){if(t!==e){gg(this,e);var n=t.previous;t.previous=e,this.head===t?this.head=e:n&&(n.next=e),e.previous=n,e.next=t}}insertBefore(t,e){const n=fg(e,t.previous,t);return t.previous&&(t.previous.next=n),t.previous=n,this.head===t&&(this.head=n),this._incrementLength(),n}insertAfter(t,e){const n=fg(e,t,t.next);return t.next&&(t.next.previous=n),t.next=n,this.tail===t&&(this.tail=n),this._incrementLength(),n}_setFirstNode(t){if(this.head||this.tail)throw new Error("_setFirstNode error!");const e=fg(t,void 0,void 0);if(this.head=e,this.tail=e,this._incrementLength(),this._length!==1)throw new Error("_setFirstNode error! this._length !== 1");return e}push(t){return this.tail?this.insertAfter(this.tail,t):this._setFirstNode(t)}pop(){if(!this.tail)throw new Error("DoublyLinkedList is empty!");const t=this.tail.item;return this.remove(this.tail),t}shift(){if(!this.head)throw new Error("DoublyLinkedList is empty!");const t=this.head.item;return this.remove(this.head),t}unshift(t){return this.head?this.insertBefore(this.head,t):this._setFirstNode(t)}removeAll(){let t=this.head;for(;t;){const e=t.next;w0(t),t=e}this.head=void 0,this.tail=void 0,this._setLength(0)}}function FS(){return{func:void 0,scope:void 0,_hasRemoved:!1,_once:!1}}function kS(i){i.func=void 0,i.scope=void 0,i._hasRemoved=!1,i._once=!1}const Ca=new ad(FS,kS,!0);class pg{constructor(){f(this,"__dll");f(this,"__currentListenerStack")}get _dll(){return this.__dll=this.__dll??new E0({needLength:!0}),this.__dll}_pushCurrentListener(t){this.__currentListenerStack?Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.push(t):this.__currentListenerStack=[this.__currentListenerStack,t]:this.__currentListenerStack=t}_popCurrentListener(){if(this.__currentListenerStack)Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.pop():this.__currentListenerStack=void 0;else throw new Error("cannot pop!")}_hasCurrentListener(t){return this.__currentListenerStack?Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.indexOf(t)!==-1:this.__currentListenerStack===t:!1}do(...t){if(this.__dll&&!this._dll.empty){let e=this._dll.head;for(;e;){const n=e.item;n._hasRemoved||(this._pushCurrentListener(n),n.func.call(n.scope,...t),this._popCurrentListener());const r=e.next;n._once&&!n._hasRemoved&&(this.remove(e),e=void 0),e&&this._clearHasRemoved(e),e=r}}}get empty(){if(!this.__dll||this._dll.empty)return!0;let t=!0,e=this._dll.head;for(;e;){if(!e.item._hasRemoved){t=!1;break}e=e.next}return t}isHandlerValid(t){return!t.item._hasRemoved}nextHandler(t){if(!t.item._hasRemoved)throw new Error("handler has removed!");let e=t.next;for(;e&&e.item._hasRemoved;)e=e.next;return e}prevHandler(t){if(!t.item._hasRemoved)throw new Error("handler has removed!");let e=t.previous;for(;e&&e.item._hasRemoved;)e=e.previous;return e}moveAfter(t,e){if(t.item._hasRemoved||e.item._hasRemoved)throw new Error("handler or nextHandler has removed!");return this._dll.moveAfter(t,e)}moveBefore(t,e){if(t.item._hasRemoved||e.item._hasRemoved)throw new Error("handler or prevHandler has removed!");return this._dll.moveBefore(t,e)}insertBefore(t,e,n,r=!1){if(t.item._hasRemoved)throw new Error("handler has removed!");const s=Ca.create();return s.func=e,s.scope=n,s._once=r,this._dll.insertBefore(t,s)}insertAfter(t,e,n,r=!1){if(t.item._hasRemoved)throw new Error("handler has removed!");const s=Ca.create();return s.func=e,s.scope=n,s._once=r,this._dll.insertAfter(t,s)}_clearHasRemoved(t){t.item._hasRemoved&&!this._hasCurrentListener(t.item)&&(Ca.destroy(t.item),this._dll.remove(t))}remove(t){if(!t.item||t.item._hasRemoved)throw new Error("handler has removed!");this._hasCurrentListener(t.item)?t.item._hasRemoved=!0:(Ca.destroy(t.item),this._dll.remove(t))}removeAll(){if(this.__dll&&!this._dll.empty){let t=this._dll.head;for(;t;){const e=t.next;t.item._hasRemoved||this.remove(t),t=e}}}destroy(){if(!this.__dll)return;let t=this._dll.head;for(;t;){const e=t.next,n=t;this._hasCurrentListener(n.item)||(console.warn("Event has remove item that on current stack!"),console.warn(`${n.item.func.toString()}`)),Ca.destroy(n.item),this._dll.remove(n),t=e}this.__dll=void 0,this.__currentListenerStack=void 0}push(t,e,n=!1){const r=Ca.create();return r.func=t,r.scope=e,r._once=n,this._dll.push(r)}pop(){const t=this.tail;if(!t)throw new Error("pop error!");this.remove(t)}shift(){const t=this.head;if(!t)throw new Error("shift error!");this.remove(t)}unshift(t,e,n=!1){const r=Ca.create();return r.func=t,r.scope=e,r._once=n,this._dll.unshift(r)}get tail(){let t=this._dll.tail;for(;t&&t.item._hasRemoved;)t=t.previous;return t}get head(){let t=this._dll.head;for(;t&&t.item._hasRemoved;)t=t.previous;return t}}class _h{constructor(){f(this,"_listenerHandler");f(this,"_cid")}_reset(t,e){this._listenerHandler=t,this._cid=e}clone(t){return t=t??new _h,t._reset(this._listenerHandler,this._cid),t}get valid(){if(typeof this._listenerHandler<"u"&&typeof this._cid=="number"){const t=this._listenerHandler._cid;if(typeof t<"u"&&this._cid===t)return!0}return!1}}class mg extends _h{}class O extends B{constructor(){super(...arguments);f(this,"__pipe");f(this,"beforeCallback");f(this,"afterCallback")}get _pipe(){return this.__pipe=this.__pipe??new pg,this.__pipe}get empty(){return!this.__pipe||this._pipe.empty}emit(...e){!this.isDestroyed()&&this.beforeCallback&&this.beforeCallback(...e),!this.isDestroyed()&&this._pipe.do(...e),!this.isDestroyed()&&this.afterCallback&&this.afterCallback(...e)}on(e,n,r=!1,s){const o=r?this._pipe.unshift(e,n,!1):this._pipe.push(e,n,!1);return s=s??new mg,s._reset(o,o._cid),s}disposableOn(e,n,r=!1,s){const o=this.on(e,n,r,s);return()=>{o.valid&&this.off(o)}}don(e,n,r=!1,s){return this.disposableOn(e,n,r,s)}disposableWeakOn(e,n,r=!1,s){const o=new B,a=()=>{!o.isDestroyed()&&o.destroy()};return o.dispose(this.disposableOn(e,n,r,s)),o.dispose(this.toDestroyEvent.disposableOn(a)),a}dwon(e,n,r=!1,s){return this.disposableWeakOn(e,n,r,s)}once(e,n,r=!1,s){const o=r?this._pipe.unshift(e,n,!0):this._pipe.push(e,n,!0);return s=s??new mg,s._reset(o,o._cid),s}disposableOnce(e,n,r=!1,s){const o=this.once(e,n,r,s);return()=>o.valid&&this.off(o)}donce(e,n,r=!1,s){const o=this.once(e,n,r,s);return()=>o.valid&&this.off(o)}off(e){if(!e.valid)throw new Error("handler is not valid!");this._pipe.remove(e._listenerHandler),e._reset()}reset(){this._pipe.removeAll()}destroyImp(){this.empty||(Rl("The event is destroying with listeners!"),this._pipe.removeAll())}}y0(O);function Al(i,t){return t=t??new _h,t._reset(i,i._cid),t}class GS{constructor(){f(this,"__pipe")}get _pipe(){return this.__pipe=this.__pipe??new pg,this.__pipe}get empty(){return!this.__pipe||this._pipe.empty}do(...t){return this._pipe.do(...t)}isHandlerValid(t){return t.valid?this._pipe.isHandlerValid(t._listenerHandler):!1}moveAfter(t,e){if(!t.valid||!e.valid)throw new Error("handler or nextHander is not valid!");return this._pipe.moveAfter(t._listenerHandler,e._listenerHandler)}moveBefore(t,e){if(!t.valid||!e.valid)throw new Error("handler or nextHander is not valid!");return this._pipe.moveAfter(t._listenerHandler,e._listenerHandler)}insertBefore(t,e,n,r=!1,s){if(!t.valid)throw new Error("handler is not valid!");const o=this._pipe.insertBefore(t._listenerHandler,e,n,r);return Al(o,s)}insertAfter(t,e,n,r=!1,s){if(!t.valid)throw new Error("handler is not valid!");const o=this._pipe.insertAfter(t._listenerHandler,e,n,r);return Al(o,s)}remove(t){if(!t.valid)throw new Error("handler is not valid!");return this._pipe.remove(t._listenerHandler)}removeAll(){return this._pipe.removeAll()}push(t,e,n=!1,r){const s=this._pipe.push(t,e,n);return Al(s,r)}pop(){return this._pipe.pop()}shift(){return this._pipe.shift()}unshift(t,e,n=!1,r){const s=this._pipe.unshift(t,e,n);return Al(s,r)}getTail(t){const e=this._pipe.tail;if(e)return Al(e,t)}getHead(t){const e=this._pipe.head;if(e)return Al(e,t)}}class ui extends B{constructor(e,n,r){super();f(this,"_changed");f(this,"_value");f(this,"_oldValue");f(this,"toChangeFunc");this._equalsFunc=n,this._assignFunc=r,this._value=this._assignFunc&&this._assignFunc(e,void 0)||e}get assignFunc(){return this._assignFunc}get equalsFunc(){return this._equalsFunc}equals(e){return this._equalsFunc?this._equalsFunc(this._value,e):this._value===e}set value(e){if(this._equalsFunc?!this._equalsFunc(this._value,e):this._value!==e){if(this.toChangeFunc&&!this.toChangeFunc(e,this._value))return;this._assignFunc?(this._oldValue=this._assignFunc(this._value,this._oldValue),this._value=this._assignFunc(e,this._value)):(this._oldValue=this._value,this._value=e),this._changed&&this._changed.emit(e,this._oldValue)}}get value(){return this._value}get changed(){return this._changed||(this._changed=this.disposeVar(new O)),this._changed}forceChange(){this._changed&&this._changed.emit(this._value,this._value)}}function z(i,t,e){return new ui(i,t,e)}function ot(i){return new ui(i,(t,e)=>t.length!==e.length?!1:t.every((n,r)=>n===e[r]),(t,e)=>{const n=e||new Array(t.length);return n.length=t.length,t.forEach((r,s)=>n[s]=r),n})}function oe(i){return z(i,(t,e)=>t===void 0||e===void 0?t===void 0&&e===void 0:t.length!==e.length?!1:t.every((n,r)=>n===e[r]),(t,e)=>{if(!t)return;const n=e||new Array(t.length);return n.length=t.length,t.forEach((r,s)=>n[s]=r),n})}function ld(i,t,e){return z(i,(n,r)=>n.length!==r.length?!1:n.every((s,o)=>t&&t(s,r[o])||s===r[o]),(n,r)=>{const s=r||new Array(n.length);return s.length=n.length,n.forEach((o,a)=>{s[a]=e?e(o):o}),s})}function Do(i,t,e){return z(i,(n,r)=>n===void 0||r===void 0?n===void 0&&r===void 0:n.length!==r.length?!1:n.every((s,o)=>t&&t(s,r[o])||s===r[o]),(n,r)=>{if(!n)return;const s=r||new Array(n.length);return s.length=n.length,n.forEach((o,a)=>{s[a]=e?e(o):o}),s})}function bt(i){return new ui(i,(t,e)=>t===e||t!==void 0&&e!==void 0&&JSON.stringify(t)===JSON.stringify(e),(t,e)=>{if(t!==void 0)return JSON.parse(JSON.stringify(t))})}function fe(i){return new ui(i,(t,e)=>t===e||t!==void 0&&e!==void 0&&JSON.stringify(t)===JSON.stringify(e),(t,e)=>{if(t!==void 0)return JSON.parse(JSON.stringify(t))})}function jS(i){return new ui(i,(t,e)=>{if(t===e)return!0;if(t===void 0||e===void 0)return!1;const n=Object.keys(t),r=Object.keys(e);return n.length!==r.length?!1:n.every((s,o)=>s===r[o]&&t[s]===e[s])},(t,e)=>t&&{...t})}function VS(i){return new ui(i,(t,e)=>{if(t===e)return!0;if(t===void 0||e===void 0)return!1;const n=Object.keys(t),r=Object.keys(e);return n.length!==r.length?!1:n.every((s,o)=>s===r[o]&&t[s]===e[s])},(t,e)=>t&&{...t})}function zS(i){return ld(i,(t,e)=>t.every((n,r)=>n===e[r]),t=>[...t])}function vg(i){return Do(i,(t,e)=>t.every((n,r)=>n===e[r]),t=>[...t])}function BS(i){return ld(i,(t,e)=>JSON.stringify(t)===JSON.stringify(e),t=>JSON.parse(JSON.stringify(t)))}function US(i){return Do(i,(t,e)=>JSON.stringify(t)===JSON.stringify(e),t=>JSON.parse(JSON.stringify(t)))}function Pa(i){return vg(i)}function yg(i){return Do(i,(t,e)=>t.length===e.length&&t.every((n,r)=>n.every((s,o)=>s===e[r][o])),t=>t.map(e=>[...e]))}function qS(i){return Do(i,(t,e)=>t.length===e.length&&t.every((n,r)=>n.every((s,o)=>s===e[r][o])),t=>t.map(e=>[...e]))}function ud(i){const t=i instanceof ui?[i,"value","changed"]:[...i];return t[2]=t[2]||t[1]+"Changed",t}function _g(i,t,e,n=!1){t[2]=t[2]||t[1]+"Changed";const r=()=>{const s=t[0][t[1]];e?i[0][i[1]]=e(s):i[0][i[1]]=s};return r(),n?t[0][t[2]].disposableWeakOn(r):t[0][t[2]].disposableOn(r)}function WS(i,t,e,n,r=!1){const s=_g(i,t,e,r),o=_g(t,i,n,r);return()=>(s(),o())}function F(i,t,e,n=!1){const r=i instanceof ui?[i,"value","changed"]:i,s=t instanceof ui?[t,"value","changed"]:t;return _g(r,s,e,n)}function lt(i,t,e,n,r=!1){const s=ud(i),o=ud(t);return WS(s,o,e,n,r)}function HS(i,t,e,n=!1){const[r]=yh(t);return lt(i,t,s=>s??e,s=>{if(!(s===e&&r()===void 0))return s},n)}function Ll(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var t=Math.random()*16|0,e=i==="x"?t:t&3|8;return e.toString(16)})}function hd(i,t){if(!window||!window.setTimeout||!window.clearTimeout)throw new Error("目前只适合在浏览器中使用!");let e=0;function n(){e>0&&(window.clearTimeout(e),e=0)}function r(...s){n(),e=window.setTimeout(i,t,...s)}return[r,n]}function wg(i,t,...e){const n=setInterval(i,t,...e);return()=>clearInterval(n)}function Eg(i,t,...e){const n=setTimeout(i,t,...e);return()=>clearTimeout(n)}function cd(i,...t){let e;const n=()=>{const r=performance.now();i(r,...t),e=requestAnimationFrame(n)};return n(),()=>typeof e<"u"&&(cancelAnimationFrame(e),e=void 0)}function Fl(i,...t){let e;return e=requestAnimationFrame(()=>{const r=performance.now();i(r,...t)}),()=>typeof e<"u"&&(cancelAnimationFrame(e),e=void 0)}function wh(i,...t){let e=!1,n;return new Promise((r,s)=>{n=s,r()}).then(()=>{!e&&i(...t)}).catch(r=>{console.error(r)}),()=>(e=!0)&&n&&(n("nextMicroTask cancelled!"),n=void 0)}class dd extends O{constructor(e,n,...r){super();f(this,"_cancellFunc");this._nextFunc=e,this.dispose(()=>{this._cancellFunc&&(this._cancellFunc(),this._cancellFunc=void 0)}),r.forEach(s=>this.dispose(s[n?"dwon":"don"](()=>{this.next()})))}next(){this._cancellFunc||(this._cancellFunc=this._nextFunc(()=>(this._cancellFunc=void 0,this.emit())))}flush(){this._cancellFunc&&(this._cancellFunc(),this._cancellFunc=void 0,this.emit())}}class Sg extends dd{constructor(...t){super(wh,!1,...t)}}function XS(...i){return new Sg(...i)}class $S extends dd{constructor(...t){super(wh,!0,...t)}}function YS(...i){return new Sg(...i)}class fd extends dd{constructor(...t){super(Fl,!1,...t)}}function Ve(...i){return new fd(...i)}function JS(i,t){return new fd(...i).don(t())}class S0 extends dd{constructor(...t){super(Fl,!0,...t)}}function ZS(...i){return new S0(...i)}function Ze(i,t,e={time:"don",immediate:!1}){const n=new fd(...Array.isArray(i)?i:[i]),r=n[e.time??"don"](t);return(e.immediate??!1)&&t(),()=>{r(),n.destroy()}}function Eh(i){let t;if(typeof i.next=="function")t=i;else if(typeof i[Symbol.iterator]=="function")t=i[Symbol.iterator]();else throw new Error("iteratorOrIterable error!");return t}function bg(i,t){let e=!1;const n=Eh(i);let r=-1;for(;;){const{done:s,value:o}=n.next();if(s)break;if(t(o,++r)){e=!0;break}}return e}function Cg(i,t){return!bg(i,(n,r)=>!t(n,r))}function Sh(i,t,e,n){const r=i;if(!r[t]){const s=n(),o=Object.fromEntries(Object.entries(s).filter(([a,l])=>{const u=Object.getPrototypeOf(e),h=a in u;if(h){const c=l instanceof ui?l.value:l;i[a]=c}return!h}).map(([a,l])=>l instanceof ui?[a,l]:[a,Array.isArray(l)?oe(l):z(l)]));r[t]=o}return r[t]}function Ro(i,t){var n;const e=Symbol(`${(n=i==null?void 0:i.constructor)==null?void 0:n.name}-createDefaultProps`);i.constructor.__xbsj_dpSymbol=e,i.constructor.__xbsj_createDefaultProps=t;for(let[r,s]of Object.entries(t()))if(!Reflect.has(i,r)){const o=function(a){var h,c;if(a[e])return;const l=[];let u=Object.getPrototypeOf(a);for(;u;)l.push(u),u=Object.getPrototypeOf(u);l.reverse();for(let d of l){const g=(h=d.constructor)==null?void 0:h.__xbsj_dpSymbol;if(!g)continue;const p=(c=d.constructor)==null?void 0:c.__xbsj_createDefaultProps;p&&Sh(a,g,d,p)}};Object.defineProperties(i,{[r]:{get(){return o(this),Sh(this,e,i,t)[r].value},set(a){o(this);const l=Sh(this,e,i,t)[r];if(!l){console.error("!propObj");debugger}l.value=a}},[`${r}Changed`]:{get(){return o(this),Sh(this,e,i,t)[r].changed}},[`${r}React`]:{get(){return o(this),Sh(this,e,i,t)[r]}}})}}const bh=new WeakMap;function ps(i,t,e){bh.has(i)||bh.set(i,{});const n=bh.get(i);n[t]=e}function An(i,t){return bh.has(i)?bh.get(i)[t]:void 0}function ms(i,t){const e=Eh(i);let n=0;for(;;){const{done:r,value:s}=e.next();if(r)break;t(s,n++)}}function Ch(i,t,e){const n=Eh(i);let r=e,s=0;for(;;){const{done:o,value:a}=n.next();if(o)break;r=t(r,a,s++)}return r}const KS=i=>++i;function Pg(i){return Ch(i,KS,0)}function to(i){return Ch(i,(t,e)=>t>e?t:e,Number.NEGATIVE_INFINITY)}function Ao(i){return Ch(i,(t,e)=>t<e?t:e,Number.POSITIVE_INFINITY)}function b0(i,t){let e=i;for(let n of t)e=e[n];return e}function QS(i,t,e){if(t.length===0)throw new Error("props的数量必须大于0");const n=t.length-1,r=t[n];let s=i;for(let o=0;o<n;++o){const a=t[o];typeof s[a]>"u"&&(s[a]={}),s=s[a]}s[r]=e}function*xa(i,t){const e=Eh(i);for(;;){const{done:n,value:r}=e.next();if(n)break;yield b0(r,t)}}class Ph extends B{constructor(){super();f(this,"_innerObj");f(this,"_toChangeEvent");f(this,"_changedEvent");this._innerObj=[],this.dispose(()=>{if(this.length=0,this._innerObj.length>0)throw new Error("this._innerObj.length > 0");this._toChangeEvent&&this._toChangeEvent.reset(),this._innerObj=void 0})}get toChangeEvent(){return this._toChangeEvent||(this._toChangeEvent=new O),this._toChangeEvent}get changedEvent(){return this._changedEvent||(this._changedEvent=new O),this._changedEvent}_resetArray(e){this._toChangeEvent&&this._toChangeEvent.emit([{start:0,deleteCount:this._innerObj.length,items:e}],this);const{length:n}=e;this._innerObj.length=n;for(let r=0;r<n;++r)this._innerObj[r]=e[r];this._changedEvent&&this._changedEvent.emit(this)}splice(e,n,...r){const{length:s}=this._innerObj;e=e>this._innerObj.length?this._innerObj.length:e,e>s?e=s:e<0&&(e+=s,e<0&&(e=0));const o=this._innerObj.length-e;if(n>o?n=o:n<0&&(n=0),arguments.length===1){this._toChangeEvent&&this._toChangeEvent.emit([{start:e,deleteCount:this._innerObj.length-e,items:[]}],this);const a=this._innerObj.splice(e);return this._changedEvent&&this._changedEvent.emit(this),a}else if(arguments.length===2){this._toChangeEvent&&this._toChangeEvent.emit([{start:e,deleteCount:n,items:[]}],this);const a=this._innerObj.splice(e,n);return this._changedEvent&&this._changedEvent.emit(this),a}else{this._toChangeEvent&&this._toChangeEvent.emit([{start:e,deleteCount:n,items:r}],this);const a=this._innerObj.splice(e,n,...r);return this._changedEvent&&this._changedEvent.emit(this),a}}pop(){if(this._innerObj.length===0)return;if(this._toChangeEvent){const n=this._innerObj.length-1,r=1,s=[];this._toChangeEvent.emit([{start:n,deleteCount:r,items:s}],this)}const e=this._innerObj.pop();return this._changedEvent&&this._changedEvent.emit(this),e}push(...e){if(this._toChangeEvent){const r=this._innerObj.length;this._toChangeEvent.emit([{start:r,deleteCount:0,items:e}],this)}const n=this._innerObj.push(...e);return this._changedEvent&&this._changedEvent.emit(this),n}get length(){return this._innerObj.length}set length(e){if(e<0)throw new Error("value < 0");const{length:n}=this._innerObj;if(n!==e){if(this._toChangeEvent){let r,s,o;n>e?(r=e,s=n-e,o=[]):(r=n,s=0,o=new Array(e-n)),this._toChangeEvent.emit([{start:r,deleteCount:s,items:o}],this)}this._innerObj.length=e,this._changedEvent&&this._changedEvent.emit(this)}}get(e){return this._innerObj[e]}set(e,n){const{length:r}=this._innerObj;if(e<0||e>=r)throw new Error("index < 0 || index >= length");this._toChangeEvent&&this._toChangeEvent.emit([{start:e,deleteCount:1,items:[n]}],this),this._innerObj[e]=n,this._changedEvent&&this._changedEvent.emit(this)}indexOf(e){return this._innerObj.indexOf(e)}[Symbol.iterator](){return this._innerObj[Symbol.iterator]()}}function xg(i,t,...e){let n=i;for(let r of e){if(!n[r])if(t)n[r]={};else return;n=n[r]}return n}function tb(i,t,e){typeof e>"u"&&(t.endsWith(".gltf")?e="model/gltf+json":t.endsWith(".bin")?e="application/octet-stream":t.endsWith(".glb")?e="model/gltf-binary":t.endsWith(".jpg")||t.endsWith(".jpeg")?e="image/jpeg":t.endsWith(".png")?e="image/png":t.endsWith(".glsl")?e="text/plain":t.endsWith(".json")?e="application/json":t.endsWith(".b3dm")||t.endsWith(".i3dm")||t.endsWith("pnts")||t.endsWith("cmpt")?e="application/octet-stream":console.warn(`save ${t}: MimeType无法确定!`));const n=new Blob([i],{type:e||""});let r=URL.createObjectURL(n);var s=document.createElement("a"),o=new MouseEvent("click");s.download=t,s.href=r,s.dispatchEvent(o),URL.revokeObjectURL(r)}function eb(i,t){const e=document.createElement("a"),n=new MouseEvent("click");e.download=t||"下载",e.href=i,e.dispatchEvent(n)}function ib(){return new Promise((i,t)=>{const e=performance.now();requestAnimationFrame(n=>i(n>e))})}const gd=i=>{let t,e;return e=n=>{n=performance.now(),t=requestAnimationFrame(e),i(n)},t=requestAnimationFrame(e),()=>{cancelAnimationFrame(t)}};function Ig(i,t,e=gd){let n=Number.NEGATIVE_INFINITY,r;function s(l){l-n>t&&r&&(i(...r),r=void 0,n=l)}const o=e&&e(s)||void 0;function a(...l){r=l}return[a,o]}const C0=[];function P0(i,t,e){if(C0.includes(i)){console.warn(`_loadJs ${i} has loaded before!`),t&&t();return}var n=document.getElementsByTagName("head")[0],r=document.createElement("script");r.setAttribute("type","text/javascript"),r.setAttribute("src",i),r.onload=r.onreadystatechange=function(){this.readyState&&this.readyState!=="complete"||(C0.push(i),t&&t(),r.onload=r.onreadystatechange=null)},r.onerror=(s,o,a,l,u)=>{e(u)},n.appendChild(r)}function Mg(i,t=!0){if(t){const e=window.L;window.L&&(window.L=void 0);const n=window.define;return window.define&&(window.define=void 0),new Promise((r,s)=>{P0(i,r,s)}).then(()=>(window.define=n,window.L=e,Promise.resolve()))}else return new Promise((e,n)=>{P0(i,e,n)})}async function x0(i,t=""){return new Promise((e,n)=>{var r=new Image;r.crossOrigin=t,r.src=i,r.onload=()=>e(r),r.onerror=s=>n(s)})}class nb extends B{constructor(t){super(),this._owner=t}get owner(){return this._owner}}function rb(i,t){if(i.length%3!==0)throw new Error("positions.length % 3 !== 0");const e=i.length/3;function*n(o){for(let a=0;a<e;++a)yield i[a*3+o]}const r=(t==null?void 0:t.min)??[NaN,NaN,NaN],s=(t==null?void 0:t.max)??[NaN,NaN,NaN];return r[0]=Ao(n(0))??NaN,r[1]=Ao(n(1))??NaN,r[2]=Ao(n(2))??NaN,s[0]=to(n(0))??NaN,s[1]=to(n(1))??NaN,s[2]=to(n(2))??NaN,{min:r,max:s}}async function sb(i,t=fetch){const e=await t(i);return e.ok?await e.arrayBuffer():void 0}class ob extends B{constructor(e){super();f(this,"_map",new Map);f(this,"_array",[]);f(this,"_createEvent",this.dv(new O));f(this,"_updateEvent",this.dv(new O));f(this,"_destroyEvent",this.dv(new O));this._idFunc=e,this.d(()=>{this._array.length>0&&console.warn("EventFromArrayUpdating: destroy with non-empty array, will trigger destroy event for all items")})}get createEvent(){return this._createEvent}get updateEvent(){return this._updateEvent}get destroyEvent(){return this._destroyEvent}update(e,n={toDel:!0,toAdd:!0,toUpdate:!0}){const{toDel:r=!0,toAdd:s=!0,toUpdate:o=!0}=n;for(let l of this._array)l.updated=!1;const a=e.length;for(let l=0;l<a;++l){const u=e[l],h=this._idFunc(u,l);if(this._map.has(h)){if(o){const c=this._map.get(h);if(!c)throw new Error("!edwi");c.updated=!0,c.item=u,this._updateEvent.emit(h,u)}}else if(s){const c={item:u,id:h,updated:!0};this._array.push(c),this._map.set(h,c),this._createEvent.emit(h,u)}}if(r){const l=this._array.filter(u=>!u.updated);this._array=this._array.filter(u=>u.updated);for(let u of l)this._map.delete(u.id);for(let u of l)this._destroyEvent.emit(u.id,u.item)}}}function pd(i,...t){if(i>16)throw new Error("length > 16");const e=new Array(i);for(let n=0;n<i;++n)e[n]=t[n]??0;return e}class md{constructor(t,e){this._xyzw=t,this._length=e}set 0(t){this._xyzw.x=t}set 1(t){this._xyzw.y=t}set 2(t){this._xyzw.z=t}set 3(t){this._xyzw.w=t}get 0(){return this._xyzw.x??0}get 1(){return this._xyzw.y??0}get 2(){return this._xyzw.z??0}get 3(){return this._xyzw.w??0}get length(){return this._length}}function ab(i){return new md(i,2)}function lb(i){return new md(i,3)}function ub(i){return new md(i,4)}class hb{constructor(t,e,n,r){this._array=t,this._length=e,this._start=n,this._stride=r}get length(){return this._length}set 0(t){this._array[this._start+0*this._stride]=t}set 1(t){this._array[this._start+1*this._stride]=t}set 2(t){this._array[this._start+2*this._stride]=t}set 3(t){this._array[this._start+3*this._stride]=t}set 4(t){this._array[this._start+4*this._stride]=t}set 5(t){this._array[this._start+5*this._stride]=t}set 6(t){this._array[this._start+6*this._stride]=t}set 7(t){this._array[this._start+7*this._stride]=t}set 8(t){this._array[this._start+8*this._stride]=t}set 9(t){this._array[this._start+9*this._stride]=t}set 10(t){this._array[this._start+10*this._stride]=t}set 11(t){this._array[this._start+11*this._stride]=t}set 12(t){this._array[this._start+12*this._stride]=t}set 13(t){this._array[this._start+13*this._stride]=t}set 14(t){this._array[this._start+14*this._stride]=t}set 15(t){this._array[this._start+15*this._stride]=t}set 16(t){this._array[this._start+16*this._stride]=t}get 0(){return this._array[this._start+0*this._stride]}get 1(){return this._array[this._start+1*this._stride]}get 2(){return this._array[this._start+2*this._stride]}get 3(){return this._array[this._start+3*this._stride]}get 4(){return this._array[this._start+4*this._stride]}get 5(){return this._array[this._start+5*this._stride]}get 6(){return this._array[this._start+6*this._stride]}get 7(){return this._array[this._start+7*this._stride]}get 8(){return this._array[this._start+8*this._stride]}get 9(){return this._array[this._start+9*this._stride]}get 10(){return this._array[this._start+10*this._stride]}get 11(){return this._array[this._start+11*this._stride]}get 12(){return this._array[this._start+12*this._stride]}get 13(){return this._array[this._start+13*this._stride]}get 14(){return this._array[this._start+14*this._stride]}get 15(){return this._array[this._start+15*this._stride]}get 16(){return this._array[this._start+16*this._stride]}}function cb(i,t,e=0,n=1){return new hb(i,t,e,n)}w.Vector=void 0,(i=>{function t(U,...$){if(U=U||pd($.length),$.length>U.length)throw new Error("args.length > target.length");return U instanceof Float64Array?U.set($):T($,U),U}i.set=t;function e(U,$){const xt=U.length;for(let $t=0;$t<xt;++$t)if(!$(U[$t],$t))return!1;return!0}i.every=e;function n(U,$,xt){const $t=U.length;let we=xt;for(let Ue=0;Ue<$t;++Ue)we=$(we,U[Ue],Ue);return we}i.reduce=n;function*r(U){for(let $=0;$<U.length;++$)yield U[$]}i.itr=r;const s=(U,$)=>U+=$*$;function o(U){return n(U,s,0)}i.magnitudeSquared=o;function a(U){const $=o(U);return Math.sqrt($)}i.magnitude=a;function l(U,$=1e-5){const xt=o(U);return Math.abs(xt-1)<$}i.isNormalized=l;let u;const h=(U,$,xt)=>U+$*u[xt];function c(U,$){return C(U,$),u=$,n(U,h,0)}i.dot=c;let d;const g=(U,$,xt)=>U+=($-d[xt])*($-d[xt]);function p(U,$){return C(U,$),d=$,n(U,g,0)}i.distanceSquared=p;function E(U,$){return Math.sqrt(p(U,$))}i.distance=E;let b;const P=(U,$)=>U===b[$];function v(U,$){return C(U,$),b=$,e(U,P)}i.equals=v;let _,m;const y=(U,$)=>Math.abs(U-_[$])<m;function S(U,$,xt=0){return C(U,$),_=$,m=xt,e(U,y)}i.equalsEpsilon=S;function C(U,$){if(U.length!==$.length)throw new Error("left.length !== right.length")}function x(U,$,xt){const $t=U.length;xt=xt||pd($t),C(U,xt);for(let we=0;we<$t;++we)xt[we]=$(U[we],we);return xt}i.op1=x;function I(U,$,xt,$t){C(U,$),$t&&C(U,$t);const we=U.length;$t=$t||pd(we);for(let Ue=0;Ue<we;++Ue)$t[Ue]=xt(U[Ue],$[Ue]);return $t}i.op2=I;const M=U=>U;function T(U,$){return x(U,M,$)}i.clone=T;let R=0;const A=(U,$)=>U*R;function N(U,$,xt){return R=$,x(U,A,xt)}i.multiplyByScalar=N;function V(U,$,xt=0){const $t=o(U);if($t<=xt)return;const we=Math.sqrt($t);return N(U,1/we,$)}i.normalize=V;function G(U,$){return N(U,-1,$)}i.negate=G;const q=U=>Math.abs(U);function at(U,$){return x(U,q,$)}i.abs=at;const dt=U=>U-Math.floor(U);function Q(U,$){return x(U,dt,$)}i.fract=Q;const K=(U,$)=>U-$;function it(U,$,xt){return I(U,$,K,xt)}i.subtract=it;const Ct=(U,$)=>U+$;function Ht(U,$,xt){return I(U,$,Ct,xt)}i.add=Ht;const Vt=(U,$)=>U*$;function zt(U,$,xt){return I(U,$,Vt,xt)}i.multiply=zt;const ee=(U,$)=>U/$;function je(U,$,xt){return I(U,$,ee,xt)}i.divide=je;let me;const tn=(U,$)=>U*(1-me)+$*me;function en(U,$,xt,$t){return me=xt,I(U,$,tn,$t)}i.lerp=en})(w.Vector||(w.Vector={}));function vd(i,t=0,e=1){return i<t?t:i>e?e:i}class yd extends B{constructor(e,n,r,s,o,a,l,u){super();f(this,"__status");f(this,"_statusChangedEvent");f(this,"_forceCancelFunc");f(this,"_startEvent");f(this,"_progressEvent");f(this,"_completeEvent");f(this,"_cancelEvent");f(this,"_cancelledEvent");f(this,"_errorEvent");f(this,"_finishedEvent");f(this,"_processingID",-1);this._startProcessingFunc=e,this.startFunc=n,this.progressFunc=r,this.completeFunc=s,this.cancelFunc=o,this.cancelledFunc=a,this.errorFunc=l,this.finishedFunc=u,this._status="Initial",this.dispose(()=>{var h;return(h=this._statusChangedEvent)==null?void 0:h.destroy()}),this.dispose(()=>{var h;return(h=this._startEvent)==null?void 0:h.destroy()}),this.dispose(()=>{var h;return(h=this._progressEvent)==null?void 0:h.destroy()}),this.dispose(()=>{var h;return(h=this._completeEvent)==null?void 0:h.destroy()}),this.dispose(()=>{var h;return(h=this._cancelEvent)==null?void 0:h.destroy()}),this.dispose(()=>{var h;return(h=this._cancelledEvent)==null?void 0:h.destroy()}),this.dispose(()=>{var h;return(h=this._errorEvent)==null?void 0:h.destroy()}),this.dispose(()=>{var h;return(h=this._finishedEvent)==null?void 0:h.destroy()}),this.dispose(()=>this.reset())}get startEvent(){return this._startEvent=this._startEvent||new O,this._startEvent}get progressEvent(){return this._progressEvent=this._progressEvent||new O,this._progressEvent}get completeEvent(){return this._completeEvent=this._completeEvent||new O,this._completeEvent}get cancelEvent(){return this._cancelEvent=this._cancelEvent||new O,this._cancelEvent}get cancelledEvent(){return this._cancelledEvent=this._cancelledEvent||new O,this._cancelledEvent}get errorEvent(){return this._errorEvent=this._errorEvent||new O,this._errorEvent}get finishedEvent(){return this._finishedEvent=this._finishedEvent||new O,this._finishedEvent}_completeFunc(e,n){this.processingID===e&&this._status==="Running"&&(this._status="Completed",this.completeFunc&&this.completeFunc(n),this._completeEvent&&this._completeEvent.emit(n),this.finishedFunc&&this.finishedFunc({status:"Completed",value:n}),this._finishedEvent&&this._finishedEvent.emit({status:"Completed",value:n}))}_cancelFunc(e){this._status==="Running"&&(this._status="Cancelling",this.cancelFunc&&this.cancelFunc(e),this._cancelEvent&&this._cancelEvent.emit(e))}_cancelledFunc(e){this._status==="Cancelling"&&(this._status="Cancelled",this.cancelledFunc&&this.cancelledFunc(e),this._cancelledEvent&&this._cancelledEvent.emit(e),this.finishedFunc&&this.finishedFunc({status:"Cancelled",cancelError:e}),this._finishedEvent&&this._finishedEvent.emit({status:"Cancelled",cancelError:e}))}_errorFunc(e,n){this.processingID===e&&this._status==="Running"&&(this._status="Error",this.errorFunc&&this.errorFunc(n),this._errorEvent&&this._errorEvent.emit(n),this.finishedFunc&&this.finishedFunc({status:"Error",error:n}),this._finishedEvent&&this._finishedEvent.emit({status:"Error",error:n}))}_progressFunc(e,n){this.processingID===e&&this._status==="Running"&&(this.progressFunc&&this.progressFunc(n),this._progressEvent&&this._progressEvent.emit(n))}_startFunc(...e){if(this._status==="Initial"){this._status="Running";const n=++this._processingID,r={completeFunc:this._completeFunc.bind(this,n),errorFunc:this._errorFunc.bind(this,n),progressFunc:this._progressFunc.bind(this,n),cancelFunc:this._cancel.bind(this,n),processingID:n},s=this._startProcessingFunc(r,...e);return this._forceCancelFunc=s,this.startFunc&&this.startFunc(...e),this._startEvent&&this._startEvent.emit(...e),n}else return console.warn("this._status !== 'Initial' but start again!"),-1}set _status(e){if(this.__status!==e){const n=this.__status;this.__status=e,this._statusChangedEvent&&this._statusChangedEvent.emit(e,n)}}get _status(){return this.__status}get processingID(){return this._processingID}get statusChangedEvent(){return this._statusChangedEvent||(this._statusChangedEvent=new O),this._statusChangedEvent}reset(e){this._status==="Running"&&this.cancel(e),this._status==="Cancelled"||this._status==="Error"||this._status==="Completed"?this._status="Initial":this._status==="Cancelling"&&console.warn("Cannot reset! (this._status === 'Cancelling')")}get status(){return this._status}cancel(e,n=this.processingID){return this._cancel(n,e)}_cancel(e,n){if(this.processingID===e)if(this._status==="Running"){if(!this._forceCancelFunc)throw new Error("this._forceCancelFunc is undefined!");this._cancelFunc(n);const r=this._forceCancelFunc(n);if(this._forceCancelFunc=void 0,r&&r instanceof Promise)return r.then(()=>{this._cancelledFunc(n)});this._cancelledFunc(n)}else console.warn("this._status !== 'Running' but cancel")}start(...e){try{return this._startFunc(...e)}catch(n){console.error(`processing start error: ${n}`)}}restart(e,...n){try{return this.isRunning&&this.cancel(e),this.isFinished&&this.reset(e),this.isInitial?this._startFunc(...n):(console.warn("restart failed!"),-1)}catch(r){console.error(`processing restart error: ${r}`)}}get isCompleted(){return this._status==="Completed"}get isCancelled(){return this._status==="Cancelled"}get isCancelling(){return this._status==="Cancelling"}get isError(){return this._status==="Error"}get isInitial(){return this._status==="Initial"}get isRunning(){return this._status==="Running"}get isFinished(){return this.isCancelled||this.isCompleted||this.isError}}let Tg=class extends Error{};function I0(i,t){typeof i=="function"?i(t):i.cancelFunc=t}class Ng extends yd{constructor(e=300){super(({progressFunc:n,completeFunc:r,errorFunc:s})=>{const[o,a]=hd(()=>{if(!this._lastDebounceValue)throw new Error("!this._lastDebounceValue");n([this._lastDebounceValue,this._debouncTimes]),this._debouncTimes=0},this._delayTime);return this._d=o,()=>{a()}});f(this,"_lastDebounceValue");f(this,"_debouncTimes",0);f(this,"_d");this._delayTime=e}get delayTime(){return this._delayTime}debounce(...e){this.isRunning?(++this._debouncTimes,this._lastDebounceValue=e,this._d&&this._d()):console.warn("Debouncing is not running!")}}function M0(i,t,...e){const n=new AbortController;let r=n.signal,[s,o]=e;if(o!=null&&o.signal)throw console.error("init?.signal"),new Error("init?.signal");o=o||{},o.signal=r;let a=!1;I0(i,()=>{a=!0,n.abort()});let l=fetch(s,o);return t&&(l=l.then(u=>{if(!u.ok)return u;if(!u.body)throw Error("ReadableStream not yet supported in this browser.");const h=u.headers.get("content-length"),c=h?parseInt(h,10):0;let d=0;return new Response(new ReadableStream({start(g){if(!u.body)throw new Error("!response.body");const p=u.body.getReader();E();function E(){p.read().then(({done:b,value:P})=>{if(b){g.close();return}if(!P)throw new Error("!value");if(!t)throw new Error("!progressFunc");d+=P.byteLength,t(d,c),g.enqueue(P),E()}).catch(b=>{g.error(b)})}}}),{status:u.status,statusText:u.statusText,headers:u.headers})}).catch(u=>{throw a?(u instanceof Error&&u.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new Tg("fetching cancelled!")):(u instanceof Error&&u.code===20&&console.error("error.code === 20"),u)})),l}function T0(...i){if(i.length>=1)if(typeof i[0]=="function"||typeof i[0]>"u"){const t={};let e=M0(t,...i);const{cancelFunc:n}=t;if(!n)throw new Error("!cancelResult.cancelFunc");return[n,e]}else return M0(...i);throw new Error("cancelableFetch args error!")}class db extends yd{constructor(e,...n){super(({progressFunc:r,completeFunc:s,errorFunc:o},...a)=>{const l={};let u={loaded:0,total:0};const h=(g,p)=>{u.loaded=g,u.total=p,r(u)},c=this._fetchArgs||a;if(c.length===0)throw new Error("fetchArgs.length === 0");if(T0(l,h,...c).then(e).then(s).catch(g=>{g instanceof Tg||o(g)}),!l.cancelFunc)throw new Error("!cancelResult.cancelFunc");return l.cancelFunc});f(this,"_fetchArgs");n.length>0&&(this._fetchArgs=n)}get fetchArgs(){return this._fetchArgs}}function Og(i,t,e,n){const r="_"+t,s="_"+t+"Changed",o=t+"Changed";Object.defineProperties(i.prototype,{[t]:{get(){return typeof this[r]>"u"&&typeof e<"u"&&(this[r]=e),this[r]},set(a){if(typeof this[r]>"u"&&typeof e<"u"&&(this[r]=e),n?!n(this[r],a):this[r]!==a){const l=this[r];this[r]=a,this[s]&&this[s].emit(a,l)}}},[o]:{get(){return typeof this[s]>"u"&&(this[s]=new O,typeof this.dispose<"u"&&this.dispose(()=>this[s].destroy())),this[s]}}})}class Dg extends yd{constructor(e,n=!0){super(({progressFunc:r,completeFunc:s,errorFunc:o})=>(this._intervalFunc=r,this._intervalID&&console.error("this._intervalID should be undefined!"),this.leading&&r(),this._intervalID=setInterval(r,this.intervalTime),()=>{if(!this._intervalID)throw console.error("this._intervalID should not be undefined!"),new Error("this._intervalID should not be undefined!");clearInterval(this._intervalID),this._intervalID=void 0}));f(this,"_intervalID");f(this,"_intervalFunc");this.intervalTime=e,this.leading=n,this.dispose(this.intervalTimeChanged.disposableOn(()=>{this._intervalID&&this._intervalFunc&&(clearInterval(this._intervalID),this._intervalID=setInterval(this._intervalFunc,this.intervalTime))}))}}Og(Dg,"leading",!0),Og(Dg,"intervalTime",500);function fb(i,t){let e,n;const r=new Promise((o,a)=>{n=a,e=globalThis.setTimeout(()=>{e=void 0,o()},i)}),s=o=>{e&&(clearTimeout(e),e=void 0),n&&n(o??new Tg("sleep cancel error!"))};if(typeof t=="boolean"&&t)return[s,r];if(t)return I0(t,s),r}class gb{constructor(t=0,e=0,n=0,r,s){f(this,"_processData");f(this,"_lastUpdateTimeStamp",0);this.startTime=t,this.duration=e,this.delay=n,this.proccessFunc=r,this.completeFunc=s,this._processData={ratio:0,timeStamp:0,timeStampFromStart:0,timeStampFromLastUpdate:0}}update(t){const e=(t-this.startTime)/this.duration;e>=0&&(this._processData.ratio=e,this._processData.timeStamp=t,this._processData.timeStampFromStart=t-this.startTime,this._processData.timeStampFromLastUpdate=t-this._lastUpdateTimeStamp,this._lastUpdateTimeStamp=t,this.proccessFunc&&this.proccessFunc(this._processData),e>=1&&this.completeFunc&&this.completeFunc())}start(){this.startTime=performance.now()+this.delay,this._lastUpdateTimeStamp=this.startTime}}class N0 extends yd{constructor(e=1e3,n=0,r=gd){let s;function o(){s&&s()}super(({progressFunc:l,completeFunc:u,errorFunc:h})=>{const c=this.startUpdateFunc&&this.startUpdateFunc(this._base.update.bind(this._base))||void 0;return this._base.startTime=performance.now(),this._base.duration=this.duration,this._base.delay=this.delay,this._base.proccessFunc=l,this._base.completeFunc=()=>{c&&c(),u()},this._base.start(),s=c,o});f(this,"_base");f(this,"duration");f(this,"delay");f(this,"startUpdateFunc");this._base=new gb,this.duration=e,this.delay=n,this.startUpdateFunc=r}get startTime(){return this._base.startTime}}class pb extends B{constructor(e){super();f(this,"_target",0);f(this,"_current",0);f(this,"_start",0);f(this,"_timing",new N0(Number.POSITIVE_INFINITY));f(this,"_currentChanged");this._duration=e,this._timing.progressFunc=({ratio:n})=>{n=n<0?0:n>1?1:n;const r=this._start*(1-n)+this._target*n;this._current=r,this._currentChanged&&this._currentChanged.emit(this._target,this._current)},this.dispose(()=>{this._timing.isRunning&&this._timing.cancel(),this._timing.destroy()})}reset(e,n=e){this._timing.isRunning&&this._timing.cancel(),this._target=e,this._current=n,this._start=e}set target(e){if(this._target!==e){this._target=e,this._timing.isRunning&&this._timing.cancel(),this._timing.reset(),this._start=this._current;const n=Math.abs(this._target-this._start);this._timing.duration=n*this._duration,this._timing.start()}}get target(){return this._target}get current(){return this._current}get currentChanged(){return this._currentChanged||(this._currentChanged=new O),this._currentChanged}}function O0(i,t){t=t||[];const e=i.parentNode;return e?O0(e,t.concat(e)):t}function mb(i){const t=i.composedPath&&i.composedPath()||i.path,e=i.target;if(t!=null)return t.indexOf(window)<0?t.concat(window):t;if(e===window)return[window];if(e===null)throw new Error("target === null");return[e].concat(O0(e),window)}function ji(i,t=!1){const{offsetX:e,offsetY:n}=i;let r=e,s=n;{const o=mb(i);for(let a=0;a<o.length;++a){const l=o[a];if(l!==i.currentTarget&&l instanceof HTMLElement)r+=l.clientLeft,s+=l.clientTop,r+=l.offsetLeft,s+=l.offsetTop;else break}}return t?[r*window.devicePixelRatio,s*window.devicePixelRatio]:[r,s]}function kl(i,t=!1){const e=i.target,n=i.currentTarget||i.__xbsj_lastCurrentTarget__;if(!e||!n)return[i.clientX,i.clientY];const r=e.getBoundingClientRect(),s=n.getBoundingClientRect(),o=r.left+i.offsetX,a=r.top+i.offsetY,l=o-s.left,u=a-s.top;return t?[l*window.devicePixelRatio,u*window.devicePixelRatio]:[l,u]}class D0 extends B{constructor(e){super();f(this,"_clickEvent",new O);f(this,"_dbclickEvent",new O);f(this,"_downEvent",new O);f(this,"_upEvent",new O);f(this,"_moveEvent",new O);f(this,"_debouncing",new Ng(300));this.dispose(()=>{this._clickEvent.destroy(),this._dbclickEvent.destroy(),this._downEvent.destroy(),this._upEvent.destroy(),this._moveEvent.destroy(),this._debouncing.destroy()});let n=!1,r=[0,0],s=!1;this._debouncing.progressFunc=([[h,c,d],g])=>{g===1?this._clickEvent.emit(h,c,d):g>=2?this._dbclickEvent.emit(h,c,d):console.error("point click should not be here!")},this._debouncing.start(),this.dispose(()=>{this._debouncing.isRunning&&this._debouncing.cancel(),this._debouncing.destroy()});const o=h=>{n=!0;const[c,d]=ji(h);r[0]=c,r[1]=d,this._downEvent.emit(c,d,h)},a=h=>{const[c,d]=ji(h);n&&!s&&this._debouncing.debounce(c,d,h),n=!1,s=!1,this._upEvent.emit(c,d,h)},l=h=>{const[c,d]=ji(h);if(n&&!s){const[g,p]=r;(Math.abs(c-g)>3||Math.abs(d-p)>3)&&(s=!0)}this._moveEvent.emit(c,d,h)},u=()=>{n=!1,s=!1};e.addEventListener("pointerdown",o),e.addEventListener("pointerup",a),e.addEventListener("pointermove",l),e.addEventListener("pointerout",u),this.dispose(()=>{e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",a),e.removeEventListener("pointermove",l),e.removeEventListener("pointerout",u)})}get clickEvent(){return this._clickEvent}get dbclickEvent(){return this._dbclickEvent}get downEvent(){return this._downEvent}get upEvent(){return this._upEvent}get moveEvent(){return this._moveEvent}}class Rg extends B{constructor(){super();f(this,"_pickRectEvent",this.disposeVar(new O));f(this,"_updateRectEvent",this.disposeVar(new O));f(this,"_pointerActionEvent",this.disposeVar(new O));f(this,"_active",this.disposeVar(z(!1)));f(this,"_pickRect",{left0:0,top0:0,left1:0,top1:0});let e=0,n=0,r=0,s=0;this.dispose(this._pointerActionEvent.disposableOn(({type:o,left:a,top:l})=>{o==="PointerDown"?(this._active.value=!0,e=a,n=l,r=a,s=l,this._setPickRect({left0:e,top0:n,left1:r,top1:s}),this._updateRectEvent.emit(this._pickRect)):o==="PointerMove"?this._active.value&&(r=a,s=l,this._setPickRect({left0:e,top0:n,left1:r,top1:s}),this._updateRectEvent.emit(this._pickRect)):o==="PointerUp"&&this._active.value&&(this._active.value=!1,r=a,s=l,this._setPickRect({left0:e,top0:n,left1:r,top1:s}),this._updateRectEvent.emit(this._pickRect),this._pickRectEvent.emit(this._pickRect))}))}_setPickRect({left0:e,left1:n,top0:r,top1:s}){this._pickRect.left0=e,this._pickRect.left1=n,this._pickRect.top0=r,this._pickRect.top1=s}pointerDown(e,n){this._pointerActionEvent.emit({type:"PointerDown",left:e,top:n})}pointerMove(e,n){this._pointerActionEvent.emit({type:"PointerMove",left:e,top:n})}pointerUp(e,n){this._pointerActionEvent.emit({type:"PointerUp",left:e,top:n})}reset(){this._setPickRect({left0:0,top0:0,left1:0,top1:0}),this._updateRectEvent.emit(this._pickRect),this._pickRectEvent.emit(this._pickRect)}get activeEvent(){return this._active.changed}get updateRectEvent(){return this._updateRectEvent}get pickRectEvent(){return this._pickRectEvent}static getLeftTopAndSize(e,n){n=n||{left:0,top:0,width:0,height:0,forward:!0};const{left0:r,top0:s,left1:o,top1:a}=e;return n.width=Math.abs(r-o),n.height=Math.abs(s-a),n.left=Math.min(r,o),n.top=Math.min(s,a),n.forward=o>r,n}static contains(e,n,r){const{left:s,top:o,width:a,height:l}=r;return e>s&&e<=s+a&&n>=o&&n<=o+l}}class vb extends Rg{constructor(t){super();const e=this.disposeVar(new D0(t));this.dispose(e.downEvent.disposableOn((o,a,l)=>l.altKey&&this.pointerDown(o,a))),this.dispose(e.moveEvent.disposableOn((o,a)=>this.pointerMove(o,a))),this.dispose(e.upEvent.disposableOn((o,a)=>this.pointerUp(o,a)));const n=document.createElement("div");n.style.backgroundColor="rgba(0, 0, 0, 0)",n.style.border="2px dashed red",n.style.position="absolute",n.style.boxSizing="border-box",n.style.pointerEvents="none",n.style.height="0px",n.style.width="0px",n.style.left="0px",n.style.top="0px",n.style.display="none",t.appendChild(n),this.dispose(()=>t.removeChild(n)),this.dispose(this.activeEvent.disposableOn(o=>{n.style.display=o?"block":"none"}));const r=()=>{this.reset()};t.addEventListener("contextmenu",r),this.dispose(()=>t.removeEventListener("contextmenu",r));const s={left:0,top:0,width:0,height:0,forward:!1};this.dispose(this.updateRectEvent.disposableOn(o=>{if(Rg.getLeftTopAndSize(o,s)){const{left:a,top:l,width:u,height:h}=s;n.style.height=`${h|0}px`,n.style.width=`${u|0}px`,n.style.left=`${a|0}px`,n.style.top=`${l|0}px`}}))}}class Fr extends Error{}function Lo(i,t){An(i,"_promise_cancel")&&console.warn("setPromiseCancel warn: promise has cancelFunc!"),ps(i,"_promise_cancel",t)}function Gl(i){return An(i,"_promise_cancel")}function jl(i){return!!Gl(i)}function Ag(i,t){const e=Gl(i);return e?(e(t),!0):!1}function Lg(i){const[t,e]=i;return Lo(e,t),e}function Vl(i){let t;const e=new Promise((n,r)=>{t=r,i.then(n).catch(r)});return Lo(e,t),e}function yb(i){let t,e;var n=new Promise((r,s)=>{e=i.disposableOn((...o)=>{e&&e(),r(o)}),t=o=>{e&&e(),s(o)}});return[t,n]}function _b(i){const t=new O,e=new O;return i.then(n=>{t.isDestroyed()||t.emit(n)}).catch(n=>{e.isDestroyed()||e.emit(n)}),[t,e]}class Fg extends B{constructor(){super();f(this,"_cancelled",!1);f(this,"_cancelError");f(this,"_promiseSet",new Set);f(this,"_disposer")}get disposer(){return this._disposer=this._disposer||new B,this._disposer}destroyImp(){this.finally()}cancel(e){var n;if(!this._cancelled){this._cancelled=!0,(n=this._disposer)==null||n.destroy(),this._cancelError=e;for(let r of this._promiseSet)Ag(r);this._promiseSet.clear()}}get cancelFuncsNum(){return Ch(this._promiseSet,e=>e+1,0)}finally(){this._disposer&&!this._disposer.isDestroyed()&&this._disposer.destroy(),this._promiseSet.clear()}check(){if(this._cancelled)throw this._cancelError??new Fr("cancel from CancelManager!")}promise(e){return this._promiseSet.add(e),e.finally(()=>(this._promiseSet.delete(e),this.check()))}promiseAny(e){const n=[],r=e.map(s=>(this._promiseSet.add(s),jl(s)&&n.push(Gl(s)),s.finally(()=>this._promiseSet.delete(s))));return Promise.any(r).finally(()=>(n.forEach((s=>s(new Fr("cancel from promiseAny!")))),n.length=0))}promiseAll(e){const n=[],r=e.map(s=>(this._promiseSet.add(s),jl(s)&&n.push(Gl(s)),s.finally(()=>this._promiseSet.delete(s))));return Promise.all(r).finally(()=>(n.forEach((s=>s(new Fr("cancel from promiseAll!")))),n.length=0))}promiseRace(e){const n=[],r=e.map(s=>(this._promiseSet.add(s),jl(s)&&n.push(Gl(s)),s.finally(()=>this._promiseSet.delete(s))));return Promise.race(r).finally(()=>(n.forEach((s=>s(new Fr("cancel from promiseRace!")))),n.length=0))}}class hi extends B{constructor(e){super();f(this,"_status","Initial");f(this,"_completeEvent");f(this,"_errorEvent");f(this,"_completeFunc");f(this,"_errorFunc");f(this,"_cancelFunc");f(this,"_runningId",-1);this._startFunc=e,this.dispose(()=>this.isRunning&&this.cancel())}get errorEvent(){return this._errorEvent||(this._errorEvent=new O),this._errorEvent}get completeEvent(){return this._completeEvent||(this._completeEvent=new O),this._completeEvent}get errorFunc(){return this._errorFunc}get completeFunc(){return this._completeFunc}set errorFunc(e){this._errorFunc!==e&&(this._errorFunc=e)}set completeFunc(e){this._completeFunc!==e&&(this._completeFunc=e)}start(...e){if(this._status!=="Initial")return;const n=++this._runningId;this._status="Running",this._cancelFunc=this._startFunc({completeFunc:r=>{var s;n===this._runningId&&this._status==="Running"&&(this._status="Completed",this._completeFunc&&this._completeFunc(r),(s=this._completeEvent)==null||s.emit(r))},errorFunc:r=>{var s;n===this._runningId&&this._status==="Running"&&(this._status="Error",this._errorFunc&&this._errorFunc(r),(s=this._errorEvent)==null||s.emit(r))},runningingID:n},...e)}cancel(e=new Fr("")){var n;if(this._status==="Running"){if(!this._cancelFunc)throw new Error("!this._cancelFunc");this._status="Error",this._errorFunc&&this._errorFunc(e),(n=this._errorEvent)==null||n.emit(e),this._cancelFunc(e),this._cancelFunc=void 0}}reset(){this._status==="Running"&&console.error("processing cannot reset while running. you can first cancel it!"),(this._status==="Completed"||this._status==="Error")&&(this._status="Initial")}get status(){return this._status}get isInitial(){return this._status==="Initial"}get isRunning(){return this._status==="Running"}get isCompleted(){return this._status==="Completed"}get isError(){return this._status==="Error"}get runningId(){return this._runningId}restart(e=new Fr(""),...n){this.isRunning&&this.cancel(e),this.reset(),this.start(...n)}restartIfNotRunning(...e){this.isRunning||(this.reset(),this.start(...e))}}function xh(i){return(t,...e)=>{const n=new Fg,{completeFunc:r,errorFunc:s}=t,o=i(n,...e).then(r).catch(s).finally(()=>n.destroy());return Lo(o,n.cancel.bind(n)),a=>Ag(o,a)}}class wb extends hi{constructor(){super(({errorFunc:e},n,r)=>{try{const[s,o]=hd(n,r);return this._doFunc=s,o}catch(s){return e(s),()=>{}}});f(this,"_doFunc")}do(...e){this._doFunc&&this._doFunc(...e)}}class Eb extends hi{constructor(e,n){super(({errorFunc:r})=>{try{const[s,o]=hd(e,n);return this._doFunc=s,o}catch(s){return r(s),()=>{}}});f(this,"_doFunc")}do(...e){this._doFunc&&this._doFunc(...e)}}function Sb(i){return new hi(xh((t,...e)=>t.promise(i(...e))))}function bb(i,...t){return new hi(xh(e=>e.promise(i(...t))))}function _d(i){return Sb((...t)=>{const e=i(...t);return jl(e)?e:Vl(e)})}function kg(i,...t){return bb(()=>{const e=i(...t);return jl(e)?e:Vl(e)})}function Cb(i){let t;const e=new Promise((n,r)=>{t=()=>{i(),r()}});return Lo(e,t),e}function Pb(i,...t){const e=new Fg,n=i(e,...t).finally(()=>e.destroy());return Lo(n,e.cancel.bind(e)),n}function Ln(i){return new hi(xh(i))}function xb(i,...t){return new hi(xh(e=>i(e,...t)))}function R0(i,...t){const e=new AbortController;let n=e.signal,[r,s]=t;if(s!=null&&s.signal)throw console.error("init?.signal"),new Error("init?.signal");s=s||{},s.signal&&console.warn("revocableFetch error: init.signal would be override!"),s.signal=n;let o=!1;const a=()=>{o=!0,e.abort()};let l=fetch(r,s);return i&&(l=l.then(u=>{if(!u.ok)return u;if(!u.body)throw Error("ReadableStream not yet supported in this browser.");const h=u.headers.get("content-length");h||console.warn("response.headers.get('content-length') is undefined... cannot get contentLength!");const c=h?parseInt(h,10):0;let d=0;return new Response(new ReadableStream({start(g){if(!u.body)throw new Error("!response.body");const p=u.body.getReader();E();function E(){p.read().then(({done:b,value:P})=>{if(b){g.close();return}if(!P)throw new Error("!value");if(!i)throw new Error("!progressFunc");d+=P.byteLength,i(d,c),g.enqueue(P),E()}).catch(b=>{g.error(b)})}}}),{status:u.status,statusText:u.statusText,headers:u.headers})}).catch(u=>{throw o?(u instanceof Error&&u.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new Fr(`fetching cancelled! error: ${u}`)):(u instanceof Error&&u.code===20&&console.error("error.code === 20"),u)})),Lo(l,a),l}function Ib(i,...t){return R0(i,...t)}function Gg(...i){return R0(void 0,...i)}function Mb(){return _d(Gg)}function Tb(...i){return kg(Gg,...i)}function jg(i,...t){let e=-1;var n=new Promise((r,s)=>{i.isRunning&&i.cancel(),i.reset();const o=new B;o.dispose(i.completeEvent.disposableOn(a=>{if(r(a),o.isDestroyed()){debugger;console.error(`disposer is destroyed! ${o}`);return}o.destroy()})),o.dispose(i.errorEvent.disposableOn(a=>{if(s(a),o.isDestroyed()){debugger;console.error(`disposer is destroyed! ${o}`);return}o.destroy()})),i.start(...t),e=i.runningId});return[r=>e===i.runningId&&i.isRunning&&i.cancel(r),n]}function vs(i,t,...e){try{return t(...e)}catch(n){i(n)}}function Nb(){return new hi(({completeFunc:i,errorFunc:t},e)=>Fl(()=>vs(t,()=>{e&&e(),i()})))}function Ob(i){return new hi(({completeFunc:t,errorFunc:e})=>Fl(()=>vs(e,()=>{i&&i(),t()})))}function Db(){return new hi(({completeFunc:i,errorFunc:t},e)=>wh(()=>{vs(t,()=>{e&&e(),i()})}))}function Rb(i){return new hi(({completeFunc:t,errorFunc:e})=>wh(()=>{vs(e,()=>{i&&i(),t()})}))}function A0(){return new hi(({completeFunc:i,errorFunc:t},e,n)=>Eg(()=>{vs(t,()=>{e&&e(),i()})},n??1e3))}function L0(i,t){return new hi(({completeFunc:e,errorFunc:n})=>Eg(()=>{vs(n,()=>{i&&i(),e()})},t??1e3))}function Ab(){return new hi(({errorFunc:i},t,e=1e3)=>wg(()=>vs(i,t),e))}function Lb(i,t=1e3){return new hi(({errorFunc:e})=>wg(()=>vs(e,i),t))}function Ih(){return new hi(({errorFunc:i},t)=>cd(e=>vs(i,t,e)))}function zl(i){return new hi(({errorFunc:t})=>cd(e=>vs(t,i,e)))}function Mh(i,...t){let e,n;const r=new Promise((o,a)=>{n=a,e=globalThis.setTimeout(()=>{e=void 0,o(t)},i)});return Lo(r,o=>{e&&(clearTimeout(e),e=void 0),n&&n(o??new Fr("sleep cancel error!"))}),r}function Fb(){return _d(Mh)}function kb(i,...t){return kg(Mh,i,...t)}function Ia(i,t,...e){return i.promise(Lg(jg(Ln(async(n,...r)=>(i.disposer.dispose(()=>{n.isDestroyed()||n.cancel()}),await t(n,...r))),...e)))}function Gb(i,t,...e){return i.promise(Lg(jg(t,...e)))}class jb extends hi{constructor(){super(({errorFunc:e},n,r)=>{try{const[s,o]=Ig(n,r);return this._doFunc=s,o}catch(s){return e(s),()=>{}}});f(this,"_doFunc")}do(...e){this._doFunc&&this._doFunc(...e)}}class Vb extends hi{constructor(e,n){super(({errorFunc:r})=>{try{const[s,o]=Ig(e,n);return this._doFunc=s,o}catch(s){return r(s),()=>{}}});f(this,"_doFunc")}do(...e){this._doFunc&&this._doFunc(...e)}}class wd extends B{constructor(e=1e3,n=gd){super();f(this,"_speed");f(this,"_speedChangedEvent");f(this,"_duration");f(this,"_durationChangedEvent");f(this,"_loop");f(this,"startUpdateFunc");f(this,"_updateBindThis");f(this,"_cancelStartUpdateFunc");f(this,"_startTimeStamp");f(this,"_playingChangedEvent");f(this,"_startPlayingEvent");f(this,"_stopPlayingEvent");f(this,"_loopChangedEvent");f(this,"_currentTime",this.disposeVar(z(0)));this._speed=1,this._duration=e,this._loop=!1,this.startUpdateFunc=n,this._updateBindThis=this._update.bind(this),this.dispose(()=>{this._cancelStartUpdateFunc&&(this._cancelStartUpdateFunc(),this._cancelStartUpdateFunc=void 0)}),this._startTimeStamp=Number.NaN,this.dispose(()=>{this._startPlayingEvent&&this._startPlayingEvent.reset(),this._stopPlayingEvent&&this._stopPlayingEvent.reset()})}get startPlayingEvent(){return this._startPlayingEvent=this._startPlayingEvent||new O,this._startPlayingEvent}get stopPlayingEvent(){return this._stopPlayingEvent=this._stopPlayingEvent||new O,this._stopPlayingEvent}get currentTimeChangedEvent(){return this._currentTime.changed}get loopChangedEvent(){return this._loopChangedEvent=this._loopChangedEvent||new O,this._loopChangedEvent}set loop(e){this._loop!==e&&(this._loop=e,this._loopChangedEvent&&this._loopChangedEvent.emit(this._loop))}get loop(){return this._loop}_update(e){if(Number.isNaN(this._startTimeStamp))console.warn("Number.isNaN(this._startTimeStamp)");else{const n=(e-this._startTimeStamp)*this._speed;this._setCurrentTimeInner(n)}}get currentTime(){return this._currentTime.value}set currentTime(e){this._setCurrentTimeInner(e),this._resetStartTime()}_setCurrentTimeInner(e){this._currentTime.value!==e&&(this._duration<=0?this._currentTime.value=0:e<0?this.loop?this._currentTime.value=this._duration+e%this._duration:(this._currentTime.value=0,this.playing&&this._stopPlaying()):e>this._duration?this.loop?this._currentTime.value=e%this._duration:(this._currentTime.value=this._duration,this.playing&&this._stopPlaying()):this._currentTime.value=e)}get durationChangedEvent(){return this._durationChangedEvent||(this._durationChangedEvent=new O),this._durationChangedEvent}get duration(){return this._duration}set duration(e){var n;if(e<0)console.warn("duration sholud greater than 0!");else if(this._duration!==e){const r=this._duration;this._duration=e,this._currentTime.value>this._duration&&(this._currentTime.value=this._duration),(n=this._durationChangedEvent)==null||n.emit(this._duration,r)}}get speedChangedEvent(){return this._speedChangedEvent||(this._speedChangedEvent=new O),this._speedChangedEvent}get speed(){return this._speed}set speed(e){var n;if(this._speed!==e&&e!==0){const r=this._speed;this._speed=e,this._resetStartTime(),(n=this._speedChangedEvent)==null||n.emit(this._speed,r)}}_resetStartTime(){this._startTimeStamp=performance.now()-this._currentTime.value/this._speed}_startPlaying(){var e,n;this._resetStartTime(),this._cancelStartUpdateFunc=this.startUpdateFunc(this._updateBindThis),(e=this._startPlayingEvent)==null||e.emit(this._currentTime.value),(n=this._playingChangedEvent)==null||n.emit(!0)}_stopPlaying(){var e,n;if(!this._cancelStartUpdateFunc)throw new Error("this._cancelStartUpdateFunc is undefined!");this._cancelStartUpdateFunc(),this._cancelStartUpdateFunc=void 0,(e=this._stopPlayingEvent)==null||e.emit(this._currentTime.value),(n=this._playingChangedEvent)==null||n.emit(!1)}get playingChangedEvent(){return this._playingChangedEvent||(this._playingChangedEvent=new O),this._playingChangedEvent}get playing(){return!!this._cancelStartUpdateFunc}set playing(e){!!this._cancelStartUpdateFunc!==e&&(e?this._startPlaying():this._stopPlaying())}}class Th extends B{constructor(e){super();f(this,"_stop",this.disposeVar(z(0)));f(this,"_current",this.disposeVar(z(0)));f(this,"_start",this.disposeVar(z(0)));f(this,"_player",this.disposeVar(new wd(200)));this.dispose(this._player.currentTimeChangedEvent.disposableOn(n=>{let r=n/this._player.duration;r=r>1?1:r<0?0:r;const s=this._start.value,o=this._stop.value;this._current.value=s+(o-s)*r})),this.duration=e}get current(){return this._current.value}get currentChanged(){return this._current.changed}get source(){return this._start.value}get sourceChanged(){return this._start.changed}get target(){return this._stop.value}get targetChanged(){return this._stop.changed}get duration(){return this._player.duration}set duration(e){this._player.duration=e}set target(e){this._start.value=this._current.value,this._stop.value=e,this._player.currentTime=0,this._player.playing=!0}reset(e){this._start.value=e,this._current.value=e,this._stop.value=e,this._player.playing=!1}}let F0=-1;class xe extends O{constructor(t,e,n,r){super(),this._domElement=t,this._type=e,this.callback=r;const s=o=>(o.__xbsj_listenerNo__=++F0,o.__xbsj_listenerTime__=Date.now(),o.__xbsj_lastCurrentTarget__=o.currentTarget,this.emit(o),this.callback&&this.callback(o));this._domElement.addEventListener(this._type,s,n),this.dispose(()=>this._domElement.removeEventListener(this._type,s,n))}static getLastLisenNo(){return F0}static getCurrentTarget(t){return t.__xbsj_lastCurrentTarget__}static getListenerNo(t){return t.__xbsj_listenerNo__}static getListenerTime(t){return t.__xbsj_listenerTime__}static on(t,e){const n=xe.getLastLisenNo();return t.disposableOn(r=>{const s=xe.getListenerNo(r);(s===void 0||s>n)&&e(r)})}get element(){return this._domElement}static create(t,e,n){return new xe(t,e,n)}}class Vg extends B{constructor(){super();f(this,"_clickEvent",this.disposeVar(new O));f(this,"_dbclickEvent",this.disposeVar(new O));f(this,"_pointerdownEvent",this.disposeVar(new O));f(this,"_pointerupEvent",this.disposeVar(new O));f(this,"_pointermoveEvent",this.disposeVar(new O));f(this,"_pointeroutEvent",this.disposeVar(new O));f(this,"dbClickDelayTime",300);f(this,"nativeClickDelayTime",500);f(this,"clickMovementTolerantPixelSize",3);f(this,"debugging",!1);f(this,"_enabled",this.disposeVar(z(!0)));const e=this.disposeVar(Ln(async r=>{do{const s=await Ia(r,l=>new Promise((u,h)=>{l.disposer.dispose(h),l.disposer.dispose(xe.on(this._pointerdownEvent,u))})),o=ji(s);if(this.debugging&&console.log(`鼠标按下 ${o.toString()}`),!await Ia(r,l=>new Promise((u,h)=>{l.disposer.dispose(h);const c=setTimeout(()=>u(!0),this.nativeClickDelayTime);l.disposer.dispose(()=>clearTimeout(c)),l.disposer.dispose(xe.on(this._pointermoveEvent,d=>{const[g,p]=ji(d),[E,b]=o;(Math.abs(g-E)>3||Math.abs(p-b)>3)&&u(!1)})),l.disposer.dispose(xe.on(this._pointeroutEvent,()=>u(!1))),l.disposer.dispose(xe.on(this._pointerupEvent,()=>u(!0)))}))){this.debugging&&console.log("取消1");continue}const a=await Ia(r,l=>new Promise((u,h)=>{l.disposer.dispose(h);const c=setTimeout(()=>u("timeout"),this.dbClickDelayTime);l.disposer.dispose(()=>clearTimeout(c)),l.disposer.dispose(xe.on(this._pointermoveEvent,d=>{const[g,p]=ji(d),[E,b]=o;(Math.abs(g-E)>3||Math.abs(p-b)>3)&&u("moved")})),l.disposer.dispose(xe.on(this._pointerdownEvent,u)),l.disposer.dispose(xe.on(this._pointeroutEvent,()=>u("pointouted"))),l.disposer.dispose(xe.on(this._pointerupEvent,()=>u("pointuped")))}));if(typeof a=="string"){this.debugging&&console.log(`触发单击事件!取消双击监听!error: ${a}`),this._clickEvent.emit(s);continue}if(!await Ia(r,l=>new Promise((u,h)=>{l.disposer.dispose(h);const c=setTimeout(()=>u(!1),this.nativeClickDelayTime);l.disposer.dispose(()=>clearTimeout(c)),l.disposer.dispose(xe.on(this._pointermoveEvent,d=>{const[g,p]=ji(d),[E,b]=o;(Math.abs(g-E)>3||Math.abs(p-b)>3)&&u(!1)})),l.disposer.dispose(xe.on(this._pointeroutEvent,()=>u(!1))),l.disposer.dispose(xe.on(this._pointerupEvent,()=>u(!0)))}))){this.debugging&&console.log("取消2");continue}this.debugging&&console.log("触发双击事件!"),this._dbclickEvent.emit(a)}while(!0)})),n=r=>{r?e.restart():e.isRunning&&e.cancel()};n(this.enabled),this.dispose(this.enabledChanged.disposableOn(n))}get clickEvent(){return this._clickEvent}get dbclickEvent(){return this._dbclickEvent}pointerDown(e){this._pointerdownEvent.emit(e)}pointerUp(e){this._pointerupEvent.emit(e)}pointerMove(e){this._pointermoveEvent.emit(e)}pointerOut(e){this._pointeroutEvent.emit(e)}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}}class zb extends B{constructor(e,n){super();f(this,"_pointerClick",this.disposeVar(new Vg));this._div=e;const{div:r,pointerClick:s}=this,o=h=>s.pointerDown(h),a=h=>s.pointerMove(h),l=h=>s.pointerOut(h),u=h=>s.pointerUp(h);r.addEventListener("pointerdown",o,n),r.addEventListener("pointermove",a,n),r.addEventListener("pointerout",l,n),r.addEventListener("pointerup",u,n),this.dispose(()=>{r.removeEventListener("pointerdown",o,n),r.removeEventListener("pointermove",a,n),r.removeEventListener("pointerout",l,n),r.removeEventListener("pointerup",u,n)})}get div(){return this._div}get pointerClick(){return this._pointerClick}get clickEvent(){return this.pointerClick.clickEvent}get dbclickEvent(){return this.pointerClick.dbclickEvent}}class k0 extends B{constructor(){super();f(this,"_hoverEvent",this.disposeVar(new O));f(this,"_hoverOutEvent",this.disposeVar(new O));f(this,"_pointerdownEvent",this.disposeVar(new O));f(this,"_pointerupEvent",this.disposeVar(new O));f(this,"_pointermoveEvent",this.disposeVar(new O));f(this,"_pointeroutEvent",this.disposeVar(new O));f(this,"delayTime",800);const e=this.disposeVar(A0()),n=u=>{this._hoverOutEvent.emit()},r=u=>{this._hoverOutEvent.emit()};let s;const o=()=>{if(!s){console.warn("!lastPointerEvent");return}this._hoverEvent.emit(s)},a=u=>{s=u,e.restart(void 0,o,this.delayTime),this._hoverOutEvent.emit()},l=u=>{e.cancel(),this._hoverOutEvent.emit()};this.dispose(this._pointerdownEvent.disposableOn(n)),this.dispose(this._pointerupEvent.disposableOn(r)),this.dispose(this._pointermoveEvent.disposableOn(a)),this.dispose(this._pointeroutEvent.disposableOn(l))}get hoverEvent(){return this._hoverEvent}get hoverOutEvent(){return this._hoverOutEvent}pointerDown(e){this._pointerdownEvent.emit(e)}pointerUp(e){this._pointerupEvent.emit(e)}pointerMove(e){this._pointermoveEvent.emit(e)}pointerOut(e){this._pointeroutEvent.emit(e)}}class Bb extends B{constructor(e,n=1500){super();f(this,"_hoverEvent",new O);f(this,"_hoverOutEvent",new O);const r=new Ng(n);this.dispose(()=>r.destroy());let s=0,o=0,a;r.progressFunc=()=>this._hoverEvent.emit(s,o,a);const l=d=>{!r.isRunning&&r.restart(),a=d,[s,o]=ji(d),r.debounce(),this._hoverOutEvent.emit()},u=d=>{!r.isRunning&&r.restart(),a=d,[s,o]=ji(a),r.debounce(),this._hoverOutEvent.emit()},h=d=>{!r.isRunning&&r.restart(),a=d,[s,o]=ji(a),r.debounce(),this._hoverOutEvent.emit()},c=d=>{r.isRunning&&r.cancel(),this._hoverOutEvent.emit()};e.addEventListener("pointerdown",l),e.addEventListener("pointerup",u),e.addEventListener("pointermove",h),e.addEventListener("pointerout",c),this.dispose(()=>{e.removeEventListener("pointerdown",l),e.removeEventListener("pointerup",u),e.removeEventListener("pointermove",h),e.removeEventListener("pointerout",c)})}get hoverEvent(){return this._hoverEvent}get hoverOutEvent(){return this._hoverOutEvent}}class G0 extends B{constructor(e,n={}){super();f(this,"_needRedrawEvent");f(this,"_needPickRedrawEvent");f(this,"_id",Ll());f(this,"_clickEvent");f(this,"_clickOutEvent");f(this,"_dbclickEvent");f(this,"_dbclickOutEvent");f(this,"_actived",!1);f(this,"_activedChanged");f(this,"_hovered",!1);f(this,"_hoveredChanged");f(this,"_selected",!1);f(this,"_selectedChanged");f(this,"_opacity",1);f(this,"_opacityChanged");f(this,"_show",!0);f(this,"_showChanged");this._canvasPrimitivesContext=e;const{needRedraw:r=!0,needPickRedraw:s=!0}=n;r&&(this._needRedrawEvent=new O),s&&(this._needPickRedrawEvent=new O),this._canvasPrimitivesContext.addPoi(this),this.dispose(()=>this._canvasPrimitivesContext.removePoi(this)),this.dispose(this.showChanged.disposableOn(()=>{this.needRedraw(),this.needPickRedraw()})),this.dispose(this.opacityChanged.disposableOn(()=>this.needRedraw()))}get id(){return this._id}set id(e){this._id=e}get context(){return this._canvasPrimitivesContext}needRedraw(){this._needRedrawEvent?this._needRedrawEvent.emit():console.warn("no needRedrawEvent!")}needPickRedraw(){this._needPickRedrawEvent?this._needPickRedrawEvent.emit():console.warn("no needPickRedrawEvent!")}hasClickEvent(){return!!this._clickEvent}get clickEvent(){return this._clickEvent=this._clickEvent||new O,this._clickEvent}hasClickOutEvent(){return!!this._clickOutEvent}get clickOutEvent(){return this._clickOutEvent=this._clickOutEvent||new O,this._clickOutEvent}hasDbclickEvent(){return!!this._dbclickEvent}get dbclickEvent(){return this._dbclickEvent=this._dbclickEvent||new O,this._dbclickEvent}hasDbclickOutEvent(){return!!this._dbclickOutEvent}get dbclickOutEvent(){return this._dbclickOutEvent=this._dbclickOutEvent||new O,this._dbclickOutEvent}set actived(e){this._actived!==e&&(this._actived=e,this._activedChanged&&this._activedChanged.emit(e,this))}get actived(){return this._actived}get activedChanged(){return this._activedChanged=this._activedChanged||new O,this._activedChanged}set hovered(e){this._hovered!==e&&(this._hovered=e,this._hoveredChanged&&this._hoveredChanged.emit(e,this))}get hovered(){return this._hovered}get hoveredChanged(){return this._hoveredChanged=this._hoveredChanged||new O,this._hoveredChanged}set selected(e){this._selected!==e&&(this._selected=e,this._selectedChanged&&this._selectedChanged.emit(e,this))}get selected(){return this._selected}get selectedChanged(){return this._selectedChanged=this._selectedChanged||new O,this._selectedChanged}set opacity(e){this._opacity!==e&&(this._opacity=e,this._opacityChanged&&this._opacityChanged.emit(e,this))}get opacity(){return this._opacity}get opacityChanged(){return this._opacityChanged=this._opacityChanged||new O,this._opacityChanged}set show(e){this._show!==e&&(this._show=e,this._showChanged&&this._showChanged.emit(e,this))}get show(){return this._show}get showChanged(){return this._showChanged=this._showChanged||new O,this._showChanged}}class zg extends G0{constructor(e,n=[0,0],r=0){super(e);f(this,"_winPosAndDepthChanged");this._winPos=n,this._depth=r,this.dispose(this.winPosAndDepthChanged.disposableOn(()=>{this.needRedraw(),this.needPickRedraw()}))}set winPos(e){(this._winPos[0]!==e[0]||this._winPos[1]!==e[1])&&(this._winPos[0]=e[0],this._winPos[1]=e[1],this._winPosAndDepthChanged&&this._winPosAndDepthChanged.emit(this._winPos,this._depth))}get winPos(){return this._winPos}set depth(e){this._depth!==e&&(this._depth=e,this._winPosAndDepthChanged&&this._winPosAndDepthChanged.emit(this._winPos,this._depth))}get depth(){return this._depth}get winPosAndDepthChanged(){return this._winPosAndDepthChanged||(this._winPosAndDepthChanged=new O),this._winPosAndDepthChanged}}function Ma(i,t,e,n){const[r,s]=i,[o,a,l,u]=n,h=t[0]*e[0],c=t[1]*e[1],d=r-(h*o+l),g=s-(c*a+u);return{left:d,top:g,right:d+h,bottom:g+c}}function Ta(i,t,e,n,r){i.beginPath(),i.moveTo(t,e),i.lineTo(t-n*.5,e-n*.5),i.arc(t,e-n,n*.7071067811865475,Math.PI*.75,Math.PI*.25),i.lineTo(t,e),i.fillStyle=r,i.fill()}function Ub(i,t,e,n,r,s){if(i.beginPath(),i.moveTo(t+n,e),i.arc(t,e,n,0,2*Math.PI),s){const o=i.createRadialGradient(t,e,0,t,e,n);o.addColorStop(0,r),o.addColorStop(1,r.replace(/[\d\.]+\)$/,"0)")),i.fillStyle=o}else i.fillStyle=r;i.fill()}function j0(i,t,e,n,r,s){i.beginPath(),i.moveTo(t+s,e),i.lineTo(t+n-s,e),i.arcTo(t+n,e,t+n,e+s,s),i.lineTo(t+n,e+r-s),i.arcTo(t+n,e+r,t+n-s,e+r,s),i.lineTo(t+s,e+r),i.arcTo(t,e+r,t,e+r-s,s),i.lineTo(t,e+s),i.arcTo(t,e,t+s,e,s)}function V0(i,t,e,n,r,s){i.font=r;const o=i.measureText(n),a=o.actualBoundingBoxLeft+o.actualBoundingBoxRight,l=Number.isFinite(o.fontBoundingBoxAscent)?o.fontBoundingBoxAscent:o.actualBoundingBoxAscent,u=Number.isFinite(o.fontBoundingBoxDescent)?o.fontBoundingBoxDescent:o.actualBoundingBoxDescent;let h=l+u;i.fillStyle=s,i.fillText(n,t-a*.5,e+h*.5-u)}function z0(i){const{width:t,height:e}=i,n=t instanceof SVGAnimatedLength?t.baseVal.SVG_LENGTHTYPE_PX:t,r=e instanceof SVGAnimatedLength?e.baseVal.SVG_LENGTHTYPE_PX:e,s=document.createElement("canvas");s.width=n,s.height=r;const o=s.getContext("2d");if(!o)throw new Error("!cavnasCtx");return o.drawImage(i,0,0,n,r),s}function B0(i,t){const{width:e,height:n}=i,r=i.getContext("2d");if(!r)throw new Error("!cavnasCtx");const[s,o,a]=t.map(c=>c*255|0),l=r.getImageData(0,0,e,n),u=l.data;for(var h=0;h<u.length;h+=4)u[h]=s,u[h+1]=o,u[h+2]=a;r.putImageData(l,0,0)}function Bg(i,t,e,n=[.5,1,0,0],r,s="12px Arial",o=2,a="#FFF",l="#000A"){i.font=s;const u=i.measureText(r),h=u.actualBoundingBoxLeft+u.actualBoundingBoxRight,c=u.fontBoundingBoxAscent+u.fontBoundingBoxDescent,d=t,g=e,p=h+o*2,E=c+o*2,{left:b,top:P,bottom:v}=Ma([d,g],[p,E],[1,1],n);i.fillStyle=l,j0(i,b,P,p,E,o),i.fill(),i.fillStyle=a,i.fillText(r,b+o,v-o-u.fontBoundingBoxDescent)}function Nh(i){return("00"+i.toString(16).toUpperCase()).substr(-2)}function Oh(i){const[t,e,n,r]=i.map(s=>s*255|0);return`#${Nh(t)}${Nh(e)}${Nh(n)}${Nh(r)}`}function Ug(i,t){const[e,n,r]=t,s=`${e}-${n}-${r}`;let o=An(i,s);return o||(o=z0(i),B0(o,t),ps(i,s,o)),o}class qb extends zg{constructor(e,n,r=[32,32],s=[.5,1,0,0],o="#F00F"){super(e);f(this,"_tooltip","");f(this,"_title","");f(this,"__scale",[1,1]);f(this,"_tooltipAlpha",0);f(this,"_bgColor",[.3,.3,.3,.8]);f(this,"_bgColorHexStr",Oh(this._bgColor));f(this,"_fgColor",[1,1,1,1]);f(this,"_fgColorHexStr",Oh(this._fgColor));this._image=n,this._size=r,this._originRatioAndOffset=s,this._defaultColorStr=o;const a=new Th(100),l=new Th(100);this.dispose(()=>{a.destroy(),l.destroy()});const u=()=>{if(this._clickEvent&&!this._clickEvent.empty){const h=(1+.08*l.current)*(1+.08*a.current);this._scale=[h,h],this._tooltipAlpha=a.current}};this.dispose(this.activedChanged.disposableOn(h=>{l.target=h?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(h=>{a.target=h?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(()=>{this.needRedraw()})),this.dispose(l.currentChanged.disposableOn(u)),this.dispose(a.currentChanged.disposableOn(u))}set size(e){const[n,r]=e,[s,o]=this._size;(s!==n||o!==r)&&(this._size[0]=n,this._size[1]=r,this.needRedraw(),this.needPickRedraw())}get size(){return this._size}set _scale(e){const[n,r]=e,[s,o]=this.__scale;(s!==n||o!==r)&&(this.__scale[0]=n,this.__scale[1]=r,this.needRedraw(),this.needPickRedraw())}get _scale(){return this.__scale}set fgColor(e){if(!this._fgColor.every((n,r)=>e[r]===n)){const[n,r,s,o]=e;this._fgColor.splice(0,4,n,r,s,o),this._fgColorHexStr=Oh(this._fgColor),this.needRedraw()}}get fgColor(){return this._fgColor}set bgColor(e){if(!this._bgColor.every((n,r)=>e[r]===n)){const[n,r,s,o]=e;this._bgColor.splice(0,4,n,r,s,o),this._bgColorHexStr=Oh(this._bgColor),this.needRedraw()}}get bgColor(){return this._bgColor}set originRatioAndOffset(e){const[n,r,s,o]=this._originRatioAndOffset,[a,l,u,h]=e;(n!==a||r!==l||s!==u||o!==h)&&(this._originRatioAndOffset.splice(0,4,a,l,u,h),this.needRedraw(),this.needPickRedraw())}get originRatioAndOffset(){return this._originRatioAndOffset}set image(e){this._image!==e&&(this._image=e,this.needRedraw())}get image(){return this._image}set defaultColorStr(e){this._defaultColorStr!==e&&(this._defaultColorStr=e,this.needRedraw())}get defaultColorStr(){return this._defaultColorStr}set tooltip(e){this._tooltip!==e&&(this._tooltip=e,this.needRedraw())}get tooltip(){return this._tooltip}set title(e){this._title!==e&&(this._title=e,this.needRedraw())}get title(){return this._title}draw(e){if(!this._show)return;const[n,r]=this._winPos,s=this._size[0]*this.__scale[0],o=this._size[1]*this.__scale[1],{left:a,top:l}=Ma([n,r],this._size,this.__scale,this._originRatioAndOffset),u=e.globalAlpha;if(e.globalAlpha=this.opacity,this._image){if(this.selected){const h=Ug(this._image,[1,0,0]),{left:c,top:d}=Ma([n,r+3],[s+6,o+6],[1,1],this._originRatioAndOffset);e.drawImage(h,c,d,s+6,o+6)}if(this.actived){const[h,c,d,g]=this._fgColor,p=Ug(this._image,[h,c,d]),{left:E,top:b}=Ma([n,r+4],[s+8,o+8],[1,1],this._originRatioAndOffset);e.drawImage(p,E,b,s+8,o+8)}if(this.hovered){const[h,c,d,g]=this._bgColor,p=Ug(this._image,[h,c,d]),{left:E,top:b}=Ma([n,r+2],[s+4,o+4],[1,1],this._originRatioAndOffset);e.drawImage(p,E,b,s+4,o+4)}e.drawImage(this._image,a,l,s,o)}else e.fillStyle=this._fgColorHexStr,e.fillRect(a,l,s,o);if(this._title!==""&&Bg(e,n+20,r-16,[0,.5,0,0],this._title,"14px Arial",4,this._fgColorHexStr,this._bgColorHexStr),e.globalAlpha=u,this._hovered&&this._tooltip!==""){const h=e.globalAlpha;e.globalAlpha=this._tooltipAlpha,Bg(e,n,r-42,[.5,1,0,0],this._tooltip,"12px Arial",4,this._fgColorHexStr,this._bgColorHexStr),e.globalAlpha=h}}drawForPick(e,n){if(!this._show)return;const[r,s]=this._winPos,o=n("default"),a=this._size[0]*this.__scale[0],l=this._size[1]*this.__scale[1],{left:u,top:h}=Ma([r,s],this._size,this.__scale,this._originRatioAndOffset);e.fillStyle=o,e.fillRect(u,h,a,l)}}class Wb extends zg{constructor(e){super(e);f(this,"_width",16);f(this,"_text","");f(this,"_fillStyle","#0F0");f(this,"_scale",1);f(this,"_scaleChanged");this.dispose(this.scaleChanged.disposableOn(o=>{this.needRedraw(),this.needPickRedraw()}));const n=this.disposeVar(new Th(100)),r=this.disposeVar(new Th(100)),s=()=>{this._clickEvent&&!this._clickEvent.empty&&(this.scale=(1+.1*r.current)*(1+.2*n.current))};this.dispose(r.currentChanged.disposableOn(s)),this.dispose(n.currentChanged.disposableOn(s)),this.dispose(this.activedChanged.disposableOn(o=>{r.target=o?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(o=>{n.target=o?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(o=>{this.needRedraw()}))}set scale(e){this._scale!==e&&(this._scale=e,this._scaleChanged&&this._scaleChanged.emit(e,this))}get scale(){return this._scale}get scaleChanged(){return this._scaleChanged||(this._scaleChanged=new O),this._scaleChanged}set width(e){this._width!==e&&(this._width=e,this.needRedraw(),this.needPickRedraw())}get width(){return this._width}set text(e){this._text!==e&&(this._text=e,this.needRedraw())}get text(){return this._text}set fillStyle(e){this._fillStyle!==e&&(this._fillStyle=e,this.needRedraw())}get fillStyle(){return this._fillStyle}draw(e){if(!this._show)return;const[n,r]=this._winPos,s=e.globalAlpha;e.globalAlpha=this.opacity;const o=this._width*this._scale;this.selected&&Ta(e,n,r+3,o+3,"#F00"),this.actived&&this._clickEvent&&!this._clickEvent.empty&&Ta(e,n,r+5,o+5,"#FFF"),this.hovered?Ta(e,n,r+3,o+3,"#000A"):Ta(e,n,r+1,o+1,"#000A"),Ta(e,n,r,o,this._fillStyle);const a=this._scale>1.2?"bold 14px Arial":"bold 10px Arial";V0(e,n,r-o,this._text,a,"#000"),e.globalAlpha=s}drawForPick(e,n){if(!this._show)return;const[r,s]=this._winPos,o=this._width*this._scale,a=n("default");Ta(e,r,s,o,a)}}const U0=new ArrayBuffer(4),q0=new Uint32Array(U0),Na=new Uint8Array(U0);function W0(i){if(i>=16777215)throw new Error("uint32 > 0xFFFFFF");return q0[0]=i,[Na[0],Na[1],Na[2]]}function H0(i,t,e){return Na[0]=i,Na[1]=t,Na[2]=e,Na[3]=0,q0[0]}class X0 extends B{constructor(){super(...arguments);f(this,"_pickColors",new Array(16777215));f(this,"_pickColorIndex",0)}reset(){for(let e=0;e<this._pickColorIndex;++e){const n=this._pickColors[e];if(!n)throw console.error("this._pickColors[i] should not be undefined!"),new Error("this._pickColors[i] should not be undefined!");n.poi=null,n.tag=""}this._pickColorIndex=0}createPickColor(e,n){const r=this._pickColorIndex;++this._pickColorIndex;const s=this._pickColors[r];s?(s.poi=e,s.tag=n):this._pickColors[r]={poi:e,tag:n};const[o,a,l]=W0(r);return[o,a,l]}getPickInfoFromColor(e,n,r){const s=H0(e,n,r);if(s>=this._pickColorIndex){console.error("index >= this._pickColorIndex");return}const o=this._pickColors[s];if(!o){console.error("!this._pickColors[index]");return}return o}destroyImp(){this.reset()}}const $0=(i,t)=>t.depth-i.depth;class Hb extends B{constructor(){super();f(this,"_pois",[]);f(this,"_canvasElement");f(this,"_ctx");f(this,"_offscreenCanvasElement");f(this,"_offscreenCanvasElement2");f(this,"_offscreenCtx");f(this,"_offscreenCtx2");f(this,"_size",[0,0]);f(this,"_needRedraw",!1);f(this,"_needPickRedraw",!1);f(this,"_pickColorManager",new X0);const e=document.createElement("canvas");e.style.width="100%",e.style.height="100%",this._canvasElement=e;const n=e.getContext("2d");if(n===null)throw new Error("cannot get context 2d!");this._ctx=n,this._offscreenCanvasElement=document.createElement("canvas"),this._offscreenCtx=this._offscreenCanvasElement.getContext("2d"),this._offscreenCtx.imageSmoothingEnabled=!1,this._offscreenCanvasElement2=document.createElement("canvas"),this._offscreenCtx2=this._offscreenCanvasElement2.getContext("2d"),this._offscreenCtx2.imageSmoothingEnabled=!1,this.disposeVar(zl(()=>{const[s,o]=this._size,{clientWidth:a,clientHeight:l}=this._canvasElement;(s!==a||o!==l)&&(this._size[0]=a,this._size[1]=l,this._canvasElement.width=a,this._canvasElement.height=l,this._offscreenCanvasElement.width=a,this._offscreenCanvasElement.height=l,this._offscreenCanvasElement2.width=a,this._offscreenCanvasElement2.height=l,this._dirty()),this._needRedraw&&(this._needRedraw=!1,this._draw())})).start()}get element(){return this._canvasElement}get pois(){return this._pois}_dirty(){this._needRedraw=!0,this._needPickRedraw=!0}get size(){return this._size}addPoi(e){if(typeof An(e,"listenHandler")<"u"){console.error("可能有poi重复加载poiManager中!");return}if(this._pois.indexOf(e)!==-1){console.error("同一个poi加了多次!");return}this._pois.push(e),this._dirty();const n=e._needRedrawEvent;if(n){const s=n.on(()=>{this._needRedraw=!0});ps(e,"needRedrawEventHandler",s)}const r=e._needPickRedrawEvent;if(r){const s=r.on(()=>{this._needPickRedraw=!0});ps(e,"needPickRedrawEventHandler",s)}}removePoi(e){const n=this._pois.indexOf(e);if(n===-1){console.error("删除一个不存在的poi!");return}this._pois.splice(n,1),this._dirty();const r=e._needRedrawEvent;if(r){const o=An(e,"needRedrawEventHandler");o?r.off(o):console.error("poi没有listenHandler!")}const s=e._needPickRedrawEvent;if(s){const o=An(e,"needPickRedrawEventHandler");o?s.off(o):console.error("poi没有listenHandler!")}}_draw(){this._pois.sort($0);const[e,n]=this._size;this._ctx.clearRect(0,0,e,n),this._pois.forEach(r=>r.draw(this._ctx))}pick(e,n,r,s){return this._needPickRedraw&&(this._needPickRedraw=!1,this._pickDraw()),this._getPickInfo(e,n,r,s)}_pickDraw(){this._pickColorManager.reset(),this._pois.sort($0);const[e,n]=this._size;this._offscreenCtx.clearRect(0,0,e,n),this._pois.forEach(r=>{const s=o=>{const[a,l,u]=this._pickColorManager.createPickColor(r,o);return`rgb(${a}, ${l}, ${u})`};r.drawForPick(this._offscreenCtx,s)})}_getPickInfo(e,n,r,s){const o=this._offscreenCtx.getImageData(e,n,r,s),a=[],l=o.data.length/4;for(let u=0;u<l;++u){const h=o.data[u*4+0],c=o.data[u*4+1],d=o.data[u*4+2];if(o.data[u*4+3]===255){const p=this._pickColorManager.getPickInfoFromColor(h,c,d);if(p&&p.poi&&!a.includes(p)){let E=!0;{const[b,P]=this._size;this._offscreenCtx2.clearRect(0,0,b,P);const v=C=>"rgb(255, 255, 255)";p.poi.drawForPick(this._offscreenCtx2,v);const _=this._offscreenCtx2.getImageData(e,n,r,s),m=_.data[u*4+0],y=_.data[u*4+1],S=_.data[u*4+2];_.data[u*4+3],m===255&&y===255&&S===255||(E=!1)}E&&a.push(p)}}}return a}}class qg extends B{constructor(){super(...arguments);f(this,"_closeEvent");f(this,"_show",!0);f(this,"_showChanged");f(this,"_opacity",1);f(this,"_opacityChanged");f(this,"_winPos",[0,0]);f(this,"_winPosChanged")}set winPos(e){const[n,r]=e,[s,o]=this._winPos;(n!==s||r!==o)&&(this._winPos[0]=n,this._winPos[1]=r,this._winPosChanged&&this._winPosChanged.emit(this._winPos))}get winPos(){return this._winPos}get winPosChanged(){return this._winPosChanged=this._winPosChanged||new O,this._winPosChanged}set opacity(e){this._opacity!==e&&(this._opacity=e,this._opacityChanged&&this._opacityChanged.emit(this._opacity))}get opacity(){return this._opacity}get opacityChanged(){return this._opacityChanged=this._opacityChanged||new O,this._opacityChanged}set show(e){this._show!==e&&(this._show=e,this._showChanged&&this._showChanged.emit(this._show))}get show(){return this._show}get showChanged(){return this._showChanged=this._showChanged||new O,this._showChanged}get closeEvent(){return this._closeEvent||(this._closeEvent=new O),this._closeEvent}}const Wg=new WeakMap;function Hg(i){if(!Wg.has(i)){const t=new ad(()=>new i,e=>e.reset());Wg.set(i,t)}return Wg.get(i)}class Xg extends qg{constructor(){super();f(this,"_div");f(this,"_contentDiv");f(this,"_originOffsetX",0);f(this,"_originOffsetY",0);f(this,"_originRatioX",.5);f(this,"_originRatioY",1);f(this,"_divChanged",new O);const e=document.createElement("div");e.style.cssText="width: 0px; height: 0px; position: absolute; opacity: 1.0; visibility: visible;";const n=document.createElement("div");n.style.cssText=`position: absolute; left: ${-this._originOffsetX}px; top: ${-this._originOffsetY}px; transform: translateX(-${100*this._originRatioX}%) translateY(-${100*this._originRatioY}%); margin: 0; padding: 0; pointer-events: none;`;const r=document.createElement("div");this._contentDiv=r,n.appendChild(r),e.appendChild(n),this._div=e,this.dispose(this._divChanged.disposableOn(()=>{n.style.left=`${-this._originOffsetX}px`,n.style.top=`${-this._originOffsetY}px`,n.style.transform=`translateX(-${100*this._originRatioX}%) translateY(-${100*this._originRatioY}%)`})),this.dispose(this.winPosChanged.disposableOn(([s,o])=>{this._div.style.left=`${s}px`,this._div.style.top=`${o}px`})),this.dispose(this.opacityChanged.disposableOn(s=>{this._div.style.opacity=`${s}`})),this.dispose(this.showChanged.disposableOn(s=>{this._div.style.visibility=s?"visible":"hidden"}))}get contentDiv(){return this._contentDiv}reset(){}get originOffsetX(){return this._originOffsetX}set originOffsetX(e){this._originOffsetX!==e&&(this._originOffsetX=e,this._divChanged.emit())}get originOffsetY(){return this._originOffsetY}set originOffsetY(e){this._originOffsetY!==e&&(this._originOffsetY=e,this._divChanged.emit())}get originRatioX(){return this._originRatioX}set originRatioX(e){this._originRatioX!==e&&(this._originRatioX=e,this._divChanged.emit())}get originRatioY(){return this._originRatioY}set originRatioY(e){this._originRatioY!==e&&(this._originRatioY=e,this._divChanged.emit())}get element(){return this._div}}class Y0 extends B{constructor(e,n){super();f(this,"_floatDiv");f(this,"_show",!1);f(this,"_showChanged");this._customDivClass=e,this._divContainer=n,this.dispose(()=>{this.show=!1})}_updateDivPoi(){if(this._show){const{floatDiv:n}=this;n.element.parentElement||this._divContainer.appendChild(n.element)}else{const{_floatDiv:n}=this;n&&n.element.parentElement&&this._divContainer.removeChild(n.element)}}set show(e){this._show!==e&&(this._show=e,this._updateDivPoi(),this._showChanged&&this._showChanged.emit(e))}get show(){return this._show}get floatDiv(){if(!this._floatDiv){const e=Hg(this._customDivClass).create();this.dispose(()=>{Hg(this._customDivClass).destroy(e)}),this._floatDiv=e}return this._floatDiv}get showChanged(){return this._showChanged||(this._showChanged=new O),this._showChanged}}const Xb=["top","bottom","left","right"];function $b(i){return Object.entries(i).map(([t,e])=>Xb.includes(t)?`${t}: ${e}px; `:"").join("")}function J0(i,t,e){const n=document.createElement("div");n.style.cssText=`position: absolute; ${$b(e)} background-color: ${i}; border-radius: ${t}px;`;const r='<svg viewBox="0 0 1024 1024" style="display: block;" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2420" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M512 128C300.8 128 128 300.8 128 512s172.8 384 384 384 384-172.8 384-384S723.2 128 512 128zM512 832c-179.2 0-320-140.8-320-320s140.8-320 320-320 320 140.8 320 320S691.2 832 512 832z" p-id="2421" fill="#ffffff"></path><path d="M672 352c-12.8-12.8-32-12.8-44.8 0L512 467.2 396.8 352C384 339.2 364.8 339.2 352 352S339.2 384 352 396.8L467.2 512 352 627.2c-12.8 12.8-12.8 32 0 44.8s32 12.8 44.8 0L512 556.8l115.2 115.2c12.8 12.8 32 12.8 44.8 0s12.8-32 0-44.8L556.8 512l115.2-115.2C684.8 384 684.8 364.8 672 352z" p-id="2422" fill="#ffffff"></path></svg>';return n.innerHTML=r,n}function Z0(i,t,e="rgba(0,0,0,0.7)"){const n=document.createElement("div");n.style.cssText=`margin: 0 auto; width: ${i}px; height: ${t}px; position: relative; pointer-events: none;`;const r=document.createElement("div");return r.style.cssText=`position: absolute; left: 0px; top: 0px; width: 0; height: 0; border-left: ${i*.5}px solid transparent; border-right: ${i*.5}px solid transparent; border-top: ${t}px solid ${e};`,n.appendChild(r),[n,r]}class K0 extends Xg{constructor(){super();f(this,"_borderDiv");f(this,"_closeDiv");f(this,"_innerContentDiv");f(this,"_colorStr","rgba(0, 0, 0, 0.7)");f(this,"_divColorChanged",new O);f(this,"_borderRadius",10);const e=document.createElement("div");e.style.cssText=`position: relative; background-color: ${this._colorStr}; border-radius: ${this._borderRadius}px; padding: 5px; pointer-events: all;`,this._borderDiv=e;const n=J0(this._colorStr,10,{top:3,right:3}),[r,s]=Z0(2*this._borderRadius,2*this._borderRadius,this._colorStr),o=document.createElement("div");this._innerContentDiv=o,e.appendChild(o),e.appendChild(n),this.contentDiv.appendChild(e),this.contentDiv.appendChild(r),n.style.opacity="0.1",n.onmouseenter=()=>{n.style.opacity="1.0"},n.onmouseleave=()=>{n.style.opacity="0.1"},n.onclick=()=>{this._closeEvent&&this._closeEvent.emit()},this._closeDiv=n,this.dispose(this._divColorChanged.disposableOn(()=>{s.style.borderTopColor=this._colorStr,e.style.backgroundColor=this._colorStr,r.style.width=`${this._borderRadius*2}px`,r.style.height=`${this._borderRadius*2}px`,s.style.borderLeft=`${this._borderRadius}px`,s.style.borderRight=`${this._borderRadius}px`,s.style.borderTop=`${this._borderRadius*2}px`}));const a=l=>{l.key==="Escape"&&this._closeEvent&&this._closeEvent.emit()};document.body.addEventListener("keydown",a,!0),this.dispose(()=>{document.removeEventListener("keydown",a,!0)})}get borderDiv(){return this._borderDiv}get innerContentDiv(){return this._innerContentDiv}reset(){this.show=!1,this.opacity=0,this._closeDiv.style.opacity="0.1",super.reset()}get colorStr(){return this._colorStr}set colorStr(e){this._colorStr!==e&&(this._colorStr=e,this._divColorChanged.emit())}get borderRadius(){return this._borderRadius}set borderRadius(e){this._borderRadius!==e&&(this._borderRadius=e,this._divColorChanged.emit())}}class Yb extends K0{constructor(){super();f(this,"_iframe");f(this,"_iframeMessageEvent");const e=document.createElement("iframe");e.style.cssText="width: 100%; height: 100%; border-width: 0px; border-radius: 5px; display: block;",e.src="http://www.weather.com.cn/live/index.shtml",this._iframe=e,this.innerContentDiv.appendChild(e);const n=r=>{r.source===this._iframe.contentWindow&&(this._iframeMessageEvent?this._iframeMessageEvent.emit(r):console.warn(`iframe消息接收到未处理!data: ${r.data}`))};window.addEventListener("message",n),this.dispose(()=>{window.removeEventListener("message",n)})}reset(){super.reset(),this.src=""}set src(e){this._iframe.src!==e&&(this._iframe.src=e)}get src(){return this._iframe.src}get iframe(){return this._iframe}get iframeMessageEvent(){return this._iframeMessageEvent=this._iframeMessageEvent||new O,this._iframeMessageEvent}}class Jb extends qg{constructor(){super();f(this,"_div");f(this,"_contentContainer");f(this,"_text","");const e=document.createElement("div");this._div=e,e.style.cssText="width: 0px; height: 0px; position: absolute; opacity: 1.0; visibility: visible; transition: opacity 0.5s;";const n=document.createElement("div");n.style.cssText="position: absolute; left: 0px; bottom: 0px; transform: translateX(-50%); margin: 0; padding: 0; pointer-events: none;";const r=document.createElement("div");r.style.cssText="position: relative; background-color: rgba(0, 0, 0, 0.7); border-radius: 5px; padding: 3px; pointer-events: all; color: white; white-space: nowrap;",r.innerText=this._text,this._div.appendChild(n),n.appendChild(r),this._contentContainer=r,this._div=e,this.dispose(this.winPosChanged.disposableOn(([s,o])=>{this._div.style.left=`${s}px`,this._div.style.top=`${o-50}px`})),this.dispose(this.opacityChanged.disposableOn(s=>{this._div.style.opacity=`${s}`})),this.dispose(this.showChanged.disposableOn(s=>{this._div.style.visibility=s?"visible":"hidden"}))}get element(){return this._div}reset(){this.opacity=1,this.show=!0}set text(e){this._text!==e&&(this._text=e,this._contentContainer.innerText=e)}get text(){return this._text}}class Zb extends Xg{constructor(){super(),this.contentDiv.style.backgroundColor="rgba(0, 0, 0, 0.8)",this.contentDiv.style.borderRadius="3px",this.contentDiv.style.color="rgb(255, 255, 255)",this.contentDiv.style.padding="1px 5px 1px 5px",this.contentDiv.style.fontSize="12px",this.contentDiv.style.whiteSpace="nowrap",this.contentDiv.innerText="未定义光标信息!",this.originRatioX=0,this.originRatioY=0,this.originOffsetX=-16}}class Kb extends B{constructor(e,n){super();f(this,"_cursorDiv");f(this,"_pointerOut",this.disposeVar(z(!1)));f(this,"_show",this.disposeVar(z(!0)));this._cursorDiv=new Y0(n,e),this.dispose(()=>this._cursorDiv.destroy());const r=o=>{const[a,l]=ji(o);this._cursorDiv.floatDiv.winPos=[a,l]};e.addEventListener("pointermove",r),this.dispose(()=>e.removeEventListener("pointermove",r));const s=()=>{this._cursorDiv.show=this.show&&this._pointerOut.value};s(),this.dispose(this.showChanged.disposableOn(s)),this.dispose(this._pointerOut.changed.disposableOn(s))}set show(e){this._show.value=e}get show(){return this._show.value}get showChanged(){return this._show.changed}reset(){this._pointerOut.value=!1}get cursorDiv(){return this._cursorDiv}set text(e){this._cursorDiv.floatDiv.contentDiv.innerText=e}get text(){return this._cursorDiv.floatDiv.contentDiv.innerText}}function Dh(i,t,e){if(!(i.tree===t.tree&&i!==t&&!i.isAncestorOf(t))||i.tree!==t.tree||!i.parent)return!1;if(!i.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");return!(t===i||i.isAncestorOf(t)||e!=="inner"&&!t.parent||e==="inner"&&!t.children)}function Ed(i,t,e){if(!i.tree||!t.tree||i.tree!==t.tree)return;if(!i.parent){console.warn("当前节点没有父节点,那么该节点无法被移动!");return}if(!i.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");if(t===i){console.warn("自身不能拖放到自身!");return}if(i.isAncestorOf(t)){console.warn("当前节点不能拖放到它自身的后代节点之上!");return}if(e!=="inner"&&!t.parent){console.warn("目标节点没有父节点,无法拖放!");return}if(e==="inner"&&!t.children){console.warn("无法移动到目标节点的子节点中,因为目标节点不是组节点!");return}i.tree._startTransaction();const n=i.parent.children.indexOf(i);if(i.parent.children.splice(n,1),e!=="inner"){const{parent:r}=t;if(!r||!r.children)throw new Error("!parent");const s=r.children.indexOf(t);e==="before"?r.children.splice(s,0,i):e==="after"&&r.children.splice(s+1,0,i)}else t.children.push(i);i.tree._stopTransaction()}function Q0(i,t,e){return Cg(i,n=>Dh(n,t,e))}function ty(i,t,e){for(let n of i)Dh(n,t,e)?Ed(n,t,e):console.warn(`treeItem(id: ${n.id}) cannot move...`)}const Qb={checked:1,unchecked:2,indeterminate:3},tC=["checked","unchecked","indeterminate"];class ey extends B{constructor(e){super();f(this,"_collapsed",this.disposeVar(z(!1)));f(this,"_checkedStatus",this.disposeVar(z("unchecked")));f(this,"_selected",this.disposeVar(z(!1)));f(this,"_moveToPositionMode",this.disposeVar(z("none")));f(this,"_updateCheckedStatusFromChildrenEvent",this.disposeVar(new O));this._treeItem=e;const n=()=>this._treeItem.tree&&this._treeItem.tree.itemsChanged.emit([this._treeItem]);this.dispose(this._collapsed.changed.disposableOn(n)),this.dispose(this._checkedStatus.changed.disposableOn(n)),this.dispose(this._selected.changed.disposableOn(n)),this.dispose(this._moveToPositionMode.changed.disposableOn(n)),this.dispose(this._checkedStatus.changed.disposableOn(()=>this._treeItem.parent&&this._treeItem.parent.uiTreeObject.updateCheckedStatusFromChildren())),this.dispose(this._treeItem.childrenChangedEvent.disposableOn(()=>{this.updateCheckedStatusFromChildren()}));const r=this.disposeVar(Ve(this._updateCheckedStatusFromChildrenEvent));this.dispose(r.disposableOn(()=>{if(!this._treeItem.children)return;let s=0;bg(this._treeItem.children,o=>(s|=Qb[o.uiTreeObject.checkedStatus],s===3)),s>0&&(this._checkedStatus.value=tC[s-1])})),this.dispose(this._treeItem.childrenResetedEvent.disposableOn(s=>{!s&&this.checkedStatus==="indeterminate"&&(this._checkedStatus.value="unchecked")}));{const s=(o,a,l=!0)=>{if(a)o.selectedItems.push(this._treeItem);else{const u=o.selectedItems.indexOf(this._treeItem);u===-1?l&&console.error("selectedItems index -1"):o.selectedItems.splice(u,1)}};this.dispose(this._selected.changed.disposableOn(o=>{const{tree:a}=this._treeItem;a&&s(a,o)})),this.dispose(()=>this.selected=!1)}}get treeItem(){return this._treeItem}get collapsed(){return this._collapsed.value}set collapsed(e){this._collapsed.value=e}get collapsedChanged(){return this._collapsed.changed}get checkedStatus(){return this._checkedStatus.value}check(e){const n=e?"checked":"unchecked";if(this._checkedStatus.value!==n&&(this._checkedStatus.value=n,this._treeItem.children))for(let r of this._treeItem.children)r.uiTreeObject.check(e)}updateCheckedStatusFromChildren(){this._updateCheckedStatusFromChildrenEvent.emit()}get checkedStatusChanged(){return this._checkedStatus.changed}get selected(){return this._selected.value}set selected(e){this._selected.value=e}get selectedChanged(){return this._selected.changed}get moveToPositionMode(){return this._moveToPositionMode.value}set moveToPositionMode(e){this._moveToPositionMode.value=e}get moveToPositionModeChanged(){return this._moveToPositionMode.changed}}const as=class as extends B{constructor(e,n=!1,r){super();f(this,"_children");f(this,"_childrenResetedEvent");f(this,"_childrenToChangeEvent");f(this,"_childrenChangedEvent");f(this,"_parent",this.disposeVar(z(void 0)));f(this,"_level",this.disposeVar(z(0)));f(this,"_id");f(this,"_uiTreeObject",this.disposeVar(new ey(this)));this._tree=e,this._hasChildren=n,this._id=r??Ll(),this._id!=="_ROOT"&&as.wm.has(this._id)&&console.warn(`创建了id(${this._id})相同的树节点,会导致之前的树节点无法索引!`),as.wm.set(this._id,this),this.dispose(()=>{if(this._id!=="_ROOT"&&!as.wm.has(this._id)){console.warn(`树节点(${this._id})不在wm树上!`);return}as.wm.delete(this._id)}),this.dispose(this._parent.changed.disposableOn(()=>{this._updateLevel()})),this.dispose(this._level.changed.disposableOn(()=>{if(this.children)for(let s of this.children)s._updateLevel()})),as.allTreeItems.set(this._id,this),this.dispose(()=>{as.allTreeItems.delete(this._id)})}static getFromId(e){return as.wm.get(e)}get uiTreeObject(){return this._uiTreeObject}get id(){return this._id}_updateLevel(){this.parent&&(this._level.value=this.parent.level+1)}get parent(){return this._parent.value}get parentChanged(){return this._parent.changed}get children(){if(this._hasChildren){if(!this._children){const e=this.disposeVar(new Ph);this._children=e,this.dispose(e.toChangeEvent.disposableOn((s,o)=>{for(let a of s){const{start:l,deleteCount:u,items:h}=a;for(let c=l;c<l+u;++c)o.get(c)._parent.value=void 0;for(let c of h){if(c.parent)throw console.error("请检查新增的treeItem是否正在使用!"),new Error("item.parent should not exist!");c._parent.value=this}}}));const n=new Set,r=new Set;this.dispose(e.toChangeEvent.disposableOn((s,o)=>{var a;if(this.tree){n.clear(),r.clear();for(let l of s){const{start:u,deleteCount:h,items:c}=l;for(let d=u;d<u+h;++d)n.add(o.get(d));for(let d of c)r.add(d)}for(let l of n)r.has(l)&&(n.delete(l),r.delete(l));(a=this.tree)==null||a.itemChildrenToChange.emit(this,s,n,r)}})),this.dispose(e.changedEvent.disposableOn(()=>{var s;(s=this.tree)==null||s.itemChildrenChanged.emit(this)})),this.dispose(e.toChangeEvent.disposableOn((...s)=>this._childrenToChangeEvent&&this._childrenToChangeEvent.emit(...s))),this.dispose(e.changedEvent.disposableOn((...s)=>this._childrenChangedEvent&&this._childrenChangedEvent.emit(...s)))}return this._children}else return}get childrenResetedEvent(){return this._childrenResetedEvent||(this._childrenResetedEvent=new O),this._childrenResetedEvent}get childrenToChangeEvent(){return this._childrenToChangeEvent||(this._childrenToChangeEvent=new O),this._childrenToChangeEvent}get childrenChangedEvent(){return this._childrenChangedEvent||(this._childrenChangedEvent=new O),this._childrenChangedEvent}resetChildren(e=!1){this._children&&(this._children.length=0),this._hasChildren=e,this._childrenResetedEvent&&this._childrenResetedEvent.emit(e)}*getDescendants(e){const n=this,r=[],s=[];for(n.children&&n.children.length>0&&(!e||e(n))&&(r.push(0),s.push(n.children));r.length>0;){const o=r[r.length-1],a=s[s.length-1],l=a.get(o);yield l,o<a.length-1?++r[r.length-1]:(s.pop(),r.pop()),l.children&&l.children.length>0&&(!e||e(l))&&(r.push(0),s.push(l.children))}}*getAncestors(e){let n=this.parent;for(;n&&(yield n,!(e&&!e(n)));)n=n.parent}isDescendantOf(e){for(let n of this.getAncestors())if(n===e)return!0;return!1}isAncestorOf(e){return e.isDescendantOf(this)}get level(){return this._level.value}get levelChanged(){return this._level.changed}get tree(){return this._tree}canMoveTo(e,n){return Dh(this,e,n)}moveTo(e,n){Ed(this,e,n)}detachFromParent(){if(!this.parent||!this.parent.children)return;const e=this.parent.children.indexOf(this);this.parent.children.splice(e,1)}insertNewTreeItem(e,n){if(n&&n.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&e.startsWith("Inner"))return n&&this.children.push(n),!0;if(e==="Inner")return!1;const r=this.parent;if(!r||!r.children)return!1;const s=r.children.indexOf(this);return e.endsWith("Before")?n&&r.children.splice(s,0,n):e.endsWith("After")&&n&&r.children.splice(s+1,0,n),!0}};f(as,"wm",new Map),f(as,"allTreeItems",new Map);let Rh=as;class iy extends B{constructor(e){super();f(this,"_redrawEvent",this.disposeVar(new O));f(this,"_containerScrollTop",this.disposeVar(z(0)));f(this,"_containerClientHeight",this.disposeVar(z(-1)));f(this,"_container",this.disposeVar(z(void 0)));f(this,"_redrawInfo",{topFreeSpaceHeight:0,topUnvisibleItemNum:0,middleTreeItems:[],bottomFreeSpaceHeight:0,bottomUnvisibleItemNum:0});this._tree=e;const n=this._containerClientHeight,r=this._containerScrollTop,s=this._tree._forceRedrawEvent,o=this.disposeVar(Ve(this._tree.itemDivHeightChanged,this._tree.itemChildrenChanged,this._tree.itemsChanged,n.changed,r.changed,s)),{redrawInfo:a}=this,l=h=>{const c=h.uiTreeObject;return!!h.children&&(!c||!c.collapsed)};this.dispose(o.disposableOn(()=>{if(a.topFreeSpaceHeight=0,a.topUnvisibleItemNum=0,a.middleTreeItems.length=0,a.bottomFreeSpaceHeight=0,a.bottomUnvisibleItemNum=0,this._containerClientHeight.value>=0){const h=Pg(this._tree.getDescendants(l)),c=this._tree.itemDivHeight,d=c*h,g=to([Ao([to([d-n.value,0]),r.value]),0]),p=g/c|0,E=Math.ceil((g-p*c+n.value)/c)|0;p>0&&(a.topUnvisibleItemNum=p,a.topFreeSpaceHeight=p*this._tree.itemDivHeight);const b=p+E;let P=0;for(let _ of this._tree.getDescendants(l)){if(P>=b)break;P>=p&&a.middleTreeItems.push(_),++P}const v=h-p-E;v>0&&(a.bottomUnvisibleItemNum=v,a.bottomFreeSpaceHeight=v*this._tree.itemDivHeight)}else for(let h of this._tree.getDescendants(l))a.middleTreeItems.push(h);this._redrawEvent.emit(a)}));let u;this.dispose(()=>u&&(u.destroy(),u=void 0)),this.dispose(this.containerChanged.disposableOn(h=>{u&&(u.destroy(),u=void 0),h&&(u=Ih(),u.start(()=>{const{scrollTop:c,clientHeight:d}=h;typeof c>"u"||typeof d>"u"?Rl("createUiTreeWithContainer error: conainter has no scrollTop or clientHeight property!"):(this.containerScrollTop=c,this.containerClientHeight=d)}))}))}get container(){return this._container.value}set container(e){this._container.value=e}get containerChanged(){return this._container.changed}get redrawInfo(){return this._redrawInfo}getTreeItemPos(e){const n=o=>{const a=o.uiTreeObject;return!!o.children&&(!a||!a.collapsed)};let r=0,s=!1;for(let o of this._tree.getDescendants(n)){if(o===e){s=!0;break}++r}if(s)return[r,r*this._tree.itemDivHeight]}collapseAll(){console.log("collapseAll");for(let e of this.tree.root.getDescendants()){const n=e.uiTreeObject;n.collapsed=!0}}expandAll(){console.log("expandAll");for(let e of this.tree.root.getDescendants()){const n=e.uiTreeObject;n.collapsed=!1}}get tree(){return this._tree}get redrawEvent(){return this._redrawEvent}set containerScrollTop(e){this._containerScrollTop.value=e}get containerScrollTop(){return this._containerScrollTop.value}get containerScrollTopChanged(){return this._containerScrollTop.changed}set containerClientHeight(e){this._containerClientHeight.value=e}get containerClientHeight(){return this._containerClientHeight.value}get containerClientHeightChanged(){return this._containerClientHeight.changed}*getAllItems(e){for(let n of this._tree.getDescendants())(!e||e(n))&&(yield n)}getAllSelectedItems(){return this.getAllItems(e=>e.uiTreeObject.selected)}getAllCheckedItems(){return this.getAllItems(e=>e.uiTreeObject.checkedStatus==="checked")}getAllCheckedLeafItems(){return this.getAllItems(e=>!e.children&&e.uiTreeObject.checkedStatus==="checked")}selectAllItems(e){for(let n of this.getAllItems())(!e||!e.includes(n))&&(n.uiTreeObject.selected=!0)}clearAllSelectedItems(e){for(let n of this.getAllSelectedItems())(!e||!e.includes(n))&&(n.uiTreeObject.selected=!1)}checkAllItems(e){for(let n of this.getAllItems())(!e||!e.includes(n))&&n.uiTreeObject.check(!0)}clearAllCheckedItems(e){for(let n of this.getAllCheckedItems())(!e||!e.includes(n))&&n.uiTreeObject.check(!1)}}const da=class da extends B{constructor(e){super();f(this,"_root",this.disposeVar(new Rh(this,!0,"_ROOT")));f(this,"_itemChildrenChanged",this.disposeVar(new O));f(this,"_itemChildrenToChange",this.disposeVar(new O));f(this,"_itemsAdded",this.disposeVar(new O));f(this,"_itemsDeleted",this.disposeVar(new O));f(this,"_itemsChanged",this.disposeVar(new O));f(this,"_transactionStack",0);f(this,"_addedItems",new Set);f(this,"_deletedItems",new Set);f(this,"_selectedItems",this.disposeVar(new Ph));f(this,"_itemDivHeight",this.disposeVar(z(da.defaultItemDivHeight)));f(this,"_forceRedrawEvent",this.disposeVar(new O));f(this,"_uiTree",this.disposeVar(new iy(this)));this._root._tree.value=this,this.dispose(this._itemChildrenToChange.disposableOn((n,r)=>{if(!n.children){console.error("!item.children");return}for(let s of r){const{start:o,deleteCount:a,items:l}=s;for(let u=o;u<o+a;++u){const h=n.children.get(u);this._deletedItems.has(h)?console.error(`this._deletedItems.has(currentItem(${h.id}))`):this._deletedItems.add(h)}for(let u of l)this._deletedItems.has(u)?this._deletedItems.delete(u):this._addedItems.add(u)}this._execTransaction()})),e!==void 0&&(this.itemDivHeight=e)}get selectedItems(){return this._selectedItems}get lastSelectedItem(){return this._selectedItems.length>0?this._selectedItems.get(this._selectedItems.length-1):void 0}get itemDivHeight(){return this._itemDivHeight.value}set itemDivHeight(e){this._itemDivHeight.value=e}get itemDivHeightChanged(){return this._itemDivHeight.changed}forceRedraw(){this._forceRedrawEvent.emit()}get uiTree(){return this._uiTree}get root(){return this._root}get children(){return this._root.children}getDescendants(e){return this._root.getDescendants(e)}getTreeItemFromId(e){let n;for(let r of this.getDescendants())if(r.id===e){n=r;break}return n}_startTransaction(){this._transactionStack===0&&(this._deletedItems.size>0&&(console.warn("this._deletedItems.size > 0"),this._deletedItems.clear()),this._addedItems.size>0&&(console.warn("this._addedItems.size > 0"),this._addedItems.clear())),++this._transactionStack}_stopTransaction(){--this._transactionStack,this._execTransaction()}_execTransaction(){this._transactionStack===0&&(this._deletedItems.size>0&&(this._itemsDeleted.emit([...this._deletedItems]),this._deletedItems.clear()),this._addedItems.size>0&&(this._itemsAdded.emit([...this._addedItems]),this._addedItems.clear()))}get itemChildrenChanged(){return this._itemChildrenChanged}get itemChildrenToChange(){return this._itemChildrenToChange}get itemsChanged(){return this._itemsChanged}get itemsAdded(){return this._itemsAdded}get itemsDeleted(){return this._itemsDeleted}};f(da,"defaultItemDivHeight",24),f(da,"canMoveToTreeItem",Dh),f(da,"moveToTreeItem",Ed),f(da,"canMoveToTreeItems",Q0),f(da,"moveToTreeItems",ty);let Oa=da;class qe extends B{constructor(e,n,r=!0,s){super();f(this,"_obj",this.disposeVar(z(void 0)));this._resetEvent=e,this._createFunc=n;const o=this._resetEvent,a=this._createFunc,l=()=>{this._obj.value&&(this._obj.value.destroy(),this._obj.value=void 0)};this.dispose(l);const u=(...h)=>{l(),this._obj.value=a(...h)};r&&(s?this._obj.value=a(...s):this._obj.value=a()),this.dispose(o.disposableOn(u))}get obj(){return this._obj.value}get objChanged(){return this._obj.changed}}class eC extends B{constructor(e,n=!0,r){super();f(this,"_event",this.disposeVar(new O));f(this,"_objResettingWithEvent");this._createFunc=e,this._execOnInit=n,this._initParams=r,this._objResettingWithEvent=this.disposeVar(new qe(this._event,this._createFunc,this._execOnInit,this._initParams))}get obj(){return this._objResettingWithEvent.obj}get objChanged(){return this._objResettingWithEvent.objChanged}reset(...e){this._event.emit(...e)}}const hg=class hg extends B{constructor(){super();f(this,"_set",new Set);f(this,"_toChangeEvent",this.dv(new O));f(this,"_changedEvent",this.dv(new O));f(this,"main");this.dispose(()=>{this._set.size!==0&&(hg.warnOnDestroying&&console.warn("this._set.size > 0"),this.clear())})}get toChange(){return this._toChangeEvent}get changed(){return this._changedEvent}add(...e){if(e.length==2&&typeof e[1]=="boolean")e[1]&&(this.main=e[0]);else for(let n of e)this._toChangeEvent.emit([],[n]),this._set.add(n),this._changedEvent.emit([],[n])}delete(...e){for(let n of e)this.main&&this.main==n&&(this.main=void 0),this._toChangeEvent.emit([n],[]),this._set.delete(n),this._changedEvent.emit([n],[])}disposableAdd(...e){return e.length==2&&typeof e[1]=="boolean"?(e[1]&&(this.main=e[0]),this.add(e[0]),()=>this.delete(e[0])):(this.add(...e),()=>this.delete(...e))}get size(){return this._set.size}clear(){const e=[...this._set];this._toChangeEvent.emit([],e),this._set.clear(),this._changedEvent.emit([],e),this.main=void 0}values(){return this._set.values()}};f(hg,"warnOnDestroying",!0);let Sd=hg;async function ny(i){const t=[],e=[],n=i.entries();for await(const[r,s]of n){const o=s;o.kind==="file"?t.push(r):o.kind==="directory"&&e.push(r)}return{files:t,dirs:e}}async function $g(i){return await(await i.getFile()).text()}async function ry(i){const t=await $g(i);try{return JSON.parse(t)}catch{return}}async function sy(i){return await(await i.getFile()).arrayBuffer()}class oy extends B{constructor(t){super(),this._rootDirHandle=t}get rootDirHandle(){return this._rootDirHandle}async getSubFilesAndDirs(){return await ny(this._rootDirHandle)}async getDir(t){let e=this._rootDirHandle;for(const n of t)if(e=await(e==null?void 0:e.getDirectoryHandle(n)),!e){console.log(`getDirectoryHandle ${n} failed`);return}return e}async getFile(t,e){const n=await this.getDir(t);if(n)try{return await n.getFileHandle(e)}catch(r){console.error(`未能获取当前文件 ${t.join("/")}/${e} error: ${r}`,r);return}}}class ay extends B{constructor(e){super();f(this,"_startRootDirId",0);f(this,"_dirMap",new Map);this._prefix=e}get prefix(){return this._prefix}async getRootDirId(e){let n;try{console.log("window.showDirectoryPicker begin"),n=await window.showDirectoryPicker({id:e,mode:"read"}),console.log("window.showDirectoryPicker end",n)}catch(r){console.error(`LocalFileServer getRootDirId failed: ${r}`,r);return}if(n){const r=++this._startRootDirId,s=`${this._prefix}${r}`;return this._dirMap.set(s,new oy(n)),s}}getRootDir(e){return this._dirMap.get(e)}async getFile(e){const n=e.split("/");if(n.length<2){console.warn(`LocalFileServer getFile failed: ${e}`);return}const r=n[0],s=this._dirMap.get(r);if(!s){console.warn(`LocalFileServer getFile failed: ${e}`);return}const o=n.slice(1,n.length-1),a=n[n.length-1],l=await s.getFile(o,a);if(!l){console.warn(`LocalFileServer getFile failed: ${e}`);return}return l}async getText(e){const n=await this.getFile(e);if(n)return await $g(n)}async getArrayBuffer(e){const n=await this.getFile(e);if(n)return await sy(n)}async getJson(e){const n=await this.getFile(e);if(n)return await ry(n)}async getLocalFilePath(e,n,r){const s=await this.getRootDirId(n);if(!s){console.warn("getRootDirId error!");return}const o=this.getRootDir(s);if(!o){console.warn("getRootDir error!");return}const a=await o.getSubFilesAndDirs();if(!a.files){console.warn("getSubFilesAndDirs error! 找不到符合要求的文件!");return}const l=e?a.files.filter(u=>e.some(h=>u.endsWith(h))):a.files;if(l.length===0){console.warn("找不到符合要求的文件!");return}return`https://${s}/${l[0]}`}}const ly=new ay("xe2_local");async function iC(i,t,e){return await ly.getLocalFilePath(i,t,e)}class uy extends B{constructor(e,n){super();f(this,"_processing");this._complexImage=e,this._imageUri=n,this._processing=this.disposeVar(Ln(async r=>{const s=this._complexImage,o=await r.promise(x0(this._imageUri,this._complexImage.crossOrigin));o&&o instanceof HTMLImageElement&&(s.size=[o.naturalWidth,o.naturalHeight],s.pixelFormat="RGBA",s.copyTexture({source:o}))})),this._processing.start()}get processing(){return this._processing}}const hy=["DEPTH_COMPONENT","DEPTH_STENCIL","ALPHA","RED","RG","RGB","RGBA","LUMINANCE","LUMINANCE_ALPHA","RGB_DXT1","RGBA_DXT1","RGBA_DXT3","RGBA_DXT5","RGB_PVRTC_4BPPV1","RGB_PVRTC_2BPPV1","RGBA_PVRTC_4BPPV1","RGBA_PVRTC_2BPPV1","RGBA_ASTC","RGB_ETC1","RGB8_ETC2","RGBA8_ETC2_EAC","RGBA_BC7"],cy=["img","gif","video","flv","hls"];let nC=class extends B{constructor(e,n){super();f(this,"_element");this._complexImage=e,this._videoSrc=n;var r=document.createElement("video");r.src=this._videoSrc,r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.zIndex="-100",r.style.visibility="hidden",r.style.width="0px",r.style.height="0px";{const s=()=>{r.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{r.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{r.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}r.muted=!0,document.body.appendChild(r),this._element=r,this.dispose(()=>document.body.removeChild(r))}get element(){return this._element}};class dy extends B{constructor(e,n){super();f(this,"_videoDom");f(this,"_update");this._complexImage=e,this._imageUri=n,this._videoDom=this.disposeVar(new nC(this._complexImage,this._imageUri)),this._update=this.disposeVar(zl(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:n,videoHeight:r}=this.videoElement;e.size=[n,r],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}function Yg(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function rC(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var t=i.default;if(typeof t=="function"){var e=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(i).forEach(function(n){var r=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return i[n]}})}),e}var Jg={},eo={},fy;function gy(){if(fy)return eo;fy=1,Object.defineProperty(eo,"__esModule",{value:!0}),eo.loop=eo.conditional=eo.parse=void 0;var i=function n(r,s){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:o;if(Array.isArray(s))s.forEach(function(u){return n(r,u,o,a)});else if(typeof s=="function")s(r,o,a,n);else{var l=Object.keys(s)[0];Array.isArray(s[l])?(a[l]={},n(r,s[l],o,a[l])):a[l]=s[l](r,o,a,n)}return o};eo.parse=i;var t=function(r,s){return function(o,a,l,u){s(o,a,l)&&u(o,r,a,l)}};eo.conditional=t;var e=function(r,s){return function(o,a,l,u){for(var h=[],c=o.pos;s(o,a,l);){var d={};if(u(o,r,a,d),o.pos===c)break;c=o.pos,h.push(d)}return h}};return eo.loop=e,eo}var We={},py;function my(){if(py)return We;py=1,Object.defineProperty(We,"__esModule",{value:!0}),We.readBits=We.readArray=We.readUnsigned=We.readString=We.peekBytes=We.readBytes=We.peekByte=We.readByte=We.buildStream=void 0;var i=function(c){return{data:c,pos:0}};We.buildStream=i;var t=function(){return function(c){return c.data[c.pos++]}};We.readByte=t;var e=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(d){return d.data[d.pos+c]}};We.peekByte=e;var n=function(c){return function(d){return d.data.subarray(d.pos,d.pos+=c)}};We.readBytes=n;var r=function(c){return function(d){return d.data.subarray(d.pos,d.pos+c)}};We.peekBytes=r;var s=function(c){return function(d){return Array.from(n(c)(d)).map(function(g){return String.fromCharCode(g)}).join("")}};We.readString=s;var o=function(c){return function(d){var g=n(2)(d);return c?(g[1]<<8)+g[0]:(g[0]<<8)+g[1]}};We.readUnsigned=o;var a=function(c,d){return function(g,p,E){for(var b=typeof d=="function"?d(g,p,E):d,P=n(c),v=new Array(b),_=0;_<b;_++)v[_]=P(g);return v}};We.readArray=a;var l=function(c,d,g){for(var p=0,E=0;E<g;E++)p+=c[d+E]&&Math.pow(2,g-E-1);return p},u=function(c){return function(d){for(var g=t()(d),p=new Array(8),E=0;E<8;E++)p[7-E]=!!(g&1<<E);return Object.keys(c).reduce(function(b,P){var v=c[P];return v.length?b[P]=l(p,v.index,v.length):b[P]=p[v.index],b},{})}};return We.readBits=u,We}var vy;function sC(){return vy||(vy=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var t=gy(),e=my(),n={blocks:function(d){for(var g=0,p=[],E=d.data.length,b=0,P=(0,e.readByte)()(d);P!==g&&P;P=(0,e.readByte)()(d)){if(d.pos+P>=E){var v=E-d.pos;p.push((0,e.readBytes)(v)(d)),b+=v;break}p.push((0,e.readBytes)(P)(d)),b+=P}for(var _=new Uint8Array(b),m=0,y=0;y<p.length;y++)_.set(p[y],m),m+=p[y].length;return _}},r=(0,t.conditional)({gce:[{codes:(0,e.readBytes)(2)},{byteSize:(0,e.readByte)()},{extras:(0,e.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,e.readUnsigned)(!0)},{transparentColorIndex:(0,e.readByte)()},{terminator:(0,e.readByte)()}]},function(c){var d=(0,e.peekBytes)(2)(c);return d[0]===33&&d[1]===249}),s=(0,t.conditional)({image:[{code:(0,e.readByte)()},{descriptor:[{left:(0,e.readUnsigned)(!0)},{top:(0,e.readUnsigned)(!0)},{width:(0,e.readUnsigned)(!0)},{height:(0,e.readUnsigned)(!0)},{lct:(0,e.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,t.conditional)({lct:(0,e.readArray)(3,function(c,d,g){return Math.pow(2,g.descriptor.lct.size+1)})},function(c,d,g){return g.descriptor.lct.exists}),{data:[{minCodeSize:(0,e.readByte)()},n]}]},function(c){return(0,e.peekByte)()(c)===44}),o=(0,t.conditional)({text:[{codes:(0,e.readBytes)(2)},{blockSize:(0,e.readByte)()},{preData:function(d,g,p){return(0,e.readBytes)(p.text.blockSize)(d)}},n]},function(c){var d=(0,e.peekBytes)(2)(c);return d[0]===33&&d[1]===1}),a=(0,t.conditional)({application:[{codes:(0,e.readBytes)(2)},{blockSize:(0,e.readByte)()},{id:function(d,g,p){return(0,e.readString)(p.blockSize)(d)}},n]},function(c){var d=(0,e.peekBytes)(2)(c);return d[0]===33&&d[1]===255}),l=(0,t.conditional)({comment:[{codes:(0,e.readBytes)(2)},n]},function(c){var d=(0,e.peekBytes)(2)(c);return d[0]===33&&d[1]===254}),u=[{header:[{signature:(0,e.readString)(3)},{version:(0,e.readString)(3)}]},{lsd:[{width:(0,e.readUnsigned)(!0)},{height:(0,e.readUnsigned)(!0)},{gct:(0,e.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,e.readByte)()},{pixelAspectRatio:(0,e.readByte)()}]},(0,t.conditional)({gct:(0,e.readArray)(3,function(c,d){return Math.pow(2,d.lsd.gct.size+1)})},function(c,d){return d.lsd.gct.exists}),{frames:(0,t.loop)([r,a,l,s,o],function(c){var d=(0,e.peekByte)()(c);return d===33||d===44})}],h=u;i.default=h})(Jg)),Jg}var oC=sC();const aC=Yg(oC);var lC=gy(),uC=my();const hC=(i,t)=>{const e=new Array(i.length),n=i.length/t,r=function(h,c){const d=i.slice(c*t,(c+1)*t);e.splice.apply(e,[h*t,t].concat(d))},s=[0,4,2,1],o=[8,8,4,2];for(var a=0,l=0;l<4;l++)for(var u=s[l];u<n;u+=o[l])r(u,a),a++;return e},cC=(i,t,e)=>{const s=e;var o,a,l,u,h,c,d,y,g,p,m,E,S,C,I,x;const b=new Array(e),P=new Array(4096),v=new Array(4096),_=new Array(4097);for(E=i,a=1<<E,h=a+1,o=a+2,d=-1,u=E+1,l=(1<<u)-1,g=0;g<a;g++)P[g]=0,v[g]=g;var m,y,S,C,x,I;for(m=y=S=C=x=I=0,p=0;p<s;){if(C===0){if(y<u){m+=t[I]<<y,y+=8,I++;continue}if(g=m&l,m>>=u,y-=u,g>o||g==h)break;if(g==a){u=E+1,l=(1<<u)-1,o=a+2,d=-1;continue}if(d==-1){_[C++]=v[g],d=g,S=g;continue}for(c=g,g==o&&(_[C++]=S,g=d);g>a;)_[C++]=v[g],g=P[g];S=v[g]&255,_[C++]=S,o<4096&&(P[o]=d,v[o]=S,o++,(o&l)===0&&o<4096&&(u++,l+=o)),d=c}C--,b[x++]=_[C],p++}for(p=x;p<s;p++)b[p]=0;return b},dC=i=>{const t=new Uint8Array(i);return lC.parse(uC.buildStream(t),aC)},fC=i=>{const t=i.pixels.length,e=new Uint8ClampedArray(t*4);for(var n=0;n<t;n++){const r=n*4,s=i.pixels[n],o=i.colorTable[s]||[0,0,0];e[r]=o[0],e[r+1]=o[1],e[r+2]=o[2],e[r+3]=s!==i.transparentIndex?255:0}return e},gC=(i,t,e)=>{if(!i.image){console.warn("gif frame does not have associated image.");return}const{image:n}=i,r=n.descriptor.width*n.descriptor.height;var s=cC(n.data.minCodeSize,n.data.blocks,r);n.descriptor.lct.interlaced&&(s=hC(s,n.descriptor.width));const o={pixels:s,dims:{top:i.image.descriptor.top,left:i.image.descriptor.left,width:i.image.descriptor.width,height:i.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?o.colorTable=n.lct:o.colorTable=t,i.gce&&(o.delay=(i.gce.delay||10)*10,o.disposalType=i.gce.extras.disposal,i.gce.extras.transparentColorGiven&&(o.transparentIndex=i.gce.transparentColorIndex)),o.patch=fC(o),o},pC=(i,t)=>i.frames.filter(e=>e.image).map(e=>gC(e,i.gct));async function yy(i){const e=await(await fetch(i)).arrayBuffer(),n=dC(e),r=pC(n);return{gif:n,gifFrames:r,arrayBuffer:e}}function _y(i,t,e){return i<t?t:i>e?e:i}class wy extends wd{constructor(e,n=!0,r){super();f(this,"_gifFrames",this.disposeVar(z(void 0)));f(this,"_gifDurations",[]);f(this,"_gifDuration",this.disposeVar(z(0)));f(this,"_gifSize",this.disposeVar(z([0,0],(e,n)=>e.every((r,s)=>r===n[s]),e=>[...e])));f(this,"_autoPlayOnLoad",this.disposeVar(z(!0)));f(this,"_gifCanvas");this._container=e,this.loop=!0;const s=document.createElement("canvas");this._gifCanvas=s,s.style.width="100%",s.style.height="100%";const o=s.getContext("2d");this._container&&this._container.appendChild(s),this.dispose(()=>this._container&&this._container.removeChild(s));let a;this.dispose(this._gifFrames.changed.disposableOn(u=>{if(!u||u.length===0){s.width=0,s.height=0;return}const{width:h,height:c}=u[0].dims;this._gifSize.value=[h,c];const d=u.length;let g=0;this._gifDurations.length=0;for(let p=0;p<d;++p)g+=u[p].delay,this._gifDurations.push(g);this._gifDuration.value=this._gifDurations[this._gifDurations.length-1],s.width=h,s.height=c,a=o.createImageData(h,c),this.currentTimeChangedEvent.emit(this.currentTime,this.currentTime),this._autoPlayOnLoad.value&&(this.currentTime=0,this.playing=!0)}));let l=-1;this.dispose(this.currentTimeChangedEvent.disposableOn(u=>{const h=_y(u/this.duration,0,1),c=this.gifDuration*h,d=this._gifFrames.value;if(d&&d.length>0){const g=this._getFrame(c);if(g===l)return;l=g;const p=d[g];if(p.disposalType!==0&&p.disposalType!==1&&p.disposalType!==2&&Rl(`gif parsed get disposalType ${p.disposalType}... frame: ${g} size: ${JSON.stringify(p.dims)}`,`gif parsed get disposalType ${p.disposalType}...`),a&&(g===0||p.disposalType===2)&&a.data.fill(0),a){const[E,b]=this._gifSize.value,{width:P,height:v,left:_,top:m}=p.dims;if(v>b)throw new Error("height > canvasHeight");for(let y=0;y<v;++y)for(let S=0;S<P;++S){const C=y*P+S,x=m+y,I=_+S,M=x*E+I,T=a.data,R=p.patch,A=R[C*4+3]/255;T[M*4+0]=T[M*4+0]*(1-A)+R[C*4+0]*A|0,T[M*4+1]=T[M*4+1]*(1-A)+R[C*4+1]*A|0,T[M*4+2]=T[M*4+2]*(1-A)+R[C*4+2]*A|0,T[M*4+3]=_y(T[M*4+3]+R[C*4+3],0,255)|0}o.putImageData(a,0,0)}}else Rl("gif资源未加载!无法播放!")})),this.dispose(this._gifDuration.changed.disposableOn(()=>{this.duration=this.gifDuration})),this._autoPlayOnLoad.value=n,this._gifFrames.value=r}get gifCanvas(){return this._gifCanvas}set gifFrames(e){this._gifFrames.value=e}get gifFrames(){return this._gifFrames.value}get gifFramesChanged(){return this._gifFrames.changed}get gifSize(){return this._gifSize.value}get gifSizeChanged(){return this._gifSize.changed}get gifDuration(){return this._gifDuration.value}get gifDurationChanged(){return this._gifDuration.changed}get autoPlayOnLoad(){return this._autoPlayOnLoad.value}set autoPlayOnLoad(e){this._autoPlayOnLoad.value=e}get autoPlayOnLoadChanged(){return this._autoPlayOnLoad.changed}_getFrame(e){const n=this._gifDurations.length;for(let r=0;r<n;++r)if(e<=this._gifDurations[r])return r;throw new Error("should not be here")}}class Ey extends B{constructor(e){super();f(this,"_player");f(this,"_url",this.disposeVar(z("")));f(this,"_loadGifFramesProcessing",this.disposeVar(_d(e=>Vl(yy(e)))));this._player=this.disposeVar(new wy(e)),this._player.autoPlayOnLoad=!0,this._loadGifFramesProcessing.completeFunc=({gifFrames:n})=>this._player.gifFrames=n,this.dispose(this._url.changed.disposableOn(n=>{this._player.gifFrames=void 0,this._loadGifFramesProcessing.restart(new Fr(`reload gif(${n})`),n)}))}get player(){return this._player}set url(e){this._url.value=e}get url(){return this._url.value}get loadedEvent(){return this._loadGifFramesProcessing.completeEvent}get size(){return this._player.gifSize}get sizeChanged(){return this._player.gifSizeChanged}get duration(){return this._player.gifDuration}get durationChanged(){return this._player.gifDurationChanged}}class Sy extends B{constructor(e,n){super();f(this,"_gif",this.disposeVar(new Ey));f(this,"_update");this._complexImage=e,this._imageUri=n,this._gif.url=this._imageUri,this._update=this.disposeVar(zl(()=>this.update())),this._update.start()}get gif(){return this._gif}update(){const{player:e}=this._gif;if(!e.gifFrames)return;const n=this._complexImage,{width:r,height:s}=e.gifCanvas;n.size=[r,s],n.pixelFormat="RGBA",n.copyTexture({source:e.gifCanvas});{const o=()=>{e.autoPlayOnLoad=this._complexImage.autoplay};o(),this.dispose(this._complexImage.autoplayChanged.disposableOn(o))}{const o=()=>{e.loop=this._complexImage.loop};o(),this.dispose(this._complexImage.loopChanged.disposableOn(o))}}}function by(i,t){const[e,n,r]=yh(i),s=z(void 0),o=()=>{const a=e()??t;s.value=a&&pt.context.getStrFromEnv(a)};return o(),r&&s.d(r.don(o)),s.d(pt.context.environmentVariablesChanged.don(o)),s}function Cy(i){const t=/\${(.*?)\}/g;if(!t.test(i))return i;const e=i.replace(t,(n,r)=>{const s=pt.context.getEnv(r);return s===void 0?(console.warn(`环境变量(${r})不存在,无法进行转换`),"{env-error}"):s});return Cy(e)}class mC extends B{constructor(e){super();f(this,"_sceneObjRefs",new Map);f(this,"_refs",{});f(this,"_refsChanged",this.dv(new O));const n=(r,s,o)=>{if(o){const a=this.getLastSceneObject(o),l=this._sceneObjRefs.get(o);if(!l)console.warn(`this._sceneObjRefs中不存在ref(${o}), 可能系统存在逻辑问题`);else{const h=l.indexOf(r);h===-1?console.warn(`this._sceneObjRefs中不存在当前对象(id: ${r.id} type: ${r.typeName})!可能系统存在逻辑问题`):(l.splice(h,1),l.length===0&&this._sceneObjRefs.delete(o))}const u=this.getLastSceneObject(o);this._refs[o]=u,this._refsChanged.emit(u,a)}if(s){const a=this.getLastSceneObject(s),l=this._sceneObjRefs.get(s);l?(l.push(r),l.length>0&&console.warn(`同时存在多个ref${s}相同的场景对象!
22
22
  ${l.map(h=>`${h.id} ${h.typeName}
23
- `).join(" ")}`)):this._sceneObjRefs.set(s,[r]);const u=this.getLastSceneObject(s);this._refs[s]=u,this._refsChanged.emit(u,a)}};this.d(e.sceneObjCreatedEvent.don(r=>{const s=(o,a)=>n(r,o,a);r.ref&&s(r.ref,void 0),r.refChanged.don(s)})),this.d(e.sceneObjToDestroyEvent.don(r=>{r.ref&&n(r,void 0,r.ref)}))}get sceneObjRefs(){return this._sceneObjRefs}get refs(){return this._refs}get refsChanged(){return this._refsChanged}getLastSceneObject(e){const n=this.getSceneObjects(e);if(n)return n[n.length-1]}getSceneObjects(e){const n=this._sceneObjRefs.get(e);if(!(!n||n.length===0))return n}}class vC extends B{constructor(){super();f(this,"_esObjConstructors",new Map);f(this,"_sceneObjs",new Map);f(this,"_sceneObjCreatedEvent",new O);f(this,"_sceneObjToDestroyEvent",new O);f(this,"_refsManager",this.dv(new mC(this)));f(this,"_environmentVariables",window.ESSDK_ENV||{});f(this,"_environmentVariablesChanged",this.dv(new O))}get typeNames(){return this._esObjConstructors.keys()}get sceneObjs(){return this._sceneObjs.values()}get sceneObjCreatedEvent(){return this._sceneObjCreatedEvent}get sceneObjToDestroyEvent(){return this._sceneObjToDestroyEvent}get refsManager(){return this._refsManager}get $refs(){return this._refsManager.refs}register(e,n,r){return this._esObjConstructors.has(e)&&console.warn(`register warn: ${e} has registered ! will be override!`),this._esObjConstructors.set(e,n),r&&ps(n,"__sceneObjExtraInfo",r),e}_addSceneObject(e){this._sceneObjs.set(e.id,e),this._sceneObjCreatedEvent.emit(e),e.d(()=>this._deleteSceneObject(e))}addSceneObject(e){this._addSceneObject(e)}_deleteSceneObject(e){this._sceneObjToDestroyEvent.emit(e),this._sceneObjs.delete(e.id)}deleteSceneObject(e){this._deleteSceneObject(e)}createSceneObjectFromClass(e,n){if(!n||this._sceneObjs.has(n)){const s=Ll();n&&console.warn(`已存在相同id的对象!id自动变更!${n} -> ${s} 请注意:id变更可能导致引用失效!`),n=s}if(!n)throw new Error("id不能为空!");const r=new e(n);return r.id!==n&&(console.warn(`sceneObj.id(${r.id}) !== id(${n}) sceneObjectType: ${r.typeName}`),console.warn("出现这种问题有可能是自定义的场景对象,没有在构造函数中传递id参数!示例如下:"),console.warn("class XXX extends XXX { constructor(id) { super(id); } }")),this._addSceneObject(r),r}createSceneObject(e,n){if(typeof e=="string"){const r=this._getSceneObjConstructor(e);if(!r){console.warn(`Cannot find SceneObjectType: ${e}`);return}return this.createSceneObjectFromClass(r,n)}else return this.createSceneObjectFromClass(e,n)}createSceneObjectFromUrl(e,n){let r;const s=e.toLowerCase();if(s.includes(".gltf")||s.includes(".glb")?r="ESGltfModel":s.includes("tileset.json")?r="ES3DTileset":s.includes("layer.json")||s.includes("ion://1")?r="ESTerrainLayer":s.includes(".jpg")||s.includes(".png")||s.includes(".jpeg")||s.includes(".webp")||s.includes("image/jpg")||s.includes("image/png")||s.includes("image/jpeg")||s.includes("image/webp")?r="ESImageLabel":(s.includes("/tilemapresource.xml")||s.includes("ion://")||s.includes("wms")||s.includes("wmts")||s.includes("{x}")||s.includes("{y}")||s.includes("{z}"))&&(r="ESImageryLayer"),!!r)return this.createSceneObjectFromJson({type:r,id:n,url:e})}createSceneObjectFromJson(e){const n=this.createSceneObject(e.type,e.id);return n&&(n.json=e),n}destroySceneObject(e){return this._deleteSceneObject(e),e.destroy(),e.isDestroyed()}getSceneObjectById(e){return this._sceneObjs.get(e)}getSceneObject(e){if(!e&&e!="")return Array.from(this._sceneObjs.values());if(typeof e=="function"){const n=[];for(const r of this._sceneObjs.values())r instanceof e&&n.push(r);return n}if(e.startsWith("ES")){const n=[];for(const r of this._sceneObjs.values())r.typeName===e&&n.push(r);return n}return this._sceneObjs.get(e)}_getSceneObjConstructor(e){const n=this._esObjConstructors.get(e);if(n)return n}getProps(e){const n=this._getSceneObjConstructor(e);if(!n){console.warn(`cannot get constructor from type: ${e}`);return}return An(n,"__sceneObjExtraInfo")}setProps(e,n){const r=this._getSceneObjConstructor(e);if(!r){console.warn(`cannot get constructor from type: ${e}`);return}let s=An(r,"__sceneObjExtraInfo");s||(s={},ps(r,"__sceneObjExtraInfo",s)),Object.assign(s,n)}getProp(e,n){const r=this.getProps(e);return r&&r[n]}setProp(e,n,r){this.setProps(e,{[n]:r})}get environmentVariables(){return this._environmentVariables}set environmentVariables(e){for(let[n,r]of Object.entries(e))this.setEnv(n,r)}get environmentVariablesChanged(){return this._environmentVariablesChanged}setEnv(e,n){if(this._environmentVariables[e]!==n){const r=this._environmentVariables[e];this._environmentVariables[e]=n,this._environmentVariablesChanged.emit(e,n,r)}window.ESSDK_ENV={...this._environmentVariables}}getEnv(e){return this._environmentVariables[e]}getStrFromEnv(e){return Cy(e)}createEnvStrReact(e,n){return by(e,n)}createEvnStrReact(e,n){return by(e,n)}}const Nt=class Nt extends B{constructor(e){super();f(this,"_components",this.dv(new Sd));f(this,"_viewerAttached",this.dv(new O));f(this,"_viewerDetached",this.dv(new O));f(this,"_attachedViewers",(()=>{const e=new Set;return this.d(this._viewerAttached.don(n=>{n.actived&&(this.activeViewer=n),n.ad(n.activedChanged.don(r=>{r&&e.has(n)&&(this.activeViewer=n)})),e.add(n)})),this.d(this._viewerDetached.don(n=>{e.delete(n),this.activeViewer==n&&(this.activeViewer=void 0)})),e})());f(this,"_activeViewer",this.dv(z(void 0)));f(this,"_reloadEvent",this.dv(new O));f(this,"_readyEvent",this.dv(new O));f(this,"_createdEvent",this.dv(new O));f(this,"_flushEvent",this.dv(new O));f(this,"_id");f(this,"_updateFuncReact",this.dv(z(void 0)));f(this,"_toDestroyFuncReact",this.dv(z(void 0)));f(this,"_parentID");e!==void 0&&(typeof e!="string"?console.warn(`对象id必须是字符串类型,当前id的类型是${typeof e},值为${e}`):e.trim()===""?console.warn("场景对象创建时的id不能是空字符串!"):e.trim()!==e&&console.warn(`id前后有空字符串!id: ${e}`)),this._id=e??Ll(),this._initName();{const n=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(r){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${r}`)}};n(),this.d(this.execOnceFuncStrChanged.don(n))}{const n=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(s){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};n(),this.d(this.updateFuncStrChanged.don(n));let r;this.d(()=>r&&r.destroy()),this.d(this.updateFuncChanged.don(()=>{r&&r.cancel(),this.updateFunc&&(r=r||Ih(),r.restart(void 0,s=>{this.updateFunc&&this.updateFunc(this,s)}))}))}{const n=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(r){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${r}`),this.toDestroyFunc=void 0}};n(),this.d(this.toDestroyFuncStrChanged.don(n)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}}static getParentClass(){return Object.getPrototypeOf(this)}static register(e,n,r){Ro(n.prototype,n.createDefaultProps);const s=n.createDefaultProps();n.defaults&&(n.defaults={});for(const o of Object.keys(s))n.defaults[o]=s[o]instanceof ui?s[o].value:s[o];return this.innerRegister(e,n,r),e}static get envs(){return Nt.context.environmentVariables}static get $refs(){return Nt.context.refsManager.refs}get components(){return this._components}get viewerAttached(){return this._viewerAttached}get viewerDetached(){return this._viewerDetached}get attachedViewers(){return this._attachedViewers}get activeViewer(){return this._activeViewer.value}set activeViewer(e){this._activeViewer.value=e}get activeViewerChanged(){return this._activeViewer.changed}removefromViewer(e){this.attachedViewers.has(e)&&e.delete(this)}get reloadEvent(){return this._reloadEvent}reload(){this._reloadEvent.emit()}get readyEvent(){return this._readyEvent}addToViewer(e){this.attachedViewers.has(e)||e.add(this)}registerAttachedObject(e){const n=new Map;this.d(()=>{n.size>0&&console.warn("viewerPropSceneObjects.size > 0")}),this.d(this._viewerAttached.don(r=>{const s=e(r);s&&n.set(r,s)})),this.d(this._viewerDetached.don(r=>{if(!n.has(r))return;const s=n.get(r);s&&(s.destroy(),n.delete(r))}))}createAttachedObject(e){const n=new Map,r=(()=>{for(let[l,u]of n.entries())u.destroy();n.clear()}),s=l=>{const u=e(l);u&&n.set(l,u)};for(let l of this.attachedViewers)s(l);const o=this._viewerAttached.don(s),a=this._viewerDetached.don(l=>{if(!n.has(l))return;const u=n.get(l);u&&(u.destroy(),n.delete(l))});return()=>{a(),o(),r()}}registerAttachedObjectForContainer(e){this.registerAttachedObject(n=>new yC(n,e))}get createdEvent(){return this._createdEvent}get flushEvent(){return this._flushEvent}flush(){this.flushEvent.emit()}get id(){return this._id}get typeName(){return this.constructor.type}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return this.constructor.createDefaultProps()}_innerGetJson(e=!0){const n={id:this.id,type:this.typeName};for(let r of Object.keys(this.defaultProps))if(e){let s,o=this.defaultProps[r];o instanceof ui?s=o.equals(this[r]):s=o===this[r],s||(n[r]=this[r])}else n[r]=this[r];return n}_innerSetJson(e,n,r){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const s=n||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in e)this[a]=e[a]===null?void 0:e[a];else if(!(r??!1)){let l=this.defaultProps[a];l instanceof ui&&(l=l.value),this[a]=l}}get completeJson(){return this._innerGetJson(!1)}get json(){return this._innerGetJson()}set json(e){this._innerSetJson(e)}get _jsonStr(){return JSON.stringify(this.json,null,4)}set _jsonStr(e){this._innerSetJson(JSON.parse(e))}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get parentID(){return this._parentID??this.id}set parentID(e){this._parentID=e}getESProperties(){return{defaultMenu:"general",basic:[],general:[new mt([this,"typeName"],"类型",void 0,!1,!0),new mt([this,"id"],"id",void 0,!1,!0),new mt([this,"name"],"名称"),new Qg("JSON",()=>this._jsonStr,e=>e&&(this._jsonStr=e))],dataSource:[],location:[],coordinate:[],style:[],more:[new mt([this,"ref"],"ref",void 0,!0),new Et([this,"extras"],"extras",{},void 0,!0)]}}};f(Nt,"context",new vC),f(Nt,"innerRegister",Nt.context.register.bind(Nt.context)),f(Nt,"defaults",{}),f(Nt,"createDefaultProps",()=>({name:"未命名场景对象",ref:void 0,extras:bt(void 0),devTags:oe(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})),f(Nt,"type",Nt.register("ESSceneObject",Nt,{chsName:"场景类",tags:["ESObjects"],description:""})),f(Nt,"create",Nt.context.createSceneObject.bind(Nt.context)),f(Nt,"createFromUrl",Nt.context.createSceneObjectFromUrl.bind(Nt.context)),f(Nt,"createFromClass",Nt.context.createSceneObjectFromClass.bind(Nt.context)),f(Nt,"createFromJson",Nt.context.createSceneObjectFromJson.bind(Nt.context)),f(Nt,"destroySceneObject",Nt.context.destroySceneObject.bind(Nt.context)),f(Nt,"getSceneObjById",Nt.context.getSceneObjectById.bind(Nt.context)),f(Nt,"getSceneObj",Nt.context.getSceneObject.bind(Nt.context)),f(Nt,"getEnv",Nt.context.getEnv.bind(Nt.context)),f(Nt,"setEnv",Nt.context.setEnv.bind(Nt.context)),f(Nt,"getStrFromEnv",Nt.context.getStrFromEnv.bind(Nt.context)),f(Nt,"getSceneObjectById",Nt.context.getSceneObjectById.bind(Nt.context)),f(Nt,"getSceneObject",Nt.context.getSceneObject.bind(Nt.context));let pt=Nt;class yC extends B{constructor(t,e){super(),this.dv(new qe(t.subContainerChanged,()=>{if(t.subContainer)return e(t,t.subContainer)}))}}const cg=class cg extends B{constructor(e,n,r){super();f(this,"_id",++cg._accumId);this._name=e,this._description=n,this._callFunction=r}get id(){return this._id}get name(){return this._name}get description(){return this._description}get callFunction(){return this._callFunction}};f(cg,"_accumId",-1);let Fo=cg;class Zg extends Fo{constructor(t,e,n,r,s,o){super(t,e,o??(()=>{})),this._withUndefined=n,this._readonly=r,this._defaultValue=s}get withUndefined(){return this._withUndefined}get readonly(){return this._readonly}get defaultValue(){return this._defaultValue instanceof Function?this._defaultValue():this._defaultValue}}class nn extends Zg{constructor(e,n,r,s,o,a,l){var h;const u=e instanceof ui?"未获取到属性名":e[1].toString();super(n??u,a??u,s??!1,o??!1,r,l);f(this,"_propName");f(this,"_typeName");this._reactVar=e,this._propName=u;try{this._typeName=e instanceof ui?"未获取到对象类型":(h=e[0])==null?void 0:h.typeName}catch{this._typeName="未获取到对象类型"}}get reactVar(){return this._reactVar}get propName(){return this._propName}get typeName(){return this._typeName}}class X extends nn{get type(){return"BooleanProperty"}}class mt extends nn{get type(){return"StringProperty"}}class D extends nn{get type(){return"NumberProperty"}}class Ke extends nn{get type(){return"Number2Property"}}class ci extends nn{get type(){return"Number3Property"}}class rr extends nn{get type(){return"Number4Property"}}class Dt extends rr{get type(){return"ColorProperty"}}class Py extends D{get type(){return"DashPatternProperty"}}class ys extends nn{get type(){return"DateProperty"}}class Kg extends nn{get type(){return"DatesProperty"}}class wt extends Fo{constructor(e,n,r){super(e??"",r??"");f(this,"_placement");this._placement=n}get type(){return"DivideProperty"}get placement(){return this._placement}}class ft extends nn{constructor(t,e,n,r,s,o,a){super(t,n,r,s,o,a),this._enums=e}get type(){return"EnumProperty"}get enums(){return this._enums}}class io extends nn{constructor(t,e,n,r,s,o,a){super(t,e,n,s,o,a),this._sampleValue=r}get sampleValue(){return this._sampleValue}get type(){return"EvalStringProperty"}}class bd extends nn{constructor(t,e,n,r,s,o,a){super(t,e,n,s,o,a),this._sampleValue=r}get sampleValue(){return this._sampleValue}get type(){return"LongStringProperty"}}class vt extends Fo{constructor(e,n,r,s){const o=e??"Unnamed Function";super(o,s??o);f(this,"_paramsLength");this._func=n,this._defaultParams=r,this._paramsLength=this._func.length??0}get paramsLength(){return this._paramsLength}get defaultParams(){return this._defaultParams}get isOpen(){return this._defaultParams.length!==this._paramsLength}get func(){return this._func}run(...e){this._func(...e)}get type(){return"MethodProperty"}}class Qe extends nn{constructor(t,e,n,r,s,o,a,l){super(t,r,s,o,a,l),this._step=e,this._minMax=n}get type(){return"NumberSliderProperty"}get minMax(){return this._minMax}get step(){return this._step}}class _s extends ci{get type(){return"PositionProperty"}}class Ah extends ci{get type(){return"RotationProperty"}}function _C(i,t){const[e,n,r]=yh(i),[s,o,a]=yh(t),l=z((e()??0)/(s()??3e3)),u=()=>{const h=l.value,c=s()??3e3,d=e()??0;if(!Number.isFinite(c)||!Number.isFinite(d)){console.warn(`duration || currentTime error: duration: ${c} currentTime: ${d}`);return}Math.abs(h*c-d)<.001||(c<=0?l.value=0:l.value=d/c)};return l.dispose(r.disposableOn(u)),l.dispose(a.disposableOn(u)),l.dispose(l.changed.disposableOn(()=>{const h=l.value,c=s()??3e3,d=e()??0;if(!Number.isFinite(c)||!Number.isFinite(d)){console.warn(`duration || currentTime error: duration: ${c} currentTime: ${d}`);return}Math.abs(h*c-d)<.001||n(h*c)})),l}class Cd extends Fo{constructor(e,n,r,s,o,a){super(s??"播放器",a??"播放器");f(this,"_defaults",{playing:!1,ratio:0,loop:!1});this._playingReact=e,this._ratioReact=n,this._loopReact=r,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.ratio=o.ratio??this._defaults.ratio,this._defaults.loop=o.loop??this._defaults.loop)}get type(){return"PlayerProperty"}get playingReact(){return this._playingReact}get ratioReact(){return this._ratioReact}get loopReact(){return this._loopReact}get defaults(){return this._defaults}}f(Cd,"createPlayingRatio",_C);class xy extends Fo{constructor(e,n,r,s,o,a){const l=s??"视角播放器";super(l,a??l);f(this,"_defaults",{playing:!1,loop:!1});this._playingReact=e,this._stopFn=n,this._loopReact=r,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.loop=o.loop??this._defaults.loop)}get type(){return"ViewPlayerProperty"}get playingReact(){return this._playingReact}get loopReact(){return this._loopReact}get stopFn(){return this._stopFn}get defaults(){return this._defaults}}class Ne extends nn{constructor(t,e,n,r,s,o,a){super(t,e,n,s,o,a),this._sampleValue=r}get sampleValue(){return this._sampleValue}get type(){return"JsonArrayProperty"}}class Et extends nn{constructor(t,e,n,r,s,o,a){super(t,e,n,s,o,a),this._sampleValue=r}get sampleValue(){return this._sampleValue}get type(){return"JsonProperty"}}class Qg extends Zg{constructor(t,e,n,r,s,o){super(t,o??t,r??!1,s??!1),this._getFunc=e,this._setFunc=n}get getFunc(){return this._getFunc}get setFunc(){return this._setFunc}get type(){return"GetSetProperty"}}var nt=(i=>(i.Place="place",i.BrushErase="brushErase",i.Translation="translation",i.Rotation="rotation",i.Scale="scale",i.DoublePointsAppend="doublePointsAppend",i.DoublePointsModify="doublePointsModify",i.CircularAppend="circularAppend",i.CircularInsert="circularInsert",i.LineStringAppend="lineStringAppend",i.LineStringInsert="lineStringInsert",i.ScatterAppend="scatterAppend",i.ScatterModify="scatterModify",i.VisibilityAppend="visibilityAppend",i.VisibilityModify="visibilityModify",i.HeightModify="heightModify",i.SinglePoint="singlePoint",i.DoublePoints="doublePoints",i))(nt||{});const tp=[["地形","TERRAIN"],["3D Tiles","CESIUM_3D_TILE"],["地形和3D Tiles","BOTH"]],ep=[["直箭头","straightArrow"],["燕尾箭头","swallowTailArrow"]];var Iy=(i=>(i.DECIMAL_DEGREE="DECIMAL_DEGREE",i.DEGREES_DECIMAL_MINUTES="DEGREES_DECIMAL_MINUTES",i.SEXAGESIMAL_DEGREE="SEXAGESIMAL_DEGREE",i))(Iy||{});class wC{constructor(t){this.childPickedInfo=t}}class EC{constructor(t,e,n,r,s,o){this.pickResult=t,this.sceneObject=e,this.tilesetPickInfo=n,this.geojsonPickInfo=r,this.attachedInfo=s,this.screenPosition=o}assign(t){t!=null&&t.pickedResult&&(this.pickResult=t.pickedResult),t!=null&&t.sceneObject&&(this.sceneObject=t.sceneObject),t!=null&&t.tilesetPickInfo&&(this.tilesetPickInfo=t.tilesetPickInfo),t!=null&&t.geojsonPickInfo&&(this.geojsonPickInfo=t.geojsonPickInfo),t!=null&&t.attachedInfo&&(this.attachedInfo=t.attachedInfo),t!=null&&t.screenPosition&&(this.screenPosition=t.screenPosition)}}const Be=class Be extends pt{constructor(e){super(e);f(this,"_editing",this.dv(z(!1)));f(this,"editingID");f(this,"editingBindMode","singlePoint");f(this,"_deprecated",[]);f(this,"_flyInEvent",this.dv(new O));f(this,"_flyToEvent",this.dv(new O));f(this,"_flyOverEvent",this.disposeVar(new O));f(this,"_pickedEvent",this.dv(new O));f(this,"_calcFlyToParamEvent",this.dv(new O));f(this,"_calcFlyInParamEvent",this.dv(new O));f(this,"useCalcFlyToParamInESObjectWithLocation",!1);Dy(this,this.updateEditing)}supportEditingModes(){return this.constructor.supportEditingModes}get editing(){return this._editing.value}set editing(e){this._editing.value=e}get editingChanged(){return this._editing.changed}updateEditing(){}_deprecatedWarning(){const e=this._deprecated;for(let n=0;n<e.length;n++){const r=e[n];typeof r=="string"?Reflect.has(this,r+"Changed")&&this.d(this[r+"Changed"].don(()=>{console.warn(`注意:${this.typeName} 的 ${r} 属性下版本将会被移除!`)})):Object.keys(r).forEach(s=>{Reflect.has(this,s+"Changed")&&this.d(this[s+"Changed"].don(a=>{const l=r[s];typeof l=="string"?console.warn(`注意:${this.typeName} 的 ${s} 属性下版本将会被移除!`):Object.keys(l).forEach((u=>{a===u&&console.warn(`注意:${this.typeName} 的 ${s} 属性值 ${u} 下版本将会被移除,推荐使用属性值 ${l[u]}`)}))}))})}}get flyInEvent(){return this._flyInEvent}flyIn(e=1){this._flyInEvent.emit(e,Be._lastFlyInId)}get flyToEvent(){return this._flyToEvent}flyTo(e=1){this._flyToEvent.emit(e,Be._lastFlyToId)}get flyOverEvent(){return this._flyOverEvent}get pickedEvent(){return this._pickedEvent}get calcFlyToParamEvent(){return this._calcFlyToParamEvent}calcFlyToParam(){this._calcFlyToParamEvent.emit()}get calcFlyInParamEvent(){return this._calcFlyInParamEvent}calcFlyInParam(){this._calcFlyInParamEvent.emit()}emptyFlyToParam(){this.flyToParam=void 0}emptyFlyInParam(){this.flyInParam=void 0}async getBoundSphere(e){return await e.getBoundSphere(this.id)}getESProperties(){const e={...super.getESProperties()};return{...e,general:[...e.general,new X([this,"show"],"是否显示",Be.defaults.show),new X([this,"collision"],"开启碰撞",Be.defaults.collision),new X([this,"allowPicking"],"允许拾取",Be.defaults.allowPicking),new vt("保存观察视角",()=>this.calcFlyToParam(),[]),new vt("清空飞向参数",()=>this.emptyFlyToParam(),[]),new vt("保存飞入参数",()=>this.calcFlyInParam(),[]),new vt("清空飞入参数",()=>this.emptyFlyInParam(),[])],more:[...e.more,new wt("飞行定位"),new vt("飞向",n=>this.flyTo(n),[1],"flyTo"),new Et([this,"flyToParam"],"飞行参数",void 0,void 0,!0),new D([this,"flyToDistance"],"flyToDistance",void 0,!0),new D([this,"flyToHeading"],"flyToHeading",void 0,!0),new D([this,"flyToPitch"],"flyToPitch",void 0,!0),new D([this,"flyToFlyDuration"],"flyToFlyDuration",void 0,!0),new D([this,"flyToHDelta"],"flyToHDelta",void 0,!0),new D([this,"flyToPDelta"],"flyToPDelta",void 0,!0),new wt("飞入参数"),new vt("飞入",n=>this.flyIn(n),[1],"flyIn"),new Et([this,"flyInParam"],"飞入参数",void 0,void 0,!0)]}}get flyToDistance(){return this.flyToParam&&this.flyToParam.distance}get flyToHeading(){return this.flyToParam&&this.flyToParam.heading}get flyToPitch(){return this.flyToParam&&this.flyToParam.pitch}get flyToFlyDuration(){return this.flyToParam&&this.flyToParam.flyDuration}get flyToHDelta(){return this.flyToParam&&this.flyToParam.hDelta}get flyToPDelta(){return this.flyToParam&&this.flyToParam.pDelta}get flyToDistanceChanged(){return this.flyToParamChanged}get flyToHeadingChanged(){return this.flyToParamChanged}get flyToPitchChanged(){return this.flyToParamChanged}get flyToFlyDurationChanged(){return this.flyToParamChanged}get flyToHDeltaChanged(){return this.flyToParamChanged}get flyToPDeltaChanged(){return this.flyToParamChanged}set flyToDistance(e){this.flyToParam=e!==void 0?{...this.flyToParam??Be.defaultFlyToParam,distance:e}:void 0}set flyToHeading(e){this.flyToParam=e!==void 0?{...this.flyToParam??Be.defaultFlyToParam,heading:e}:void 0}set flyToPitch(e){this.flyToParam=e!==void 0?{...this.flyToParam??Be.defaultFlyToParam,pitch:e}:void 0}set flyToFlyDuration(e){this.flyToParam=e!==void 0?{...this.flyToParam??Be.defaultFlyToParam,flyDuration:e}:void 0}set flyToHDelta(e){this.flyToParam=e!==void 0?{...this.flyToParam??Be.defaultFlyToParam,hDelta:e}:void 0}set flyToPDelta(e){this.flyToParam=e!==void 0?{...this.flyToParam??Be.defaultFlyToParam,pDelta:e}:void 0}};f(Be,"createDefaultProps",()=>({...pt.createDefaultProps(),show:!0,collision:!0,allowPicking:!1,flyToParam:fe(void 0),flyInParam:fe(void 0)})),f(Be,"type",Be.register("ESVisualObject",Be,{chsName:"可视化对象",tags:["ESObjects"],description:"可视化对象"})),f(Be,"supportEditingModes",[]),f(Be,"defaultFlyToParam",{distance:0,heading:0,pitch:0,flyDuration:1,hDelta:0,pDelta:0}),f(Be,"defaultFlyInParam",{position:[0,0,0],rotation:[0,0,0],flyDuration:1}),f(Be,"_lastFlyInId",0),f(Be,"_lastFlyToId",0);let Xt=Be;class My extends B{constructor(){super();f(this,"_data",this.dv(z(void 0)))}set data(e){this._data.value=e}get data(){return this._data.value}get dataChanged(){return this._data.changed}}class Ty extends B{constructor(){super(...arguments);f(this,"_dragStartEvent",this.dv(new O));f(this,"_dragOverEvent",this.dv(new O));f(this,"_dragLeaveEvent",this.dv(new O));f(this,"_dropEvent",this.dv(new O))}dragStart(e){this._dragStartEvent.emit(e)}dragOver(e){this._dragOverEvent.emit(e)}dragLeave(e){this._dragLeaveEvent.emit(e)}drop(e){this._dropEvent.emit(e)}}function SC(i,t){t&&(Reflect.has(t,"editing")?t.editing=!0:Reflect.has(t,"positionEditing")&&(t.positionEditing=!0))}function bC(i){["Czm3DTiles","View","ESCameraView","OlView","GeoCameraController"].includes(i.typeName)||(Reflect.has(i,"editing")?i.editing=!0:Reflect.has(i,"positionEditing")&&(i.positionEditing=!0)),typeof i.execOnCreating=="function"&&i.execOnCreating()}function Pd(i,t){An(i,"__treeItem")&&console.error("setSceneObjectTreeItem error!"),ps(i,"__treeItem",t)}function CC(i){return An(i,"__treeItem")}function PC(i){if(!(i.startsWith("./")||i.startsWith("../")||i.startsWith("/")))return i;const t=document.createElement("a");t.href=i;const e=t.href;return t.remove(),e}function ip(i){if(typeof i!="string")return!1;try{const t=JSON.parse(i);return typeof t=="object"&&t!==null}catch{return!1}}function xC(i){try{return new DOMParser().parseFromString(i,"application/xml").getElementsByTagName("parsererror").length===0}catch{return!1}}function IC(i){return i instanceof Function?i():i}function Ny(i,t){for(let e of i)if(t.includes(e))return!0;return!1}function Lh(i,t){const e=i,n=t;return e===void 0||e.length===0||n===void 0||n.length===0?!0:Ny(e,n)}function MC(i){const t=setTimeout(()=>{i(),clearTimeout(t)})}function Bl(i){let t=i%360;return t=t<0?360+t:t,t}function Oy(i){return Bl(i+180)-180}function xd(i,t,e){let n=Bl(i),r=Bl(t);Math.abs(n-r)>180&&(n<r?n+=360:r+=360);const s=n*(1-e)+r*e;return Oy(s)}function np(i,t,e,n){return n=n||[0,0,0],n[0]=xd(i[0],t[0],e),n[1]=xd(i[1],t[1],e),n[2]=xd(i[2],t[2],e),n}function Dy(i,t,e="editing"){const n=new B;i.ad(n);const r=t.bind(i);return n.ad(new qe(i.activeViewerChanged,()=>{const s=new B;let o=i.activeViewer;return o?(s.ad(i[`${e}Changed`].don(()=>{var a;i[`${e}`]?r():(a=(i.components.main??i).editingID)!=null&&a.includes("inner")&&i.activeViewer&&i.activeViewer.stopEditing()})),s.ad(o.editingEvent.don(a=>{if(a.objectIDs.includes(i.id)&&a.type==="end"){const l=i.components.main??i;l.editingID&&(a.editingID.includes(l.editingID)?(l.editingID=void 0,i[e]=!1):i[e]=!l.editingID.includes("outer"))}}))):s.ad(i[`${e}Changed`].don(()=>{i[`${e}`]=!1})),s})),i[`${e}`]&&r(),n}function TC(i){return i}function NC(i){if(i==null)return TC;var t,e,n=i.scale[0],r=i.scale[1],s=i.translate[0],o=i.translate[1];return function(a,l){l||(t=e=0);var u=2,h=a.length,c=new Array(h);for(c[0]=(t+=a[0])*n+s,c[1]=(e+=a[1])*r+o;u<h;)c[u]=a[u],++u;return c}}function OC(i,t){for(var e,n=i.length,r=n-t;r<--n;)e=i[r],i[r++]=i[n],i[n]=e}function DC(i,t){return typeof t=="string"&&(t=i.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(e){return Ry(i,e)})}:Ry(i,t)}function Ry(i,t){var e=t.id,n=t.bbox,r=t.properties==null?{}:t.properties,s=RC(i,t);return e==null&&n==null?{type:"Feature",properties:r,geometry:s}:n==null?{type:"Feature",id:e,properties:r,geometry:s}:{type:"Feature",id:e,bbox:n,properties:r,geometry:s}}function RC(i,t){var e=NC(i.transform),n=i.arcs;function r(h,c){c.length&&c.pop();for(var d=n[h<0?~h:h],g=0,p=d.length;g<p;++g)c.push(e(d[g],g));h<0&&OC(c,p)}function s(h){return e(h)}function o(h){for(var c=[],d=0,g=h.length;d<g;++d)r(h[d],c);return c.length<2&&c.push(c[0]),c}function a(h){for(var c=o(h);c.length<4;)c.push(c[0]);return c}function l(h){return h.map(a)}function u(h){var c=h.type,d;switch(c){case"GeometryCollection":return{type:c,geometries:h.geometries.map(u)};case"Point":d=s(h.coordinates);break;case"MultiPoint":d=h.coordinates.map(s);break;case"LineString":d=o(h.arcs);break;case"MultiLineString":d=h.arcs.map(o);break;case"Polygon":d=l(h.arcs);break;case"MultiPolygon":d=h.arcs.map(l);break;default:return null}return{type:c,coordinates:d}}return u(t)}function Ay(i){var e;const t=Array.isArray(i)?"feature":((e=i.type)==null?void 0:e.toLowerCase())??"";switch(t){case"geometrycollection":return AC(i);case"topology":const n=i.objects,r=[];for(const s in n){const o=DC(i,n[s]);r.push(...o.features)}return{type:"FeatureCollection",features:r};case"feature":return{type:"FeatureCollection",features:Array.isArray(i)?i:[i]};case"featurecollection":return i;default:return console.warn(`GeoJson数据转换可能有误,数据类型${t}`),{type:"FeatureCollection",features:Array.isArray(i.features)?i.features:[]}}}function AC(i,t){const e=[],n=i.geometries||[];function r(s,o={}){!s||!s.type||(s.type==="GeometryCollection"&&Array.isArray(s.geometries)?s.geometries.forEach(a=>r(a,o)):e.push({type:"Feature",geometry:s,properties:{...s.properties||{},...o}}))}return n.forEach(s=>r(s,{})),{type:"FeatureCollection",features:e}}function LC(i){const t=i.cloneNode(!0);t.style.position="fixed",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.top="0",t.style.left="0",t.style.display="inline-block",document.body.appendChild(t);const e=t.getBoundingClientRect();return document.body.removeChild(t),{x:e.x,y:e.y,width:e.width,height:e.height}}function FC(i,t,e=!1){var c,d,g,p,E,b;const n=[],r=[],s=[],o=[],a=[],l=new Set,u=new Map;if(t!=null&&t.features)for(const P of t.features){const v=((c=P.id)==null?void 0:c.toString())||((g=(d=P.properties)==null?void 0:d.id)==null?void 0:g.toString());v&&(l.add(v),u.set(v,P))}if(i!=null&&i.features)for(const P of i.features){const v=((p=P.id)==null?void 0:p.toString())||((b=(E=P.properties)==null?void 0:E.id)==null?void 0:b.toString());if(v)if(l.has(v)){if(e){const _=u.get(v);_&&Ly(_,P)?o.push(v):a.push(v)}n.push(v)}else r.push(v)}for(const P of l)n.includes(P)||s.push(P);const h={unchangedIds:n,newIds:r,removedIds:s};return e&&(h.contentUnchangedIds=o,h.contentUpdatedIds=a),h}function Ly(i,t){return Fy(i.geometry,t.geometry)?JSON.stringify(i.properties)===JSON.stringify(t.properties):!1}function Fy(i,t){if(i===t)return!0;if(!i||!t||i.type!==t.type)return!1;const e=i.coordinates,n=t.coordinates;if(i.type==="Point")return kC(e,n);if(i.type==="LineString"||i.type==="MultiPoint")return Id(e,n);if(i.type==="Polygon"){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!Id(e[r],n[r]))return!1;return!0}if(i.type==="MultiLineString"){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!Id(e[r],n[r]))return!1;return!0}if(i.type==="MultiPolygon"){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++){const s=e[r],o=n[r];if(s.length!==o.length)return!1;for(let a=0;a<s.length;a++)if(!Id(s[a],o[a]))return!1}return!0}return JSON.stringify(i)===JSON.stringify(t)}function kC(i,t){if(!i||!t)return i===t;if(i.length!==t.length)return!1;for(let e=0;e<i.length;e++)if(Math.abs(i[e]-t[e])>1e-10)return!1;return!0}function Id(i,t){if(i===t)return!0;if(!i||!t||i.length!==t.length)return!1;for(let e=0;e<i.length;e++){const n=i[e],r=t[e];if(n.length!==r.length)return!1;for(let s=0;s<n.length;s++)if(Math.abs(n[s]-r[s])>1e-10)return!1}return!0}class rp extends B{constructor(e){super();f(this,"_sceneObject",this.dv(z(void 0)));this._id=e,this.d(()=>{this._sceneObject.value=void 0});const n=pt.getSceneObjById(this._id);n&&(this._sceneObject.value=n),this.d(pt.context.sceneObjCreatedEvent.don(r=>{r.id===this._id&&(this._sceneObject.value=r)})),this.d(pt.context.sceneObjToDestroyEvent.don(r=>{r.id===this._id&&(this._sceneObject.value=void 0)}))}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}get id(){return this._id}}class GC extends B{constructor(e,n){super();f(this,"_sofi");this._id=e,this._sofi=this.dv(new rp(this._id));{const r=()=>{n.sceneObject=this._sofi.sceneObject};r(),this.d(this._sofi.sceneObjectChanged.don(r))}}}class ky extends B{constructor(){super();f(this,"_id",this.dv(z(void 0)));f(this,"_sceneObject",this.dv(z(void 0)));f(this,"_resetting",this.dv(new qe(this.idChanged,()=>{const{id:e}=this;if(e===void 0||e===""){this.sceneObject=void 0;return}return new GC(e,this)})))}get id(){return this._id.value}get idChanged(){return this._id.changed}set id(e){this._id.value=e}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}set sceneObject(e){this._sceneObject.value=e}get resetting(){return this._resetting}}class jC extends B{constructor(e,n,r,s){super();f(this,"_sceneObjectId",this.dv(new ky));this._id=e,this._startTimeStamp=n,this._duration=r,this._parent=s,this._sceneObjectId.id=this._id;const o=()=>{if(!this.player)return;const{currentTime:a=0}=this._parent,l=a-this._startTimeStamp;this.player.currentTime=vd(l,0,this._duration)*(this.player.speed??1)};o(),this.d(this._parent.currentTimeChanged.don(o)),this.d(this.playerChanged.don(o))}get player(){return this._sceneObjectId.sceneObject instanceof kr?this._sceneObjectId.sceneObject:void 0}get playerChanged(){return this._sceneObjectId.sceneObjectChanged}}const VC=`
23
+ `).join(" ")}`)):this._sceneObjRefs.set(s,[r]);const u=this.getLastSceneObject(s);this._refs[s]=u,this._refsChanged.emit(u,a)}};this.d(e.sceneObjCreatedEvent.don(r=>{const s=(o,a)=>n(r,o,a);r.ref&&s(r.ref,void 0),r.refChanged.don(s)})),this.d(e.sceneObjToDestroyEvent.don(r=>{r.ref&&n(r,void 0,r.ref)}))}get sceneObjRefs(){return this._sceneObjRefs}get refs(){return this._refs}get refsChanged(){return this._refsChanged}getLastSceneObject(e){const n=this.getSceneObjects(e);if(n)return n[n.length-1]}getSceneObjects(e){const n=this._sceneObjRefs.get(e);if(!(!n||n.length===0))return n}}class vC extends B{constructor(){super();f(this,"_esObjConstructors",new Map);f(this,"_sceneObjs",new Map);f(this,"_sceneObjCreatedEvent",new O);f(this,"_sceneObjToDestroyEvent",new O);f(this,"_refsManager",this.dv(new mC(this)));f(this,"_environmentVariables",window.ESSDK_ENV||{});f(this,"_environmentVariablesChanged",this.dv(new O))}get typeNames(){return this._esObjConstructors.keys()}get sceneObjs(){return this._sceneObjs.values()}get sceneObjCreatedEvent(){return this._sceneObjCreatedEvent}get sceneObjToDestroyEvent(){return this._sceneObjToDestroyEvent}get refsManager(){return this._refsManager}get $refs(){return this._refsManager.refs}register(e,n,r){return this._esObjConstructors.has(e)&&console.warn(`register warn: ${e} has registered ! will be override!`),this._esObjConstructors.set(e,n),r&&ps(n,"__sceneObjExtraInfo",r),e}_addSceneObject(e){this._sceneObjs.set(e.id,e),this._sceneObjCreatedEvent.emit(e),e.d(()=>this._deleteSceneObject(e))}addSceneObject(e){this._addSceneObject(e)}_deleteSceneObject(e){this._sceneObjToDestroyEvent.emit(e),this._sceneObjs.delete(e.id)}deleteSceneObject(e){this._deleteSceneObject(e)}createSceneObjectFromClass(e,n){if(!n||this._sceneObjs.has(n)){const s=Ll();n&&console.warn(`已存在相同id的对象!id自动变更!${n} -> ${s} 请注意:id变更可能导致引用失效!`),n=s}if(!n)throw new Error("id不能为空!");const r=new e(n);return r.id!==n&&(console.warn(`sceneObj.id(${r.id}) !== id(${n}) sceneObjectType: ${r.typeName}`),console.warn("出现这种问题有可能是自定义的场景对象,没有在构造函数中传递id参数!示例如下:"),console.warn("class XXX extends XXX { constructor(id) { super(id); } }")),this._addSceneObject(r),r}createSceneObject(e,n){if(typeof e=="string"){const r=this._getSceneObjConstructor(e);if(!r){console.warn(`Cannot find SceneObjectType: ${e}`);return}return this.createSceneObjectFromClass(r,n)}else return this.createSceneObjectFromClass(e,n)}createSceneObjectFromUrl(e,n){let r;const s=e.toLowerCase();if(s.includes(".gltf")||s.includes(".glb")?r="ESGltfModel":s.includes("tileset.json")?r="ES3DTileset":s.includes("layer.json")||s.includes("ion://1")?r="ESTerrainLayer":s.includes(".jpg")||s.includes(".png")||s.includes(".jpeg")||s.includes(".webp")||s.includes("image/jpg")||s.includes("image/png")||s.includes("image/jpeg")||s.includes("image/webp")?r="ESImageLabel":(s.includes("/tilemapresource.xml")||s.includes("ion://")||s.includes("wms")||s.includes("wmts")||s.includes("{x}")||s.includes("{y}")||s.includes("{z}"))&&(r="ESImageryLayer"),!!r)return this.createSceneObjectFromJson({type:r,id:n,url:e})}createSceneObjectFromJson(e){const n=this.createSceneObject(e.type,e.id);return n&&(n.json=e),n}destroySceneObject(e){return this._deleteSceneObject(e),e.destroy(),e.isDestroyed()}getSceneObjectById(e){return this._sceneObjs.get(e)}getSceneObject(e){if(!e&&e!="")return Array.from(this._sceneObjs.values());if(typeof e=="function"){const n=[];for(const r of this._sceneObjs.values())r instanceof e&&n.push(r);return n}if(e.startsWith("ES")){const n=[];for(const r of this._sceneObjs.values())r.typeName===e&&n.push(r);return n}return this._sceneObjs.get(e)}_getSceneObjConstructor(e){const n=this._esObjConstructors.get(e);if(n)return n}getProps(e){const n=this._getSceneObjConstructor(e);if(!n){console.warn(`cannot get constructor from type: ${e}`);return}return An(n,"__sceneObjExtraInfo")}setProps(e,n){const r=this._getSceneObjConstructor(e);if(!r){console.warn(`cannot get constructor from type: ${e}`);return}let s=An(r,"__sceneObjExtraInfo");s||(s={},ps(r,"__sceneObjExtraInfo",s)),Object.assign(s,n)}getProp(e,n){const r=this.getProps(e);return r&&r[n]}setProp(e,n,r){this.setProps(e,{[n]:r})}get environmentVariables(){return this._environmentVariables}set environmentVariables(e){for(let[n,r]of Object.entries(e))this.setEnv(n,r)}get environmentVariablesChanged(){return this._environmentVariablesChanged}setEnv(e,n){if(this._environmentVariables[e]!==n){const r=this._environmentVariables[e];this._environmentVariables[e]=n,this._environmentVariablesChanged.emit(e,n,r)}window.ESSDK_ENV={...this._environmentVariables}}getEnv(e){return this._environmentVariables[e]}getStrFromEnv(e){return Cy(e)}createEnvStrReact(e,n){return by(e,n)}createEvnStrReact(e,n){return by(e,n)}}const Nt=class Nt extends B{constructor(e){super();f(this,"_components",this.dv(new Sd));f(this,"_viewerAttached",this.dv(new O));f(this,"_viewerDetached",this.dv(new O));f(this,"_attachedViewers",(()=>{const e=new Set;return this.d(this._viewerAttached.don(n=>{n.actived&&(this.activeViewer=n),n.ad(n.activedChanged.don(r=>{r&&e.has(n)&&(this.activeViewer=n)})),e.add(n)})),this.d(this._viewerDetached.don(n=>{e.delete(n),this.activeViewer==n&&(this.activeViewer=void 0)})),e})());f(this,"_activeViewer",this.dv(z(void 0)));f(this,"_reloadEvent",this.dv(new O));f(this,"_readyEvent",this.dv(new O));f(this,"_createdEvent",this.dv(new O));f(this,"_flushEvent",this.dv(new O));f(this,"_id");f(this,"_updateFuncReact",this.dv(z(void 0)));f(this,"_toDestroyFuncReact",this.dv(z(void 0)));f(this,"_parentID");e!==void 0&&(typeof e!="string"?console.warn(`对象id必须是字符串类型,当前id的类型是${typeof e},值为${e}`):e.trim()===""?console.warn("场景对象创建时的id不能是空字符串!"):e.trim()!==e&&console.warn(`id前后有空字符串!id: ${e}`)),this._id=e??Ll(),this._initName();{const n=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(r){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${r}`)}};n(),this.d(this.execOnceFuncStrChanged.don(n))}{const n=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(s){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};n(),this.d(this.updateFuncStrChanged.don(n));let r;this.d(()=>r&&r.destroy()),this.d(this.updateFuncChanged.don(()=>{r&&r.cancel(),this.updateFunc&&(r=r||Ih(),r.restart(void 0,s=>{this.updateFunc&&this.updateFunc(this,s)}))}))}{const n=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(r){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${r}`),this.toDestroyFunc=void 0}};n(),this.d(this.toDestroyFuncStrChanged.don(n)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}}static getParentClass(){return Object.getPrototypeOf(this)}static register(e,n,r){Ro(n.prototype,n.createDefaultProps);const s=n.createDefaultProps();n.defaults&&(n.defaults={});for(const o of Object.keys(s))n.defaults[o]=s[o]instanceof ui?s[o].value:s[o];return this.innerRegister(e,n,r),e}static get envs(){return Nt.context.environmentVariables}static get $refs(){return Nt.context.refsManager.refs}get components(){return this._components}get viewerAttached(){return this._viewerAttached}get viewerDetached(){return this._viewerDetached}get attachedViewers(){return this._attachedViewers}get activeViewer(){return this._activeViewer.value}set activeViewer(e){this._activeViewer.value=e}get activeViewerChanged(){return this._activeViewer.changed}removefromViewer(e){this.attachedViewers.has(e)&&e.delete(this)}get reloadEvent(){return this._reloadEvent}reload(){this._reloadEvent.emit()}get readyEvent(){return this._readyEvent}addToViewer(e){this.attachedViewers.has(e)||e.add(this)}registerAttachedObject(e){const n=new Map;this.d(()=>{n.size>0&&console.warn("viewerPropSceneObjects.size > 0")}),this.d(this._viewerAttached.don(r=>{const s=e(r);s&&n.set(r,s)})),this.d(this._viewerDetached.don(r=>{if(!n.has(r))return;const s=n.get(r);s&&(s.destroy(),n.delete(r))}))}createAttachedObject(e){const n=new Map,r=(()=>{for(let[l,u]of n.entries())u.destroy();n.clear()}),s=l=>{const u=e(l);u&&n.set(l,u)};for(let l of this.attachedViewers)s(l);const o=this._viewerAttached.don(s),a=this._viewerDetached.don(l=>{if(!n.has(l))return;const u=n.get(l);u&&(u.destroy(),n.delete(l))});return()=>{a(),o(),r()}}registerAttachedObjectForContainer(e){this.registerAttachedObject(n=>new yC(n,e))}get createdEvent(){return this._createdEvent}get flushEvent(){return this._flushEvent}flush(){this.flushEvent.emit()}get id(){return this._id}get typeName(){return this.constructor.type}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return this.constructor.createDefaultProps()}_innerGetJson(e=!0){const n={id:this.id,type:this.typeName};for(let r of Object.keys(this.defaultProps))if(e){let s,o=this.defaultProps[r];o instanceof ui?s=o.equals(this[r]):s=o===this[r],s||(n[r]=this[r])}else n[r]=this[r];return n}_innerSetJson(e,n,r){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const s=n||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in e)this[a]=e[a]===null?void 0:e[a];else if(!(r??!1)){let l=this.defaultProps[a];l instanceof ui&&(l=l.value),this[a]=l}}get completeJson(){return this._innerGetJson(!1)}get json(){return this._innerGetJson()}set json(e){this._innerSetJson(e)}get _jsonStr(){return JSON.stringify(this.json,null,4)}set _jsonStr(e){this._innerSetJson(JSON.parse(e))}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get parentID(){return this._parentID??this.id}set parentID(e){this._parentID=e}getESProperties(){return{defaultMenu:"general",basic:[],general:[new mt([this,"typeName"],"类型",void 0,!1,!0),new mt([this,"id"],"id",void 0,!1,!0),new mt([this,"name"],"名称"),new Qg("JSON",()=>this._jsonStr,e=>e&&(this._jsonStr=e))],dataSource:[],location:[],coordinate:[],style:[],more:[new mt([this,"ref"],"ref",void 0,!0),new Et([this,"extras"],"extras",{},void 0,!0)]}}};f(Nt,"context",new vC),f(Nt,"innerRegister",Nt.context.register.bind(Nt.context)),f(Nt,"defaults",{}),f(Nt,"createDefaultProps",()=>({name:"未命名场景对象",ref:void 0,extras:bt(void 0),devTags:oe(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})),f(Nt,"type",Nt.register("ESSceneObject",Nt,{chsName:"场景类",tags:["ESObjects"],description:""})),f(Nt,"create",Nt.context.createSceneObject.bind(Nt.context)),f(Nt,"createFromUrl",Nt.context.createSceneObjectFromUrl.bind(Nt.context)),f(Nt,"createFromClass",Nt.context.createSceneObjectFromClass.bind(Nt.context)),f(Nt,"createFromJson",Nt.context.createSceneObjectFromJson.bind(Nt.context)),f(Nt,"destroySceneObject",Nt.context.destroySceneObject.bind(Nt.context)),f(Nt,"getSceneObjById",Nt.context.getSceneObjectById.bind(Nt.context)),f(Nt,"getSceneObj",Nt.context.getSceneObject.bind(Nt.context)),f(Nt,"getEnv",Nt.context.getEnv.bind(Nt.context)),f(Nt,"setEnv",Nt.context.setEnv.bind(Nt.context)),f(Nt,"getStrFromEnv",Nt.context.getStrFromEnv.bind(Nt.context)),f(Nt,"getSceneObjectById",Nt.context.getSceneObjectById.bind(Nt.context)),f(Nt,"getSceneObject",Nt.context.getSceneObject.bind(Nt.context));let pt=Nt;class yC extends B{constructor(t,e){super(),this.dv(new qe(t.subContainerChanged,()=>{if(t.subContainer)return e(t,t.subContainer)}))}}const cg=class cg extends B{constructor(e,n,r){super();f(this,"_id",++cg._accumId);this._name=e,this._description=n,this._callFunction=r}get id(){return this._id}get name(){return this._name}get description(){return this._description}get callFunction(){return this._callFunction}};f(cg,"_accumId",-1);let Fo=cg;class Zg extends Fo{constructor(t,e,n,r,s,o){super(t,e,o??(()=>{})),this._withUndefined=n,this._readonly=r,this._defaultValue=s}get withUndefined(){return this._withUndefined}get readonly(){return this._readonly}get defaultValue(){return this._defaultValue instanceof Function?this._defaultValue():this._defaultValue}}class nn extends Zg{constructor(e,n,r,s,o,a,l){var h;const u=e instanceof ui?"未获取到属性名":e[1].toString();super(n??u,a??u,s??!1,o??!1,r,l);f(this,"_propName");f(this,"_typeName");this._reactVar=e,this._propName=u;try{this._typeName=e instanceof ui?"未获取到对象类型":(h=e[0])==null?void 0:h.typeName}catch{this._typeName="未获取到对象类型"}}get reactVar(){return this._reactVar}get propName(){return this._propName}get typeName(){return this._typeName}}class H extends nn{get type(){return"BooleanProperty"}}class mt extends nn{get type(){return"StringProperty"}}class D extends nn{get type(){return"NumberProperty"}}class Ke extends nn{get type(){return"Number2Property"}}class ci extends nn{get type(){return"Number3Property"}}class rr extends nn{get type(){return"Number4Property"}}class Dt extends rr{get type(){return"ColorProperty"}}class Py extends D{get type(){return"DashPatternProperty"}}class ys extends nn{get type(){return"DateProperty"}}class Kg extends nn{get type(){return"DatesProperty"}}class wt extends Fo{constructor(e,n,r){super(e??"",r??"");f(this,"_placement");this._placement=n}get type(){return"DivideProperty"}get placement(){return this._placement}}class ft extends nn{constructor(t,e,n,r,s,o,a){super(t,n,r,s,o,a),this._enums=e}get type(){return"EnumProperty"}get enums(){return this._enums}}class io extends nn{constructor(t,e,n,r,s,o,a){super(t,e,n,s,o,a),this._sampleValue=r}get sampleValue(){return this._sampleValue}get type(){return"EvalStringProperty"}}class bd extends nn{constructor(t,e,n,r,s,o,a){super(t,e,n,s,o,a),this._sampleValue=r}get sampleValue(){return this._sampleValue}get type(){return"LongStringProperty"}}class vt extends Fo{constructor(e,n,r,s){const o=e??"Unnamed Function";super(o,s??o);f(this,"_paramsLength");this._func=n,this._defaultParams=r,this._paramsLength=this._func.length??0}get paramsLength(){return this._paramsLength}get defaultParams(){return this._defaultParams}get isOpen(){return this._defaultParams.length!==this._paramsLength}get func(){return this._func}run(...e){this._func(...e)}get type(){return"MethodProperty"}}class Qe extends nn{constructor(t,e,n,r,s,o,a,l){super(t,r,s,o,a,l),this._step=e,this._minMax=n}get type(){return"NumberSliderProperty"}get minMax(){return this._minMax}get step(){return this._step}}class _s extends ci{get type(){return"PositionProperty"}}class Ah extends ci{get type(){return"RotationProperty"}}function _C(i,t){const[e,n,r]=yh(i),[s,o,a]=yh(t),l=z((e()??0)/(s()??3e3)),u=()=>{const h=l.value,c=s()??3e3,d=e()??0;if(!Number.isFinite(c)||!Number.isFinite(d)){console.warn(`duration || currentTime error: duration: ${c} currentTime: ${d}`);return}Math.abs(h*c-d)<.001||(c<=0?l.value=0:l.value=d/c)};return l.dispose(r.disposableOn(u)),l.dispose(a.disposableOn(u)),l.dispose(l.changed.disposableOn(()=>{const h=l.value,c=s()??3e3,d=e()??0;if(!Number.isFinite(c)||!Number.isFinite(d)){console.warn(`duration || currentTime error: duration: ${c} currentTime: ${d}`);return}Math.abs(h*c-d)<.001||n(h*c)})),l}class Cd extends Fo{constructor(e,n,r,s,o,a){super(s??"播放器",a??"播放器");f(this,"_defaults",{playing:!1,ratio:0,loop:!1});this._playingReact=e,this._ratioReact=n,this._loopReact=r,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.ratio=o.ratio??this._defaults.ratio,this._defaults.loop=o.loop??this._defaults.loop)}get type(){return"PlayerProperty"}get playingReact(){return this._playingReact}get ratioReact(){return this._ratioReact}get loopReact(){return this._loopReact}get defaults(){return this._defaults}}f(Cd,"createPlayingRatio",_C);class xy extends Fo{constructor(e,n,r,s,o,a){const l=s??"视角播放器";super(l,a??l);f(this,"_defaults",{playing:!1,loop:!1});this._playingReact=e,this._stopFn=n,this._loopReact=r,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.loop=o.loop??this._defaults.loop)}get type(){return"ViewPlayerProperty"}get playingReact(){return this._playingReact}get loopReact(){return this._loopReact}get stopFn(){return this._stopFn}get defaults(){return this._defaults}}class Ne extends nn{constructor(t,e,n,r,s,o,a){super(t,e,n,s,o,a),this._sampleValue=r}get sampleValue(){return this._sampleValue}get type(){return"JsonArrayProperty"}}class Et extends nn{constructor(t,e,n,r,s,o,a){super(t,e,n,s,o,a),this._sampleValue=r}get sampleValue(){return this._sampleValue}get type(){return"JsonProperty"}}class Qg extends Zg{constructor(t,e,n,r,s,o){super(t,o??t,r??!1,s??!1),this._getFunc=e,this._setFunc=n}get getFunc(){return this._getFunc}get setFunc(){return this._setFunc}get type(){return"GetSetProperty"}}var nt=(i=>(i.Place="place",i.BrushErase="brushErase",i.Translation="translation",i.Rotation="rotation",i.Scale="scale",i.DoublePointsAppend="doublePointsAppend",i.DoublePointsModify="doublePointsModify",i.CircularAppend="circularAppend",i.CircularInsert="circularInsert",i.LineStringAppend="lineStringAppend",i.LineStringInsert="lineStringInsert",i.ScatterAppend="scatterAppend",i.ScatterModify="scatterModify",i.VisibilityAppend="visibilityAppend",i.VisibilityModify="visibilityModify",i.HeightModify="heightModify",i.SinglePoint="singlePoint",i.DoublePoints="doublePoints",i))(nt||{});const tp=[["地形","TERRAIN"],["3D Tiles","CESIUM_3D_TILE"],["地形和3D Tiles","BOTH"]],ep=[["直箭头","straightArrow"],["燕尾箭头","swallowTailArrow"]];var Iy=(i=>(i.DECIMAL_DEGREE="DECIMAL_DEGREE",i.DEGREES_DECIMAL_MINUTES="DEGREES_DECIMAL_MINUTES",i.SEXAGESIMAL_DEGREE="SEXAGESIMAL_DEGREE",i))(Iy||{});class wC{constructor(t){this.childPickedInfo=t}}class EC{constructor(t,e,n,r,s,o){this.pickResult=t,this.sceneObject=e,this.tilesetPickInfo=n,this.geojsonPickInfo=r,this.attachedInfo=s,this.screenPosition=o}assign(t){t!=null&&t.pickedResult&&(this.pickResult=t.pickedResult),t!=null&&t.sceneObject&&(this.sceneObject=t.sceneObject),t!=null&&t.tilesetPickInfo&&(this.tilesetPickInfo=t.tilesetPickInfo),t!=null&&t.geojsonPickInfo&&(this.geojsonPickInfo=t.geojsonPickInfo),t!=null&&t.attachedInfo&&(this.attachedInfo=t.attachedInfo),t!=null&&t.screenPosition&&(this.screenPosition=t.screenPosition)}}const Be=class Be extends pt{constructor(e){super(e);f(this,"_editing",this.dv(z(!1)));f(this,"editingID");f(this,"editingBindMode","singlePoint");f(this,"_deprecated",[]);f(this,"_flyInEvent",this.dv(new O));f(this,"_flyToEvent",this.dv(new O));f(this,"_flyOverEvent",this.disposeVar(new O));f(this,"_pickedEvent",this.dv(new O));f(this,"_calcFlyToParamEvent",this.dv(new O));f(this,"_calcFlyInParamEvent",this.dv(new O));f(this,"useCalcFlyToParamInESObjectWithLocation",!1);Dy(this,this.updateEditing)}supportEditingModes(){return this.constructor.supportEditingModes}get editing(){return this._editing.value}set editing(e){this._editing.value=e}get editingChanged(){return this._editing.changed}updateEditing(){}_deprecatedWarning(){const e=this._deprecated;for(let n=0;n<e.length;n++){const r=e[n];typeof r=="string"?Reflect.has(this,r+"Changed")&&this.d(this[r+"Changed"].don(()=>{console.warn(`注意:${this.typeName} 的 ${r} 属性下版本将会被移除!`)})):Object.keys(r).forEach(s=>{Reflect.has(this,s+"Changed")&&this.d(this[s+"Changed"].don(a=>{const l=r[s];typeof l=="string"?console.warn(`注意:${this.typeName} 的 ${s} 属性下版本将会被移除!`):Object.keys(l).forEach((u=>{a===u&&console.warn(`注意:${this.typeName} 的 ${s} 属性值 ${u} 下版本将会被移除,推荐使用属性值 ${l[u]}`)}))}))})}}get flyInEvent(){return this._flyInEvent}flyIn(e=1){this._flyInEvent.emit(e,Be._lastFlyInId)}get flyToEvent(){return this._flyToEvent}flyTo(e=1){this._flyToEvent.emit(e,Be._lastFlyToId)}get flyOverEvent(){return this._flyOverEvent}get pickedEvent(){return this._pickedEvent}get calcFlyToParamEvent(){return this._calcFlyToParamEvent}calcFlyToParam(){this._calcFlyToParamEvent.emit()}get calcFlyInParamEvent(){return this._calcFlyInParamEvent}calcFlyInParam(){this._calcFlyInParamEvent.emit()}emptyFlyToParam(){this.flyToParam=void 0}emptyFlyInParam(){this.flyInParam=void 0}async getBoundSphere(e){return await e.getBoundSphere(this.id)}getESProperties(){const e={...super.getESProperties()};return{...e,general:[...e.general,new H([this,"show"],"是否显示",Be.defaults.show),new H([this,"collision"],"开启碰撞",Be.defaults.collision),new H([this,"allowPicking"],"允许拾取",Be.defaults.allowPicking),new vt("保存观察视角",()=>this.calcFlyToParam(),[]),new vt("清空飞向参数",()=>this.emptyFlyToParam(),[]),new vt("保存飞入参数",()=>this.calcFlyInParam(),[]),new vt("清空飞入参数",()=>this.emptyFlyInParam(),[])],more:[...e.more,new wt("飞行定位"),new vt("飞向",n=>this.flyTo(n),[1],"flyTo"),new Et([this,"flyToParam"],"飞行参数",void 0,void 0,!0),new D([this,"flyToDistance"],"flyToDistance",void 0,!0),new D([this,"flyToHeading"],"flyToHeading",void 0,!0),new D([this,"flyToPitch"],"flyToPitch",void 0,!0),new D([this,"flyToFlyDuration"],"flyToFlyDuration",void 0,!0),new D([this,"flyToHDelta"],"flyToHDelta",void 0,!0),new D([this,"flyToPDelta"],"flyToPDelta",void 0,!0),new wt("飞入参数"),new vt("飞入",n=>this.flyIn(n),[1],"flyIn"),new Et([this,"flyInParam"],"飞入参数",void 0,void 0,!0)]}}get flyToDistance(){return this.flyToParam&&this.flyToParam.distance}get flyToHeading(){return this.flyToParam&&this.flyToParam.heading}get flyToPitch(){return this.flyToParam&&this.flyToParam.pitch}get flyToFlyDuration(){return this.flyToParam&&this.flyToParam.flyDuration}get flyToHDelta(){return this.flyToParam&&this.flyToParam.hDelta}get flyToPDelta(){return this.flyToParam&&this.flyToParam.pDelta}get flyToDistanceChanged(){return this.flyToParamChanged}get flyToHeadingChanged(){return this.flyToParamChanged}get flyToPitchChanged(){return this.flyToParamChanged}get flyToFlyDurationChanged(){return this.flyToParamChanged}get flyToHDeltaChanged(){return this.flyToParamChanged}get flyToPDeltaChanged(){return this.flyToParamChanged}set flyToDistance(e){this.flyToParam=e!==void 0?{...this.flyToParam??Be.defaultFlyToParam,distance:e}:void 0}set flyToHeading(e){this.flyToParam=e!==void 0?{...this.flyToParam??Be.defaultFlyToParam,heading:e}:void 0}set flyToPitch(e){this.flyToParam=e!==void 0?{...this.flyToParam??Be.defaultFlyToParam,pitch:e}:void 0}set flyToFlyDuration(e){this.flyToParam=e!==void 0?{...this.flyToParam??Be.defaultFlyToParam,flyDuration:e}:void 0}set flyToHDelta(e){this.flyToParam=e!==void 0?{...this.flyToParam??Be.defaultFlyToParam,hDelta:e}:void 0}set flyToPDelta(e){this.flyToParam=e!==void 0?{...this.flyToParam??Be.defaultFlyToParam,pDelta:e}:void 0}};f(Be,"createDefaultProps",()=>({...pt.createDefaultProps(),show:!0,collision:!0,allowPicking:!1,flyToParam:fe(void 0),flyInParam:fe(void 0)})),f(Be,"type",Be.register("ESVisualObject",Be,{chsName:"可视化对象",tags:["ESObjects"],description:"可视化对象"})),f(Be,"supportEditingModes",[]),f(Be,"defaultFlyToParam",{distance:0,heading:0,pitch:0,flyDuration:1,hDelta:0,pDelta:0}),f(Be,"defaultFlyInParam",{position:[0,0,0],rotation:[0,0,0],flyDuration:1}),f(Be,"_lastFlyInId",0),f(Be,"_lastFlyToId",0);let Xt=Be;class My extends B{constructor(){super();f(this,"_data",this.dv(z(void 0)))}set data(e){this._data.value=e}get data(){return this._data.value}get dataChanged(){return this._data.changed}}class Ty extends B{constructor(){super(...arguments);f(this,"_dragStartEvent",this.dv(new O));f(this,"_dragOverEvent",this.dv(new O));f(this,"_dragLeaveEvent",this.dv(new O));f(this,"_dropEvent",this.dv(new O))}dragStart(e){this._dragStartEvent.emit(e)}dragOver(e){this._dragOverEvent.emit(e)}dragLeave(e){this._dragLeaveEvent.emit(e)}drop(e){this._dropEvent.emit(e)}}function SC(i,t){t&&(Reflect.has(t,"editing")?t.editing=!0:Reflect.has(t,"positionEditing")&&(t.positionEditing=!0))}function bC(i){["Czm3DTiles","View","ESCameraView","OlView","GeoCameraController"].includes(i.typeName)||(Reflect.has(i,"editing")?i.editing=!0:Reflect.has(i,"positionEditing")&&(i.positionEditing=!0)),typeof i.execOnCreating=="function"&&i.execOnCreating()}function Pd(i,t){An(i,"__treeItem")&&console.error("setSceneObjectTreeItem error!"),ps(i,"__treeItem",t)}function CC(i){return An(i,"__treeItem")}function PC(i){if(!(i.startsWith("./")||i.startsWith("../")||i.startsWith("/")))return i;const t=document.createElement("a");t.href=i;const e=t.href;return t.remove(),e}function ip(i){if(typeof i!="string")return!1;try{const t=JSON.parse(i);return typeof t=="object"&&t!==null}catch{return!1}}function xC(i){try{return new DOMParser().parseFromString(i,"application/xml").getElementsByTagName("parsererror").length===0}catch{return!1}}function IC(i){return i instanceof Function?i():i}function Ny(i,t){for(let e of i)if(t.includes(e))return!0;return!1}function Lh(i,t){const e=i,n=t;return e===void 0||e.length===0||n===void 0||n.length===0?!0:Ny(e,n)}function MC(i){const t=setTimeout(()=>{i(),clearTimeout(t)})}function Bl(i){let t=i%360;return t=t<0?360+t:t,t}function Oy(i){return Bl(i+180)-180}function xd(i,t,e){let n=Bl(i),r=Bl(t);Math.abs(n-r)>180&&(n<r?n+=360:r+=360);const s=n*(1-e)+r*e;return Oy(s)}function np(i,t,e,n){return n=n||[0,0,0],n[0]=xd(i[0],t[0],e),n[1]=xd(i[1],t[1],e),n[2]=xd(i[2],t[2],e),n}function Dy(i,t,e="editing"){const n=new B;i.ad(n);const r=t.bind(i);return n.ad(new qe(i.activeViewerChanged,()=>{const s=new B;let o=i.activeViewer;return o?(s.ad(i[`${e}Changed`].don(()=>{var a;i[`${e}`]?r():(a=(i.components.main??i).editingID)!=null&&a.includes("inner")&&i.activeViewer&&i.activeViewer.stopEditing()})),s.ad(o.editingEvent.don(a=>{if(a.objectIDs.includes(i.id)&&a.type==="end"){const l=i.components.main??i;l.editingID&&(a.editingID.includes(l.editingID)?(l.editingID=void 0,i[e]=!1):i[e]=!l.editingID.includes("outer"))}}))):s.ad(i[`${e}Changed`].don(()=>{i[`${e}`]=!1})),s})),i[`${e}`]&&r(),n}function TC(i){return i}function NC(i){if(i==null)return TC;var t,e,n=i.scale[0],r=i.scale[1],s=i.translate[0],o=i.translate[1];return function(a,l){l||(t=e=0);var u=2,h=a.length,c=new Array(h);for(c[0]=(t+=a[0])*n+s,c[1]=(e+=a[1])*r+o;u<h;)c[u]=a[u],++u;return c}}function OC(i,t){for(var e,n=i.length,r=n-t;r<--n;)e=i[r],i[r++]=i[n],i[n]=e}function DC(i,t){return typeof t=="string"&&(t=i.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(e){return Ry(i,e)})}:Ry(i,t)}function Ry(i,t){var e=t.id,n=t.bbox,r=t.properties==null?{}:t.properties,s=RC(i,t);return e==null&&n==null?{type:"Feature",properties:r,geometry:s}:n==null?{type:"Feature",id:e,properties:r,geometry:s}:{type:"Feature",id:e,bbox:n,properties:r,geometry:s}}function RC(i,t){var e=NC(i.transform),n=i.arcs;function r(h,c){c.length&&c.pop();for(var d=n[h<0?~h:h],g=0,p=d.length;g<p;++g)c.push(e(d[g],g));h<0&&OC(c,p)}function s(h){return e(h)}function o(h){for(var c=[],d=0,g=h.length;d<g;++d)r(h[d],c);return c.length<2&&c.push(c[0]),c}function a(h){for(var c=o(h);c.length<4;)c.push(c[0]);return c}function l(h){return h.map(a)}function u(h){var c=h.type,d;switch(c){case"GeometryCollection":return{type:c,geometries:h.geometries.map(u)};case"Point":d=s(h.coordinates);break;case"MultiPoint":d=h.coordinates.map(s);break;case"LineString":d=o(h.arcs);break;case"MultiLineString":d=h.arcs.map(o);break;case"Polygon":d=l(h.arcs);break;case"MultiPolygon":d=h.arcs.map(l);break;default:return null}return{type:c,coordinates:d}}return u(t)}function Ay(i){var e;const t=Array.isArray(i)?"feature":((e=i.type)==null?void 0:e.toLowerCase())??"";switch(t){case"geometrycollection":return AC(i);case"topology":const n=i.objects,r=[];for(const s in n){const o=DC(i,n[s]);r.push(...o.features)}return{type:"FeatureCollection",features:r};case"feature":return{type:"FeatureCollection",features:Array.isArray(i)?i:[i]};case"featurecollection":return i;default:return console.warn(`GeoJson数据转换可能有误,数据类型${t}`),{type:"FeatureCollection",features:Array.isArray(i.features)?i.features:[]}}}function AC(i,t){const e=[],n=i.geometries||[];function r(s,o={}){!s||!s.type||(s.type==="GeometryCollection"&&Array.isArray(s.geometries)?s.geometries.forEach(a=>r(a,o)):e.push({type:"Feature",geometry:s,properties:{...s.properties||{},...o}}))}return n.forEach(s=>r(s,{})),{type:"FeatureCollection",features:e}}function LC(i){const t=i.cloneNode(!0);t.style.position="fixed",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.top="0",t.style.left="0",t.style.display="inline-block",document.body.appendChild(t);const e=t.getBoundingClientRect();return document.body.removeChild(t),{x:e.x,y:e.y,width:e.width,height:e.height}}function FC(i,t,e=!1){var c,d,g,p,E,b;const n=[],r=[],s=[],o=[],a=[],l=new Set,u=new Map;if(t!=null&&t.features)for(const P of t.features){const v=((c=P.id)==null?void 0:c.toString())||((g=(d=P.properties)==null?void 0:d.id)==null?void 0:g.toString());v&&(l.add(v),u.set(v,P))}if(i!=null&&i.features)for(const P of i.features){const v=((p=P.id)==null?void 0:p.toString())||((b=(E=P.properties)==null?void 0:E.id)==null?void 0:b.toString());if(v)if(l.has(v)){if(e){const _=u.get(v);_&&Ly(_,P)?o.push(v):a.push(v)}n.push(v)}else r.push(v)}for(const P of l)n.includes(P)||s.push(P);const h={unchangedIds:n,newIds:r,removedIds:s};return e&&(h.contentUnchangedIds=o,h.contentUpdatedIds=a),h}function Ly(i,t){return Fy(i.geometry,t.geometry)?JSON.stringify(i.properties)===JSON.stringify(t.properties):!1}function Fy(i,t){if(i===t)return!0;if(!i||!t||i.type!==t.type)return!1;const e=i.coordinates,n=t.coordinates;if(i.type==="Point")return kC(e,n);if(i.type==="LineString"||i.type==="MultiPoint")return Id(e,n);if(i.type==="Polygon"){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!Id(e[r],n[r]))return!1;return!0}if(i.type==="MultiLineString"){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!Id(e[r],n[r]))return!1;return!0}if(i.type==="MultiPolygon"){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++){const s=e[r],o=n[r];if(s.length!==o.length)return!1;for(let a=0;a<s.length;a++)if(!Id(s[a],o[a]))return!1}return!0}return JSON.stringify(i)===JSON.stringify(t)}function kC(i,t){if(!i||!t)return i===t;if(i.length!==t.length)return!1;for(let e=0;e<i.length;e++)if(Math.abs(i[e]-t[e])>1e-10)return!1;return!0}function Id(i,t){if(i===t)return!0;if(!i||!t||i.length!==t.length)return!1;for(let e=0;e<i.length;e++){const n=i[e],r=t[e];if(n.length!==r.length)return!1;for(let s=0;s<n.length;s++)if(Math.abs(n[s]-r[s])>1e-10)return!1}return!0}class rp extends B{constructor(e){super();f(this,"_sceneObject",this.dv(z(void 0)));this._id=e,this.d(()=>{this._sceneObject.value=void 0});const n=pt.getSceneObjById(this._id);n&&(this._sceneObject.value=n),this.d(pt.context.sceneObjCreatedEvent.don(r=>{r.id===this._id&&(this._sceneObject.value=r)})),this.d(pt.context.sceneObjToDestroyEvent.don(r=>{r.id===this._id&&(this._sceneObject.value=void 0)}))}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}get id(){return this._id}}class GC extends B{constructor(e,n){super();f(this,"_sofi");this._id=e,this._sofi=this.dv(new rp(this._id));{const r=()=>{n.sceneObject=this._sofi.sceneObject};r(),this.d(this._sofi.sceneObjectChanged.don(r))}}}class ky extends B{constructor(){super();f(this,"_id",this.dv(z(void 0)));f(this,"_sceneObject",this.dv(z(void 0)));f(this,"_resetting",this.dv(new qe(this.idChanged,()=>{const{id:e}=this;if(e===void 0||e===""){this.sceneObject=void 0;return}return new GC(e,this)})))}get id(){return this._id.value}get idChanged(){return this._id.changed}set id(e){this._id.value=e}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}set sceneObject(e){this._sceneObject.value=e}get resetting(){return this._resetting}}class jC extends B{constructor(e,n,r,s){super();f(this,"_sceneObjectId",this.dv(new ky));this._id=e,this._startTimeStamp=n,this._duration=r,this._parent=s,this._sceneObjectId.id=this._id;const o=()=>{if(!this.player)return;const{currentTime:a=0}=this._parent,l=a-this._startTimeStamp;this.player.currentTime=vd(l,0,this._duration)*(this.player.speed??1)};o(),this.d(this._parent.currentTimeChanged.don(o)),this.d(this.playerChanged.don(o))}get player(){return this._sceneObjectId.sceneObject instanceof kr?this._sceneObjectId.sceneObject:void 0}get playerChanged(){return this._sceneObjectId.sceneObjectChanged}}const VC=`
24
24
  用来配置子播放器,它是一个数组形式,数组的每个元素仍然是一个数组,形式是[子播放器的ID, 起始时间, 持续时间]。
25
25
  注意时间的单位是毫秒。
26
26
  示例如下:
@@ -43,9 +43,9 @@ of digits after the zone letter and two 100km letters - front
43
43
  half for easting meters, second half for
44
44
  northing meters`+i;var d=c/2,g=0,p=0,E,b,P,v,_;return d>0&&(E=1e5/Math.pow(10,d),b=i.substring(s,s+d),g=parseFloat(b)*E,P=i.substring(s+d),p=parseFloat(P)*E),v=g+u,_=p+h,{easting:v,northing:_,zoneLetter:a,zoneNumber:o,accuracy:E}}function nx(i,t){for(var e=p_.charCodeAt(t-1),n=1e5,r=!1;e!==i.charCodeAt(0);){if(e++,e===En&&e++,e===ar&&e++,e>Uh){if(r)throw"Bad character: "+i;e=Hl,r=!0}n+=1e5}return n}function rx(i,t){if(i>"V")throw"MGRSPoint given invalid Northing "+i;for(var e=m_.charCodeAt(t-1),n=0,r=!1;e!==i.charCodeAt(0);){if(e++,e===En&&e++,e===ar&&e++,e>Bh){if(r)throw"Bad character: "+i;e=Hl,r=!0}n+=1e5}return n}function sx(i){var t;switch(i){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+i}function Xl(i,t,e){if(!(this instanceof Xl))return new Xl(i,t,e);if(Array.isArray(i))this.x=i[0],this.y=i[1],this.z=i[2]||0;else if(typeof i=="object")this.x=i.x,this.y=i.y,this.z=i.z||0;else if(typeof i=="string"&&typeof t>"u"){var n=i.split(",");this.x=parseFloat(n[0]),this.y=parseFloat(n[1]),this.z=parseFloat(n[2])||0}else this.x=i,this.y=t,this.z=e||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Xl.fromMGRS=function(i){return new Xl(y_(i))},Xl.prototype.toMGRS=function(i){return v_([this.x,this.y],i)};var ox=1,ax=.25,S_=.046875,b_=.01953125,C_=.01068115234375,lx=.75,ux=.46875,hx=.013020833333333334,cx=.007120768229166667,dx=.3645833333333333,fx=.005696614583333333,gx=.3076171875;function pp(i){var t=[];t[0]=ox-i*(ax+i*(S_+i*(b_+i*C_))),t[1]=i*(lx-i*(S_+i*(b_+i*C_)));var e=i*i;return t[2]=e*(ux-i*(hx+i*cx)),e*=i,t[3]=e*(dx-i*fx),t[4]=e*i*gx,t}function $l(i,t,e,n){return e*=t,t*=t,n[0]*i-e*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}var px=20;function mp(i,t,e){for(var n=1/(1-t),r=i,s=px;s;--s){var o=Math.sin(r),a=1-t*o*o;if(a=($l(r,o,Math.cos(r),e)-i)*(a*Math.sqrt(a))*n,r-=a,Math.abs(a)<et)return r}return r}function mx(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=pp(this.es),this.ml0=$l(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function vx(i){var t=i.x,e=i.y,n=rt(t-this.long0,this.over),r,s,o,a=Math.sin(e),l=Math.cos(e);if(this.es){var h=l*n,c=Math.pow(h,2),d=this.ep2*Math.pow(l,2),g=Math.pow(d,2),p=Math.abs(l)>et?Math.tan(e):0,E=Math.pow(p,2),b=Math.pow(E,2);r=1-this.es*Math.pow(a,2),h=h/Math.sqrt(r);var P=$l(e,a,l,this.en);s=this.a*(this.k0*h*(1+c/6*(1-E+d+c/20*(5-18*E+b+14*d-58*E*d+c/42*(61+179*b-b*E-479*E)))))+this.x0,o=this.a*(this.k0*(P-this.ml0+a*n*h/2*(1+c/12*(5-E+9*d+4*g+c/30*(61+b-58*E+270*d-330*E*d+c/56*(1385+543*b-b*E-3111*E))))))+this.y0}else{var u=l*Math.sin(n);if(Math.abs(Math.abs(u)-1)<et)return 93;if(s=.5*this.a*this.k0*Math.log((1+u)/(1-u))+this.x0,o=l*Math.cos(n)/Math.sqrt(1-Math.pow(u,2)),u=Math.abs(o),u>=1){if(u-1>et)return 93;o=0}else o=Math.acos(o);e<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return i.x=s,i.y=o,i}function yx(i){var t,e,n,r,s=(i.x-this.x0)*(1/this.a),o=(i.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+o/this.k0,e=mp(t,this.es,this.en),Math.abs(e)<W){var c=Math.sin(e),d=Math.cos(e),g=Math.abs(d)>et?Math.tan(e):0,p=this.ep2*Math.pow(d,2),E=Math.pow(p,2),b=Math.pow(g,2),P=Math.pow(b,2);t=1-this.es*Math.pow(c,2);var v=s*Math.sqrt(t)/this.k0,_=Math.pow(v,2);t=t*g,n=e-t*_/(1-this.es)*.5*(1-_/12*(5+3*b-9*p*b+p-4*E-_/30*(61+90*b-252*p*b+45*P+46*p-_/56*(1385+3633*b+4095*P+1574*P*b)))),r=rt(this.long0+v*(1-_/6*(1+2*b+p-_/20*(5+28*b+24*P+8*p*b+6*p-_/42*(61+662*b+1320*P+720*P*b))))/d,this.over)}else n=W*Vh(o),r=0;else{var a=Math.exp(s/this.k0),l=.5*(a-1/a),u=this.lat0+o/this.k0,h=Math.cos(u);t=Math.sqrt((1-Math.pow(h,2))/(1+Math.pow(l,2))),n=Math.asin(t),o<0&&(n=-n),l===0&&h===0?r=0:r=rt(Math.atan2(l,h)+this.long0,this.over)}return i.x=r,i.y=n,i}var _x=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const Fd={init:mx,forward:vx,inverse:yx,names:_x};function P_(i){var t=Math.exp(i);return t=(t-1/t)/2,t}function Sn(i,t){i=Math.abs(i),t=Math.abs(t);var e=Math.max(i,t),n=Math.min(i,t)/(e||1);return e*Math.sqrt(1+Math.pow(n,2))}function wx(i){var t=1+i,e=t-1;return e===0?i:i*Math.log(t)/e}function Ex(i){var t=Math.abs(i);return t=wx(t*(1+t/(Sn(1,t)+1))),i<0?-t:t}function vp(i,t){for(var e=2*Math.cos(2*t),n=i.length-1,r=i[n],s=0,o;--n>=0;)o=-s+e*r+i[n],s=r,r=o;return t+o*Math.sin(2*t)}function Sx(i,t){for(var e=2*Math.cos(t),n=i.length-1,r=i[n],s=0,o;--n>=0;)o=-s+e*r+i[n],s=r,r=o;return Math.sin(t)*o}function bx(i){var t=Math.exp(i);return t=(t+1/t)/2,t}function x_(i,t,e){for(var n=Math.sin(t),r=Math.cos(t),s=P_(e),o=bx(e),a=2*r*o,l=-2*n*s,u=i.length-1,h=i[u],c=0,d=0,g=0,p,E;--u>=0;)p=d,E=c,d=h,c=g,h=-p+a*d-l*c+i[u],g=-E+l*d+a*c;return a=n*o,l=r*s,[a*h-l*g,a*g+l*h]}function Cx(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Fd.init.apply(this),this.forward=Fd.forward,this.inverse=Fd.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var i=this.es/(1+Math.sqrt(1-this.es)),t=i/(2-i),e=t;this.cgb[0]=t*(2+t*(-.6666666666666666+t*(-2+t*(2.577777777777778+t*(.5777777777777777+t*-4.228148148148148))))),this.cbg[0]=t*(-2+t*(.6666666666666666+t*(1.3333333333333333+t*(-1.8222222222222222+t*(.7111111111111111+t*.9824338624338624))))),e=e*t,this.cgb[1]=e*(2.3333333333333335+t*(-1.6+t*(-5.044444444444444+t*(8.584126984126984+t*2.458201058201058)))),this.cbg[1]=e*(1.6666666666666667+t*(-1.0666666666666667+t*(-1.4444444444444444+t*(2.86984126984127+t*-1.6105820105820106)))),e=e*t,this.cgb[2]=e*(3.7333333333333334+t*(-3.8857142857142857+t*(-12.019047619047619+t*26.03668430335097))),this.cbg[2]=e*(-1.7333333333333334+t*(1.619047619047619+t*(1.6+t*-4.474779541446208))),e=e*t,this.cgb[3]=e*(6.792063492063492+t*(-9.485714285714286+t*-28.188500881834216)),this.cbg[3]=e*(1.9634920634920634+t*(-2.4+t*-1.7518165784832451)),e=e*t,this.cgb[4]=e*(13.250793650793652+t*-23.22238255571589),this.cbg[4]=e*(-2.3301587301587303+t*3.5144460477793813),e=e*t,this.cgb[5]=e*27.011268237934903,this.cbg[5]=e*2.8496841430174764,e=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+e*(.25+e*(.015625+e/256))),this.utg[0]=t*(-.5+t*(.6666666666666666+t*(-.3854166666666667+t*(.002777777777777778+t*(.158203125+t*-.15905919312169312))))),this.gtu[0]=t*(.5+t*(-.6666666666666666+t*(.3125+t*(.22777777777777777+t*(-.4409722222222222+t*.20875661375661375))))),this.utg[1]=e*(-.020833333333333332+t*(-.06666666666666667+t*(.3034722222222222+t*(-.4380952380952381+t*.2890188388723545)))),this.gtu[1]=e*(.2708333333333333+t*(-.6+t*(.38680555555555557+t*(.44603174603174606+t*-1.0248393063822752)))),e=e*t,this.utg[2]=e*(-.035416666666666666+t*(.04404761904761905+t*(.046651785714285715+t*-.06138668430335097))),this.gtu[2]=e*(.25416666666666665+t*(-.7357142857142858+t*(.5603050595238095+t*.9237378747795415))),e=e*t,this.utg[3]=e*(-.02726314484126984+t*(.021825396825396824+t*.11439745921516754)),this.gtu[3]=e*(.30729786706349205+t*(-1.0654761904761905+t*.9096203979276896)),e=e*t,this.utg[4]=e*(-.02841641865079365+t*.027268468414301746),this.gtu[4]=e*(.4306671626984127+t*-1.713007555715889),e=e*t,this.utg[5]=e*-.03233083094085698,this.gtu[5]=e*.6650675310896665;var n=vp(this.cbg,this.lat0);this.Zb=-this.Qn*(n+Sx(this.gtu,2*n))}function Px(i){var t=rt(i.x-this.long0,this.over),e=i.y;e=vp(this.cbg,e);var n=Math.sin(e),r=Math.cos(e),s=Math.sin(t),o=Math.cos(t);e=Math.atan2(n,o*r),t=Math.atan2(s*r,Sn(n,r*o)),t=Ex(Math.tan(t));var a=x_(this.gtu,2*e,2*t);e=e+a[0],t=t+a[1];var l,u;return Math.abs(t)<=2.623395162778?(l=this.a*(this.Qn*t)+this.x0,u=this.a*(this.Qn*e+this.Zb)+this.y0):(l=1/0,u=1/0),i.x=l,i.y=u,i}function xx(i){var t=(i.x-this.x0)*(1/this.a),e=(i.y-this.y0)*(1/this.a);e=(e-this.Zb)/this.Qn,t=t/this.Qn;var n,r;if(Math.abs(t)<=2.623395162778){var s=x_(this.utg,2*e,2*t);e=e+s[0],t=t+s[1],t=Math.atan(P_(t));var o=Math.sin(e),a=Math.cos(e),l=Math.sin(t),u=Math.cos(t);e=Math.atan2(o*u,Sn(l,u*a)),t=Math.atan2(l,u*a),n=rt(t+this.long0,this.over),r=vp(this.cgb,e)}else n=1/0,r=1/0;return i.x=n,i.y=r,i}var Ix=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const kd={init:Cx,forward:Px,inverse:xx,names:Ix};function Mx(i,t){if(i===void 0){if(i=Math.floor((rt(t)+Math.PI)*30/Math.PI)+1,i<0)return 0;if(i>60)return 60}return i}var Tx="etmerc";function Nx(){var i=Mx(this.zone,this.long0);if(i===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(i)-183)*ze,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,kd.init.apply(this),this.forward=kd.forward,this.inverse=kd.inverse}var Ox=["Universal Transverse Mercator System","utm"];const Dx={init:Nx,names:Ox,dependsOn:Tx};function yp(i,t){return Math.pow((1-i)/(1+i),t)}var Rx=20;function Ax(){var i=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*i*i),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(i/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+ae)/(Math.pow(Math.tan(.5*this.lat0+ae),this.C)*yp(this.e*i,this.ratexp))}function Lx(i){var t=i.x,e=i.y;return i.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+ae),this.C)*yp(this.e*Math.sin(e),this.ratexp))-W,i.x=this.C*t,i}function Fx(i){for(var t=1e-14,e=i.x/this.C,n=i.y,r=Math.pow(Math.tan(.5*n+ae)/this.K,1/this.C),s=Rx;s>0&&(n=2*Math.atan(r*yp(this.e*Math.sin(i.y),-.5*this.e))-W,!(Math.abs(n-i.y)<t));--s)i.y=n;return s?(i.x=e,i.y=n,i):null}const _p={init:Ax,forward:Lx,inverse:Fx};function kx(){_p.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function Gx(i){var t,e,n,r;return i.x=rt(i.x-this.long0,this.over),_p.forward.apply(this,[i]),t=Math.sin(i.y),e=Math.cos(i.y),n=Math.cos(i.x),r=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*e*n),i.x=r*e*Math.sin(i.x),i.y=r*(this.cosc0*t-this.sinc0*e*n),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function jx(i){var t,e,n,r,s;if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,s=Sn(i.x,i.y)){var o=2*Math.atan2(s,this.R2);t=Math.sin(o),e=Math.cos(o),r=Math.asin(e*this.sinc0+i.y*t*this.cosc0/s),n=Math.atan2(i.x*t,s*this.cosc0*e-i.y*this.sinc0*t)}else r=this.phic0,n=0;return i.x=n,i.y=r,_p.inverse.apply(this,[i]),i.x=rt(i.x+this.long0,this.over),i}var Vx=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const zx={init:kx,forward:Gx,inverse:jx,names:Vx};function wp(i,t,e){return t*=e,Math.tan(.5*(W+i))*Math.pow((1-t)/(1+t),.5*e)}function Bx(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=et&&(this.k0=.5*(1+Vh(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=et&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=et&&Math.abs(Math.cos(this.lat_ts))>et&&(this.k0=.5*this.cons*ws(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Gr(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=ws(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(wp(this.lat0,this.sinlat0,this.e))-W,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function Ux(i){var t=i.x,e=i.y,n=Math.sin(e),r=Math.cos(e),s,o,a,l,u,h,c=rt(t-this.long0,this.over);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=et&&Math.abs(e+this.lat0)<=et?(i.x=NaN,i.y=NaN,i):this.sphere?(s=2*this.k0/(1+this.sinlat0*n+this.coslat0*r*Math.cos(c)),i.x=this.a*s*r*Math.sin(c)+this.x0,i.y=this.a*s*(this.coslat0*n-this.sinlat0*r*Math.cos(c))+this.y0,i):(o=2*Math.atan(wp(e,n,this.e))-W,l=Math.cos(o),a=Math.sin(o),Math.abs(this.coslat0)<=et?(u=Gr(this.e,e*this.con,this.con*n),h=2*this.a*this.k0*u/this.cons,i.x=this.x0+h*Math.sin(t-this.long0),i.y=this.y0-this.con*h*Math.cos(t-this.long0),i):(Math.abs(this.sinlat0)<et?(s=2*this.a*this.k0/(1+l*Math.cos(c)),i.y=s*a):(s=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*l*Math.cos(c))),i.y=s*(this.cosX0*a-this.sinX0*l*Math.cos(c))+this.y0),i.x=s*l*Math.sin(c)+this.x0,i))}function qx(i){i.x-=this.x0,i.y-=this.y0;var t,e,n,r,s,o=Math.sqrt(i.x*i.x+i.y*i.y);if(this.sphere){var a=2*Math.atan(o/(2*this.a*this.k0));return t=this.long0,e=this.lat0,o<=et?(i.x=t,i.y=e,i):(e=Math.asin(Math.cos(a)*this.sinlat0+i.y*Math.sin(a)*this.coslat0/o),Math.abs(this.coslat0)<et?this.lat0>0?t=rt(this.long0+Math.atan2(i.x,-1*i.y),this.over):t=rt(this.long0+Math.atan2(i.x,i.y),this.over):t=rt(this.long0+Math.atan2(i.x*Math.sin(a),o*this.coslat0*Math.cos(a)-i.y*this.sinlat0*Math.sin(a)),this.over),i.x=t,i.y=e,i)}else if(Math.abs(this.coslat0)<=et){if(o<=et)return e=this.lat0,t=this.long0,i.x=t,i.y=e,i;i.x*=this.con,i.y*=this.con,n=o*this.cons/(2*this.a*this.k0),e=this.con*zh(this.e,n),t=this.con*rt(this.con*this.long0+Math.atan2(i.x,-1*i.y),this.over)}else r=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=et?s=this.X0:(s=Math.asin(Math.cos(r)*this.sinX0+i.y*Math.sin(r)*this.cosX0/o),t=rt(this.long0+Math.atan2(i.x*Math.sin(r),o*this.cosX0*Math.cos(r)-i.y*this.sinX0*Math.sin(r)),this.over)),e=-1*zh(this.e,Math.tan(.5*(W+s)));return i.x=t,i.y=e,i}var Wx=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const Hx={init:Bx,forward:Ux,inverse:qx,names:Wx,ssfn_:wp};function Xx(){var i=this.lat0;this.lambda0=this.long0;var t=Math.sin(i),e=this.a,n=this.rf,r=1/n,s=2*r-Math.pow(r,2),o=this.e=Math.sqrt(s);this.R=this.k0*e*Math.sqrt(1-s)/(1-s*Math.pow(t,2)),this.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(i),4)),this.b0=Math.asin(t/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+i/2)),u=Math.log((1+o*t)/(1-o*t));this.K=a-this.alpha*l+this.alpha*o/2*u}function $x(i){var t=Math.log(Math.tan(Math.PI/4-i.y/2)),e=this.e/2*Math.log((1+this.e*Math.sin(i.y))/(1-this.e*Math.sin(i.y))),n=-this.alpha*(t+e)+this.K,r=2*(Math.atan(Math.exp(n))-Math.PI/4),s=this.alpha*(i.x-this.lambda0),o=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(s))),a=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(s));return i.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,i.x=this.R*o+this.x0,i}function Yx(i){for(var t=i.x-this.x0,e=i.y-this.y0,n=t/this.R,r=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(n)),o=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(r))),a=this.lambda0+o/this.alpha,l=0,u=s,h=-1e3,c=0;Math.abs(u-h)>1e-7;){if(++c>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(u))/2)),h=u,u=2*Math.atan(Math.exp(l))-Math.PI/2}return i.x=a,i.y=u,i}var Jx=["somerc"];const Zx={init:Xx,forward:$x,inverse:Yx,names:Jx};var Yl=1e-7;function Kx(i){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],e=typeof i.projName=="object"?Object.keys(i.projName)[0]:i.projName;return"no_uoff"in i||"no_off"in i||t.indexOf(e)!==-1||t.indexOf(n_(e))!==-1}function Qx(){var i,t,e,n,r,s,o,a,l,u,h=0,c,d=0,g=0,p=0,E=0,b=0,P=0;this.no_off=Kx(this),this.no_rot="no_rot"in this;var v=!1;"alpha"in this&&(v=!0);var _=!1;if("rectified_grid_angle"in this&&(_=!0),v&&(P=this.alpha),_&&(h=this.rectified_grid_angle),v||_)d=this.longc;else if(g=this.long1,E=this.lat1,p=this.long2,b=this.lat2,Math.abs(E-b)<=Yl||(i=Math.abs(E))<=Yl||Math.abs(i-W)<=Yl||Math.abs(Math.abs(this.lat0)-W)<=Yl||Math.abs(Math.abs(b)-W)<=Yl)throw new Error;var m=1-this.es;t=Math.sqrt(m),Math.abs(this.lat0)>et?(a=Math.sin(this.lat0),e=Math.cos(this.lat0),i=1-this.es*a*a,this.B=e*e,this.B=Math.sqrt(1+this.es*this.B*this.B/m),this.A=this.B*this.k0*t/i,n=this.B*t/(e*Math.sqrt(i)),r=n*n-1,r<=0?r=0:(r=Math.sqrt(r),this.lat0<0&&(r=-r)),this.E=r+=n,this.E*=Math.pow(Gr(this.e,this.lat0,a),this.B)):(this.B=1/t,this.A=this.k0,this.E=n=r=1),v||_?(v?(c=Math.asin(Math.sin(P)/n),_||(h=P)):(c=h,P=Math.asin(n*Math.sin(c))),this.lam0=d-Math.asin(.5*(r-1/r)*Math.tan(c))/this.B):(s=Math.pow(Gr(this.e,E,Math.sin(E)),this.B),o=Math.pow(Gr(this.e,b,Math.sin(b)),this.B),r=this.E/s,l=(o-s)/(o+s),u=this.E*this.E,u=(u-o*s)/(u+o*s),i=g-p,i<-Math.PI?p-=Gh:i>Math.PI&&(p+=Gh),this.lam0=rt(.5*(g+p)-Math.atan(u*Math.tan(.5*this.B*(g-p))/l)/this.B,this.over),c=Math.atan(2*Math.sin(this.B*rt(g-this.lam0,this.over))/(r-1/r)),h=P=Math.asin(n*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(h),this.cosrot=Math.cos(h),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(P))),this.lat0<0&&(this.u_0=-this.u_0)),r=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(ae-r)),this.v_pole_s=this.ArB*Math.log(Math.tan(ae+r))}function tI(i){var t={},e,n,r,s,o,a,l,u;if(i.x=i.x-this.lam0,Math.abs(Math.abs(i.y)-W)>et){if(o=this.E/Math.pow(Gr(this.e,i.y,Math.sin(i.y)),this.B),a=1/o,e=.5*(o-a),n=.5*(o+a),s=Math.sin(this.B*i.x),r=(e*this.singam-s*this.cosgam)/n,Math.abs(Math.abs(r)-1)<et)throw new Error;u=.5*this.ArB*Math.log((1-r)/(1+r)),a=Math.cos(this.B*i.x),Math.abs(a)<Yl?l=this.A*i.x:l=this.ArB*Math.atan2(e*this.cosgam+s*this.singam,a)}else u=i.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*i.y;return this.no_rot?(t.x=l,t.y=u):(l-=this.u_0,t.x=u*this.cosrot+l*this.sinrot,t.y=l*this.cosrot-u*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function eI(i){var t,e,n,r,s,o,a,l={};if(i.x=(i.x-this.x0)*(1/this.a),i.y=(i.y-this.y0)*(1/this.a),this.no_rot?(e=i.y,t=i.x):(e=i.x*this.cosrot-i.y*this.sinrot,t=i.y*this.cosrot+i.x*this.sinrot+this.u_0),n=Math.exp(-this.BrA*e),r=.5*(n-1/n),s=.5*(n+1/n),o=Math.sin(this.BrA*t),a=(o*this.cosgam+r*this.singam)/s,Math.abs(Math.abs(a)-1)<et)l.x=0,l.y=a<0?-W:W;else{if(l.y=this.E/Math.sqrt((1+a)/(1-a)),l.y=zh(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(r*this.cosgam-o*this.singam,Math.cos(this.BrA*t))}return l.x+=this.lam0,l}var iI=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const nI={init:Qx,forward:tI,inverse:eI,names:iI};function rI(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<et)){var i=this.b/this.a;this.e=Math.sqrt(1-i*i);var t=Math.sin(this.lat1),e=Math.cos(this.lat1),n=ws(this.e,t,e),r=Gr(this.e,this.lat1,t),s=Math.sin(this.lat2),o=Math.cos(this.lat2),a=ws(this.e,s,o),l=Gr(this.e,this.lat2,s),u=Math.abs(Math.abs(this.lat0)-W)<et?0:Gr(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>et?this.ns=Math.log(n/a)/Math.log(r/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=n/(this.ns*Math.pow(r,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function sI(i){var t=i.x,e=i.y;Math.abs(2*Math.abs(e)-Math.PI)<=et&&(e=Vh(e)*(W-2*et));var n=Math.abs(Math.abs(e)-W),r,s;if(n>et)r=Gr(this.e,e,Math.sin(e)),s=this.a*this.f0*Math.pow(r,this.ns);else{if(n=e*this.ns,n<=0)return null;s=0}var o=this.ns*rt(t-this.long0,this.over);return i.x=this.k0*(s*Math.sin(o))+this.x0,i.y=this.k0*(this.rh-s*Math.cos(o))+this.y0,i}function oI(i){var t,e,n,r,s,o=(i.x-this.x0)/this.k0,a=this.rh-(i.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+a*a),e=1):(t=-Math.sqrt(o*o+a*a),e=-1);var l=0;if(t!==0&&(l=Math.atan2(e*o,e*a)),t!==0||this.ns>0){if(e=1/this.ns,n=Math.pow(t/(this.a*this.f0),e),r=zh(this.e,n),r===-9999)return null}else r=-W;return s=rt(l/this.ns+this.long0,this.over),i.x=s,i.y=r,i}var aI=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const lI={init:rI,forward:sI,inverse:oI,names:aI};function uI(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function hI(i){var t,e,n,r,s,o,a,l=i.x,u=i.y,h=rt(l-this.long0,this.over);return t=Math.pow((1+this.e*Math.sin(u))/(1-this.e*Math.sin(u)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(u/2+this.s45),this.alfa)/t)-this.s45),n=-h*this.alfa,r=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(n)),s=Math.asin(Math.cos(e)*Math.sin(n)/Math.cos(r)),o=this.n*s,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n),i.y=a*Math.cos(o)/1,i.x=a*Math.sin(o)/1,this.czech||(i.y*=-1,i.x*=-1),i}function cI(i){var t,e,n,r,s,o,a,l,u=i.x;i.x=i.y,i.y=u,this.czech||(i.y*=-1,i.x*=-1),o=Math.sqrt(i.x*i.x+i.y*i.y),s=Math.atan2(i.y,i.x),r=s/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),e=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(t)),i.x=this.long0-e/this.alfa,a=t,l=0;var h=0;do i.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-i.y)<1e-10&&(l=1),a=i.y,h+=1;while(l===0&&h<15);return h>=15?null:i}var dI=["Krovak","Krovak Modified","Krovak (North Orientated)","Krovak Modified (North Orientated)","krovak"];const fI={init:uI,forward:hI,inverse:cI,names:dI};function rn(i,t,e,n,r){return i*r-t*Math.sin(2*r)+e*Math.sin(4*r)-n*Math.sin(6*r)}function qh(i){return 1-.25*i*(1+i/16*(3+1.25*i))}function Wh(i){return .375*i*(1+.25*i*(1+.46875*i))}function Hh(i){return .05859375*i*i*(1+.75*i)}function Xh(i){return i*i*i*.011393229166666666}function Ep(i,t,e){var n=t*e;return i/Math.sqrt(1-n*n)}function jo(i){return Math.abs(i)<W?i:i-Vh(i)*Math.PI}function Gd(i,t,e,n,r){var s,o;s=i/t;for(var a=0;a<15;a++)if(o=(i-(t*s-e*Math.sin(2*s)+n*Math.sin(4*s)-r*Math.sin(6*s)))/(t-2*e*Math.cos(2*s)+4*n*Math.cos(4*s)-6*r*Math.cos(6*s)),s+=o,Math.abs(o)<=1e-10)return s;return NaN}function gI(){this.sphere||(this.e0=qh(this.es),this.e1=Wh(this.es),this.e2=Hh(this.es),this.e3=Xh(this.es),this.ml0=this.a*rn(this.e0,this.e1,this.e2,this.e3,this.lat0))}function pI(i){var t,e,n=i.x,r=i.y;if(n=rt(n-this.long0,this.over),this.sphere)t=this.a*Math.asin(Math.cos(r)*Math.sin(n)),e=this.a*(Math.atan2(Math.tan(r),Math.cos(n))-this.lat0);else{var s=Math.sin(r),o=Math.cos(r),a=Ep(this.a,this.e,s),l=Math.tan(r)*Math.tan(r),u=n*Math.cos(r),h=u*u,c=this.es*o*o/(1-this.es),d=this.a*rn(this.e0,this.e1,this.e2,this.e3,r);t=a*u*(1-h*l*(.16666666666666666-(8-l+8*c)*h/120)),e=d-this.ml0+a*s/o*h*(.5+(5-l+6*c)*h/24)}return i.x=t+this.x0,i.y=e+this.y0,i}function mI(i){i.x-=this.x0,i.y-=this.y0;var t=i.x/this.a,e=i.y/this.a,n,r;if(this.sphere){var s=e+this.lat0;n=Math.asin(Math.sin(s)*Math.cos(t)),r=Math.atan2(Math.tan(t),Math.cos(s))}else{var o=this.ml0/this.a+e,a=Gd(o,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-W)<=et)return i.x=this.long0,i.y=W,e<0&&(i.y*=-1),i;var l=Ep(this.a,this.e,Math.sin(a)),u=l*l*l/this.a/this.a*(1-this.es),h=Math.pow(Math.tan(a),2),c=t*this.a/l,d=c*c;n=a-l*Math.tan(a)/u*c*c*(.5-(1+3*h)*c*c/24),r=c*(1-d*(h/3+(1+3*h)*h*d/15))/Math.cos(a)}return i.x=rt(r+this.long0,this.over),i.y=jo(n),i}var vI=["Cassini","Cassini_Soldner","cass"];const yI={init:gI,forward:pI,inverse:mI,names:vI};function Vo(i,t){var e;return i>1e-7?(e=i*t,(1-i*i)*(t/(1-e*e)-.5/i*Math.log((1-e)/(1+e)))):2*t}var Sp=1,bp=2,Cp=3,jd=4;function _I(){var i=Math.abs(this.lat0);if(Math.abs(i-W)<et?this.mode=this.lat0<0?Sp:bp:Math.abs(i)<et?this.mode=Cp:this.mode=jd,this.es>0){var t;switch(this.qp=Vo(this.e,1),this.mmf=.5/(1-this.es),this.apa=MI(this.es),this.mode){case bp:this.dd=1;break;case Sp:this.dd=1;break;case Cp:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case jd:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Vo(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===jd&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function wI(i){var t,e,n,r,s,o,a,l,u,h,c=i.x,d=i.y;if(c=rt(c-this.long0,this.over),this.sphere){if(s=Math.sin(d),h=Math.cos(d),n=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e=this.mode===this.EQUIT?1+h*n:1+this.sinph0*s+this.cosph0*h*n,e<=et)return null;e=Math.sqrt(2/e),t=e*h*Math.sin(c),e*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*h*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(d+this.lat0)<et)return null;e=ae-d*.5,e=2*(this.mode===this.S_POLE?Math.cos(e):Math.sin(e)),t=e*Math.sin(c),e*=n}}else{switch(a=0,l=0,u=0,n=Math.cos(c),r=Math.sin(c),s=Math.sin(d),o=Vo(this.e,s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(a=o/this.qp,l=Math.sqrt(1-a*a)),this.mode){case this.OBLIQ:u=1+this.sinb1*a+this.cosb1*l*n;break;case this.EQUIT:u=1+l*n;break;case this.N_POLE:u=W+d,o=this.qp-o;break;case this.S_POLE:u=d-W,o=this.qp+o;break}if(Math.abs(u)<et)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:u=Math.sqrt(2/u),this.mode===this.OBLIQ?e=this.ymf*u*(this.cosb1*a-this.sinb1*l*n):e=(u=Math.sqrt(2/(1+l*n)))*a*this.ymf,t=this.xmf*u*l*r;break;case this.N_POLE:case this.S_POLE:o>=0?(t=(u=Math.sqrt(o))*r,e=n*(this.mode===this.S_POLE?u:-u)):t=e=0;break}}return i.x=this.a*t+this.x0,i.y=this.a*e+this.y0,i}function EI(i){i.x-=this.x0,i.y-=this.y0;var t=i.x/this.a,e=i.y/this.a,n,r,s,o,a,l,u;if(this.sphere){var h=0,c,d=0;if(c=Math.sqrt(t*t+e*e),r=c*.5,r>1)return null;switch(r=2*Math.asin(r),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(d=Math.sin(r),h=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(c)<=et?0:Math.asin(e*d/c),t*=d,e=h*c;break;case this.OBLIQ:r=Math.abs(c)<=et?this.lat0:Math.asin(h*this.sinph0+e*d*this.cosph0/c),t*=d*this.cosph0,e=(h-Math.sin(r)*this.sinph0)*c;break;case this.N_POLE:e=-e,r=W-r;break;case this.S_POLE:r-=W;break}n=e===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,e)}else{if(u=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,e*=this.dd,l=Math.sqrt(t*t+e*e),l<et)return i.x=this.long0,i.y=this.lat0,i;o=2*Math.asin(.5*l/this.rq),s=Math.cos(o),t*=o=Math.sin(o),this.mode===this.OBLIQ?(u=s*this.sinb1+e*o*this.cosb1/l,a=this.qp*u,e=l*this.cosb1*s-e*this.sinb1*o):(u=e*o/l,a=this.qp*u,e=l*s)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(e=-e),a=t*t+e*e,!a)return i.x=this.long0,i.y=this.lat0,i;u=1-a/this.qp,this.mode===this.S_POLE&&(u=-u)}n=Math.atan2(t,e),r=TI(Math.asin(u),this.apa)}return i.x=rt(this.long0+n,this.over),i.y=r,i}var SI=.3333333333333333,bI=.17222222222222222,CI=.10257936507936508,PI=.06388888888888888,xI=.0664021164021164,II=.016415012942191543;function MI(i){var t,e=[];return e[0]=i*SI,t=i*i,e[0]+=t*bI,e[1]=t*PI,t*=i,e[0]+=t*CI,e[1]+=t*xI,e[2]=t*II,e}function TI(i,t){var e=i+i;return i+t[0]*Math.sin(e)+t[1]*Math.sin(e+e)+t[2]*Math.sin(e+e+e)}var NI=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const OI={init:_I,forward:wI,inverse:EI,names:NI,S_POLE:Sp,N_POLE:bp,EQUIT:Cp,OBLIQ:jd};function zo(i){return Math.abs(i)>1&&(i=i>1?1:-1),Math.asin(i)}function DI(){Math.abs(this.lat1+this.lat2)<et||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=ws(this.e3,this.sin_po,this.cos_po),this.qs1=Vo(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=ws(this.e3,this.sin_po,this.cos_po),this.qs2=Vo(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Vo(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>et?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function RI(i){var t=i.x,e=i.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var n=Vo(this.e3,this.sin_phi),r=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,s=this.ns0*rt(t-this.long0,this.over),o=r*Math.sin(s)+this.x0,a=this.rh-r*Math.cos(s)+this.y0;return i.x=o,i.y=a,i}function AI(i){var t,e,n,r,s,o;return i.x-=this.x0,i.y=this.rh-i.y+this.y0,this.ns0>=0?(t=Math.sqrt(i.x*i.x+i.y*i.y),n=1):(t=-Math.sqrt(i.x*i.x+i.y*i.y),n=-1),r=0,t!==0&&(r=Math.atan2(n*i.x,n*i.y)),n=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-n*n)/(2*this.ns0)):(e=(this.c-n*n)/this.ns0,o=this.phi1z(this.e3,e)),s=rt(r/this.ns0+this.long0,this.over),i.x=s,i.y=o,i}function LI(i,t){var e,n,r,s,o,a=zo(.5*t);if(i<et)return a;for(var l=i*i,u=1;u<=25;u++)if(e=Math.sin(a),n=Math.cos(a),r=i*e,s=1-r*r,o=.5*s*s/n*(t/(1-l)-e/s+.5/i*Math.log((1-r)/(1+r))),a=a+o,Math.abs(o)<=1e-7)return a;return null}var FI=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const kI={init:DI,forward:RI,inverse:AI,names:FI,phi1z:LI};function GI(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function jI(i){var t,e,n,r,s,o,a,l,u=i.x,h=i.y;return n=rt(u-this.long0,this.over),t=Math.sin(h),e=Math.cos(h),r=Math.cos(n),o=this.sin_p14*t+this.cos_p14*e*r,s=1,o>0||Math.abs(o)<=et?(a=this.x0+this.a*s*e*Math.sin(n)/o,l=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*e*r)/o):(a=this.x0+this.infinity_dist*e*Math.sin(n),l=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*e*r)),i.x=a,i.y=l,i}function VI(i){var t,e,n,r,s,o;return i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,(t=Math.sqrt(i.x*i.x+i.y*i.y))?(r=Math.atan2(t,this.rc),e=Math.sin(r),n=Math.cos(r),o=zo(n*this.sin_p14+i.y*e*this.cos_p14/t),s=Math.atan2(i.x*e,t*this.cos_p14*n-i.y*this.sin_p14*e),s=rt(this.long0+s,this.over)):(o=this.phic0,s=0),i.x=s,i.y=o,i}var zI=["gnom"];const BI={init:GI,forward:jI,inverse:VI,names:zI};function UI(i,t){var e=1-(1-i*i)/(2*i)*Math.log((1-i)/(1+i));if(Math.abs(Math.abs(t)-e)<1e-6)return t<0?-1*W:W;for(var n=Math.asin(.5*t),r,s,o,a,l=0;l<30;l++)if(s=Math.sin(n),o=Math.cos(n),a=i*s,r=Math.pow(1-a*a,2)/(2*o)*(t/(1-i*i)-s/(1-a*a)+.5/i*Math.log((1-a)/(1+a))),n+=r,Math.abs(r)<=1e-10)return n;return NaN}function qI(){this.sphere||(this.k0=ws(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function WI(i){var t=i.x,e=i.y,n,r,s=rt(t-this.long0,this.over);if(this.sphere)n=this.x0+this.a*s*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var o=Vo(this.e,Math.sin(e));n=this.x0+this.a*this.k0*s,r=this.y0+this.a*o*.5/this.k0}return i.x=n,i.y=r,i}function HI(i){i.x-=this.x0,i.y-=this.y0;var t,e;return this.sphere?(t=rt(this.long0+i.x/this.a/Math.cos(this.lat_ts),this.over),e=Math.asin(i.y/this.a*Math.cos(this.lat_ts))):(e=UI(this.e,2*i.y*this.k0/this.a),t=rt(this.long0+i.x/(this.a*this.k0),this.over)),i.x=t,i.y=e,i}var XI=["cea"];const $I={init:qI,forward:WI,inverse:HI,names:XI};function YI(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function JI(i){var t=i.x,e=i.y,n=rt(t-this.long0,this.over),r=jo(e-this.lat0);return i.x=this.x0+this.a*n*this.rc,i.y=this.y0+this.a*r,i}function ZI(i){var t=i.x,e=i.y;return i.x=rt(this.long0+(t-this.x0)/(this.a*this.rc),this.over),i.y=jo(this.lat0+(e-this.y0)/this.a),i}var KI=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const QI={init:YI,forward:JI,inverse:ZI,names:KI};var I_=20;function tM(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=qh(this.es),this.e1=Wh(this.es),this.e2=Hh(this.es),this.e3=Xh(this.es),this.ml0=this.a*rn(this.e0,this.e1,this.e2,this.e3,this.lat0)}function eM(i){var t=i.x,e=i.y,n,r,s,o=rt(t-this.long0,this.over);if(s=o*Math.sin(e),this.sphere)Math.abs(e)<=et?(n=this.a*o,r=-1*this.a*this.lat0):(n=this.a*Math.sin(s)/Math.tan(e),r=this.a*(jo(e-this.lat0)+(1-Math.cos(s))/Math.tan(e)));else if(Math.abs(e)<=et)n=this.a*o,r=-1*this.ml0;else{var a=Ep(this.a,this.e,Math.sin(e))/Math.tan(e);n=a*Math.sin(s),r=this.a*rn(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+a*(1-Math.cos(s))}return i.x=n+this.x0,i.y=r+this.y0,i}function iM(i){var t,e,n,r,s,o,a,l,u;if(n=i.x-this.x0,r=i.y-this.y0,this.sphere)if(Math.abs(r+this.a*this.lat0)<=et)t=rt(n/this.a+this.long0,this.over),e=0;else{o=this.lat0+r/this.a,a=n*n/this.a/this.a+o*o,l=o;var h;for(s=I_;s;--s)if(h=Math.tan(l),u=-1*(o*(l*h+1)-l-.5*(l*l+a)*h)/((l-o)/h-1),l+=u,Math.abs(u)<=et){e=l;break}t=rt(this.long0+Math.asin(n*Math.tan(l)/this.a)/Math.sin(e),this.over)}else if(Math.abs(r+this.ml0)<=et)e=0,t=rt(this.long0+n/this.a,this.over);else{o=(this.ml0+r)/this.a,a=n*n/this.a/this.a+o*o,l=o;var c,d,g,p,E;for(s=I_;s;--s)if(E=this.e*Math.sin(l),c=Math.sqrt(1-E*E)*Math.tan(l),d=this.a*rn(this.e0,this.e1,this.e2,this.e3,l),g=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),p=d/this.a,u=(o*(c*p+1)-p-.5*c*(p*p+a))/(this.es*Math.sin(2*l)*(p*p+a-2*o*p)/(4*c)+(o-p)*(c*g-2/Math.sin(2*l))-g),l-=u,Math.abs(u)<=et){e=l;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),t=rt(this.long0+Math.asin(n*c/this.a)/Math.sin(e),this.over)}return i.x=t,i.y=e,i}var nM=["Polyconic","American_Polyconic","poly"];const rM={init:tM,forward:eM,inverse:iM,names:nM};function sM(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function oM(i){var t,e=i.x,n=i.y,r=n-this.lat0,s=e-this.long0,o=r/kh*1e-5,a=s,l=1,u=0;for(t=1;t<=10;t++)l=l*o,u=u+this.A[t]*l;var h=u,c=a,d=1,g=0,p,E,b=0,P=0;for(t=1;t<=6;t++)p=d*h-g*c,E=g*h+d*c,d=p,g=E,b=b+this.B_re[t]*d-this.B_im[t]*g,P=P+this.B_im[t]*d+this.B_re[t]*g;return i.x=P*this.a+this.x0,i.y=b*this.a+this.y0,i}function aM(i){var t,e=i.x,n=i.y,r=e-this.x0,s=n-this.y0,o=s/this.a,a=r/this.a,l=1,u=0,h,c,d=0,g=0;for(t=1;t<=6;t++)h=l*o-u*a,c=u*o+l*a,l=h,u=c,d=d+this.C_re[t]*l-this.C_im[t]*u,g=g+this.C_im[t]*l+this.C_re[t]*u;for(var p=0;p<this.iterations;p++){var E=d,b=g,P,v,_=o,m=a;for(t=2;t<=6;t++)P=E*d-b*g,v=b*d+E*g,E=P,b=v,_=_+(t-1)*(this.B_re[t]*E-this.B_im[t]*b),m=m+(t-1)*(this.B_im[t]*E+this.B_re[t]*b);E=1,b=0;var y=this.B_re[1],S=this.B_im[1];for(t=2;t<=6;t++)P=E*d-b*g,v=b*d+E*g,E=P,b=v,y=y+t*(this.B_re[t]*E-this.B_im[t]*b),S=S+t*(this.B_im[t]*E+this.B_re[t]*b);var C=y*y+S*S;d=(_*y+m*S)/C,g=(m*y-_*S)/C}var x=d,I=g,M=1,T=0;for(t=1;t<=9;t++)M=M*x,T=T+this.D[t]*M;var R=this.lat0+T*kh*1e5,A=this.long0+I;return i.x=A,i.y=R,i}var lM=["New_Zealand_Map_Grid","nzmg"];const uM={init:sM,forward:oM,inverse:aM,names:lM};function hM(){}function cM(i){var t=i.x,e=i.y,n=rt(t-this.long0,this.over),r=this.x0+this.a*n,s=this.y0+this.a*Math.log(Math.tan(Math.PI/4+e/2.5))*1.25;return i.x=r,i.y=s,i}function dM(i){i.x-=this.x0,i.y-=this.y0;var t=rt(this.long0+i.x/this.a,this.over),e=2.5*(Math.atan(Math.exp(.8*i.y/this.a))-Math.PI/4);return i.x=t,i.y=e,i}var fM=["Miller_Cylindrical","mill"];const gM={init:hM,forward:cM,inverse:dM,names:fM};var pM=20;function mM(){this.long0=this.long0||0,this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=pp(this.es)}function vM(i){var t,e,n=i.x,r=i.y;if(n=rt(n-this.long0,this.over),this.sphere){if(!this.m)r=this.n!==1?Math.asin(this.n*Math.sin(r)):r;else for(var s=this.n*Math.sin(r),o=pM;o;--o){var a=(this.m*r+Math.sin(r)-s)/(this.m+Math.cos(r));if(r-=a,Math.abs(a)<et)break}t=this.a*this.C_x*n*(this.m+Math.cos(r)),e=this.a*this.C_y*r}else{var l=Math.sin(r),u=Math.cos(r);e=this.a*$l(r,l,u,this.en),t=this.a*n*u/Math.sqrt(1-this.es*l*l)}return i.x=t,i.y=e,i}function yM(i){var t,e,n,r;return i.x-=this.x0,n=i.x/this.a,i.y-=this.y0,t=i.y/this.a,this.sphere?(t/=this.C_y,n=n/(this.C_x*(this.m+Math.cos(t))),this.m?t=zo((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=zo(Math.sin(t)/this.n)),n=rt(n+this.long0,this.over),t=jo(t)):(t=mp(i.y/this.a,this.es,this.en),r=Math.abs(t),r<W?(r=Math.sin(t),e=this.long0+i.x*Math.sqrt(1-this.es*r*r)/(this.a*Math.cos(t)),n=rt(e,this.over)):r-et<W&&(n=this.long0)),i.x=n,i.y=t,i}var _M=["Sinusoidal","sinu"];const wM={init:mM,forward:vM,inverse:yM,names:_M};function EM(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0}function SM(i){for(var t=i.x,e=i.y,n=rt(t-this.long0,this.over),r=e,s=Math.PI*Math.sin(e);;){var o=-(r+Math.sin(r)-s)/(1+Math.cos(r));if(r+=o,Math.abs(o)<et)break}r/=2,Math.PI/2-Math.abs(e)<et&&(n=0);var a=.900316316158*this.a*n*Math.cos(r)+this.x0,l=1.4142135623731*this.a*Math.sin(r)+this.y0;return i.x=a,i.y=l,i}function bM(i){var t,e;i.x-=this.x0,i.y-=this.y0,e=i.y/(1.4142135623731*this.a),Math.abs(e)>.999999999999&&(e=.999999999999),t=Math.asin(e);var n=rt(this.long0+i.x/(.900316316158*this.a*Math.cos(t)),this.over);n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),e=(2*t+Math.sin(2*t))/Math.PI,Math.abs(e)>1&&(e=1);var r=Math.asin(e);return i.x=n,i.y=r,i}var CM=["Mollweide","moll"];const PM={init:EM,forward:SM,inverse:bM,names:CM};function xM(){Math.abs(this.lat1+this.lat2)<et||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=qh(this.es),this.e1=Wh(this.es),this.e2=Hh(this.es),this.e3=Xh(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=ws(this.e,this.sin_phi,this.cos_phi),this.ml1=rn(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<et?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=ws(this.e,this.sin_phi,this.cos_phi),this.ml2=rn(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=rn(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function IM(i){var t=i.x,e=i.y,n;if(this.sphere)n=this.a*(this.g-e);else{var r=rn(this.e0,this.e1,this.e2,this.e3,e);n=this.a*(this.g-r)}var s=this.ns*rt(t-this.long0,this.over),o=this.x0+n*Math.sin(s),a=this.y0+this.rh-n*Math.cos(s);return i.x=o,i.y=a,i}function MM(i){i.x-=this.x0,i.y=this.rh-i.y+this.y0;var t,e,n,r;this.ns>=0?(e=Math.sqrt(i.x*i.x+i.y*i.y),t=1):(e=-Math.sqrt(i.x*i.x+i.y*i.y),t=-1);var s=0;if(e!==0&&(s=Math.atan2(t*i.x,t*i.y)),this.sphere)return r=rt(this.long0+s/this.ns,this.over),n=jo(this.g-e/this.a),i.x=r,i.y=n,i;var o=this.g-e/this.a;return n=Gd(o,this.e0,this.e1,this.e2,this.e3),r=rt(this.long0+s/this.ns,this.over),i.x=r,i.y=n,i}var TM=["Equidistant_Conic","eqdc"];const NM={init:xM,forward:IM,inverse:MM,names:TM};function OM(){this.R=this.a}function DM(i){var t=i.x,e=i.y,n=rt(t-this.long0,this.over),r,s;Math.abs(e)<=et&&(r=this.x0+this.R*n,s=this.y0);var o=zo(2*Math.abs(e/Math.PI));(Math.abs(n)<=et||Math.abs(Math.abs(e)-W)<=et)&&(r=this.x0,e>=0?s=this.y0+Math.PI*this.R*Math.tan(.5*o):s=this.y0+Math.PI*this.R*-Math.tan(.5*o));var a=.5*Math.abs(Math.PI/n-n/Math.PI),l=a*a,u=Math.sin(o),h=Math.cos(o),c=h/(u+h-1),d=c*c,g=c*(2/u-1),p=g*g,E=Math.PI*this.R*(a*(c-p)+Math.sqrt(l*(c-p)*(c-p)-(p+l)*(d-p)))/(p+l);n<0&&(E=-E),r=this.x0+E;var b=l+c;return E=Math.PI*this.R*(g*b-a*Math.sqrt((p+l)*(l+1)-b*b))/(p+l),e>=0?s=this.y0+E:s=this.y0-E,i.x=r,i.y=s,i}function RM(i){var t,e,n,r,s,o,a,l,u,h,c,d,g;return i.x-=this.x0,i.y-=this.y0,c=Math.PI*this.R,n=i.x/c,r=i.y/c,s=n*n+r*r,o=-Math.abs(r)*(1+s),a=o-2*r*r+n*n,l=-2*o+1+2*r*r+s*s,g=r*r/l+(2*a*a*a/l/l/l-9*o*a/l/l)/27,u=(o-a*a/3/l)/l,h=2*Math.sqrt(-u/3),c=3*g/u/h,Math.abs(c)>1&&(c>=0?c=1:c=-1),d=Math.acos(c)/3,i.y>=0?e=(-h*Math.cos(d+Math.PI/3)-a/3/l)*Math.PI:e=-(-h*Math.cos(d+Math.PI/3)-a/3/l)*Math.PI,Math.abs(n)<et?t=this.long0:t=rt(this.long0+Math.PI*(s-1+Math.sqrt(1+2*(n*n-r*r)+s*s))/2/n,this.over),i.x=t,i.y=e,i}var AM=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const LM={init:OM,forward:DM,inverse:RM,names:AM};function FM(i,t,e,n,r,s){const o=n-t,a=Math.atan((1-s)*Math.tan(i)),l=Math.atan((1-s)*Math.tan(e)),u=Math.sin(a),h=Math.cos(a),c=Math.sin(l),d=Math.cos(l);let g=o,p,E=100,b,P,v,_,m,y,S,C,x,I,M,T,R,A;do{if(b=Math.sin(g),P=Math.cos(g),v=Math.sqrt(d*b*(d*b)+(h*c-u*d*P)*(h*c-u*d*P)),v===0)return{azi1:0,s12:0};_=u*c+h*d*P,m=Math.atan2(v,_),y=h*d*b/v,S=1-y*y,C=S!==0?_-2*u*c/S:0,x=s/16*S*(4+s*(4-3*S)),p=g,g=o+(1-x)*s*y*(m+x*v*(C+x*_*(-1+2*C*C)))}while(Math.abs(g-p)>1e-12&&--E>0);return E===0?{azi1:NaN,s12:NaN}:(I=S*(r*r-r*(1-s)*(r*(1-s)))/(r*(1-s)*(r*(1-s))),M=1+I/16384*(4096+I*(-768+I*(320-175*I))),T=I/1024*(256+I*(-128+I*(74-47*I))),R=T*v*(C+T/4*(_*(-1+2*C*C)-T/6*C*(-3+4*v*v)*(-3+4*C*C))),A=r*(1-s)*M*(m-R),{azi1:Math.atan2(d*b,h*c-u*d*P),s12:A})}function kM(i,t,e,n,r,s){const o=Math.atan((1-s)*Math.tan(i)),a=Math.sin(o),l=Math.cos(o),u=Math.sin(e),h=Math.cos(e),c=Math.atan2(a,l*h),d=l*u,g=1-d*d,p=g*(r*r-r*(1-s)*(r*(1-s)))/(r*(1-s)*(r*(1-s))),E=1+p/16384*(4096+p*(-768+p*(320-175*p))),b=p/1024*(256+p*(-128+p*(74-47*p)));let P=n/(r*(1-s)*E),v,_=100,m,y,S,C;do m=Math.cos(2*c+P),y=Math.sin(P),S=Math.cos(P),C=b*y*(m+b/4*(S*(-1+2*m*m)-b/6*m*(-3+4*y*y)*(-3+4*m*m))),v=P,P=n/(r*(1-s)*E)+C;while(Math.abs(P-v)>1e-12&&--_>0);if(_===0)return{lat2:NaN,lon2:NaN};const x=a*y-l*S*h,I=Math.atan2(a*S+l*y*h,(1-s)*Math.sqrt(d*d+x*x)),M=Math.atan2(y*u,l*S-a*y*h),T=s/16*g*(4+s*(4-3*g)),R=M-(1-T)*s*d*(P+T*y*(m+T*S*(-1+2*m*m))),A=t+R;return{lat2:I,lon2:A}}function GM(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function jM(i){var t=i.x,e=i.y,n=Math.sin(i.y),r=Math.cos(i.y),s=rt(t-this.long0,this.over),o,a,l,u,h,c,d,g,p,E,b;return this.sphere?Math.abs(this.sin_p12-1)<=et?(i.x=this.x0+this.a*(W-e)*Math.sin(s),i.y=this.y0-this.a*(W-e)*Math.cos(s),i):Math.abs(this.sin_p12+1)<=et?(i.x=this.x0+this.a*(W+e)*Math.sin(s),i.y=this.y0+this.a*(W+e)*Math.cos(s),i):(p=this.sin_p12*n+this.cos_p12*r*Math.cos(s),d=Math.acos(p),g=d?d/Math.sin(d):1,i.x=this.x0+this.a*g*r*Math.sin(s),i.y=this.y0+this.a*g*(this.cos_p12*n-this.sin_p12*r*Math.cos(s)),i):(o=qh(this.es),a=Wh(this.es),l=Hh(this.es),u=Xh(this.es),Math.abs(this.sin_p12-1)<=et?(h=this.a*rn(o,a,l,u,W),c=this.a*rn(o,a,l,u,e),i.x=this.x0+(h-c)*Math.sin(s),i.y=this.y0-(h-c)*Math.cos(s),i):Math.abs(this.sin_p12+1)<=et?(h=this.a*rn(o,a,l,u,W),c=this.a*rn(o,a,l,u,e),i.x=this.x0+(h+c)*Math.sin(s),i.y=this.y0+(h+c)*Math.cos(s),i):Math.abs(t)<et&&Math.abs(e-this.lat0)<et?(i.x=i.y=0,i):(E=FM(this.lat0,this.long0,e,t,this.a,this.f),b=E.azi1,i.x=E.s12*Math.sin(b),i.y=E.s12*Math.cos(b),i))}function VM(i){i.x-=this.x0,i.y-=this.y0;var t,e,n,r,s,o,a,l,u,h,c,d,g,p,E,b;return this.sphere?(t=Math.sqrt(i.x*i.x+i.y*i.y),t>2*W*this.a?void 0:(e=t/this.a,n=Math.sin(e),r=Math.cos(e),s=this.long0,Math.abs(t)<=et?o=this.lat0:(o=zo(r*this.sin_p12+i.y*n*this.cos_p12/t),a=Math.abs(this.lat0)-W,Math.abs(a)<=et?this.lat0>=0?s=rt(this.long0+Math.atan2(i.x,-i.y),this.over):s=rt(this.long0-Math.atan2(-i.x,i.y),this.over):s=rt(this.long0+Math.atan2(i.x*n,t*this.cos_p12*r-i.y*this.sin_p12*n),this.over)),i.x=s,i.y=o,i)):(l=qh(this.es),u=Wh(this.es),h=Hh(this.es),c=Xh(this.es),Math.abs(this.sin_p12-1)<=et?(d=this.a*rn(l,u,h,c,W),t=Math.sqrt(i.x*i.x+i.y*i.y),g=d-t,o=Gd(g/this.a,l,u,h,c),s=rt(this.long0+Math.atan2(i.x,-1*i.y),this.over),i.x=s,i.y=o,i):Math.abs(this.sin_p12+1)<=et?(d=this.a*rn(l,u,h,c,W),t=Math.sqrt(i.x*i.x+i.y*i.y),g=t-d,o=Gd(g/this.a,l,u,h,c),s=rt(this.long0+Math.atan2(i.x,i.y),this.over),i.x=s,i.y=o,i):(p=Math.atan2(i.x,i.y),E=Math.sqrt(i.x*i.x+i.y*i.y),b=kM(this.lat0,this.long0,p,E,this.a,this.f),i.x=b.lon2,i.y=b.lat2,i))}var zM=["Azimuthal_Equidistant","aeqd"];const BM={init:GM,forward:jM,inverse:VM,names:zM};function UM(){this.sin_p14=Math.sin(this.lat0||0),this.cos_p14=Math.cos(this.lat0||0)}function qM(i){var t,e,n,r,s,o,a,l,u=i.x,h=i.y;return n=rt(u-(this.long0||0),this.over),t=Math.sin(h),e=Math.cos(h),r=Math.cos(n),o=this.sin_p14*t+this.cos_p14*e*r,s=1,(o>0||Math.abs(o)<=et)&&(a=this.a*s*e*Math.sin(n),l=(this.y0||0)+this.a*s*(this.cos_p14*t-this.sin_p14*e*r)),i.x=a,i.y=l,i}function WM(i){var t,e,n,r,s,o,a,l,u;return i.x-=this.x0||0,i.y-=this.y0||0,t=Math.sqrt(i.x*i.x+i.y*i.y),e=zo(t/this.a),n=Math.sin(e),r=Math.cos(e),l=this.long0||0,u=this.lat0||0,o=l,Math.abs(t)<=et?(a=u,i.x=o,i.y=a,i):(a=zo(r*this.sin_p14+i.y*n*this.cos_p14/t),s=Math.abs(u)-W,Math.abs(s)<=et?(u>=0?o=rt(l+Math.atan2(i.x,-i.y),this.over):o=rt(l-Math.atan2(-i.x,i.y),this.over),i.x=o,i.y=a,i):(o=rt(l+Math.atan2(i.x*n,t*this.cos_p14*r-i.y*this.sin_p14*n),this.over),i.x=o,i.y=a,i))}var HM=["ortho"];const XM={init:UM,forward:qM,inverse:WM,names:HM};var Oe={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},le={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function $M(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=W-ae/2?this.face=Oe.TOP:this.lat0<=-(W-ae/2)?this.face=Oe.BOTTOM:Math.abs(this.long0)<=ae?this.face=Oe.FRONT:Math.abs(this.long0)<=W+ae?this.face=this.long0>0?Oe.RIGHT:Oe.LEFT:this.face=Oe.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function YM(i){var t={x:0,y:0},e,n,r,s,o,a,l={value:0};if(i.x-=this.long0,this.es!==0?e=Math.atan(this.one_minus_f_squared*Math.tan(i.y)):e=i.y,n=i.x,this.face===Oe.TOP)s=W-e,n>=ae&&n<=W+ae?(l.value=le.AREA_0,r=n-W):n>W+ae||n<=-(W+ae)?(l.value=le.AREA_1,r=n>0?n-He:n+He):n>-(W+ae)&&n<=-ae?(l.value=le.AREA_2,r=n+W):(l.value=le.AREA_3,r=n);else if(this.face===Oe.BOTTOM)s=W+e,n>=ae&&n<=W+ae?(l.value=le.AREA_0,r=-n+W):n<ae&&n>=-ae?(l.value=le.AREA_1,r=-n):n<-ae&&n>=-(W+ae)?(l.value=le.AREA_2,r=-n-W):(l.value=le.AREA_3,r=n>0?-n+He:-n-He);else{var u,h,c,d,g,p,E;this.face===Oe.RIGHT?n=Jl(n,+W):this.face===Oe.BACK?n=Jl(n,+He):this.face===Oe.LEFT&&(n=Jl(n,-W)),d=Math.sin(e),g=Math.cos(e),p=Math.sin(n),E=Math.cos(n),u=g*E,h=g*p,c=d,this.face===Oe.FRONT?(s=Math.acos(u),r=Vd(s,c,h,l)):this.face===Oe.RIGHT?(s=Math.acos(h),r=Vd(s,c,-u,l)):this.face===Oe.BACK?(s=Math.acos(-u),r=Vd(s,c,-h,l)):this.face===Oe.LEFT?(s=Math.acos(-h),r=Vd(s,c,u,l)):(s=r=0,l.value=le.AREA_0)}return a=Math.atan(12/He*(r+Math.acos(Math.sin(r)*Math.cos(ae))-W)),o=Math.sqrt((1-Math.cos(s))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(r))))),l.value===le.AREA_1?a+=W:l.value===le.AREA_2?a+=He:l.value===le.AREA_3&&(a+=1.5*He),t.x=o*Math.cos(a),t.y=o*Math.sin(a),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,i.x=t.x,i.y=t.y,i}function JM(i){var t={lam:0,phi:0},e,n,r,s,o,a,l,u,h,c={value:0};if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,n=Math.atan(Math.sqrt(i.x*i.x+i.y*i.y)),e=Math.atan2(i.y,i.x),i.x>=0&&i.x>=Math.abs(i.y)?c.value=le.AREA_0:i.y>=0&&i.y>=Math.abs(i.x)?(c.value=le.AREA_1,e-=W):i.x<0&&-i.x>=Math.abs(i.y)?(c.value=le.AREA_2,e=e<0?e+He:e-He):(c.value=le.AREA_3,e+=W),h=He/12*Math.tan(e),o=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),a=Math.atan(o),r=Math.cos(e),s=Math.tan(n),l=1-r*r*s*s*(1-Math.cos(Math.atan(1/Math.cos(a)))),l<-1?l=-1:l>1&&(l=1),this.face===Oe.TOP)u=Math.acos(l),t.phi=W-u,c.value===le.AREA_0?t.lam=a+W:c.value===le.AREA_1?t.lam=a<0?a+He:a-He:c.value===le.AREA_2?t.lam=a-W:t.lam=a;else if(this.face===Oe.BOTTOM)u=Math.acos(l),t.phi=u-W,c.value===le.AREA_0?t.lam=-a+W:c.value===le.AREA_1?t.lam=-a:c.value===le.AREA_2?t.lam=-a-W:t.lam=a<0?-a-He:-a+He;else{var d,g,p;d=l,h=d*d,h>=1?p=0:p=Math.sqrt(1-h)*Math.sin(a),h+=p*p,h>=1?g=0:g=Math.sqrt(1-h),c.value===le.AREA_1?(h=g,g=-p,p=h):c.value===le.AREA_2?(g=-g,p=-p):c.value===le.AREA_3&&(h=g,g=p,p=-h),this.face===Oe.RIGHT?(h=d,d=-g,g=h):this.face===Oe.BACK?(d=-d,g=-g):this.face===Oe.LEFT&&(h=d,d=g,g=-h),t.phi=Math.acos(-p)-W,t.lam=Math.atan2(g,d),this.face===Oe.RIGHT?t.lam=Jl(t.lam,-W):this.face===Oe.BACK?t.lam=Jl(t.lam,-He):this.face===Oe.LEFT&&(t.lam=Jl(t.lam,+W))}if(this.es!==0){var E,b,P;E=t.phi<0?1:0,b=Math.tan(t.phi),P=this.b/Math.sqrt(b*b+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-P*P)/(this.one_minus_f*P)),E&&(t.phi=-t.phi)}return t.lam+=this.long0,i.x=t.lam,i.y=t.phi,i}function Vd(i,t,e,n){var r;return i<et?(n.value=le.AREA_0,r=0):(r=Math.atan2(t,e),Math.abs(r)<=ae?n.value=le.AREA_0:r>ae&&r<=W+ae?(n.value=le.AREA_1,r-=W):r>W+ae||r<=-(W+ae)?(n.value=le.AREA_2,r=r>=0?r-He:r+He):(n.value=le.AREA_3,r+=W)),r}function Jl(i,t){var e=i+t;return e<-He?e+=Gh:e>+He&&(e-=Gh),e}var ZM=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const KM={init:$M,forward:YM,inverse:JM,names:ZM};var Pp=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],$h=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],M_=.8487,T_=1.3523,N_=_n/5,QM=1/N_,Zl=18,zd=function(i,t){return i[0]+t*(i[1]+t*(i[2]+t*i[3]))},t2=function(i,t){return i[1]+t*(2*i[2]+t*3*i[3])};function e2(i,t,e,n){for(var r=t;n;--n){var s=i(r);if(r-=s,Math.abs(s)<e)break}return r}function i2(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function n2(i){var t=rt(i.x-this.long0,this.over),e=Math.abs(i.y),n=Math.floor(e*N_);n<0?n=0:n>=Zl&&(n=Zl-1),e=_n*(e-QM*n);var r={x:zd(Pp[n],e)*t,y:zd($h[n],e)};return i.y<0&&(r.y=-r.y),r.x=r.x*this.a*M_+this.x0,r.y=r.y*this.a*T_+this.y0,r}function r2(i){var t={x:(i.x-this.x0)/(this.a*M_),y:Math.abs(i.y-this.y0)/(this.a*T_)};if(t.y>=1)t.x/=Pp[Zl][0],t.y=i.y<0?-W:W;else{var e=Math.floor(t.y*Zl);for(e<0?e=0:e>=Zl&&(e=Zl-1);;)if($h[e][0]>t.y)--e;else if($h[e+1][0]<=t.y)++e;else break;var n=$h[e],r=5*(t.y-n[0])/($h[e+1][0]-n[0]);r=e2(function(s){return(zd(n,s)-t.y)/t2(n,s)},r,et,100),t.x/=zd(Pp[e],r),t.y=(5*e+r)*ze,i.y<0&&(t.y=-t.y)}return t.x=rt(t.x+this.long0,this.over),t}var s2=["Robinson","robin"];const o2={init:i2,forward:n2,inverse:r2,names:s2};function a2(){this.name="geocent"}function l2(i){var t=o_(i,this.es,this.a);return t}function u2(i){var t=a_(i,this.es,this.a,this.b);return t}var h2=["Geocentric","geocentric","geocent","Geocent"];const c2={init:a2,forward:l2,inverse:u2,names:h2};var Vi={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Yh={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function d2(){if(Object.keys(Yh).forEach((function(e){if(typeof this[e]>"u")this[e]=Yh[e].def;else{if(Yh[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);Yh[e].num&&(this[e]=parseFloat(this[e]))}Yh[e].degrees&&(this[e]=this[e]*ze)}).bind(this)),Math.abs(Math.abs(this.lat0)-W)<et?this.mode=this.lat0<0?Vi.S_POLE:Vi.N_POLE:Math.abs(this.lat0)<et?this.mode=Vi.EQUIT:(this.mode=Vi.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var i=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(i),this.sw=Math.sin(i)}function f2(i){i.x-=this.long0;var t=Math.sin(i.y),e=Math.cos(i.y),n=Math.cos(i.x),r,s;switch(this.mode){case Vi.OBLIQ:s=this.sinph0*t+this.cosph0*e*n;break;case Vi.EQUIT:s=e*n;break;case Vi.S_POLE:s=-t;break;case Vi.N_POLE:s=t;break}switch(s=this.pn1/(this.p-s),r=s*e*Math.sin(i.x),this.mode){case Vi.OBLIQ:s*=this.cosph0*t-this.sinph0*e*n;break;case Vi.EQUIT:s*=t;break;case Vi.N_POLE:s*=-(e*n);break;case Vi.S_POLE:s*=e*n;break}var o,a;return o=s*this.cg+r*this.sg,a=1/(o*this.sw*this.h1+this.cw),r=(r*this.cg-s*this.sg)*this.cw*a,s=o*a,i.x=r*this.a,i.y=s*this.a,i}function g2(i){i.x/=this.a,i.y/=this.a;var t={x:i.x,y:i.y},e,n,r;r=1/(this.pn1-i.y*this.sw),e=this.pn1*i.x*r,n=this.pn1*i.y*this.cw*r,i.x=e*this.cg+n*this.sg,i.y=n*this.cg-e*this.sg;var s=Sn(i.x,i.y);if(Math.abs(s)<et)t.x=0,t.y=i.y;else{var o,a;switch(a=1-s*s*this.pfact,a=(this.p-Math.sqrt(a))/(this.pn1/s+s/this.pn1),o=Math.sqrt(1-a*a),this.mode){case Vi.OBLIQ:t.y=Math.asin(o*this.sinph0+i.y*a*this.cosph0/s),i.y=(o-this.sinph0*Math.sin(t.y))*s,i.x*=a*this.cosph0;break;case Vi.EQUIT:t.y=Math.asin(i.y*a/s),i.y=o*s,i.x*=a;break;case Vi.N_POLE:t.y=Math.asin(o),i.y=-i.y;break;case Vi.S_POLE:t.y=-Math.asin(o);break}t.x=Math.atan2(i.x,i.y)}return i.x=t.x+this.long0,i.y=t.y,i}var p2=["Tilted_Perspective","tpers"];const m2={init:d2,forward:f2,inverse:g2,names:p2};function v2(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var i=1-this.es,t=1/i;this.radius_p=Math.sqrt(i),this.radius_p2=i,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function y2(i){var t=i.x,e=i.y,n,r,s,o;if(t=t-this.long0,this.shape==="ellipse"){e=Math.atan(this.radius_p2*Math.tan(e));var a=this.radius_p/Sn(this.radius_p*Math.cos(e),Math.sin(e));if(r=a*Math.cos(t)*Math.cos(e),s=a*Math.sin(t)*Math.cos(e),o=a*Math.sin(e),(this.radius_g-r)*r-s*s-o*o*this.radius_p_inv2<0)return i.x=Number.NaN,i.y=Number.NaN,i;n=this.radius_g-r,this.flip_axis?(i.x=this.radius_g_1*Math.atan(s/Sn(o,n)),i.y=this.radius_g_1*Math.atan(o/n)):(i.x=this.radius_g_1*Math.atan(s/n),i.y=this.radius_g_1*Math.atan(o/Sn(s,n)))}else this.shape==="sphere"&&(n=Math.cos(e),r=Math.cos(t)*n,s=Math.sin(t)*n,o=Math.sin(e),n=this.radius_g-r,this.flip_axis?(i.x=this.radius_g_1*Math.atan(s/Sn(o,n)),i.y=this.radius_g_1*Math.atan(o/n)):(i.x=this.radius_g_1*Math.atan(s/n),i.y=this.radius_g_1*Math.atan(o/Sn(s,n))));return i.x=i.x*this.a,i.y=i.y*this.a,i}function _2(i){var t=-1,e=0,n=0,r,s,o,a;if(i.x=i.x/this.a,i.y=i.y/this.a,this.shape==="ellipse"){this.flip_axis?(n=Math.tan(i.y/this.radius_g_1),e=Math.tan(i.x/this.radius_g_1)*Sn(1,n)):(e=Math.tan(i.x/this.radius_g_1),n=Math.tan(i.y/this.radius_g_1)*Sn(1,e));var l=n/this.radius_p;if(r=e*e+l*l+t*t,s=2*this.radius_g*t,o=s*s-4*r*this.C,o<0)return i.x=Number.NaN,i.y=Number.NaN,i;a=(-s-Math.sqrt(o))/(2*r),t=this.radius_g+a*t,e*=a,n*=a,i.x=Math.atan2(e,t),i.y=Math.atan(n*Math.cos(i.x)/t),i.y=Math.atan(this.radius_p_inv2*Math.tan(i.y))}else if(this.shape==="sphere"){if(this.flip_axis?(n=Math.tan(i.y/this.radius_g_1),e=Math.tan(i.x/this.radius_g_1)*Math.sqrt(1+n*n)):(e=Math.tan(i.x/this.radius_g_1),n=Math.tan(i.y/this.radius_g_1)*Math.sqrt(1+e*e)),r=e*e+n*n+t*t,s=2*this.radius_g*t,o=s*s-4*r*this.C,o<0)return i.x=Number.NaN,i.y=Number.NaN,i;a=(-s-Math.sqrt(o))/(2*r),t=this.radius_g+a*t,e*=a,n*=a,i.x=Math.atan2(e,t),i.y=Math.atan(n*Math.cos(i.x)/t)}return i.x=i.x+this.long0,i}var w2=["Geostationary Satellite View","Geostationary_Satellite","geos"];const E2={init:v2,forward:y2,inverse:_2,names:w2};var Jh=1.340264,Zh=-.081106,Kh=893e-6,Qh=.003796,Bd=Math.sqrt(3)/2;function S2(){this.es=0,this.long0=this.long0!==void 0?this.long0:0,this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0}function b2(i){var t=rt(i.x-this.long0,this.over),e=i.y,n=Math.asin(Bd*Math.sin(e)),r=n*n,s=r*r*r;return i.x=t*Math.cos(n)/(Bd*(Jh+3*Zh*r+s*(7*Kh+9*Qh*r))),i.y=n*(Jh+Zh*r+s*(Kh+Qh*r)),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function C2(i){i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a;var t=1e-9,e=12,n=i.y,r,s,o,a,l,u;for(u=0;u<e&&(r=n*n,s=r*r*r,o=n*(Jh+Zh*r+s*(Kh+Qh*r))-i.y,a=Jh+3*Zh*r+s*(7*Kh+9*Qh*r),n-=l=o/a,!(Math.abs(l)<t));++u);return r=n*n,s=r*r*r,i.x=Bd*i.x*(Jh+3*Zh*r+s*(7*Kh+9*Qh*r))/Math.cos(n),i.y=Math.asin(Math.sin(n)/Bd),i.x=rt(i.x+this.long0,this.over),i}var P2=["eqearth","Equal Earth","Equal_Earth"];const x2={init:S2,forward:b2,inverse:C2,names:P2};var tc=1e-10;function I2(){var i;if(this.phi1=this.lat1,Math.abs(this.phi1)<tc)throw new Error;this.es?(this.en=pp(this.es),this.m1=$l(this.phi1,this.am1=Math.sin(this.phi1),i=Math.cos(this.phi1),this.en),this.am1=i/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=T2,this.forward=M2):(Math.abs(this.phi1)+tc>=W?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=O2,this.forward=N2)}function M2(i){var t=rt(i.x-(this.long0||0),this.over),e=i.y,n,r,s;return n=this.am1+this.m1-$l(e,r=Math.sin(e),s=Math.cos(e),this.en),r=s*t/(n*Math.sqrt(1-this.es*r*r)),i.x=n*Math.sin(r),i.y=this.am1-n*Math.cos(r),i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function T2(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var t,e,n,r;if(e=Sn(i.x,i.y=this.am1-i.y),r=mp(this.am1+this.m1-e,this.es,this.en),(t=Math.abs(r))<W)t=Math.sin(r),n=e*Math.atan2(i.x,i.y)*Math.sqrt(1-this.es*t*t)/Math.cos(r);else if(Math.abs(t-W)<=tc)n=0;else throw new Error;return i.x=rt(n+(this.long0||0),this.over),i.y=jo(r),i}function N2(i){var t=rt(i.x-(this.long0||0),this.over),e=i.y,n,r;return r=this.cphi1+this.phi1-e,Math.abs(r)>tc?(i.x=r*Math.sin(n=t*Math.cos(e)/r),i.y=this.cphi1-r*Math.cos(n)):i.x=i.y=0,i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function O2(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var t,e,n=Sn(i.x,i.y=this.cphi1-i.y);if(e=this.cphi1+this.phi1-n,Math.abs(e)>W)throw new Error;return Math.abs(Math.abs(e)-W)<=tc?t=0:t=n*Math.atan2(i.x,i.y)/Math.cos(e),i.x=rt(t+(this.long0||0),this.over),i.y=jo(e),i}var D2=["bonne","Bonne (Werner lat_1=90)"];const R2={init:I2,names:D2},O_={OBLIQUE:{forward:G2,inverse:V2},TRANSVERSE:{forward:j2,inverse:z2}},Ud={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};function A2(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=e_.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if(this.o_proj==="ob_tran")throw new Error("Invalid value for o_proj: "+this.o_proj);const i=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),t=or(i);if(!t)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);t.long0=0,this.obliqueProjection=t;let e;const n=Object.keys(Ud),r=a=>{if(typeof this[a]>"u")return;const l=parseFloat(this[a])*ze;if(isNaN(l))throw new Error("Invalid value for "+a+": "+this[a]);return l};for(let a=0;a<n.length;a++){const l=n[a],u=Ud[l],h=Object.entries(u);if(h.some(([d])=>typeof this[d]<"u")){e=u;for(let d=0;d<h.length;d++){const[g,p]=h[d],E=r(g);if(typeof E>"u")throw new Error("Missing parameter: "+g+".");this[p]=E}break}}if(!e)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:s,phip:o}=k2(this,e);this.lamp=s,Math.abs(o)>et?(this.cphip=Math.cos(o),this.sphip=Math.sin(o),this.projectionType=O_.OBLIQUE):this.projectionType=O_.TRANSVERSE}function L2(i){return this.projectionType.forward(this,i)}function F2(i){return this.projectionType.inverse(this,i)}function k2(i,t){let e,n;if(t===Ud.ROTATE){let r=i.oLongC,s=i.oLatC,o=i.oAlpha;if(Math.abs(Math.abs(s)-W)<=et)throw new Error("Invalid value for o_lat_c: "+i.o_lat_c+" should be < 90°");n=r+Math.atan2(-1*Math.cos(o),-1*Math.sin(o)*Math.sin(s)),e=Math.asin(Math.cos(s)*Math.sin(o))}else if(t===Ud.NEW_POLE)n=i.oLongP,e=i.oLatP;else{let r=i.oLong1,s=i.oLat1,o=i.oLong2,a=i.oLat2,l=Math.abs(s);if(Math.abs(s)>W-et)throw new Error("Invalid value for o_lat_1: "+i.o_lat_1+" should be < 90°");if(Math.abs(a)>W-et)throw new Error("Invalid value for o_lat_2: "+i.o_lat_2+" should be < 90°");if(Math.abs(s-a)<et)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(l<et)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");n=Math.atan2(Math.cos(s)*Math.sin(a)*Math.cos(r)-Math.sin(s)*Math.cos(a)*Math.cos(o),Math.sin(s)*Math.cos(a)*Math.sin(o)-Math.cos(s)*Math.sin(a)*Math.sin(r)),e=Math.atan(-1*Math.cos(n-r)/Math.tan(s))}return{lamp:n,phip:e}}function G2(i,t){let{x:e,y:n}=t;e+=i.long0;const r=Math.cos(e),s=Math.sin(n),o=Math.cos(n);t.x=rt(Math.atan2(o*Math.sin(e),i.sphip*o*r+i.cphip*s)+i.lamp),t.y=Math.asin(i.sphip*s-i.cphip*o*r);const a=i.obliqueProjection.forward(t);return i.isIdentity&&(a.x*=_n,a.y*=_n),a}function j2(i,t){let{x:e,y:n}=t;e+=i.long0;const r=Math.cos(n),s=Math.cos(e);t.x=rt(Math.atan2(r*Math.sin(e),Math.sin(n))+i.lamp),t.y=Math.asin(-1*r*s);const o=i.obliqueProjection.forward(t);return i.isIdentity&&(o.x*=_n,o.y*=_n),o}function V2(i,t){i.isIdentity&&(t.x*=ze,t.y*=ze);const e=i.obliqueProjection.inverse(t);let{x:n,y:r}=e;if(n<Number.MAX_VALUE){n-=i.lamp;const s=Math.cos(n),o=Math.sin(r),a=Math.cos(r);t.x=Math.atan2(a*Math.sin(n),i.sphip*a*s-i.cphip*o),t.y=Math.asin(i.sphip*o+i.cphip*a*s)}return t.x=rt(t.x+i.long0),t}function z2(i,t){i.isIdentity&&(t.x*=ze,t.y*=ze);const e=i.obliqueProjection.inverse(t);let{x:n,y:r}=e;if(n<Number.MAX_VALUE){const s=Math.cos(r);n-=i.lamp,t.x=Math.atan2(s*Math.sin(n),-1*Math.sin(r)),t.y=Math.asin(s*Math.cos(n))}return t.x=rt(t.x+i.long0),t}var B2=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"];const U2={init:A2,forward:L2,inverse:F2,names:B2};function q2(i){i.Proj.projections.add(Fd),i.Proj.projections.add(kd),i.Proj.projections.add(Dx),i.Proj.projections.add(zx),i.Proj.projections.add(Hx),i.Proj.projections.add(Zx),i.Proj.projections.add(nI),i.Proj.projections.add(lI),i.Proj.projections.add(fI),i.Proj.projections.add(yI),i.Proj.projections.add(OI),i.Proj.projections.add(kI),i.Proj.projections.add(BI),i.Proj.projections.add($I),i.Proj.projections.add(QI),i.Proj.projections.add(rM),i.Proj.projections.add(uM),i.Proj.projections.add(gM),i.Proj.projections.add(wM),i.Proj.projections.add(PM),i.Proj.projections.add(NM),i.Proj.projections.add(LM),i.Proj.projections.add(BM),i.Proj.projections.add(XM),i.Proj.projections.add(KM),i.Proj.projections.add(o2),i.Proj.projections.add(c2),i.Proj.projections.add(m2),i.Proj.projections.add(E2),i.Proj.projections.add(x2),i.Proj.projections.add(R2),i.Proj.projections.add(U2)}const xp=Object.assign(YP,{defaultDatum:"WGS84",Proj:or,WGS84:new or("WGS84"),Point:Xl,toPoint:c_,defs:Ti,nadgrid:OP,transform:Ad,mgrs:JP,version:"__VERSION__"});q2(xp);const D_=xp("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=geocent +datum=WGS84");function jr(i){return D_.forward(i)}function Ip(i){return D_.inverse(i)}const R_=xp("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs");function W2(i){const t=R_.forward([i[0],i[1]]);return[t[0],t[1],i[2]]}function H2(i){const t=R_.inverse([i[0],i[1]]);return[t[0],t[1],i[2]]}var Ni=63710088e-1,A_={centimeters:Ni*100,centimetres:Ni*100,degrees:Ni/111325,feet:Ni*3.28084,inches:Ni*39.37,kilometers:Ni/1e3,kilometres:Ni/1e3,meters:Ni,metres:Ni,miles:Ni/1609.344,millimeters:Ni*1e3,millimetres:Ni*1e3,nauticalmiles:Ni/1852,radians:1,yards:Ni*1.0936};function lr(i,t,e){e===void 0&&(e={});var n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=t||{},n.geometry=i,n}function Kt(i,t,e){if(e===void 0&&(e={}),!i)throw new Error("coordinates is required");if(!Array.isArray(i))throw new Error("coordinates must be an Array");if(i.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!L_(i[0])||!L_(i[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:i};return lr(n,t,e)}function ue(i,t,e){e===void 0&&(e={});for(var n=0,r=i;n<r.length;n++){var s=r[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<s[s.length-1].length;o++)if(s[s.length-1][o]!==s[0][o])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:i};return lr(a,t,e)}function yi(i,t,e){if(e===void 0&&(e={}),i.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:i};return lr(n,t,e)}function Fn(i,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=i,e}function X2(i,t,e){e===void 0&&(e={});var n={type:"MultiLineString",coordinates:i};return lr(n,t,e)}function Mp(i,t,e){e===void 0&&(e={});var n={type:"MultiPolygon",coordinates:i};return lr(n,t,e)}function Tp(i,t){t===void 0&&(t="kilometers");var e=A_[t];if(!e)throw new Error(t+" units is invalid");return i*e}function Np(i,t){t===void 0&&(t="kilometers");var e=A_[t];if(!e)throw new Error(t+" units is invalid");return i/e}function qd(i){var t=i%(2*Math.PI);return t*180/Math.PI}function zi(i){var t=i%360;return t*Math.PI/180}function Op(i,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(i>=0))throw new Error("length must be a positive number");return Tp(Np(i,t),e)}function L_(i){return!isNaN(i)&&i!==null&&!Array.isArray(i)}function Kl(i,t,e){if(i!==null)for(var n,r,s,o,a,l,u,h=0,c=0,d,g=i.type,p=g==="FeatureCollection",E=g==="Feature",b=p?i.features.length:1,P=0;P<b;P++){u=p?i.features[P].geometry:E?i.geometry:i,d=u?u.type==="GeometryCollection":!1,a=d?u.geometries.length:1;for(var v=0;v<a;v++){var _=0,m=0;if(o=d?u.geometries[v]:u,o!==null){l=o.coordinates;var y=o.type;switch(h=e&&(y==="Polygon"||y==="MultiPolygon")?1:0,y){case null:break;case"Point":if(t(l,c,P,_,m)===!1)return!1;c++,_++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(t(l[n],c,P,_,m)===!1)return!1;c++,y==="MultiPoint"&&_++}y==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(r=0;r<l[n].length-h;r++){if(t(l[n][r],c,P,_,m)===!1)return!1;c++}y==="MultiLineString"&&_++,y==="Polygon"&&m++}y==="Polygon"&&_++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(m=0,r=0;r<l[n].length;r++){for(s=0;s<l[n][r].length-h;s++){if(t(l[n][r][s],c,P,_,m)===!1)return!1;c++}m++}_++}break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(Kl(o.geometries[n],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ql(i,t){if(i.type==="Feature")t(i,0);else if(i.type==="FeatureCollection")for(var e=0;e<i.features.length&&t(i.features[e],e)!==!1;e++);}function Wd(i,t){var e,n,r,s,o,a,l,u,h,c,d=0,g=i.type==="FeatureCollection",p=i.type==="Feature",E=g?i.features.length:1;for(e=0;e<E;e++){for(a=g?i.features[e].geometry:p?i.geometry:i,u=g?i.features[e].properties:p?i.properties:{},h=g?i.features[e].bbox:p?i.bbox:void 0,c=g?i.features[e].id:p?i.id:void 0,l=a?a.type==="GeometryCollection":!1,o=l?a.geometries.length:1,r=0;r<o;r++){if(s=l?a.geometries[r]:a,s===null){if(t(null,d,u,h,c)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(s,d,u,h,c)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(t(s.geometries[n],d,u,h,c)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}d++}}function $2(i,t,e){var n=e;return Wd(i,function(r,s,o,a,l){n=t(n,r,s,o,a,l)}),n}function La(i,t){Wd(i,function(e,n,r,s,o){var a=e===null?null:e.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return t(lr(e,r,{bbox:s,id:o}),n,0)===!1?!1:void 0}var l;switch(a){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var h=e.coordinates[u],c={type:l,coordinates:h};if(t(lr(c,r),n,u)===!1)return!1}})}function F_(i,t){La(i,function(e,n,r){var s=0;if(e.geometry){var o=e.geometry.type;if(!(o==="Point"||o==="MultiPoint")){var a,l=0,u=0,h=0;if(Kl(e,function(c,d,g,p,E){if(a===void 0||n>l||p>u||E>h){a=c,l=n,u=p,h=E,s=0;return}var b=yi([a,c],e.properties);if(t(b,n,r,E,s)===!1)return!1;s++,a=c})===!1)return!1}}})}function Y2(i,t,e){var n=e,r=!1;return F_(i,function(s,o,a,l,u){r===!1&&e===void 0?n=s:n=t(n,s,o,a,l,u),r=!0}),n}function ur(i){var t=[1/0,1/0,-1/0,-1/0];return Kl(i,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}ur.default=ur;function sn(i){if(!i)throw new Error("coord is required");if(!Array.isArray(i)){if(i.type==="Feature"&&i.geometry!==null&&i.geometry.type==="Point")return i.geometry.coordinates;if(i.type==="Point")return i.coordinates}if(Array.isArray(i)&&i.length>=2&&!Array.isArray(i[0])&&!Array.isArray(i[1]))return i;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function kn(i){if(Array.isArray(i))return i;if(i.type==="Feature"){if(i.geometry!==null)return i.geometry.coordinates}else if(i.coordinates)return i.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function k_(i,t,e){if(!i)throw new Error("No feature passed");if(!e)throw new Error(".featureOf() requires a name");if(!i||i.type!=="Feature"||!i.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!i.geometry||i.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+i.geometry.type)}function J2(i,t,e){if(!i)throw new Error("No featureCollection passed");if(!i||i.type!=="FeatureCollection")throw new Error("Invalid input to "+e+", FeatureCollection required");for(var n=0,r=i.features;n<r.length;n++){var s=r[n];if(!s||s.type!=="Feature"||!s.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!s.geometry||s.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+s.geometry.type)}}function Bi(i){return i.type==="Feature"?i.geometry:i}function Z2(i,t){return i.type==="FeatureCollection"?"FeatureCollection":i.type==="GeometryCollection"?"GeometryCollection":i.type==="Feature"&&i.geometry!==null?i.geometry.type:i.type}var Hd={exports:{}},Xd={exports:{}},K2=Xd.exports,G_;function j_(){return G_||(G_=1,(function(i,t){(function(e,n){i.exports=n()})(K2,function(){function e(v,_,m,y,S){(function C(x,I,M,T,R){for(;T>M;){if(T-M>600){var A=T-M+1,N=I-M+1,V=Math.log(A),G=.5*Math.exp(2*V/3),q=.5*Math.sqrt(V*G*(A-G)/A)*(N-A/2<0?-1:1),at=Math.max(M,Math.floor(I-N*G/A+q)),dt=Math.min(T,Math.floor(I+(A-N)*G/A+q));C(x,I,at,dt,R)}var Q=x[I],K=M,it=T;for(n(x,M,I),R(x[T],Q)>0&&n(x,M,T);K<it;){for(n(x,K,it),K++,it--;R(x[K],Q)<0;)K++;for(;R(x[it],Q)>0;)it--}R(x[M],Q)===0?n(x,M,it):n(x,++it,T),it<=I&&(M=it+1),I<=it&&(T=it-1)}})(v,_,m||0,y||v.length-1,S||r)}function n(v,_,m){var y=v[_];v[_]=v[m],v[m]=y}function r(v,_){return v<_?-1:v>_?1:0}var s=function(v){v===void 0&&(v=9),this._maxEntries=Math.max(4,v),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(v,_,m){if(!m)return _.indexOf(v);for(var y=0;y<_.length;y++)if(m(v,_[y]))return y;return-1}function a(v,_){l(v,0,v.children.length,_,v)}function l(v,_,m,y,S){S||(S=b(null)),S.minX=1/0,S.minY=1/0,S.maxX=-1/0,S.maxY=-1/0;for(var C=_;C<m;C++){var x=v.children[C];u(S,v.leaf?y(x):x)}return S}function u(v,_){return v.minX=Math.min(v.minX,_.minX),v.minY=Math.min(v.minY,_.minY),v.maxX=Math.max(v.maxX,_.maxX),v.maxY=Math.max(v.maxY,_.maxY),v}function h(v,_){return v.minX-_.minX}function c(v,_){return v.minY-_.minY}function d(v){return(v.maxX-v.minX)*(v.maxY-v.minY)}function g(v){return v.maxX-v.minX+(v.maxY-v.minY)}function p(v,_){return v.minX<=_.minX&&v.minY<=_.minY&&_.maxX<=v.maxX&&_.maxY<=v.maxY}function E(v,_){return _.minX<=v.maxX&&_.minY<=v.maxY&&_.maxX>=v.minX&&_.maxY>=v.minY}function b(v){return{children:v,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function P(v,_,m,y,S){for(var C=[_,m];C.length;)if(!((m=C.pop())-(_=C.pop())<=y)){var x=_+Math.ceil((m-_)/y/2)*y;e(v,x,_,m,S),C.push(_,x,x,m)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(v){var _=this.data,m=[];if(!E(v,_))return m;for(var y=this.toBBox,S=[];_;){for(var C=0;C<_.children.length;C++){var x=_.children[C],I=_.leaf?y(x):x;E(v,I)&&(_.leaf?m.push(x):p(v,I)?this._all(x,m):S.push(x))}_=S.pop()}return m},s.prototype.collides=function(v){var _=this.data;if(!E(v,_))return!1;for(var m=[];_;){for(var y=0;y<_.children.length;y++){var S=_.children[y],C=_.leaf?this.toBBox(S):S;if(E(v,C)){if(_.leaf||p(v,C))return!0;m.push(S)}}_=m.pop()}return!1},s.prototype.load=function(v){if(!v||!v.length)return this;if(v.length<this._minEntries){for(var _=0;_<v.length;_++)this.insert(v[_]);return this}var m=this._build(v.slice(),0,v.length-1,0);if(this.data.children.length)if(this.data.height===m.height)this._splitRoot(this.data,m);else{if(this.data.height<m.height){var y=this.data;this.data=m,m=y}this._insert(m,this.data.height-m.height-1,!0)}else this.data=m;return this},s.prototype.insert=function(v){return v&&this._insert(v,this.data.height-1),this},s.prototype.clear=function(){return this.data=b([]),this},s.prototype.remove=function(v,_){if(!v)return this;for(var m,y,S,C=this.data,x=this.toBBox(v),I=[],M=[];C||I.length;){if(C||(C=I.pop(),y=I[I.length-1],m=M.pop(),S=!0),C.leaf){var T=o(v,C.children,_);if(T!==-1)return C.children.splice(T,1),I.push(C),this._condense(I),this}S||C.leaf||!p(C,x)?y?(m++,C=y.children[m],S=!1):C=null:(I.push(C),M.push(m),m=0,y=C,C=C.children[0])}return this},s.prototype.toBBox=function(v){return v},s.prototype.compareMinX=function(v,_){return v.minX-_.minX},s.prototype.compareMinY=function(v,_){return v.minY-_.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(v){return this.data=v,this},s.prototype._all=function(v,_){for(var m=[];v;)v.leaf?_.push.apply(_,v.children):m.push.apply(m,v.children),v=m.pop();return _},s.prototype._build=function(v,_,m,y){var S,C=m-_+1,x=this._maxEntries;if(C<=x)return a(S=b(v.slice(_,m+1)),this.toBBox),S;y||(y=Math.ceil(Math.log(C)/Math.log(x)),x=Math.ceil(C/Math.pow(x,y-1))),(S=b([])).leaf=!1,S.height=y;var I=Math.ceil(C/x),M=I*Math.ceil(Math.sqrt(x));P(v,_,m,M,this.compareMinX);for(var T=_;T<=m;T+=M){var R=Math.min(T+M-1,m);P(v,T,R,I,this.compareMinY);for(var A=T;A<=R;A+=I){var N=Math.min(A+I-1,R);S.children.push(this._build(v,A,N,y-1))}}return a(S,this.toBBox),S},s.prototype._chooseSubtree=function(v,_,m,y){for(;y.push(_),!_.leaf&&y.length-1!==m;){for(var S=1/0,C=1/0,x=void 0,I=0;I<_.children.length;I++){var M=_.children[I],T=d(M),R=(A=v,N=M,(Math.max(N.maxX,A.maxX)-Math.min(N.minX,A.minX))*(Math.max(N.maxY,A.maxY)-Math.min(N.minY,A.minY))-T);R<C?(C=R,S=T<S?T:S,x=M):R===C&&T<S&&(S=T,x=M)}_=x||_.children[0]}var A,N;return _},s.prototype._insert=function(v,_,m){var y=m?v:this.toBBox(v),S=[],C=this._chooseSubtree(y,this.data,_,S);for(C.children.push(v),u(C,y);_>=0&&S[_].children.length>this._maxEntries;)this._split(S,_),_--;this._adjustParentBBoxes(y,S,_)},s.prototype._split=function(v,_){var m=v[_],y=m.children.length,S=this._minEntries;this._chooseSplitAxis(m,S,y);var C=this._chooseSplitIndex(m,S,y),x=b(m.children.splice(C,m.children.length-C));x.height=m.height,x.leaf=m.leaf,a(m,this.toBBox),a(x,this.toBBox),_?v[_-1].children.push(x):this._splitRoot(m,x)},s.prototype._splitRoot=function(v,_){this.data=b([v,_]),this.data.height=v.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(v,_,m){for(var y,S,C,x,I,M,T,R=1/0,A=1/0,N=_;N<=m-_;N++){var V=l(v,0,N,this.toBBox),G=l(v,N,m,this.toBBox),q=(S=V,C=G,x=void 0,I=void 0,M=void 0,T=void 0,x=Math.max(S.minX,C.minX),I=Math.max(S.minY,C.minY),M=Math.min(S.maxX,C.maxX),T=Math.min(S.maxY,C.maxY),Math.max(0,M-x)*Math.max(0,T-I)),at=d(V)+d(G);q<R?(R=q,y=N,A=at<A?at:A):q===R&&at<A&&(A=at,y=N)}return y||m-_},s.prototype._chooseSplitAxis=function(v,_,m){var y=v.leaf?this.compareMinX:h,S=v.leaf?this.compareMinY:c;this._allDistMargin(v,_,m,y)<this._allDistMargin(v,_,m,S)&&v.children.sort(y)},s.prototype._allDistMargin=function(v,_,m,y){v.children.sort(y);for(var S=this.toBBox,C=l(v,0,_,S),x=l(v,m-_,m,S),I=g(C)+g(x),M=_;M<m-_;M++){var T=v.children[M];u(C,v.leaf?S(T):T),I+=g(C)}for(var R=m-_-1;R>=_;R--){var A=v.children[R];u(x,v.leaf?S(A):A),I+=g(x)}return I},s.prototype._adjustParentBBoxes=function(v,_,m){for(var y=m;y>=0;y--)u(_[y],v)},s.prototype._condense=function(v){for(var _=v.length-1,m=void 0;_>=0;_--)v[_].children.length===0?_>0?(m=v[_-1].children).splice(m.indexOf(v[_]),1):this.clear():a(v[_],this.toBBox)},s})})(Xd)),Xd.exports}class Q2{constructor(t=[],e=tT){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:n}=this,r=e[t];for(;t>0;){const s=t-1>>1,o=e[s];if(n(r,o)>=0)break;e[t]=o,t=s}e[t]=r}_down(t){const{data:e,compare:n}=this,r=this.length>>1,s=e[t];for(;t<r;){let o=(t<<1)+1,a=e[o];const l=o+1;if(l<this.length&&n(e[l],a)<0&&(o=l,a=e[l]),n(a,s)>=0)break;e[t]=a,t=o}e[t]=s}}function tT(i,t){return i<t?-1:i>t?1:0}const eT=rC(Object.freeze(Object.defineProperty({__proto__:null,default:Q2},Symbol.toStringTag,{value:"Module"})));var ec={exports:{}},Dp,V_;function iT(){return V_||(V_=1,Dp=function(t,e,n,r){var s=t[0],o=t[1],a=!1;n===void 0&&(n=0),r===void 0&&(r=e.length);for(var l=(r-n)/2,u=0,h=l-1;u<l;h=u++){var c=e[n+u*2+0],d=e[n+u*2+1],g=e[n+h*2+0],p=e[n+h*2+1],E=d>o!=p>o&&s<(g-c)*(o-d)/(p-d)+c;E&&(a=!a)}return a}),Dp}var Rp,z_;function nT(){return z_||(z_=1,Rp=function(t,e,n,r){var s=t[0],o=t[1],a=!1;n===void 0&&(n=0),r===void 0&&(r=e.length);for(var l=r-n,u=0,h=l-1;u<l;h=u++){var c=e[u+n][0],d=e[u+n][1],g=e[h+n][0],p=e[h+n][1],E=d>o!=p>o&&s<(g-c)*(o-d)/(p-d)+c;E&&(a=!a)}return a}),Rp}var B_;function rT(){if(B_)return ec.exports;B_=1;var i=iT(),t=nT();return ec.exports=function(n,r,s,o){return r.length>0&&Array.isArray(r[0])?t(n,r,s,o):i(n,r,s,o)},ec.exports.nested=t,ec.exports.flat=i,ec.exports}var ic={exports:{}},sT=ic.exports,U_;function oT(){return U_||(U_=1,(function(i,t){(function(e,n){n(t)})(sT,function(e){const r=33306690738754706e-32;function s(E,b,P,v,_){let m,y,S,C,x=b[0],I=v[0],M=0,T=0;I>x==I>-x?(m=x,x=b[++M]):(m=I,I=v[++T]);let R=0;if(M<E&&T<P)for(I>x==I>-x?(S=m-((y=x+m)-x),x=b[++M]):(S=m-((y=I+m)-I),I=v[++T]),m=y,S!==0&&(_[R++]=S);M<E&&T<P;)I>x==I>-x?(S=m-((y=m+x)-(C=y-m))+(x-C),x=b[++M]):(S=m-((y=m+I)-(C=y-m))+(I-C),I=v[++T]),m=y,S!==0&&(_[R++]=S);for(;M<E;)S=m-((y=m+x)-(C=y-m))+(x-C),x=b[++M],m=y,S!==0&&(_[R++]=S);for(;T<P;)S=m-((y=m+I)-(C=y-m))+(I-C),I=v[++T],m=y,S!==0&&(_[R++]=S);return m===0&&R!==0||(_[R++]=m),R}function o(E){return new Float64Array(E)}const a=33306690738754716e-32,l=22204460492503146e-32,u=11093356479670487e-47,h=o(4),c=o(8),d=o(12),g=o(16),p=o(4);e.orient2d=function(E,b,P,v,_,m){const y=(b-m)*(P-_),S=(E-_)*(v-m),C=y-S;if(y===0||S===0||y>0!=S>0)return C;const x=Math.abs(y+S);return Math.abs(C)>=a*x?C:-(function(I,M,T,R,A,N,V){let G,q,at,dt,Q,K,it,Ct,Ht,Vt,zt,ee,je,me,tn,en,U,$;const xt=I-A,$t=T-A,we=M-N,Ue=R-N;Q=(tn=(Ct=xt-(it=(K=134217729*xt)-(K-xt)))*(Vt=Ue-(Ht=(K=134217729*Ue)-(K-Ue)))-((me=xt*Ue)-it*Ht-Ct*Ht-it*Vt))-(zt=tn-(U=(Ct=we-(it=(K=134217729*we)-(K-we)))*(Vt=$t-(Ht=(K=134217729*$t)-(K-$t)))-((en=we*$t)-it*Ht-Ct*Ht-it*Vt))),h[0]=tn-(zt+Q)+(Q-U),Q=(je=me-((ee=me+zt)-(Q=ee-me))+(zt-Q))-(zt=je-en),h[1]=je-(zt+Q)+(Q-en),Q=($=ee+zt)-ee,h[2]=ee-($-Q)+(zt-Q),h[3]=$;let ba=(function(EA,NS){let OS=NS[0];for(let g0=1;g0<EA;g0++)OS+=NS[g0];return OS})(4,h),od=l*V;if(ba>=od||-ba>=od||(G=I-(xt+(Q=I-xt))+(Q-A),at=T-($t+(Q=T-$t))+(Q-A),q=M-(we+(Q=M-we))+(Q-N),dt=R-(Ue+(Q=R-Ue))+(Q-N),G===0&&q===0&&at===0&&dt===0)||(od=u*V+r*Math.abs(ba),(ba+=xt*dt+Ue*G-(we*at+$t*q))>=od||-ba>=od))return ba;Q=(tn=(Ct=G-(it=(K=134217729*G)-(K-G)))*(Vt=Ue-(Ht=(K=134217729*Ue)-(K-Ue)))-((me=G*Ue)-it*Ht-Ct*Ht-it*Vt))-(zt=tn-(U=(Ct=q-(it=(K=134217729*q)-(K-q)))*(Vt=$t-(Ht=(K=134217729*$t)-(K-$t)))-((en=q*$t)-it*Ht-Ct*Ht-it*Vt))),p[0]=tn-(zt+Q)+(Q-U),Q=(je=me-((ee=me+zt)-(Q=ee-me))+(zt-Q))-(zt=je-en),p[1]=je-(zt+Q)+(Q-en),Q=($=ee+zt)-ee,p[2]=ee-($-Q)+(zt-Q),p[3]=$;const yA=s(4,h,4,p,c);Q=(tn=(Ct=xt-(it=(K=134217729*xt)-(K-xt)))*(Vt=dt-(Ht=(K=134217729*dt)-(K-dt)))-((me=xt*dt)-it*Ht-Ct*Ht-it*Vt))-(zt=tn-(U=(Ct=we-(it=(K=134217729*we)-(K-we)))*(Vt=at-(Ht=(K=134217729*at)-(K-at)))-((en=we*at)-it*Ht-Ct*Ht-it*Vt))),p[0]=tn-(zt+Q)+(Q-U),Q=(je=me-((ee=me+zt)-(Q=ee-me))+(zt-Q))-(zt=je-en),p[1]=je-(zt+Q)+(Q-en),Q=($=ee+zt)-ee,p[2]=ee-($-Q)+(zt-Q),p[3]=$;const _A=s(yA,c,4,p,d);Q=(tn=(Ct=G-(it=(K=134217729*G)-(K-G)))*(Vt=dt-(Ht=(K=134217729*dt)-(K-dt)))-((me=G*dt)-it*Ht-Ct*Ht-it*Vt))-(zt=tn-(U=(Ct=q-(it=(K=134217729*q)-(K-q)))*(Vt=at-(Ht=(K=134217729*at)-(K-at)))-((en=q*at)-it*Ht-Ct*Ht-it*Vt))),p[0]=tn-(zt+Q)+(Q-U),Q=(je=me-((ee=me+zt)-(Q=ee-me))+(zt-Q))-(zt=je-en),p[1]=je-(zt+Q)+(Q-en),Q=($=ee+zt)-ee,p[2]=ee-($-Q)+(zt-Q),p[3]=$;const wA=s(_A,d,4,p,g);return g[wA-1]})(E,b,P,v,_,m,x)},e.orient2dfast=function(E,b,P,v,_,m){return(b-m)*(P-_)-(E-_)*(v-m)},Object.defineProperty(e,"__esModule",{value:!0})})})(ic,ic.exports)),ic.exports}var q_;function aT(){if(q_)return Hd.exports;q_=1;var i=j_(),t=eT,e=rT(),n=oT().orient2d;t.default&&(t=t.default),Hd.exports=r,Hd.exports.default=r;function r(m,y,S){y=Math.max(0,y===void 0?2:y),S=S||0;var C=g(m),x=new i(16);x.toBBox=function(it){return{minX:it[0],minY:it[1],maxX:it[0],maxY:it[1]}},x.compareMinX=function(it,Ct){return it[0]-Ct[0]},x.compareMinY=function(it,Ct){return it[1]-Ct[1]},x.load(m);for(var I=[],M=0,T;M<C.length;M++){var R=C[M];x.remove(R),T=p(R,T),I.push(T)}var A=new i(16);for(M=0;M<I.length;M++)A.insert(d(I[M]));for(var N=y*y,V=S*S;I.length;){var G=I.shift(),q=G.p,at=G.next.p,dt=E(q,at);if(!(dt<V)){var Q=dt/N;R=s(x,G.prev.p,q,at,G.next.next.p,Q,A),R&&Math.min(E(R,q),E(R,at))<=Q&&(I.push(G),I.push(p(R,G)),x.remove(R),A.remove(G),A.insert(d(G)),A.insert(d(G.next)))}}G=T;var K=[];do K.push(G.p),G=G.next;while(G!==T);return K.push(G.p),K}function s(m,y,S,C,x,I,M){for(var T=new t([],o),R=m.data;R;){for(var A=0;A<R.children.length;A++){var N=R.children[A],V=R.leaf?b(N,S,C):a(S,C,N);V>I||T.push({node:N,dist:V})}for(;T.length&&!T.peek().node.children;){var G=T.pop(),q=G.node,at=b(q,y,S),dt=b(q,C,x);if(G.dist<at&&G.dist<dt&&u(S,q,M)&&u(C,q,M))return q}R=T.pop(),R&&(R=R.node)}return null}function o(m,y){return m.dist-y.dist}function a(m,y,S){if(l(m,S)||l(y,S))return 0;var C=P(m[0],m[1],y[0],y[1],S.minX,S.minY,S.maxX,S.minY);if(C===0)return 0;var x=P(m[0],m[1],y[0],y[1],S.minX,S.minY,S.minX,S.maxY);if(x===0)return 0;var I=P(m[0],m[1],y[0],y[1],S.maxX,S.minY,S.maxX,S.maxY);if(I===0)return 0;var M=P(m[0],m[1],y[0],y[1],S.minX,S.maxY,S.maxX,S.maxY);return M===0?0:Math.min(C,x,I,M)}function l(m,y){return m[0]>=y.minX&&m[0]<=y.maxX&&m[1]>=y.minY&&m[1]<=y.maxY}function u(m,y,S){for(var C=Math.min(m[0],y[0]),x=Math.min(m[1],y[1]),I=Math.max(m[0],y[0]),M=Math.max(m[1],y[1]),T=S.search({minX:C,minY:x,maxX:I,maxY:M}),R=0;R<T.length;R++)if(c(T[R].p,T[R].next.p,m,y))return!1;return!0}function h(m,y,S){return n(m[0],m[1],y[0],y[1],S[0],S[1])}function c(m,y,S,C){return m!==C&&y!==S&&h(m,y,S)>0!=h(m,y,C)>0&&h(S,C,m)>0!=h(S,C,y)>0}function d(m){var y=m.p,S=m.next.p;return m.minX=Math.min(y[0],S[0]),m.minY=Math.min(y[1],S[1]),m.maxX=Math.max(y[0],S[0]),m.maxY=Math.max(y[1],S[1]),m}function g(m){for(var y=m[0],S=m[0],C=m[0],x=m[0],I=0;I<m.length;I++){var M=m[I];M[0]<y[0]&&(y=M),M[0]>C[0]&&(C=M),M[1]<S[1]&&(S=M),M[1]>x[1]&&(x=M)}var T=[y,S,C,x],R=T.slice();for(I=0;I<m.length;I++)e(m[I],T)||R.push(m[I]);return _(R)}function p(m,y){var S={p:m,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return y?(S.next=y.next,S.prev=y,y.next.prev=S,y.next=S):(S.prev=S,S.next=S),S}function E(m,y){var S=m[0]-y[0],C=m[1]-y[1];return S*S+C*C}function b(m,y,S){var C=y[0],x=y[1],I=S[0]-C,M=S[1]-x;if(I!==0||M!==0){var T=((m[0]-C)*I+(m[1]-x)*M)/(I*I+M*M);T>1?(C=S[0],x=S[1]):T>0&&(C+=I*T,x+=M*T)}return I=m[0]-C,M=m[1]-x,I*I+M*M}function P(m,y,S,C,x,I,M,T){var R=S-m,A=C-y,N=M-x,V=T-I,G=m-x,q=y-I,at=R*R+A*A,dt=R*N+A*V,Q=N*N+V*V,K=R*G+A*q,it=N*G+V*q,Ct=at*Q-dt*dt,Ht,Vt,zt,ee,je=Ct,me=Ct;Ct===0?(Vt=0,je=1,ee=it,me=Q):(Vt=dt*it-Q*K,ee=at*it-dt*K,Vt<0?(Vt=0,ee=it,me=Q):Vt>je&&(Vt=je,ee=it+dt,me=Q)),ee<0?(ee=0,-K<0?Vt=0:-K>at?Vt=je:(Vt=-K,je=at)):ee>me&&(ee=me,-K+dt<0?Vt=0:-K+dt>at?Vt=je:(Vt=-K+dt,je=at)),Ht=Vt===0?0:Vt/je,zt=ee===0?0:ee/me;var tn=(1-Ht)*m+Ht*S,en=(1-Ht)*y+Ht*C,U=(1-zt)*x+zt*M,$=(1-zt)*I+zt*T,xt=U-tn,$t=$-en;return xt*xt+$t*$t}function v(m,y){return m[0]===y[0]?m[1]-y[1]:m[0]-y[0]}function _(m){m.sort(v);for(var y=[],S=0;S<m.length;S++){for(;y.length>=2&&h(y[y.length-2],y[y.length-1],m[S])<=0;)y.pop();y.push(m[S])}for(var C=[],x=m.length-1;x>=0;x--){for(;C.length>=2&&h(C[C.length-2],C[C.length-1],m[x])<=0;)C.pop();C.push(m[x])}return C.pop(),y.pop(),y.concat(C)}return Hd.exports}var lT=aT();const uT=Yg(lT);function hT(i,t){t===void 0&&(t={}),t.concavity=t.concavity||1/0;var e=[];if(Kl(i,function(r){e.push([r[0],r[1]])}),!e.length)return null;var n=uT(e,t.concavity);return n.length>3?ue([n]):null}function _i(i,t,e){if(e===void 0&&(e={}),!i)throw new Error("point is required");if(!t)throw new Error("polygon is required");var n=sn(i),r=Bi(t),s=r.type,o=t.bbox,a=r.coordinates;if(o&&cT(n,o)===!1)return!1;s==="Polygon"&&(a=[a]);for(var l=!1,u=0;u<a.length&&!l;u++)if(W_(n,a[u][0],e.ignoreBoundary)){for(var h=!1,c=1;c<a[u].length&&!h;)W_(n,a[u][c],!e.ignoreBoundary)&&(h=!0),c++;h||(l=!0)}return l}function W_(i,t,e){var n=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var r=0,s=t.length-1;r<t.length;s=r++){var o=t[r][0],a=t[r][1],l=t[s][0],u=t[s][1],h=i[1]*(o-l)+a*(l-i[0])+u*(i[0]-o)===0&&(o-i[0])*(l-i[0])<=0&&(a-i[1])*(u-i[1])<=0;if(h)return!e;var c=a>i[1]!=u>i[1]&&i[0]<(l-o)*(i[1]-a)/(u-a)+o;c&&(n=!n)}return n}function cT(i,t){return t[0]<=i[0]&&t[1]<=i[1]&&t[2]>=i[0]&&t[3]>=i[1]}function di(i,t,e){e===void 0&&(e={});var n=sn(i),r=sn(t),s=zi(r[1]-n[1]),o=zi(r[0]-n[0]),a=zi(n[1]),l=zi(r[1]),u=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(a)*Math.cos(l);return Tp(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}function dT(i){if(!i)throw new Error("geojson is required");switch(i.type){case"Feature":return H_(i);case"FeatureCollection":return fT(i);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Ap(i);default:throw new Error("unknown GeoJSON type")}}function H_(i){var t={type:"Feature"};return Object.keys(i).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:t[e]=i[e]}}),t.properties=X_(i.properties),t.geometry=Ap(i.geometry),t}function X_(i){var t={};return i&&Object.keys(i).forEach(function(e){var n=i[e];typeof n=="object"?n===null?t[e]=null:Array.isArray(n)?t[e]=n.map(function(r){return r}):t[e]=X_(n):t[e]=n}),t}function fT(i){var t={type:"FeatureCollection"};return Object.keys(i).forEach(function(e){switch(e){case"type":case"features":return;default:t[e]=i[e]}}),t.features=i.features.map(function(e){return H_(e)}),t}function Ap(i){var t={type:i.type};return i.bbox&&(t.bbox=i.bbox),i.type==="GeometryCollection"?(t.geometries=i.geometries.map(function(e){return Ap(e)}),t):(t.coordinates=$_(i.coordinates),t)}function $_(i){var t=i;return typeof t[0]!="object"?t.slice():t.map(function(e){return $_(e)})}function hr(i,t,e,n){n===void 0&&(n={});var r=sn(i),s=zi(r[0]),o=zi(r[1]),a=zi(e),l=Np(t,n.units),u=Math.asin(Math.sin(o)*Math.cos(l)+Math.cos(o)*Math.sin(l)*Math.cos(a)),h=s+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(o),Math.cos(l)-Math.sin(o)*Math.sin(u)),c=qd(h),d=qd(u);return Kt([c,d],n.properties)}function gT(i,t,e){e===void 0&&(e={});for(var n=e.steps||64,r=e.properties?e.properties:!Array.isArray(i)&&i.type==="Feature"&&i.properties?i.properties:{},s=[],o=0;o<n;o++)s.push(hr(i,t,o*-360/n,e).geometry.coordinates);return s.push(s[0]),ue([s],r)}function tu(i,t,e){if(e===void 0&&(e={}),e.final===!0)return pT(i,t);var n=sn(i),r=sn(t),s=zi(n[0]),o=zi(r[0]),a=zi(n[1]),l=zi(r[1]),u=Math.sin(o-s)*Math.cos(l),h=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(o-s);return qd(Math.atan2(u,h))}function pT(i,t){var e=tu(t,i);return e=(e+180)%360,e}function mT(i,t){var e=di(i,t),n=tu(i,t),r=hr(i,e/2,n);return r}function Y_(i,t){t===void 0&&(t={});var e=ur(i),n=(e[0]+e[2])/2,r=(e[1]+e[3])/2;return Kt([n,r],t.properties,t)}function Lp(i,t){t===void 0&&(t={});var e=0,n=0,r=0;return Kl(i,function(s){e+=s[0],n+=s[1],r++},!0),Kt([e/r,n/r],t.properties)}function J_(i,t){switch(t===void 0&&(t={}),Z2(i)){case"Point":return Kt(sn(i),t.properties);case"Polygon":var e=[];Kl(i,function(m){e.push(m)});var n=Lp(i,{properties:t.properties}),r=n.geometry.coordinates,s=0,o=0,a=0,l,u,h,c,d,g,p,E,b=e.map(function(m){return[m[0]-r[0],m[1]-r[1]]});for(l=0;l<e.length-1;l++)u=b[l],c=u[0],g=u[1],h=b[l+1],d=h[0],p=h[1],E=c*p-d*g,a+=E,s+=(c+d)*E,o+=(g+p)*E;if(a===0)return n;var P=a*.5,v=1/(6*P);return Kt([r[0]+v*s,r[1]+v*o],t.properties);default:var _=hT(i);return _?J_(_,{properties:t.properties}):Lp(i,{properties:t.properties})}}function Z_(i){if(!i)throw new Error("geojson is required");var t=[];return La(i,function(e){vT(e,t)}),Fn(t)}function vT(i,t){var e=[],n=i.geometry;if(n!==null){switch(n.type){case"Polygon":e=kn(n);break;case"LineString":e=[kn(n)]}e.forEach(function(r){var s=yT(r,i.properties);s.forEach(function(o){o.id=t.length,t.push(o)})})}}function yT(i,t){var e=[];return i.reduce(function(n,r){var s=yi([n,r],t);return s.bbox=_T(n,r),e.push(s),r}),e}function _T(i,t){var e=i[0],n=i[1],r=t[0],s=t[1],o=e<r?e:r,a=n<s?n:s,l=e>r?e:r,u=n>s?n:s;return[o,a,l,u]}var $d={exports:{}},Fp={},K_;function Q_(){return K_||(K_=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.earthRadius=63710088e-1,i.factors={centimeters:i.earthRadius*100,centimetres:i.earthRadius*100,degrees:i.earthRadius/111325,feet:i.earthRadius*3.28084,inches:i.earthRadius*39.37,kilometers:i.earthRadius/1e3,kilometres:i.earthRadius/1e3,meters:i.earthRadius,metres:i.earthRadius,miles:i.earthRadius/1609.344,millimeters:i.earthRadius*1e3,millimetres:i.earthRadius*1e3,nauticalmiles:i.earthRadius/1852,radians:1,yards:i.earthRadius*1.0936},i.unitsFactors={centimeters:100,centimetres:100,degrees:8982708286548395e-21,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:.0006213711922373339,millimeters:1e3,millimetres:1e3,nauticalmiles:.0005399568034557236,radians:1/i.earthRadius,yards:1.0936133},i.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function t(T,R,A){A===void 0&&(A={});var N={type:"Feature"};return(A.id===0||A.id)&&(N.id=A.id),A.bbox&&(N.bbox=A.bbox),N.properties=R||{},N.geometry=T,N}i.feature=t;function e(T,R,A){switch(T){case"Point":return n(R).geometry;case"LineString":return a(R).geometry;case"Polygon":return s(R).geometry;case"MultiPoint":return c(R).geometry;case"MultiLineString":return h(R).geometry;case"MultiPolygon":return d(R).geometry;default:throw new Error(T+" is invalid")}}i.geometry=e;function n(T,R,A){if(A===void 0&&(A={}),!T)throw new Error("coordinates is required");if(!Array.isArray(T))throw new Error("coordinates must be an Array");if(T.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!C(T[0])||!C(T[1]))throw new Error("coordinates must contain numbers");var N={type:"Point",coordinates:T};return t(N,R,A)}i.point=n;function r(T,R,A){return A===void 0&&(A={}),u(T.map(function(N){return n(N,R)}),A)}i.points=r;function s(T,R,A){A===void 0&&(A={});for(var N=0,V=T;N<V.length;N++){var G=V[N];if(G.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var q=0;q<G[G.length-1].length;q++)if(G[G.length-1][q]!==G[0][q])throw new Error("First and last Position are not equivalent.")}var at={type:"Polygon",coordinates:T};return t(at,R,A)}i.polygon=s;function o(T,R,A){return A===void 0&&(A={}),u(T.map(function(N){return s(N,R)}),A)}i.polygons=o;function a(T,R,A){if(A===void 0&&(A={}),T.length<2)throw new Error("coordinates must be an array of two or more positions");var N={type:"LineString",coordinates:T};return t(N,R,A)}i.lineString=a;function l(T,R,A){return A===void 0&&(A={}),u(T.map(function(N){return a(N,R)}),A)}i.lineStrings=l;function u(T,R){R===void 0&&(R={});var A={type:"FeatureCollection"};return R.id&&(A.id=R.id),R.bbox&&(A.bbox=R.bbox),A.features=T,A}i.featureCollection=u;function h(T,R,A){A===void 0&&(A={});var N={type:"MultiLineString",coordinates:T};return t(N,R,A)}i.multiLineString=h;function c(T,R,A){A===void 0&&(A={});var N={type:"MultiPoint",coordinates:T};return t(N,R,A)}i.multiPoint=c;function d(T,R,A){A===void 0&&(A={});var N={type:"MultiPolygon",coordinates:T};return t(N,R,A)}i.multiPolygon=d;function g(T,R,A){A===void 0&&(A={});var N={type:"GeometryCollection",geometries:T};return t(N,R,A)}i.geometryCollection=g;function p(T,R){if(R===void 0&&(R=0),R&&!(R>=0))throw new Error("precision must be a positive number");var A=Math.pow(10,R||0);return Math.round(T*A)/A}i.round=p;function E(T,R){R===void 0&&(R="kilometers");var A=i.factors[R];if(!A)throw new Error(R+" units is invalid");return T*A}i.radiansToLength=E;function b(T,R){R===void 0&&(R="kilometers");var A=i.factors[R];if(!A)throw new Error(R+" units is invalid");return T/A}i.lengthToRadians=b;function P(T,R){return _(b(T,R))}i.lengthToDegrees=P;function v(T){var R=T%360;return R<0&&(R+=360),R}i.bearingToAzimuth=v;function _(T){var R=T%(2*Math.PI);return R*180/Math.PI}i.radiansToDegrees=_;function m(T){var R=T%360;return R*Math.PI/180}i.degreesToRadians=m;function y(T,R,A){if(R===void 0&&(R="kilometers"),A===void 0&&(A="kilometers"),!(T>=0))throw new Error("length must be a positive number");return E(b(T,R),A)}i.convertLength=y;function S(T,R,A){if(R===void 0&&(R="meters"),A===void 0&&(A="kilometers"),!(T>=0))throw new Error("area must be a positive number");var N=i.areaFactors[R];if(!N)throw new Error("invalid original units");var V=i.areaFactors[A];if(!V)throw new Error("invalid final units");return T/N*V}i.convertArea=S;function C(T){return!isNaN(T)&&T!==null&&!Array.isArray(T)}i.isNumber=C;function x(T){return!!T&&T.constructor===Object}i.isObject=x;function I(T){if(!T)throw new Error("bbox is required");if(!Array.isArray(T))throw new Error("bbox must be an Array");if(T.length!==4&&T.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");T.forEach(function(R){if(!C(R))throw new Error("bbox must only contain numbers")})}i.validateBBox=I;function M(T){if(!T)throw new Error("id is required");if(["string","number"].indexOf(typeof T)===-1)throw new Error("id must be a number or a string")}i.validateId=M})(Fp)),Fp}var ti={},tw;function wT(){if(tw)return ti;tw=1,Object.defineProperty(ti,"__esModule",{value:!0});var i=Q_();function t(v,_,m){if(v!==null)for(var y,S,C,x,I,M,T,R=0,A=0,N,V=v.type,G=V==="FeatureCollection",q=V==="Feature",at=G?v.features.length:1,dt=0;dt<at;dt++){T=G?v.features[dt].geometry:q?v.geometry:v,N=T?T.type==="GeometryCollection":!1,I=N?T.geometries.length:1;for(var Q=0;Q<I;Q++){var K=0,it=0;if(x=N?T.geometries[Q]:T,x!==null){M=x.coordinates;var Ct=x.type;switch(R=m&&(Ct==="Polygon"||Ct==="MultiPolygon")?1:0,Ct){case null:break;case"Point":if(_(M,A,dt,K,it)===!1)return!1;A++,K++;break;case"LineString":case"MultiPoint":for(y=0;y<M.length;y++){if(_(M[y],A,dt,K,it)===!1)return!1;A++,Ct==="MultiPoint"&&K++}Ct==="LineString"&&K++;break;case"Polygon":case"MultiLineString":for(y=0;y<M.length;y++){for(S=0;S<M[y].length-R;S++){if(_(M[y][S],A,dt,K,it)===!1)return!1;A++}Ct==="MultiLineString"&&K++,Ct==="Polygon"&&it++}Ct==="Polygon"&&K++;break;case"MultiPolygon":for(y=0;y<M.length;y++){for(it=0,S=0;S<M[y].length;S++){for(C=0;C<M[y][S].length-R;C++){if(_(M[y][S][C],A,dt,K,it)===!1)return!1;A++}it++}K++}break;case"GeometryCollection":for(y=0;y<x.geometries.length;y++)if(t(x.geometries[y],_,m)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function e(v,_,m,y){var S=m;return t(v,function(C,x,I,M,T){x===0&&m===void 0?S=C:S=_(S,C,x,I,M,T)},y),S}function n(v,_){var m;switch(v.type){case"FeatureCollection":for(m=0;m<v.features.length&&_(v.features[m].properties,m)!==!1;m++);break;case"Feature":_(v.properties,0);break}}function r(v,_,m){var y=m;return n(v,function(S,C){C===0&&m===void 0?y=S:y=_(y,S,C)}),y}function s(v,_){if(v.type==="Feature")_(v,0);else if(v.type==="FeatureCollection")for(var m=0;m<v.features.length&&_(v.features[m],m)!==!1;m++);}function o(v,_,m){var y=m;return s(v,function(S,C){C===0&&m===void 0?y=S:y=_(y,S,C)}),y}function a(v){var _=[];return t(v,function(m){_.push(m)}),_}function l(v,_){var m,y,S,C,x,I,M,T,R,A,N=0,V=v.type==="FeatureCollection",G=v.type==="Feature",q=V?v.features.length:1;for(m=0;m<q;m++){for(I=V?v.features[m].geometry:G?v.geometry:v,T=V?v.features[m].properties:G?v.properties:{},R=V?v.features[m].bbox:G?v.bbox:void 0,A=V?v.features[m].id:G?v.id:void 0,M=I?I.type==="GeometryCollection":!1,x=M?I.geometries.length:1,S=0;S<x;S++){if(C=M?I.geometries[S]:I,C===null){if(_(null,N,T,R,A)===!1)return!1;continue}switch(C.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(_(C,N,T,R,A)===!1)return!1;break}case"GeometryCollection":{for(y=0;y<C.geometries.length;y++)if(_(C.geometries[y],N,T,R,A)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}N++}}function u(v,_,m){var y=m;return l(v,function(S,C,x,I,M){C===0&&m===void 0?y=S:y=_(y,S,C,x,I,M)}),y}function h(v,_){l(v,function(m,y,S,C,x){var I=m===null?null:m.type;switch(I){case null:case"Point":case"LineString":case"Polygon":return _(i.feature(m,S,{bbox:C,id:x}),y,0)===!1?!1:void 0}var M;switch(I){case"MultiPoint":M="Point";break;case"MultiLineString":M="LineString";break;case"MultiPolygon":M="Polygon";break}for(var T=0;T<m.coordinates.length;T++){var R=m.coordinates[T],A={type:M,coordinates:R};if(_(i.feature(A,S),y,T)===!1)return!1}})}function c(v,_,m){var y=m;return h(v,function(S,C,x){C===0&&x===0&&m===void 0?y=S:y=_(y,S,C,x)}),y}function d(v,_){h(v,function(m,y,S){var C=0;if(m.geometry){var x=m.geometry.type;if(!(x==="Point"||x==="MultiPoint")){var I,M=0,T=0,R=0;if(t(m,function(A,N,V,G,q){if(I===void 0||y>M||G>T||q>R){I=A,M=y,T=G,R=q,C=0;return}var at=i.lineString([I,A],m.properties);if(_(at,y,S,q,C)===!1)return!1;C++,I=A})===!1)return!1}}})}function g(v,_,m){var y=m,S=!1;return d(v,function(C,x,I,M,T){S===!1&&m===void 0?y=C:y=_(y,C,x,I,M,T),S=!0}),y}function p(v,_){if(!v)throw new Error("geojson is required");h(v,function(m,y,S){if(m.geometry!==null){var C=m.geometry.type,x=m.geometry.coordinates;switch(C){case"LineString":if(_(m,y,S,0,0)===!1)return!1;break;case"Polygon":for(var I=0;I<x.length;I++)if(_(i.lineString(x[I],m.properties),y,S,I)===!1)return!1;break}}})}function E(v,_,m){var y=m;return p(v,function(S,C,x,I){C===0&&m===void 0?y=S:y=_(y,S,C,x,I)}),y}function b(v,_){if(_=_||{},!i.isObject(_))throw new Error("options is invalid");var m=_.featureIndex||0,y=_.multiFeatureIndex||0,S=_.geometryIndex||0,C=_.segmentIndex||0,x=_.properties,I;switch(v.type){case"FeatureCollection":m<0&&(m=v.features.length+m),x=x||v.features[m].properties,I=v.features[m].geometry;break;case"Feature":x=x||v.properties,I=v.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":I=v;break;default:throw new Error("geojson is invalid")}if(I===null)return null;var M=I.coordinates;switch(I.type){case"Point":case"MultiPoint":return null;case"LineString":return C<0&&(C=M.length+C-1),i.lineString([M[C],M[C+1]],x,_);case"Polygon":return S<0&&(S=M.length+S),C<0&&(C=M[S].length+C-1),i.lineString([M[S][C],M[S][C+1]],x,_);case"MultiLineString":return y<0&&(y=M.length+y),C<0&&(C=M[y].length+C-1),i.lineString([M[y][C],M[y][C+1]],x,_);case"MultiPolygon":return y<0&&(y=M.length+y),S<0&&(S=M[y].length+S),C<0&&(C=M[y][S].length-C-1),i.lineString([M[y][S][C],M[y][S][C+1]],x,_)}throw new Error("geojson is invalid")}function P(v,_){if(_=_||{},!i.isObject(_))throw new Error("options is invalid");var m=_.featureIndex||0,y=_.multiFeatureIndex||0,S=_.geometryIndex||0,C=_.coordIndex||0,x=_.properties,I;switch(v.type){case"FeatureCollection":m<0&&(m=v.features.length+m),x=x||v.features[m].properties,I=v.features[m].geometry;break;case"Feature":x=x||v.properties,I=v.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":I=v;break;default:throw new Error("geojson is invalid")}if(I===null)return null;var M=I.coordinates;switch(I.type){case"Point":return i.point(M,x,_);case"MultiPoint":return y<0&&(y=M.length+y),i.point(M[y],x,_);case"LineString":return C<0&&(C=M.length+C),i.point(M[C],x,_);case"Polygon":return S<0&&(S=M.length+S),C<0&&(C=M[S].length+C),i.point(M[S][C],x,_);case"MultiLineString":return y<0&&(y=M.length+y),C<0&&(C=M[y].length+C),i.point(M[y][C],x,_);case"MultiPolygon":return y<0&&(y=M.length+y),S<0&&(S=M[y].length+S),C<0&&(C=M[y][S].length-C),i.point(M[y][S][C],x,_)}throw new Error("geojson is invalid")}return ti.coordAll=a,ti.coordEach=t,ti.coordReduce=e,ti.featureEach=s,ti.featureReduce=o,ti.findPoint=P,ti.findSegment=b,ti.flattenEach=h,ti.flattenReduce=c,ti.geomEach=l,ti.geomReduce=u,ti.lineEach=p,ti.lineReduce=E,ti.propEach=n,ti.propReduce=r,ti.segmentEach=d,ti.segmentReduce=g,ti}var nc={},ei={},Qt={},ew;function ET(){if(ew)return Qt;ew=1,Object.defineProperty(Qt,"__esModule",{value:!0});var i=63710088e-1,t={centimeters:i*100,centimetres:i*100,degrees:360/(2*Math.PI),feet:i*3.28084,inches:i*39.37,kilometers:i/1e3,kilometres:i/1e3,meters:i,metres:i,miles:i/1609.344,millimeters:i*1e3,millimetres:i*1e3,nauticalmiles:i/1852,radians:1,yards:i*1.0936},e={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function n(N,V,G={}){const q={type:"Feature"};return(G.id===0||G.id)&&(q.id=G.id),G.bbox&&(q.bbox=G.bbox),q.properties=V||{},q.geometry=N,q}function r(N,V,G={}){switch(N){case"Point":return s(V).geometry;case"LineString":return u(V).geometry;case"Polygon":return a(V).geometry;case"MultiPoint":return g(V).geometry;case"MultiLineString":return d(V).geometry;case"MultiPolygon":return p(V).geometry;default:throw new Error(N+" is invalid")}}function s(N,V,G={}){if(!N)throw new Error("coordinates is required");if(!Array.isArray(N))throw new Error("coordinates must be an Array");if(N.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!M(N[0])||!M(N[1]))throw new Error("coordinates must contain numbers");return n({type:"Point",coordinates:N},V,G)}function o(N,V,G={}){return c(N.map(q=>s(q,V)),G)}function a(N,V,G={}){for(const at of N){if(at.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(at[at.length-1].length!==at[0].length)throw new Error("First and last Position are not equivalent.");for(let dt=0;dt<at[at.length-1].length;dt++)if(at[at.length-1][dt]!==at[0][dt])throw new Error("First and last Position are not equivalent.")}return n({type:"Polygon",coordinates:N},V,G)}function l(N,V,G={}){return c(N.map(q=>a(q,V)),G)}function u(N,V,G={}){if(N.length<2)throw new Error("coordinates must be an array of two or more positions");return n({type:"LineString",coordinates:N},V,G)}function h(N,V,G={}){return c(N.map(q=>u(q,V)),G)}function c(N,V={}){const G={type:"FeatureCollection"};return V.id&&(G.id=V.id),V.bbox&&(G.bbox=V.bbox),G.features=N,G}function d(N,V,G={}){return n({type:"MultiLineString",coordinates:N},V,G)}function g(N,V,G={}){return n({type:"MultiPoint",coordinates:N},V,G)}function p(N,V,G={}){return n({type:"MultiPolygon",coordinates:N},V,G)}function E(N,V,G={}){return n({type:"GeometryCollection",geometries:N},V,G)}function b(N,V=0){if(V&&!(V>=0))throw new Error("precision must be a positive number");const G=Math.pow(10,V||0);return Math.round(N*G)/G}function P(N,V="kilometers"){const G=t[V];if(!G)throw new Error(V+" units is invalid");return N*G}function v(N,V="kilometers"){const G=t[V];if(!G)throw new Error(V+" units is invalid");return N/G}function _(N,V){return S(v(N,V))}function m(N){let V=N%360;return V<0&&(V+=360),V}function y(N){return N=N%360,N>180?N-360:N<-180?N+360:N}function S(N){return N%(2*Math.PI)*180/Math.PI}function C(N){return N%360*Math.PI/180}function x(N,V="kilometers",G="kilometers"){if(!(N>=0))throw new Error("length must be a positive number");return P(v(N,V),G)}function I(N,V="meters",G="kilometers"){if(!(N>=0))throw new Error("area must be a positive number");const q=e[V];if(!q)throw new Error("invalid original units");const at=e[G];if(!at)throw new Error("invalid final units");return N/q*at}function M(N){return!isNaN(N)&&N!==null&&!Array.isArray(N)}function T(N){return N!==null&&typeof N=="object"&&!Array.isArray(N)}function R(N){if(!N)throw new Error("bbox is required");if(!Array.isArray(N))throw new Error("bbox must be an Array");if(N.length!==4&&N.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");N.forEach(V=>{if(!M(V))throw new Error("bbox must only contain numbers")})}function A(N){if(!N)throw new Error("id is required");if(["string","number"].indexOf(typeof N)===-1)throw new Error("id must be a number or a string")}return Qt.areaFactors=e,Qt.azimuthToBearing=y,Qt.bearingToAzimuth=m,Qt.convertArea=I,Qt.convertLength=x,Qt.degreesToRadians=C,Qt.earthRadius=i,Qt.factors=t,Qt.feature=n,Qt.featureCollection=c,Qt.geometry=r,Qt.geometryCollection=E,Qt.isNumber=M,Qt.isObject=T,Qt.lengthToDegrees=_,Qt.lengthToRadians=v,Qt.lineString=u,Qt.lineStrings=h,Qt.multiLineString=d,Qt.multiPoint=g,Qt.multiPolygon=p,Qt.point=s,Qt.points=o,Qt.polygon=a,Qt.polygons=l,Qt.radiansToDegrees=S,Qt.radiansToLength=P,Qt.round=b,Qt.validateBBox=R,Qt.validateId=A,Qt}var iw;function ST(){if(iw)return ei;iw=1,Object.defineProperty(ei,"__esModule",{value:!0});var i=ET();function t(v,_,m){if(v!==null)for(var y,S,C,x,I,M,T,R=0,A=0,N,V=v.type,G=V==="FeatureCollection",q=V==="Feature",at=G?v.features.length:1,dt=0;dt<at;dt++){T=G?v.features[dt].geometry:q?v.geometry:v,N=T?T.type==="GeometryCollection":!1,I=N?T.geometries.length:1;for(var Q=0;Q<I;Q++){var K=0,it=0;if(x=N?T.geometries[Q]:T,x!==null){M=x.coordinates;var Ct=x.type;switch(R=m&&(Ct==="Polygon"||Ct==="MultiPolygon")?1:0,Ct){case null:break;case"Point":if(_(M,A,dt,K,it)===!1)return!1;A++,K++;break;case"LineString":case"MultiPoint":for(y=0;y<M.length;y++){if(_(M[y],A,dt,K,it)===!1)return!1;A++,Ct==="MultiPoint"&&K++}Ct==="LineString"&&K++;break;case"Polygon":case"MultiLineString":for(y=0;y<M.length;y++){for(S=0;S<M[y].length-R;S++){if(_(M[y][S],A,dt,K,it)===!1)return!1;A++}Ct==="MultiLineString"&&K++,Ct==="Polygon"&&it++}Ct==="Polygon"&&K++;break;case"MultiPolygon":for(y=0;y<M.length;y++){for(it=0,S=0;S<M[y].length;S++){for(C=0;C<M[y][S].length-R;C++){if(_(M[y][S][C],A,dt,K,it)===!1)return!1;A++}it++}K++}break;case"GeometryCollection":for(y=0;y<x.geometries.length;y++)if(t(x.geometries[y],_,m)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function e(v,_,m,y){var S=m;return t(v,function(C,x,I,M,T){x===0&&m===void 0?S=C:S=_(S,C,x,I,M,T)},y),S}function n(v,_){var m;switch(v.type){case"FeatureCollection":for(m=0;m<v.features.length&&_(v.features[m].properties,m)!==!1;m++);break;case"Feature":_(v.properties,0);break}}function r(v,_,m){var y=m;return n(v,function(S,C){C===0&&m===void 0?y=S:y=_(y,S,C)}),y}function s(v,_){if(v.type==="Feature")_(v,0);else if(v.type==="FeatureCollection")for(var m=0;m<v.features.length&&_(v.features[m],m)!==!1;m++);}function o(v,_,m){var y=m;return s(v,function(S,C){C===0&&m===void 0?y=S:y=_(y,S,C)}),y}function a(v){var _=[];return t(v,function(m){_.push(m)}),_}function l(v,_){var m,y,S,C,x,I,M,T,R,A,N=0,V=v.type==="FeatureCollection",G=v.type==="Feature",q=V?v.features.length:1;for(m=0;m<q;m++){for(I=V?v.features[m].geometry:G?v.geometry:v,T=V?v.features[m].properties:G?v.properties:{},R=V?v.features[m].bbox:G?v.bbox:void 0,A=V?v.features[m].id:G?v.id:void 0,M=I?I.type==="GeometryCollection":!1,x=M?I.geometries.length:1,S=0;S<x;S++){if(C=M?I.geometries[S]:I,C===null){if(_(null,N,T,R,A)===!1)return!1;continue}switch(C.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(_(C,N,T,R,A)===!1)return!1;break}case"GeometryCollection":{for(y=0;y<C.geometries.length;y++)if(_(C.geometries[y],N,T,R,A)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}N++}}function u(v,_,m){var y=m;return l(v,function(S,C,x,I,M){C===0&&m===void 0?y=S:y=_(y,S,C,x,I,M)}),y}function h(v,_){l(v,function(m,y,S,C,x){var I=m===null?null:m.type;switch(I){case null:case"Point":case"LineString":case"Polygon":return _(i.feature.call(void 0,m,S,{bbox:C,id:x}),y,0)===!1?!1:void 0}var M;switch(I){case"MultiPoint":M="Point";break;case"MultiLineString":M="LineString";break;case"MultiPolygon":M="Polygon";break}for(var T=0;T<m.coordinates.length;T++){var R=m.coordinates[T],A={type:M,coordinates:R};if(_(i.feature.call(void 0,A,S),y,T)===!1)return!1}})}function c(v,_,m){var y=m;return h(v,function(S,C,x){C===0&&x===0&&m===void 0?y=S:y=_(y,S,C,x)}),y}function d(v,_){h(v,function(m,y,S){var C=0;if(m.geometry){var x=m.geometry.type;if(!(x==="Point"||x==="MultiPoint")){var I,M=0,T=0,R=0;if(t(m,function(A,N,V,G,q){if(I===void 0||y>M||G>T||q>R){I=A,M=y,T=G,R=q,C=0;return}var at=i.lineString.call(void 0,[I,A],m.properties);if(_(at,y,S,q,C)===!1)return!1;C++,I=A})===!1)return!1}}})}function g(v,_,m){var y=m,S=!1;return d(v,function(C,x,I,M,T){S===!1&&m===void 0?y=C:y=_(y,C,x,I,M,T),S=!0}),y}function p(v,_){if(!v)throw new Error("geojson is required");h(v,function(m,y,S){if(m.geometry!==null){var C=m.geometry.type,x=m.geometry.coordinates;switch(C){case"LineString":if(_(m,y,S,0,0)===!1)return!1;break;case"Polygon":for(var I=0;I<x.length;I++)if(_(i.lineString.call(void 0,x[I],m.properties),y,S,I)===!1)return!1;break}}})}function E(v,_,m){var y=m;return p(v,function(S,C,x,I){C===0&&m===void 0?y=S:y=_(y,S,C,x,I)}),y}function b(v,_){if(_=_||{},!i.isObject.call(void 0,_))throw new Error("options is invalid");var m=_.featureIndex||0,y=_.multiFeatureIndex||0,S=_.geometryIndex||0,C=_.segmentIndex||0,x=_.properties,I;switch(v.type){case"FeatureCollection":m<0&&(m=v.features.length+m),x=x||v.features[m].properties,I=v.features[m].geometry;break;case"Feature":x=x||v.properties,I=v.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":I=v;break;default:throw new Error("geojson is invalid")}if(I===null)return null;var M=I.coordinates;switch(I.type){case"Point":case"MultiPoint":return null;case"LineString":return C<0&&(C=M.length+C-1),i.lineString.call(void 0,[M[C],M[C+1]],x,_);case"Polygon":return S<0&&(S=M.length+S),C<0&&(C=M[S].length+C-1),i.lineString.call(void 0,[M[S][C],M[S][C+1]],x,_);case"MultiLineString":return y<0&&(y=M.length+y),C<0&&(C=M[y].length+C-1),i.lineString.call(void 0,[M[y][C],M[y][C+1]],x,_);case"MultiPolygon":return y<0&&(y=M.length+y),S<0&&(S=M[y].length+S),C<0&&(C=M[y][S].length-C-1),i.lineString.call(void 0,[M[y][S][C],M[y][S][C+1]],x,_)}throw new Error("geojson is invalid")}function P(v,_){if(_=_||{},!i.isObject.call(void 0,_))throw new Error("options is invalid");var m=_.featureIndex||0,y=_.multiFeatureIndex||0,S=_.geometryIndex||0,C=_.coordIndex||0,x=_.properties,I;switch(v.type){case"FeatureCollection":m<0&&(m=v.features.length+m),x=x||v.features[m].properties,I=v.features[m].geometry;break;case"Feature":x=x||v.properties,I=v.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":I=v;break;default:throw new Error("geojson is invalid")}if(I===null)return null;var M=I.coordinates;switch(I.type){case"Point":return i.point.call(void 0,M,x,_);case"MultiPoint":return y<0&&(y=M.length+y),i.point.call(void 0,M[y],x,_);case"LineString":return C<0&&(C=M.length+C),i.point.call(void 0,M[C],x,_);case"Polygon":return S<0&&(S=M.length+S),C<0&&(C=M[S].length+C),i.point.call(void 0,M[S][C],x,_);case"MultiLineString":return y<0&&(y=M.length+y),C<0&&(C=M[y].length+C),i.point.call(void 0,M[y][C],x,_);case"MultiPolygon":return y<0&&(y=M.length+y),S<0&&(S=M[y].length+S),C<0&&(C=M[y][S].length-C),i.point.call(void 0,M[y][S][C],x,_)}throw new Error("geojson is invalid")}return ei.coordAll=a,ei.coordEach=t,ei.coordReduce=e,ei.featureEach=s,ei.featureReduce=o,ei.findPoint=P,ei.findSegment=b,ei.flattenEach=h,ei.flattenReduce=c,ei.geomEach=l,ei.geomReduce=u,ei.lineEach=p,ei.lineReduce=E,ei.propEach=n,ei.propReduce=r,ei.segmentEach=d,ei.segmentReduce=g,ei}var nw;function bT(){if(nw)return nc;nw=1,Object.defineProperty(nc,"__esModule",{value:!0});var i=ST();function t(n,r={}){if(n.bbox!=null&&r.recompute!==!0)return n.bbox;const s=[1/0,1/0,-1/0,-1/0];return i.coordEach.call(void 0,n,o=>{s[0]>o[0]&&(s[0]=o[0]),s[1]>o[1]&&(s[1]=o[1]),s[2]<o[0]&&(s[2]=o[0]),s[3]<o[1]&&(s[3]=o[1])}),s}var e=t;return nc.bbox=t,nc.default=e,nc}var rw;function CT(){if(rw)return $d.exports;rw=1;var i=j_(),t=Q_(),e=wT(),n=bT().default,r=e.featureEach;e.coordEach,t.polygon;var s=t.featureCollection;function o(a){var l=new i(a);return l.insert=function(u){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:n(u),i.prototype.insert.call(this,u)},l.load=function(u){var h=[];return Array.isArray(u)?u.forEach(function(c){if(c.type!=="Feature")throw new Error("invalid features");c.bbox=c.bbox?c.bbox:n(c),h.push(c)}):r(u,function(c){if(c.type!=="Feature")throw new Error("invalid features");c.bbox=c.bbox?c.bbox:n(c),h.push(c)}),i.prototype.load.call(this,h)},l.remove=function(u,h){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:n(u),i.prototype.remove.call(this,u,h)},l.clear=function(){return i.prototype.clear.call(this)},l.search=function(u){var h=i.prototype.search.call(this,this.toBBox(u));return s(h)},l.collides=function(u){return i.prototype.collides.call(this,this.toBBox(u))},l.all=function(){var u=i.prototype.all.call(this);return s(u)},l.toJSON=function(){return i.prototype.toJSON.call(this)},l.fromJSON=function(u){return i.prototype.fromJSON.call(this,u)},l.toBBox=function(u){var h;if(u.bbox)h=u.bbox;else if(Array.isArray(u)&&u.length===4)h=u;else if(Array.isArray(u)&&u.length===6)h=[u[0],u[1],u[3],u[4]];else if(u.type==="Feature")h=n(u);else if(u.type==="FeatureCollection")h=n(u);else throw new Error("invalid geojson");return{minX:h[0],minY:h[1],maxX:h[2],maxY:h[3]}},l}return $d.exports=o,$d.exports.default=o,$d.exports}var PT=CT();const xT=Yg(PT);function Fa(i,t){var e={},n=[];if(i.type==="LineString"&&(i=lr(i)),t.type==="LineString"&&(t=lr(t)),i.type==="Feature"&&t.type==="Feature"&&i.geometry!==null&&t.geometry!==null&&i.geometry.type==="LineString"&&t.geometry.type==="LineString"&&i.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var r=sw(i,t);return r&&n.push(r),Fn(n)}var s=xT();return s.load(Z_(t)),Ql(Z_(i),function(o){Ql(s.search(o),function(a){var l=sw(o,a);if(l){var u=kn(l).join(",");e[u]||(e[u]=!0,n.push(l))}})}),Fn(n)}function sw(i,t){var e=kn(i),n=kn(t);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var r=e[0][0],s=e[0][1],o=e[1][0],a=e[1][1],l=n[0][0],u=n[0][1],h=n[1][0],c=n[1][1],d=(c-u)*(o-r)-(h-l)*(a-s),g=(h-l)*(s-u)-(c-u)*(r-l),p=(o-r)*(s-u)-(a-s)*(r-l);if(d===0)return null;var E=g/d,b=p/d;if(E>=0&&E<=1&&b>=0&&b<=1){var P=r+E*(o-r),v=s+E*(a-s);return Kt([P,v])}return null}function IT(i,t,e){e===void 0&&(e={});var n=Kt([1/0,1/0],{dist:1/0}),r=0;return La(i,function(s){for(var o=kn(s),a=0;a<o.length-1;a++){var l=Kt(o[a]);l.properties.dist=di(t,l,e);var u=Kt(o[a+1]);u.properties.dist=di(t,u,e);var h=di(l,u,e),c=Math.max(l.properties.dist,u.properties.dist),d=tu(l,u),g=hr(t,c,d+90,e),p=hr(t,c,d-90,e),E=Fa(yi([g.geometry.coordinates,p.geometry.coordinates]),yi([l.geometry.coordinates,u.geometry.coordinates])),b=null;E.features.length>0&&(b=E.features[0],b.properties.dist=di(t,b,e),b.properties.location=r+di(l,b,e)),l.properties.dist<n.properties.dist&&(n=l,n.properties.index=a,n.properties.location=r),u.properties.dist<n.properties.dist&&(n=u,n.properties.index=a+1,n.properties.location=r+h),b&&b.properties.dist<n.properties.dist&&(n=b,n.properties.index=a),r+=h}}),n}function ow(i,t,e){e===void 0&&(e={});var n=sn(i),r=sn(t);r[0]+=r[0]-n[0]>180?-360:n[0]-r[0]>180?360:0;var s=MT(n,r),o=Op(s,"meters",e.units);return o}function MT(i,t,e){e=e===void 0?Ni:Number(e);var n=e,r=i[1]*Math.PI/180,s=t[1]*Math.PI/180,o=s-r,a=Math.abs(t[0]-i[0])*Math.PI/180;a>Math.PI&&(a-=2*Math.PI);var l=Math.log(Math.tan(s/2+Math.PI/4)/Math.tan(r/2+Math.PI/4)),u=Math.abs(l)>1e-11?o/l:Math.cos(r),h=Math.sqrt(o*o+u*u*a*a),c=h*n;return c}function TT(i,t,e){if(e===void 0&&(e={}),e.method||(e.method="geodesic"),e.units||(e.units="kilometers"),!i)throw new Error("pt is required");if(Array.isArray(i)?i=Kt(i):i.type==="Point"?i=lr(i):k_(i,"Point","point"),!t)throw new Error("line is required");Array.isArray(t)?t=yi(t):t.type==="LineString"?t=lr(t):k_(t,"LineString","line");var n=1/0,r=i.geometry.coordinates;return F_(t,function(s){var o=s.geometry.coordinates[0],a=s.geometry.coordinates[1],l=NT(r,o,a,e);l<n&&(n=l)}),Op(n,"degrees",e.units)}function NT(i,t,e,n){var r=[e[0]-t[0],e[1]-t[1]],s=[i[0]-t[0],i[1]-t[1]],o=aw(s,r);if(o<=0)return kp(i,t,{method:n.method,units:"degrees"});var a=aw(r,r);if(a<=o)return kp(i,e,{method:n.method,units:"degrees"});var l=o/a,u=[t[0]+l*r[0],t[1]+l*r[1]];return kp(i,u,{method:n.method,units:"degrees"})}function aw(i,t){return i[0]*t[0]+i[1]*t[1]}function kp(i,t,e){return e.method==="planar"?ow(i,t,e):di(i,t,e)}var lw=6378137;function OT(i){return $2(i,function(t,e){return t+DT(e)},0)}function DT(i){var t=0,e;switch(i.type){case"Polygon":return uw(i.coordinates);case"MultiPolygon":for(e=0;e<i.coordinates.length;e++)t+=uw(i.coordinates[e]);return t;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function uw(i){var t=0;if(i&&i.length>0){t+=Math.abs(hw(i[0]));for(var e=1;e<i.length;e++)t-=Math.abs(hw(i[e]))}return t}function hw(i){var t,e,n,r,s,o,a,l=0,u=i.length;if(u>2){for(a=0;a<u;a++)a===u-2?(r=u-2,s=u-1,o=0):a===u-1?(r=u-1,s=0,o=1):(r=a,s=a+1,o=a+2),t=i[r],e=i[s],n=i[o],l+=(Gp(n[0])-Gp(t[0]))*Math.sin(Gp(e[1]));l=l*lw*lw/2}return l}function Gp(i){return i*Math.PI/180}function jp(i,t,e){e===void 0&&(e={});for(var n=Bi(i),r=n.coordinates,s=0,o=0;o<r.length&&!(t>=s&&o===r.length-1);o++)if(s>=t){var a=t-s;if(a){var l=tu(r[o],r[o-1])-180,u=hr(r[o],a,l,e);return u}else return Kt(r[o])}else s+=di(r[o],r[o+1],e);return Kt(r[r.length-1])}function cw(i,t){return t===void 0&&(t={}),Y2(i,function(e,n){var r=n.geometry.coordinates;return e+di(r[0],r[1],t)},0)}function ro(i,t,e){e===void 0&&(e={});for(var n=sn(i),r=kn(t),s=0;s<r.length-1;s++){var o=!1;if(e.ignoreEndVertices&&(s===0&&(o="start"),s===r.length-2&&(o="end"),s===0&&s+1===r.length-1&&(o="both")),RT(r[s],r[s+1],n,o,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function RT(i,t,e,n,r){var s=e[0],o=e[1],a=i[0],l=i[1],u=t[0],h=t[1],c=e[0]-a,d=e[1]-l,g=u-a,p=h-l,E=c*p-d*g;if(r!==null){if(Math.abs(E)>r)return!1}else if(E!==0)return!1;if(n){if(n==="start")return Math.abs(g)>=Math.abs(p)?g>0?a<s&&s<=u:u<=s&&s<a:p>0?l<o&&o<=h:h<=o&&o<l;if(n==="end")return Math.abs(g)>=Math.abs(p)?g>0?a<=s&&s<u:u<s&&s<=a:p>0?l<=o&&o<h:h<o&&o<=l;if(n==="both")return Math.abs(g)>=Math.abs(p)?g>0?a<s&&s<u:u<s&&s<a:p>0?l<o&&o<h:h<o&&o<l}else return Math.abs(g)>=Math.abs(p)?g>0?a<=s&&s<=u:u<=s&&s<=a:p>0?l<=o&&o<=h:h<=o&&o<=l;return!1}function dw(i,t){var e=Bi(i),n=Bi(t),r=e.type,s=n.type;switch(r){case"Point":switch(s){case"MultiPoint":return AT(e,n);case"LineString":return ro(e,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return _i(e,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return LT(e,n);case"LineString":return FT(e,n);case"Polygon":case"MultiPolygon":return kT(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return GT(e,n);case"Polygon":case"MultiPolygon":return jT(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return VT(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+r+" geometry not supported")}}function AT(i,t){var e,n=!1;for(e=0;e<t.coordinates.length;e++)if(gw(t.coordinates[e],i.coordinates)){n=!0;break}return n}function LT(i,t){for(var e=0;e<i.coordinates.length;e++){for(var n=!1,r=0;r<t.coordinates.length;r++)gw(i.coordinates[e],t.coordinates[r])&&(n=!0);if(!n)return!1}return!0}function FT(i,t){for(var e=!1,n=0;n<i.coordinates.length;n++){if(!ro(i.coordinates[n],t))return!1;e||(e=ro(i.coordinates[n],t,{ignoreEndVertices:!0}))}return e}function kT(i,t){for(var e=!0,n=!1,r=0;r<i.coordinates.length;r++){if(n=_i(i.coordinates[1],t),!n){e=!1;break}n=_i(i.coordinates[1],t,{ignoreBoundary:!0})}return e&&n}function GT(i,t){for(var e=0;e<i.coordinates.length;e++)if(!ro(i.coordinates[e],t))return!1;return!0}function jT(i,t){var e=ur(t),n=ur(i);if(!fw(e,n))return!1;for(var r=!1,s=0;s<i.coordinates.length-1;s++){if(!_i(i.coordinates[s],t))return!1;if(r||(r=_i(i.coordinates[s],t,{ignoreBoundary:!0})),!r){var o=zT(i.coordinates[s],i.coordinates[s+1]);r=_i(o,t,{ignoreBoundary:!0})}}return r}function VT(i,t){var e=ur(i),n=ur(t);if(!fw(n,e))return!1;for(var r=0;r<i.coordinates[0].length;r++)if(!_i(i.coordinates[0][r],t))return!1;return!0}function fw(i,t){return!(i[0]>t[0]||i[2]<t[2]||i[1]>t[1]||i[3]<t[3])}function gw(i,t){return i[0]===t[0]&&i[1]===t[1]}function zT(i,t){return[(i[0]+t[0])/2,(i[1]+t[1])/2]}function BT(i,t,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var n=[],r=i[0],s=i[1],o=i[2],a=i[3],l=t/di([r,s],[o,s],e),u=l*(o-r),h=t/di([r,s],[r,a],e),c=h*(a-s),d=o-r,g=a-s,p=Math.floor(d/u),E=Math.floor(g/c),b=(d-p*u)/2,P=(g-E*c)/2,v=r+b;v<=o;){for(var _=s+P;_<=a;){var m=Kt([v,_],e.properties);e.mask?dw(m,e.mask)&&n.push(m):n.push(m),_+=c}v+=u}return Fn(n)}function Vp(i,t){t===void 0&&(t={});var e=Bi(i);switch(!t.properties&&i.type==="Feature"&&(t.properties=i.properties),e.type){case"Polygon":return UT(e,t);case"MultiPolygon":return qT(e,t);default:throw new Error("invalid poly")}}function UT(i,t){t===void 0&&(t={});var e=Bi(i),n=e.coordinates,r=t.properties?t.properties:i.type==="Feature"?i.properties:{};return pw(n,r)}function qT(i,t){t===void 0&&(t={});var e=Bi(i),n=e.coordinates,r=t.properties?t.properties:i.type==="Feature"?i.properties:{},s=[];return n.forEach(function(o){s.push(pw(o,r))}),Fn(s)}function pw(i,t){return i.length>1?X2(i,t):yi(i[0],t)}function WT(i,t,e){e===void 0&&(e={});var n;e.final?n=mw(sn(t),sn(i)):n=mw(sn(i),sn(t));var r=n>180?-(360-n):n;return r}function mw(i,t){var e=zi(i[1]),n=zi(t[1]),r=zi(t[0]-i[0]);r>Math.PI&&(r-=2*Math.PI),r<-Math.PI&&(r+=2*Math.PI);var s=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(e/2+Math.PI/4)),o=Math.atan2(r,s);return(qd(o)+360)%360}function HT(i,t,e,n){n===void 0&&(n={});var r=t<0,s=Op(Math.abs(t),n.units,"meters");r&&(s=-Math.abs(s));var o=sn(i),a=XT(o,s,e);return a[0]+=a[0]-o[0]>180?-360:o[0]-a[0]>180?360:0,Kt(a,n.properties)}function XT(i,t,e,n){n=n===void 0?Ni:Number(n);var r=t/n,s=i[0]*Math.PI/180,o=zi(i[1]),a=zi(e),l=r*Math.cos(a),u=o+l;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var h=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),c=Math.abs(h)>1e-11?l/h:Math.cos(o),d=r*Math.sin(a)/c,g=s+d;return[(g*180/Math.PI+540)%360-180,u*180/Math.PI]}function $T(i,t){var e=!0;return La(i,function(n){La(t,function(r){if(e===!1)return!1;e=YT(n.geometry,r.geometry)})}),e}function YT(i,t){switch(i.type){case"Point":switch(t.type){case"Point":return!QT(i.coordinates,t.coordinates);case"LineString":return!vw(t,i);case"Polygon":return!_i(i,t)}break;case"LineString":switch(t.type){case"Point":return!vw(i,t);case"LineString":return!JT(i,t);case"Polygon":return!yw(t,i)}break;case"Polygon":switch(t.type){case"Point":return!_i(t,i);case"LineString":return!yw(i,t);case"Polygon":return!ZT(t,i)}}return!1}function vw(i,t){for(var e=0;e<i.coordinates.length-1;e++)if(KT(i.coordinates[e],i.coordinates[e+1],t.coordinates))return!0;return!1}function JT(i,t){var e=Fa(i,t);return e.features.length>0}function yw(i,t){for(var e=0,n=t.coordinates;e<n.length;e++){var r=n[e];if(_i(r,i))return!0}var s=Fa(t,Vp(i));return s.features.length>0}function ZT(i,t){for(var e=0,n=i.coordinates[0];e<n.length;e++){var r=n[e];if(_i(r,t))return!0}for(var s=0,o=t.coordinates[0];s<o.length;s++){var a=o[s];if(_i(a,i))return!0}var l=Fa(Vp(i),Vp(t));return l.features.length>0}function KT(i,t,e){var n=e[0]-i[0],r=e[1]-i[1],s=t[0]-i[0],o=t[1]-i[1],a=n*o-r*s;return a!==0?!1:Math.abs(s)>=Math.abs(o)?s>0?i[0]<=e[0]&&e[0]<=t[0]:t[0]<=e[0]&&e[0]<=i[0]:o>0?i[1]<=e[1]&&e[1]<=t[1]:t[1]<=e[1]&&e[1]<=i[1]}function QT(i,t){return i[0]===t[0]&&i[1]===t[1]}function tN(i,t){var e=Bi(i),n=Bi(t),r=e.type,s=n.type,o=e.coordinates,a=n.coordinates;switch(r){case"Point":switch(s){case"Point":return zp(o,a);default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"Point":return eN(e,n);case"MultiPoint":return iN(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"Point":return ro(n,e,{ignoreEndVertices:!0});case"LineString":return sN(e,n);case"MultiPoint":return nN(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Point":return _i(n,e,{ignoreBoundary:!0});case"LineString":return oN(e,n);case"Polygon":return aN(e,n);case"MultiPoint":return rN(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+r+" geometry not supported")}}function eN(i,t){var e,n=!1;for(e=0;e<i.coordinates.length;e++)if(zp(i.coordinates[e],t.coordinates)){n=!0;break}return n}function iN(i,t){for(var e=0,n=t.coordinates;e<n.length;e++){for(var r=n[e],s=!1,o=0,a=i.coordinates;o<a.length;o++){var l=a[o];if(zp(r,l)){s=!0;break}}if(!s)return!1}return!0}function nN(i,t){for(var e=!1,n=0,r=t.coordinates;n<r.length;n++){var s=r[n];if(ro(s,i,{ignoreEndVertices:!0})&&(e=!0),!ro(s,i))return!1}return!!e}function rN(i,t){for(var e=0,n=t.coordinates;e<n.length;e++){var r=n[e];if(!_i(r,i,{ignoreBoundary:!0}))return!1}return!0}function sN(i,t){for(var e=!1,n=0,r=t.coordinates;n<r.length;n++){var s=r[n];if(ro({type:"Point",coordinates:s},i,{ignoreEndVertices:!0})&&(e=!0),!ro({type:"Point",coordinates:s},i,{ignoreEndVertices:!1}))return!1}return e}function oN(i,t){var e=!1,n=0,r=ur(i),s=ur(t);if(!_w(r,s))return!1;for(n;n<t.coordinates.length-1;n++){var o=lN(t.coordinates[n],t.coordinates[n+1]);if(_i({type:"Point",coordinates:o},i,{ignoreBoundary:!0})){e=!0;break}}return e}function aN(i,t){if(i.type==="Feature"&&i.geometry===null||t.type==="Feature"&&t.geometry===null)return!1;var e=ur(i),n=ur(t);if(!_w(e,n))return!1;for(var r=Bi(t).coordinates,s=0,o=r;s<o.length;s++)for(var a=o[s],l=0,u=a;l<u.length;l++){var h=u[l];if(!_i(h,i))return!1}return!0}function _w(i,t){return!(i[0]>t[0]||i[2]<t[2]||i[1]>t[1]||i[3]<t[3])}function zp(i,t){return i[0]===t[0]&&i[1]===t[1]}function lN(i,t){return[(i[0]+t[0])/2,(i[1]+t[1])/2]}function uN(i,t){var e=!1;return La(i,function(n){La(t,function(r){if(e===!0)return!0;e=!$T(n.geometry,r.geometry)})}),e}class Bo{constructor(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}}function hN(i,t){return i>t?1:i<t?-1:0}function Uo(i,t,e){const n=new Bo(null,null);let r=n,s=n;for(;;){const o=e(i,t.key);if(o<0){if(t.left===null)break;if(e(i,t.left.key)<0){const a=t.left;if(t.left=a.right,a.right=t,t=a,t.left===null)break}s.left=t,s=t,t=t.left}else if(o>0){if(t.right===null)break;if(e(i,t.right.key)>0){const a=t.right;if(t.right=a.left,a.left=t,t=a,t.right===null)break}r.right=t,r=t,t=t.right}else break}return r.right=t.left,s.left=t.right,t.left=n.right,t.right=n.left,t}function Bp(i,t,e,n){const r=new Bo(i,t);if(e===null)return r.left=r.right=null,r;e=Uo(i,e,n);const s=n(i,e.key);return s<0?(r.left=e.left,r.right=e,e.left=null):s>=0&&(r.right=e.right,r.left=e,e.right=null),r}function ww(i,t,e){let n=null,r=null;if(t){t=Uo(i,t,e);const s=e(t.key,i);s===0?(n=t.left,r=t.right):s<0?(r=t.right,t.right=null,n=t):(n=t.left,t.left=null,r=t)}return{left:n,right:r}}function cN(i,t,e){return t===null?i:(i===null||(t=Uo(i.key,t,e),t.left=i),t)}function Up(i,t,e,n,r){if(i){n(`${t}${e?"└── ":"├── "}${r(i)}
45
45
  `);const s=t+(e?" ":"│ ");i.left&&Up(i.left,s,!1,n,r),i.right&&Up(i.right,s,!0,n,r)}}let qp=class{constructor(t=hN){this._root=null,this._size=0,this._comparator=t}insert(t,e){return this._size++,this._root=Bp(t,e,this._root,this._comparator)}add(t,e){const n=new Bo(t,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);const r=this._comparator,s=Uo(t,this._root,r),o=r(t,s.key);return o===0?this._root=s:(o<0?(n.left=s.left,n.right=s,s.left=null):o>0&&(n.right=s.right,n.left=s,s.right=null),this._size++,this._root=n),this._root}remove(t){this._root=this._remove(t,this._root,this._comparator)}_remove(t,e,n){let r;return e===null?null:(e=Uo(t,e,n),n(t,e.key)===0?(e.left===null?r=e.right:(r=Uo(t,e.left,n),r.right=e.right),this._size--,r):e)}pop(){let t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Uo(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null}findStatic(t){let e=this._root;const n=this._comparator;for(;e;){const r=n(t,e.key);if(r===0)return e;r<0?e=e.left:e=e.right}return null}find(t){return this._root&&(this._root=Uo(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root}contains(t){let e=this._root;const n=this._comparator;for(;e;){const r=n(t,e.key);if(r===0)return!0;r<0?e=e.left:e=e.right}return!1}forEach(t,e){let n=this._root;const r=[];let s=!1;for(;!s;)n!==null?(r.push(n),n=n.left):r.length!==0?(n=r.pop(),t.call(e,n),n=n.right):s=!0;return this}range(t,e,n,r){const s=[],o=this._comparator;let a=this._root,l;for(;s.length!==0||a;)if(a)s.push(a),a=a.left;else{if(a=s.pop(),l=o(a.key,e),l>0)break;if(o(a.key,t)>=0&&n.call(r,a))return this;a=a.right}return this}keys(){const t=[];return this.forEach(({key:e})=>{t.push(e)}),t}values(){const t=[];return this.forEach(({data:e})=>{t.push(e)}),t}min(){return this._root?this.minNode(this._root).key:null}max(){return this._root?this.maxNode(this._root).key:null}minNode(t=this._root){if(t)for(;t.left;)t=t.left;return t}maxNode(t=this._root){if(t)for(;t.right;)t=t.right;return t}at(t){let e=this._root,n=!1,r=0;const s=[];for(;!n;)if(e)s.push(e),e=e.left;else if(s.length>0){if(e=s.pop(),r===t)return e;r++,e=e.right}else n=!0;return null}next(t){let e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}const r=this._comparator;for(;e;){const s=r(t.key,e.key);if(s===0)break;s<0?(n=e,e=e.left):e=e.right}return n}prev(t){let e=this._root,n=null;if(t.left!==null){for(n=t.left;n.right;)n=n.right;return n}const r=this._comparator;for(;e;){const s=r(t.key,e.key);if(s===0)break;s<0?e=e.left:(n=e,e=e.right)}return n}clear(){return this._root=null,this._size=0,this}toList(){return fN(this._root)}load(t,e=[],n=!1){let r=t.length;const s=this._comparator;if(n&&Xp(t,e,0,r-1,s),this._root===null)this._root=Wp(t,e,0,r),this._size=r;else{const o=gN(this.toList(),dN(t,e),s);r=this._size+r,this._root=Hp({head:o},0,r)}return this}isEmpty(){return this._root===null}get size(){return this._size}get root(){return this._root}toString(t=e=>String(e.key)){const e=[];return Up(this._root,"",!0,n=>e.push(n),t),e.join("")}update(t,e,n){const r=this._comparator;let{left:s,right:o}=ww(t,this._root,r);r(t,e)<0?o=Bp(e,n,o,r):s=Bp(e,n,s,r),this._root=cN(s,o,r)}split(t){return ww(t,this._root,this._comparator)}*[Symbol.iterator](){let t=this._root;const e=[];let n=!1;for(;!n;)t!==null?(e.push(t),t=t.left):e.length!==0?(t=e.pop(),yield t,t=t.right):n=!0}};function Wp(i,t,e,n){const r=n-e;if(r>0){const s=e+Math.floor(r/2),o=i[s],a=t[s],l=new Bo(o,a);return l.left=Wp(i,t,e,s),l.right=Wp(i,t,s+1,n),l}return null}function dN(i,t){const e=new Bo(null,null);let n=e;for(let r=0;r<i.length;r++)n=n.next=new Bo(i[r],t[r]);return n.next=null,e.next}function fN(i){let t=i;const e=[];let n=!1;const r=new Bo(null,null);let s=r;for(;!n;)t?(e.push(t),t=t.left):e.length>0?(t=s=s.next=e.pop(),t=t.right):n=!0;return s.next=null,r.next}function Hp(i,t,e){const n=e-t;if(n>0){const r=t+Math.floor(n/2),s=Hp(i,t,r),o=i.head;return o.left=s,i.head=i.head.next,o.right=Hp(i,r+1,e),o}return null}function gN(i,t,e){const n=new Bo(null,null);let r=n,s=i,o=t;for(;s!==null&&o!==null;)e(s.key,o.key)<0?(r.next=s,s=s.next):(r.next=o,o=o.next),r=r.next;return s!==null?r.next=s:o!==null&&(r.next=o),n.next}function Xp(i,t,e,n,r){if(e>=n)return;const s=i[e+n>>1];let o=e-1,a=n+1;for(;;){do o++;while(r(i[o],s)<0);do a--;while(r(i[a],s)>0);if(o>=a)break;let l=i[o];i[o]=i[a],i[a]=l,l=t[o],t[o]=t[a],t[a]=l}Xp(i,t,e,a,r),Xp(i,t,a+1,n,r)}const so=11102230246251565e-32,Ui=134217729,pN=(3+8*so)*so;function $p(i,t,e,n,r){let s,o,a,l,u=t[0],h=n[0],c=0,d=0;h>u==h>-u?(s=u,u=t[++c]):(s=h,h=n[++d]);let g=0;if(c<i&&d<e)for(h>u==h>-u?(o=u+s,a=s-(o-u),u=t[++c]):(o=h+s,a=s-(o-h),h=n[++d]),s=o,a!==0&&(r[g++]=a);c<i&&d<e;)h>u==h>-u?(o=s+u,l=o-s,a=s-(o-l)+(u-l),u=t[++c]):(o=s+h,l=o-s,a=s-(o-l)+(h-l),h=n[++d]),s=o,a!==0&&(r[g++]=a);for(;c<i;)o=s+u,l=o-s,a=s-(o-l)+(u-l),u=t[++c],s=o,a!==0&&(r[g++]=a);for(;d<e;)o=s+h,l=o-s,a=s-(o-l)+(h-l),h=n[++d],s=o,a!==0&&(r[g++]=a);return(s!==0||g===0)&&(r[g++]=s),g}function mN(i,t){let e=t[0];for(let n=1;n<i;n++)e+=t[n];return e}function rc(i){return new Float64Array(i)}const vN=(3+16*so)*so,yN=(2+12*so)*so,_N=(9+64*so)*so*so,eu=rc(4),Ew=rc(8),Sw=rc(12),bw=rc(16),on=rc(4);function wN(i,t,e,n,r,s,o){let a,l,u,h,c,d,g,p,E,b,P,v,_,m,y,S,C,x;const I=i-r,M=e-r,T=t-s,R=n-s;m=I*R,d=Ui*I,g=d-(d-I),p=I-g,d=Ui*R,E=d-(d-R),b=R-E,y=p*b-(m-g*E-p*E-g*b),S=T*M,d=Ui*T,g=d-(d-T),p=T-g,d=Ui*M,E=d-(d-M),b=M-E,C=p*b-(S-g*E-p*E-g*b),P=y-C,c=y-P,eu[0]=y-(P+c)+(c-C),v=m+P,c=v-m,_=m-(v-c)+(P-c),P=_-S,c=_-P,eu[1]=_-(P+c)+(c-S),x=v+P,c=x-v,eu[2]=v-(x-c)+(P-c),eu[3]=x;let A=mN(4,eu),N=yN*o;if(A>=N||-A>=N||(c=i-I,a=i-(I+c)+(c-r),c=e-M,u=e-(M+c)+(c-r),c=t-T,l=t-(T+c)+(c-s),c=n-R,h=n-(R+c)+(c-s),a===0&&l===0&&u===0&&h===0)||(N=_N*o+pN*Math.abs(A),A+=I*h+R*a-(T*u+M*l),A>=N||-A>=N))return A;m=a*R,d=Ui*a,g=d-(d-a),p=a-g,d=Ui*R,E=d-(d-R),b=R-E,y=p*b-(m-g*E-p*E-g*b),S=l*M,d=Ui*l,g=d-(d-l),p=l-g,d=Ui*M,E=d-(d-M),b=M-E,C=p*b-(S-g*E-p*E-g*b),P=y-C,c=y-P,on[0]=y-(P+c)+(c-C),v=m+P,c=v-m,_=m-(v-c)+(P-c),P=_-S,c=_-P,on[1]=_-(P+c)+(c-S),x=v+P,c=x-v,on[2]=v-(x-c)+(P-c),on[3]=x;const V=$p(4,eu,4,on,Ew);m=I*h,d=Ui*I,g=d-(d-I),p=I-g,d=Ui*h,E=d-(d-h),b=h-E,y=p*b-(m-g*E-p*E-g*b),S=T*u,d=Ui*T,g=d-(d-T),p=T-g,d=Ui*u,E=d-(d-u),b=u-E,C=p*b-(S-g*E-p*E-g*b),P=y-C,c=y-P,on[0]=y-(P+c)+(c-C),v=m+P,c=v-m,_=m-(v-c)+(P-c),P=_-S,c=_-P,on[1]=_-(P+c)+(c-S),x=v+P,c=x-v,on[2]=v-(x-c)+(P-c),on[3]=x;const G=$p(V,Ew,4,on,Sw);m=a*h,d=Ui*a,g=d-(d-a),p=a-g,d=Ui*h,E=d-(d-h),b=h-E,y=p*b-(m-g*E-p*E-g*b),S=l*u,d=Ui*l,g=d-(d-l),p=l-g,d=Ui*u,E=d-(d-u),b=u-E,C=p*b-(S-g*E-p*E-g*b),P=y-C,c=y-P,on[0]=y-(P+c)+(c-C),v=m+P,c=v-m,_=m-(v-c)+(P-c),P=_-S,c=_-P,on[1]=_-(P+c)+(c-S),x=v+P,c=x-v,on[2]=v-(x-c)+(P-c),on[3]=x;const q=$p(G,Sw,4,on,bw);return bw[q-1]}function EN(i,t,e,n,r,s){const o=(t-s)*(e-r),a=(i-r)*(n-s),l=o-a,u=Math.abs(o+a);return Math.abs(l)>=vN*u?l:-wN(i,t,e,n,r,s,u)}const sc=(i,t)=>i.ll.x<=t.x&&t.x<=i.ur.x&&i.ll.y<=t.y&&t.y<=i.ur.y,Yp=(i,t)=>{if(t.ur.x<i.ll.x||i.ur.x<t.ll.x||t.ur.y<i.ll.y||i.ur.y<t.ll.y)return null;const e=i.ll.x<t.ll.x?t.ll.x:i.ll.x,n=i.ur.x<t.ur.x?i.ur.x:t.ur.x,r=i.ll.y<t.ll.y?t.ll.y:i.ll.y,s=i.ur.y<t.ur.y?i.ur.y:t.ur.y;return{ll:{x:e,y:r},ur:{x:n,y:s}}};let qo=Number.EPSILON;qo===void 0&&(qo=Math.pow(2,-52));const SN=qo*qo,Cw=(i,t)=>{if(-qo<i&&i<qo&&-qo<t&&t<qo)return 0;const e=i-t;return e*e<SN*i*t?0:i<t?-1:1};class bN{constructor(){this.reset()}reset(){this.xRounder=new Pw,this.yRounder=new Pw}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}class Pw{constructor(){this.tree=new qp,this.round(0)}round(t){const e=this.tree.add(t),n=this.tree.prev(e);if(n!==null&&Cw(e.key,n.key)===0)return this.tree.remove(t),n.key;const r=this.tree.next(e);return r!==null&&Cw(e.key,r.key)===0?(this.tree.remove(t),r.key):t}}const oc=new bN,Yd=(i,t)=>i.x*t.y-i.y*t.x,xw=(i,t)=>i.x*t.x+i.y*t.y,Iw=(i,t,e)=>{const n=EN(i.x,i.y,t.x,t.y,e.x,e.y);return n>0?-1:n<0?1:0},Jd=i=>Math.sqrt(xw(i,i)),CN=(i,t,e)=>{const n={x:t.x-i.x,y:t.y-i.y},r={x:e.x-i.x,y:e.y-i.y};return Yd(r,n)/Jd(r)/Jd(n)},PN=(i,t,e)=>{const n={x:t.x-i.x,y:t.y-i.y},r={x:e.x-i.x,y:e.y-i.y};return xw(r,n)/Jd(r)/Jd(n)},Mw=(i,t,e)=>t.y===0?null:{x:i.x+t.x/t.y*(e-i.y),y:e},Tw=(i,t,e)=>t.x===0?null:{x:e,y:i.y+t.y/t.x*(e-i.x)},xN=(i,t,e,n)=>{if(t.x===0)return Tw(e,n,i.x);if(n.x===0)return Tw(i,t,e.x);if(t.y===0)return Mw(e,n,i.y);if(n.y===0)return Mw(i,t,e.y);const r=Yd(t,n);if(r==0)return null;const s={x:e.x-i.x,y:e.y-i.y},o=Yd(s,t)/r,a=Yd(s,n)/r,l=i.x+a*t.x,u=e.x+o*n.x,h=i.y+a*t.y,c=e.y+o*n.y,d=(l+u)/2,g=(h+c)/2;return{x:d,y:g}};class cr{static compare(t,e){const n=cr.comparePoints(t.point,e.point);return n!==0?n:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:Wo.compare(t.segment,e.segment))}static comparePoints(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}constructor(t,e){t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const e=t.point.events;for(let n=0,r=e.length;n<r;n++){const s=e[n];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let e=0;e<t;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let r=e+1;r<t;r++){const s=this.point.events[r];s.consumedBy===void 0&&n.otherSE.point.events===s.otherSE.point.events&&n.segment.consume(s.segment)}}}getAvailableLinkedEvents(){const t=[];for(let e=0,n=this.point.events.length;e<n;e++){const r=this.point.events[e];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&t.push(r)}return t}getLeftmostComparator(t){const e=new Map,n=r=>{const s=r.otherSE;e.set(r,{sine:CN(this.point,t.point,s.point),cosine:PN(this.point,t.point,s.point)})};return(r,s)=>{e.has(r)||n(r),e.has(s)||n(s);const{sine:o,cosine:a}=e.get(r),{sine:l,cosine:u}=e.get(s);return o>=0&&l>=0?a<u?1:a>u?-1:0:o<0&&l<0?a<u?-1:a>u?1:0:l<o?-1:l>o?1:0}}}let IN=0;class Wo{static compare(t,e){const n=t.leftSE.point.x,r=e.leftSE.point.x,s=t.rightSE.point.x,o=e.rightSE.point.x;if(o<n)return 1;if(s<r)return-1;const a=t.leftSE.point.y,l=e.leftSE.point.y,u=t.rightSE.point.y,h=e.rightSE.point.y;if(n<r){if(l<a&&l<u)return 1;if(l>a&&l>u)return-1;const c=t.comparePoint(e.leftSE.point);if(c<0)return 1;if(c>0)return-1;const d=e.comparePoint(t.rightSE.point);return d!==0?d:-1}if(n>r){if(a<l&&a<h)return-1;if(a>l&&a>h)return 1;const c=e.comparePoint(t.leftSE.point);if(c!==0)return c;const d=t.comparePoint(e.rightSE.point);return d<0?1:d>0?-1:1}if(a<l)return-1;if(a>l)return 1;if(s<o){const c=e.comparePoint(t.rightSE.point);if(c!==0)return c}if(s>o){const c=t.comparePoint(e.rightSE.point);if(c<0)return 1;if(c>0)return-1}if(s!==o){const c=u-a,d=s-n,g=h-l,p=o-r;if(c>d&&g<p)return 1;if(c<d&&g>p)return-1}return s>o?1:s<o||u<h?-1:u>h?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,n,r){this.id=++IN,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=r}static fromRing(t,e,n){let r,s,o;const a=cr.comparePoints(t,e);if(a<0)r=t,s=e,o=1;else if(a>0)r=e,s=t,o=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);const l=new cr(r,!0),u=new cr(s,!1);return new Wo(l,u,[n],[o])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const e=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x<e.x?1:-1;const s=(t.y-e.y)/r.y,o=e.x+s*r.x;if(t.x===o)return 0;const a=(t.x-e.x)/r.x,l=e.y+a*r.y;return t.y===l?0:t.y<l?-1:1}getIntersection(t){const e=this.bbox(),n=t.bbox(),r=Yp(e,n);if(r===null)return null;const s=this.leftSE.point,o=this.rightSE.point,a=t.leftSE.point,l=t.rightSE.point,u=sc(e,a)&&this.comparePoint(a)===0,h=sc(n,s)&&t.comparePoint(s)===0,c=sc(e,l)&&this.comparePoint(l)===0,d=sc(n,o)&&t.comparePoint(o)===0;if(h&&u)return d&&!c?o:!d&&c?l:null;if(h)return c&&s.x===l.x&&s.y===l.y?null:s;if(u)return d&&o.x===a.x&&o.y===a.y?null:a;if(d&&c)return null;if(d)return o;if(c)return l;const g=xN(s,this.vector(),a,t.vector());return g===null||!sc(r,g)?null:oc.round(g.x,g.y)}split(t){const e=[],n=t.events!==void 0,r=new cr(t,!0),s=new cr(t,!1),o=this.rightSE;this.replaceRightSE(s),e.push(s),e.push(r);const a=new Wo(r,o,this.rings.slice(),this.windings.slice());return cr.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),cr.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),s.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(t){let e=this,n=t;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const r=Wo.compare(e,n);if(r!==0){if(r>0){const s=e;e=n,n=s}if(e.prev===n){const s=e;e=n,n=s}for(let s=0,o=n.rings.length;s<o;s++){const a=n.rings[s],l=n.windings[s],u=e.rings.indexOf(a);u===-1?(e.rings.push(a),e.windings.push(l)):e.windings[u]+=l}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys;for(let a=0,l=this.rings.length;a<l;a++){const u=this.rings[a],h=this.windings[a],c=e.indexOf(u);c===-1?(e.push(u),n.push(h)):n[c]+=h}const s=[],o=[];for(let a=0,l=e.length;a<l;a++){if(n[a]===0)continue;const u=e[a],h=u.poly;if(o.indexOf(h)===-1)if(u.isExterior)s.push(h);else{o.indexOf(h)===-1&&o.push(h);const c=s.indexOf(u.poly);c!==-1&&s.splice(c,1)}}for(let a=0,l=s.length;a<l;a++){const u=s[a].multiPoly;r.indexOf(u)===-1&&r.push(u)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Vr.type){case"union":{const n=t.length===0,r=e.length===0;this._isInResult=n!==r;break}case"intersection":{let n,r;t.length<e.length?(n=t.length,r=e.length):(n=e.length,r=t.length),this._isInResult=r===Vr.numMultiPolys&&n<r;break}case"xor":{const n=Math.abs(t.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=r=>r.length===1&&r[0].isSubject;this._isInResult=n(t)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${Vr.type}`)}return this._isInResult}}class Nw{constructor(t,e,n){if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=oc.round(t[0][0],t[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let s=r;for(let o=1,a=t.length;o<a;o++){if(typeof t[o][0]!="number"||typeof t[o][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=oc.round(t[o][0],t[o][1]);l.x===s.x&&l.y===s.y||(this.segments.push(Wo.fromRing(s,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),s=l)}(r.x!==s.x||r.y!==s.y)&&this.segments.push(Wo.fromRing(s,r,this))}getSweepEvents(){const t=[];for(let e=0,n=this.segments.length;e<n;e++){const r=this.segments[e];t.push(r.leftSE),t.push(r.rightSE)}return t}}class MN{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Nw(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,r=t.length;n<r;n++){const s=new Nw(t[n],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=e}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const r=this.interiorRings[e].getSweepEvents();for(let s=0,o=r.length;s<o;s++)t.push(r[s])}return t}}class Ow{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,r=t.length;n<r;n++){const s=new MN(t[n],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=e}getSweepEvents(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const r=this.polys[e].getSweepEvents();for(let s=0,o=r.length;s<o;s++)t.push(r[s])}return t}}class Zd{static factory(t){const e=[];for(let n=0,r=t.length;n<r;n++){const s=t[n];if(!s.isInResult()||s.ringOut)continue;let o=null,a=s.leftSE,l=s.rightSE;const u=[a],h=a.point,c=[];for(;o=a,a=l,u.push(a),a.point!==h;)for(;;){const d=a.getAvailableLinkedEvents();if(d.length===0){const E=u[0].point,b=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${E.x}, ${E.y}]. Last matching segment found ends at [${b.x}, ${b.y}].`)}if(d.length===1){l=d[0].otherSE;break}let g=null;for(let E=0,b=c.length;E<b;E++)if(c[E].point===a.point){g=E;break}if(g!==null){const E=c.splice(g)[0],b=u.splice(E.index);b.unshift(b[0].otherSE),e.push(new Zd(b.reverse()));continue}c.push({index:u.length,point:a.point});const p=a.getLeftmostComparator(o);l=d.sort(p)[0].otherSE;break}e.push(new Zd(u))}return e}constructor(t){this.events=t;for(let e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const e=[t];for(let u=1,h=this.events.length-1;u<h;u++){const c=this.events[u].point,d=this.events[u+1].point;Iw(c,t,d)!==0&&(e.push(c),t=c)}if(e.length===1)return null;const n=e[0],r=e[1];Iw(n,t,r)===0&&e.shift(),e.push(e[0]);const s=this.isExteriorRing()?1:-1,o=this.isExteriorRing()?0:e.length-1,a=this.isExteriorRing()?e.length:-1,l=[];for(let u=o;u!=a;u+=s)l.push([e[u].x,e[u].y]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){const t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let r=1,s=this.events.length;r<s;r++){const o=this.events[r];cr.compare(t,o)>0&&(t=o)}let e=t.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class Dw{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const r=this.interiorRings[e].getGeom();r!==null&&t.push(r)}return t}}class TN{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const r=this.polys[e].getGeom();r!==null&&t.push(r)}return t}_composePolys(t){const e=[];for(let n=0,r=t.length;n<r;n++){const s=t[n];if(!s.poly)if(s.isExteriorRing())e.push(new Dw(s));else{const o=s.enclosingRing();o.poly||e.push(new Dw(o)),o.poly.addInterior(s)}}return e}}class NN{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Wo.compare;this.queue=t,this.tree=new qp(e),this.segments=[]}process(t){const e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;const r=t.isLeft?this.tree.add(e):this.tree.find(e);if(!r)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let s=r,o=r,a,l;for(;a===void 0;)s=this.tree.prev(s),s===null?a=null:s.key.consumedBy===void 0&&(a=s.key);for(;l===void 0;)o=this.tree.next(o),o===null?l=null:o.key.consumedBy===void 0&&(l=o.key);if(t.isLeft){let u=null;if(a){const c=a.getIntersection(e);if(c!==null&&(e.isAnEndpoint(c)||(u=c),!a.isAnEndpoint(c))){const d=this._splitSafely(a,c);for(let g=0,p=d.length;g<p;g++)n.push(d[g])}}let h=null;if(l){const c=l.getIntersection(e);if(c!==null&&(e.isAnEndpoint(c)||(h=c),!l.isAnEndpoint(c))){const d=this._splitSafely(l,c);for(let g=0,p=d.length;g<p;g++)n.push(d[g])}}if(u!==null||h!==null){let c=null;u===null?c=h:h===null?c=u:c=cr.comparePoints(u,h)<=0?u:h,this.queue.remove(e.rightSE),n.push(e.rightSE);const d=e.split(c);for(let g=0,p=d.length;g<p;g++)n.push(d[g])}n.length>0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&l){const u=a.getIntersection(l);if(u!==null){if(!a.isAnEndpoint(u)){const h=this._splitSafely(a,u);for(let c=0,d=h.length;c<d;c++)n.push(h[c])}if(!l.isAnEndpoint(u)){const h=this._splitSafely(l,u);for(let c=0,d=h.length;c<d;c++)n.push(h[c])}}}this.tree.remove(e)}return n}_splitSafely(t,e){this.tree.remove(t);const n=t.rightSE;this.queue.remove(n);const r=t.split(e);return r.push(n),t.consumedBy===void 0&&this.tree.add(t),r}}const Rw=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,ON=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class DN{run(t,e,n){Vr.type=t,oc.reset();const r=[new Ow(e,!0)];for(let c=0,d=n.length;c<d;c++)r.push(new Ow(n[c],!1));if(Vr.numMultiPolys=r.length,Vr.type==="difference"){const c=r[0];let d=1;for(;d<r.length;)Yp(r[d].bbox,c.bbox)!==null?d++:r.splice(d,1)}if(Vr.type==="intersection")for(let c=0,d=r.length;c<d;c++){const g=r[c];for(let p=c+1,E=r.length;p<E;p++)if(Yp(g.bbox,r[p].bbox)===null)return[]}const s=new qp(cr.compare);for(let c=0,d=r.length;c<d;c++){const g=r[c].getSweepEvents();for(let p=0,E=g.length;p<E;p++)if(s.insert(g[p]),s.size>Rw)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const o=new NN(s);let a=s.size,l=s.pop();for(;l;){const c=l.key;if(s.size===a){const g=c.segment;throw new Error(`Unable to pop() ${c.isLeft?"left":"right"} SweepEvent [${c.point.x}, ${c.point.y}] from segment #${g.id} [${g.leftSE.point.x}, ${g.leftSE.point.y}] -> [${g.rightSE.point.x}, ${g.rightSE.point.y}] from queue.`)}if(s.size>Rw)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(o.segments.length>ON)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const d=o.process(c);for(let g=0,p=d.length;g<p;g++){const E=d[g];E.consumedBy===void 0&&s.insert(E)}a=s.size,l=s.pop()}oc.reset();const u=Zd.factory(o.segments);return new TN(u).getGeom()}}const Vr=new DN;var Jp={union:function(i){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return Vr.run("union",i,e)},intersection:function(i){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return Vr.run("intersection",i,e)},xor:function(i){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return Vr.run("xor",i,e)},difference:function(i){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return Vr.run("difference",i,e)}};function RN(i,t){var e=Bi(i),n=Bi(t),r=i.properties||{},s=Jp.difference(e.coordinates,n.coordinates);return s.length===0?null:s.length===1?ue(s[0],r):Mp(s,r)}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(n+r,0):Math.min(r,n);var s=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:n;for(s=s<0?Math.max(n+arguments[2],0):Math.min(s,n);r<s;)e[r]=t,++r;return e},writable:!0}),Number.isFinite=Number.isFinite||function(i){return typeof i=="number"&&isFinite(i)},Number.isInteger=Number.isInteger||function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(i){return i!==i},Math.trunc=Math.trunc||function(i){return i<0?Math.ceil(i):Math.floor(i)};var ka=function(){};ka.prototype.interfaces_=function(){return[]},ka.prototype.getClass=function(){return ka},ka.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var de=(function(i){function t(e){i.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=new i().stack}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t})(Error),Pt=function(){},Aw={MAX_VALUE:{configurable:!0}};Pt.isNaN=function(t){return Number.isNaN(t)},Pt.doubleToLongBits=function(t){return t},Pt.longBitsToDouble=function(t){return t},Pt.isInfinite=function(t){return!Number.isFinite(t)},Aw.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(Pt,Aw);var bn=function(){},Kd=function(){},iu=function(){};function Cn(){}var L=function i(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=i.NULL_ORDINATE;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.z=t.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=i.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},Ga={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};L.prototype.setOrdinate=function(t,e){switch(t){case L.X:this.x=e;break;case L.Y:this.y=e;break;case L.Z:this.z=e;break;default:throw new de("Invalid ordinate index: "+t)}},L.prototype.equals2D=function(){if(arguments.length===1){var t=arguments[0];return!(this.x!==t.x||this.y!==t.y)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return!(!ka.equalsWithTolerance(this.x,e.x,n)||!ka.equalsWithTolerance(this.y,e.y,n))}},L.prototype.getOrdinate=function(t){switch(t){case L.X:return this.x;case L.Y:return this.y;case L.Z:return this.z}throw new de("Invalid ordinate index: "+t)},L.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||Pt.isNaN(this.z))&&Pt.isNaN(t.z)},L.prototype.equals=function(t){return t instanceof L?this.equals2D(t):!1},L.prototype.equalInZ=function(t,e){return ka.equalsWithTolerance(this.z,t.z,e)},L.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},L.prototype.clone=function(){},L.prototype.copy=function(){return new L(this)},L.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},L.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},L.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},L.prototype.hashCode=function(){var t=17;return t=37*t+L.hashCode(this.x),t=37*t+L.hashCode(this.y),t},L.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},L.prototype.interfaces_=function(){return[bn,Kd,Cn]},L.prototype.getClass=function(){return L},L.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=Pt.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},Ga.DimensionalComparator.get=function(){return oo},Ga.serialVersionUID.get=function(){return 6683108902428367e3},Ga.NULL_ORDINATE.get=function(){return Pt.NaN},Ga.X.get=function(){return 0},Ga.Y.get=function(){return 1},Ga.Z.get=function(){return 2},Object.defineProperties(L,Ga);var oo=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new de("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};oo.prototype.compare=function(t,e){var n=t,r=e,s=oo.compare(n.x,r.x);if(s!==0)return s;var o=oo.compare(n.y,r.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var a=oo.compare(n.z,r.z);return a},oo.prototype.interfaces_=function(){return[iu]},oo.prototype.getClass=function(){return oo},oo.compare=function(t,e){return t<e?-1:t>e?1:Pt.isNaN(t)?Pt.isNaN(e)?0:-1:Pt.isNaN(e)?1:0};var nu=function(){};nu.prototype.create=function(){},nu.prototype.interfaces_=function(){return[]},nu.prototype.getClass=function(){return nu};var k=function(){},ac={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};k.prototype.interfaces_=function(){return[]},k.prototype.getClass=function(){return k},k.toLocationSymbol=function(t){switch(t){case k.EXTERIOR:return"e";case k.BOUNDARY:return"b";case k.INTERIOR:return"i";case k.NONE:return"-"}throw new de("Unknown location value: "+t)},ac.INTERIOR.get=function(){return 0},ac.BOUNDARY.get=function(){return 1},ac.EXTERIOR.get=function(){return 2},ac.NONE.get=function(){return-1},Object.defineProperties(k,ac);var St=function(i,t){return i.interfaces_&&i.interfaces_().indexOf(t)>-1},an=function(){},Lw={LOG_10:{configurable:!0}};an.prototype.interfaces_=function(){return[]},an.prototype.getClass=function(){return an},an.log10=function(t){var e=Math.log(t);return Pt.isInfinite(e)||Pt.isNaN(e)?e:e/an.LOG_10},an.min=function(t,e,n,r){var s=t;return e<s&&(s=e),n<s&&(s=n),r<s&&(s=r),s},an.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],s=arguments[1],o=arguments[2];return r<s?s:r>o?o:r}},an.wrap=function(t,e){return t<0?e- -t%e:t%e},an.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2],r=t;return e>r&&(r=e),n>r&&(r=n),r}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],l=arguments[3],u=s;return o>u&&(u=o),a>u&&(u=a),l>u&&(u=l),u}},an.average=function(t,e){return(t+e)/2},Lw.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(an,Lw);var dr=function(t){this.str=t};dr.prototype.append=function(t){this.str+=t},dr.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},dr.prototype.toString=function(t){return this.str};var fr=function(t){this.value=t};fr.prototype.intValue=function(){return this.value},fr.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},fr.isNaN=function(t){return Number.isNaN(t)};var lc=function(){};lc.isWhitespace=function(t){return t<=32&&t>=0||t===127},lc.toUpperCase=function(t){return t.toUpperCase()};var j=function i(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof i){var e=arguments[0];this.init(e)}else if(typeof arguments[0]=="string"){var n=arguments[0];i.call(this,i.parse(n))}}else if(arguments.length===2){var r=arguments[0],s=arguments[1];this.init(r,s)}},Gn={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};j.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},j.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=j.magnitude(n._hi),s=j.TEN.pow(r);n=n.divide(s),n.gt(j.TEN)?(n=n.divide(j.TEN),r+=1):n.lt(j.ONE)&&(n=n.multiply(j.TEN),r-=1);for(var o=r+1,a=new dr,l=j.MAX_PRINT_DIGITS-1,u=0;u<=l;u++){t&&u===o&&a.append(".");var h=Math.trunc(n._hi);if(h<0)break;var c=!1,d=0;h>9?(c=!0,d="9"):d="0"+h,a.append(d),n=n.subtract(j.valueOf(h)).multiply(j.TEN),c&&n.selfAdd(j.TEN);var g=!0,p=j.magnitude(n._hi);if(p<0&&Math.abs(p)>=l-u&&(g=!1),!g)break}return e[0]=r,a.toString()},j.prototype.sqr=function(){return this.multiply(this)},j.prototype.doubleValue=function(){return this._hi+this._lo},j.prototype.subtract=function(){if(arguments[0]instanceof j){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},j.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},j.prototype.isZero=function(){return this._hi===0&&this._lo===0},j.prototype.selfSubtract=function(){if(arguments[0]instanceof j){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},j.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},j.prototype.min=function(t){return this.le(t)?this:t},j.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof j){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1],s=null,o=null,a=null,l=null,u=null,h=null,c=null,d=null;return u=this._hi/n,h=j.SPLIT*u,s=h-u,d=j.SPLIT*n,s=h-s,o=u-s,a=d-n,c=u*n,a=d-a,l=n-a,d=s*a-c+s*l+o*a+o*l,h=(this._hi-c-d+this._lo-u*r)/n,d=u+h,this._hi=d,this._lo=u-d+h,this}},j.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},j.prototype.divide=function(){if(arguments[0]instanceof j){var t=arguments[0],e=null,n=null,r=null,s=null,o=null,a=null,l=null,u=null;o=this._hi/t._hi,a=j.SPLIT*o,e=a-o,u=j.SPLIT*t._hi,e=a-e,n=o-e,r=u-t._hi,l=o*t._hi,r=u-r,s=t._hi-r,u=e*r-l+e*s+n*r+n*s,a=(this._hi-l-u+this._lo-o*t._lo)/t._hi,u=o+a;var h=u,c=o-u+a;return new j(h,c)}else if(typeof arguments[0]=="number"){var d=arguments[0];return Pt.isNaN(d)?j.createNaN():j.copy(this).selfDivide(d,0)}},j.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},j.prototype.pow=function(t){if(t===0)return j.valueOf(1);var e=new j(this),n=j.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2===1&&n.selfMultiply(e),r/=2,r>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},j.prototype.ceil=function(){if(this.isNaN())return j.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new j(t,e)},j.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},j.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()},j.prototype.setValue=function(){if(arguments[0]instanceof j){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},j.prototype.max=function(t){return this.ge(t)?this:t},j.prototype.sqrt=function(){if(this.isZero())return j.valueOf(0);if(this.isNegative())return j.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=j.valueOf(e),r=this.subtract(n.sqr()),s=r._hi*(t*.5);return n.add(s)},j.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof j){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],n=null,r=null,s=null,o=null,a=null,l=null;return s=this._hi+e,a=s-this._hi,o=s-a,o=e-a+(this._hi-o),l=o+this._lo,n=s+l,r=l+(s-n),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(arguments.length===2){var u=arguments[0],h=arguments[1],c=null,d=null,g=null,p=null,E=null,b=null,P=null,v=null;E=this._hi+u,g=this._lo+h,P=E-this._hi,v=g-this._lo,b=E-P,p=g-v,b=u-P+(this._hi-b),p=h-v+(this._lo-p),P=b+g,c=E+P,d=P+(E-c),P=p+d;var _=c+P,m=P+(c-_);return this._hi=_,this._lo=m,this}},j.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof j){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1],s=null,o=null,a=null,l=null,u=null,h=null;u=j.SPLIT*this._hi,s=u-this._hi,h=j.SPLIT*n,s=u-s,o=this._hi-s,a=h-n,u=this._hi*n,a=h-a,l=n-a,h=s*a-u+s*l+o*a+o*l+(this._hi*r+this._lo*n);var c=u+h;s=u-c;var d=h+s;return this._hi=c,this._lo=d,this}},j.prototype.selfSqr=function(){return this.selfMultiply(this)},j.prototype.floor=function(){if(this.isNaN())return j.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new j(t,e)},j.prototype.negate=function(){return this.isNaN()?this:new j(-this._hi,-this._lo)},j.prototype.clone=function(){},j.prototype.multiply=function(){if(arguments[0]instanceof j){var t=arguments[0];return t.isNaN()?j.createNaN():j.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return Pt.isNaN(e)?j.createNaN():j.copy(this).selfMultiply(e,0)}},j.prototype.isNaN=function(){return Pt.isNaN(this._hi)},j.prototype.intValue=function(){return Math.trunc(this._hi)},j.prototype.toString=function(){var t=j.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},j.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,s=n;if(n.charAt(0)===".")s="0"+n;else if(r<0)s="0."+j.stringOfChar("0",-r)+n;else if(n.indexOf(".")===-1){var o=r-n.length,a=j.stringOfChar("0",o);s=n+a+".0"}return this.isNegative()?"-"+s:s},j.prototype.reciprocal=function(){var t=null,e=null,n=null,r=null,s=null,o=null,a=null,l=null;s=1/this._hi,o=j.SPLIT*s,t=o-s,l=j.SPLIT*this._hi,t=o-t,e=s-t,n=l-this._hi,a=s*this._hi,n=l-n,r=this._hi-n,l=t*n-a+t*r+e*n+e*r,o=(1-a-l-s*this._lo)/this._hi;var u=s+o,h=s-u+o;return new j(u,h)},j.prototype.toSciNotation=function(){if(this.isZero())return j.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=j.SCI_NOT_EXPONENT_CHAR+e[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var s="";n.length>1&&(s=n.substring(1));var o=n.charAt(0)+"."+s;return this.isNegative()?"-"+o+r:o+r},j.prototype.abs=function(){return this.isNaN()?j.NaN:this.isNegative()?this.negate():new j(this)},j.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},j.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},j.prototype.add=function(){if(arguments[0]instanceof j){var t=arguments[0];return j.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return j.copy(this).selfAdd(e)}},j.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof j){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this._hi=n,this._lo=r}},j.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},j.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},j.prototype.trunc=function(){return this.isNaN()?j.NaN:this.isPositive()?this.floor():this.ceil()},j.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},j.prototype.interfaces_=function(){return[Cn,bn,Kd]},j.prototype.getClass=function(){return j},j.sqr=function(t){return j.valueOf(t).selfMultiply(t)},j.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return j.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new j(e)}},j.sqrt=function(t){return j.valueOf(t).sqrt()},j.parse=function(t){for(var e=0,n=t.length;lc.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var s=t.charAt(e);(s==="-"||s==="+")&&(e++,s==="-"&&(r=!0))}for(var o=new j,a=0,l=0,u=0;!(e>=n);){var h=t.charAt(e);if(e++,lc.isDigit(h)){var c=h-"0";o.selfMultiply(j.TEN),o.selfAdd(c),a++;continue}if(h==="."){l=a;continue}if(h==="e"||h==="E"){var d=t.substring(e);try{u=fr.parseInt(d)}catch(P){throw P instanceof Error?new Error("Invalid exponent "+d+" in string "+t):P}finally{}break}throw new Error("Unexpected character '"+h+"' at position "+e+" in string "+t)}var g=o,p=a-l-u;if(p===0)g=o;else if(p>0){var E=j.TEN.pow(p);g=o.divide(E)}else if(p<0){var b=j.TEN.pow(-p);g=o.multiply(b)}return r?g.negate():g},j.createNaN=function(){return new j(Pt.NaN,Pt.NaN)},j.copy=function(t){return new j(t)},j.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n)),s=Math.pow(10,r);return s*10<=e&&(r+=1),r},j.stringOfChar=function(t,e){for(var n=new dr,r=0;r<e;r++)n.append(t);return n.toString()},Gn.PI.get=function(){return new j(3.141592653589793,12246467991473532e-32)},Gn.TWO_PI.get=function(){return new j(6.283185307179586,24492935982947064e-32)},Gn.PI_2.get=function(){return new j(1.5707963267948966,6123233995736766e-32)},Gn.E.get=function(){return new j(2.718281828459045,14456468917292502e-32)},Gn.NaN.get=function(){return new j(Pt.NaN,Pt.NaN)},Gn.EPS.get=function(){return 123259516440783e-46},Gn.SPLIT.get=function(){return 134217729},Gn.MAX_PRINT_DIGITS.get=function(){return 32},Gn.TEN.get=function(){return j.valueOf(10)},Gn.ONE.get=function(){return j.valueOf(1)},Gn.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Gn.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(j,Gn);var Oi=function(){},Fw={DP_SAFE_EPSILON:{configurable:!0}};Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi},Oi.orientationIndex=function(t,e,n){var r=Oi.orientationIndexFilter(t,e,n);if(r<=1)return r;var s=j.valueOf(e.x).selfAdd(-t.x),o=j.valueOf(e.y).selfAdd(-t.y),a=j.valueOf(n.x).selfAdd(-e.x),l=j.valueOf(n.y).selfAdd(-e.y);return s.selfMultiply(l).selfSubtract(o.selfMultiply(a)).signum()},Oi.signOfDet2x2=function(t,e,n,r){var s=t.multiply(r).selfSubtract(e.multiply(n));return s.signum()},Oi.intersection=function(t,e,n,r){var s=j.valueOf(r.y).selfSubtract(n.y).selfMultiply(j.valueOf(e.x).selfSubtract(t.x)),o=j.valueOf(r.x).selfSubtract(n.x).selfMultiply(j.valueOf(e.y).selfSubtract(t.y)),a=s.subtract(o),l=j.valueOf(r.x).selfSubtract(n.x).selfMultiply(j.valueOf(t.y).selfSubtract(n.y)),u=j.valueOf(r.y).selfSubtract(n.y).selfMultiply(j.valueOf(t.x).selfSubtract(n.x)),h=l.subtract(u),c=h.selfDivide(a).doubleValue(),d=j.valueOf(t.x).selfAdd(j.valueOf(e.x).selfSubtract(t.x).selfMultiply(c)).doubleValue(),g=j.valueOf(e.x).selfSubtract(t.x).selfMultiply(j.valueOf(t.y).selfSubtract(n.y)),p=j.valueOf(e.y).selfSubtract(t.y).selfMultiply(j.valueOf(t.x).selfSubtract(n.x)),E=g.subtract(p),b=E.selfDivide(a).doubleValue(),P=j.valueOf(n.y).selfAdd(j.valueOf(r.y).selfSubtract(n.y).selfMultiply(b)).doubleValue();return new L(d,P)},Oi.orientationIndexFilter=function(t,e,n){var r=null,s=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),a=s-o;if(s>0){if(o<=0)return Oi.signum(a);r=s+o}else if(s<0){if(o>=0)return Oi.signum(a);r=-s-o}else return Oi.signum(a);var l=Oi.DP_SAFE_EPSILON*r;return a>=l||-a>=l?Oi.signum(a):2},Oi.signum=function(t){return t>0?1:t<0?-1:0},Fw.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Oi,Fw);var Gt=function(){},uc={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};uc.X.get=function(){return 0},uc.Y.get=function(){return 1},uc.Z.get=function(){return 2},uc.M.get=function(){return 3},Gt.prototype.setOrdinate=function(t,e,n){},Gt.prototype.size=function(){},Gt.prototype.getOrdinate=function(t,e){},Gt.prototype.getCoordinate=function(){},Gt.prototype.getCoordinateCopy=function(t){},Gt.prototype.getDimension=function(){},Gt.prototype.getX=function(t){},Gt.prototype.clone=function(){},Gt.prototype.expandEnvelope=function(t){},Gt.prototype.copy=function(){},Gt.prototype.getY=function(t){},Gt.prototype.toCoordinateArray=function(){},Gt.prototype.interfaces_=function(){return[Kd]},Gt.prototype.getClass=function(){return Gt},Object.defineProperties(Gt,uc);var kw=function(){},ru=(function(i){function t(){i.call(this,"Projective point not representable on the Cartesian plane.")}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(kw),ii=function(){};ii.arraycopy=function(t,e,n,r,s){for(var o=0,a=e;a<e+s;a++)n[r+o]=t[a],o++},ii.getProperty=function(t){return{"line.separator":`
46
- `}[t]};var jn=function i(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],n=arguments[1];this.x=e,this.y=n,this.w=1}else if(arguments[0]instanceof i&&arguments[1]instanceof i){var r=arguments[0],s=arguments[1];this.x=r.y*s.w-s.y*r.w,this.y=s.x*r.w-r.x*s.w,this.w=r.x*s.y-s.x*r.y}else if(arguments[0]instanceof L&&arguments[1]instanceof L){var o=arguments[0],a=arguments[1];this.x=o.y-a.y,this.y=a.x-o.x,this.w=o.x*a.y-a.x*o.y}}else if(arguments.length===3){var l=arguments[0],u=arguments[1],h=arguments[2];this.x=l,this.y=u,this.w=h}else if(arguments.length===4){var c=arguments[0],d=arguments[1],g=arguments[2],p=arguments[3],E=c.y-d.y,b=d.x-c.x,P=c.x*d.y-d.x*c.y,v=g.y-p.y,_=p.x-g.x,m=g.x*p.y-p.x*g.y;this.x=b*m-_*P,this.y=v*P-E*m,this.w=E*_-v*b}};jn.prototype.getY=function(){var t=this.y/this.w;if(Pt.isNaN(t)||Pt.isInfinite(t))throw new ru;return t},jn.prototype.getX=function(){var t=this.x/this.w;if(Pt.isNaN(t)||Pt.isInfinite(t))throw new ru;return t},jn.prototype.getCoordinate=function(){var t=new L;return t.x=this.getX(),t.y=this.getY(),t},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.intersection=function(t,e,n,r){var s=t.y-e.y,o=e.x-t.x,a=t.x*e.y-e.x*t.y,l=n.y-r.y,u=r.x-n.x,h=n.x*r.y-r.x*n.y,c=o*h-u*a,d=l*a-s*h,g=s*u-l*o,p=c/g,E=d/g;if(Pt.isNaN(p)||Pt.isInfinite(p)||Pt.isNaN(E)||Pt.isInfinite(E))throw new ru;return new L(p,E)};var ht=function i(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof i){var e=arguments[0];this.init(e)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],l=arguments[3];this.init(s,o,a,l)}},Gw={serialVersionUID:{configurable:!0}};ht.prototype.getArea=function(){return this.getWidth()*this.getHeight()},ht.prototype.equals=function(t){if(!(t instanceof ht))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},ht.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new ht;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,s=this._maxy<t._maxy?this._maxy:t._maxy;return new ht(e,r,n,s)},ht.prototype.isNull=function(){return this._maxx<this._minx},ht.prototype.getMaxX=function(){return this._maxx},ht.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof ht){var e=arguments[0];return this.isNull()||e.isNull()?!1:e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},ht.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof ht){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}else if(arguments[0]instanceof L){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.isNull()?!1:!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}},ht.prototype.getMinY=function(){return this._miny},ht.prototype.getMinX=function(){return this._minx},ht.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof ht){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},ht.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},ht.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},ht.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},ht.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},ht.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},ht.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},ht.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},ht.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},ht.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},ht.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof ht){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof L){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},ht.prototype.centre=function(){return this.isNull()?null:new L((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},ht.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof ht){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],l=arguments[3];s<o?(this._minx=s,this._maxx=o):(this._minx=o,this._maxx=s),a<l?(this._miny=a,this._maxy=l):(this._miny=l,this._maxy=a)}},ht.prototype.getMaxY=function(){return this._maxy},ht.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),e===0?n:n===0?e:Math.sqrt(e*e+n*n)},ht.prototype.hashCode=function(){var t=17;return t=37*t+L.hashCode(this._minx),t=37*t+L.hashCode(this._maxx),t=37*t+L.hashCode(this._miny),t=37*t+L.hashCode(this._maxy),t},ht.prototype.interfaces_=function(){return[bn,Cn]},ht.prototype.getClass=function(){return ht},ht.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var r=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],l=Math.min(o.x,a.x),u=Math.max(o.x,a.x),h=Math.min(r.x,s.x),c=Math.max(r.x,s.x);return!(h>u||c<l||(l=Math.min(o.y,a.y),u=Math.max(o.y,a.y),h=Math.min(r.y,s.y),c=Math.max(r.y,s.y),h>u)||c<l)}},Gw.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(ht,Gw);var gr={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},Qd=function(t){this.geometryFactory=t||new At};Qd.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var s=gr.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(s=gr.emptyTypeStr.exec(t),s[2]=void 0),s&&(n=s[1].toLowerCase(),r=s[2],su[n]&&(e=su[n].apply(this,[r]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},Qd.prototype.write=function(t){return this.extractGeometry(t)},Qd.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Es[e])return null;var n=e.toUpperCase(),r;return t.isEmpty()?r=n+" EMPTY":r=n+"("+Es[e].apply(this,[t])+")",r};var Es={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Es.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,n=[],r=0,s=t._geometries.length;r<s;++r)n.push("("+Es.point.apply(e,[t._geometries[r]])+")");return n.join(",")},linestring:function(t){for(var e=this,n=[],r=0,s=t._points._coordinates.length;r<s;++r)n.push(Es.coordinate.apply(e,[t._points._coordinates[r]]));return n.join(",")},linearring:function(t){for(var e=this,n=[],r=0,s=t._points._coordinates.length;r<s;++r)n.push(Es.coordinate.apply(e,[t._points._coordinates[r]]));return n.join(",")},multilinestring:function(t){for(var e=this,n=[],r=0,s=t._geometries.length;r<s;++r)n.push("("+Es.linestring.apply(e,[t._geometries[r]])+")");return n.join(",")},polygon:function(t){var e=this,n=[];n.push("("+Es.linestring.apply(this,[t._shell])+")");for(var r=0,s=t._holes.length;r<s;++r)n.push("("+Es.linestring.apply(e,[t._holes[r]])+")");return n.join(",")},multipolygon:function(t){for(var e=this,n=[],r=0,s=t._geometries.length;r<s;++r)n.push("("+Es.polygon.apply(e,[t._geometries[r]])+")");return n.join(",")},geometrycollection:function(t){for(var e=this,n=[],r=0,s=t._geometries.length;r<s;++r)n.push(e.extractGeometry(t._geometries[r]));return n.join(",")}},su={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(gr.spaces);return this.geometryFactory.createPoint(new L(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var n,r=t.trim().split(","),s=[],o=0,a=r.length;o<a;++o)n=r[o].replace(gr.trimParens,"$1"),s.push(su.point.apply(e,[n]));return this.geometryFactory.createMultiPoint(s)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),n=[],r,s=0,o=e.length;s<o;++s)r=e[s].trim().split(gr.spaces),n.push(new L(Number.parseFloat(r[0]),Number.parseFloat(r[1])));return this.geometryFactory.createLineString(n)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),n=[],r,s=0,o=e.length;s<o;++s)r=e[s].trim().split(gr.spaces),n.push(new L(Number.parseFloat(r[0]),Number.parseFloat(r[1])));return this.geometryFactory.createLinearRing(n)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var n,r=t.trim().split(gr.parenComma),s=[],o=0,a=r.length;o<a;++o)n=r[o].replace(gr.trimParens,"$1"),s.push(su.linestring.apply(e,[n]));return this.geometryFactory.createMultiLineString(s)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var n,r,s,o=t.trim().split(gr.parenComma),a,l=[],u=0,h=o.length;u<h;++u)n=o[u].replace(gr.trimParens,"$1"),r=su.linestring.apply(e,[n]),s=e.geometryFactory.createLinearRing(r._points),u===0?a=s:l.push(s);return this.geometryFactory.createPolygon(a,l)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var n,r=t.trim().split(gr.doubleParenComma),s=[],o=0,a=r.length;o<a;++o)n=r[o].replace(gr.trimParens,"$1"),s.push(su.polygon.apply(e,[n]));return this.geometryFactory.createMultiPolygon(s)},geometrycollection:function(t){var e=this;if(t===void 0)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var n=t.trim().split("|"),r=[],s=0,o=n.length;s<o;++s)r.push(e.read(n[s]));return this.geometryFactory.createGeometryCollection(r)}},Vn=function(t){this.parser=new Qd(t)};Vn.prototype.write=function(t){return this.parser.write(t)},Vn.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Ss=(function(i){function t(e){i.call(this,e),this.name="RuntimeException",this.message=e,this.stack=new i().stack}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t})(Error),tf=(function(i){function t(){if(i.call(this),arguments.length===0)i.call(this);else if(arguments.length===1){var e=arguments[0];i.call(this,e)}}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Ss),Tt=function(){};Tt.prototype.interfaces_=function(){return[]},Tt.prototype.getClass=function(){return Tt},Tt.shouldNeverReachHere=function(){if(arguments.length===0)Tt.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new tf("Should never reach here"+(t!==null?": "+t:""))}},Tt.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],Tt.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new tf:new tf(e)},Tt.equals=function(){var t,e,n;if(arguments.length===2)t=arguments[0],e=arguments[1],Tt.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],n=arguments[2],!e.equals(t)))throw new tf("Expected "+t+" but encountered "+e+(n!==null?": "+n:""))};var ge=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new L,this._intPt[1]=new L,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},ja={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};ge.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},ge.prototype.getTopologySummary=function(){var t=new dr;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},ge.prototype.computeIntersection=function(t,e,n,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,n,r)},ge.prototype.getIntersectionNum=function(){return this._result},ge.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var t=arguments[0],e=this.getEdgeDistance(t,0),n=this.getEdgeDistance(t,1);e>n?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},ge.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},ge.prototype.setPrecisionModel=function(t){this._precisionModel=t},ge.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],n=0;n<this._result;n++)if(!(t._intPt[n].equals2D(t._inputLines[e][0])||t._intPt[n].equals2D(t._inputLines[e][1])))return!0;return!1}},ge.prototype.getIntersection=function(t){return this._intPt[t]},ge.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},ge.prototype.hasIntersection=function(){return this._result!==ge.NO_INTERSECTION},ge.prototype.getEdgeDistance=function(t,e){var n=ge.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return n},ge.prototype.isCollinear=function(){return this._result===ge.COLLINEAR_INTERSECTION},ge.prototype.toString=function(){return Vn.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Vn.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},ge.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},ge.prototype.isIntersection=function(t){for(var e=this,n=0;n<this._result;n++)if(e._intPt[n].equals2D(t))return!0;return!1},ge.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge},ge.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),s=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))r>s?o=r:o=s;else{var a=Math.abs(t.x-e.x),l=Math.abs(t.y-e.y);r>s?o=a:o=l,o===0&&!t.equals(e)&&(o=Math.max(a,l))}return Tt.isTrue(!(o===0&&!t.equals(e)),"Bad distance calculation"),o},ge.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,s=t.y-e.y,o=Math.sqrt(r*r+s*s);return Tt.isTrue(!(o===0&&!t.equals(e)),"Invalid distance calculation"),o},ja.DONT_INTERSECT.get=function(){return 0},ja.DO_INTERSECT.get=function(){return 1},ja.COLLINEAR.get=function(){return 2},ja.NO_INTERSECTION.get=function(){return 0},ja.POINT_INTERSECTION.get=function(){return 1},ja.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(ge,ja);var Ho=(function(i){function t(){i.apply(this,arguments)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(n){var r=new ht(this._inputLines[0][0],this._inputLines[0][1]),s=new ht(this._inputLines[1][0],this._inputLines[1][1]);return r.contains(n)&&s.contains(n)},t.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];if(this._isProper=!1,ht.intersects(r,s,n)&&tt.orientationIndex(r,s,n)===0&&tt.orientationIndex(s,r,n)===0)return this._isProper=!0,(n.equals(r)||n.equals(s))&&(this._isProper=!1),this._result=i.POINT_INTERSECTION,null;this._result=i.NO_INTERSECTION}else return i.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(n,r,s,o,a){a.x=this.smallestInAbsValue(n.x,r.x,s.x,o.x),a.y=this.smallestInAbsValue(n.y,r.y,s.y,o.y),n.x-=a.x,n.y-=a.y,r.x-=a.x,r.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},t.prototype.safeHCoordinateIntersection=function(n,r,s,o){var a=null;try{a=jn.intersection(n,r,s,o)}catch(l){if(l instanceof ru)a=t.nearestEndpoint(n,r,s,o);else throw l}finally{}return a},t.prototype.intersection=function(n,r,s,o){var a=this.intersectionWithNormalization(n,r,s,o);return this.isInSegmentEnvelopes(a)||(a=new L(t.nearestEndpoint(n,r,s,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},t.prototype.smallestInAbsValue=function(n,r,s,o){var a=n,l=Math.abs(a);return Math.abs(r)<l&&(a=r,l=Math.abs(r)),Math.abs(s)<l&&(a=s,l=Math.abs(s)),Math.abs(o)<l&&(a=o),a},t.prototype.checkDD=function(n,r,s,o,a){var l=Oi.intersection(n,r,s,o),u=this.isInSegmentEnvelopes(l);ii.out.println("DD in env = "+u+" --------------------- "+l),a.distance(l)>1e-4&&ii.out.println("Distance = "+a.distance(l))},t.prototype.intersectionWithNormalization=function(n,r,s,o){var a=new L(n),l=new L(r),u=new L(s),h=new L(o),c=new L;this.normalizeToEnvCentre(a,l,u,h,c);var d=this.safeHCoordinateIntersection(a,l,u,h);return d.x+=c.x,d.y+=c.y,d},t.prototype.computeCollinearIntersection=function(n,r,s,o){var a=ht.intersects(n,r,s),l=ht.intersects(n,r,o),u=ht.intersects(s,o,n),h=ht.intersects(s,o,r);return a&&l?(this._intPt[0]=s,this._intPt[1]=o,i.COLLINEAR_INTERSECTION):u&&h?(this._intPt[0]=n,this._intPt[1]=r,i.COLLINEAR_INTERSECTION):a&&u?(this._intPt[0]=s,this._intPt[1]=n,s.equals(n)&&!l&&!h?i.POINT_INTERSECTION:i.COLLINEAR_INTERSECTION):a&&h?(this._intPt[0]=s,this._intPt[1]=r,s.equals(r)&&!l&&!u?i.POINT_INTERSECTION:i.COLLINEAR_INTERSECTION):l&&u?(this._intPt[0]=o,this._intPt[1]=n,o.equals(n)&&!a&&!h?i.POINT_INTERSECTION:i.COLLINEAR_INTERSECTION):l&&h?(this._intPt[0]=o,this._intPt[1]=r,o.equals(r)&&!a&&!u?i.POINT_INTERSECTION:i.COLLINEAR_INTERSECTION):i.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(n,r,s,o,a){var l=n.x<r.x?n.x:r.x,u=n.y<r.y?n.y:r.y,h=n.x>r.x?n.x:r.x,c=n.y>r.y?n.y:r.y,d=s.x<o.x?s.x:o.x,g=s.y<o.y?s.y:o.y,p=s.x>o.x?s.x:o.x,E=s.y>o.y?s.y:o.y,b=l>d?l:d,P=h<p?h:p,v=u>g?u:g,_=c<E?c:E,m=(b+P)/2,y=(v+_)/2;a.x=m,a.y=y,n.x-=a.x,n.y-=a.y,r.x-=a.x,r.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},t.prototype.computeIntersect=function(n,r,s,o){if(this._isProper=!1,!ht.intersects(n,r,s,o))return i.NO_INTERSECTION;var a=tt.orientationIndex(n,r,s),l=tt.orientationIndex(n,r,o);if(a>0&&l>0||a<0&&l<0)return i.NO_INTERSECTION;var u=tt.orientationIndex(s,o,n),h=tt.orientationIndex(s,o,r);if(u>0&&h>0||u<0&&h<0)return i.NO_INTERSECTION;var c=a===0&&l===0&&u===0&&h===0;return c?this.computeCollinearIntersection(n,r,s,o):(a===0||l===0||u===0||h===0?(this._isProper=!1,n.equals2D(s)||n.equals2D(o)?this._intPt[0]=n:r.equals2D(s)||r.equals2D(o)?this._intPt[0]=r:a===0?this._intPt[0]=new L(s):l===0?this._intPt[0]=new L(o):u===0?this._intPt[0]=new L(n):h===0&&(this._intPt[0]=new L(r))):(this._isProper=!0,this._intPt[0]=this.intersection(n,r,s,o)),i.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(n,r,s,o){var a=n,l=tt.distancePointLine(n,s,o),u=tt.distancePointLine(r,s,o);return u<l&&(l=u,a=r),u=tt.distancePointLine(s,n,r),u<l&&(l=u,a=s),u=tt.distancePointLine(o,n,r),u<l&&(l=u,a=o),a},t})(ge),Va=function(){};Va.prototype.interfaces_=function(){return[]},Va.prototype.getClass=function(){return Va},Va.orientationIndex=function(t,e,n){var r=e.x-t.x,s=e.y-t.y,o=n.x-e.x,a=n.y-e.y;return Va.signOfDet2x2(r,s,o,a)},Va.signOfDet2x2=function(t,e,n,r){var s=null,o=null,a=null;if(s=1,t===0||r===0)return e===0||n===0?0:e>0?n>0?-s:s:n>0?s:-s;if(e===0||n===0)return r>0?t>0?s:-s:t>0?-s:s;if(e>0?r>0?e<=r||(s=-s,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(s=-s,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(s=-s,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(s=-s,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0)if(n>0){if(!(t<=n))return s}else return s;else{if(n>0)return-s;if(t>=n)s=-s,t=-t,n=-n;else return-s}for(;;){if(a=Math.floor(n/t),n=n-a*t,r=r-a*e,r<0)return-s;if(r>e)return s;if(t>n+n){if(e<r+r)return s}else{if(e>r+r)return-s;n=t-n,r=e-r,s=-s}if(r===0)return n===0?0:-s;if(n===0||(a=Math.floor(t/n),t=t-a*n,e=e-a*r,e<0))return s;if(e>r)return-s;if(n>t+t){if(r<e+e)return-s}else{if(r>e+e)return s;t=n-t,e=r-e,s=-s}if(e===0)return t===0?0:s;if(t===0)return-s}};var pr=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};pr.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,r=e.x;return n>r&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var s=t.x-this._p.x,o=t.y-this._p.y,a=e.x-this._p.x,l=e.y-this._p.y,u=Va.signOfDet2x2(s,o,a,l);if(u===0)return this._isPointOnSegment=!0,null;l<o&&(u=-u),u>0&&this._crossingCount++}},pr.prototype.isPointInPolygon=function(){return this.getLocation()!==k.EXTERIOR},pr.prototype.getLocation=function(){return this._isPointOnSegment?k.BOUNDARY:this._crossingCount%2===1?k.INTERIOR:k.EXTERIOR},pr.prototype.isOnSegment=function(){return this._isPointOnSegment},pr.prototype.interfaces_=function(){return[]},pr.prototype.getClass=function(){return pr},pr.locatePointInRing=function(){if(arguments[0]instanceof L&&St(arguments[1],Gt)){for(var t=arguments[0],e=arguments[1],n=new pr(t),r=new L,s=new L,o=1;o<e.size();o++)if(e.getCoordinate(o,r),e.getCoordinate(o-1,s),n.countSegment(r,s),n.isOnSegment())return n.getLocation();return n.getLocation()}else if(arguments[0]instanceof L&&arguments[1]instanceof Array){for(var a=arguments[0],l=arguments[1],u=new pr(a),h=1;h<l.length;h++){var c=l[h],d=l[h-1];if(u.countSegment(c,d),u.isOnSegment())return u.getLocation()}return u.getLocation()}};var tt=function(){},za={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};tt.prototype.interfaces_=function(){return[]},tt.prototype.getClass=function(){return tt},tt.orientationIndex=function(t,e,n){return Oi.orientationIndex(t,e,n)},tt.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,r=1;r<t.length-1;r++){var s=t[r].x-n,o=t[r+1].y,a=t[r-1].y;e+=s*(a-o)}return e/2}else if(St(arguments[0],Gt)){var l=arguments[0],u=l.size();if(u<3)return 0;var h=new L,c=new L,d=new L;l.getCoordinate(0,c),l.getCoordinate(1,d);var g=c.x;d.x-=g;for(var p=0,E=1;E<u-1;E++)h.y=c.y,c.x=d.x,c.y=d.y,l.getCoordinate(E+1,d),d.x-=g,p+=c.x*(h.y-d.y);return p/2}},tt.distanceLineLine=function(t,e,n,r){if(t.equals(e))return tt.distancePointLine(t,n,r);if(n.equals(r))return tt.distancePointLine(r,t,e);var s=!1;if(!ht.intersects(t,e,n,r))s=!0;else{var o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(o===0)s=!0;else{var a=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),l=(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y),u=l/o,h=a/o;(h<0||h>1||u<0||u>1)&&(s=!0)}}return s?an.min(tt.distancePointLine(t,n,r),tt.distancePointLine(e,n,r),tt.distancePointLine(n,t,e),tt.distancePointLine(r,t,e)):0},tt.isPointInRing=function(t,e){return tt.locatePointInRing(t,e)!==k.EXTERIOR},tt.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new L;t.getCoordinate(0,r);for(var s=r.x,o=r.y,a=1;a<e;a++){t.getCoordinate(a,r);var l=r.x,u=r.y,h=l-s,c=u-o;n+=Math.sqrt(h*h+c*c),s=l,o=u}return n},tt.isCCW=function(t){var e=t.length-1;if(e<3)throw new de("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,s=1;s<=e;s++){var o=t[s];o.y>n.y&&(n=o,r=s)}var a=r;do a=a-1,a<0&&(a=e);while(t[a].equals2D(n)&&a!==r);var l=r;do l=(l+1)%e;while(t[l].equals2D(n)&&l!==r);var u=t[a],h=t[l];if(u.equals2D(n)||h.equals2D(n)||u.equals2D(h))return!1;var c=tt.computeOrientation(u,n,h),d=!1;return c===0?d=u.x>h.x:d=c>0,d},tt.locatePointInRing=function(t,e){return pr.locatePointInRing(t,e)},tt.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),s=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(s)*Math.sqrt(r)},tt.computeOrientation=function(t,e,n){return tt.orientationIndex(t,e,n)},tt.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new de("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var s=tt.distancePointLine(t,e[r],e[r+1]);s<n&&(n=s)}return n}else if(arguments.length===3){var o=arguments[0],a=arguments[1],l=arguments[2];if(a.x===l.x&&a.y===l.y)return o.distance(a);var u=(l.x-a.x)*(l.x-a.x)+(l.y-a.y)*(l.y-a.y),h=((o.x-a.x)*(l.x-a.x)+(o.y-a.y)*(l.y-a.y))/u;if(h<=0)return o.distance(a);if(h>=1)return o.distance(l);var c=((a.y-o.y)*(l.x-a.x)-(a.x-o.x)*(l.y-a.y))/u;return Math.abs(c)*Math.sqrt(u)}},tt.isOnLine=function(t,e){for(var n=new Ho,r=1;r<e.length;r++){var s=e[r-1],o=e[r];if(n.computeIntersection(t,s,o),n.hasIntersection())return!0}return!1},za.CLOCKWISE.get=function(){return-1},za.RIGHT.get=function(){return tt.CLOCKWISE},za.COUNTERCLOCKWISE.get=function(){return 1},za.LEFT.get=function(){return tt.COUNTERCLOCKWISE},za.COLLINEAR.get=function(){return 0},za.STRAIGHT.get=function(){return tt.COLLINEAR},Object.defineProperties(tt,za);var bs=function(){};bs.prototype.filter=function(t){},bs.prototype.interfaces_=function(){return[]},bs.prototype.getClass=function(){return bs};var _t=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},zr={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};_t.prototype.isGeometryCollection=function(){return this.getSortIndex()===_t.SORTINDEX_GEOMETRYCOLLECTION},_t.prototype.getFactory=function(){return this._factory},_t.prototype.getGeometryN=function(t){return this},_t.prototype.getArea=function(){return 0},_t.prototype.isRectangle=function(){return!1},_t.prototype.equals=function(){if(arguments[0]instanceof _t){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof _t))return!1;var n=e;return this.equalsExact(n)}},_t.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},_t.prototype.geometryChanged=function(){this.apply(_t.geometryChangedFilter)},_t.prototype.geometryChangedAction=function(){this._envelope=null},_t.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())},_t.prototype.getLength=function(){return 0},_t.prototype.getNumGeometries=function(){return 1},_t.prototype.compareTo=function(){if(arguments.length===1){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,r)}},_t.prototype.getUserData=function(){return this._userData},_t.prototype.getSRID=function(){return this._SRID},_t.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},_t.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===_t.SORTINDEX_GEOMETRYCOLLECTION)throw new de("This method does not support GeometryCollection arguments")},_t.prototype.equal=function(t,e,n){return n===0?t.equals(e):t.distance(e)<=n},_t.prototype.norm=function(){var t=this.copy();return t.normalize(),t},_t.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},_t.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new ht(this._envelope)},_t.prototype.setSRID=function(t){this._SRID=t},_t.prototype.setUserData=function(t){this._userData=t},_t.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var s=n.next(),o=r.next(),a=s.compareTo(o);if(a!==0)return a}return n.hasNext()?1:r.hasNext()?-1:0},_t.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},_t.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===_t.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===_t.SORTINDEX_MULTIPOINT||this.getSortIndex()===_t.SORTINDEX_MULTILINESTRING||this.getSortIndex()===_t.SORTINDEX_MULTIPOLYGON},_t.prototype.interfaces_=function(){return[Kd,bn,Cn]},_t.prototype.getClass=function(){return _t},_t.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},_t.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1},zr.serialVersionUID.get=function(){return 8763622679187377e3},zr.SORTINDEX_POINT.get=function(){return 0},zr.SORTINDEX_MULTIPOINT.get=function(){return 1},zr.SORTINDEX_LINESTRING.get=function(){return 2},zr.SORTINDEX_LINEARRING.get=function(){return 3},zr.SORTINDEX_MULTILINESTRING.get=function(){return 4},zr.SORTINDEX_POLYGON.get=function(){return 5},zr.SORTINDEX_MULTIPOLYGON.get=function(){return 6},zr.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},zr.geometryChangedFilter.get=function(){return Zp},Object.defineProperties(_t,zr);var Zp=function(){};Zp.interfaces_=function(){return[bs]},Zp.filter=function(t){t.geometryChangedAction()};var Br=function(){};Br.prototype.filter=function(t){},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br};var Pn=function(){},Cs={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Pn.prototype.isInBoundary=function(t){},Pn.prototype.interfaces_=function(){return[]},Pn.prototype.getClass=function(){return Pn},Cs.Mod2BoundaryNodeRule.get=function(){return ou},Cs.EndPointBoundaryNodeRule.get=function(){return au},Cs.MultiValentEndPointBoundaryNodeRule.get=function(){return lu},Cs.MonoValentEndPointBoundaryNodeRule.get=function(){return uu},Cs.MOD2_BOUNDARY_RULE.get=function(){return new ou},Cs.ENDPOINT_BOUNDARY_RULE.get=function(){return new au},Cs.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new lu},Cs.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new uu},Cs.OGC_SFS_BOUNDARY_RULE.get=function(){return Pn.MOD2_BOUNDARY_RULE},Object.defineProperties(Pn,Cs);var ou=function(){};ou.prototype.isInBoundary=function(t){return t%2===1},ou.prototype.interfaces_=function(){return[Pn]},ou.prototype.getClass=function(){return ou};var au=function(){};au.prototype.isInBoundary=function(t){return t>0},au.prototype.interfaces_=function(){return[Pn]},au.prototype.getClass=function(){return au};var lu=function(){};lu.prototype.isInBoundary=function(t){return t>1},lu.prototype.interfaces_=function(){return[Pn]},lu.prototype.getClass=function(){return lu};var uu=function(){};uu.prototype.isInBoundary=function(t){return t===1},uu.prototype.interfaces_=function(){return[Pn]},uu.prototype.getClass=function(){return uu};var De=function(){};De.prototype.add=function(){},De.prototype.addAll=function(){},De.prototype.isEmpty=function(){},De.prototype.iterator=function(){},De.prototype.size=function(){},De.prototype.toArray=function(){},De.prototype.remove=function(){};function Kp(i){this.message=i||""}Kp.prototype=new Error,Kp.prototype.name="IndexOutOfBoundsException";var hu=function(){};hu.prototype.hasNext=function(){},hu.prototype.next=function(){},hu.prototype.remove=function(){};var zn=(function(i){function t(){i.apply(this,arguments)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t})(De);function cu(i){this.message=i||""}cu.prototype=new Error,cu.prototype.name="NoSuchElementException";var J=(function(i){function t(){i.call(this),this.array_=[],arguments[0]instanceof De&&this.addAll(arguments[0])}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[i,De]},t.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(n){for(var r=this,s=n.iterator();s.hasNext();)r.add(s.next());return!0},t.prototype.set=function(n,r){var s=this.array_[n];return this.array_[n]=r,s},t.prototype.iterator=function(){return new AN(this)},t.prototype.get=function(n){if(n<0||n>=this.size())throw new Kp;return this.array_[n]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var n=this,r=[],s=0,o=this.array_.length;s<o;s++)r.push(n.array_[s]);return r},t.prototype.remove=function(n){for(var r=this,s=!1,o=0,a=this.array_.length;o<a;o++)if(r.array_[o]===n){r.array_.splice(o,1),s=!0;break}return s},t})(zn),AN=(function(i){function t(e){i.call(this),this.arrayList_=e,this.position_=0}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new cu;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(n){return this.arrayList_.set(this.position_-1,n)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t})(hu),hc=(function(i){function t(){if(i.call(this),arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.ensureCapacity(n.length),this.add(n,!0)}else if(arguments.length===2){var r=arguments[0],s=arguments[1];this.ensureCapacity(r.length),this.add(r,s)}}}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={coordArrayType:{configurable:!0}};return e.coordArrayType.get=function(){return new Array(0).fill(null)},t.prototype.getCoordinate=function(r){return this.get(r)},t.prototype.addAll=function(){var r=this;if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=!1,l=s.iterator();l.hasNext();)r.add(l.next(),o),a=!0;return a}else return i.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var r=this,s=i.prototype.clone.call(this),o=0;o<this.size();o++)s.add(o,r.get(o).copy());return s},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var r=this;if(arguments.length===1){var s=arguments[0];i.prototype.add.call(this,s)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1];return this.add(o,a,!0),!0}else if(arguments[0]instanceof L&&typeof arguments[1]=="boolean"){var l=arguments[0],u=arguments[1];if(!u&&this.size()>=1){var h=this.get(this.size()-1);if(h.equals2D(l))return null}i.prototype.add.call(this,l)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var c=arguments[0],d=arguments[1];return this.add(c,d),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var g=arguments[0],p=arguments[1],E=arguments[2];if(E)for(var b=0;b<g.length;b++)r.add(g[b],p);else for(var P=g.length-1;P>=0;P--)r.add(g[P],p);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof L){var v=arguments[0],_=arguments[1],m=arguments[2];if(!m){var y=this.size();if(y>0){if(v>0){var S=this.get(v-1);if(S.equals2D(_))return null}if(v<y){var C=this.get(v);if(C.equals2D(_))return null}}}i.prototype.add.call(this,v,_)}}else if(arguments.length===4){var x=arguments[0],I=arguments[1],M=arguments[2],T=arguments[3],R=1;M>T&&(R=-1);for(var A=M;A!==T;A+=R)r.add(x[A],I);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new L(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t})(J),Rt=function(){},ef={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};ef.ForwardComparator.get=function(){return cc},ef.BidirectionalComparator.get=function(){return du},ef.coordArrayType.get=function(){return new Array(0).fill(null)},Rt.prototype.interfaces_=function(){return[]},Rt.prototype.getClass=function(){return Rt},Rt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Rt.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(Rt.indexOf(r,e)<0)return r}return null},Rt.scroll=function(t,e){var n=Rt.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);ii.arraycopy(t,n,r,0,t.length-n),ii.arraycopy(t,0,r,t.length-n,n),ii.arraycopy(r,0,t,0,t.length)},Rt.equals=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2];if(r===s)return!0;if(r===null||s===null||r.length!==s.length)return!1;for(var a=0;a<r.length;a++)if(o.compare(r[a],s[a])!==0)return!1;return!0}},Rt.intersection=function(t,e){for(var n=new hc,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},Rt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Rt.removeRepeatedPoints=function(t){if(!Rt.hasRepeatedPoints(t))return t;var e=new hc(t,!1);return e.toCoordinateArray()},Rt.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var s=t[r];t[r]=t[e-r],t[e-r]=s}},Rt.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)t[n]!==null&&e++;var r=new Array(e).fill(null);if(e===0)return r;for(var s=0,o=0;o<t.length;o++)t[o]!==null&&(r[s++]=t[o]);return r},Rt.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new L(t[n]);return e}else if(arguments.length===5)for(var r=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],l=arguments[4],u=0;u<l;u++)o[a+u]=new L(r[s+u])},Rt.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],s=e[t.length-n-1];if(r.compareTo(s)!==0)return!1}return!0},Rt.envelope=function(t){for(var e=new ht,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Rt.toCoordinateArray=function(t){return t.toArray(Rt.coordArrayType)},Rt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Rt.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Rt.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,r=t[e].compareTo(t[n]);if(r!==0)return r}return 1},Rt.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t[n].compareTo(e[n]);if(r!==0)return r;n++}return n<e.length?-1:n<t.length?1:0},Rt.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(e===null||e.compareTo(t[n])>0)&&(e=t[n]);return e},Rt.extract=function(t,e,n){e=an.clamp(e,0,t.length),n=an.clamp(n,-1,t.length);var r=n-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var s=new Array(r).fill(null);if(r===0)return s;for(var o=0,a=e;a<=n;a++)s[o++]=t[a];return s},Object.defineProperties(Rt,ef);var cc=function(){};cc.prototype.compare=function(t,e){var n=t,r=e;return Rt.compare(n,r)},cc.prototype.interfaces_=function(){return[iu]},cc.prototype.getClass=function(){return cc};var du=function(){};du.prototype.compare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(n.length===0)return 0;var s=Rt.compare(n,r),o=Rt.isEqualReversed(n,r);return o?0:s},du.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(n.length===0)return 0;for(var s=Rt.increasingDirection(n),o=Rt.increasingDirection(r),a=s>0?0:n.length-1,l=o>0?0:n.length-1,u=0;u<n.length;u++){var h=n[a].compareTo(r[l]);if(h!==0)return h;a+=s,l+=o}return 0},du.prototype.interfaces_=function(){return[iu]},du.prototype.getClass=function(){return du};var Ba=function(){};Ba.prototype.get=function(){},Ba.prototype.put=function(){},Ba.prototype.size=function(){},Ba.prototype.values=function(){},Ba.prototype.entrySet=function(){};var LN=(function(i){function t(){i.apply(this,arguments)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t})(Ba);function dc(i){this.message=i||""}dc.prototype=new Error,dc.prototype.name="OperationNotSupported";function nf(){}nf.prototype=new De,nf.prototype.contains=function(){};var Qp=(function(i){function t(){i.call(this),this.array_=[],arguments[0]instanceof De&&this.addAll(arguments[0])}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.contains=function(n){for(var r=this,s=0,o=this.array_.length;s<o;s++){var a=r.array_[s];if(a===n)return!0}return!1},t.prototype.add=function(n){return this.contains(n)?!1:(this.array_.push(n),!0)},t.prototype.addAll=function(n){for(var r=this,s=n.iterator();s.hasNext();)r.add(s.next());return!0},t.prototype.remove=function(n){throw new Error},t.prototype.size=function(){return this.array_.length},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.toArray=function(){for(var n=this,r=[],s=0,o=this.array_.length;s<o;s++)r.push(n.array_[s]);return r},t.prototype.iterator=function(){return new FN(this)},t})(nf),FN=(function(i){function t(e){i.call(this),this.hashSet_=e,this.position_=0}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new cu;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new dc},t})(hu),Ps=0,Xo=1;function jw(i){return i===null?Ps:i.color}function ne(i){return i===null?null:i.parent}function xs(i,t){i!==null&&(i.color=t)}function tm(i){return i===null?null:i.left}function Vw(i){return i===null?null:i.right}function fi(){this.root_=null,this.size_=0}fi.prototype=new LN,fi.prototype.get=function(i){for(var t=this.root_;t!==null;){var e=i.compareTo(t.key);if(e<0)t=t.left;else if(e>0)t=t.right;else return t.value}return null},fi.prototype.put=function(i,t){if(this.root_===null)return this.root_={key:i,value:t,left:null,right:null,parent:null,color:Ps,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var e=this.root_,n,r;do if(n=e,r=i.compareTo(e.key),r<0)e=e.left;else if(r>0)e=e.right;else{var s=e.value;return e.value=t,s}while(e!==null);var o={key:i,left:null,right:null,value:t,parent:n,color:Ps,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=o:n.right=o,this.fixAfterInsertion(o),this.size_++,null},fi.prototype.fixAfterInsertion=function(i){var t=this;for(i.color=Xo;i!=null&&i!==this.root_&&i.parent.color===Xo;)if(ne(i)===tm(ne(ne(i)))){var e=Vw(ne(ne(i)));jw(e)===Xo?(xs(ne(i),Ps),xs(e,Ps),xs(ne(ne(i)),Xo),i=ne(ne(i))):(i===Vw(ne(i))&&(i=ne(i),t.rotateLeft(i)),xs(ne(i),Ps),xs(ne(ne(i)),Xo),t.rotateRight(ne(ne(i))))}else{var n=tm(ne(ne(i)));jw(n)===Xo?(xs(ne(i),Ps),xs(n,Ps),xs(ne(ne(i)),Xo),i=ne(ne(i))):(i===tm(ne(i))&&(i=ne(i),t.rotateRight(i)),xs(ne(i),Ps),xs(ne(ne(i)),Xo),t.rotateLeft(ne(ne(i))))}this.root_.color=Ps},fi.prototype.values=function(){var i=new J,t=this.getFirstEntry();if(t!==null)for(i.add(t.value);(t=fi.successor(t))!==null;)i.add(t.value);return i},fi.prototype.entrySet=function(){var i=new Qp,t=this.getFirstEntry();if(t!==null)for(i.add(t);(t=fi.successor(t))!==null;)i.add(t);return i},fi.prototype.rotateLeft=function(i){if(i!=null){var t=i.right;i.right=t.left,t.left!=null&&(t.left.parent=i),t.parent=i.parent,i.parent===null?this.root_=t:i.parent.left===i?i.parent.left=t:i.parent.right=t,t.left=i,i.parent=t}},fi.prototype.rotateRight=function(i){if(i!=null){var t=i.left;i.left=t.right,t.right!=null&&(t.right.parent=i),t.parent=i.parent,i.parent===null?this.root_=t:i.parent.right===i?i.parent.right=t:i.parent.left=t,t.right=i,i.parent=t}},fi.prototype.getFirstEntry=function(){var i=this.root_;if(i!=null)for(;i.left!=null;)i=i.left;return i},fi.successor=function(i){if(i===null)return null;if(i.right!==null){for(var t=i.right;t.left!==null;)t=t.left;return t}else{for(var e=i.parent,n=i;e!==null&&n===e.right;)n=e,e=e.parent;return e}},fi.prototype.size=function(){return this.size_};var fc=function(){};fc.prototype.interfaces_=function(){return[]},fc.prototype.getClass=function(){return fc};function zw(){}zw.prototype=new nf;function mr(){this.array_=[],arguments[0]instanceof De&&this.addAll(arguments[0])}mr.prototype=new zw,mr.prototype.contains=function(i){for(var t=this,e=0,n=this.array_.length;e<n;e++){var r=t.array_[e];if(r.compareTo(i)===0)return!0}return!1},mr.prototype.add=function(i){var t=this;if(this.contains(i))return!1;for(var e=0,n=this.array_.length;e<n;e++){var r=t.array_[e];if(r.compareTo(i)===1)return t.array_.splice(e,0,i),!0}return this.array_.push(i),!0},mr.prototype.addAll=function(i){for(var t=this,e=i.iterator();e.hasNext();)t.add(e.next());return!0},mr.prototype.remove=function(i){throw new dc},mr.prototype.size=function(){return this.array_.length},mr.prototype.isEmpty=function(){return this.array_.length===0},mr.prototype.toArray=function(){for(var i=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(i.array_[e]);return t},mr.prototype.iterator=function(){return new rf(this)};var rf=function(i){this.treeSet_=i,this.position_=0};rf.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new cu;return this.treeSet_.array_[this.position_++]},rf.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},rf.prototype.remove=function(){throw new dc};var $o=function(){};$o.sort=function(){var t=arguments[0],e,n,r,s;if(arguments.length===1)s=function(a,l){return a.compareTo(l)},t.sort(s);else if(arguments.length===2)r=arguments[1],s=function(a,l){return r.compare(a,l)},t.sort(s);else if(arguments.length===3){n=t.slice(arguments[1],arguments[2]),n.sort();var o=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length));for(t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])}else if(arguments.length===4)for(n=t.slice(arguments[1],arguments[2]),r=arguments[3],s=function(a,l){return r.compare(a,l)},n.sort(s),o=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])},$o.asList=function(t){for(var e=new J,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var Bt=function(){},Bn={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};Bn.P.get=function(){return 0},Bn.L.get=function(){return 1},Bn.A.get=function(){return 2},Bn.FALSE.get=function(){return-1},Bn.TRUE.get=function(){return-2},Bn.DONTCARE.get=function(){return-3},Bn.SYM_FALSE.get=function(){return"F"},Bn.SYM_TRUE.get=function(){return"T"},Bn.SYM_DONTCARE.get=function(){return"*"},Bn.SYM_P.get=function(){return"0"},Bn.SYM_L.get=function(){return"1"},Bn.SYM_A.get=function(){return"2"},Bt.prototype.interfaces_=function(){return[]},Bt.prototype.getClass=function(){return Bt},Bt.toDimensionSymbol=function(t){switch(t){case Bt.FALSE:return Bt.SYM_FALSE;case Bt.TRUE:return Bt.SYM_TRUE;case Bt.DONTCARE:return Bt.SYM_DONTCARE;case Bt.P:return Bt.SYM_P;case Bt.L:return Bt.SYM_L;case Bt.A:return Bt.SYM_A}throw new de("Unknown dimension value: "+t)},Bt.toDimensionValue=function(t){switch(lc.toUpperCase(t)){case Bt.SYM_FALSE:return Bt.FALSE;case Bt.SYM_TRUE:return Bt.TRUE;case Bt.SYM_DONTCARE:return Bt.DONTCARE;case Bt.SYM_P:return Bt.P;case Bt.SYM_L:return Bt.L;case Bt.SYM_A:return Bt.A}throw new de("Unknown dimension symbol: "+t)},Object.defineProperties(Bt,Bn);var vr=function(){};vr.prototype.filter=function(t){},vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr};var Un=function(){};Un.prototype.filter=function(t,e){},Un.prototype.isDone=function(){},Un.prototype.isGeometryChanged=function(){},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un};var wi=(function(i){function t(n,r){if(i.call(this,r),this._geometries=n||[],i.hasNullElements(this._geometries))throw new de("geometries must not contain null elements")}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){for(var r=this,s=new ht,o=0;o<this._geometries.length;o++)s.expandToInclude(r._geometries[o].getEnvelopeInternal());return s},t.prototype.getGeometryN=function(r){return this._geometries[r]},t.prototype.getSortIndex=function(){return i.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var r=this,s=new Array(this.getNumPoints()).fill(null),o=-1,a=0;a<this._geometries.length;a++)for(var l=r._geometries[a].getCoordinates(),u=0;u<l.length;u++)o++,s[o]=l[u];return s},t.prototype.getArea=function(){for(var r=this,s=0,o=0;o<this._geometries.length;o++)s+=r._geometries[o].getArea();return s},t.prototype.equalsExact=function(){var r=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;if(this._geometries.length!==a._geometries.length)return!1;for(var l=0;l<this._geometries.length;l++)if(!r._geometries[l].equalsExact(a._geometries[l],o))return!1;return!0}else return i.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var r=this,s=0;s<this._geometries.length;s++)r._geometries[s].normalize();$o.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var r=this,s=Bt.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,r._geometries[o].getBoundaryDimension());return s},t.prototype.getDimension=function(){for(var r=this,s=Bt.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,r._geometries[o].getDimension());return s},t.prototype.getLength=function(){for(var r=this,s=0,o=0;o<this._geometries.length;o++)s+=r._geometries[o].getLength();return s},t.prototype.getNumPoints=function(){for(var r=this,s=0,o=0;o<this._geometries.length;o++)s+=r._geometries[o].getNumPoints();return s},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var r=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=r._geometries[a].reverse();return this.getFactory().createGeometryCollection(o)},t.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){var s=arguments[0],o=new mr($o.asList(this._geometries)),a=new mr($o.asList(s._geometries));return this.compare(o,a)}else if(arguments.length===2){for(var l=arguments[0],u=arguments[1],h=l,c=this.getNumGeometries(),d=h.getNumGeometries(),g=0;g<c&&g<d;){var p=r.getGeometryN(g),E=h.getGeometryN(g),b=p.compareToSameClass(E,u);if(b!==0)return b;g++}return g<c?1:g<d?-1:0}},t.prototype.apply=function(){var r=this;if(St(arguments[0],Br))for(var s=arguments[0],o=0;o<this._geometries.length;o++)r._geometries[o].apply(s);else if(St(arguments[0],Un)){var a=arguments[0];if(this._geometries.length===0)return null;for(var l=0;l<this._geometries.length&&(r._geometries[l].apply(a),!a.isDone());l++);a.isGeometryChanged()&&this.geometryChanged()}else if(St(arguments[0],vr)){var u=arguments[0];u.filter(this);for(var h=0;h<this._geometries.length;h++)r._geometries[h].apply(u)}else if(St(arguments[0],bs)){var c=arguments[0];c.filter(this);for(var d=0;d<this._geometries.length;d++)r._geometries[d].apply(c)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),Tt.shouldNeverReachHere(),null},t.prototype.clone=function(){var r=this,s=i.prototype.clone.call(this);s._geometries=new Array(this._geometries.length).fill(null);for(var o=0;o<this._geometries.length;o++)s._geometries[o]=r._geometries[o].clone();return s},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var r=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=r._geometries[o].copy();return new t(s,this._factory)},t.prototype.isEmpty=function(){for(var r=this,s=0;s<this._geometries.length;s++)if(!r._geometries[s].isEmpty())return!1;return!0},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(t,e),t})(_t),Yo=(function(i){function t(){i.apply(this,arguments)}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return _t.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?i.prototype.equalsExact.call(this,r,s):!1}else return i.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Bt.FALSE:0},t.prototype.isClosed=function(){var r=this;if(this.isEmpty())return!1;for(var s=0;s<this._geometries.length;s++)if(!r._geometries[s].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var r=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[s-1-a]=r._geometries[a].reverse();return this.getFactory().createMultiLineString(o)},t.prototype.getBoundary=function(){return new xn(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var r=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=r._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[fc]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t})(wi),xn=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=Pn.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=r}};xn.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return e.length===1?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},xn.prototype.getBoundary=function(){return this._geom instanceof ve?this.boundaryLineString(this._geom):this._geom instanceof Yo?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},xn.prototype.boundaryLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var e=this._bnRule.isInBoundary(2);return e?t.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},xn.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},xn.prototype.computeBoundaryCoordinates=function(t){var e=this,n=new J;this._endpointMap=new fi;for(var r=0;r<t.getNumGeometries();r++){var s=t.getGeometryN(r);s.getNumPoints()!==0&&(e.addEndpoint(s.getCoordinateN(0)),e.addEndpoint(s.getCoordinateN(s.getNumPoints()-1)))}for(var o=this._endpointMap.entrySet().iterator();o.hasNext();){var a=o.next(),l=a.getValue(),u=l.count;e._bnRule.isInBoundary(u)&&n.add(a.getKey())}return Rt.toCoordinateArray(n)},xn.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new sf,this._endpointMap.put(t,e)),e.count++},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn},xn.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new xn(t);return e.getBoundary()}else if(arguments.length===2){var n=arguments[0],r=arguments[1],s=new xn(n,r);return s.getBoundary()}};var sf=function(){this.count=null};sf.prototype.interfaces_=function(){return[]},sf.prototype.getClass=function(){return sf};function kN(){}function GN(){}var jN=function(){};function VN(){}function zN(){}function BN(){}var In=function(){},em={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};In.prototype.interfaces_=function(){return[]},In.prototype.getClass=function(){return In},In.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},In.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new VN,n=new kN;return t.printStackTrace(n),e.toString()}else if(arguments.length===2){var r=arguments[0],s=arguments[1],o="";new GN(In.getStackTrace(r));for(var a=new BN,l=0;l<s;l++)try{o+=a.readLine()+In.NEWLINE}catch(u){if(u instanceof zN)Tt.shouldNeverReachHere();else throw u}finally{}return o}},In.split=function(t,e){for(var n=e.length,r=new J,s=""+t,o=s.indexOf(e);o>=0;){var a=s.substring(0,o);r.add(a),s=s.substring(o+n),o=s.indexOf(e)}s.length>0&&r.add(s);for(var l=new Array(r.size()).fill(null),u=0;u<l.length;u++)l[u]=r.get(u);return l},In.toString=function(){if(arguments.length===1){var t=arguments[0];return In.SIMPLE_ORDINATE_FORMAT.format(t)}},In.spaces=function(t){return In.chars(" ",t)},em.NEWLINE.get=function(){return ii.getProperty("line.separator")},em.SIMPLE_ORDINATE_FORMAT.get=function(){return new jN},Object.defineProperties(In,em);var Ee=function(){};Ee.prototype.interfaces_=function(){return[]},Ee.prototype.getClass=function(){return Ee},Ee.copyCoord=function(t,e,n,r){for(var s=Math.min(t.getDimension(),n.getDimension()),o=0;o<s;o++)n.setOrdinate(r,o,t.getOrdinate(e,o))},Ee.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,Gt.X)===t.getOrdinate(e-1,Gt.X)&&t.getOrdinate(0,Gt.Y)===t.getOrdinate(e-1,Gt.Y)},Ee.isEqual=function(t,e){var n=t.size(),r=e.size();if(n!==r)return!1;for(var s=Math.min(t.getDimension(),e.getDimension()),o=0;o<n;o++)for(var a=0;a<s;a++){var l=t.getOrdinate(o,a),u=e.getOrdinate(o,a);if(t.getOrdinate(o,a)!==e.getOrdinate(o,a)&&!(Pt.isNaN(l)&&Pt.isNaN(u)))return!1}return!0},Ee.extend=function(t,e,n){var r=t.create(n,e.getDimension()),s=e.size();if(Ee.copy(e,0,r,0,s),s>0)for(var o=s;o<n;o++)Ee.copy(e,s-1,r,o,1);return r},Ee.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Ee.swap(t,r,e-r)},Ee.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var s=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,s)}},Ee.copy=function(t,e,n,r,s){for(var o=0;o<s;o++)Ee.copyCoord(t,e+o,n,r+o)},Ee.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var n=t.getDimension(),r=new dr;r.append("(");for(var s=0;s<e;s++){s>0&&r.append(" ");for(var o=0;o<n;o++)o>0&&r.append(","),r.append(In.toString(t.getOrdinate(s,o)))}return r.append(")"),r.toString()}},Ee.ensureValidRing=function(t,e){var n=e.size();if(n===0)return e;if(n<=3)return Ee.createClosedRing(t,e,4);var r=e.getOrdinate(0,Gt.X)===e.getOrdinate(n-1,Gt.X)&&e.getOrdinate(0,Gt.Y)===e.getOrdinate(n-1,Gt.Y);return r?e:Ee.createClosedRing(t,e,n+1)},Ee.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),s=e.size();Ee.copy(e,0,r,0,s);for(var o=s;o<n;o++)Ee.copy(e,0,r,o,1);return r};var ve=(function(i){function t(n,r){i.call(this,r),this._points=null,this.init(n)}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new ht:this._points.expandEnvelope(new ht)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return i.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){var r=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;if(this._points.size()!==a._points.size())return!1;for(var l=0;l<this._points.size();l++)if(!r.equal(r._points.getCoordinate(l),a._points.getCoordinate(l),o))return!1;return!0}else return i.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var r=this,s=0;s<Math.trunc(this._points.size()/2);s++){var o=r._points.size()-1-s;if(!r._points.getCoordinate(s).equals(r._points.getCoordinate(o)))return r._points.getCoordinate(s).compareTo(r._points.getCoordinate(o))>0&&Ee.reverse(r._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Bt.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return tt.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var r=this._points.copy();Ee.reverse(r);var s=this.getFactory().createLineString(r);return s},t.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){for(var s=arguments[0],o=s,a=0,l=0;a<this._points.size()&&l<o._points.size();){var u=r._points.getCoordinate(a).compareTo(o._points.getCoordinate(l));if(u!==0)return u;a++,l++}return a<this._points.size()?1:l<o._points.size()?-1:0}else if(arguments.length===2){var h=arguments[0],c=arguments[1],d=h;return c.compare(this._points,d._points)}},t.prototype.apply=function(){var r=this;if(St(arguments[0],Br))for(var s=arguments[0],o=0;o<this._points.size();o++)s.filter(r._points.getCoordinate(o));else if(St(arguments[0],Un)){var a=arguments[0];if(this._points.size()===0)return null;for(var l=0;l<this._points.size()&&(a.filter(r._points,l),!a.isDone());l++);a.isGeometryChanged()&&this.geometryChanged()}else if(St(arguments[0],vr)){var u=arguments[0];u.filter(this)}else if(St(arguments[0],bs)){var h=arguments[0];h.filter(this)}},t.prototype.getBoundary=function(){return new xn(this).getBoundary()},t.prototype.isEquivalentClass=function(r){return r instanceof t},t.prototype.clone=function(){var r=i.prototype.clone.call(this);return r._points=this._points.clone(),r},t.prototype.getCoordinateN=function(r){return this._points.getCoordinate(r)},t.prototype.getGeometryType=function(){return"LineString"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._points},t.prototype.isEmpty=function(){return this._points.size()===0},t.prototype.init=function(r){if(r===null&&(r=this.getFactory().getCoordinateSequenceFactory().create([])),r.size()===1)throw new de("Invalid number of points in LineString (found "+r.size()+" - must be 0 or >= 2)");this._points=r},t.prototype.isCoordinate=function(r){for(var s=this,o=0;o<this._points.size();o++)if(s._points.getCoordinate(o).equals(r))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(r){return this.getFactory().createPoint(this._points.getCoordinate(r))},t.prototype.interfaces_=function(){return[fc]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t})(_t),gc=function(){};gc.prototype.interfaces_=function(){return[]},gc.prototype.getClass=function(){return gc};var qi=(function(i){function t(n,r){i.call(this,r),this._coordinates=n||null,this.init(this._coordinates)}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new ht;var r=new ht;return r.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),r},t.prototype.getSortIndex=function(){return i.SORTINDEX_POINT},t.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?this.isEmpty()&&r.isEmpty()?!0:this.isEmpty()!==r.isEmpty()?!1:this.equal(r.getCoordinate(),this.getCoordinate(),s):!1}else return i.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){},t.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},t.prototype.getBoundaryDimension=function(){return Bt.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getNumPoints=function(){return this.isEmpty()?0:1},t.prototype.reverse=function(){return this.copy()},t.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},t.prototype.compareToSameClass=function(){if(arguments.length===1){var r=arguments[0],s=r;return this.getCoordinate().compareTo(s.getCoordinate())}else if(arguments.length===2){var o=arguments[0],a=arguments[1],l=o;return a.compare(this._coordinates,l._coordinates)}},t.prototype.apply=function(){if(St(arguments[0],Br)){var r=arguments[0];if(this.isEmpty())return null;r.filter(this.getCoordinate())}else if(St(arguments[0],Un)){var s=arguments[0];if(this.isEmpty())return null;s.filter(this._coordinates,0),s.isGeometryChanged()&&this.geometryChanged()}else if(St(arguments[0],vr)){var o=arguments[0];o.filter(this)}else if(St(arguments[0],bs)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var r=i.prototype.clone.call(this);return r._coordinates=this._coordinates.clone(),r},t.prototype.getGeometryType=function(){return"Point"},t.prototype.copy=function(){return new t(this._coordinates.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._coordinates},t.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},t.prototype.isEmpty=function(){return this._coordinates.size()===0},t.prototype.init=function(r){r===null&&(r=this.getFactory().getCoordinateSequenceFactory().create([])),Tt.isTrue(r.size()<=1),this._coordinates=r},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[gc]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t})(_t),ao=function(){};ao.prototype.interfaces_=function(){return[]},ao.prototype.getClass=function(){return ao};var Re=(function(i){function t(n,r,s){if(i.call(this,s),this._shell=null,this._holes=null,n===null&&(n=this.getFactory().createLinearRing()),r===null&&(r=[]),i.hasNullElements(r))throw new de("holes must not contain null elements");if(n.isEmpty()&&i.hasNonEmptyElements(r))throw new de("shell is empty but holes are not");this._shell=n,this._holes=r}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return i.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var r=this;if(this.isEmpty())return[];for(var s=new Array(this.getNumPoints()).fill(null),o=-1,a=this._shell.getCoordinates(),l=0;l<a.length;l++)o++,s[o]=a[l];for(var u=0;u<this._holes.length;u++)for(var h=r._holes[u].getCoordinates(),c=0;c<h.length;c++)o++,s[o]=h[c];return s},t.prototype.getArea=function(){var r=this,s=0;s+=Math.abs(tt.signedArea(this._shell.getCoordinateSequence()));for(var o=0;o<this._holes.length;o++)s-=Math.abs(tt.signedArea(r._holes[o].getCoordinateSequence()));return s},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var r=this._shell.getCoordinateSequence(),s=this.getEnvelopeInternal(),o=0;o<5;o++){var a=r.getX(o);if(!(a===s.getMinX()||a===s.getMaxX()))return!1;var l=r.getY(o);if(!(l===s.getMinY()||l===s.getMaxY()))return!1}for(var u=r.getX(0),h=r.getY(0),c=1;c<=4;c++){var d=r.getX(c),g=r.getY(c),p=d!==u,E=g!==h;if(p===E)return!1;u=d,h=g}return!0},t.prototype.equalsExact=function(){var r=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s,l=this._shell,u=a._shell;if(!l.equalsExact(u,o)||this._holes.length!==a._holes.length)return!1;for(var h=0;h<this._holes.length;h++)if(!r._holes[h].equalsExact(a._holes[h],o))return!1;return!0}else return i.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var r=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var s=0;s<this._holes.length;s++)r.normalize(r._holes[s],!1);$o.sort(this._holes)}else if(arguments.length===2){var o=arguments[0],a=arguments[1];if(o.isEmpty())return null;var l=new Array(o.getCoordinates().length-1).fill(null);ii.arraycopy(o.getCoordinates(),0,l,0,l.length);var u=Rt.minCoordinate(o.getCoordinates());Rt.scroll(l,u),ii.arraycopy(l,0,o.getCoordinates(),0,l.length),o.getCoordinates()[l.length]=l[0],tt.isCCW(o.getCoordinates())===a&&Rt.reverse(o.getCoordinates())}},t.prototype.getCoordinate=function(){return this._shell.getCoordinate()},t.prototype.getNumInteriorRing=function(){return this._holes.length},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.getLength=function(){var r=this,s=0;s+=this._shell.getLength();for(var o=0;o<this._holes.length;o++)s+=r._holes[o].getLength();return s},t.prototype.getNumPoints=function(){for(var r=this,s=this._shell.getNumPoints(),o=0;o<this._holes.length;o++)s+=r._holes[o].getNumPoints();return s},t.prototype.reverse=function(){var r=this,s=this.copy();s._shell=this._shell.copy().reverse(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=r._holes[o].copy().reverse();return s},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){var s=arguments[0],o=this._shell,a=s._shell;return o.compareToSameClass(a)}else if(arguments.length===2){var l=arguments[0],u=arguments[1],h=l,c=this._shell,d=h._shell,g=c.compareToSameClass(d,u);if(g!==0)return g;for(var p=this.getNumInteriorRing(),E=h.getNumInteriorRing(),b=0;b<p&&b<E;){var P=r.getInteriorRingN(b),v=h.getInteriorRingN(b),_=P.compareToSameClass(v,u);if(_!==0)return _;b++}return b<p?1:b<E?-1:0}},t.prototype.apply=function(r){var s=this;if(St(r,Br)){this._shell.apply(r);for(var o=0;o<this._holes.length;o++)s._holes[o].apply(r)}else if(St(r,Un)){if(this._shell.apply(r),!r.isDone())for(var a=0;a<this._holes.length&&(s._holes[a].apply(r),!r.isDone());a++);r.isGeometryChanged()&&this.geometryChanged()}else if(St(r,vr))r.filter(this);else if(St(r,bs)){r.filter(this),this._shell.apply(r);for(var l=0;l<this._holes.length;l++)s._holes[l].apply(r)}},t.prototype.getBoundary=function(){var r=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var s=new Array(this._holes.length+1).fill(null);s[0]=this._shell;for(var o=0;o<this._holes.length;o++)s[o+1]=r._holes[o];return s.length<=1?this.getFactory().createLinearRing(s[0].getCoordinateSequence()):this.getFactory().createMultiLineString(s)},t.prototype.clone=function(){var r=this,s=i.prototype.clone.call(this);s._shell=this._shell.clone(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=r._holes[o].clone();return s},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var r=this,s=this._shell.copy(),o=new Array(this._holes.length).fill(null),a=0;a<o.length;a++)o[a]=r._holes[a].copy();return new t(s,o,this._factory)},t.prototype.getExteriorRing=function(){return this._shell},t.prototype.isEmpty=function(){return this._shell.isEmpty()},t.prototype.getInteriorRingN=function(r){return this._holes[r]},t.prototype.interfaces_=function(){return[ao]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t})(_t),fu=(function(i){function t(){i.apply(this,arguments)}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return _t.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?i.prototype.equalsExact.call(this,r,s):!1}else return i.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var r=arguments[0];return this._geometries[r].getCoordinate()}else return i.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return Bt.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.getGeometryType=function(){return"MultiPoint"},t.prototype.copy=function(){for(var r=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=r._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[gc]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t})(wi),Ur=(function(i){function t(n,r){n instanceof L&&r instanceof At&&(n=r.getCoordinateSequenceFactory().create(n)),i.call(this,n,r),this.validateConstruction()}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return _t.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return Bt.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:i.prototype.isClosed.call(this)},t.prototype.reverse=function(){var r=this._points.copy();Ee.reverse(r);var s=this.getFactory().createLinearRing(r);return s},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!i.prototype.isClosed.call(this))throw new de("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new de("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.MINIMUM_VALID_SIZE.get=function(){return 4},e.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,e),t})(ve),qr=(function(i){function t(){i.apply(this,arguments)}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return _t.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?i.prototype.equalsExact.call(this,r,s):!1}else return i.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var r=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=r._geometries[a].reverse();return this.getFactory().createMultiPolygon(o)},t.prototype.getBoundary=function(){var r=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var s=new J,o=0;o<this._geometries.length;o++)for(var a=r._geometries[o],l=a.getBoundary(),u=0;u<l.getNumGeometries();u++)s.add(l.getGeometryN(u));var h=new Array(s.size()).fill(null);return this.getFactory().createMultiLineString(s.toArray(h))},t.prototype.getGeometryType=function(){return"MultiPolygon"},t.prototype.copy=function(){for(var r=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=r._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[ao]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t})(wi),Mn=function(t){this._factory=t||null,this._isUserDataCopied=!1},of={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Mn.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},Mn.prototype.edit=function(t,e){if(t===null)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},Mn.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof wi?this.editGeometryCollection(t,e):t instanceof Re?this.editPolygon(t,e):t instanceof qi?e.edit(t,this._factory):t instanceof ve?e.edit(t,this._factory):(Tt.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},Mn.prototype.editGeometryCollection=function(t,e){for(var n=this,r=e.edit(t,this._factory),s=new J,o=0;o<r.getNumGeometries();o++){var a=n.edit(r.getGeometryN(o),e);a===null||a.isEmpty()||s.add(a)}return r.getClass()===fu?this._factory.createMultiPoint(s.toArray([])):r.getClass()===Yo?this._factory.createMultiLineString(s.toArray([])):r.getClass()===qr?this._factory.createMultiPolygon(s.toArray([])):this._factory.createGeometryCollection(s.toArray([]))},Mn.prototype.editPolygon=function(t,e){var n=this,r=e.edit(t,this._factory);if(r===null&&(r=this._factory.createPolygon(null)),r.isEmpty())return r;var s=this.edit(r.getExteriorRing(),e);if(s===null||s.isEmpty())return this._factory.createPolygon();for(var o=new J,a=0;a<r.getNumInteriorRing();a++){var l=n.edit(r.getInteriorRingN(a),e);l===null||l.isEmpty()||o.add(l)}return this._factory.createPolygon(s,o.toArray([]))},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},Mn.GeometryEditorOperation=function(){},of.NoOpGeometryOperation.get=function(){return pc},of.CoordinateOperation.get=function(){return mc},of.CoordinateSequenceOperation.get=function(){return vc},Object.defineProperties(Mn,of);var pc=function(){};pc.prototype.edit=function(t,e){return t},pc.prototype.interfaces_=function(){return[Mn.GeometryEditorOperation]},pc.prototype.getClass=function(){return pc};var mc=function(){};mc.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return n===null?t:t instanceof Ur?e.createLinearRing(n):t instanceof ve?e.createLineString(n):t instanceof qi?n.length>0?e.createPoint(n[0]):e.createPoint():t},mc.prototype.interfaces_=function(){return[Mn.GeometryEditorOperation]},mc.prototype.getClass=function(){return mc};var vc=function(){};vc.prototype.edit=function(t,e){return t instanceof Ur?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof ve?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof qi?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},vc.prototype.interfaces_=function(){return[Mn.GeometryEditorOperation]},vc.prototype.getClass=function(){return vc};var Se=function(){var t=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var n=0;n<e;n++)t._coordinates[n]=new L}else if(St(arguments[0],Gt)){var r=arguments[0];if(r===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=r.getDimension(),this._coordinates=new Array(r.size()).fill(null);for(var s=0;s<this._coordinates.length;s++)t._coordinates[s]=r.getCoordinateCopy(s)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var o=arguments[0],a=arguments[1];this._coordinates=o,this._dimension=a,o===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var l=arguments[0],u=arguments[1];this._coordinates=new Array(l).fill(null),this._dimension=u;for(var h=0;h<l;h++)t._coordinates[h]=new L}}},Bw={serialVersionUID:{configurable:!0}};Se.prototype.setOrdinate=function(t,e,n){switch(e){case Gt.X:this._coordinates[t].x=n;break;case Gt.Y:this._coordinates[t].y=n;break;case Gt.Z:this._coordinates[t].z=n;break;default:throw new de("invalid ordinateIndex")}},Se.prototype.size=function(){return this._coordinates.length},Se.prototype.getOrdinate=function(t,e){switch(e){case Gt.X:return this._coordinates[t].x;case Gt.Y:return this._coordinates[t].y;case Gt.Z:return this._coordinates[t].z}return Pt.NaN},Se.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},Se.prototype.getCoordinateCopy=function(t){return new L(this._coordinates[t])},Se.prototype.getDimension=function(){return this._dimension},Se.prototype.getX=function(t){return this._coordinates[t].x},Se.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].clone();return new Se(e,this._dimension)},Se.prototype.expandEnvelope=function(t){for(var e=this,n=0;n<this._coordinates.length;n++)t.expandToInclude(e._coordinates[n]);return t},Se.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].copy();return new Se(e,this._dimension)},Se.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new dr(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var n=1;n<this._coordinates.length;n++)e.append(", "),e.append(t._coordinates[n]);return e.append(")"),e.toString()}else return"()"},Se.prototype.getY=function(t){return this._coordinates[t].y},Se.prototype.toCoordinateArray=function(){return this._coordinates},Se.prototype.interfaces_=function(){return[Gt,Cn]},Se.prototype.getClass=function(){return Se},Bw.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(Se,Bw);var Wr=function(){},im={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Wr.prototype.readResolve=function(){return Wr.instance()},Wr.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new Se(t)}else if(St(arguments[0],Gt)){var e=arguments[0];return new Se(e)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return r>3&&(r=3),r<2?new Se(n):new Se(n,r)}},Wr.prototype.interfaces_=function(){return[nu,Cn]},Wr.prototype.getClass=function(){return Wr},Wr.instance=function(){return Wr.instanceObject},im.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},im.instanceObject.get=function(){return new Wr},Object.defineProperties(Wr,im);var Uw=(function(i){function t(){i.call(this),this.map_=new Map}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.get=function(n){return this.map_.get(n)||null},t.prototype.put=function(n,r){return this.map_.set(n,r),r},t.prototype.values=function(){for(var n=new J,r=this.map_.values(),s=r.next();!s.done;)n.add(s.value),s=r.next();return n},t.prototype.entrySet=function(){var n=new Qp;return this.map_.entries().forEach(function(r){return n.add(r)}),n},t.prototype.size=function(){return this.map_.size()},t})(Ba),Ut=function i(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=i.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof yr){var t=arguments[0];this._modelType=t,t===i.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var e=arguments[0];this._modelType=i.FIXED,this.setScale(e)}else if(arguments[0]instanceof i){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}},nm={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Ut.prototype.equals=function(t){if(!(t instanceof Ut))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},Ut.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new fr(n).compareTo(new fr(r))},Ut.prototype.getScale=function(){return this._scale},Ut.prototype.isFloating=function(){return this._modelType===Ut.FLOATING||this._modelType===Ut.FLOATING_SINGLE},Ut.prototype.getType=function(){return this._modelType},Ut.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Ut.FLOATING?t="Floating":this._modelType===Ut.FLOATING_SINGLE?t="Floating-Single":this._modelType===Ut.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},Ut.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(Pt.isNaN(t))return t;if(this._modelType===Ut.FLOATING_SINGLE){var e=t;return e}return this._modelType===Ut.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof L){var n=arguments[0];if(this._modelType===Ut.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}},Ut.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Ut.FLOATING?t=16:this._modelType===Ut.FLOATING_SINGLE?t=6:this._modelType===Ut.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},Ut.prototype.setScale=function(t){this._scale=Math.abs(t)},Ut.prototype.interfaces_=function(){return[Cn,bn]},Ut.prototype.getClass=function(){return Ut},Ut.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},nm.serialVersionUID.get=function(){return 7777263578777804e3},nm.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Ut,nm);var yr=function i(t){this._name=t||null,i.nameToTypeMap.put(t,this)},rm={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};yr.prototype.readResolve=function(){return yr.nameToTypeMap.get(this._name)},yr.prototype.toString=function(){return this._name},yr.prototype.interfaces_=function(){return[Cn]},yr.prototype.getClass=function(){return yr},rm.serialVersionUID.get=function(){return-552860263173159e4},rm.nameToTypeMap.get=function(){return new Uw},Object.defineProperties(yr,rm),Ut.Type=yr,Ut.FIXED=new yr("FIXED"),Ut.FLOATING=new yr("FLOATING"),Ut.FLOATING_SINGLE=new yr("FLOATING SINGLE");var At=function i(){this._precisionModel=new Ut,this._SRID=0,this._coordinateSequenceFactory=i.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?St(arguments[0],nu)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Ut&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},qw={serialVersionUID:{configurable:!0}};At.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new L(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new L(t.getMinX(),t.getMinY()),new L(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new L(t.getMinX(),t.getMinY()),new L(t.getMinX(),t.getMaxY()),new L(t.getMaxX(),t.getMaxY()),new L(t.getMaxX(),t.getMinY()),new L(t.getMinX(),t.getMinY())]),null)},At.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new ve(this.getCoordinateSequenceFactory().create(t),this);if(St(t,Gt))return new ve(t,this)}else return new ve(this.getCoordinateSequenceFactory().create([]),this)},At.prototype.createMultiLineString=function(){if(arguments.length===0)return new Yo(null,this);if(arguments.length===1){var t=arguments[0];return new Yo(t,this)}},At.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,s=t.iterator();s.hasNext();){var o=s.next(),a=o.getClass();e===null&&(e=a),a!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(e===null)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(At.toGeometryArray(t));var l=t.iterator().next(),u=t.size()>1;if(u){if(l instanceof Re)return this.createMultiPolygon(At.toPolygonArray(t));if(l instanceof ve)return this.createMultiLineString(At.toLineStringArray(t));if(l instanceof qi)return this.createMultiPoint(At.toPointArray(t));Tt.shouldNeverReachHere("Unhandled class: "+l.getClass().getName())}return l},At.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},At.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(St(arguments[0],Gt)){var e=arguments[0];return new qi(e,this)}}},At.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},At.prototype.createPolygon=function(){if(arguments.length===0)return new Re(null,null,this);if(arguments.length===1){if(St(arguments[0],Gt)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Ur){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var r=arguments[0],s=arguments[1];return new Re(r,s,this)}},At.prototype.getSRID=function(){return this._SRID},At.prototype.createGeometryCollection=function(){if(arguments.length===0)return new wi(null,this);if(arguments.length===1){var t=arguments[0];return new wi(t,this)}},At.prototype.createGeometry=function(t){var e=new Mn(this);return e.edit(t,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})},At.prototype.getPrecisionModel=function(){return this._precisionModel},At.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}else if(St(arguments[0],Gt)){var e=arguments[0];return new Ur(e,this)}}},At.prototype.createMultiPolygon=function(){if(arguments.length===0)return new qr(null,this);if(arguments.length===1){var t=arguments[0];return new qr(t,this)}},At.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new fu(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new fu(e,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(St(arguments[0],Gt)){var r=arguments[0];if(r===null)return this.createMultiPoint(new Array(0).fill(null));for(var s=new Array(r.size()).fill(null),o=0;o<r.size();o++){var a=t.getCoordinateSequenceFactory().create(1,r.getDimension());Ee.copy(r,o,a,0,1),s[o]=t.createPoint(a)}return this.createMultiPoint(s)}}},At.prototype.interfaces_=function(){return[Cn]},At.prototype.getClass=function(){return At},At.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},At.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},At.getDefaultCoordinateSequenceFactory=function(){return Wr.instance()},At.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},At.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},At.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},At.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},At.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},At.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},At.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},qw.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(At,qw);var UN=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],af=function(t){this.geometryFactory=t||new At};af.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var n=e.type;if(!_r[n])throw new Error("Unknown GeoJSON type: "+e.type);return UN.indexOf(n)!==-1?_r[n].apply(this,[e.coordinates]):n==="GeometryCollection"?_r[n].apply(this,[e.geometries]):_r[n].apply(this,[e])},af.prototype.write=function(t){var e=t.getGeometryType();if(!Is[e])throw new Error("Geometry is not supported");return Is[e].apply(this,[t])};var _r={Feature:function(i){var t={};for(var e in i)t[e]=i[e];if(i.geometry){var n=i.geometry.type;if(!_r[n])throw new Error("Unknown GeoJSON type: "+i.type);t.geometry=this.read(i.geometry)}return i.bbox&&(t.bbox=_r.bbox.apply(this,[i.bbox])),t},FeatureCollection:function(i){var t=this,e={};if(i.features){e.features=[];for(var n=0;n<i.features.length;++n)e.features.push(t.read(i.features[n]))}return i.bbox&&(e.bbox=this.parse.bbox.apply(this,[i.bbox])),e},coordinates:function(i){for(var t=[],e=0;e<i.length;++e){var n=i[e];t.push(new L(n[0],n[1]))}return t},bbox:function(i){return this.geometryFactory.createLinearRing([new L(i[0],i[1]),new L(i[2],i[1]),new L(i[2],i[3]),new L(i[0],i[3]),new L(i[0],i[1])])},Point:function(i){var t=new L(i[0],i[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(i){for(var t=this,e=[],n=0;n<i.length;++n)e.push(_r.Point.apply(t,[i[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(i){var t=_r.coordinates.apply(this,[i]);return this.geometryFactory.createLineString(t)},MultiLineString:function(i){for(var t=this,e=[],n=0;n<i.length;++n)e.push(_r.LineString.apply(t,[i[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(i){for(var t=this,e=_r.coordinates.apply(this,[i[0]]),n=this.geometryFactory.createLinearRing(e),r=[],s=1;s<i.length;++s){var o=i[s],a=_r.coordinates.apply(t,[o]),l=t.geometryFactory.createLinearRing(a);r.push(l)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(i){for(var t=this,e=[],n=0;n<i.length;++n){var r=i[n];e.push(_r.Polygon.apply(t,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(i){for(var t=this,e=[],n=0;n<i.length;++n){var r=i[n];e.push(t.read(r))}return this.geometryFactory.createGeometryCollection(e)}},Is={coordinate:function(i){return[i.x,i.y]},Point:function(i){var t=Is.coordinate.apply(this,[i.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(i){for(var t=this,e=[],n=0;n<i._geometries.length;++n){var r=i._geometries[n],s=Is.Point.apply(t,[r]);e.push(s.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(i){for(var t=this,e=[],n=i.getCoordinates(),r=0;r<n.length;++r){var s=n[r];e.push(Is.coordinate.apply(t,[s]))}return{type:"LineString",coordinates:e}},MultiLineString:function(i){for(var t=this,e=[],n=0;n<i._geometries.length;++n){var r=i._geometries[n],s=Is.LineString.apply(t,[r]);e.push(s.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(i){var t=this,e=[],n=Is.LineString.apply(this,[i._shell]);e.push(n.coordinates);for(var r=0;r<i._holes.length;++r){var s=i._holes[r],o=Is.LineString.apply(t,[s]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(i){for(var t=this,e=[],n=0;n<i._geometries.length;++n){var r=i._geometries[n],s=Is.Polygon.apply(t,[r]);e.push(s.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(i){for(var t=this,e=[],n=0;n<i._geometries.length;++n){var r=i._geometries[n],s=r.getGeometryType();e.push(Is[s].apply(t,[r]))}return{type:"GeometryCollection",geometries:e}}},sm=function(t){this.geometryFactory=t||new At,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new af(this.geometryFactory)};sm.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===Ut.FIXED&&this.reducePrecision(e),e},sm.prototype.reducePrecision=function(t){var e=this,n,r;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(n=0,r=t.points.length;n<r;n++)e.precisionModel.makePrecise(t.points[n]);else if(t.geometries)for(n=0,r=t.geometries.length;n<r;n++)e.reducePrecision(t.geometries[n])};var Ww=function(){this.parser=new af(this.geometryFactory)};Ww.prototype.write=function(t){return this.parser.write(t)};var H=function(){},lf={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};H.prototype.interfaces_=function(){return[]},H.prototype.getClass=function(){return H},H.opposite=function(t){return t===H.LEFT?H.RIGHT:t===H.RIGHT?H.LEFT:t},lf.ON.get=function(){return 0},lf.LEFT.get=function(){return 1},lf.RIGHT.get=function(){return 2},Object.defineProperties(H,lf);function uf(i){this.message=i||""}uf.prototype=new Error,uf.prototype.name="EmptyStackException";function wr(){this.array_=[]}wr.prototype=new zn,wr.prototype.add=function(i){return this.array_.push(i),!0},wr.prototype.get=function(i){if(i<0||i>=this.size())throw new Error;return this.array_[i]},wr.prototype.push=function(i){return this.array_.push(i),i},wr.prototype.pop=function(i){if(this.array_.length===0)throw new uf;return this.array_.pop()},wr.prototype.peek=function(){if(this.array_.length===0)throw new uf;return this.array_[this.array_.length-1]},wr.prototype.empty=function(){return this.array_.length===0},wr.prototype.isEmpty=function(){return this.empty()},wr.prototype.search=function(i){return this.array_.indexOf(i)},wr.prototype.size=function(){return this.array_.length},wr.prototype.toArray=function(){for(var i=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(i.array_[e]);return t};var Er=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Er.prototype.getCoordinate=function(){return this._minCoord},Er.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},Er.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();Tt.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],r=tt.computeOrientation(this._minCoord,n,e),s=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===tt.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===tt.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)},Er.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge(),r=n.getCoordinates();if(e<0||e+1>=r.length||r[e].y===r[e+1].y)return-1;var s=H.LEFT;return r[e].y<r[e+1].y&&(s=H.RIGHT),s},Er.prototype.getEdge=function(){return this._orientedDe},Er.prototype.checkForRightmostCoordinate=function(t){for(var e=this,n=t.getEdge().getCoordinates(),r=0;r<n.length-1;r++)(e._minCoord===null||n[r].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=r,e._minCoord=n[r])},Er.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Er.prototype.findEdge=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next();r.isForward()&&e.checkForRightmostCoordinate(r)}Tt.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var s=this.getRightmostSide(this._minDe,this._minIndex);s===H.LEFT&&(this._orientedDe=this._minDe.getSym())},Er.prototype.interfaces_=function(){return[]},Er.prototype.getClass=function(){return Er};var Ms=(function(i){function t(e,n){i.call(this,t.msgWithCoord(e,n)),this.pt=n?new L(n):null,this.name="TopologyException"}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(n,r){return r?n:n+" [ "+r+" ]"},t})(Ss),hf=function(){this.array_=[]};hf.prototype.addLast=function(t){this.array_.push(t)},hf.prototype.removeFirst=function(){return this.array_.shift()},hf.prototype.isEmpty=function(){return this.array_.length===0};var Ei=function(){this._finder=null,this._dirEdgeList=new J,this._nodes=new J,this._rightMostCoord=null,this._env=null,this._finder=new Er};Ei.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},Ei.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ei.prototype.computeNodeDepth=function(t){for(var e=this,n=null,r=t.getEdges().iterator();r.hasNext();){var s=r.next();if(s.isVisited()||s.getSym().isVisited()){n=s;break}}if(n===null)throw new Ms("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(n);for(var o=t.getEdges().iterator();o.hasNext();){var a=o.next();a.setVisited(!0),e.copySymDepths(a)}},Ei.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(H.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Ei.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ei.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(H.RIGHT)>=1&&e.getDepth(H.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Ei.prototype.computeDepths=function(t){var e=this,n=new Qp,r=new hf,s=t.getNode();for(r.addLast(s),n.add(s),t.setVisited(!0);!r.isEmpty();){var o=r.removeFirst();n.add(o),e.computeNodeDepth(o);for(var a=o.getEdges().iterator();a.hasNext();){var l=a.next(),u=l.getSym();if(!u.isVisited()){var h=u.getNode();n.contains(h)||(r.addLast(h),n.add(h))}}}},Ei.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Ei.prototype.getEnvelope=function(){if(this._env===null){for(var t=new ht,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next(),r=n.getEdge().getCoordinates(),s=0;s<r.length-1;s++)t.expandToInclude(r[s]);this._env=t}return this._env},Ei.prototype.addReachable=function(t){var e=this,n=new wr;for(n.add(t);!n.empty();){var r=n.pop();e.add(r,n)}},Ei.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(H.LEFT,t.getDepth(H.RIGHT)),e.setDepth(H.RIGHT,t.getDepth(H.LEFT))},Ei.prototype.add=function(t,e){var n=this;t.setVisited(!0),this._nodes.add(t);for(var r=t.getEdges().iterator();r.hasNext();){var s=r.next();n._dirEdgeList.add(s);var o=s.getSym(),a=o.getNode();a.isVisited()||e.push(a)}},Ei.prototype.getNodes=function(){return this._nodes},Ei.prototype.getDirectedEdges=function(){return this._dirEdgeList},Ei.prototype.interfaces_=function(){return[bn]},Ei.prototype.getClass=function(){return Ei};var re=function i(){var t=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[H.ON]=n}else if(arguments[0]instanceof i){var r=arguments[0];if(this.init(r.location.length),r!==null)for(var s=0;s<this.location.length;s++)t.location[s]=r.location[s]}}else if(arguments.length===3){var o=arguments[0],a=arguments[1],l=arguments[2];this.init(3),this.location[H.ON]=o,this.location[H.LEFT]=a,this.location[H.RIGHT]=l}};re.prototype.setAllLocations=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]=t},re.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==k.NONE)return!1;return!0},re.prototype.setAllLocationsIfNull=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]===k.NONE&&(e.location[n]=t)},re.prototype.isLine=function(){return this.location.length===1},re.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var n=new Array(3).fill(null);n[H.ON]=this.location[H.ON],n[H.LEFT]=k.NONE,n[H.RIGHT]=k.NONE,this.location=n}for(var r=0;r<this.location.length;r++)e.location[r]===k.NONE&&r<t.location.length&&(e.location[r]=t.location[r])},re.prototype.getLocations=function(){return this.location},re.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[H.LEFT];this.location[H.LEFT]=this.location[H.RIGHT],this.location[H.RIGHT]=t},re.prototype.toString=function(){var t=new dr;return this.location.length>1&&t.append(k.toLocationSymbol(this.location[H.LEFT])),t.append(k.toLocationSymbol(this.location[H.ON])),this.location.length>1&&t.append(k.toLocationSymbol(this.location[H.RIGHT])),t.toString()},re.prototype.setLocations=function(t,e,n){this.location[H.ON]=t,this.location[H.LEFT]=e,this.location[H.RIGHT]=n},re.prototype.get=function(t){return t<this.location.length?this.location[t]:k.NONE},re.prototype.isArea=function(){return this.location.length>1},re.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===k.NONE)return!0;return!1},re.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(H.ON,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.location[e]=n}},re.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(k.NONE)},re.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},re.prototype.allPositionsEqual=function(t){for(var e=this,n=0;n<this.location.length;n++)if(e.location[n]!==t)return!1;return!0},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re};var Yt=function i(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new re(t),this.elt[1]=new re(t)}else if(arguments[0]instanceof i){var e=arguments[0];this.elt[0]=new re(e.elt[0]),this.elt[1]=new re(e.elt[1])}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.elt[0]=new re(k.NONE),this.elt[1]=new re(k.NONE),this.elt[n].setLocation(r)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this.elt[0]=new re(s,o,a),this.elt[1]=new re(s,o,a)}else if(arguments.length===4){var l=arguments[0],u=arguments[1],h=arguments[2],c=arguments[3];this.elt[0]=new re(k.NONE,k.NONE,k.NONE),this.elt[1]=new re(k.NONE,k.NONE,k.NONE),this.elt[l].setLocations(u,h,c)}};Yt.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Yt.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Yt.prototype.isNull=function(t){return this.elt[t].isNull()},Yt.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},Yt.prototype.isLine=function(t){return this.elt[t].isLine()},Yt.prototype.merge=function(t){for(var e=this,n=0;n<2;n++)e.elt[n]===null&&t.elt[n]!==null?e.elt[n]=new re(t.elt[n]):e.elt[n].merge(t.elt[n])},Yt.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Yt.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(H.ON)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Yt.prototype.toString=function(){var t=new dr;return this.elt[0]!==null&&(t.append("A:"),t.append(this.elt[0].toString())),this.elt[1]!==null&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},Yt.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var t=arguments[0];return this.elt[t].isArea()}},Yt.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Yt.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(H.ON,e)}else if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];this.elt[n].setLocation(r,s)}},Yt.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Yt.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Yt.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new re(this.elt[t].location[0]))},Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.toLineLabel=function(t){for(var e=new Yt(k.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Ie=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new J,this._pts=new J,this._label=new Yt(k.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new J,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Ie.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),n=0;n<this._pts.size();n++)e[n]=t._pts.get(n);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=tt.isCCW(this._ring.getCoordinates())},Ie.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},Ie.prototype.computePoints=function(t){var e=this;this._startDe=t;var n=t,r=!0;do{if(n===null)throw new Ms("Found null DirectedEdge");if(n.getEdgeRing()===e)throw new Ms("Directed Edge visited twice during ring-building at "+n.getCoordinate());e._edges.add(n);var s=n.getLabel();Tt.isTrue(s.isArea()),e.mergeLabel(s),e.addPoints(n.getEdge(),n.isForward(),r),r=!1,e.setEdgeRing(n,e),n=e.getNext(n)}while(n!==this._startDe)},Ie.prototype.getLinearRing=function(){return this._ring},Ie.prototype.getCoordinate=function(t){return this._pts.get(t)},Ie.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var n=e.getNode(),r=n.getEdges().getOutgoingDegree(t);r>t._maxNodeDegree&&(t._maxNodeDegree=r),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},Ie.prototype.addPoints=function(t,e,n){var r=this,s=t.getCoordinates();if(e){var o=1;n&&(o=0);for(var a=o;a<s.length;a++)r._pts.add(s[a])}else{var l=s.length-2;n&&(l=s.length-1);for(var u=l;u>=0;u--)r._pts.add(s[u])}},Ie.prototype.isHole=function(){return this._isHole},Ie.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},Ie.prototype.containsPoint=function(t){var e=this.getLinearRing(),n=e.getEnvelopeInternal();if(!n.contains(t)||!tt.isPointInRing(t,e.getCoordinates()))return!1;for(var r=this._holes.iterator();r.hasNext();){var s=r.next();if(s.containsPoint(t))return!1}return!0},Ie.prototype.addHole=function(t){this._holes.add(t)},Ie.prototype.isShell=function(){return this._shell===null},Ie.prototype.getLabel=function(){return this._label},Ie.prototype.getEdges=function(){return this._edges},Ie.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Ie.prototype.getShell=function(){return this._shell},Ie.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],r=e.getLocation(n,H.RIGHT);if(r===k.NONE)return null;if(this._label.getLocation(n)===k.NONE)return this._label.setLocation(n,r),null}},Ie.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},Ie.prototype.toPolygon=function(t){for(var e=this,n=new Array(this._holes.size()).fill(null),r=0;r<this._holes.size();r++)n[r]=e._holes.get(r).getLinearRing();var s=t.createPolygon(this.getLinearRing(),n);return s},Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie};var qN=(function(i){function t(){var e=arguments[0],n=arguments[1];i.call(this,e,n)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(n,r){n.setMinEdgeRing(r)},t.prototype.getNext=function(n){return n.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Ie),WN=(function(i){function t(){var e=arguments[0],n=arguments[1];i.call(this,e,n)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var n=this,r=new J,s=this._startDe;do{if(s.getMinEdgeRing()===null){var o=new qN(s,n._geometryFactory);r.add(o)}s=s.getNext()}while(s!==this._startDe);return r},t.prototype.setEdgeRing=function(n,r){n.setEdgeRing(r)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var n=this,r=this._startDe;do{var s=r.getNode();s.getEdges().linkMinimalDirectedEdges(n),r=r.getNext()}while(r!==this._startDe)},t.prototype.getNext=function(n){return n.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Ie),ln=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._label=t}}};ln.prototype.setVisited=function(t){this._isVisited=t},ln.prototype.setInResult=function(t){this._isInResult=t},ln.prototype.isCovered=function(){return this._isCovered},ln.prototype.isCoveredSet=function(){return this._isCoveredSet},ln.prototype.setLabel=function(t){this._label=t},ln.prototype.getLabel=function(){return this._label},ln.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},ln.prototype.updateIM=function(t){Tt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},ln.prototype.isInResult=function(){return this._isInResult},ln.prototype.isVisited=function(){return this._isVisited},ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln};var cf=(function(i){function t(){i.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new Yt(0,k.NONE)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var r=n.next();if(r.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(n){},t.prototype.computeMergedLocation=function(n,r){var s=k.NONE;if(s=this._label.getLocation(r),!n.isNull(r)){var o=n.getLocation(r);s!==k.BOUNDARY&&(s=o)}return s},t.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1];this._label===null?this._label=new Yt(n,r):this._label.setLocation(n,r)}else return i.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof t){var r=arguments[0];this.mergeLabel(r._label)}else if(arguments[0]instanceof Yt)for(var s=arguments[0],o=0;o<2;o++){var a=n.computeMergedLocation(s,o),l=n._label.getLocation(o);l===k.NONE&&n._label.setLocation(o,a)}},t.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},t.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var r=k.NONE;this._label!==null&&(r=this._label.getLocation(n));var s=null;switch(r){case k.BOUNDARY:s=k.INTERIOR;break;case k.INTERIOR:s=k.BOUNDARY;break;default:s=k.BOUNDARY;break}this._label.setLocation(n,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(ln),Sr=function(){this.nodeMap=new fi,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Sr.prototype.find=function(t){return this.nodeMap.get(t)},Sr.prototype.addNode=function(){if(arguments[0]instanceof L){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof cf){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return r===null?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},Sr.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Sr.prototype.iterator=function(){return this.nodeMap.values().iterator()},Sr.prototype.values=function(){return this.nodeMap.values()},Sr.prototype.getBoundaryNodes=function(t){for(var e=new J,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===k.BOUNDARY&&e.add(r)}return e},Sr.prototype.add=function(t){var e=t.getCoordinate(),n=this.addNode(e);n.add(t)},Sr.prototype.interfaces_=function(){return[]},Sr.prototype.getClass=function(){return Sr};var te=function(){},yc={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};te.prototype.interfaces_=function(){return[]},te.prototype.getClass=function(){return te},te.isNorthern=function(t){return t===te.NE||t===te.NW},te.isOpposite=function(t,e){if(t===e)return!1;var n=(t-e+4)%4;return n===2},te.commonHalfPlane=function(t,e){if(t===e)return t;var n=(t-e+4)%4;if(n===2)return-1;var r=t<e?t:e,s=t>e?t:e;return r===0&&s===3?3:r},te.isInHalfPlane=function(t,e){return e===te.SE?t===te.SE||t===te.SW:t===e||t===e+1},te.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new de("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?te.NE:te.SE:e>=0?te.NW:te.SW}else if(arguments[0]instanceof L&&arguments[1]instanceof L){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new de("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?te.NE:te.SE:r.y>=n.y?te.NW:te.SW}},yc.NE.get=function(){return 0},yc.NW.get=function(){return 1},yc.SW.get=function(){return 2},yc.SE.get=function(){return 3},Object.defineProperties(te,yc);var gi=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],n=arguments[1],r=arguments[2],s=null;this._edge=e,this.init(n,r),this._label=s}else if(arguments.length===4){var o=arguments[0],a=arguments[1],l=arguments[2],u=arguments[3];this._edge=o,this.init(a,l),this._label=u}};gi.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:tt.computeOrientation(t._p0,t._p1,this._p1)},gi.prototype.getDy=function(){return this._dy},gi.prototype.getCoordinate=function(){return this._p0},gi.prototype.setNode=function(t){this._node=t},gi.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),s=n.substring(r+1);t.print(" "+s+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},gi.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},gi.prototype.getDirectedCoordinate=function(){return this._p1},gi.prototype.getDx=function(){return this._dx},gi.prototype.getLabel=function(){return this._label},gi.prototype.getEdge=function(){return this._edge},gi.prototype.getQuadrant=function(){return this._quadrant},gi.prototype.getNode=function(){return this._node},gi.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf("."),r=e.substring(n+1);return" "+r+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},gi.prototype.computeLabel=function(t){},gi.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=te.quadrant(this._dx,this._dy),Tt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},gi.prototype.interfaces_=function(){return[bn]},gi.prototype.getClass=function(){return gi};var om=(function(i){function t(){var e=arguments[0],n=arguments[1];if(i.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var r=e.getNumPoints()-1;this.init(e.getCoordinate(r),e.getCoordinate(r-1))}this.computeDirectedLabel()}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.getNextMin=function(){return this._nextMin},t.prototype.getDepth=function(n){return this._depth[n]},t.prototype.setVisited=function(n){this._isVisited=n},t.prototype.computeDirectedLabel=function(){this._label=new Yt(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(n,r){if(this._depth[n]!==-999&&this._depth[n]!==r)throw new Ms("assigned depths do not match",this.getCoordinate());this._depth[n]=r},t.prototype.isInteriorAreaEdge=function(){for(var n=this,r=!0,s=0;s<2;s++)n._label.isArea(s)&&n._label.getLocation(s,H.LEFT)===k.INTERIOR&&n._label.getLocation(s,H.RIGHT)===k.INTERIOR||(r=!1);return r},t.prototype.setNextMin=function(n){this._nextMin=n},t.prototype.print=function(n){i.prototype.print.call(this,n),n.print(" "+this._depth[H.LEFT]+"/"+this._depth[H.RIGHT]),n.print(" ("+this.getDepthDelta()+")"),this._isInResult&&n.print(" inResult")},t.prototype.setMinEdgeRing=function(n){this._minEdgeRing=n},t.prototype.isLineEdge=function(){var n=this._label.isLine(0)||this._label.isLine(1),r=!this._label.isArea(0)||this._label.allPositionsEqual(0,k.EXTERIOR),s=!this._label.isArea(1)||this._label.allPositionsEqual(1,k.EXTERIOR);return n&&r&&s},t.prototype.setEdgeRing=function(n){this._edgeRing=n},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var n=this._edge.getDepthDelta();return this._isForward||(n=-n),n},t.prototype.setInResult=function(n){this._isInResult=n},t.prototype.getSym=function(){return this._sym},t.prototype.isForward=function(){return this._isForward},t.prototype.getEdge=function(){return this._edge},t.prototype.printEdge=function(n){this.print(n),n.print(" "),this._isForward?this._edge.print(n):this._edge.printReverse(n)},t.prototype.setSym=function(n){this._sym=n},t.prototype.setVisitedEdge=function(n){this.setVisited(n),this._sym.setVisited(n)},t.prototype.setEdgeDepths=function(n,r){var s=this.getEdge().getDepthDelta();this._isForward||(s=-s);var o=1;n===H.LEFT&&(o=-1);var a=H.opposite(n),l=s*o,u=r+l;this.setDepth(n,r),this.setDepth(a,u)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(n){this._next=n},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(n,r){return n===k.EXTERIOR&&r===k.INTERIOR?1:n===k.INTERIOR&&r===k.EXTERIOR?-1:0},t})(gi),gu=function(){};gu.prototype.createNode=function(t){return new cf(t,null)},gu.prototype.interfaces_=function(){return[]},gu.prototype.getClass=function(){return gu};var pe=function(){if(this._edges=new J,this._nodes=null,this._edgeEndList=new J,arguments.length===0)this._nodes=new Sr(new gu);else if(arguments.length===1){var t=arguments[0];this._nodes=new Sr(t)}};pe.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var n=0;n<this._edges.size();n++){t.println("edge "+n+":");var r=e._edges.get(n);r.print(t),r.eiList.print(t)}},pe.prototype.find=function(t){return this._nodes.find(t)},pe.prototype.addNode=function(){if(arguments[0]instanceof cf){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof L){var e=arguments[0];return this._nodes.addNode(e)}},pe.prototype.getNodeIterator=function(){return this._nodes.iterator()},pe.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},pe.prototype.debugPrintln=function(t){ii.out.println(t)},pe.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(n===null)return!1;var r=n.getLabel();return r!==null&&r.getLocation(t)===k.BOUNDARY},pe.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}},pe.prototype.matchInSameDirection=function(t,e,n,r){return t.equals(n)?tt.computeOrientation(t,e,r)===tt.COLLINEAR&&te.quadrant(t,e)===te.quadrant(n,r):!1},pe.prototype.getEdgeEnds=function(){return this._edgeEndList},pe.prototype.debugPrint=function(t){ii.out.print(t)},pe.prototype.getEdgeIterator=function(){return this._edges.iterator()},pe.prototype.findEdgeInSameDirection=function(t,e){for(var n=this,r=0;r<this._edges.size();r++){var s=n._edges.get(r),o=s.getCoordinates();if(n.matchInSameDirection(t,e,o[0],o[1])||n.matchInSameDirection(t,e,o[o.length-1],o[o.length-2]))return s}return null},pe.prototype.insertEdge=function(t){this._edges.add(t)},pe.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},pe.prototype.addEdges=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next();e._edges.add(r);var s=new om(r,!0),o=new om(r,!1);s.setSym(o),o.setSym(s),e.add(s),e.add(o)}},pe.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},pe.prototype.getNodes=function(){return this._nodes.values()},pe.prototype.findEdge=function(t,e){for(var n=this,r=0;r<this._edges.size();r++){var s=n._edges.get(r),o=s.getCoordinates();if(t.equals(o[0])&&e.equals(o[1]))return s}return null},pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe},pe.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.getEdges().linkResultDirectedEdges()}};var Wi=function(){this._geometryFactory=null,this._shellList=new J;var t=arguments[0];this._geometryFactory=t};Wi.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var s=r.next();s.isHole()?n.add(s):e.add(s)}},Wi.prototype.computePolygons=function(t){for(var e=this,n=new J,r=t.iterator();r.hasNext();){var s=r.next(),o=s.toPolygon(e._geometryFactory);n.add(o)}return n},Wi.prototype.placeFreeHoles=function(t,e){for(var n=this,r=e.iterator();r.hasNext();){var s=r.next();if(s.getShell()===null){var o=n.findEdgeRingContaining(s,t);if(o===null)throw new Ms("unable to assign hole to a shell",s.getCoordinate(0));s.setShell(o)}}},Wi.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=this,s=new J,o=t.iterator();o.hasNext();){var a=o.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var l=a.buildMinimalRings(),u=r.findShell(l);u!==null?(r.placePolygonHoles(u,l),e.add(u)):n.addAll(l)}else s.add(a)}return s},Wi.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var n=e.next();if(n.containsPoint(t))return!0}return!1},Wi.prototype.buildMaximalEdgeRings=function(t){for(var e=this,n=new J,r=t.iterator();r.hasNext();){var s=r.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var o=new WN(s,e._geometryFactory);n.add(o),o.setInResult()}}return n},Wi.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Wi.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},Wi.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),s=n.getCoordinateN(0),o=null,a=null,l=e.iterator();l.hasNext();){var u=l.next(),h=u.getLinearRing(),c=h.getEnvelopeInternal();o!==null&&(a=o.getLinearRing().getEnvelopeInternal());var d=!1;c.contains(r)&&tt.isPointInRing(s,h.getCoordinates())&&(d=!0),d&&(o===null||a.contains(c))&&(o=u)}return o},Wi.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var s=r.next();s.isHole()||(n=s,e++)}return Tt.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Wi.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],n=arguments[1];pe.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),s=new J,o=this.buildMinimalEdgeRings(r,this._shellList,s);this.sortShellsAndHoles(o,this._shellList,s),this.placeFreeHoles(this._shellList,s)}},Wi.prototype.interfaces_=function(){return[]},Wi.prototype.getClass=function(){return Wi};var pu=function(){};pu.prototype.getBounds=function(){},pu.prototype.interfaces_=function(){return[]},pu.prototype.getClass=function(){return pu};var qn=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};qn.prototype.getItem=function(){return this._item},qn.prototype.getBounds=function(){return this._bounds},qn.prototype.interfaces_=function(){return[pu,Cn]},qn.prototype.getClass=function(){return qn};var Ts=function(){this._size=null,this._items=null,this._size=0,this._items=new J,this._items.add(null)};Ts.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},Ts.prototype.size=function(){return this._size},Ts.prototype.reorder=function(t){for(var e=this,n=null,r=this._items.get(t);t*2<=this._size&&(n=t*2,n!==e._size&&e._items.get(n+1).compareTo(e._items.get(n))<0&&n++,e._items.get(n).compareTo(r)<0);t=n)e._items.set(t,e._items.get(n));this._items.set(t,r)},Ts.prototype.clear=function(){this._size=0,this._items.clear()},Ts.prototype.isEmpty=function(){return this._size===0},Ts.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)e._items.set(n,e._items.get(Math.trunc(n/2)));this._items.set(n,t)},Ts.prototype.interfaces_=function(){return[]},Ts.prototype.getClass=function(){return Ts};var lo=function(){};lo.prototype.visitItem=function(t){},lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo};var Ua=function(){};Ua.prototype.insert=function(t,e){},Ua.prototype.remove=function(t,e){},Ua.prototype.query=function(){},Ua.prototype.interfaces_=function(){return[]},Ua.prototype.getClass=function(){return Ua};var Ae=function(){if(this._childBoundables=new J,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},Hw={serialVersionUID:{configurable:!0}};Ae.prototype.getLevel=function(){return this._level},Ae.prototype.size=function(){return this._childBoundables.size()},Ae.prototype.getChildBoundables=function(){return this._childBoundables},Ae.prototype.addChildBoundable=function(t){Tt.isTrue(this._bounds===null),this._childBoundables.add(t)},Ae.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ae.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Ae.prototype.interfaces_=function(){return[pu,Cn]},Ae.prototype.getClass=function(){return Ae},Hw.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Ae,Hw);var Wn=function(){};Wn.reverseOrder=function(){return{compare:function(e,n){return n.compareTo(e)}}},Wn.min=function(t){return Wn.sort(t),t.get(0)},Wn.sort=function(t,e){var n=t.toArray();e?$o.sort(n,e):$o.sort(n);for(var r=t.iterator(),s=0,o=n.length;s<o;s++)r.next(),r.set(n[s])},Wn.singletonList=function(t){var e=new J;return e.add(t),e};var Me=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};Me.prototype.expandToQueue=function(t,e){var n=Me.isComposite(this._boundable1),r=Me.isComposite(this._boundable2);if(n&&r)return Me.area(this._boundable1)>Me.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new de("neither boundable is composite")},Me.prototype.isLeaves=function(){return!(Me.isComposite(this._boundable1)||Me.isComposite(this._boundable2))},Me.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},Me.prototype.expand=function(t,e,n,r){for(var s=this,o=t.getChildBoundables(),a=o.iterator();a.hasNext();){var l=a.next(),u=new Me(l,e,s._itemDistance);u.getDistance()<r&&n.add(u)}},Me.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},Me.prototype.getDistance=function(){return this._distance},Me.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Me.prototype.interfaces_=function(){return[bn]},Me.prototype.getClass=function(){return Me},Me.area=function(t){return t.getBounds().getArea()},Me.isComposite=function(t){return t instanceof Ae};var Xe=function i(){if(this._root=null,this._built=!1,this._itemBoundables=new J,this._nodeCapacity=null,arguments.length===0){var t=i.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var e=arguments[0];Tt.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}},df={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Xe.prototype.getNodeCapacity=function(){return this._nodeCapacity},Xe.prototype.lastNode=function(t){return t.get(t.size()-1)},Xe.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,r=e.getChildBoundables().iterator();r.hasNext();){var s=r.next();s instanceof Ae?n+=t.size(s):s instanceof qn&&(n+=1)}return n}},Xe.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var s=r.next();s instanceof qn&&s.getItem()===e&&(n=s)}return n!==null?(t.getChildBoundables().remove(n),!0):!1},Xe.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new J:e}else if(arguments.length===1){for(var n=arguments[0],r=new J,s=n.getChildBoundables().iterator();s.hasNext();){var o=s.next();if(o instanceof Ae){var a=t.itemsTree(o);a!==null&&r.add(a)}else o instanceof qn?r.add(o.getItem()):Tt.shouldNeverReachHere()}return r.size()<=0?null:r}},Xe.prototype.insert=function(t,e){Tt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new qn(t,e))},Xe.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],n=new J;return this.boundablesAtLevel(e,this._root,n),n}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2];if(Tt.isTrue(r>-2),s.getLevel()===r)return o.add(s),null;for(var a=s.getChildBoundables().iterator();a.hasNext();){var l=a.next();l instanceof Ae?t.boundablesAtLevel(r,l,o):(Tt.isTrue(l instanceof qn),r===-1&&o.add(l))}return null}},Xe.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var n=new J;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,n),n}else if(arguments.length===2){var r=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,s)}else if(arguments.length===3){if(St(arguments[2],lo)&&arguments[0]instanceof Object&&arguments[1]instanceof Ae)for(var o=arguments[0],a=arguments[1],l=arguments[2],u=a.getChildBoundables(),h=0;h<u.size();h++){var c=u.get(h);t.getIntersectsOp().intersects(c.getBounds(),o)&&(c instanceof Ae?t.query(o,c,l):c instanceof qn?l.visitItem(c.getItem()):Tt.shouldNeverReachHere())}else if(St(arguments[2],zn)&&arguments[0]instanceof Object&&arguments[1]instanceof Ae)for(var d=arguments[0],g=arguments[1],p=arguments[2],E=g.getChildBoundables(),b=0;b<E.size();b++){var P=E.get(b);t.getIntersectsOp().intersects(P.getBounds(),d)&&(P instanceof Ae?t.query(d,P,p):P instanceof qn?p.add(P.getItem()):Tt.shouldNeverReachHere())}}},Xe.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},Xe.prototype.getRoot=function(){return this.build(),this._root},Xe.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,n):!1}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2],a=this.removeItem(s,o);if(a)return!0;for(var l=null,u=s.getChildBoundables().iterator();u.hasNext();){var h=u.next();if(t.getIntersectsOp().intersects(h.getBounds(),r)&&h instanceof Ae&&(a=t.remove(r,h,o),a)){l=h;break}}return l!==null&&l.getChildBoundables().isEmpty()&&s.getChildBoundables().remove(l),a}},Xe.prototype.createHigherLevels=function(t,e){Tt.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return n.size()===1?n.get(0):this.createHigherLevels(n,e+1)},Xe.prototype.depth=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,r=e.getChildBoundables().iterator();r.hasNext();){var s=r.next();if(s instanceof Ae){var o=t.depth(s);o>n&&(n=o)}}return n+1}},Xe.prototype.createParentBoundables=function(t,e){var n=this;Tt.isTrue(!t.isEmpty());var r=new J;r.add(this.createNode(e));var s=new J(t);Wn.sort(s,this.getComparator());for(var o=s.iterator();o.hasNext();){var a=o.next();n.lastNode(r).getChildBoundables().size()===n.getNodeCapacity()&&r.add(n.createNode(e)),n.lastNode(r).addChildBoundable(a)}return r},Xe.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Xe.prototype.interfaces_=function(){return[Cn]},Xe.prototype.getClass=function(){return Xe},Xe.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},df.IntersectsOp.get=function(){return HN},df.serialVersionUID.get=function(){return-3886435814360241e3},df.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Xe,df);var HN=function(){},mu=function(){};mu.prototype.distance=function(t,e){},mu.prototype.interfaces_=function(){return[]},mu.prototype.getClass=function(){return mu};var Xw=(function(i){function t(n){n=n||t.DEFAULT_NODE_CAPACITY,i.call(this,n)}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return t.prototype.createParentBoundablesFromVerticalSlices=function(r,s){var o=this;Tt.isTrue(r.length>0);for(var a=new J,l=0;l<r.length;l++)a.addAll(o.createParentBoundablesFromVerticalSlice(r[l],s));return a},t.prototype.createNode=function(r){return new $w(r)},t.prototype.size=function(){return arguments.length===0?i.prototype.size.call(this):i.prototype.size.apply(this,arguments)},t.prototype.insert=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];if(r.isNull())return null;i.prototype.insert.call(this,r,s)}else return i.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(r,s){for(var o=Math.trunc(Math.ceil(r.size()/s)),a=new Array(s).fill(null),l=r.iterator(),u=0;u<s;u++){a[u]=new J;for(var h=0;l.hasNext()&&h<o;){var c=l.next();a[u].add(c),h++}}return a},t.prototype.query=function(){if(arguments.length===1){var r=arguments[0];return i.prototype.query.call(this,r)}else if(arguments.length===2){var s=arguments[0],o=arguments[1];i.prototype.query.call(this,s,o)}else if(arguments.length===3){if(St(arguments[2],lo)&&arguments[0]instanceof Object&&arguments[1]instanceof Ae){var a=arguments[0],l=arguments[1],u=arguments[2];i.prototype.query.call(this,a,l,u)}else if(St(arguments[2],zn)&&arguments[0]instanceof Object&&arguments[1]instanceof Ae){var h=arguments[0],c=arguments[1],d=arguments[2];i.prototype.query.call(this,h,c,d)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(r,s){return i.prototype.createParentBoundables.call(this,r,s)},t.prototype.remove=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return i.prototype.remove.call(this,r,s)}else return i.prototype.remove.apply(this,arguments)},t.prototype.depth=function(){return arguments.length===0?i.prototype.depth.call(this):i.prototype.depth.apply(this,arguments)},t.prototype.createParentBoundables=function(r,s){Tt.isTrue(!r.isEmpty());var o=Math.trunc(Math.ceil(r.size()/this.getNodeCapacity())),a=new J(r);Wn.sort(a,t.xComparator);var l=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(o))));return this.createParentBoundablesFromVerticalSlices(l,s)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(St(arguments[0],mu)){var r=arguments[0],s=new Me(this.getRoot(),this.getRoot(),r);return this.nearestNeighbour(s)}else if(arguments[0]instanceof Me){var o=arguments[0];return this.nearestNeighbour(o,Pt.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&St(arguments[1],mu)){var a=arguments[0],l=arguments[1],u=new Me(this.getRoot(),a.getRoot(),l);return this.nearestNeighbour(u)}else if(arguments[0]instanceof Me&&typeof arguments[1]=="number"){var h=arguments[0],c=arguments[1],d=c,g=null,p=new Ts;for(p.add(h);!p.isEmpty()&&d>0;){var E=p.poll(),b=E.getDistance();if(b>=d)break;E.isLeaves()?(d=b,g=E):E.expandToQueue(p,d)}return[g.getBoundable(0).getItem(),g.getBoundable(1).getItem()]}}else if(arguments.length===3){var P=arguments[0],v=arguments[1],_=arguments[2],m=new qn(P,v),y=new Me(this.getRoot(),m,_);return this.nearestNeighbour(y)[0]}},t.prototype.interfaces_=function(){return[Ua,Cn]},t.prototype.getClass=function(){return t},t.centreX=function(r){return t.avg(r.getMinX(),r.getMaxX())},t.avg=function(r,s){return(r+s)/2},t.centreY=function(r){return t.avg(r.getMinY(),r.getMaxY())},e.STRtreeNode.get=function(){return $w},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[iu]},compare:function(n,r){return i.compareDoubles(t.centreX(n.getBounds()),t.centreX(r.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[iu]},compare:function(n,r){return i.compareDoubles(t.centreY(n.getBounds()),t.centreY(r.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[i.IntersectsOp]},intersects:function(n,r){return n.intersects(r)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,e),t})(Xe),$w=(function(i){function t(){var e=arguments[0];i.call(this,e)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var n=null,r=this.getChildBoundables().iterator();r.hasNext();){var s=r.next();n===null?n=new ht(s.getBounds()):n.expandToInclude(s.getBounds())}return n},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Ae),Di=function(){};Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di},Di.relativeSign=function(t,e){return t<e?-1:t>e?1:0},Di.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=Di.relativeSign(e.x,n.x),s=Di.relativeSign(e.y,n.y);switch(t){case 0:return Di.compareValue(r,s);case 1:return Di.compareValue(s,r);case 2:return Di.compareValue(s,-r);case 3:return Di.compareValue(-r,s);case 4:return Di.compareValue(-r,-s);case 5:return Di.compareValue(-s,-r);case 6:return Di.compareValue(-s,r);case 7:return Di.compareValue(r,-s)}return Tt.shouldNeverReachHere("invalid octant value"),0},Di.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var uo=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new L(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};uo.prototype.getCoordinate=function(){return this.coord},uo.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},uo.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:Di.compare(this._segmentOctant,this.coord,e.coord)},uo.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},uo.prototype.isInterior=function(){return this._isInterior},uo.prototype.interfaces_=function(){return[bn]},uo.prototype.getClass=function(){return uo};var Si=function(){this._nodeMap=new fi,this._edge=null;var t=arguments[0];this._edge=t};Si.prototype.getSplitCoordinates=function(){var t=this,e=new hc;this.addEndpoints();for(var n=this.iterator(),r=n.next();n.hasNext();){var s=n.next();t.addEdgeCoordinates(r,s,e),r=s}return e.toCoordinateArray()},Si.prototype.addCollapsedNodes=function(){var t=this,e=new J;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var n=e.iterator();n.hasNext();){var r=n.next().intValue();t.add(t._edge.getCoordinate(r),r)}},Si.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Si.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,n=0;n<this._edge.size()-2;n++){var r=e._edge.getCoordinate(n),s=e._edge.getCoordinate(n+2);r.equals2D(s)&&t.add(new fr(n+1))}},Si.prototype.addEdgeCoordinates=function(t,e,n){var r=this,s=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(s);n.add(new L(t.coord),!1);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)n.add(r._edge.getCoordinate(a));o&&n.add(new L(e.coord))},Si.prototype.iterator=function(){return this._nodeMap.values().iterator()},Si.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var n=this.iterator(),r=n.next();n.hasNext();){var s=n.next(),o=e.createSplitEdge(r,s);t.add(o),r=s}},Si.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,r===1?(n[0]=t.segmentIndex+1,!0):!1},Si.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,n=new Array(1).fill(null),r=this.iterator(),s=r.next();r.hasNext();){var o=r.next(),a=e.findCollapseIndex(s,o,n);a&&t.add(new fr(n[0])),s=o}},Si.prototype.getEdge=function(){return this._edge},Si.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},Si.prototype.createSplitEdge=function(t,e){var n=this,r=e.segmentIndex-t.segmentIndex+2,s=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(s);o||r--;var a=new Array(r).fill(null),l=0;a[l++]=new L(t.coord);for(var u=t.segmentIndex+1;u<=e.segmentIndex;u++)a[l++]=n._edge.getCoordinate(u);return o&&(a[l]=new L(e.coord)),new be(a,this._edge.getData())},Si.prototype.add=function(t,e){var n=new uo(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return r!==null?(Tt.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},Si.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0),r=n.getCoordinate(0);if(!r.equals2D(e[0]))throw new Ss("bad split edge start point at "+r);var s=t.get(t.size()-1),o=s.getCoordinates(),a=o[o.length-1];if(!a.equals2D(e[e.length-1]))throw new Ss("bad split edge end point at "+a)},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si};var qa=function(){};qa.prototype.interfaces_=function(){return[]},qa.prototype.getClass=function(){return qa},qa.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new de("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}else if(arguments[0]instanceof L&&arguments[1]instanceof L){var s=arguments[0],o=arguments[1],a=o.x-s.x,l=o.y-s.y;if(a===0&&l===0)throw new de("Cannot compute the octant for two identical points "+s);return qa.octant(a,l)}};var Hr=function(){};Hr.prototype.getCoordinates=function(){},Hr.prototype.size=function(){},Hr.prototype.getCoordinate=function(t){},Hr.prototype.isClosed=function(){},Hr.prototype.setData=function(t){},Hr.prototype.getData=function(){},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var _c=function(){};_c.prototype.addIntersection=function(t,e){},_c.prototype.interfaces_=function(){return[Hr]},_c.prototype.getClass=function(){return _c};var be=function(){this._nodeList=new Si(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};be.prototype.getCoordinates=function(){return this._pts},be.prototype.size=function(){return this._pts.length},be.prototype.getCoordinate=function(t){return this._pts[t]},be.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},be.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},be.prototype.setData=function(t){this._data=t},be.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:qa.octant(t,e)},be.prototype.getData=function(){return this._data},be.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var n=arguments[0],r=arguments[1],s=arguments[3],o=new L(n.getIntersection(s));this.addIntersection(o,r)}},be.prototype.toString=function(){return Vn.toLineString(new Se(this._pts))},be.prototype.getNodeList=function(){return this._nodeList},be.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var s=this._pts[r];t.equals2D(s)&&(n=r)}var o=this._nodeList.add(t,n);return o},be.prototype.addIntersections=function(t,e,n){for(var r=this,s=0;s<t.getIntersectionNum();s++)r.addIntersection(t,e,n,s)},be.prototype.interfaces_=function(){return[_c]},be.prototype.getClass=function(){return be},be.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new J;return be.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var n=arguments[0],r=arguments[1],s=n.iterator();s.hasNext();){var o=s.next();o.getNodeList().addSplitEdges(r)}};var gt=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new L,this.p1=new L;else if(arguments.length===1){var t=arguments[0];this.p0=new L(t.p0),this.p1=new L(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],n=arguments[1],r=arguments[2],s=arguments[3];this.p0=new L(e,n),this.p1=new L(r,s)}},Yw={serialVersionUID:{configurable:!0}};gt.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},gt.prototype.orientationIndex=function(){if(arguments[0]instanceof gt){var t=arguments[0],e=tt.orientationIndex(this.p0,this.p1,t.p0),n=tt.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}else if(arguments[0]instanceof L){var r=arguments[0];return tt.orientationIndex(this.p0,this.p1,r)}},gt.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},gt.prototype.isVertical=function(){return this.p0.x===this.p1.x},gt.prototype.equals=function(t){if(!(t instanceof gt))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},gt.prototype.intersection=function(t){var e=new Ho;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},gt.prototype.project=function(){if(arguments[0]instanceof L){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new L(t);var e=this.projectionFactor(t),n=new L;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof gt){var r=arguments[0],s=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(s>=1&&o>=1||s<=0&&o<=0)return null;var a=this.project(r.p0);s<0&&(a=this.p0),s>1&&(a=this.p1);var l=this.project(r.p1);return o<0&&(l=this.p0),o>1&&(l=this.p1),new gt(a,l)}},gt.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},gt.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},gt.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},gt.prototype.distancePerpendicular=function(t){return tt.distancePointLinePerpendicular(t,this.p0,this.p1)},gt.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},gt.prototype.midPoint=function(){return gt.midPoint(this.p0,this.p1)},gt.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;if(r<=0)return Pt.NaN;var s=((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r;return s},gt.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var n=new Array(2).fill(null),r=Pt.MAX_VALUE,s=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var a=this.closestPoint(t.p1);s=a.distance(t.p1),s<r&&(r=s,n[0]=a,n[1]=t.p1);var l=t.closestPoint(this.p0);s=l.distance(this.p0),s<r&&(r=s,n[0]=this.p0,n[1]=l);var u=t.closestPoint(this.p1);return s=u.distance(this.p1),s<r&&(r=s,n[0]=this.p1,n[1]=u),n},gt.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var n=this.p0.distance(t),r=this.p1.distance(t);return n<r?this.p0:this.p1},gt.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},gt.prototype.getLength=function(){return this.p0.distance(this.p1)},gt.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return n!==0?n:this.p1.compareTo(e.p1)},gt.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},gt.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},gt.prototype.lineIntersection=function(t){try{var e=jn.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(n){if(!(n instanceof ru))throw n}finally{}return null},gt.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},gt.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),r=this.p0.y+t*(this.p1.y-this.p0.y),s=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,a=Math.sqrt(s*s+o*o),l=0,u=0;if(e!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");l=e*s/a,u=e*o/a}var h=n-u,c=r+l,d=new L(h,c);return d},gt.prototype.setCoordinates=function(){if(arguments.length===1){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},gt.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||Pt.isNaN(e))&&(e=1),e},gt.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},gt.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},gt.prototype.distance=function(){if(arguments[0]instanceof gt){var t=arguments[0];return tt.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof L){var e=arguments[0];return tt.distancePointLine(e,this.p0,this.p1)}},gt.prototype.pointAlong=function(t){var e=new L;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},gt.prototype.hashCode=function(){var t=Pt.doubleToLongBits(this.p0.x);t^=Pt.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),n=Pt.doubleToLongBits(this.p1.x);n^=Pt.doubleToLongBits(this.p1.y)*31;var r=Math.trunc(n)^Math.trunc(n>>32);return e^r},gt.prototype.interfaces_=function(){return[bn,Cn]},gt.prototype.getClass=function(){return gt},gt.midPoint=function(t,e){return new L((t.x+e.x)/2,(t.y+e.y)/2)},Yw.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(gt,Yw);var wc=function(){this.tempEnv1=new ht,this.tempEnv2=new ht,this._overlapSeg1=new gt,this._overlapSeg2=new gt};wc.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},wc.prototype.interfaces_=function(){return[]},wc.prototype.getClass=function(){return wc};var Hi=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};Hi.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},Hi.prototype.computeSelect=function(t,e,n,r){var s=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(s,o),n-e===1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var a=Math.trunc((e+n)/2);e<a&&this.computeSelect(t,e,a,r),a<n&&this.computeSelect(t,a,n,r)},Hi.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),n=0,r=this._start;r<=this._end;r++)e[n++]=t._pts[r];return e},Hi.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},Hi.prototype.setId=function(t){this._id=t},Hi.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},Hi.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new ht(t,e)}return this._env},Hi.prototype.getEndIndex=function(){return this._end},Hi.prototype.getStartIndex=function(){return this._start},Hi.prototype.getContext=function(){return this._context},Hi.prototype.getId=function(){return this._id},Hi.prototype.computeOverlapsInternal=function(t,e,n,r,s,o){var a=this._pts[t],l=this._pts[e],u=n._pts[r],h=n._pts[s];if(e-t===1&&s-r===1)return o.overlap(this,t,n,r),null;if(o.tempEnv1.init(a,l),o.tempEnv2.init(u,h),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),d=Math.trunc((r+s)/2);t<c&&(r<d&&this.computeOverlapsInternal(t,c,n,r,d,o),d<s&&this.computeOverlapsInternal(t,c,n,d,s,o)),c<e&&(r<d&&this.computeOverlapsInternal(c,e,n,r,d,o),d<s&&this.computeOverlapsInternal(c,e,n,d,s,o))},Hi.prototype.interfaces_=function(){return[]},Hi.prototype.getClass=function(){return Hi};var br=function(){};br.prototype.interfaces_=function(){return[]},br.prototype.getClass=function(){return br},br.getChainStartIndices=function(t){var e=0,n=new J;n.add(new fr(e));do{var r=br.findChainEnd(t,e);n.add(new fr(r)),e=r}while(e<t.length-1);var s=br.toIntArray(n);return s},br.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var r=te.quadrant(t[n],t[n+1]),s=e+1;s<t.length;){if(!t[s-1].equals2D(t[s])){var o=te.quadrant(t[s-1],t[s]);if(o!==r)break}s++}return s-1},br.getChains=function(){if(arguments.length===1){var t=arguments[0];return br.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],n=arguments[1],r=new J,s=br.getChainStartIndices(e),o=0;o<s.length-1;o++){var a=new Hi(e,s[o],s[o+1],n);r.add(a)}return r}},br.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Jo=function(){};Jo.prototype.computeNodes=function(t){},Jo.prototype.getNodedSubstrings=function(){},Jo.prototype.interfaces_=function(){return[]},Jo.prototype.getClass=function(){return Jo};var Ec=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};Ec.prototype.setSegmentIntersector=function(t){this._segInt=t},Ec.prototype.interfaces_=function(){return[Jo]},Ec.prototype.getClass=function(){return Ec};var am=(function(i){function t(n){n?i.call(this,n):i.call(this),this._monoChains=new J,this._index=new Xw,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={SegmentOverlapAction:{configurable:!0}};return t.prototype.getMonotoneChains=function(){return this._monoChains},t.prototype.getNodedSubstrings=function(){return be.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(r){for(var s=this,o=br.getChains(r.getCoordinates(),r),a=o.iterator();a.hasNext();){var l=a.next();l.setId(s._idCounter++),s._index.insert(l.getEnvelope(),l),s._monoChains.add(l)}},t.prototype.computeNodes=function(r){var s=this;this._nodedSegStrings=r;for(var o=r.iterator();o.hasNext();)s.add(o.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var r=this,s=new Jw(this._segInt),o=this._monoChains.iterator();o.hasNext();)for(var a=o.next(),l=r._index.query(a.getEnvelope()),u=l.iterator();u.hasNext();){var h=u.next();if(h.getId()>a.getId()&&(a.computeOverlaps(h,s),r._nOverlaps++),r._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.SegmentOverlapAction.get=function(){return Jw},Object.defineProperties(t,e),t})(Ec),Jw=(function(i){function t(){i.call(this),this._si=null;var e=arguments[0];this._si=e}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],r=arguments[1],s=arguments[2],o=arguments[3],a=n.getContext(),l=s.getContext();this._si.processIntersections(a,r,l,o)}else return i.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(wc),qt=function i(){if(this._quadrantSegments=i.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=i.CAP_ROUND,this._joinStyle=i.JOIN_ROUND,this._mitreLimit=i.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=i.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(n)}else if(arguments.length===4){var r=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3];this.setQuadrantSegments(r),this.setEndCapStyle(s),this.setJoinStyle(o),this.setMitreLimit(a)}}},Ns={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};qt.prototype.getEndCapStyle=function(){return this._endCapStyle},qt.prototype.isSingleSided=function(){return this._isSingleSided},qt.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=qt.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=qt.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==qt.JOIN_ROUND&&(this._quadrantSegments=qt.DEFAULT_QUADRANT_SEGMENTS)},qt.prototype.getJoinStyle=function(){return this._joinStyle},qt.prototype.setJoinStyle=function(t){this._joinStyle=t},qt.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},qt.prototype.getSimplifyFactor=function(){return this._simplifyFactor},qt.prototype.getQuadrantSegments=function(){return this._quadrantSegments},qt.prototype.setEndCapStyle=function(t){this._endCapStyle=t},qt.prototype.getMitreLimit=function(){return this._mitreLimit},qt.prototype.setMitreLimit=function(t){this._mitreLimit=t},qt.prototype.setSingleSided=function(t){this._isSingleSided=t},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Ns.CAP_ROUND.get=function(){return 1},Ns.CAP_FLAT.get=function(){return 2},Ns.CAP_SQUARE.get=function(){return 3},Ns.JOIN_ROUND.get=function(){return 1},Ns.JOIN_MITRE.get=function(){return 2},Ns.JOIN_BEVEL.get=function(){return 3},Ns.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Ns.DEFAULT_MITRE_LIMIT.get=function(){return 5},Ns.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(qt,Ns);var ye=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=tt.COUNTERCLOCKWISE,this._inputLine=t||null},Sc={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};ye.prototype.isDeletable=function(t,e,n,r){var s=this._inputLine[t],o=this._inputLine[e],a=this._inputLine[n];return!this.isConcave(s,o,a)||!this.isShallow(s,o,a,r)?!1:this.isShallowSampled(s,o,t,n,r)},ye.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,n=this.findNextNonDeletedIndex(e),r=this.findNextNonDeletedIndex(n),s=!1;r<this._inputLine.length;){var o=!1;t.isDeletable(e,n,r,t._distanceTol)&&(t._isDeleted[n]=ye.DELETE,o=!0,s=!0),o?e=r:e=n,n=t.findNextNonDeletedIndex(e),r=t.findNextNonDeletedIndex(n)}return s},ye.prototype.isShallowConcavity=function(t,e,n,r){var s=tt.computeOrientation(t,e,n),o=s===this._angleOrientation;if(!o)return!1;var a=tt.distancePointLine(e,t,n);return a<r},ye.prototype.isShallowSampled=function(t,e,n,r,s){var o=this,a=Math.trunc((r-n)/ye.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var l=n;l<r;l+=a)if(!o.isShallow(t,e,o._inputLine[l],s))return!1;return!0},ye.prototype.isConcave=function(t,e,n){var r=tt.computeOrientation(t,e,n),s=r===this._angleOrientation;return s},ye.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=tt.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var n=!1;do n=e.deleteShallowConcavities();while(n);return this.collapseLine()},ye.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===ye.DELETE;)e++;return e},ye.prototype.isShallow=function(t,e,n,r){var s=tt.distancePointLine(e,t,n);return s<r},ye.prototype.collapseLine=function(){for(var t=this,e=new hc,n=0;n<this._inputLine.length;n++)t._isDeleted[n]!==ye.DELETE&&e.add(t._inputLine[n]);return e.toCoordinateArray()},ye.prototype.interfaces_=function(){return[]},ye.prototype.getClass=function(){return ye},ye.simplify=function(t,e){var n=new ye(t);return n.simplify(e)},Sc.INIT.get=function(){return 0},Sc.DELETE.get=function(){return 1},Sc.KEEP.get=function(){return 1},Sc.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(ye,Sc);var un=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new J},Zw={COORDINATE_ARRAY_TYPE:{configurable:!0}};un.prototype.getCoordinates=function(){var t=this._ptList.toArray(un.COORDINATE_ARRAY_TYPE);return t},un.prototype.setPrecisionModel=function(t){this._precisionModel=t},un.prototype.addPt=function(t){var e=new L(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},un.prototype.revere=function(){},un.prototype.addPts=function(t,e){var n=this;if(e)for(var r=0;r<t.length;r++)n.addPt(t[r]);else for(var s=t.length-1;s>=0;s--)n.addPt(t[s])},un.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),n=t.distance(e);return n<this._minimimVertexDistance},un.prototype.toString=function(){var t=new At,e=t.createLineString(this.getCoordinates());return e.toString()},un.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new L(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},un.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un},Zw.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(un,Zw);var kt=function(){},Wa={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt},kt.toDegrees=function(t){return t*180/Math.PI},kt.normalize=function(t){for(;t>Math.PI;)t-=kt.PI_TIMES_2;for(;t<=-Math.PI;)t+=kt.PI_TIMES_2;return t},kt.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],r=n.x-e.x,s=n.y-e.y;return Math.atan2(s,r)}},kt.isAcute=function(t,e,n){var r=t.x-e.x,s=t.y-e.y,o=n.x-e.x,a=n.y-e.y,l=r*o+s*a;return l>0},kt.isObtuse=function(t,e,n){var r=t.x-e.x,s=t.y-e.y,o=n.x-e.x,a=n.y-e.y,l=r*o+s*a;return l<0},kt.interiorAngle=function(t,e,n){var r=kt.angle(e,t),s=kt.angle(e,n);return Math.abs(s-r)},kt.normalizePositive=function(t){if(t<0){for(;t<0;)t+=kt.PI_TIMES_2;t>=kt.PI_TIMES_2&&(t=0)}else{for(;t>=kt.PI_TIMES_2;)t-=kt.PI_TIMES_2;t<0&&(t=0)}return t},kt.angleBetween=function(t,e,n){var r=kt.angle(e,t),s=kt.angle(e,n);return kt.diff(r,s)},kt.diff=function(t,e){var n=null;return t<e?n=e-t:n=t-e,n>Math.PI&&(n=2*Math.PI-n),n},kt.toRadians=function(t){return t*Math.PI/180},kt.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?kt.COUNTERCLOCKWISE:n<0?kt.CLOCKWISE:kt.NONE},kt.angleBetweenOriented=function(t,e,n){var r=kt.angle(e,t),s=kt.angle(e,n),o=s-r;return o<=-Math.PI?o+kt.PI_TIMES_2:o>Math.PI?o-kt.PI_TIMES_2:o},Wa.PI_TIMES_2.get=function(){return 2*Math.PI},Wa.PI_OVER_2.get=function(){return Math.PI/2},Wa.PI_OVER_4.get=function(){return Math.PI/4},Wa.COUNTERCLOCKWISE.get=function(){return tt.COUNTERCLOCKWISE},Wa.CLOCKWISE.get=function(){return tt.CLOCKWISE},Wa.NONE.get=function(){return tt.COLLINEAR},Object.defineProperties(kt,Wa);var he=function i(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new gt,this._seg1=new gt,this._offset0=new gt,this._offset1=new gt,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new Ho,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===qt.JOIN_ROUND&&(this._closingSegLengthFactor=i.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},bc={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};he.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=tt.computeOrientation(this._s0,this._s1,this._s2),r=n===tt.CLOCKWISE&&this._side===H.LEFT||n===tt.COUNTERCLOCKWISE&&this._side===H.RIGHT;n===0?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},he.prototype.addLineEndCap=function(t,e){var n=new gt(t,e),r=new gt;this.computeOffsetSegment(n,H.LEFT,this._distance,r);var s=new gt;this.computeOffsetSegment(n,H.RIGHT,this._distance,s);var o=e.x-t.x,a=e.y-t.y,l=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case qt.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,l+Math.PI/2,l-Math.PI/2,tt.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case qt.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(s.p1);break;case qt.CAP_SQUARE:var u=new L;u.x=Math.abs(this._distance)*Math.cos(l),u.y=Math.abs(this._distance)*Math.sin(l);var h=new L(r.p1.x+u.x,r.p1.y+u.y),c=new L(s.p1.x+u.x,s.p1.y+u.y);this._segList.addPt(h),this._segList.addPt(c);break}},he.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},he.prototype.addMitreJoin=function(t,e,n,r){var s=!0,o=null;try{o=jn.intersection(e.p0,e.p1,n.p0,n.p1);var a=r<=0?1:o.distance(t)/Math.abs(r);a>this._bufParams.getMitreLimit()&&(s=!1)}catch(l){if(l instanceof ru)o=new L(0,0),s=!1;else throw l}finally{}s?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},he.prototype.addFilletCorner=function(t,e,n,r,s){var o=e.x-t.x,a=e.y-t.y,l=Math.atan2(a,o),u=n.x-t.x,h=n.y-t.y,c=Math.atan2(h,u);r===tt.CLOCKWISE?l<=c&&(l+=2*Math.PI):l>=c&&(l-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,l,c,r,s),this._segList.addPt(n)},he.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*he.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===qt.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===qt.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},he.prototype.createSquare=function(t){this._segList.addPt(new L(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new L(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new L(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new L(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},he.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},he.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},he.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},he.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},he.prototype.addLimitedMitreJoin=function(t,e,n,r){var s=this._seg0.p1,o=kt.angle(s,this._seg0.p0),a=kt.angleBetweenOriented(this._seg0.p0,s,this._seg1.p1),l=a/2,u=kt.normalize(o+l),h=kt.normalize(u+Math.PI),c=r*n,d=c*Math.abs(Math.sin(l)),g=n-d,p=s.x+c*Math.cos(h),E=s.y+c*Math.sin(h),b=new L(p,E),P=new gt(s,b),v=P.pointAlongOffset(1,g),_=P.pointAlongOffset(1,-g);this._side===H.LEFT?(this._segList.addPt(v),this._segList.addPt(_)):(this._segList.addPt(_),this._segList.addPt(v))},he.prototype.computeOffsetSegment=function(t,e,n,r){var s=e===H.LEFT?1:-1,o=t.p1.x-t.p0.x,a=t.p1.y-t.p0.y,l=Math.sqrt(o*o+a*a),u=s*n*o/l,h=s*n*a/l;r.p0.x=t.p0.x-h,r.p0.y=t.p0.y+u,r.p1.x=t.p1.x-h,r.p1.y=t.p1.y+u},he.prototype.addFilletArc=function(t,e,n,r,s){var o=this,a=r===tt.CLOCKWISE?-1:1,l=Math.abs(e-n),u=Math.trunc(l/this._filletAngleQuantum+.5);if(u<1)return null;for(var h=0,c=l/u,d=h,g=new L;d<l;){var p=e+a*d;g.x=t.x+s*Math.cos(p),g.y=t.y+s*Math.sin(p),o._segList.addPt(g),d+=c}},he.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*he.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new L((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var r=new L((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},he.prototype.createCircle=function(t){var e=new L(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},he.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},he.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new un,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*he.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},he.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===qt.JOIN_BEVEL||this._bufParams.getJoinStyle()===qt.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,tt.CLOCKWISE,this._distance))},he.prototype.closeRing=function(){this._segList.closeRing()},he.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},he.prototype.interfaces_=function(){return[]},he.prototype.getClass=function(){return he},bc.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},bc.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},bc.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},bc.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(he,bc);var Ri=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Ri.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var n=e<0,r=Math.abs(e),s=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],s):this.computeOffsetCurve(t,n,s);var o=s.getCoordinates();return n&&Rt.reverse(o),o},Ri.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var s=ye.simplify(t,-r),o=s.length-1;n.initSideSegments(s[o],s[o-1],H.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(s[a],!0)}else{n.addSegments(t,!1);var l=ye.simplify(t,r),u=l.length-1;n.initSideSegments(l[0],l[1],H.LEFT),n.addFirstSegment();for(var h=2;h<=u;h++)n.addNextSegment(l[h],!0)}n.addLastSegment(),n.closeRing()},Ri.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===H.RIGHT&&(r=-r);var s=ye.simplify(t,r),o=s.length-1;n.initSideSegments(s[o-1],s[0],e);for(var a=1;a<=o;a++){var l=a!==1;n.addNextSegment(s[a],l)}n.closeRing()},Ri.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=ye.simplify(t,n),s=r.length-1;e.initSideSegments(r[0],r[1],H.LEFT);for(var o=2;o<=s;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[s-1],r[s]);var a=ye.simplify(t,-n),l=a.length-1;e.initSideSegments(a[l],a[l-1],H.LEFT);for(var u=l-2;u>=0;u--)e.addNextSegment(a[u],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},Ri.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case qt.CAP_ROUND:e.createCircle(t);break;case qt.CAP_SQUARE:e.createSquare(t);break}},Ri.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var s=e<0;this.computeSingleSidedBufferCurve(t,s,r)}else this.computeLineBufferCurve(t,r);var o=r.getCoordinates();return o},Ri.prototype.getBufferParameters=function(){return this._bufParams},Ri.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Ri.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(n===0)return Ri.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Ri.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var s=ye.simplify(t,-r),o=s.length-1;n.initSideSegments(s[o],s[o-1],H.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(s[a],!0)}else{var l=ye.simplify(t,r),u=l.length-1;n.initSideSegments(l[0],l[1],H.LEFT),n.addFirstSegment();for(var h=2;h<=u;h++)n.addNextSegment(l[h],!0)}n.addLastSegment()},Ri.prototype.getSegGen=function(t){return new he(this._precisionModel,this._bufParams,t)},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new L(t[n]);return e};var Ha=function(){this._subgraphs=null,this._seg=new gt,this._cga=new tt;var t=arguments[0];this._subgraphs=t},Kw={DepthSegment:{configurable:!0}};Ha.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=new J,r=this._subgraphs.iterator();r.hasNext();){var s=r.next(),o=s.getEnvelope();e.y<o.getMinY()||e.y>o.getMaxY()||t.findStabbedSegments(e,s.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(St(arguments[2],zn)&&arguments[0]instanceof L&&arguments[1]instanceof om)for(var a=arguments[0],l=arguments[1],u=arguments[2],h=l.getEdge().getCoordinates(),c=0;c<h.length-1;c++){t._seg.p0=h[c],t._seg.p1=h[c+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var d=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(d<a.x)&&!t._seg.isHorizontal()&&!(a.y<t._seg.p0.y||a.y>t._seg.p1.y)&&tt.computeOrientation(t._seg.p0,t._seg.p1,a)!==tt.RIGHT){var g=l.getDepth(H.LEFT);t._seg.p0.equals(h[c])||(g=l.getDepth(H.RIGHT));var p=new Zo(t._seg,g);u.add(p)}}else if(St(arguments[2],zn)&&arguments[0]instanceof L&&St(arguments[1],zn))for(var E=arguments[0],b=arguments[1],P=arguments[2],v=b.iterator();v.hasNext();){var _=v.next();_.isForward()&&t.findStabbedSegments(E,_,P)}}},Ha.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var n=Wn.min(e);return n._leftDepth},Ha.prototype.interfaces_=function(){return[]},Ha.prototype.getClass=function(){return Ha},Kw.DepthSegment.get=function(){return Zo},Object.defineProperties(Ha,Kw);var Zo=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new gt(t),this._leftDepth=e};Zo.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return n!==0||(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(e._upwardSeg)},Zo.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return n!==0?n:t.p1.compareTo(e.p1)},Zo.prototype.toString=function(){return this._upwardSeg.toString()},Zo.prototype.interfaces_=function(){return[bn]},Zo.prototype.getClass=function(){return Zo};var Wt=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Wt.prototype.area=function(){return Wt.area(this.p0,this.p1,this.p2)},Wt.prototype.signedArea=function(){return Wt.signedArea(this.p0,this.p1,this.p2)},Wt.prototype.interpolateZ=function(t){if(t===null)throw new de("Supplied point is null.");return Wt.interpolateZ(t,this.p0,this.p1,this.p2)},Wt.prototype.longestSideLength=function(){return Wt.longestSideLength(this.p0,this.p1,this.p2)},Wt.prototype.isAcute=function(){return Wt.isAcute(this.p0,this.p1,this.p2)},Wt.prototype.circumcentre=function(){return Wt.circumcentre(this.p0,this.p1,this.p2)},Wt.prototype.area3D=function(){return Wt.area3D(this.p0,this.p1,this.p2)},Wt.prototype.centroid=function(){return Wt.centroid(this.p0,this.p1,this.p2)},Wt.prototype.inCentre=function(){return Wt.inCentre(this.p0,this.p1,this.p2)},Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},Wt.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Wt.det=function(t,e,n,r){return t*r-e*n},Wt.interpolateZ=function(t,e,n,r){var s=e.x,o=e.y,a=n.x-s,l=r.x-s,u=n.y-o,h=r.y-o,c=a*h-l*u,d=t.x-s,g=t.y-o,p=(h*d-l*g)/c,E=(-u*d+a*g)/c,b=e.z+p*(n.z-e.z)+E*(r.z-e.z);return b},Wt.longestSideLength=function(t,e,n){var r=t.distance(e),s=e.distance(n),o=n.distance(t),a=r;return s>a&&(a=s),o>a&&(a=o),a},Wt.isAcute=function(t,e,n){return!(!kt.isAcute(t,e,n)||!kt.isAcute(e,n,t)||!kt.isAcute(n,t,e))},Wt.circumcentre=function(t,e,n){var r=n.x,s=n.y,o=t.x-r,a=t.y-s,l=e.x-r,u=e.y-s,h=2*Wt.det(o,a,l,u),c=Wt.det(a,o*o+a*a,u,l*l+u*u),d=Wt.det(o,o*o+a*a,l,l*l+u*u),g=r-c/h,p=s+d/h;return new L(g,p)},Wt.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,s=new jn(t.x+n/2,t.y+r/2,1),o=new jn(t.x-r+n/2,t.y+n+r/2,1);return new jn(s,o)},Wt.angleBisector=function(t,e,n){var r=e.distance(t),s=e.distance(n),o=r/(r+s),a=n.x-t.x,l=n.y-t.y,u=new L(t.x+o*a,t.y+o*l);return u},Wt.area3D=function(t,e,n){var r=e.x-t.x,s=e.y-t.y,o=e.z-t.z,a=n.x-t.x,l=n.y-t.y,u=n.z-t.z,h=s*u-o*l,c=o*a-r*u,d=r*l-s*a,g=h*h+c*c+d*d,p=Math.sqrt(g)/2;return p},Wt.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,s=(t.y+e.y+n.y)/3;return new L(r,s)},Wt.inCentre=function(t,e,n){var r=e.distance(n),s=t.distance(n),o=t.distance(e),a=r+s+o,l=(r*t.x+s*e.x+o*n.x)/a,u=(r*t.y+s*e.y+o*n.y)/a;return new L(l,u)};var Tn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new J;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Tn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,k.EXTERIOR,k.INTERIOR)},Tn.prototype.addPolygon=function(t){var e=this,n=this._distance,r=H.LEFT;this._distance<0&&(n=-this._distance,r=H.RIGHT);var s=t.getExteriorRing(),o=Rt.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,n,r,k.EXTERIOR,k.INTERIOR);for(var a=0;a<t.getNumInteriorRing();a++){var l=t.getInteriorRingN(a),u=Rt.removeRepeatedPoints(l.getCoordinates());e._distance>0&&e.isErodedCompletely(l,-e._distance)||e.addPolygonRing(u,n,H.opposite(r),k.INTERIOR,k.EXTERIOR)}},Tn.prototype.isTriangleErodedCompletely=function(t,e){var n=new Wt(t[0],t[1],t[2]),r=n.inCentre(),s=tt.distancePointLine(r,n.p0,n.p1);return s<Math.abs(e)},Tn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Rt.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,k.EXTERIOR,k.INTERIOR)},Tn.prototype.addCurve=function(t,e,n){if(t===null||t.length<2)return null;var r=new be(t,new Yt(0,k.BOUNDARY,e,n));this._curveList.add(r)},Tn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Tn.prototype.addPolygonRing=function(t,e,n,r,s){if(e===0&&t.length<Ur.MINIMUM_VALID_SIZE)return null;var o=r,a=s;t.length>=Ur.MINIMUM_VALID_SIZE&&tt.isCCW(t)&&(o=s,a=r,n=H.opposite(n));var l=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(l,o,a)},Tn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Re?this.addPolygon(t):t instanceof ve?this.addLineString(t):t instanceof qi?this.addPoint(t):t instanceof fu?this.addCollection(t):t instanceof Yo?this.addCollection(t):t instanceof qr?this.addCollection(t):t instanceof wi&&this.addCollection(t)},Tn.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(n.length===4)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),s=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>s},Tn.prototype.addCollection=function(t){for(var e=this,n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);e.add(r)}},Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn};var vu=function(){};vu.prototype.locate=function(t){},vu.prototype.interfaces_=function(){return[]},vu.prototype.getClass=function(){return vu};var Xr=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};Xr.prototype.next=function(){if(this._atStart)return this._atStart=!1,Xr.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new cu;var t=this._parent.getGeometryN(this._index++);return t instanceof wi?(this._subcollectionIterator=new Xr(t),this._subcollectionIterator.next()):t},Xr.prototype.remove=function(){throw new Error(this.getClass().getName())},Xr.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Xr.prototype.interfaces_=function(){return[hu]},Xr.prototype.getClass=function(){return Xr},Xr.isAtomic=function(t){return!(t instanceof wi)};var hn=function(){this._geom=null;var t=arguments[0];this._geom=t};hn.prototype.locate=function(t){return hn.locate(t,this._geom)},hn.prototype.interfaces_=function(){return[vu]},hn.prototype.getClass=function(){return hn},hn.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?tt.isPointInRing(t,e.getCoordinates()):!1},hn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!hn.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var s=e.getInteriorRingN(r);if(hn.isPointInRing(t,s))return!1}return!0},hn.containsPoint=function(t,e){if(e instanceof Re)return hn.containsPointInPolygon(t,e);if(e instanceof wi)for(var n=new Xr(e);n.hasNext();){var r=n.next();if(r!==e&&hn.containsPoint(t,r))return!0}return!1},hn.locate=function(t,e){return e.isEmpty()?k.EXTERIOR:hn.containsPoint(t,e)?k.INTERIOR:k.EXTERIOR};var pi=function(){this._edgeMap=new fi,this._edgeList=null,this._ptInAreaLocation=[k.NONE,k.NONE]};pi.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return e===0&&(n=this._edgeList.size()-1),this._edgeList.get(n)},pi.prototype.propagateSideLabels=function(t){for(var e=k.NONE,n=this.iterator();n.hasNext();){var r=n.next(),s=r.getLabel();s.isArea(t)&&s.getLocation(t,H.LEFT)!==k.NONE&&(e=s.getLocation(t,H.LEFT))}if(e===k.NONE)return null;for(var o=e,a=this.iterator();a.hasNext();){var l=a.next(),u=l.getLabel();if(u.getLocation(t,H.ON)===k.NONE&&u.setLocation(t,H.ON,o),u.isArea(t)){var h=u.getLocation(t,H.LEFT),c=u.getLocation(t,H.RIGHT);if(c!==k.NONE){if(c!==o)throw new Ms("side location conflict",l.getCoordinate());h===k.NONE&&Tt.shouldNeverReachHere("found single null side (at "+l.getCoordinate()+")"),o=h}else Tt.isTrue(u.getLocation(t,H.LEFT)===k.NONE,"found single null side"),u.setLocation(t,H.RIGHT,o),u.setLocation(t,H.LEFT,o)}}},pi.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},pi.prototype.print=function(t){ii.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},pi.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},pi.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel(),s=r.getLocation(t,H.LEFT);Tt.isTrue(s!==k.NONE,"Found unlabelled area edge");for(var o=s,a=this.iterator();a.hasNext();){var l=a.next(),u=l.getLabel();Tt.isTrue(u.isArea(t),"Found non-area edge");var h=u.getLocation(t,H.LEFT),c=u.getLocation(t,H.RIGHT);if(h===c||c!==o)return!1;o=h}return!0},pi.prototype.findIndex=function(t){var e=this;this.iterator();for(var n=0;n<this._edgeList.size();n++){var r=e._edgeList.get(n);if(r===t)return n}return-1},pi.prototype.iterator=function(){return this.getEdges().iterator()},pi.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new J(this._edgeMap.values())),this._edgeList},pi.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===k.NONE&&(this._ptInAreaLocation[t]=hn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},pi.prototype.toString=function(){var t=new dr;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
46
+ `}[t]};var jn=function i(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],n=arguments[1];this.x=e,this.y=n,this.w=1}else if(arguments[0]instanceof i&&arguments[1]instanceof i){var r=arguments[0],s=arguments[1];this.x=r.y*s.w-s.y*r.w,this.y=s.x*r.w-r.x*s.w,this.w=r.x*s.y-s.x*r.y}else if(arguments[0]instanceof L&&arguments[1]instanceof L){var o=arguments[0],a=arguments[1];this.x=o.y-a.y,this.y=a.x-o.x,this.w=o.x*a.y-a.x*o.y}}else if(arguments.length===3){var l=arguments[0],u=arguments[1],h=arguments[2];this.x=l,this.y=u,this.w=h}else if(arguments.length===4){var c=arguments[0],d=arguments[1],g=arguments[2],p=arguments[3],E=c.y-d.y,b=d.x-c.x,P=c.x*d.y-d.x*c.y,v=g.y-p.y,_=p.x-g.x,m=g.x*p.y-p.x*g.y;this.x=b*m-_*P,this.y=v*P-E*m,this.w=E*_-v*b}};jn.prototype.getY=function(){var t=this.y/this.w;if(Pt.isNaN(t)||Pt.isInfinite(t))throw new ru;return t},jn.prototype.getX=function(){var t=this.x/this.w;if(Pt.isNaN(t)||Pt.isInfinite(t))throw new ru;return t},jn.prototype.getCoordinate=function(){var t=new L;return t.x=this.getX(),t.y=this.getY(),t},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.intersection=function(t,e,n,r){var s=t.y-e.y,o=e.x-t.x,a=t.x*e.y-e.x*t.y,l=n.y-r.y,u=r.x-n.x,h=n.x*r.y-r.x*n.y,c=o*h-u*a,d=l*a-s*h,g=s*u-l*o,p=c/g,E=d/g;if(Pt.isNaN(p)||Pt.isInfinite(p)||Pt.isNaN(E)||Pt.isInfinite(E))throw new ru;return new L(p,E)};var ht=function i(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof i){var e=arguments[0];this.init(e)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],l=arguments[3];this.init(s,o,a,l)}},Gw={serialVersionUID:{configurable:!0}};ht.prototype.getArea=function(){return this.getWidth()*this.getHeight()},ht.prototype.equals=function(t){if(!(t instanceof ht))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},ht.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new ht;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,s=this._maxy<t._maxy?this._maxy:t._maxy;return new ht(e,r,n,s)},ht.prototype.isNull=function(){return this._maxx<this._minx},ht.prototype.getMaxX=function(){return this._maxx},ht.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof ht){var e=arguments[0];return this.isNull()||e.isNull()?!1:e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},ht.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof ht){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}else if(arguments[0]instanceof L){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.isNull()?!1:!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}},ht.prototype.getMinY=function(){return this._miny},ht.prototype.getMinX=function(){return this._minx},ht.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof ht){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},ht.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},ht.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},ht.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},ht.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},ht.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},ht.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},ht.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},ht.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},ht.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},ht.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof ht){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof L){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},ht.prototype.centre=function(){return this.isNull()?null:new L((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},ht.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof ht){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],l=arguments[3];s<o?(this._minx=s,this._maxx=o):(this._minx=o,this._maxx=s),a<l?(this._miny=a,this._maxy=l):(this._miny=l,this._maxy=a)}},ht.prototype.getMaxY=function(){return this._maxy},ht.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),e===0?n:n===0?e:Math.sqrt(e*e+n*n)},ht.prototype.hashCode=function(){var t=17;return t=37*t+L.hashCode(this._minx),t=37*t+L.hashCode(this._maxx),t=37*t+L.hashCode(this._miny),t=37*t+L.hashCode(this._maxy),t},ht.prototype.interfaces_=function(){return[bn,Cn]},ht.prototype.getClass=function(){return ht},ht.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var r=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],l=Math.min(o.x,a.x),u=Math.max(o.x,a.x),h=Math.min(r.x,s.x),c=Math.max(r.x,s.x);return!(h>u||c<l||(l=Math.min(o.y,a.y),u=Math.max(o.y,a.y),h=Math.min(r.y,s.y),c=Math.max(r.y,s.y),h>u)||c<l)}},Gw.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(ht,Gw);var gr={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},Qd=function(t){this.geometryFactory=t||new At};Qd.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var s=gr.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(s=gr.emptyTypeStr.exec(t),s[2]=void 0),s&&(n=s[1].toLowerCase(),r=s[2],su[n]&&(e=su[n].apply(this,[r]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},Qd.prototype.write=function(t){return this.extractGeometry(t)},Qd.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Es[e])return null;var n=e.toUpperCase(),r;return t.isEmpty()?r=n+" EMPTY":r=n+"("+Es[e].apply(this,[t])+")",r};var Es={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Es.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,n=[],r=0,s=t._geometries.length;r<s;++r)n.push("("+Es.point.apply(e,[t._geometries[r]])+")");return n.join(",")},linestring:function(t){for(var e=this,n=[],r=0,s=t._points._coordinates.length;r<s;++r)n.push(Es.coordinate.apply(e,[t._points._coordinates[r]]));return n.join(",")},linearring:function(t){for(var e=this,n=[],r=0,s=t._points._coordinates.length;r<s;++r)n.push(Es.coordinate.apply(e,[t._points._coordinates[r]]));return n.join(",")},multilinestring:function(t){for(var e=this,n=[],r=0,s=t._geometries.length;r<s;++r)n.push("("+Es.linestring.apply(e,[t._geometries[r]])+")");return n.join(",")},polygon:function(t){var e=this,n=[];n.push("("+Es.linestring.apply(this,[t._shell])+")");for(var r=0,s=t._holes.length;r<s;++r)n.push("("+Es.linestring.apply(e,[t._holes[r]])+")");return n.join(",")},multipolygon:function(t){for(var e=this,n=[],r=0,s=t._geometries.length;r<s;++r)n.push("("+Es.polygon.apply(e,[t._geometries[r]])+")");return n.join(",")},geometrycollection:function(t){for(var e=this,n=[],r=0,s=t._geometries.length;r<s;++r)n.push(e.extractGeometry(t._geometries[r]));return n.join(",")}},su={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(gr.spaces);return this.geometryFactory.createPoint(new L(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var n,r=t.trim().split(","),s=[],o=0,a=r.length;o<a;++o)n=r[o].replace(gr.trimParens,"$1"),s.push(su.point.apply(e,[n]));return this.geometryFactory.createMultiPoint(s)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),n=[],r,s=0,o=e.length;s<o;++s)r=e[s].trim().split(gr.spaces),n.push(new L(Number.parseFloat(r[0]),Number.parseFloat(r[1])));return this.geometryFactory.createLineString(n)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),n=[],r,s=0,o=e.length;s<o;++s)r=e[s].trim().split(gr.spaces),n.push(new L(Number.parseFloat(r[0]),Number.parseFloat(r[1])));return this.geometryFactory.createLinearRing(n)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var n,r=t.trim().split(gr.parenComma),s=[],o=0,a=r.length;o<a;++o)n=r[o].replace(gr.trimParens,"$1"),s.push(su.linestring.apply(e,[n]));return this.geometryFactory.createMultiLineString(s)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var n,r,s,o=t.trim().split(gr.parenComma),a,l=[],u=0,h=o.length;u<h;++u)n=o[u].replace(gr.trimParens,"$1"),r=su.linestring.apply(e,[n]),s=e.geometryFactory.createLinearRing(r._points),u===0?a=s:l.push(s);return this.geometryFactory.createPolygon(a,l)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var n,r=t.trim().split(gr.doubleParenComma),s=[],o=0,a=r.length;o<a;++o)n=r[o].replace(gr.trimParens,"$1"),s.push(su.polygon.apply(e,[n]));return this.geometryFactory.createMultiPolygon(s)},geometrycollection:function(t){var e=this;if(t===void 0)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var n=t.trim().split("|"),r=[],s=0,o=n.length;s<o;++s)r.push(e.read(n[s]));return this.geometryFactory.createGeometryCollection(r)}},Vn=function(t){this.parser=new Qd(t)};Vn.prototype.write=function(t){return this.parser.write(t)},Vn.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Ss=(function(i){function t(e){i.call(this,e),this.name="RuntimeException",this.message=e,this.stack=new i().stack}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t})(Error),tf=(function(i){function t(){if(i.call(this),arguments.length===0)i.call(this);else if(arguments.length===1){var e=arguments[0];i.call(this,e)}}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Ss),Tt=function(){};Tt.prototype.interfaces_=function(){return[]},Tt.prototype.getClass=function(){return Tt},Tt.shouldNeverReachHere=function(){if(arguments.length===0)Tt.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new tf("Should never reach here"+(t!==null?": "+t:""))}},Tt.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],Tt.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new tf:new tf(e)},Tt.equals=function(){var t,e,n;if(arguments.length===2)t=arguments[0],e=arguments[1],Tt.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],n=arguments[2],!e.equals(t)))throw new tf("Expected "+t+" but encountered "+e+(n!==null?": "+n:""))};var ge=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new L,this._intPt[1]=new L,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},ja={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};ge.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},ge.prototype.getTopologySummary=function(){var t=new dr;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},ge.prototype.computeIntersection=function(t,e,n,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,n,r)},ge.prototype.getIntersectionNum=function(){return this._result},ge.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var t=arguments[0],e=this.getEdgeDistance(t,0),n=this.getEdgeDistance(t,1);e>n?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},ge.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},ge.prototype.setPrecisionModel=function(t){this._precisionModel=t},ge.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],n=0;n<this._result;n++)if(!(t._intPt[n].equals2D(t._inputLines[e][0])||t._intPt[n].equals2D(t._inputLines[e][1])))return!0;return!1}},ge.prototype.getIntersection=function(t){return this._intPt[t]},ge.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},ge.prototype.hasIntersection=function(){return this._result!==ge.NO_INTERSECTION},ge.prototype.getEdgeDistance=function(t,e){var n=ge.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return n},ge.prototype.isCollinear=function(){return this._result===ge.COLLINEAR_INTERSECTION},ge.prototype.toString=function(){return Vn.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Vn.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},ge.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},ge.prototype.isIntersection=function(t){for(var e=this,n=0;n<this._result;n++)if(e._intPt[n].equals2D(t))return!0;return!1},ge.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge},ge.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),s=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))r>s?o=r:o=s;else{var a=Math.abs(t.x-e.x),l=Math.abs(t.y-e.y);r>s?o=a:o=l,o===0&&!t.equals(e)&&(o=Math.max(a,l))}return Tt.isTrue(!(o===0&&!t.equals(e)),"Bad distance calculation"),o},ge.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,s=t.y-e.y,o=Math.sqrt(r*r+s*s);return Tt.isTrue(!(o===0&&!t.equals(e)),"Invalid distance calculation"),o},ja.DONT_INTERSECT.get=function(){return 0},ja.DO_INTERSECT.get=function(){return 1},ja.COLLINEAR.get=function(){return 2},ja.NO_INTERSECTION.get=function(){return 0},ja.POINT_INTERSECTION.get=function(){return 1},ja.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(ge,ja);var Ho=(function(i){function t(){i.apply(this,arguments)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(n){var r=new ht(this._inputLines[0][0],this._inputLines[0][1]),s=new ht(this._inputLines[1][0],this._inputLines[1][1]);return r.contains(n)&&s.contains(n)},t.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];if(this._isProper=!1,ht.intersects(r,s,n)&&tt.orientationIndex(r,s,n)===0&&tt.orientationIndex(s,r,n)===0)return this._isProper=!0,(n.equals(r)||n.equals(s))&&(this._isProper=!1),this._result=i.POINT_INTERSECTION,null;this._result=i.NO_INTERSECTION}else return i.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(n,r,s,o,a){a.x=this.smallestInAbsValue(n.x,r.x,s.x,o.x),a.y=this.smallestInAbsValue(n.y,r.y,s.y,o.y),n.x-=a.x,n.y-=a.y,r.x-=a.x,r.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},t.prototype.safeHCoordinateIntersection=function(n,r,s,o){var a=null;try{a=jn.intersection(n,r,s,o)}catch(l){if(l instanceof ru)a=t.nearestEndpoint(n,r,s,o);else throw l}finally{}return a},t.prototype.intersection=function(n,r,s,o){var a=this.intersectionWithNormalization(n,r,s,o);return this.isInSegmentEnvelopes(a)||(a=new L(t.nearestEndpoint(n,r,s,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},t.prototype.smallestInAbsValue=function(n,r,s,o){var a=n,l=Math.abs(a);return Math.abs(r)<l&&(a=r,l=Math.abs(r)),Math.abs(s)<l&&(a=s,l=Math.abs(s)),Math.abs(o)<l&&(a=o),a},t.prototype.checkDD=function(n,r,s,o,a){var l=Oi.intersection(n,r,s,o),u=this.isInSegmentEnvelopes(l);ii.out.println("DD in env = "+u+" --------------------- "+l),a.distance(l)>1e-4&&ii.out.println("Distance = "+a.distance(l))},t.prototype.intersectionWithNormalization=function(n,r,s,o){var a=new L(n),l=new L(r),u=new L(s),h=new L(o),c=new L;this.normalizeToEnvCentre(a,l,u,h,c);var d=this.safeHCoordinateIntersection(a,l,u,h);return d.x+=c.x,d.y+=c.y,d},t.prototype.computeCollinearIntersection=function(n,r,s,o){var a=ht.intersects(n,r,s),l=ht.intersects(n,r,o),u=ht.intersects(s,o,n),h=ht.intersects(s,o,r);return a&&l?(this._intPt[0]=s,this._intPt[1]=o,i.COLLINEAR_INTERSECTION):u&&h?(this._intPt[0]=n,this._intPt[1]=r,i.COLLINEAR_INTERSECTION):a&&u?(this._intPt[0]=s,this._intPt[1]=n,s.equals(n)&&!l&&!h?i.POINT_INTERSECTION:i.COLLINEAR_INTERSECTION):a&&h?(this._intPt[0]=s,this._intPt[1]=r,s.equals(r)&&!l&&!u?i.POINT_INTERSECTION:i.COLLINEAR_INTERSECTION):l&&u?(this._intPt[0]=o,this._intPt[1]=n,o.equals(n)&&!a&&!h?i.POINT_INTERSECTION:i.COLLINEAR_INTERSECTION):l&&h?(this._intPt[0]=o,this._intPt[1]=r,o.equals(r)&&!a&&!u?i.POINT_INTERSECTION:i.COLLINEAR_INTERSECTION):i.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(n,r,s,o,a){var l=n.x<r.x?n.x:r.x,u=n.y<r.y?n.y:r.y,h=n.x>r.x?n.x:r.x,c=n.y>r.y?n.y:r.y,d=s.x<o.x?s.x:o.x,g=s.y<o.y?s.y:o.y,p=s.x>o.x?s.x:o.x,E=s.y>o.y?s.y:o.y,b=l>d?l:d,P=h<p?h:p,v=u>g?u:g,_=c<E?c:E,m=(b+P)/2,y=(v+_)/2;a.x=m,a.y=y,n.x-=a.x,n.y-=a.y,r.x-=a.x,r.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},t.prototype.computeIntersect=function(n,r,s,o){if(this._isProper=!1,!ht.intersects(n,r,s,o))return i.NO_INTERSECTION;var a=tt.orientationIndex(n,r,s),l=tt.orientationIndex(n,r,o);if(a>0&&l>0||a<0&&l<0)return i.NO_INTERSECTION;var u=tt.orientationIndex(s,o,n),h=tt.orientationIndex(s,o,r);if(u>0&&h>0||u<0&&h<0)return i.NO_INTERSECTION;var c=a===0&&l===0&&u===0&&h===0;return c?this.computeCollinearIntersection(n,r,s,o):(a===0||l===0||u===0||h===0?(this._isProper=!1,n.equals2D(s)||n.equals2D(o)?this._intPt[0]=n:r.equals2D(s)||r.equals2D(o)?this._intPt[0]=r:a===0?this._intPt[0]=new L(s):l===0?this._intPt[0]=new L(o):u===0?this._intPt[0]=new L(n):h===0&&(this._intPt[0]=new L(r))):(this._isProper=!0,this._intPt[0]=this.intersection(n,r,s,o)),i.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(n,r,s,o){var a=n,l=tt.distancePointLine(n,s,o),u=tt.distancePointLine(r,s,o);return u<l&&(l=u,a=r),u=tt.distancePointLine(s,n,r),u<l&&(l=u,a=s),u=tt.distancePointLine(o,n,r),u<l&&(l=u,a=o),a},t})(ge),Va=function(){};Va.prototype.interfaces_=function(){return[]},Va.prototype.getClass=function(){return Va},Va.orientationIndex=function(t,e,n){var r=e.x-t.x,s=e.y-t.y,o=n.x-e.x,a=n.y-e.y;return Va.signOfDet2x2(r,s,o,a)},Va.signOfDet2x2=function(t,e,n,r){var s=null,o=null,a=null;if(s=1,t===0||r===0)return e===0||n===0?0:e>0?n>0?-s:s:n>0?s:-s;if(e===0||n===0)return r>0?t>0?s:-s:t>0?-s:s;if(e>0?r>0?e<=r||(s=-s,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(s=-s,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(s=-s,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(s=-s,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0)if(n>0){if(!(t<=n))return s}else return s;else{if(n>0)return-s;if(t>=n)s=-s,t=-t,n=-n;else return-s}for(;;){if(a=Math.floor(n/t),n=n-a*t,r=r-a*e,r<0)return-s;if(r>e)return s;if(t>n+n){if(e<r+r)return s}else{if(e>r+r)return-s;n=t-n,r=e-r,s=-s}if(r===0)return n===0?0:-s;if(n===0||(a=Math.floor(t/n),t=t-a*n,e=e-a*r,e<0))return s;if(e>r)return-s;if(n>t+t){if(r<e+e)return-s}else{if(r>e+e)return s;t=n-t,e=r-e,s=-s}if(e===0)return t===0?0:s;if(t===0)return-s}};var pr=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};pr.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,r=e.x;return n>r&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var s=t.x-this._p.x,o=t.y-this._p.y,a=e.x-this._p.x,l=e.y-this._p.y,u=Va.signOfDet2x2(s,o,a,l);if(u===0)return this._isPointOnSegment=!0,null;l<o&&(u=-u),u>0&&this._crossingCount++}},pr.prototype.isPointInPolygon=function(){return this.getLocation()!==k.EXTERIOR},pr.prototype.getLocation=function(){return this._isPointOnSegment?k.BOUNDARY:this._crossingCount%2===1?k.INTERIOR:k.EXTERIOR},pr.prototype.isOnSegment=function(){return this._isPointOnSegment},pr.prototype.interfaces_=function(){return[]},pr.prototype.getClass=function(){return pr},pr.locatePointInRing=function(){if(arguments[0]instanceof L&&St(arguments[1],Gt)){for(var t=arguments[0],e=arguments[1],n=new pr(t),r=new L,s=new L,o=1;o<e.size();o++)if(e.getCoordinate(o,r),e.getCoordinate(o-1,s),n.countSegment(r,s),n.isOnSegment())return n.getLocation();return n.getLocation()}else if(arguments[0]instanceof L&&arguments[1]instanceof Array){for(var a=arguments[0],l=arguments[1],u=new pr(a),h=1;h<l.length;h++){var c=l[h],d=l[h-1];if(u.countSegment(c,d),u.isOnSegment())return u.getLocation()}return u.getLocation()}};var tt=function(){},za={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};tt.prototype.interfaces_=function(){return[]},tt.prototype.getClass=function(){return tt},tt.orientationIndex=function(t,e,n){return Oi.orientationIndex(t,e,n)},tt.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,r=1;r<t.length-1;r++){var s=t[r].x-n,o=t[r+1].y,a=t[r-1].y;e+=s*(a-o)}return e/2}else if(St(arguments[0],Gt)){var l=arguments[0],u=l.size();if(u<3)return 0;var h=new L,c=new L,d=new L;l.getCoordinate(0,c),l.getCoordinate(1,d);var g=c.x;d.x-=g;for(var p=0,E=1;E<u-1;E++)h.y=c.y,c.x=d.x,c.y=d.y,l.getCoordinate(E+1,d),d.x-=g,p+=c.x*(h.y-d.y);return p/2}},tt.distanceLineLine=function(t,e,n,r){if(t.equals(e))return tt.distancePointLine(t,n,r);if(n.equals(r))return tt.distancePointLine(r,t,e);var s=!1;if(!ht.intersects(t,e,n,r))s=!0;else{var o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(o===0)s=!0;else{var a=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),l=(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y),u=l/o,h=a/o;(h<0||h>1||u<0||u>1)&&(s=!0)}}return s?an.min(tt.distancePointLine(t,n,r),tt.distancePointLine(e,n,r),tt.distancePointLine(n,t,e),tt.distancePointLine(r,t,e)):0},tt.isPointInRing=function(t,e){return tt.locatePointInRing(t,e)!==k.EXTERIOR},tt.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new L;t.getCoordinate(0,r);for(var s=r.x,o=r.y,a=1;a<e;a++){t.getCoordinate(a,r);var l=r.x,u=r.y,h=l-s,c=u-o;n+=Math.sqrt(h*h+c*c),s=l,o=u}return n},tt.isCCW=function(t){var e=t.length-1;if(e<3)throw new de("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,s=1;s<=e;s++){var o=t[s];o.y>n.y&&(n=o,r=s)}var a=r;do a=a-1,a<0&&(a=e);while(t[a].equals2D(n)&&a!==r);var l=r;do l=(l+1)%e;while(t[l].equals2D(n)&&l!==r);var u=t[a],h=t[l];if(u.equals2D(n)||h.equals2D(n)||u.equals2D(h))return!1;var c=tt.computeOrientation(u,n,h),d=!1;return c===0?d=u.x>h.x:d=c>0,d},tt.locatePointInRing=function(t,e){return pr.locatePointInRing(t,e)},tt.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),s=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(s)*Math.sqrt(r)},tt.computeOrientation=function(t,e,n){return tt.orientationIndex(t,e,n)},tt.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new de("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var s=tt.distancePointLine(t,e[r],e[r+1]);s<n&&(n=s)}return n}else if(arguments.length===3){var o=arguments[0],a=arguments[1],l=arguments[2];if(a.x===l.x&&a.y===l.y)return o.distance(a);var u=(l.x-a.x)*(l.x-a.x)+(l.y-a.y)*(l.y-a.y),h=((o.x-a.x)*(l.x-a.x)+(o.y-a.y)*(l.y-a.y))/u;if(h<=0)return o.distance(a);if(h>=1)return o.distance(l);var c=((a.y-o.y)*(l.x-a.x)-(a.x-o.x)*(l.y-a.y))/u;return Math.abs(c)*Math.sqrt(u)}},tt.isOnLine=function(t,e){for(var n=new Ho,r=1;r<e.length;r++){var s=e[r-1],o=e[r];if(n.computeIntersection(t,s,o),n.hasIntersection())return!0}return!1},za.CLOCKWISE.get=function(){return-1},za.RIGHT.get=function(){return tt.CLOCKWISE},za.COUNTERCLOCKWISE.get=function(){return 1},za.LEFT.get=function(){return tt.COUNTERCLOCKWISE},za.COLLINEAR.get=function(){return 0},za.STRAIGHT.get=function(){return tt.COLLINEAR},Object.defineProperties(tt,za);var bs=function(){};bs.prototype.filter=function(t){},bs.prototype.interfaces_=function(){return[]},bs.prototype.getClass=function(){return bs};var _t=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},zr={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};_t.prototype.isGeometryCollection=function(){return this.getSortIndex()===_t.SORTINDEX_GEOMETRYCOLLECTION},_t.prototype.getFactory=function(){return this._factory},_t.prototype.getGeometryN=function(t){return this},_t.prototype.getArea=function(){return 0},_t.prototype.isRectangle=function(){return!1},_t.prototype.equals=function(){if(arguments[0]instanceof _t){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof _t))return!1;var n=e;return this.equalsExact(n)}},_t.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},_t.prototype.geometryChanged=function(){this.apply(_t.geometryChangedFilter)},_t.prototype.geometryChangedAction=function(){this._envelope=null},_t.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())},_t.prototype.getLength=function(){return 0},_t.prototype.getNumGeometries=function(){return 1},_t.prototype.compareTo=function(){if(arguments.length===1){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,r)}},_t.prototype.getUserData=function(){return this._userData},_t.prototype.getSRID=function(){return this._SRID},_t.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},_t.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===_t.SORTINDEX_GEOMETRYCOLLECTION)throw new de("This method does not support GeometryCollection arguments")},_t.prototype.equal=function(t,e,n){return n===0?t.equals(e):t.distance(e)<=n},_t.prototype.norm=function(){var t=this.copy();return t.normalize(),t},_t.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},_t.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new ht(this._envelope)},_t.prototype.setSRID=function(t){this._SRID=t},_t.prototype.setUserData=function(t){this._userData=t},_t.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var s=n.next(),o=r.next(),a=s.compareTo(o);if(a!==0)return a}return n.hasNext()?1:r.hasNext()?-1:0},_t.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},_t.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===_t.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===_t.SORTINDEX_MULTIPOINT||this.getSortIndex()===_t.SORTINDEX_MULTILINESTRING||this.getSortIndex()===_t.SORTINDEX_MULTIPOLYGON},_t.prototype.interfaces_=function(){return[Kd,bn,Cn]},_t.prototype.getClass=function(){return _t},_t.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},_t.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1},zr.serialVersionUID.get=function(){return 8763622679187377e3},zr.SORTINDEX_POINT.get=function(){return 0},zr.SORTINDEX_MULTIPOINT.get=function(){return 1},zr.SORTINDEX_LINESTRING.get=function(){return 2},zr.SORTINDEX_LINEARRING.get=function(){return 3},zr.SORTINDEX_MULTILINESTRING.get=function(){return 4},zr.SORTINDEX_POLYGON.get=function(){return 5},zr.SORTINDEX_MULTIPOLYGON.get=function(){return 6},zr.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},zr.geometryChangedFilter.get=function(){return Zp},Object.defineProperties(_t,zr);var Zp=function(){};Zp.interfaces_=function(){return[bs]},Zp.filter=function(t){t.geometryChangedAction()};var Br=function(){};Br.prototype.filter=function(t){},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br};var Pn=function(){},Cs={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Pn.prototype.isInBoundary=function(t){},Pn.prototype.interfaces_=function(){return[]},Pn.prototype.getClass=function(){return Pn},Cs.Mod2BoundaryNodeRule.get=function(){return ou},Cs.EndPointBoundaryNodeRule.get=function(){return au},Cs.MultiValentEndPointBoundaryNodeRule.get=function(){return lu},Cs.MonoValentEndPointBoundaryNodeRule.get=function(){return uu},Cs.MOD2_BOUNDARY_RULE.get=function(){return new ou},Cs.ENDPOINT_BOUNDARY_RULE.get=function(){return new au},Cs.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new lu},Cs.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new uu},Cs.OGC_SFS_BOUNDARY_RULE.get=function(){return Pn.MOD2_BOUNDARY_RULE},Object.defineProperties(Pn,Cs);var ou=function(){};ou.prototype.isInBoundary=function(t){return t%2===1},ou.prototype.interfaces_=function(){return[Pn]},ou.prototype.getClass=function(){return ou};var au=function(){};au.prototype.isInBoundary=function(t){return t>0},au.prototype.interfaces_=function(){return[Pn]},au.prototype.getClass=function(){return au};var lu=function(){};lu.prototype.isInBoundary=function(t){return t>1},lu.prototype.interfaces_=function(){return[Pn]},lu.prototype.getClass=function(){return lu};var uu=function(){};uu.prototype.isInBoundary=function(t){return t===1},uu.prototype.interfaces_=function(){return[Pn]},uu.prototype.getClass=function(){return uu};var De=function(){};De.prototype.add=function(){},De.prototype.addAll=function(){},De.prototype.isEmpty=function(){},De.prototype.iterator=function(){},De.prototype.size=function(){},De.prototype.toArray=function(){},De.prototype.remove=function(){};function Kp(i){this.message=i||""}Kp.prototype=new Error,Kp.prototype.name="IndexOutOfBoundsException";var hu=function(){};hu.prototype.hasNext=function(){},hu.prototype.next=function(){},hu.prototype.remove=function(){};var zn=(function(i){function t(){i.apply(this,arguments)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t})(De);function cu(i){this.message=i||""}cu.prototype=new Error,cu.prototype.name="NoSuchElementException";var J=(function(i){function t(){i.call(this),this.array_=[],arguments[0]instanceof De&&this.addAll(arguments[0])}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[i,De]},t.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(n){for(var r=this,s=n.iterator();s.hasNext();)r.add(s.next());return!0},t.prototype.set=function(n,r){var s=this.array_[n];return this.array_[n]=r,s},t.prototype.iterator=function(){return new AN(this)},t.prototype.get=function(n){if(n<0||n>=this.size())throw new Kp;return this.array_[n]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var n=this,r=[],s=0,o=this.array_.length;s<o;s++)r.push(n.array_[s]);return r},t.prototype.remove=function(n){for(var r=this,s=!1,o=0,a=this.array_.length;o<a;o++)if(r.array_[o]===n){r.array_.splice(o,1),s=!0;break}return s},t})(zn),AN=(function(i){function t(e){i.call(this),this.arrayList_=e,this.position_=0}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new cu;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(n){return this.arrayList_.set(this.position_-1,n)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t})(hu),hc=(function(i){function t(){if(i.call(this),arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.ensureCapacity(n.length),this.add(n,!0)}else if(arguments.length===2){var r=arguments[0],s=arguments[1];this.ensureCapacity(r.length),this.add(r,s)}}}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={coordArrayType:{configurable:!0}};return e.coordArrayType.get=function(){return new Array(0).fill(null)},t.prototype.getCoordinate=function(r){return this.get(r)},t.prototype.addAll=function(){var r=this;if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=!1,l=s.iterator();l.hasNext();)r.add(l.next(),o),a=!0;return a}else return i.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var r=this,s=i.prototype.clone.call(this),o=0;o<this.size();o++)s.add(o,r.get(o).copy());return s},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var r=this;if(arguments.length===1){var s=arguments[0];i.prototype.add.call(this,s)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1];return this.add(o,a,!0),!0}else if(arguments[0]instanceof L&&typeof arguments[1]=="boolean"){var l=arguments[0],u=arguments[1];if(!u&&this.size()>=1){var h=this.get(this.size()-1);if(h.equals2D(l))return null}i.prototype.add.call(this,l)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var c=arguments[0],d=arguments[1];return this.add(c,d),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var g=arguments[0],p=arguments[1],E=arguments[2];if(E)for(var b=0;b<g.length;b++)r.add(g[b],p);else for(var P=g.length-1;P>=0;P--)r.add(g[P],p);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof L){var v=arguments[0],_=arguments[1],m=arguments[2];if(!m){var y=this.size();if(y>0){if(v>0){var S=this.get(v-1);if(S.equals2D(_))return null}if(v<y){var C=this.get(v);if(C.equals2D(_))return null}}}i.prototype.add.call(this,v,_)}}else if(arguments.length===4){var x=arguments[0],I=arguments[1],M=arguments[2],T=arguments[3],R=1;M>T&&(R=-1);for(var A=M;A!==T;A+=R)r.add(x[A],I);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new L(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t})(J),Rt=function(){},ef={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};ef.ForwardComparator.get=function(){return cc},ef.BidirectionalComparator.get=function(){return du},ef.coordArrayType.get=function(){return new Array(0).fill(null)},Rt.prototype.interfaces_=function(){return[]},Rt.prototype.getClass=function(){return Rt},Rt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Rt.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(Rt.indexOf(r,e)<0)return r}return null},Rt.scroll=function(t,e){var n=Rt.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);ii.arraycopy(t,n,r,0,t.length-n),ii.arraycopy(t,0,r,t.length-n,n),ii.arraycopy(r,0,t,0,t.length)},Rt.equals=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2];if(r===s)return!0;if(r===null||s===null||r.length!==s.length)return!1;for(var a=0;a<r.length;a++)if(o.compare(r[a],s[a])!==0)return!1;return!0}},Rt.intersection=function(t,e){for(var n=new hc,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},Rt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Rt.removeRepeatedPoints=function(t){if(!Rt.hasRepeatedPoints(t))return t;var e=new hc(t,!1);return e.toCoordinateArray()},Rt.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var s=t[r];t[r]=t[e-r],t[e-r]=s}},Rt.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)t[n]!==null&&e++;var r=new Array(e).fill(null);if(e===0)return r;for(var s=0,o=0;o<t.length;o++)t[o]!==null&&(r[s++]=t[o]);return r},Rt.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new L(t[n]);return e}else if(arguments.length===5)for(var r=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],l=arguments[4],u=0;u<l;u++)o[a+u]=new L(r[s+u])},Rt.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],s=e[t.length-n-1];if(r.compareTo(s)!==0)return!1}return!0},Rt.envelope=function(t){for(var e=new ht,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Rt.toCoordinateArray=function(t){return t.toArray(Rt.coordArrayType)},Rt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Rt.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Rt.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,r=t[e].compareTo(t[n]);if(r!==0)return r}return 1},Rt.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t[n].compareTo(e[n]);if(r!==0)return r;n++}return n<e.length?-1:n<t.length?1:0},Rt.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(e===null||e.compareTo(t[n])>0)&&(e=t[n]);return e},Rt.extract=function(t,e,n){e=an.clamp(e,0,t.length),n=an.clamp(n,-1,t.length);var r=n-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var s=new Array(r).fill(null);if(r===0)return s;for(var o=0,a=e;a<=n;a++)s[o++]=t[a];return s},Object.defineProperties(Rt,ef);var cc=function(){};cc.prototype.compare=function(t,e){var n=t,r=e;return Rt.compare(n,r)},cc.prototype.interfaces_=function(){return[iu]},cc.prototype.getClass=function(){return cc};var du=function(){};du.prototype.compare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(n.length===0)return 0;var s=Rt.compare(n,r),o=Rt.isEqualReversed(n,r);return o?0:s},du.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(n.length===0)return 0;for(var s=Rt.increasingDirection(n),o=Rt.increasingDirection(r),a=s>0?0:n.length-1,l=o>0?0:n.length-1,u=0;u<n.length;u++){var h=n[a].compareTo(r[l]);if(h!==0)return h;a+=s,l+=o}return 0},du.prototype.interfaces_=function(){return[iu]},du.prototype.getClass=function(){return du};var Ba=function(){};Ba.prototype.get=function(){},Ba.prototype.put=function(){},Ba.prototype.size=function(){},Ba.prototype.values=function(){},Ba.prototype.entrySet=function(){};var LN=(function(i){function t(){i.apply(this,arguments)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t})(Ba);function dc(i){this.message=i||""}dc.prototype=new Error,dc.prototype.name="OperationNotSupported";function nf(){}nf.prototype=new De,nf.prototype.contains=function(){};var Qp=(function(i){function t(){i.call(this),this.array_=[],arguments[0]instanceof De&&this.addAll(arguments[0])}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.contains=function(n){for(var r=this,s=0,o=this.array_.length;s<o;s++){var a=r.array_[s];if(a===n)return!0}return!1},t.prototype.add=function(n){return this.contains(n)?!1:(this.array_.push(n),!0)},t.prototype.addAll=function(n){for(var r=this,s=n.iterator();s.hasNext();)r.add(s.next());return!0},t.prototype.remove=function(n){throw new Error},t.prototype.size=function(){return this.array_.length},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.toArray=function(){for(var n=this,r=[],s=0,o=this.array_.length;s<o;s++)r.push(n.array_[s]);return r},t.prototype.iterator=function(){return new FN(this)},t})(nf),FN=(function(i){function t(e){i.call(this),this.hashSet_=e,this.position_=0}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new cu;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new dc},t})(hu),Ps=0,Xo=1;function jw(i){return i===null?Ps:i.color}function ne(i){return i===null?null:i.parent}function xs(i,t){i!==null&&(i.color=t)}function tm(i){return i===null?null:i.left}function Vw(i){return i===null?null:i.right}function fi(){this.root_=null,this.size_=0}fi.prototype=new LN,fi.prototype.get=function(i){for(var t=this.root_;t!==null;){var e=i.compareTo(t.key);if(e<0)t=t.left;else if(e>0)t=t.right;else return t.value}return null},fi.prototype.put=function(i,t){if(this.root_===null)return this.root_={key:i,value:t,left:null,right:null,parent:null,color:Ps,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var e=this.root_,n,r;do if(n=e,r=i.compareTo(e.key),r<0)e=e.left;else if(r>0)e=e.right;else{var s=e.value;return e.value=t,s}while(e!==null);var o={key:i,left:null,right:null,value:t,parent:n,color:Ps,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=o:n.right=o,this.fixAfterInsertion(o),this.size_++,null},fi.prototype.fixAfterInsertion=function(i){var t=this;for(i.color=Xo;i!=null&&i!==this.root_&&i.parent.color===Xo;)if(ne(i)===tm(ne(ne(i)))){var e=Vw(ne(ne(i)));jw(e)===Xo?(xs(ne(i),Ps),xs(e,Ps),xs(ne(ne(i)),Xo),i=ne(ne(i))):(i===Vw(ne(i))&&(i=ne(i),t.rotateLeft(i)),xs(ne(i),Ps),xs(ne(ne(i)),Xo),t.rotateRight(ne(ne(i))))}else{var n=tm(ne(ne(i)));jw(n)===Xo?(xs(ne(i),Ps),xs(n,Ps),xs(ne(ne(i)),Xo),i=ne(ne(i))):(i===tm(ne(i))&&(i=ne(i),t.rotateRight(i)),xs(ne(i),Ps),xs(ne(ne(i)),Xo),t.rotateLeft(ne(ne(i))))}this.root_.color=Ps},fi.prototype.values=function(){var i=new J,t=this.getFirstEntry();if(t!==null)for(i.add(t.value);(t=fi.successor(t))!==null;)i.add(t.value);return i},fi.prototype.entrySet=function(){var i=new Qp,t=this.getFirstEntry();if(t!==null)for(i.add(t);(t=fi.successor(t))!==null;)i.add(t);return i},fi.prototype.rotateLeft=function(i){if(i!=null){var t=i.right;i.right=t.left,t.left!=null&&(t.left.parent=i),t.parent=i.parent,i.parent===null?this.root_=t:i.parent.left===i?i.parent.left=t:i.parent.right=t,t.left=i,i.parent=t}},fi.prototype.rotateRight=function(i){if(i!=null){var t=i.left;i.left=t.right,t.right!=null&&(t.right.parent=i),t.parent=i.parent,i.parent===null?this.root_=t:i.parent.right===i?i.parent.right=t:i.parent.left=t,t.right=i,i.parent=t}},fi.prototype.getFirstEntry=function(){var i=this.root_;if(i!=null)for(;i.left!=null;)i=i.left;return i},fi.successor=function(i){if(i===null)return null;if(i.right!==null){for(var t=i.right;t.left!==null;)t=t.left;return t}else{for(var e=i.parent,n=i;e!==null&&n===e.right;)n=e,e=e.parent;return e}},fi.prototype.size=function(){return this.size_};var fc=function(){};fc.prototype.interfaces_=function(){return[]},fc.prototype.getClass=function(){return fc};function zw(){}zw.prototype=new nf;function mr(){this.array_=[],arguments[0]instanceof De&&this.addAll(arguments[0])}mr.prototype=new zw,mr.prototype.contains=function(i){for(var t=this,e=0,n=this.array_.length;e<n;e++){var r=t.array_[e];if(r.compareTo(i)===0)return!0}return!1},mr.prototype.add=function(i){var t=this;if(this.contains(i))return!1;for(var e=0,n=this.array_.length;e<n;e++){var r=t.array_[e];if(r.compareTo(i)===1)return t.array_.splice(e,0,i),!0}return this.array_.push(i),!0},mr.prototype.addAll=function(i){for(var t=this,e=i.iterator();e.hasNext();)t.add(e.next());return!0},mr.prototype.remove=function(i){throw new dc},mr.prototype.size=function(){return this.array_.length},mr.prototype.isEmpty=function(){return this.array_.length===0},mr.prototype.toArray=function(){for(var i=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(i.array_[e]);return t},mr.prototype.iterator=function(){return new rf(this)};var rf=function(i){this.treeSet_=i,this.position_=0};rf.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new cu;return this.treeSet_.array_[this.position_++]},rf.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},rf.prototype.remove=function(){throw new dc};var $o=function(){};$o.sort=function(){var t=arguments[0],e,n,r,s;if(arguments.length===1)s=function(a,l){return a.compareTo(l)},t.sort(s);else if(arguments.length===2)r=arguments[1],s=function(a,l){return r.compare(a,l)},t.sort(s);else if(arguments.length===3){n=t.slice(arguments[1],arguments[2]),n.sort();var o=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length));for(t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])}else if(arguments.length===4)for(n=t.slice(arguments[1],arguments[2]),r=arguments[3],s=function(a,l){return r.compare(a,l)},n.sort(s),o=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])},$o.asList=function(t){for(var e=new J,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var Bt=function(){},Bn={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};Bn.P.get=function(){return 0},Bn.L.get=function(){return 1},Bn.A.get=function(){return 2},Bn.FALSE.get=function(){return-1},Bn.TRUE.get=function(){return-2},Bn.DONTCARE.get=function(){return-3},Bn.SYM_FALSE.get=function(){return"F"},Bn.SYM_TRUE.get=function(){return"T"},Bn.SYM_DONTCARE.get=function(){return"*"},Bn.SYM_P.get=function(){return"0"},Bn.SYM_L.get=function(){return"1"},Bn.SYM_A.get=function(){return"2"},Bt.prototype.interfaces_=function(){return[]},Bt.prototype.getClass=function(){return Bt},Bt.toDimensionSymbol=function(t){switch(t){case Bt.FALSE:return Bt.SYM_FALSE;case Bt.TRUE:return Bt.SYM_TRUE;case Bt.DONTCARE:return Bt.SYM_DONTCARE;case Bt.P:return Bt.SYM_P;case Bt.L:return Bt.SYM_L;case Bt.A:return Bt.SYM_A}throw new de("Unknown dimension value: "+t)},Bt.toDimensionValue=function(t){switch(lc.toUpperCase(t)){case Bt.SYM_FALSE:return Bt.FALSE;case Bt.SYM_TRUE:return Bt.TRUE;case Bt.SYM_DONTCARE:return Bt.DONTCARE;case Bt.SYM_P:return Bt.P;case Bt.SYM_L:return Bt.L;case Bt.SYM_A:return Bt.A}throw new de("Unknown dimension symbol: "+t)},Object.defineProperties(Bt,Bn);var vr=function(){};vr.prototype.filter=function(t){},vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr};var Un=function(){};Un.prototype.filter=function(t,e){},Un.prototype.isDone=function(){},Un.prototype.isGeometryChanged=function(){},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un};var wi=(function(i){function t(n,r){if(i.call(this,r),this._geometries=n||[],i.hasNullElements(this._geometries))throw new de("geometries must not contain null elements")}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){for(var r=this,s=new ht,o=0;o<this._geometries.length;o++)s.expandToInclude(r._geometries[o].getEnvelopeInternal());return s},t.prototype.getGeometryN=function(r){return this._geometries[r]},t.prototype.getSortIndex=function(){return i.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var r=this,s=new Array(this.getNumPoints()).fill(null),o=-1,a=0;a<this._geometries.length;a++)for(var l=r._geometries[a].getCoordinates(),u=0;u<l.length;u++)o++,s[o]=l[u];return s},t.prototype.getArea=function(){for(var r=this,s=0,o=0;o<this._geometries.length;o++)s+=r._geometries[o].getArea();return s},t.prototype.equalsExact=function(){var r=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;if(this._geometries.length!==a._geometries.length)return!1;for(var l=0;l<this._geometries.length;l++)if(!r._geometries[l].equalsExact(a._geometries[l],o))return!1;return!0}else return i.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var r=this,s=0;s<this._geometries.length;s++)r._geometries[s].normalize();$o.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var r=this,s=Bt.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,r._geometries[o].getBoundaryDimension());return s},t.prototype.getDimension=function(){for(var r=this,s=Bt.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,r._geometries[o].getDimension());return s},t.prototype.getLength=function(){for(var r=this,s=0,o=0;o<this._geometries.length;o++)s+=r._geometries[o].getLength();return s},t.prototype.getNumPoints=function(){for(var r=this,s=0,o=0;o<this._geometries.length;o++)s+=r._geometries[o].getNumPoints();return s},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var r=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=r._geometries[a].reverse();return this.getFactory().createGeometryCollection(o)},t.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){var s=arguments[0],o=new mr($o.asList(this._geometries)),a=new mr($o.asList(s._geometries));return this.compare(o,a)}else if(arguments.length===2){for(var l=arguments[0],u=arguments[1],h=l,c=this.getNumGeometries(),d=h.getNumGeometries(),g=0;g<c&&g<d;){var p=r.getGeometryN(g),E=h.getGeometryN(g),b=p.compareToSameClass(E,u);if(b!==0)return b;g++}return g<c?1:g<d?-1:0}},t.prototype.apply=function(){var r=this;if(St(arguments[0],Br))for(var s=arguments[0],o=0;o<this._geometries.length;o++)r._geometries[o].apply(s);else if(St(arguments[0],Un)){var a=arguments[0];if(this._geometries.length===0)return null;for(var l=0;l<this._geometries.length&&(r._geometries[l].apply(a),!a.isDone());l++);a.isGeometryChanged()&&this.geometryChanged()}else if(St(arguments[0],vr)){var u=arguments[0];u.filter(this);for(var h=0;h<this._geometries.length;h++)r._geometries[h].apply(u)}else if(St(arguments[0],bs)){var c=arguments[0];c.filter(this);for(var d=0;d<this._geometries.length;d++)r._geometries[d].apply(c)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),Tt.shouldNeverReachHere(),null},t.prototype.clone=function(){var r=this,s=i.prototype.clone.call(this);s._geometries=new Array(this._geometries.length).fill(null);for(var o=0;o<this._geometries.length;o++)s._geometries[o]=r._geometries[o].clone();return s},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var r=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=r._geometries[o].copy();return new t(s,this._factory)},t.prototype.isEmpty=function(){for(var r=this,s=0;s<this._geometries.length;s++)if(!r._geometries[s].isEmpty())return!1;return!0},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(t,e),t})(_t),Yo=(function(i){function t(){i.apply(this,arguments)}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return _t.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?i.prototype.equalsExact.call(this,r,s):!1}else return i.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Bt.FALSE:0},t.prototype.isClosed=function(){var r=this;if(this.isEmpty())return!1;for(var s=0;s<this._geometries.length;s++)if(!r._geometries[s].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var r=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[s-1-a]=r._geometries[a].reverse();return this.getFactory().createMultiLineString(o)},t.prototype.getBoundary=function(){return new xn(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var r=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=r._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[fc]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t})(wi),xn=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=Pn.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=r}};xn.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return e.length===1?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},xn.prototype.getBoundary=function(){return this._geom instanceof ve?this.boundaryLineString(this._geom):this._geom instanceof Yo?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},xn.prototype.boundaryLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var e=this._bnRule.isInBoundary(2);return e?t.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},xn.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},xn.prototype.computeBoundaryCoordinates=function(t){var e=this,n=new J;this._endpointMap=new fi;for(var r=0;r<t.getNumGeometries();r++){var s=t.getGeometryN(r);s.getNumPoints()!==0&&(e.addEndpoint(s.getCoordinateN(0)),e.addEndpoint(s.getCoordinateN(s.getNumPoints()-1)))}for(var o=this._endpointMap.entrySet().iterator();o.hasNext();){var a=o.next(),l=a.getValue(),u=l.count;e._bnRule.isInBoundary(u)&&n.add(a.getKey())}return Rt.toCoordinateArray(n)},xn.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new sf,this._endpointMap.put(t,e)),e.count++},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn},xn.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new xn(t);return e.getBoundary()}else if(arguments.length===2){var n=arguments[0],r=arguments[1],s=new xn(n,r);return s.getBoundary()}};var sf=function(){this.count=null};sf.prototype.interfaces_=function(){return[]},sf.prototype.getClass=function(){return sf};function kN(){}function GN(){}var jN=function(){};function VN(){}function zN(){}function BN(){}var In=function(){},em={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};In.prototype.interfaces_=function(){return[]},In.prototype.getClass=function(){return In},In.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},In.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new VN,n=new kN;return t.printStackTrace(n),e.toString()}else if(arguments.length===2){var r=arguments[0],s=arguments[1],o="";new GN(In.getStackTrace(r));for(var a=new BN,l=0;l<s;l++)try{o+=a.readLine()+In.NEWLINE}catch(u){if(u instanceof zN)Tt.shouldNeverReachHere();else throw u}finally{}return o}},In.split=function(t,e){for(var n=e.length,r=new J,s=""+t,o=s.indexOf(e);o>=0;){var a=s.substring(0,o);r.add(a),s=s.substring(o+n),o=s.indexOf(e)}s.length>0&&r.add(s);for(var l=new Array(r.size()).fill(null),u=0;u<l.length;u++)l[u]=r.get(u);return l},In.toString=function(){if(arguments.length===1){var t=arguments[0];return In.SIMPLE_ORDINATE_FORMAT.format(t)}},In.spaces=function(t){return In.chars(" ",t)},em.NEWLINE.get=function(){return ii.getProperty("line.separator")},em.SIMPLE_ORDINATE_FORMAT.get=function(){return new jN},Object.defineProperties(In,em);var Ee=function(){};Ee.prototype.interfaces_=function(){return[]},Ee.prototype.getClass=function(){return Ee},Ee.copyCoord=function(t,e,n,r){for(var s=Math.min(t.getDimension(),n.getDimension()),o=0;o<s;o++)n.setOrdinate(r,o,t.getOrdinate(e,o))},Ee.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,Gt.X)===t.getOrdinate(e-1,Gt.X)&&t.getOrdinate(0,Gt.Y)===t.getOrdinate(e-1,Gt.Y)},Ee.isEqual=function(t,e){var n=t.size(),r=e.size();if(n!==r)return!1;for(var s=Math.min(t.getDimension(),e.getDimension()),o=0;o<n;o++)for(var a=0;a<s;a++){var l=t.getOrdinate(o,a),u=e.getOrdinate(o,a);if(t.getOrdinate(o,a)!==e.getOrdinate(o,a)&&!(Pt.isNaN(l)&&Pt.isNaN(u)))return!1}return!0},Ee.extend=function(t,e,n){var r=t.create(n,e.getDimension()),s=e.size();if(Ee.copy(e,0,r,0,s),s>0)for(var o=s;o<n;o++)Ee.copy(e,s-1,r,o,1);return r},Ee.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Ee.swap(t,r,e-r)},Ee.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var s=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,s)}},Ee.copy=function(t,e,n,r,s){for(var o=0;o<s;o++)Ee.copyCoord(t,e+o,n,r+o)},Ee.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var n=t.getDimension(),r=new dr;r.append("(");for(var s=0;s<e;s++){s>0&&r.append(" ");for(var o=0;o<n;o++)o>0&&r.append(","),r.append(In.toString(t.getOrdinate(s,o)))}return r.append(")"),r.toString()}},Ee.ensureValidRing=function(t,e){var n=e.size();if(n===0)return e;if(n<=3)return Ee.createClosedRing(t,e,4);var r=e.getOrdinate(0,Gt.X)===e.getOrdinate(n-1,Gt.X)&&e.getOrdinate(0,Gt.Y)===e.getOrdinate(n-1,Gt.Y);return r?e:Ee.createClosedRing(t,e,n+1)},Ee.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),s=e.size();Ee.copy(e,0,r,0,s);for(var o=s;o<n;o++)Ee.copy(e,0,r,o,1);return r};var ve=(function(i){function t(n,r){i.call(this,r),this._points=null,this.init(n)}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new ht:this._points.expandEnvelope(new ht)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return i.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){var r=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;if(this._points.size()!==a._points.size())return!1;for(var l=0;l<this._points.size();l++)if(!r.equal(r._points.getCoordinate(l),a._points.getCoordinate(l),o))return!1;return!0}else return i.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var r=this,s=0;s<Math.trunc(this._points.size()/2);s++){var o=r._points.size()-1-s;if(!r._points.getCoordinate(s).equals(r._points.getCoordinate(o)))return r._points.getCoordinate(s).compareTo(r._points.getCoordinate(o))>0&&Ee.reverse(r._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Bt.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return tt.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var r=this._points.copy();Ee.reverse(r);var s=this.getFactory().createLineString(r);return s},t.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){for(var s=arguments[0],o=s,a=0,l=0;a<this._points.size()&&l<o._points.size();){var u=r._points.getCoordinate(a).compareTo(o._points.getCoordinate(l));if(u!==0)return u;a++,l++}return a<this._points.size()?1:l<o._points.size()?-1:0}else if(arguments.length===2){var h=arguments[0],c=arguments[1],d=h;return c.compare(this._points,d._points)}},t.prototype.apply=function(){var r=this;if(St(arguments[0],Br))for(var s=arguments[0],o=0;o<this._points.size();o++)s.filter(r._points.getCoordinate(o));else if(St(arguments[0],Un)){var a=arguments[0];if(this._points.size()===0)return null;for(var l=0;l<this._points.size()&&(a.filter(r._points,l),!a.isDone());l++);a.isGeometryChanged()&&this.geometryChanged()}else if(St(arguments[0],vr)){var u=arguments[0];u.filter(this)}else if(St(arguments[0],bs)){var h=arguments[0];h.filter(this)}},t.prototype.getBoundary=function(){return new xn(this).getBoundary()},t.prototype.isEquivalentClass=function(r){return r instanceof t},t.prototype.clone=function(){var r=i.prototype.clone.call(this);return r._points=this._points.clone(),r},t.prototype.getCoordinateN=function(r){return this._points.getCoordinate(r)},t.prototype.getGeometryType=function(){return"LineString"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._points},t.prototype.isEmpty=function(){return this._points.size()===0},t.prototype.init=function(r){if(r===null&&(r=this.getFactory().getCoordinateSequenceFactory().create([])),r.size()===1)throw new de("Invalid number of points in LineString (found "+r.size()+" - must be 0 or >= 2)");this._points=r},t.prototype.isCoordinate=function(r){for(var s=this,o=0;o<this._points.size();o++)if(s._points.getCoordinate(o).equals(r))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(r){return this.getFactory().createPoint(this._points.getCoordinate(r))},t.prototype.interfaces_=function(){return[fc]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t})(_t),gc=function(){};gc.prototype.interfaces_=function(){return[]},gc.prototype.getClass=function(){return gc};var qi=(function(i){function t(n,r){i.call(this,r),this._coordinates=n||null,this.init(this._coordinates)}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new ht;var r=new ht;return r.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),r},t.prototype.getSortIndex=function(){return i.SORTINDEX_POINT},t.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?this.isEmpty()&&r.isEmpty()?!0:this.isEmpty()!==r.isEmpty()?!1:this.equal(r.getCoordinate(),this.getCoordinate(),s):!1}else return i.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){},t.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},t.prototype.getBoundaryDimension=function(){return Bt.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getNumPoints=function(){return this.isEmpty()?0:1},t.prototype.reverse=function(){return this.copy()},t.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},t.prototype.compareToSameClass=function(){if(arguments.length===1){var r=arguments[0],s=r;return this.getCoordinate().compareTo(s.getCoordinate())}else if(arguments.length===2){var o=arguments[0],a=arguments[1],l=o;return a.compare(this._coordinates,l._coordinates)}},t.prototype.apply=function(){if(St(arguments[0],Br)){var r=arguments[0];if(this.isEmpty())return null;r.filter(this.getCoordinate())}else if(St(arguments[0],Un)){var s=arguments[0];if(this.isEmpty())return null;s.filter(this._coordinates,0),s.isGeometryChanged()&&this.geometryChanged()}else if(St(arguments[0],vr)){var o=arguments[0];o.filter(this)}else if(St(arguments[0],bs)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var r=i.prototype.clone.call(this);return r._coordinates=this._coordinates.clone(),r},t.prototype.getGeometryType=function(){return"Point"},t.prototype.copy=function(){return new t(this._coordinates.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._coordinates},t.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},t.prototype.isEmpty=function(){return this._coordinates.size()===0},t.prototype.init=function(r){r===null&&(r=this.getFactory().getCoordinateSequenceFactory().create([])),Tt.isTrue(r.size()<=1),this._coordinates=r},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[gc]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t})(_t),ao=function(){};ao.prototype.interfaces_=function(){return[]},ao.prototype.getClass=function(){return ao};var Re=(function(i){function t(n,r,s){if(i.call(this,s),this._shell=null,this._holes=null,n===null&&(n=this.getFactory().createLinearRing()),r===null&&(r=[]),i.hasNullElements(r))throw new de("holes must not contain null elements");if(n.isEmpty()&&i.hasNonEmptyElements(r))throw new de("shell is empty but holes are not");this._shell=n,this._holes=r}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return i.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var r=this;if(this.isEmpty())return[];for(var s=new Array(this.getNumPoints()).fill(null),o=-1,a=this._shell.getCoordinates(),l=0;l<a.length;l++)o++,s[o]=a[l];for(var u=0;u<this._holes.length;u++)for(var h=r._holes[u].getCoordinates(),c=0;c<h.length;c++)o++,s[o]=h[c];return s},t.prototype.getArea=function(){var r=this,s=0;s+=Math.abs(tt.signedArea(this._shell.getCoordinateSequence()));for(var o=0;o<this._holes.length;o++)s-=Math.abs(tt.signedArea(r._holes[o].getCoordinateSequence()));return s},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var r=this._shell.getCoordinateSequence(),s=this.getEnvelopeInternal(),o=0;o<5;o++){var a=r.getX(o);if(!(a===s.getMinX()||a===s.getMaxX()))return!1;var l=r.getY(o);if(!(l===s.getMinY()||l===s.getMaxY()))return!1}for(var u=r.getX(0),h=r.getY(0),c=1;c<=4;c++){var d=r.getX(c),g=r.getY(c),p=d!==u,E=g!==h;if(p===E)return!1;u=d,h=g}return!0},t.prototype.equalsExact=function(){var r=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s,l=this._shell,u=a._shell;if(!l.equalsExact(u,o)||this._holes.length!==a._holes.length)return!1;for(var h=0;h<this._holes.length;h++)if(!r._holes[h].equalsExact(a._holes[h],o))return!1;return!0}else return i.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var r=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var s=0;s<this._holes.length;s++)r.normalize(r._holes[s],!1);$o.sort(this._holes)}else if(arguments.length===2){var o=arguments[0],a=arguments[1];if(o.isEmpty())return null;var l=new Array(o.getCoordinates().length-1).fill(null);ii.arraycopy(o.getCoordinates(),0,l,0,l.length);var u=Rt.minCoordinate(o.getCoordinates());Rt.scroll(l,u),ii.arraycopy(l,0,o.getCoordinates(),0,l.length),o.getCoordinates()[l.length]=l[0],tt.isCCW(o.getCoordinates())===a&&Rt.reverse(o.getCoordinates())}},t.prototype.getCoordinate=function(){return this._shell.getCoordinate()},t.prototype.getNumInteriorRing=function(){return this._holes.length},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.getLength=function(){var r=this,s=0;s+=this._shell.getLength();for(var o=0;o<this._holes.length;o++)s+=r._holes[o].getLength();return s},t.prototype.getNumPoints=function(){for(var r=this,s=this._shell.getNumPoints(),o=0;o<this._holes.length;o++)s+=r._holes[o].getNumPoints();return s},t.prototype.reverse=function(){var r=this,s=this.copy();s._shell=this._shell.copy().reverse(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=r._holes[o].copy().reverse();return s},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){var s=arguments[0],o=this._shell,a=s._shell;return o.compareToSameClass(a)}else if(arguments.length===2){var l=arguments[0],u=arguments[1],h=l,c=this._shell,d=h._shell,g=c.compareToSameClass(d,u);if(g!==0)return g;for(var p=this.getNumInteriorRing(),E=h.getNumInteriorRing(),b=0;b<p&&b<E;){var P=r.getInteriorRingN(b),v=h.getInteriorRingN(b),_=P.compareToSameClass(v,u);if(_!==0)return _;b++}return b<p?1:b<E?-1:0}},t.prototype.apply=function(r){var s=this;if(St(r,Br)){this._shell.apply(r);for(var o=0;o<this._holes.length;o++)s._holes[o].apply(r)}else if(St(r,Un)){if(this._shell.apply(r),!r.isDone())for(var a=0;a<this._holes.length&&(s._holes[a].apply(r),!r.isDone());a++);r.isGeometryChanged()&&this.geometryChanged()}else if(St(r,vr))r.filter(this);else if(St(r,bs)){r.filter(this),this._shell.apply(r);for(var l=0;l<this._holes.length;l++)s._holes[l].apply(r)}},t.prototype.getBoundary=function(){var r=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var s=new Array(this._holes.length+1).fill(null);s[0]=this._shell;for(var o=0;o<this._holes.length;o++)s[o+1]=r._holes[o];return s.length<=1?this.getFactory().createLinearRing(s[0].getCoordinateSequence()):this.getFactory().createMultiLineString(s)},t.prototype.clone=function(){var r=this,s=i.prototype.clone.call(this);s._shell=this._shell.clone(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=r._holes[o].clone();return s},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var r=this,s=this._shell.copy(),o=new Array(this._holes.length).fill(null),a=0;a<o.length;a++)o[a]=r._holes[a].copy();return new t(s,o,this._factory)},t.prototype.getExteriorRing=function(){return this._shell},t.prototype.isEmpty=function(){return this._shell.isEmpty()},t.prototype.getInteriorRingN=function(r){return this._holes[r]},t.prototype.interfaces_=function(){return[ao]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t})(_t),fu=(function(i){function t(){i.apply(this,arguments)}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return _t.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?i.prototype.equalsExact.call(this,r,s):!1}else return i.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var r=arguments[0];return this._geometries[r].getCoordinate()}else return i.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return Bt.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.getGeometryType=function(){return"MultiPoint"},t.prototype.copy=function(){for(var r=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=r._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[gc]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t})(wi),Ur=(function(i){function t(n,r){n instanceof L&&r instanceof At&&(n=r.getCoordinateSequenceFactory().create(n)),i.call(this,n,r),this.validateConstruction()}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return _t.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return Bt.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:i.prototype.isClosed.call(this)},t.prototype.reverse=function(){var r=this._points.copy();Ee.reverse(r);var s=this.getFactory().createLinearRing(r);return s},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!i.prototype.isClosed.call(this))throw new de("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new de("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.MINIMUM_VALID_SIZE.get=function(){return 4},e.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,e),t})(ve),qr=(function(i){function t(){i.apply(this,arguments)}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return _t.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?i.prototype.equalsExact.call(this,r,s):!1}else return i.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var r=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=r._geometries[a].reverse();return this.getFactory().createMultiPolygon(o)},t.prototype.getBoundary=function(){var r=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var s=new J,o=0;o<this._geometries.length;o++)for(var a=r._geometries[o],l=a.getBoundary(),u=0;u<l.getNumGeometries();u++)s.add(l.getGeometryN(u));var h=new Array(s.size()).fill(null);return this.getFactory().createMultiLineString(s.toArray(h))},t.prototype.getGeometryType=function(){return"MultiPolygon"},t.prototype.copy=function(){for(var r=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=r._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[ao]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t})(wi),Mn=function(t){this._factory=t||null,this._isUserDataCopied=!1},of={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Mn.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},Mn.prototype.edit=function(t,e){if(t===null)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},Mn.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof wi?this.editGeometryCollection(t,e):t instanceof Re?this.editPolygon(t,e):t instanceof qi?e.edit(t,this._factory):t instanceof ve?e.edit(t,this._factory):(Tt.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},Mn.prototype.editGeometryCollection=function(t,e){for(var n=this,r=e.edit(t,this._factory),s=new J,o=0;o<r.getNumGeometries();o++){var a=n.edit(r.getGeometryN(o),e);a===null||a.isEmpty()||s.add(a)}return r.getClass()===fu?this._factory.createMultiPoint(s.toArray([])):r.getClass()===Yo?this._factory.createMultiLineString(s.toArray([])):r.getClass()===qr?this._factory.createMultiPolygon(s.toArray([])):this._factory.createGeometryCollection(s.toArray([]))},Mn.prototype.editPolygon=function(t,e){var n=this,r=e.edit(t,this._factory);if(r===null&&(r=this._factory.createPolygon(null)),r.isEmpty())return r;var s=this.edit(r.getExteriorRing(),e);if(s===null||s.isEmpty())return this._factory.createPolygon();for(var o=new J,a=0;a<r.getNumInteriorRing();a++){var l=n.edit(r.getInteriorRingN(a),e);l===null||l.isEmpty()||o.add(l)}return this._factory.createPolygon(s,o.toArray([]))},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},Mn.GeometryEditorOperation=function(){},of.NoOpGeometryOperation.get=function(){return pc},of.CoordinateOperation.get=function(){return mc},of.CoordinateSequenceOperation.get=function(){return vc},Object.defineProperties(Mn,of);var pc=function(){};pc.prototype.edit=function(t,e){return t},pc.prototype.interfaces_=function(){return[Mn.GeometryEditorOperation]},pc.prototype.getClass=function(){return pc};var mc=function(){};mc.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return n===null?t:t instanceof Ur?e.createLinearRing(n):t instanceof ve?e.createLineString(n):t instanceof qi?n.length>0?e.createPoint(n[0]):e.createPoint():t},mc.prototype.interfaces_=function(){return[Mn.GeometryEditorOperation]},mc.prototype.getClass=function(){return mc};var vc=function(){};vc.prototype.edit=function(t,e){return t instanceof Ur?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof ve?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof qi?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},vc.prototype.interfaces_=function(){return[Mn.GeometryEditorOperation]},vc.prototype.getClass=function(){return vc};var Se=function(){var t=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var n=0;n<e;n++)t._coordinates[n]=new L}else if(St(arguments[0],Gt)){var r=arguments[0];if(r===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=r.getDimension(),this._coordinates=new Array(r.size()).fill(null);for(var s=0;s<this._coordinates.length;s++)t._coordinates[s]=r.getCoordinateCopy(s)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var o=arguments[0],a=arguments[1];this._coordinates=o,this._dimension=a,o===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var l=arguments[0],u=arguments[1];this._coordinates=new Array(l).fill(null),this._dimension=u;for(var h=0;h<l;h++)t._coordinates[h]=new L}}},Bw={serialVersionUID:{configurable:!0}};Se.prototype.setOrdinate=function(t,e,n){switch(e){case Gt.X:this._coordinates[t].x=n;break;case Gt.Y:this._coordinates[t].y=n;break;case Gt.Z:this._coordinates[t].z=n;break;default:throw new de("invalid ordinateIndex")}},Se.prototype.size=function(){return this._coordinates.length},Se.prototype.getOrdinate=function(t,e){switch(e){case Gt.X:return this._coordinates[t].x;case Gt.Y:return this._coordinates[t].y;case Gt.Z:return this._coordinates[t].z}return Pt.NaN},Se.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},Se.prototype.getCoordinateCopy=function(t){return new L(this._coordinates[t])},Se.prototype.getDimension=function(){return this._dimension},Se.prototype.getX=function(t){return this._coordinates[t].x},Se.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].clone();return new Se(e,this._dimension)},Se.prototype.expandEnvelope=function(t){for(var e=this,n=0;n<this._coordinates.length;n++)t.expandToInclude(e._coordinates[n]);return t},Se.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].copy();return new Se(e,this._dimension)},Se.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new dr(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var n=1;n<this._coordinates.length;n++)e.append(", "),e.append(t._coordinates[n]);return e.append(")"),e.toString()}else return"()"},Se.prototype.getY=function(t){return this._coordinates[t].y},Se.prototype.toCoordinateArray=function(){return this._coordinates},Se.prototype.interfaces_=function(){return[Gt,Cn]},Se.prototype.getClass=function(){return Se},Bw.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(Se,Bw);var Wr=function(){},im={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Wr.prototype.readResolve=function(){return Wr.instance()},Wr.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new Se(t)}else if(St(arguments[0],Gt)){var e=arguments[0];return new Se(e)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return r>3&&(r=3),r<2?new Se(n):new Se(n,r)}},Wr.prototype.interfaces_=function(){return[nu,Cn]},Wr.prototype.getClass=function(){return Wr},Wr.instance=function(){return Wr.instanceObject},im.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},im.instanceObject.get=function(){return new Wr},Object.defineProperties(Wr,im);var Uw=(function(i){function t(){i.call(this),this.map_=new Map}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.get=function(n){return this.map_.get(n)||null},t.prototype.put=function(n,r){return this.map_.set(n,r),r},t.prototype.values=function(){for(var n=new J,r=this.map_.values(),s=r.next();!s.done;)n.add(s.value),s=r.next();return n},t.prototype.entrySet=function(){var n=new Qp;return this.map_.entries().forEach(function(r){return n.add(r)}),n},t.prototype.size=function(){return this.map_.size()},t})(Ba),Ut=function i(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=i.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof yr){var t=arguments[0];this._modelType=t,t===i.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var e=arguments[0];this._modelType=i.FIXED,this.setScale(e)}else if(arguments[0]instanceof i){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}},nm={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Ut.prototype.equals=function(t){if(!(t instanceof Ut))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},Ut.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new fr(n).compareTo(new fr(r))},Ut.prototype.getScale=function(){return this._scale},Ut.prototype.isFloating=function(){return this._modelType===Ut.FLOATING||this._modelType===Ut.FLOATING_SINGLE},Ut.prototype.getType=function(){return this._modelType},Ut.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Ut.FLOATING?t="Floating":this._modelType===Ut.FLOATING_SINGLE?t="Floating-Single":this._modelType===Ut.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},Ut.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(Pt.isNaN(t))return t;if(this._modelType===Ut.FLOATING_SINGLE){var e=t;return e}return this._modelType===Ut.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof L){var n=arguments[0];if(this._modelType===Ut.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}},Ut.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Ut.FLOATING?t=16:this._modelType===Ut.FLOATING_SINGLE?t=6:this._modelType===Ut.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},Ut.prototype.setScale=function(t){this._scale=Math.abs(t)},Ut.prototype.interfaces_=function(){return[Cn,bn]},Ut.prototype.getClass=function(){return Ut},Ut.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},nm.serialVersionUID.get=function(){return 7777263578777804e3},nm.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Ut,nm);var yr=function i(t){this._name=t||null,i.nameToTypeMap.put(t,this)},rm={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};yr.prototype.readResolve=function(){return yr.nameToTypeMap.get(this._name)},yr.prototype.toString=function(){return this._name},yr.prototype.interfaces_=function(){return[Cn]},yr.prototype.getClass=function(){return yr},rm.serialVersionUID.get=function(){return-552860263173159e4},rm.nameToTypeMap.get=function(){return new Uw},Object.defineProperties(yr,rm),Ut.Type=yr,Ut.FIXED=new yr("FIXED"),Ut.FLOATING=new yr("FLOATING"),Ut.FLOATING_SINGLE=new yr("FLOATING SINGLE");var At=function i(){this._precisionModel=new Ut,this._SRID=0,this._coordinateSequenceFactory=i.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?St(arguments[0],nu)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Ut&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},qw={serialVersionUID:{configurable:!0}};At.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new L(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new L(t.getMinX(),t.getMinY()),new L(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new L(t.getMinX(),t.getMinY()),new L(t.getMinX(),t.getMaxY()),new L(t.getMaxX(),t.getMaxY()),new L(t.getMaxX(),t.getMinY()),new L(t.getMinX(),t.getMinY())]),null)},At.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new ve(this.getCoordinateSequenceFactory().create(t),this);if(St(t,Gt))return new ve(t,this)}else return new ve(this.getCoordinateSequenceFactory().create([]),this)},At.prototype.createMultiLineString=function(){if(arguments.length===0)return new Yo(null,this);if(arguments.length===1){var t=arguments[0];return new Yo(t,this)}},At.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,s=t.iterator();s.hasNext();){var o=s.next(),a=o.getClass();e===null&&(e=a),a!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(e===null)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(At.toGeometryArray(t));var l=t.iterator().next(),u=t.size()>1;if(u){if(l instanceof Re)return this.createMultiPolygon(At.toPolygonArray(t));if(l instanceof ve)return this.createMultiLineString(At.toLineStringArray(t));if(l instanceof qi)return this.createMultiPoint(At.toPointArray(t));Tt.shouldNeverReachHere("Unhandled class: "+l.getClass().getName())}return l},At.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},At.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(St(arguments[0],Gt)){var e=arguments[0];return new qi(e,this)}}},At.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},At.prototype.createPolygon=function(){if(arguments.length===0)return new Re(null,null,this);if(arguments.length===1){if(St(arguments[0],Gt)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Ur){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var r=arguments[0],s=arguments[1];return new Re(r,s,this)}},At.prototype.getSRID=function(){return this._SRID},At.prototype.createGeometryCollection=function(){if(arguments.length===0)return new wi(null,this);if(arguments.length===1){var t=arguments[0];return new wi(t,this)}},At.prototype.createGeometry=function(t){var e=new Mn(this);return e.edit(t,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})},At.prototype.getPrecisionModel=function(){return this._precisionModel},At.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}else if(St(arguments[0],Gt)){var e=arguments[0];return new Ur(e,this)}}},At.prototype.createMultiPolygon=function(){if(arguments.length===0)return new qr(null,this);if(arguments.length===1){var t=arguments[0];return new qr(t,this)}},At.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new fu(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new fu(e,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(St(arguments[0],Gt)){var r=arguments[0];if(r===null)return this.createMultiPoint(new Array(0).fill(null));for(var s=new Array(r.size()).fill(null),o=0;o<r.size();o++){var a=t.getCoordinateSequenceFactory().create(1,r.getDimension());Ee.copy(r,o,a,0,1),s[o]=t.createPoint(a)}return this.createMultiPoint(s)}}},At.prototype.interfaces_=function(){return[Cn]},At.prototype.getClass=function(){return At},At.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},At.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},At.getDefaultCoordinateSequenceFactory=function(){return Wr.instance()},At.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},At.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},At.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},At.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},At.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},At.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},At.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},qw.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(At,qw);var UN=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],af=function(t){this.geometryFactory=t||new At};af.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var n=e.type;if(!_r[n])throw new Error("Unknown GeoJSON type: "+e.type);return UN.indexOf(n)!==-1?_r[n].apply(this,[e.coordinates]):n==="GeometryCollection"?_r[n].apply(this,[e.geometries]):_r[n].apply(this,[e])},af.prototype.write=function(t){var e=t.getGeometryType();if(!Is[e])throw new Error("Geometry is not supported");return Is[e].apply(this,[t])};var _r={Feature:function(i){var t={};for(var e in i)t[e]=i[e];if(i.geometry){var n=i.geometry.type;if(!_r[n])throw new Error("Unknown GeoJSON type: "+i.type);t.geometry=this.read(i.geometry)}return i.bbox&&(t.bbox=_r.bbox.apply(this,[i.bbox])),t},FeatureCollection:function(i){var t=this,e={};if(i.features){e.features=[];for(var n=0;n<i.features.length;++n)e.features.push(t.read(i.features[n]))}return i.bbox&&(e.bbox=this.parse.bbox.apply(this,[i.bbox])),e},coordinates:function(i){for(var t=[],e=0;e<i.length;++e){var n=i[e];t.push(new L(n[0],n[1]))}return t},bbox:function(i){return this.geometryFactory.createLinearRing([new L(i[0],i[1]),new L(i[2],i[1]),new L(i[2],i[3]),new L(i[0],i[3]),new L(i[0],i[1])])},Point:function(i){var t=new L(i[0],i[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(i){for(var t=this,e=[],n=0;n<i.length;++n)e.push(_r.Point.apply(t,[i[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(i){var t=_r.coordinates.apply(this,[i]);return this.geometryFactory.createLineString(t)},MultiLineString:function(i){for(var t=this,e=[],n=0;n<i.length;++n)e.push(_r.LineString.apply(t,[i[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(i){for(var t=this,e=_r.coordinates.apply(this,[i[0]]),n=this.geometryFactory.createLinearRing(e),r=[],s=1;s<i.length;++s){var o=i[s],a=_r.coordinates.apply(t,[o]),l=t.geometryFactory.createLinearRing(a);r.push(l)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(i){for(var t=this,e=[],n=0;n<i.length;++n){var r=i[n];e.push(_r.Polygon.apply(t,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(i){for(var t=this,e=[],n=0;n<i.length;++n){var r=i[n];e.push(t.read(r))}return this.geometryFactory.createGeometryCollection(e)}},Is={coordinate:function(i){return[i.x,i.y]},Point:function(i){var t=Is.coordinate.apply(this,[i.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(i){for(var t=this,e=[],n=0;n<i._geometries.length;++n){var r=i._geometries[n],s=Is.Point.apply(t,[r]);e.push(s.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(i){for(var t=this,e=[],n=i.getCoordinates(),r=0;r<n.length;++r){var s=n[r];e.push(Is.coordinate.apply(t,[s]))}return{type:"LineString",coordinates:e}},MultiLineString:function(i){for(var t=this,e=[],n=0;n<i._geometries.length;++n){var r=i._geometries[n],s=Is.LineString.apply(t,[r]);e.push(s.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(i){var t=this,e=[],n=Is.LineString.apply(this,[i._shell]);e.push(n.coordinates);for(var r=0;r<i._holes.length;++r){var s=i._holes[r],o=Is.LineString.apply(t,[s]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(i){for(var t=this,e=[],n=0;n<i._geometries.length;++n){var r=i._geometries[n],s=Is.Polygon.apply(t,[r]);e.push(s.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(i){for(var t=this,e=[],n=0;n<i._geometries.length;++n){var r=i._geometries[n],s=r.getGeometryType();e.push(Is[s].apply(t,[r]))}return{type:"GeometryCollection",geometries:e}}},sm=function(t){this.geometryFactory=t||new At,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new af(this.geometryFactory)};sm.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===Ut.FIXED&&this.reducePrecision(e),e},sm.prototype.reducePrecision=function(t){var e=this,n,r;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(n=0,r=t.points.length;n<r;n++)e.precisionModel.makePrecise(t.points[n]);else if(t.geometries)for(n=0,r=t.geometries.length;n<r;n++)e.reducePrecision(t.geometries[n])};var Ww=function(){this.parser=new af(this.geometryFactory)};Ww.prototype.write=function(t){return this.parser.write(t)};var X=function(){},lf={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};X.prototype.interfaces_=function(){return[]},X.prototype.getClass=function(){return X},X.opposite=function(t){return t===X.LEFT?X.RIGHT:t===X.RIGHT?X.LEFT:t},lf.ON.get=function(){return 0},lf.LEFT.get=function(){return 1},lf.RIGHT.get=function(){return 2},Object.defineProperties(X,lf);function uf(i){this.message=i||""}uf.prototype=new Error,uf.prototype.name="EmptyStackException";function wr(){this.array_=[]}wr.prototype=new zn,wr.prototype.add=function(i){return this.array_.push(i),!0},wr.prototype.get=function(i){if(i<0||i>=this.size())throw new Error;return this.array_[i]},wr.prototype.push=function(i){return this.array_.push(i),i},wr.prototype.pop=function(i){if(this.array_.length===0)throw new uf;return this.array_.pop()},wr.prototype.peek=function(){if(this.array_.length===0)throw new uf;return this.array_[this.array_.length-1]},wr.prototype.empty=function(){return this.array_.length===0},wr.prototype.isEmpty=function(){return this.empty()},wr.prototype.search=function(i){return this.array_.indexOf(i)},wr.prototype.size=function(){return this.array_.length},wr.prototype.toArray=function(){for(var i=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(i.array_[e]);return t};var Er=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Er.prototype.getCoordinate=function(){return this._minCoord},Er.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},Er.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();Tt.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],r=tt.computeOrientation(this._minCoord,n,e),s=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===tt.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===tt.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)},Er.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge(),r=n.getCoordinates();if(e<0||e+1>=r.length||r[e].y===r[e+1].y)return-1;var s=X.LEFT;return r[e].y<r[e+1].y&&(s=X.RIGHT),s},Er.prototype.getEdge=function(){return this._orientedDe},Er.prototype.checkForRightmostCoordinate=function(t){for(var e=this,n=t.getEdge().getCoordinates(),r=0;r<n.length-1;r++)(e._minCoord===null||n[r].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=r,e._minCoord=n[r])},Er.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Er.prototype.findEdge=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next();r.isForward()&&e.checkForRightmostCoordinate(r)}Tt.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var s=this.getRightmostSide(this._minDe,this._minIndex);s===X.LEFT&&(this._orientedDe=this._minDe.getSym())},Er.prototype.interfaces_=function(){return[]},Er.prototype.getClass=function(){return Er};var Ms=(function(i){function t(e,n){i.call(this,t.msgWithCoord(e,n)),this.pt=n?new L(n):null,this.name="TopologyException"}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(n,r){return r?n:n+" [ "+r+" ]"},t})(Ss),hf=function(){this.array_=[]};hf.prototype.addLast=function(t){this.array_.push(t)},hf.prototype.removeFirst=function(){return this.array_.shift()},hf.prototype.isEmpty=function(){return this.array_.length===0};var Ei=function(){this._finder=null,this._dirEdgeList=new J,this._nodes=new J,this._rightMostCoord=null,this._env=null,this._finder=new Er};Ei.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},Ei.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ei.prototype.computeNodeDepth=function(t){for(var e=this,n=null,r=t.getEdges().iterator();r.hasNext();){var s=r.next();if(s.isVisited()||s.getSym().isVisited()){n=s;break}}if(n===null)throw new Ms("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(n);for(var o=t.getEdges().iterator();o.hasNext();){var a=o.next();a.setVisited(!0),e.copySymDepths(a)}},Ei.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(X.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Ei.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ei.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(X.RIGHT)>=1&&e.getDepth(X.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Ei.prototype.computeDepths=function(t){var e=this,n=new Qp,r=new hf,s=t.getNode();for(r.addLast(s),n.add(s),t.setVisited(!0);!r.isEmpty();){var o=r.removeFirst();n.add(o),e.computeNodeDepth(o);for(var a=o.getEdges().iterator();a.hasNext();){var l=a.next(),u=l.getSym();if(!u.isVisited()){var h=u.getNode();n.contains(h)||(r.addLast(h),n.add(h))}}}},Ei.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Ei.prototype.getEnvelope=function(){if(this._env===null){for(var t=new ht,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next(),r=n.getEdge().getCoordinates(),s=0;s<r.length-1;s++)t.expandToInclude(r[s]);this._env=t}return this._env},Ei.prototype.addReachable=function(t){var e=this,n=new wr;for(n.add(t);!n.empty();){var r=n.pop();e.add(r,n)}},Ei.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(X.LEFT,t.getDepth(X.RIGHT)),e.setDepth(X.RIGHT,t.getDepth(X.LEFT))},Ei.prototype.add=function(t,e){var n=this;t.setVisited(!0),this._nodes.add(t);for(var r=t.getEdges().iterator();r.hasNext();){var s=r.next();n._dirEdgeList.add(s);var o=s.getSym(),a=o.getNode();a.isVisited()||e.push(a)}},Ei.prototype.getNodes=function(){return this._nodes},Ei.prototype.getDirectedEdges=function(){return this._dirEdgeList},Ei.prototype.interfaces_=function(){return[bn]},Ei.prototype.getClass=function(){return Ei};var re=function i(){var t=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[X.ON]=n}else if(arguments[0]instanceof i){var r=arguments[0];if(this.init(r.location.length),r!==null)for(var s=0;s<this.location.length;s++)t.location[s]=r.location[s]}}else if(arguments.length===3){var o=arguments[0],a=arguments[1],l=arguments[2];this.init(3),this.location[X.ON]=o,this.location[X.LEFT]=a,this.location[X.RIGHT]=l}};re.prototype.setAllLocations=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]=t},re.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==k.NONE)return!1;return!0},re.prototype.setAllLocationsIfNull=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]===k.NONE&&(e.location[n]=t)},re.prototype.isLine=function(){return this.location.length===1},re.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var n=new Array(3).fill(null);n[X.ON]=this.location[X.ON],n[X.LEFT]=k.NONE,n[X.RIGHT]=k.NONE,this.location=n}for(var r=0;r<this.location.length;r++)e.location[r]===k.NONE&&r<t.location.length&&(e.location[r]=t.location[r])},re.prototype.getLocations=function(){return this.location},re.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[X.LEFT];this.location[X.LEFT]=this.location[X.RIGHT],this.location[X.RIGHT]=t},re.prototype.toString=function(){var t=new dr;return this.location.length>1&&t.append(k.toLocationSymbol(this.location[X.LEFT])),t.append(k.toLocationSymbol(this.location[X.ON])),this.location.length>1&&t.append(k.toLocationSymbol(this.location[X.RIGHT])),t.toString()},re.prototype.setLocations=function(t,e,n){this.location[X.ON]=t,this.location[X.LEFT]=e,this.location[X.RIGHT]=n},re.prototype.get=function(t){return t<this.location.length?this.location[t]:k.NONE},re.prototype.isArea=function(){return this.location.length>1},re.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===k.NONE)return!0;return!1},re.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(X.ON,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.location[e]=n}},re.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(k.NONE)},re.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},re.prototype.allPositionsEqual=function(t){for(var e=this,n=0;n<this.location.length;n++)if(e.location[n]!==t)return!1;return!0},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re};var Yt=function i(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new re(t),this.elt[1]=new re(t)}else if(arguments[0]instanceof i){var e=arguments[0];this.elt[0]=new re(e.elt[0]),this.elt[1]=new re(e.elt[1])}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.elt[0]=new re(k.NONE),this.elt[1]=new re(k.NONE),this.elt[n].setLocation(r)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this.elt[0]=new re(s,o,a),this.elt[1]=new re(s,o,a)}else if(arguments.length===4){var l=arguments[0],u=arguments[1],h=arguments[2],c=arguments[3];this.elt[0]=new re(k.NONE,k.NONE,k.NONE),this.elt[1]=new re(k.NONE,k.NONE,k.NONE),this.elt[l].setLocations(u,h,c)}};Yt.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Yt.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Yt.prototype.isNull=function(t){return this.elt[t].isNull()},Yt.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},Yt.prototype.isLine=function(t){return this.elt[t].isLine()},Yt.prototype.merge=function(t){for(var e=this,n=0;n<2;n++)e.elt[n]===null&&t.elt[n]!==null?e.elt[n]=new re(t.elt[n]):e.elt[n].merge(t.elt[n])},Yt.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Yt.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(X.ON)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Yt.prototype.toString=function(){var t=new dr;return this.elt[0]!==null&&(t.append("A:"),t.append(this.elt[0].toString())),this.elt[1]!==null&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},Yt.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var t=arguments[0];return this.elt[t].isArea()}},Yt.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Yt.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(X.ON,e)}else if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];this.elt[n].setLocation(r,s)}},Yt.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Yt.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Yt.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new re(this.elt[t].location[0]))},Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.toLineLabel=function(t){for(var e=new Yt(k.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Ie=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new J,this._pts=new J,this._label=new Yt(k.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new J,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Ie.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),n=0;n<this._pts.size();n++)e[n]=t._pts.get(n);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=tt.isCCW(this._ring.getCoordinates())},Ie.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},Ie.prototype.computePoints=function(t){var e=this;this._startDe=t;var n=t,r=!0;do{if(n===null)throw new Ms("Found null DirectedEdge");if(n.getEdgeRing()===e)throw new Ms("Directed Edge visited twice during ring-building at "+n.getCoordinate());e._edges.add(n);var s=n.getLabel();Tt.isTrue(s.isArea()),e.mergeLabel(s),e.addPoints(n.getEdge(),n.isForward(),r),r=!1,e.setEdgeRing(n,e),n=e.getNext(n)}while(n!==this._startDe)},Ie.prototype.getLinearRing=function(){return this._ring},Ie.prototype.getCoordinate=function(t){return this._pts.get(t)},Ie.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var n=e.getNode(),r=n.getEdges().getOutgoingDegree(t);r>t._maxNodeDegree&&(t._maxNodeDegree=r),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},Ie.prototype.addPoints=function(t,e,n){var r=this,s=t.getCoordinates();if(e){var o=1;n&&(o=0);for(var a=o;a<s.length;a++)r._pts.add(s[a])}else{var l=s.length-2;n&&(l=s.length-1);for(var u=l;u>=0;u--)r._pts.add(s[u])}},Ie.prototype.isHole=function(){return this._isHole},Ie.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},Ie.prototype.containsPoint=function(t){var e=this.getLinearRing(),n=e.getEnvelopeInternal();if(!n.contains(t)||!tt.isPointInRing(t,e.getCoordinates()))return!1;for(var r=this._holes.iterator();r.hasNext();){var s=r.next();if(s.containsPoint(t))return!1}return!0},Ie.prototype.addHole=function(t){this._holes.add(t)},Ie.prototype.isShell=function(){return this._shell===null},Ie.prototype.getLabel=function(){return this._label},Ie.prototype.getEdges=function(){return this._edges},Ie.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Ie.prototype.getShell=function(){return this._shell},Ie.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],r=e.getLocation(n,X.RIGHT);if(r===k.NONE)return null;if(this._label.getLocation(n)===k.NONE)return this._label.setLocation(n,r),null}},Ie.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},Ie.prototype.toPolygon=function(t){for(var e=this,n=new Array(this._holes.size()).fill(null),r=0;r<this._holes.size();r++)n[r]=e._holes.get(r).getLinearRing();var s=t.createPolygon(this.getLinearRing(),n);return s},Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie};var qN=(function(i){function t(){var e=arguments[0],n=arguments[1];i.call(this,e,n)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(n,r){n.setMinEdgeRing(r)},t.prototype.getNext=function(n){return n.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Ie),WN=(function(i){function t(){var e=arguments[0],n=arguments[1];i.call(this,e,n)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var n=this,r=new J,s=this._startDe;do{if(s.getMinEdgeRing()===null){var o=new qN(s,n._geometryFactory);r.add(o)}s=s.getNext()}while(s!==this._startDe);return r},t.prototype.setEdgeRing=function(n,r){n.setEdgeRing(r)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var n=this,r=this._startDe;do{var s=r.getNode();s.getEdges().linkMinimalDirectedEdges(n),r=r.getNext()}while(r!==this._startDe)},t.prototype.getNext=function(n){return n.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Ie),ln=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._label=t}}};ln.prototype.setVisited=function(t){this._isVisited=t},ln.prototype.setInResult=function(t){this._isInResult=t},ln.prototype.isCovered=function(){return this._isCovered},ln.prototype.isCoveredSet=function(){return this._isCoveredSet},ln.prototype.setLabel=function(t){this._label=t},ln.prototype.getLabel=function(){return this._label},ln.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},ln.prototype.updateIM=function(t){Tt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},ln.prototype.isInResult=function(){return this._isInResult},ln.prototype.isVisited=function(){return this._isVisited},ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln};var cf=(function(i){function t(){i.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new Yt(0,k.NONE)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var r=n.next();if(r.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(n){},t.prototype.computeMergedLocation=function(n,r){var s=k.NONE;if(s=this._label.getLocation(r),!n.isNull(r)){var o=n.getLocation(r);s!==k.BOUNDARY&&(s=o)}return s},t.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1];this._label===null?this._label=new Yt(n,r):this._label.setLocation(n,r)}else return i.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof t){var r=arguments[0];this.mergeLabel(r._label)}else if(arguments[0]instanceof Yt)for(var s=arguments[0],o=0;o<2;o++){var a=n.computeMergedLocation(s,o),l=n._label.getLocation(o);l===k.NONE&&n._label.setLocation(o,a)}},t.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},t.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var r=k.NONE;this._label!==null&&(r=this._label.getLocation(n));var s=null;switch(r){case k.BOUNDARY:s=k.INTERIOR;break;case k.INTERIOR:s=k.BOUNDARY;break;default:s=k.BOUNDARY;break}this._label.setLocation(n,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(ln),Sr=function(){this.nodeMap=new fi,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Sr.prototype.find=function(t){return this.nodeMap.get(t)},Sr.prototype.addNode=function(){if(arguments[0]instanceof L){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof cf){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return r===null?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},Sr.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Sr.prototype.iterator=function(){return this.nodeMap.values().iterator()},Sr.prototype.values=function(){return this.nodeMap.values()},Sr.prototype.getBoundaryNodes=function(t){for(var e=new J,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===k.BOUNDARY&&e.add(r)}return e},Sr.prototype.add=function(t){var e=t.getCoordinate(),n=this.addNode(e);n.add(t)},Sr.prototype.interfaces_=function(){return[]},Sr.prototype.getClass=function(){return Sr};var te=function(){},yc={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};te.prototype.interfaces_=function(){return[]},te.prototype.getClass=function(){return te},te.isNorthern=function(t){return t===te.NE||t===te.NW},te.isOpposite=function(t,e){if(t===e)return!1;var n=(t-e+4)%4;return n===2},te.commonHalfPlane=function(t,e){if(t===e)return t;var n=(t-e+4)%4;if(n===2)return-1;var r=t<e?t:e,s=t>e?t:e;return r===0&&s===3?3:r},te.isInHalfPlane=function(t,e){return e===te.SE?t===te.SE||t===te.SW:t===e||t===e+1},te.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new de("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?te.NE:te.SE:e>=0?te.NW:te.SW}else if(arguments[0]instanceof L&&arguments[1]instanceof L){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new de("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?te.NE:te.SE:r.y>=n.y?te.NW:te.SW}},yc.NE.get=function(){return 0},yc.NW.get=function(){return 1},yc.SW.get=function(){return 2},yc.SE.get=function(){return 3},Object.defineProperties(te,yc);var gi=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],n=arguments[1],r=arguments[2],s=null;this._edge=e,this.init(n,r),this._label=s}else if(arguments.length===4){var o=arguments[0],a=arguments[1],l=arguments[2],u=arguments[3];this._edge=o,this.init(a,l),this._label=u}};gi.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:tt.computeOrientation(t._p0,t._p1,this._p1)},gi.prototype.getDy=function(){return this._dy},gi.prototype.getCoordinate=function(){return this._p0},gi.prototype.setNode=function(t){this._node=t},gi.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),s=n.substring(r+1);t.print(" "+s+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},gi.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},gi.prototype.getDirectedCoordinate=function(){return this._p1},gi.prototype.getDx=function(){return this._dx},gi.prototype.getLabel=function(){return this._label},gi.prototype.getEdge=function(){return this._edge},gi.prototype.getQuadrant=function(){return this._quadrant},gi.prototype.getNode=function(){return this._node},gi.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf("."),r=e.substring(n+1);return" "+r+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},gi.prototype.computeLabel=function(t){},gi.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=te.quadrant(this._dx,this._dy),Tt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},gi.prototype.interfaces_=function(){return[bn]},gi.prototype.getClass=function(){return gi};var om=(function(i){function t(){var e=arguments[0],n=arguments[1];if(i.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var r=e.getNumPoints()-1;this.init(e.getCoordinate(r),e.getCoordinate(r-1))}this.computeDirectedLabel()}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.getNextMin=function(){return this._nextMin},t.prototype.getDepth=function(n){return this._depth[n]},t.prototype.setVisited=function(n){this._isVisited=n},t.prototype.computeDirectedLabel=function(){this._label=new Yt(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(n,r){if(this._depth[n]!==-999&&this._depth[n]!==r)throw new Ms("assigned depths do not match",this.getCoordinate());this._depth[n]=r},t.prototype.isInteriorAreaEdge=function(){for(var n=this,r=!0,s=0;s<2;s++)n._label.isArea(s)&&n._label.getLocation(s,X.LEFT)===k.INTERIOR&&n._label.getLocation(s,X.RIGHT)===k.INTERIOR||(r=!1);return r},t.prototype.setNextMin=function(n){this._nextMin=n},t.prototype.print=function(n){i.prototype.print.call(this,n),n.print(" "+this._depth[X.LEFT]+"/"+this._depth[X.RIGHT]),n.print(" ("+this.getDepthDelta()+")"),this._isInResult&&n.print(" inResult")},t.prototype.setMinEdgeRing=function(n){this._minEdgeRing=n},t.prototype.isLineEdge=function(){var n=this._label.isLine(0)||this._label.isLine(1),r=!this._label.isArea(0)||this._label.allPositionsEqual(0,k.EXTERIOR),s=!this._label.isArea(1)||this._label.allPositionsEqual(1,k.EXTERIOR);return n&&r&&s},t.prototype.setEdgeRing=function(n){this._edgeRing=n},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var n=this._edge.getDepthDelta();return this._isForward||(n=-n),n},t.prototype.setInResult=function(n){this._isInResult=n},t.prototype.getSym=function(){return this._sym},t.prototype.isForward=function(){return this._isForward},t.prototype.getEdge=function(){return this._edge},t.prototype.printEdge=function(n){this.print(n),n.print(" "),this._isForward?this._edge.print(n):this._edge.printReverse(n)},t.prototype.setSym=function(n){this._sym=n},t.prototype.setVisitedEdge=function(n){this.setVisited(n),this._sym.setVisited(n)},t.prototype.setEdgeDepths=function(n,r){var s=this.getEdge().getDepthDelta();this._isForward||(s=-s);var o=1;n===X.LEFT&&(o=-1);var a=X.opposite(n),l=s*o,u=r+l;this.setDepth(n,r),this.setDepth(a,u)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(n){this._next=n},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(n,r){return n===k.EXTERIOR&&r===k.INTERIOR?1:n===k.INTERIOR&&r===k.EXTERIOR?-1:0},t})(gi),gu=function(){};gu.prototype.createNode=function(t){return new cf(t,null)},gu.prototype.interfaces_=function(){return[]},gu.prototype.getClass=function(){return gu};var pe=function(){if(this._edges=new J,this._nodes=null,this._edgeEndList=new J,arguments.length===0)this._nodes=new Sr(new gu);else if(arguments.length===1){var t=arguments[0];this._nodes=new Sr(t)}};pe.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var n=0;n<this._edges.size();n++){t.println("edge "+n+":");var r=e._edges.get(n);r.print(t),r.eiList.print(t)}},pe.prototype.find=function(t){return this._nodes.find(t)},pe.prototype.addNode=function(){if(arguments[0]instanceof cf){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof L){var e=arguments[0];return this._nodes.addNode(e)}},pe.prototype.getNodeIterator=function(){return this._nodes.iterator()},pe.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},pe.prototype.debugPrintln=function(t){ii.out.println(t)},pe.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(n===null)return!1;var r=n.getLabel();return r!==null&&r.getLocation(t)===k.BOUNDARY},pe.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}},pe.prototype.matchInSameDirection=function(t,e,n,r){return t.equals(n)?tt.computeOrientation(t,e,r)===tt.COLLINEAR&&te.quadrant(t,e)===te.quadrant(n,r):!1},pe.prototype.getEdgeEnds=function(){return this._edgeEndList},pe.prototype.debugPrint=function(t){ii.out.print(t)},pe.prototype.getEdgeIterator=function(){return this._edges.iterator()},pe.prototype.findEdgeInSameDirection=function(t,e){for(var n=this,r=0;r<this._edges.size();r++){var s=n._edges.get(r),o=s.getCoordinates();if(n.matchInSameDirection(t,e,o[0],o[1])||n.matchInSameDirection(t,e,o[o.length-1],o[o.length-2]))return s}return null},pe.prototype.insertEdge=function(t){this._edges.add(t)},pe.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},pe.prototype.addEdges=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next();e._edges.add(r);var s=new om(r,!0),o=new om(r,!1);s.setSym(o),o.setSym(s),e.add(s),e.add(o)}},pe.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},pe.prototype.getNodes=function(){return this._nodes.values()},pe.prototype.findEdge=function(t,e){for(var n=this,r=0;r<this._edges.size();r++){var s=n._edges.get(r),o=s.getCoordinates();if(t.equals(o[0])&&e.equals(o[1]))return s}return null},pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe},pe.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.getEdges().linkResultDirectedEdges()}};var Wi=function(){this._geometryFactory=null,this._shellList=new J;var t=arguments[0];this._geometryFactory=t};Wi.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var s=r.next();s.isHole()?n.add(s):e.add(s)}},Wi.prototype.computePolygons=function(t){for(var e=this,n=new J,r=t.iterator();r.hasNext();){var s=r.next(),o=s.toPolygon(e._geometryFactory);n.add(o)}return n},Wi.prototype.placeFreeHoles=function(t,e){for(var n=this,r=e.iterator();r.hasNext();){var s=r.next();if(s.getShell()===null){var o=n.findEdgeRingContaining(s,t);if(o===null)throw new Ms("unable to assign hole to a shell",s.getCoordinate(0));s.setShell(o)}}},Wi.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=this,s=new J,o=t.iterator();o.hasNext();){var a=o.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var l=a.buildMinimalRings(),u=r.findShell(l);u!==null?(r.placePolygonHoles(u,l),e.add(u)):n.addAll(l)}else s.add(a)}return s},Wi.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var n=e.next();if(n.containsPoint(t))return!0}return!1},Wi.prototype.buildMaximalEdgeRings=function(t){for(var e=this,n=new J,r=t.iterator();r.hasNext();){var s=r.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var o=new WN(s,e._geometryFactory);n.add(o),o.setInResult()}}return n},Wi.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Wi.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},Wi.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),s=n.getCoordinateN(0),o=null,a=null,l=e.iterator();l.hasNext();){var u=l.next(),h=u.getLinearRing(),c=h.getEnvelopeInternal();o!==null&&(a=o.getLinearRing().getEnvelopeInternal());var d=!1;c.contains(r)&&tt.isPointInRing(s,h.getCoordinates())&&(d=!0),d&&(o===null||a.contains(c))&&(o=u)}return o},Wi.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var s=r.next();s.isHole()||(n=s,e++)}return Tt.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Wi.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],n=arguments[1];pe.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),s=new J,o=this.buildMinimalEdgeRings(r,this._shellList,s);this.sortShellsAndHoles(o,this._shellList,s),this.placeFreeHoles(this._shellList,s)}},Wi.prototype.interfaces_=function(){return[]},Wi.prototype.getClass=function(){return Wi};var pu=function(){};pu.prototype.getBounds=function(){},pu.prototype.interfaces_=function(){return[]},pu.prototype.getClass=function(){return pu};var qn=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};qn.prototype.getItem=function(){return this._item},qn.prototype.getBounds=function(){return this._bounds},qn.prototype.interfaces_=function(){return[pu,Cn]},qn.prototype.getClass=function(){return qn};var Ts=function(){this._size=null,this._items=null,this._size=0,this._items=new J,this._items.add(null)};Ts.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},Ts.prototype.size=function(){return this._size},Ts.prototype.reorder=function(t){for(var e=this,n=null,r=this._items.get(t);t*2<=this._size&&(n=t*2,n!==e._size&&e._items.get(n+1).compareTo(e._items.get(n))<0&&n++,e._items.get(n).compareTo(r)<0);t=n)e._items.set(t,e._items.get(n));this._items.set(t,r)},Ts.prototype.clear=function(){this._size=0,this._items.clear()},Ts.prototype.isEmpty=function(){return this._size===0},Ts.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)e._items.set(n,e._items.get(Math.trunc(n/2)));this._items.set(n,t)},Ts.prototype.interfaces_=function(){return[]},Ts.prototype.getClass=function(){return Ts};var lo=function(){};lo.prototype.visitItem=function(t){},lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo};var Ua=function(){};Ua.prototype.insert=function(t,e){},Ua.prototype.remove=function(t,e){},Ua.prototype.query=function(){},Ua.prototype.interfaces_=function(){return[]},Ua.prototype.getClass=function(){return Ua};var Ae=function(){if(this._childBoundables=new J,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},Hw={serialVersionUID:{configurable:!0}};Ae.prototype.getLevel=function(){return this._level},Ae.prototype.size=function(){return this._childBoundables.size()},Ae.prototype.getChildBoundables=function(){return this._childBoundables},Ae.prototype.addChildBoundable=function(t){Tt.isTrue(this._bounds===null),this._childBoundables.add(t)},Ae.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ae.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Ae.prototype.interfaces_=function(){return[pu,Cn]},Ae.prototype.getClass=function(){return Ae},Hw.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Ae,Hw);var Wn=function(){};Wn.reverseOrder=function(){return{compare:function(e,n){return n.compareTo(e)}}},Wn.min=function(t){return Wn.sort(t),t.get(0)},Wn.sort=function(t,e){var n=t.toArray();e?$o.sort(n,e):$o.sort(n);for(var r=t.iterator(),s=0,o=n.length;s<o;s++)r.next(),r.set(n[s])},Wn.singletonList=function(t){var e=new J;return e.add(t),e};var Me=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};Me.prototype.expandToQueue=function(t,e){var n=Me.isComposite(this._boundable1),r=Me.isComposite(this._boundable2);if(n&&r)return Me.area(this._boundable1)>Me.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new de("neither boundable is composite")},Me.prototype.isLeaves=function(){return!(Me.isComposite(this._boundable1)||Me.isComposite(this._boundable2))},Me.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},Me.prototype.expand=function(t,e,n,r){for(var s=this,o=t.getChildBoundables(),a=o.iterator();a.hasNext();){var l=a.next(),u=new Me(l,e,s._itemDistance);u.getDistance()<r&&n.add(u)}},Me.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},Me.prototype.getDistance=function(){return this._distance},Me.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Me.prototype.interfaces_=function(){return[bn]},Me.prototype.getClass=function(){return Me},Me.area=function(t){return t.getBounds().getArea()},Me.isComposite=function(t){return t instanceof Ae};var Xe=function i(){if(this._root=null,this._built=!1,this._itemBoundables=new J,this._nodeCapacity=null,arguments.length===0){var t=i.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var e=arguments[0];Tt.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}},df={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Xe.prototype.getNodeCapacity=function(){return this._nodeCapacity},Xe.prototype.lastNode=function(t){return t.get(t.size()-1)},Xe.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,r=e.getChildBoundables().iterator();r.hasNext();){var s=r.next();s instanceof Ae?n+=t.size(s):s instanceof qn&&(n+=1)}return n}},Xe.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var s=r.next();s instanceof qn&&s.getItem()===e&&(n=s)}return n!==null?(t.getChildBoundables().remove(n),!0):!1},Xe.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new J:e}else if(arguments.length===1){for(var n=arguments[0],r=new J,s=n.getChildBoundables().iterator();s.hasNext();){var o=s.next();if(o instanceof Ae){var a=t.itemsTree(o);a!==null&&r.add(a)}else o instanceof qn?r.add(o.getItem()):Tt.shouldNeverReachHere()}return r.size()<=0?null:r}},Xe.prototype.insert=function(t,e){Tt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new qn(t,e))},Xe.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],n=new J;return this.boundablesAtLevel(e,this._root,n),n}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2];if(Tt.isTrue(r>-2),s.getLevel()===r)return o.add(s),null;for(var a=s.getChildBoundables().iterator();a.hasNext();){var l=a.next();l instanceof Ae?t.boundablesAtLevel(r,l,o):(Tt.isTrue(l instanceof qn),r===-1&&o.add(l))}return null}},Xe.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var n=new J;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,n),n}else if(arguments.length===2){var r=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,s)}else if(arguments.length===3){if(St(arguments[2],lo)&&arguments[0]instanceof Object&&arguments[1]instanceof Ae)for(var o=arguments[0],a=arguments[1],l=arguments[2],u=a.getChildBoundables(),h=0;h<u.size();h++){var c=u.get(h);t.getIntersectsOp().intersects(c.getBounds(),o)&&(c instanceof Ae?t.query(o,c,l):c instanceof qn?l.visitItem(c.getItem()):Tt.shouldNeverReachHere())}else if(St(arguments[2],zn)&&arguments[0]instanceof Object&&arguments[1]instanceof Ae)for(var d=arguments[0],g=arguments[1],p=arguments[2],E=g.getChildBoundables(),b=0;b<E.size();b++){var P=E.get(b);t.getIntersectsOp().intersects(P.getBounds(),d)&&(P instanceof Ae?t.query(d,P,p):P instanceof qn?p.add(P.getItem()):Tt.shouldNeverReachHere())}}},Xe.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},Xe.prototype.getRoot=function(){return this.build(),this._root},Xe.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,n):!1}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2],a=this.removeItem(s,o);if(a)return!0;for(var l=null,u=s.getChildBoundables().iterator();u.hasNext();){var h=u.next();if(t.getIntersectsOp().intersects(h.getBounds(),r)&&h instanceof Ae&&(a=t.remove(r,h,o),a)){l=h;break}}return l!==null&&l.getChildBoundables().isEmpty()&&s.getChildBoundables().remove(l),a}},Xe.prototype.createHigherLevels=function(t,e){Tt.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return n.size()===1?n.get(0):this.createHigherLevels(n,e+1)},Xe.prototype.depth=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,r=e.getChildBoundables().iterator();r.hasNext();){var s=r.next();if(s instanceof Ae){var o=t.depth(s);o>n&&(n=o)}}return n+1}},Xe.prototype.createParentBoundables=function(t,e){var n=this;Tt.isTrue(!t.isEmpty());var r=new J;r.add(this.createNode(e));var s=new J(t);Wn.sort(s,this.getComparator());for(var o=s.iterator();o.hasNext();){var a=o.next();n.lastNode(r).getChildBoundables().size()===n.getNodeCapacity()&&r.add(n.createNode(e)),n.lastNode(r).addChildBoundable(a)}return r},Xe.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Xe.prototype.interfaces_=function(){return[Cn]},Xe.prototype.getClass=function(){return Xe},Xe.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},df.IntersectsOp.get=function(){return HN},df.serialVersionUID.get=function(){return-3886435814360241e3},df.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Xe,df);var HN=function(){},mu=function(){};mu.prototype.distance=function(t,e){},mu.prototype.interfaces_=function(){return[]},mu.prototype.getClass=function(){return mu};var Xw=(function(i){function t(n){n=n||t.DEFAULT_NODE_CAPACITY,i.call(this,n)}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return t.prototype.createParentBoundablesFromVerticalSlices=function(r,s){var o=this;Tt.isTrue(r.length>0);for(var a=new J,l=0;l<r.length;l++)a.addAll(o.createParentBoundablesFromVerticalSlice(r[l],s));return a},t.prototype.createNode=function(r){return new $w(r)},t.prototype.size=function(){return arguments.length===0?i.prototype.size.call(this):i.prototype.size.apply(this,arguments)},t.prototype.insert=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];if(r.isNull())return null;i.prototype.insert.call(this,r,s)}else return i.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(r,s){for(var o=Math.trunc(Math.ceil(r.size()/s)),a=new Array(s).fill(null),l=r.iterator(),u=0;u<s;u++){a[u]=new J;for(var h=0;l.hasNext()&&h<o;){var c=l.next();a[u].add(c),h++}}return a},t.prototype.query=function(){if(arguments.length===1){var r=arguments[0];return i.prototype.query.call(this,r)}else if(arguments.length===2){var s=arguments[0],o=arguments[1];i.prototype.query.call(this,s,o)}else if(arguments.length===3){if(St(arguments[2],lo)&&arguments[0]instanceof Object&&arguments[1]instanceof Ae){var a=arguments[0],l=arguments[1],u=arguments[2];i.prototype.query.call(this,a,l,u)}else if(St(arguments[2],zn)&&arguments[0]instanceof Object&&arguments[1]instanceof Ae){var h=arguments[0],c=arguments[1],d=arguments[2];i.prototype.query.call(this,h,c,d)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(r,s){return i.prototype.createParentBoundables.call(this,r,s)},t.prototype.remove=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return i.prototype.remove.call(this,r,s)}else return i.prototype.remove.apply(this,arguments)},t.prototype.depth=function(){return arguments.length===0?i.prototype.depth.call(this):i.prototype.depth.apply(this,arguments)},t.prototype.createParentBoundables=function(r,s){Tt.isTrue(!r.isEmpty());var o=Math.trunc(Math.ceil(r.size()/this.getNodeCapacity())),a=new J(r);Wn.sort(a,t.xComparator);var l=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(o))));return this.createParentBoundablesFromVerticalSlices(l,s)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(St(arguments[0],mu)){var r=arguments[0],s=new Me(this.getRoot(),this.getRoot(),r);return this.nearestNeighbour(s)}else if(arguments[0]instanceof Me){var o=arguments[0];return this.nearestNeighbour(o,Pt.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&St(arguments[1],mu)){var a=arguments[0],l=arguments[1],u=new Me(this.getRoot(),a.getRoot(),l);return this.nearestNeighbour(u)}else if(arguments[0]instanceof Me&&typeof arguments[1]=="number"){var h=arguments[0],c=arguments[1],d=c,g=null,p=new Ts;for(p.add(h);!p.isEmpty()&&d>0;){var E=p.poll(),b=E.getDistance();if(b>=d)break;E.isLeaves()?(d=b,g=E):E.expandToQueue(p,d)}return[g.getBoundable(0).getItem(),g.getBoundable(1).getItem()]}}else if(arguments.length===3){var P=arguments[0],v=arguments[1],_=arguments[2],m=new qn(P,v),y=new Me(this.getRoot(),m,_);return this.nearestNeighbour(y)[0]}},t.prototype.interfaces_=function(){return[Ua,Cn]},t.prototype.getClass=function(){return t},t.centreX=function(r){return t.avg(r.getMinX(),r.getMaxX())},t.avg=function(r,s){return(r+s)/2},t.centreY=function(r){return t.avg(r.getMinY(),r.getMaxY())},e.STRtreeNode.get=function(){return $w},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[iu]},compare:function(n,r){return i.compareDoubles(t.centreX(n.getBounds()),t.centreX(r.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[iu]},compare:function(n,r){return i.compareDoubles(t.centreY(n.getBounds()),t.centreY(r.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[i.IntersectsOp]},intersects:function(n,r){return n.intersects(r)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,e),t})(Xe),$w=(function(i){function t(){var e=arguments[0];i.call(this,e)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var n=null,r=this.getChildBoundables().iterator();r.hasNext();){var s=r.next();n===null?n=new ht(s.getBounds()):n.expandToInclude(s.getBounds())}return n},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Ae),Di=function(){};Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di},Di.relativeSign=function(t,e){return t<e?-1:t>e?1:0},Di.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=Di.relativeSign(e.x,n.x),s=Di.relativeSign(e.y,n.y);switch(t){case 0:return Di.compareValue(r,s);case 1:return Di.compareValue(s,r);case 2:return Di.compareValue(s,-r);case 3:return Di.compareValue(-r,s);case 4:return Di.compareValue(-r,-s);case 5:return Di.compareValue(-s,-r);case 6:return Di.compareValue(-s,r);case 7:return Di.compareValue(r,-s)}return Tt.shouldNeverReachHere("invalid octant value"),0},Di.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var uo=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new L(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};uo.prototype.getCoordinate=function(){return this.coord},uo.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},uo.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:Di.compare(this._segmentOctant,this.coord,e.coord)},uo.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},uo.prototype.isInterior=function(){return this._isInterior},uo.prototype.interfaces_=function(){return[bn]},uo.prototype.getClass=function(){return uo};var Si=function(){this._nodeMap=new fi,this._edge=null;var t=arguments[0];this._edge=t};Si.prototype.getSplitCoordinates=function(){var t=this,e=new hc;this.addEndpoints();for(var n=this.iterator(),r=n.next();n.hasNext();){var s=n.next();t.addEdgeCoordinates(r,s,e),r=s}return e.toCoordinateArray()},Si.prototype.addCollapsedNodes=function(){var t=this,e=new J;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var n=e.iterator();n.hasNext();){var r=n.next().intValue();t.add(t._edge.getCoordinate(r),r)}},Si.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Si.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,n=0;n<this._edge.size()-2;n++){var r=e._edge.getCoordinate(n),s=e._edge.getCoordinate(n+2);r.equals2D(s)&&t.add(new fr(n+1))}},Si.prototype.addEdgeCoordinates=function(t,e,n){var r=this,s=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(s);n.add(new L(t.coord),!1);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)n.add(r._edge.getCoordinate(a));o&&n.add(new L(e.coord))},Si.prototype.iterator=function(){return this._nodeMap.values().iterator()},Si.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var n=this.iterator(),r=n.next();n.hasNext();){var s=n.next(),o=e.createSplitEdge(r,s);t.add(o),r=s}},Si.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,r===1?(n[0]=t.segmentIndex+1,!0):!1},Si.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,n=new Array(1).fill(null),r=this.iterator(),s=r.next();r.hasNext();){var o=r.next(),a=e.findCollapseIndex(s,o,n);a&&t.add(new fr(n[0])),s=o}},Si.prototype.getEdge=function(){return this._edge},Si.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},Si.prototype.createSplitEdge=function(t,e){var n=this,r=e.segmentIndex-t.segmentIndex+2,s=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(s);o||r--;var a=new Array(r).fill(null),l=0;a[l++]=new L(t.coord);for(var u=t.segmentIndex+1;u<=e.segmentIndex;u++)a[l++]=n._edge.getCoordinate(u);return o&&(a[l]=new L(e.coord)),new be(a,this._edge.getData())},Si.prototype.add=function(t,e){var n=new uo(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return r!==null?(Tt.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},Si.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0),r=n.getCoordinate(0);if(!r.equals2D(e[0]))throw new Ss("bad split edge start point at "+r);var s=t.get(t.size()-1),o=s.getCoordinates(),a=o[o.length-1];if(!a.equals2D(e[e.length-1]))throw new Ss("bad split edge end point at "+a)},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si};var qa=function(){};qa.prototype.interfaces_=function(){return[]},qa.prototype.getClass=function(){return qa},qa.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new de("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}else if(arguments[0]instanceof L&&arguments[1]instanceof L){var s=arguments[0],o=arguments[1],a=o.x-s.x,l=o.y-s.y;if(a===0&&l===0)throw new de("Cannot compute the octant for two identical points "+s);return qa.octant(a,l)}};var Hr=function(){};Hr.prototype.getCoordinates=function(){},Hr.prototype.size=function(){},Hr.prototype.getCoordinate=function(t){},Hr.prototype.isClosed=function(){},Hr.prototype.setData=function(t){},Hr.prototype.getData=function(){},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var _c=function(){};_c.prototype.addIntersection=function(t,e){},_c.prototype.interfaces_=function(){return[Hr]},_c.prototype.getClass=function(){return _c};var be=function(){this._nodeList=new Si(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};be.prototype.getCoordinates=function(){return this._pts},be.prototype.size=function(){return this._pts.length},be.prototype.getCoordinate=function(t){return this._pts[t]},be.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},be.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},be.prototype.setData=function(t){this._data=t},be.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:qa.octant(t,e)},be.prototype.getData=function(){return this._data},be.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var n=arguments[0],r=arguments[1],s=arguments[3],o=new L(n.getIntersection(s));this.addIntersection(o,r)}},be.prototype.toString=function(){return Vn.toLineString(new Se(this._pts))},be.prototype.getNodeList=function(){return this._nodeList},be.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var s=this._pts[r];t.equals2D(s)&&(n=r)}var o=this._nodeList.add(t,n);return o},be.prototype.addIntersections=function(t,e,n){for(var r=this,s=0;s<t.getIntersectionNum();s++)r.addIntersection(t,e,n,s)},be.prototype.interfaces_=function(){return[_c]},be.prototype.getClass=function(){return be},be.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new J;return be.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var n=arguments[0],r=arguments[1],s=n.iterator();s.hasNext();){var o=s.next();o.getNodeList().addSplitEdges(r)}};var gt=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new L,this.p1=new L;else if(arguments.length===1){var t=arguments[0];this.p0=new L(t.p0),this.p1=new L(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],n=arguments[1],r=arguments[2],s=arguments[3];this.p0=new L(e,n),this.p1=new L(r,s)}},Yw={serialVersionUID:{configurable:!0}};gt.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},gt.prototype.orientationIndex=function(){if(arguments[0]instanceof gt){var t=arguments[0],e=tt.orientationIndex(this.p0,this.p1,t.p0),n=tt.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}else if(arguments[0]instanceof L){var r=arguments[0];return tt.orientationIndex(this.p0,this.p1,r)}},gt.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},gt.prototype.isVertical=function(){return this.p0.x===this.p1.x},gt.prototype.equals=function(t){if(!(t instanceof gt))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},gt.prototype.intersection=function(t){var e=new Ho;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},gt.prototype.project=function(){if(arguments[0]instanceof L){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new L(t);var e=this.projectionFactor(t),n=new L;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof gt){var r=arguments[0],s=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(s>=1&&o>=1||s<=0&&o<=0)return null;var a=this.project(r.p0);s<0&&(a=this.p0),s>1&&(a=this.p1);var l=this.project(r.p1);return o<0&&(l=this.p0),o>1&&(l=this.p1),new gt(a,l)}},gt.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},gt.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},gt.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},gt.prototype.distancePerpendicular=function(t){return tt.distancePointLinePerpendicular(t,this.p0,this.p1)},gt.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},gt.prototype.midPoint=function(){return gt.midPoint(this.p0,this.p1)},gt.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;if(r<=0)return Pt.NaN;var s=((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r;return s},gt.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var n=new Array(2).fill(null),r=Pt.MAX_VALUE,s=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var a=this.closestPoint(t.p1);s=a.distance(t.p1),s<r&&(r=s,n[0]=a,n[1]=t.p1);var l=t.closestPoint(this.p0);s=l.distance(this.p0),s<r&&(r=s,n[0]=this.p0,n[1]=l);var u=t.closestPoint(this.p1);return s=u.distance(this.p1),s<r&&(r=s,n[0]=this.p1,n[1]=u),n},gt.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var n=this.p0.distance(t),r=this.p1.distance(t);return n<r?this.p0:this.p1},gt.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},gt.prototype.getLength=function(){return this.p0.distance(this.p1)},gt.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return n!==0?n:this.p1.compareTo(e.p1)},gt.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},gt.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},gt.prototype.lineIntersection=function(t){try{var e=jn.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(n){if(!(n instanceof ru))throw n}finally{}return null},gt.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},gt.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),r=this.p0.y+t*(this.p1.y-this.p0.y),s=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,a=Math.sqrt(s*s+o*o),l=0,u=0;if(e!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");l=e*s/a,u=e*o/a}var h=n-u,c=r+l,d=new L(h,c);return d},gt.prototype.setCoordinates=function(){if(arguments.length===1){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},gt.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||Pt.isNaN(e))&&(e=1),e},gt.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},gt.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},gt.prototype.distance=function(){if(arguments[0]instanceof gt){var t=arguments[0];return tt.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof L){var e=arguments[0];return tt.distancePointLine(e,this.p0,this.p1)}},gt.prototype.pointAlong=function(t){var e=new L;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},gt.prototype.hashCode=function(){var t=Pt.doubleToLongBits(this.p0.x);t^=Pt.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),n=Pt.doubleToLongBits(this.p1.x);n^=Pt.doubleToLongBits(this.p1.y)*31;var r=Math.trunc(n)^Math.trunc(n>>32);return e^r},gt.prototype.interfaces_=function(){return[bn,Cn]},gt.prototype.getClass=function(){return gt},gt.midPoint=function(t,e){return new L((t.x+e.x)/2,(t.y+e.y)/2)},Yw.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(gt,Yw);var wc=function(){this.tempEnv1=new ht,this.tempEnv2=new ht,this._overlapSeg1=new gt,this._overlapSeg2=new gt};wc.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},wc.prototype.interfaces_=function(){return[]},wc.prototype.getClass=function(){return wc};var Hi=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};Hi.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},Hi.prototype.computeSelect=function(t,e,n,r){var s=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(s,o),n-e===1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var a=Math.trunc((e+n)/2);e<a&&this.computeSelect(t,e,a,r),a<n&&this.computeSelect(t,a,n,r)},Hi.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),n=0,r=this._start;r<=this._end;r++)e[n++]=t._pts[r];return e},Hi.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},Hi.prototype.setId=function(t){this._id=t},Hi.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},Hi.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new ht(t,e)}return this._env},Hi.prototype.getEndIndex=function(){return this._end},Hi.prototype.getStartIndex=function(){return this._start},Hi.prototype.getContext=function(){return this._context},Hi.prototype.getId=function(){return this._id},Hi.prototype.computeOverlapsInternal=function(t,e,n,r,s,o){var a=this._pts[t],l=this._pts[e],u=n._pts[r],h=n._pts[s];if(e-t===1&&s-r===1)return o.overlap(this,t,n,r),null;if(o.tempEnv1.init(a,l),o.tempEnv2.init(u,h),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),d=Math.trunc((r+s)/2);t<c&&(r<d&&this.computeOverlapsInternal(t,c,n,r,d,o),d<s&&this.computeOverlapsInternal(t,c,n,d,s,o)),c<e&&(r<d&&this.computeOverlapsInternal(c,e,n,r,d,o),d<s&&this.computeOverlapsInternal(c,e,n,d,s,o))},Hi.prototype.interfaces_=function(){return[]},Hi.prototype.getClass=function(){return Hi};var br=function(){};br.prototype.interfaces_=function(){return[]},br.prototype.getClass=function(){return br},br.getChainStartIndices=function(t){var e=0,n=new J;n.add(new fr(e));do{var r=br.findChainEnd(t,e);n.add(new fr(r)),e=r}while(e<t.length-1);var s=br.toIntArray(n);return s},br.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var r=te.quadrant(t[n],t[n+1]),s=e+1;s<t.length;){if(!t[s-1].equals2D(t[s])){var o=te.quadrant(t[s-1],t[s]);if(o!==r)break}s++}return s-1},br.getChains=function(){if(arguments.length===1){var t=arguments[0];return br.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],n=arguments[1],r=new J,s=br.getChainStartIndices(e),o=0;o<s.length-1;o++){var a=new Hi(e,s[o],s[o+1],n);r.add(a)}return r}},br.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Jo=function(){};Jo.prototype.computeNodes=function(t){},Jo.prototype.getNodedSubstrings=function(){},Jo.prototype.interfaces_=function(){return[]},Jo.prototype.getClass=function(){return Jo};var Ec=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};Ec.prototype.setSegmentIntersector=function(t){this._segInt=t},Ec.prototype.interfaces_=function(){return[Jo]},Ec.prototype.getClass=function(){return Ec};var am=(function(i){function t(n){n?i.call(this,n):i.call(this),this._monoChains=new J,this._index=new Xw,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t;var e={SegmentOverlapAction:{configurable:!0}};return t.prototype.getMonotoneChains=function(){return this._monoChains},t.prototype.getNodedSubstrings=function(){return be.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(r){for(var s=this,o=br.getChains(r.getCoordinates(),r),a=o.iterator();a.hasNext();){var l=a.next();l.setId(s._idCounter++),s._index.insert(l.getEnvelope(),l),s._monoChains.add(l)}},t.prototype.computeNodes=function(r){var s=this;this._nodedSegStrings=r;for(var o=r.iterator();o.hasNext();)s.add(o.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var r=this,s=new Jw(this._segInt),o=this._monoChains.iterator();o.hasNext();)for(var a=o.next(),l=r._index.query(a.getEnvelope()),u=l.iterator();u.hasNext();){var h=u.next();if(h.getId()>a.getId()&&(a.computeOverlaps(h,s),r._nOverlaps++),r._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.SegmentOverlapAction.get=function(){return Jw},Object.defineProperties(t,e),t})(Ec),Jw=(function(i){function t(){i.call(this),this._si=null;var e=arguments[0];this._si=e}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],r=arguments[1],s=arguments[2],o=arguments[3],a=n.getContext(),l=s.getContext();this._si.processIntersections(a,r,l,o)}else return i.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(wc),qt=function i(){if(this._quadrantSegments=i.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=i.CAP_ROUND,this._joinStyle=i.JOIN_ROUND,this._mitreLimit=i.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=i.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(n)}else if(arguments.length===4){var r=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3];this.setQuadrantSegments(r),this.setEndCapStyle(s),this.setJoinStyle(o),this.setMitreLimit(a)}}},Ns={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};qt.prototype.getEndCapStyle=function(){return this._endCapStyle},qt.prototype.isSingleSided=function(){return this._isSingleSided},qt.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=qt.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=qt.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==qt.JOIN_ROUND&&(this._quadrantSegments=qt.DEFAULT_QUADRANT_SEGMENTS)},qt.prototype.getJoinStyle=function(){return this._joinStyle},qt.prototype.setJoinStyle=function(t){this._joinStyle=t},qt.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},qt.prototype.getSimplifyFactor=function(){return this._simplifyFactor},qt.prototype.getQuadrantSegments=function(){return this._quadrantSegments},qt.prototype.setEndCapStyle=function(t){this._endCapStyle=t},qt.prototype.getMitreLimit=function(){return this._mitreLimit},qt.prototype.setMitreLimit=function(t){this._mitreLimit=t},qt.prototype.setSingleSided=function(t){this._isSingleSided=t},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Ns.CAP_ROUND.get=function(){return 1},Ns.CAP_FLAT.get=function(){return 2},Ns.CAP_SQUARE.get=function(){return 3},Ns.JOIN_ROUND.get=function(){return 1},Ns.JOIN_MITRE.get=function(){return 2},Ns.JOIN_BEVEL.get=function(){return 3},Ns.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Ns.DEFAULT_MITRE_LIMIT.get=function(){return 5},Ns.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(qt,Ns);var ye=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=tt.COUNTERCLOCKWISE,this._inputLine=t||null},Sc={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};ye.prototype.isDeletable=function(t,e,n,r){var s=this._inputLine[t],o=this._inputLine[e],a=this._inputLine[n];return!this.isConcave(s,o,a)||!this.isShallow(s,o,a,r)?!1:this.isShallowSampled(s,o,t,n,r)},ye.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,n=this.findNextNonDeletedIndex(e),r=this.findNextNonDeletedIndex(n),s=!1;r<this._inputLine.length;){var o=!1;t.isDeletable(e,n,r,t._distanceTol)&&(t._isDeleted[n]=ye.DELETE,o=!0,s=!0),o?e=r:e=n,n=t.findNextNonDeletedIndex(e),r=t.findNextNonDeletedIndex(n)}return s},ye.prototype.isShallowConcavity=function(t,e,n,r){var s=tt.computeOrientation(t,e,n),o=s===this._angleOrientation;if(!o)return!1;var a=tt.distancePointLine(e,t,n);return a<r},ye.prototype.isShallowSampled=function(t,e,n,r,s){var o=this,a=Math.trunc((r-n)/ye.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var l=n;l<r;l+=a)if(!o.isShallow(t,e,o._inputLine[l],s))return!1;return!0},ye.prototype.isConcave=function(t,e,n){var r=tt.computeOrientation(t,e,n),s=r===this._angleOrientation;return s},ye.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=tt.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var n=!1;do n=e.deleteShallowConcavities();while(n);return this.collapseLine()},ye.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===ye.DELETE;)e++;return e},ye.prototype.isShallow=function(t,e,n,r){var s=tt.distancePointLine(e,t,n);return s<r},ye.prototype.collapseLine=function(){for(var t=this,e=new hc,n=0;n<this._inputLine.length;n++)t._isDeleted[n]!==ye.DELETE&&e.add(t._inputLine[n]);return e.toCoordinateArray()},ye.prototype.interfaces_=function(){return[]},ye.prototype.getClass=function(){return ye},ye.simplify=function(t,e){var n=new ye(t);return n.simplify(e)},Sc.INIT.get=function(){return 0},Sc.DELETE.get=function(){return 1},Sc.KEEP.get=function(){return 1},Sc.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(ye,Sc);var un=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new J},Zw={COORDINATE_ARRAY_TYPE:{configurable:!0}};un.prototype.getCoordinates=function(){var t=this._ptList.toArray(un.COORDINATE_ARRAY_TYPE);return t},un.prototype.setPrecisionModel=function(t){this._precisionModel=t},un.prototype.addPt=function(t){var e=new L(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},un.prototype.revere=function(){},un.prototype.addPts=function(t,e){var n=this;if(e)for(var r=0;r<t.length;r++)n.addPt(t[r]);else for(var s=t.length-1;s>=0;s--)n.addPt(t[s])},un.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),n=t.distance(e);return n<this._minimimVertexDistance},un.prototype.toString=function(){var t=new At,e=t.createLineString(this.getCoordinates());return e.toString()},un.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new L(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},un.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un},Zw.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(un,Zw);var kt=function(){},Wa={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt},kt.toDegrees=function(t){return t*180/Math.PI},kt.normalize=function(t){for(;t>Math.PI;)t-=kt.PI_TIMES_2;for(;t<=-Math.PI;)t+=kt.PI_TIMES_2;return t},kt.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],r=n.x-e.x,s=n.y-e.y;return Math.atan2(s,r)}},kt.isAcute=function(t,e,n){var r=t.x-e.x,s=t.y-e.y,o=n.x-e.x,a=n.y-e.y,l=r*o+s*a;return l>0},kt.isObtuse=function(t,e,n){var r=t.x-e.x,s=t.y-e.y,o=n.x-e.x,a=n.y-e.y,l=r*o+s*a;return l<0},kt.interiorAngle=function(t,e,n){var r=kt.angle(e,t),s=kt.angle(e,n);return Math.abs(s-r)},kt.normalizePositive=function(t){if(t<0){for(;t<0;)t+=kt.PI_TIMES_2;t>=kt.PI_TIMES_2&&(t=0)}else{for(;t>=kt.PI_TIMES_2;)t-=kt.PI_TIMES_2;t<0&&(t=0)}return t},kt.angleBetween=function(t,e,n){var r=kt.angle(e,t),s=kt.angle(e,n);return kt.diff(r,s)},kt.diff=function(t,e){var n=null;return t<e?n=e-t:n=t-e,n>Math.PI&&(n=2*Math.PI-n),n},kt.toRadians=function(t){return t*Math.PI/180},kt.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?kt.COUNTERCLOCKWISE:n<0?kt.CLOCKWISE:kt.NONE},kt.angleBetweenOriented=function(t,e,n){var r=kt.angle(e,t),s=kt.angle(e,n),o=s-r;return o<=-Math.PI?o+kt.PI_TIMES_2:o>Math.PI?o-kt.PI_TIMES_2:o},Wa.PI_TIMES_2.get=function(){return 2*Math.PI},Wa.PI_OVER_2.get=function(){return Math.PI/2},Wa.PI_OVER_4.get=function(){return Math.PI/4},Wa.COUNTERCLOCKWISE.get=function(){return tt.COUNTERCLOCKWISE},Wa.CLOCKWISE.get=function(){return tt.CLOCKWISE},Wa.NONE.get=function(){return tt.COLLINEAR},Object.defineProperties(kt,Wa);var he=function i(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new gt,this._seg1=new gt,this._offset0=new gt,this._offset1=new gt,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new Ho,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===qt.JOIN_ROUND&&(this._closingSegLengthFactor=i.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},bc={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};he.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=tt.computeOrientation(this._s0,this._s1,this._s2),r=n===tt.CLOCKWISE&&this._side===X.LEFT||n===tt.COUNTERCLOCKWISE&&this._side===X.RIGHT;n===0?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},he.prototype.addLineEndCap=function(t,e){var n=new gt(t,e),r=new gt;this.computeOffsetSegment(n,X.LEFT,this._distance,r);var s=new gt;this.computeOffsetSegment(n,X.RIGHT,this._distance,s);var o=e.x-t.x,a=e.y-t.y,l=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case qt.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,l+Math.PI/2,l-Math.PI/2,tt.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case qt.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(s.p1);break;case qt.CAP_SQUARE:var u=new L;u.x=Math.abs(this._distance)*Math.cos(l),u.y=Math.abs(this._distance)*Math.sin(l);var h=new L(r.p1.x+u.x,r.p1.y+u.y),c=new L(s.p1.x+u.x,s.p1.y+u.y);this._segList.addPt(h),this._segList.addPt(c);break}},he.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},he.prototype.addMitreJoin=function(t,e,n,r){var s=!0,o=null;try{o=jn.intersection(e.p0,e.p1,n.p0,n.p1);var a=r<=0?1:o.distance(t)/Math.abs(r);a>this._bufParams.getMitreLimit()&&(s=!1)}catch(l){if(l instanceof ru)o=new L(0,0),s=!1;else throw l}finally{}s?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},he.prototype.addFilletCorner=function(t,e,n,r,s){var o=e.x-t.x,a=e.y-t.y,l=Math.atan2(a,o),u=n.x-t.x,h=n.y-t.y,c=Math.atan2(h,u);r===tt.CLOCKWISE?l<=c&&(l+=2*Math.PI):l>=c&&(l-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,l,c,r,s),this._segList.addPt(n)},he.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*he.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===qt.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===qt.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},he.prototype.createSquare=function(t){this._segList.addPt(new L(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new L(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new L(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new L(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},he.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},he.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},he.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},he.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},he.prototype.addLimitedMitreJoin=function(t,e,n,r){var s=this._seg0.p1,o=kt.angle(s,this._seg0.p0),a=kt.angleBetweenOriented(this._seg0.p0,s,this._seg1.p1),l=a/2,u=kt.normalize(o+l),h=kt.normalize(u+Math.PI),c=r*n,d=c*Math.abs(Math.sin(l)),g=n-d,p=s.x+c*Math.cos(h),E=s.y+c*Math.sin(h),b=new L(p,E),P=new gt(s,b),v=P.pointAlongOffset(1,g),_=P.pointAlongOffset(1,-g);this._side===X.LEFT?(this._segList.addPt(v),this._segList.addPt(_)):(this._segList.addPt(_),this._segList.addPt(v))},he.prototype.computeOffsetSegment=function(t,e,n,r){var s=e===X.LEFT?1:-1,o=t.p1.x-t.p0.x,a=t.p1.y-t.p0.y,l=Math.sqrt(o*o+a*a),u=s*n*o/l,h=s*n*a/l;r.p0.x=t.p0.x-h,r.p0.y=t.p0.y+u,r.p1.x=t.p1.x-h,r.p1.y=t.p1.y+u},he.prototype.addFilletArc=function(t,e,n,r,s){var o=this,a=r===tt.CLOCKWISE?-1:1,l=Math.abs(e-n),u=Math.trunc(l/this._filletAngleQuantum+.5);if(u<1)return null;for(var h=0,c=l/u,d=h,g=new L;d<l;){var p=e+a*d;g.x=t.x+s*Math.cos(p),g.y=t.y+s*Math.sin(p),o._segList.addPt(g),d+=c}},he.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*he.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new L((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var r=new L((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},he.prototype.createCircle=function(t){var e=new L(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},he.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},he.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new un,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*he.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},he.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===qt.JOIN_BEVEL||this._bufParams.getJoinStyle()===qt.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,tt.CLOCKWISE,this._distance))},he.prototype.closeRing=function(){this._segList.closeRing()},he.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},he.prototype.interfaces_=function(){return[]},he.prototype.getClass=function(){return he},bc.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},bc.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},bc.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},bc.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(he,bc);var Ri=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Ri.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var n=e<0,r=Math.abs(e),s=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],s):this.computeOffsetCurve(t,n,s);var o=s.getCoordinates();return n&&Rt.reverse(o),o},Ri.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var s=ye.simplify(t,-r),o=s.length-1;n.initSideSegments(s[o],s[o-1],X.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(s[a],!0)}else{n.addSegments(t,!1);var l=ye.simplify(t,r),u=l.length-1;n.initSideSegments(l[0],l[1],X.LEFT),n.addFirstSegment();for(var h=2;h<=u;h++)n.addNextSegment(l[h],!0)}n.addLastSegment(),n.closeRing()},Ri.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===X.RIGHT&&(r=-r);var s=ye.simplify(t,r),o=s.length-1;n.initSideSegments(s[o-1],s[0],e);for(var a=1;a<=o;a++){var l=a!==1;n.addNextSegment(s[a],l)}n.closeRing()},Ri.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=ye.simplify(t,n),s=r.length-1;e.initSideSegments(r[0],r[1],X.LEFT);for(var o=2;o<=s;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[s-1],r[s]);var a=ye.simplify(t,-n),l=a.length-1;e.initSideSegments(a[l],a[l-1],X.LEFT);for(var u=l-2;u>=0;u--)e.addNextSegment(a[u],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},Ri.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case qt.CAP_ROUND:e.createCircle(t);break;case qt.CAP_SQUARE:e.createSquare(t);break}},Ri.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var s=e<0;this.computeSingleSidedBufferCurve(t,s,r)}else this.computeLineBufferCurve(t,r);var o=r.getCoordinates();return o},Ri.prototype.getBufferParameters=function(){return this._bufParams},Ri.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Ri.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(n===0)return Ri.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Ri.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var s=ye.simplify(t,-r),o=s.length-1;n.initSideSegments(s[o],s[o-1],X.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(s[a],!0)}else{var l=ye.simplify(t,r),u=l.length-1;n.initSideSegments(l[0],l[1],X.LEFT),n.addFirstSegment();for(var h=2;h<=u;h++)n.addNextSegment(l[h],!0)}n.addLastSegment()},Ri.prototype.getSegGen=function(t){return new he(this._precisionModel,this._bufParams,t)},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new L(t[n]);return e};var Ha=function(){this._subgraphs=null,this._seg=new gt,this._cga=new tt;var t=arguments[0];this._subgraphs=t},Kw={DepthSegment:{configurable:!0}};Ha.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=new J,r=this._subgraphs.iterator();r.hasNext();){var s=r.next(),o=s.getEnvelope();e.y<o.getMinY()||e.y>o.getMaxY()||t.findStabbedSegments(e,s.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(St(arguments[2],zn)&&arguments[0]instanceof L&&arguments[1]instanceof om)for(var a=arguments[0],l=arguments[1],u=arguments[2],h=l.getEdge().getCoordinates(),c=0;c<h.length-1;c++){t._seg.p0=h[c],t._seg.p1=h[c+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var d=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(d<a.x)&&!t._seg.isHorizontal()&&!(a.y<t._seg.p0.y||a.y>t._seg.p1.y)&&tt.computeOrientation(t._seg.p0,t._seg.p1,a)!==tt.RIGHT){var g=l.getDepth(X.LEFT);t._seg.p0.equals(h[c])||(g=l.getDepth(X.RIGHT));var p=new Zo(t._seg,g);u.add(p)}}else if(St(arguments[2],zn)&&arguments[0]instanceof L&&St(arguments[1],zn))for(var E=arguments[0],b=arguments[1],P=arguments[2],v=b.iterator();v.hasNext();){var _=v.next();_.isForward()&&t.findStabbedSegments(E,_,P)}}},Ha.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var n=Wn.min(e);return n._leftDepth},Ha.prototype.interfaces_=function(){return[]},Ha.prototype.getClass=function(){return Ha},Kw.DepthSegment.get=function(){return Zo},Object.defineProperties(Ha,Kw);var Zo=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new gt(t),this._leftDepth=e};Zo.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return n!==0||(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(e._upwardSeg)},Zo.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return n!==0?n:t.p1.compareTo(e.p1)},Zo.prototype.toString=function(){return this._upwardSeg.toString()},Zo.prototype.interfaces_=function(){return[bn]},Zo.prototype.getClass=function(){return Zo};var Wt=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Wt.prototype.area=function(){return Wt.area(this.p0,this.p1,this.p2)},Wt.prototype.signedArea=function(){return Wt.signedArea(this.p0,this.p1,this.p2)},Wt.prototype.interpolateZ=function(t){if(t===null)throw new de("Supplied point is null.");return Wt.interpolateZ(t,this.p0,this.p1,this.p2)},Wt.prototype.longestSideLength=function(){return Wt.longestSideLength(this.p0,this.p1,this.p2)},Wt.prototype.isAcute=function(){return Wt.isAcute(this.p0,this.p1,this.p2)},Wt.prototype.circumcentre=function(){return Wt.circumcentre(this.p0,this.p1,this.p2)},Wt.prototype.area3D=function(){return Wt.area3D(this.p0,this.p1,this.p2)},Wt.prototype.centroid=function(){return Wt.centroid(this.p0,this.p1,this.p2)},Wt.prototype.inCentre=function(){return Wt.inCentre(this.p0,this.p1,this.p2)},Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},Wt.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Wt.det=function(t,e,n,r){return t*r-e*n},Wt.interpolateZ=function(t,e,n,r){var s=e.x,o=e.y,a=n.x-s,l=r.x-s,u=n.y-o,h=r.y-o,c=a*h-l*u,d=t.x-s,g=t.y-o,p=(h*d-l*g)/c,E=(-u*d+a*g)/c,b=e.z+p*(n.z-e.z)+E*(r.z-e.z);return b},Wt.longestSideLength=function(t,e,n){var r=t.distance(e),s=e.distance(n),o=n.distance(t),a=r;return s>a&&(a=s),o>a&&(a=o),a},Wt.isAcute=function(t,e,n){return!(!kt.isAcute(t,e,n)||!kt.isAcute(e,n,t)||!kt.isAcute(n,t,e))},Wt.circumcentre=function(t,e,n){var r=n.x,s=n.y,o=t.x-r,a=t.y-s,l=e.x-r,u=e.y-s,h=2*Wt.det(o,a,l,u),c=Wt.det(a,o*o+a*a,u,l*l+u*u),d=Wt.det(o,o*o+a*a,l,l*l+u*u),g=r-c/h,p=s+d/h;return new L(g,p)},Wt.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,s=new jn(t.x+n/2,t.y+r/2,1),o=new jn(t.x-r+n/2,t.y+n+r/2,1);return new jn(s,o)},Wt.angleBisector=function(t,e,n){var r=e.distance(t),s=e.distance(n),o=r/(r+s),a=n.x-t.x,l=n.y-t.y,u=new L(t.x+o*a,t.y+o*l);return u},Wt.area3D=function(t,e,n){var r=e.x-t.x,s=e.y-t.y,o=e.z-t.z,a=n.x-t.x,l=n.y-t.y,u=n.z-t.z,h=s*u-o*l,c=o*a-r*u,d=r*l-s*a,g=h*h+c*c+d*d,p=Math.sqrt(g)/2;return p},Wt.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,s=(t.y+e.y+n.y)/3;return new L(r,s)},Wt.inCentre=function(t,e,n){var r=e.distance(n),s=t.distance(n),o=t.distance(e),a=r+s+o,l=(r*t.x+s*e.x+o*n.x)/a,u=(r*t.y+s*e.y+o*n.y)/a;return new L(l,u)};var Tn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new J;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Tn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,k.EXTERIOR,k.INTERIOR)},Tn.prototype.addPolygon=function(t){var e=this,n=this._distance,r=X.LEFT;this._distance<0&&(n=-this._distance,r=X.RIGHT);var s=t.getExteriorRing(),o=Rt.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,n,r,k.EXTERIOR,k.INTERIOR);for(var a=0;a<t.getNumInteriorRing();a++){var l=t.getInteriorRingN(a),u=Rt.removeRepeatedPoints(l.getCoordinates());e._distance>0&&e.isErodedCompletely(l,-e._distance)||e.addPolygonRing(u,n,X.opposite(r),k.INTERIOR,k.EXTERIOR)}},Tn.prototype.isTriangleErodedCompletely=function(t,e){var n=new Wt(t[0],t[1],t[2]),r=n.inCentre(),s=tt.distancePointLine(r,n.p0,n.p1);return s<Math.abs(e)},Tn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Rt.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,k.EXTERIOR,k.INTERIOR)},Tn.prototype.addCurve=function(t,e,n){if(t===null||t.length<2)return null;var r=new be(t,new Yt(0,k.BOUNDARY,e,n));this._curveList.add(r)},Tn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Tn.prototype.addPolygonRing=function(t,e,n,r,s){if(e===0&&t.length<Ur.MINIMUM_VALID_SIZE)return null;var o=r,a=s;t.length>=Ur.MINIMUM_VALID_SIZE&&tt.isCCW(t)&&(o=s,a=r,n=X.opposite(n));var l=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(l,o,a)},Tn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Re?this.addPolygon(t):t instanceof ve?this.addLineString(t):t instanceof qi?this.addPoint(t):t instanceof fu?this.addCollection(t):t instanceof Yo?this.addCollection(t):t instanceof qr?this.addCollection(t):t instanceof wi&&this.addCollection(t)},Tn.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(n.length===4)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),s=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>s},Tn.prototype.addCollection=function(t){for(var e=this,n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);e.add(r)}},Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn};var vu=function(){};vu.prototype.locate=function(t){},vu.prototype.interfaces_=function(){return[]},vu.prototype.getClass=function(){return vu};var Xr=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};Xr.prototype.next=function(){if(this._atStart)return this._atStart=!1,Xr.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new cu;var t=this._parent.getGeometryN(this._index++);return t instanceof wi?(this._subcollectionIterator=new Xr(t),this._subcollectionIterator.next()):t},Xr.prototype.remove=function(){throw new Error(this.getClass().getName())},Xr.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Xr.prototype.interfaces_=function(){return[hu]},Xr.prototype.getClass=function(){return Xr},Xr.isAtomic=function(t){return!(t instanceof wi)};var hn=function(){this._geom=null;var t=arguments[0];this._geom=t};hn.prototype.locate=function(t){return hn.locate(t,this._geom)},hn.prototype.interfaces_=function(){return[vu]},hn.prototype.getClass=function(){return hn},hn.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?tt.isPointInRing(t,e.getCoordinates()):!1},hn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!hn.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var s=e.getInteriorRingN(r);if(hn.isPointInRing(t,s))return!1}return!0},hn.containsPoint=function(t,e){if(e instanceof Re)return hn.containsPointInPolygon(t,e);if(e instanceof wi)for(var n=new Xr(e);n.hasNext();){var r=n.next();if(r!==e&&hn.containsPoint(t,r))return!0}return!1},hn.locate=function(t,e){return e.isEmpty()?k.EXTERIOR:hn.containsPoint(t,e)?k.INTERIOR:k.EXTERIOR};var pi=function(){this._edgeMap=new fi,this._edgeList=null,this._ptInAreaLocation=[k.NONE,k.NONE]};pi.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return e===0&&(n=this._edgeList.size()-1),this._edgeList.get(n)},pi.prototype.propagateSideLabels=function(t){for(var e=k.NONE,n=this.iterator();n.hasNext();){var r=n.next(),s=r.getLabel();s.isArea(t)&&s.getLocation(t,X.LEFT)!==k.NONE&&(e=s.getLocation(t,X.LEFT))}if(e===k.NONE)return null;for(var o=e,a=this.iterator();a.hasNext();){var l=a.next(),u=l.getLabel();if(u.getLocation(t,X.ON)===k.NONE&&u.setLocation(t,X.ON,o),u.isArea(t)){var h=u.getLocation(t,X.LEFT),c=u.getLocation(t,X.RIGHT);if(c!==k.NONE){if(c!==o)throw new Ms("side location conflict",l.getCoordinate());h===k.NONE&&Tt.shouldNeverReachHere("found single null side (at "+l.getCoordinate()+")"),o=h}else Tt.isTrue(u.getLocation(t,X.LEFT)===k.NONE,"found single null side"),u.setLocation(t,X.RIGHT,o),u.setLocation(t,X.LEFT,o)}}},pi.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},pi.prototype.print=function(t){ii.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},pi.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},pi.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel(),s=r.getLocation(t,X.LEFT);Tt.isTrue(s!==k.NONE,"Found unlabelled area edge");for(var o=s,a=this.iterator();a.hasNext();){var l=a.next(),u=l.getLabel();Tt.isTrue(u.isArea(t),"Found non-area edge");var h=u.getLocation(t,X.LEFT),c=u.getLocation(t,X.RIGHT);if(h===c||c!==o)return!1;o=h}return!0},pi.prototype.findIndex=function(t){var e=this;this.iterator();for(var n=0;n<this._edgeList.size();n++){var r=e._edgeList.get(n);if(r===t)return n}return-1},pi.prototype.iterator=function(){return this.getEdges().iterator()},pi.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new J(this._edgeMap.values())),this._edgeList},pi.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===k.NONE&&(this._ptInAreaLocation[t]=hn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},pi.prototype.toString=function(){var t=new dr;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
47
47
  `);for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append(`
48
- `)}return t.toString()},pi.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.computeLabel(t)}},pi.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var n=[!1,!1],r=this.iterator();r.hasNext();)for(var s=r.next(),o=s.getLabel(),a=0;a<2;a++)o.isLine(a)&&o.getLocation(a)===k.BOUNDARY&&(n[a]=!0);for(var l=this.iterator();l.hasNext();)for(var u=l.next(),h=u.getLabel(),c=0;c<2;c++)if(h.isAnyNull(c)){var d=k.NONE;if(n[c])d=k.EXTERIOR;else{var g=u.getCoordinate();d=e.getLocation(c,g,t)}h.setAllLocationsIfNull(c,d)}},pi.prototype.getDegree=function(){return this._edgeMap.size()},pi.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},pi.prototype.interfaces_=function(){return[]},pi.prototype.getClass=function(){return pi};var XN=(function(i){function t(){i.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var n=this;this.getResultAreaEdges();for(var r=null,s=null,o=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var l=n._resultAreaEdgeList.get(a),u=l.getSym();if(l.getLabel().isArea())switch(r===null&&l.isInResult()&&(r=l),o){case n._SCANNING_FOR_INCOMING:if(!u.isInResult())continue;s=u,o=n._LINKING_TO_OUTGOING;break;case n._LINKING_TO_OUTGOING:if(!l.isInResult())continue;s.setNext(l),o=n._SCANNING_FOR_INCOMING;break}}if(o===this._LINKING_TO_OUTGOING){if(r===null)throw new Ms("no outgoing dirEdge found",this.getCoordinate());Tt.isTrue(r.isInResult(),"unable to link last incoming dirEdge"),s.setNext(r)}},t.prototype.insert=function(n){var r=n;this.insertEdgeEnd(r,r)},t.prototype.getRightmostEdge=function(){var n=this.getEdges(),r=n.size();if(r<1)return null;var s=n.get(0);if(r===1)return s;var o=n.get(r-1),a=s.getQuadrant(),l=o.getQuadrant();return te.isNorthern(a)&&te.isNorthern(l)?s:!te.isNorthern(a)&&!te.isNorthern(l)?o:s.getDy()!==0?s:o.getDy()!==0?o:(Tt.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(n){ii.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var r=this.iterator();r.hasNext();){var s=r.next();n.print("out "),s.print(n),n.println(),n.print("in "),s.getSym().print(n),n.println()}},t.prototype.getResultAreaEdges=function(){var n=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new J;for(var r=this.iterator();r.hasNext();){var s=r.next();(s.isInResult()||s.getSym().isInResult())&&n._resultAreaEdgeList.add(s)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(n){for(var r=this.iterator();r.hasNext();){var s=r.next(),o=s.getLabel();o.setAllLocationsIfNull(0,n.getLocation(0)),o.setAllLocationsIfNull(1,n.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var n=this;this.getEdges();for(var r=null,s=null,o=this._edgeList.size()-1;o>=0;o--){var a=n._edgeList.get(o),l=a.getSym();s===null&&(s=l),r!==null&&l.setNext(r),r=a}s.setNext(r)},t.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var r=arguments[0],s=this.findIndex(r),o=r.getDepth(H.LEFT),a=r.getDepth(H.RIGHT),l=this.computeDepths(s+1,this._edgeList.size(),o),u=this.computeDepths(0,s,l);if(u!==a)throw new Ms("depth mismatch at "+r.getCoordinate())}else if(arguments.length===3){for(var h=arguments[0],c=arguments[1],d=arguments[2],g=d,p=h;p<c;p++){var E=n._edgeList.get(p);E.setEdgeDepths(H.RIGHT,g),g=E.getDepth(H.LEFT)}return g}},t.prototype.mergeSymLabels=function(){for(var n=this.iterator();n.hasNext();){var r=n.next(),s=r.getLabel();s.merge(r.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(n){for(var r=this,s=null,o=null,a=this._SCANNING_FOR_INCOMING,l=this._resultAreaEdgeList.size()-1;l>=0;l--){var u=r._resultAreaEdgeList.get(l),h=u.getSym();switch(s===null&&u.getEdgeRing()===n&&(s=u),a){case r._SCANNING_FOR_INCOMING:if(h.getEdgeRing()!==n)continue;o=h,a=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(u.getEdgeRing()!==n)continue;o.setNextMin(u),a=r._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(Tt.isTrue(s!==null,"found null for first outgoing dirEdge"),Tt.isTrue(s.getEdgeRing()===n,"unable to link last incoming dirEdge"),o.setNextMin(s))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,r=this.iterator();r.hasNext();){var s=r.next();s.isInResult()&&n++}return n}else if(arguments.length===1){for(var o=arguments[0],a=0,l=this.iterator();l.hasNext();){var u=l.next();u.getEdgeRing()===o&&a++}return a}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var n=k.NONE,r=this.iterator();r.hasNext();){var s=r.next(),o=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){n=k.INTERIOR;break}if(o.isInResult()){n=k.EXTERIOR;break}}}if(n===k.NONE)return null;for(var a=n,l=this.iterator();l.hasNext();){var u=l.next(),h=u.getSym();u.isLineEdge()?u.getEdge().setCovered(a===k.INTERIOR):(u.isInResult()&&(a=k.EXTERIOR),h.isInResult()&&(a=k.INTERIOR))}},t.prototype.computeLabelling=function(n){var r=this;i.prototype.computeLabelling.call(this,n),this._label=new Yt(k.NONE);for(var s=this.iterator();s.hasNext();)for(var o=s.next(),a=o.getEdge(),l=a.getLabel(),u=0;u<2;u++){var h=l.getLocation(u);(h===k.INTERIOR||h===k.BOUNDARY)&&r._label.setLocation(u,k.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(pi),Qw=(function(i){function t(){i.apply(this,arguments)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.createNode=function(n){return new cf(n,new XN)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(gu),ho=function i(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=i.orientation(t)};ho.prototype.compareTo=function(t){var e=t,n=ho.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return n},ho.prototype.interfaces_=function(){return[bn]},ho.prototype.getClass=function(){return ho},ho.orientation=function(t){return Rt.increasingDirection(t)===1},ho.compareOriented=function(t,e,n,r){for(var s=e?1:-1,o=r?1:-1,a=e?t.length:-1,l=r?n.length:-1,u=e?0:t.length-1,h=r?0:n.length-1;;){var c=t[u].compareTo(n[h]);if(c!==0)return c;u+=s,h+=o;var d=u===a,g=h===l;if(d&&!g)return-1;if(!d&&g)return 1;if(d&&g)return 0}};var Hn=function(){this._edges=new J,this._ocaMap=new fi};Hn.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var n=0;n<this._edges.size();n++){var r=e._edges.get(n);n>0&&t.print(","),t.print("(");for(var s=r.getCoordinates(),o=0;o<s.length;o++)o>0&&t.print(","),t.print(s[o].x+" "+s[o].y);t.println(")")}t.print(") ")},Hn.prototype.addAll=function(t){for(var e=this,n=t.iterator();n.hasNext();)e.add(n.next())},Hn.prototype.findEdgeIndex=function(t){for(var e=this,n=0;n<this._edges.size();n++)if(e._edges.get(n).equals(t))return n;return-1},Hn.prototype.iterator=function(){return this._edges.iterator()},Hn.prototype.getEdges=function(){return this._edges},Hn.prototype.get=function(t){return this._edges.get(t)},Hn.prototype.findEqualEdge=function(t){var e=new ho(t.getCoordinates()),n=this._ocaMap.get(e);return n},Hn.prototype.add=function(t){this._edges.add(t);var e=new ho(t.getCoordinates());this._ocaMap.put(e,t)},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var Ko=function(){};Ko.prototype.processIntersections=function(t,e,n,r){},Ko.prototype.isDone=function(){},Ko.prototype.interfaces_=function(){return[]},Ko.prototype.getClass=function(){return Ko};var cn=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};cn.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&this._li.getIntersectionNum()===1){if(cn.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var s=t.size()-1;if(e===0&&r===s||r===0&&e===s)return!0}}return!1},cn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},cn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},cn.prototype.getLineIntersector=function(){return this._li},cn.prototype.hasProperIntersection=function(){return this._hasProper},cn.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var s=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],l=n.getCoordinates()[r+1];this._li.computeIntersection(s,o,a,l),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},cn.prototype.hasIntersection=function(){return this._hasIntersection},cn.prototype.isDone=function(){return!1},cn.prototype.hasInteriorIntersection=function(){return this._hasInterior},cn.prototype.interfaces_=function(){return[Ko]},cn.prototype.getClass=function(){return cn},cn.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var Cr=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new L(t),this.segmentIndex=e,this.dist=n};Cr.prototype.getSegmentIndex=function(){return this.segmentIndex},Cr.prototype.getCoordinate=function(){return this.coord},Cr.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Cr.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Cr.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},Cr.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Cr.prototype.getDistance=function(){return this.dist},Cr.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Cr.prototype.interfaces_=function(){return[bn]},Cr.prototype.getClass=function(){return Cr};var $r=function(){this._nodeMap=new fi,this.edge=null;var t=arguments[0];this.edge=t};$r.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},$r.prototype.iterator=function(){return this._nodeMap.values().iterator()},$r.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var n=this.iterator(),r=n.next();n.hasNext();){var s=n.next(),o=e.createSplitEdge(r,s);t.add(o),r=s}},$r.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},$r.prototype.createSplitEdge=function(t,e){var n=this,r=e.segmentIndex-t.segmentIndex+2,s=this.edge.pts[e.segmentIndex],o=e.dist>0||!e.coord.equals2D(s);o||r--;var a=new Array(r).fill(null),l=0;a[l++]=new L(t.coord);for(var u=t.segmentIndex+1;u<=e.segmentIndex;u++)a[l++]=n.edge.pts[u];return o&&(a[l]=e.coord),new ff(a,new Yt(this.edge._label))},$r.prototype.add=function(t,e,n){var r=new Cr(t,e,n),s=this._nodeMap.get(r);return s!==null?s:(this._nodeMap.put(r,r),r)},$r.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();if(n.coord.equals(t))return!0}return!1},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r};var Qo=function(){};Qo.prototype.getChainStartIndices=function(t){var e=this,n=0,r=new J;r.add(new fr(n));do{var s=e.findChainEnd(t,n);r.add(new fr(s)),n=s}while(n<t.length-1);var o=Qo.toIntArray(r);return o},Qo.prototype.findChainEnd=function(t,e){for(var n=te.quadrant(t[e],t[e+1]),r=e+1;r<t.length;){var s=te.quadrant(t[r-1],t[r]);if(s!==n)break;r++}return r-1},Qo.prototype.interfaces_=function(){return[]},Qo.prototype.getClass=function(){return Qo},Qo.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Os=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new ht,this.env2=new ht;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Qo;this.startIndex=e.getChainStartIndices(this.pts)};Os.prototype.getCoordinates=function(){return this.pts},Os.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},Os.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},Os.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],r)}else if(arguments.length===6){var s=arguments[0],o=arguments[1],a=arguments[2],l=arguments[3],u=arguments[4],h=arguments[5],c=this.pts[s],d=this.pts[o],g=a.pts[l],p=a.pts[u];if(o-s===1&&u-l===1)return h.addIntersections(this.e,s,a.e,l),null;if(this.env1.init(c,d),this.env2.init(g,p),!this.env1.intersects(this.env2))return null;var E=Math.trunc((s+o)/2),b=Math.trunc((l+u)/2);s<E&&(l<b&&this.computeIntersectsForChain(s,E,a,l,b,h),b<u&&this.computeIntersectsForChain(s,E,a,b,u,h)),E<o&&(l<b&&this.computeIntersectsForChain(E,o,a,l,b,h),b<u&&this.computeIntersectsForChain(E,o,a,b,u,h))}},Os.prototype.getStartIndexes=function(){return this.startIndex},Os.prototype.computeIntersects=function(t,e){for(var n=this,r=0;r<this.startIndex.length-1;r++)for(var s=0;s<t.startIndex.length-1;s++)n.computeIntersectsForChain(r,t,s,e)},Os.prototype.interfaces_=function(){return[]},Os.prototype.getClass=function(){return Os};var ni=function i(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var n=0;n<3;n++)t._depth[e][n]=i.NULL_VALUE},t1={NULL_VALUE:{configurable:!0}};ni.prototype.getDepth=function(t,e){return this._depth[t][e]},ni.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},ni.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var n=0;n<3;n++)if(t._depth[e][n]!==ni.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var r=arguments[0];return this._depth[r][1]===ni.NULL_VALUE}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._depth[s][o]===ni.NULL_VALUE}},ni.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var n=t._depth[e][1];t._depth[e][2]<n&&(n=t._depth[e][2]),n<0&&(n=0);for(var r=1;r<3;r++){var s=0;t._depth[e][r]>n&&(s=1),t._depth[e][r]=s}}},ni.prototype.getDelta=function(t){return this._depth[t][H.RIGHT]-this._depth[t][H.LEFT]},ni.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?k.EXTERIOR:k.INTERIOR},ni.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},ni.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],n=0;n<2;n++)for(var r=1;r<3;r++){var s=e.getLocation(n,r);(s===k.EXTERIOR||s===k.INTERIOR)&&(t.isNull(n,r)?t._depth[n][r]=ni.depthAtLocation(s):t._depth[n][r]+=ni.depthAtLocation(s))}else if(arguments.length===3){var o=arguments[0],a=arguments[1],l=arguments[2];l===k.INTERIOR&&this._depth[o][a]++}},ni.prototype.interfaces_=function(){return[]},ni.prototype.getClass=function(){return ni},ni.depthAtLocation=function(t){return t===k.EXTERIOR?0:t===k.INTERIOR?1:ni.NULL_VALUE},t1.NULL_VALUE.get=function(){return-1},Object.defineProperties(ni,t1);var ff=(function(i){function t(){if(i.call(this),this.pts=null,this._env=null,this.eiList=new $r(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new ni,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.pts=n,this._label=r}}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var r=new t(n,Yt.toLineLabel(this._label));return r},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(n){this._isIsolated=n},t.prototype.setName=function(n){this._name=n},t.prototype.equals=function(n){var r=this;if(!(n instanceof t))return!1;var s=n;if(this.pts.length!==s.pts.length)return!1;for(var o=!0,a=!0,l=this.pts.length,u=0;u<this.pts.length;u++)if(r.pts[u].equals2D(s.pts[u])||(o=!1),r.pts[u].equals2D(s.pts[--l])||(a=!1),!o&&!a)return!1;return!0},t.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},t.prototype.print=function(n){var r=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&n.print(","),n.print(r.pts[s].x+" "+r.pts[s].y);n.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(n){t.updateIM(this._label,n)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(n){var r=this;n.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)n.print(r.pts[s]+" ");n.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Os(this)),this._mce},t.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new ht;for(var r=0;r<this.pts.length;r++)n._env.expandToInclude(n.pts[r])}return this._env},t.prototype.addIntersection=function(n,r,s,o){var a=new L(n.getIntersection(o)),l=r,u=n.getEdgeDistance(s,o),h=l+1;if(h<this.pts.length){var c=this.pts[h];a.equals2D(c)&&(l=h,u=0)}this.eiList.add(a,l,u)},t.prototype.toString=function(){var n=this,r=new dr;r.append("edge "+this._name+": "),r.append("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&r.append(","),r.append(n.pts[s].x+" "+n.pts[s].y);return r.append(") "+this._label+" "+this._depthDelta),r.toString()},t.prototype.isPointwiseEqual=function(n){var r=this;if(this.pts.length!==n.pts.length)return!1;for(var s=0;s<this.pts.length;s++)if(!r.pts[s].equals2D(n.pts[s]))return!1;return!0},t.prototype.setDepthDelta=function(n){this._depthDelta=n},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(n,r,s){for(var o=this,a=0;a<n.getIntersectionNum();a++)o.addIntersection(n,r,s,a)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1];r.setAtLeastIfValid(n.getLocation(0,H.ON),n.getLocation(1,H.ON),1),n.isArea()&&(r.setAtLeastIfValid(n.getLocation(0,H.LEFT),n.getLocation(1,H.LEFT),2),r.setAtLeastIfValid(n.getLocation(0,H.RIGHT),n.getLocation(1,H.RIGHT),2))}else return i.prototype.updateIM.apply(this,arguments)},t})(ln),bi=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Hn,this._bufParams=t||null};bi.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},bi.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Yt(t.getLabel()),r.flip()),n.merge(r);var s=bi.depthDelta(r),o=e.getDepthDelta(),a=o+s;e.setDepthDelta(a)}else this._edgeList.add(t),t.setDepthDelta(bi.depthDelta(t.getLabel()))},bi.prototype.buildSubgraphs=function(t,e){for(var n=new J,r=t.iterator();r.hasNext();){var s=r.next(),o=s.getRightmostCoordinate(),a=new Ha(n),l=a.getDepth(o);s.computeDepth(l),s.findResultEdges(),n.add(s),e.add(s.getDirectedEdges(),s.getNodes())}},bi.prototype.createSubgraphs=function(t){for(var e=new J,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var s=new Ei;s.create(r),e.add(s)}}return Wn.sort(e,Wn.reverseOrder()),e},bi.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},bi.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new am,n=new Ho;return n.setPrecisionModel(t),e.setSegmentIntersector(new cn(n)),e},bi.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;n===null&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new Ri(n,this._bufParams),s=new Tn(t,e,r),o=s.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,n),this._graph=new pe(new Qw),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),l=new Wi(this._geomFact);this.buildSubgraphs(a,l);var u=l.getPolygons();if(u.size()<=0)return this.createEmptyResultGeometry();var h=this._geomFact.buildGeometry(u);return h},bi.prototype.computeNodedEdges=function(t,e){var n=this,r=this.getNoder(e);r.computeNodes(t);for(var s=r.getNodedSubstrings(),o=s.iterator();o.hasNext();){var a=o.next(),l=a.getCoordinates();if(!(l.length===2&&l[0].equals2D(l[1]))){var u=a.getData(),h=new ff(a.getCoordinates(),new Yt(u));n.insertUniqueEdge(h)}}},bi.prototype.setNoder=function(t){this._workingNoder=t},bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return bi},bi.depthDelta=function(t){var e=t.getLocation(0,H.LEFT),n=t.getLocation(0,H.RIGHT);return e===k.INTERIOR&&n===k.EXTERIOR?1:e===k.EXTERIOR&&n===k.INTERIOR?-1:0},bi.convertSegStrings=function(t){for(var e=new At,n=new J;t.hasNext();){var r=t.next(),s=e.createLineString(r.getCoordinates());n.add(s)}return e.buildGeometry(n)};var co=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var n=arguments[0],r=arguments[1],s=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=s,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};co.prototype.rescale=function(){var t=this;if(St(arguments[0],De))for(var e=arguments[0],n=e.iterator();n.hasNext();){var r=n.next();t.rescale(r.getCoordinates())}else if(arguments[0]instanceof Array){for(var s=arguments[0],o=0;o<s.length;o++)s[o].x=s[o].x/t._scaleFactor+t._offsetX,s[o].y=s[o].y/t._scaleFactor+t._offsetY;s.length===2&&s[0].equals2D(s[1])&&ii.out.println(s)}},co.prototype.scale=function(){var t=this;if(St(arguments[0],De)){for(var e=arguments[0],n=new J,r=e.iterator();r.hasNext();){var s=r.next();n.add(new be(t.scale(s.getCoordinates()),s.getData()))}return n}else if(arguments[0]instanceof Array){for(var o=arguments[0],a=new Array(o.length).fill(null),l=0;l<o.length;l++)a[l]=new L(Math.round((o[l].x-t._offsetX)*t._scaleFactor),Math.round((o[l].y-t._offsetY)*t._scaleFactor),o[l].z);var u=Rt.removeRepeatedPoints(a);return u}},co.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},co.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},co.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},co.prototype.interfaces_=function(){return[Jo]},co.prototype.getClass=function(){return co};var Pr=function(){this._li=new Ho,this._segStrings=null;var t=arguments[0];this._segStrings=t},e1={fact:{configurable:!0}};Pr.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next(),r=n.getCoordinates();t.checkEndPtVertexIntersections(r[0],t._segStrings),t.checkEndPtVertexIntersections(r[r.length-1],t._segStrings)}else if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=o.iterator();a.hasNext();)for(var l=a.next(),u=l.getCoordinates(),h=1;h<u.length-1;h++)if(u[h].equals(s))throw new Ss("found endpt/interior pt intersection at index "+h+" :pt "+s)}},Pr.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var n=e.next(),r=this._segStrings.iterator();r.hasNext();){var s=r.next();t.checkInteriorIntersections(n,s)}else if(arguments.length===2)for(var o=arguments[0],a=arguments[1],l=o.getCoordinates(),u=a.getCoordinates(),h=0;h<l.length-1;h++)for(var c=0;c<u.length-1;c++)t.checkInteriorIntersections(o,h,a,c);else if(arguments.length===4){var d=arguments[0],g=arguments[1],p=arguments[2],E=arguments[3];if(d===p&&g===E)return null;var b=d.getCoordinates()[g],P=d.getCoordinates()[g+1],v=p.getCoordinates()[E],_=p.getCoordinates()[E+1];if(this._li.computeIntersection(b,P,v,_),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,b,P)||this.hasInteriorIntersection(this._li,v,_)))throw new Ss("found non-noded intersection at "+b+"-"+P+" and "+v+"-"+_)}},Pr.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Pr.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next();t.checkCollapses(n)}else if(arguments.length===1)for(var r=arguments[0],s=r.getCoordinates(),o=0;o<s.length-2;o++)t.checkCollapse(s[o],s[o+1],s[o+2])},Pr.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var s=t.getIntersection(r);if(!(s.equals(e)||s.equals(n)))return!0}return!1},Pr.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Ss("found non-noded collapse at "+Pr.fact.createLineString([t,e,n]))},Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr},e1.fact.get=function(){return new At},Object.defineProperties(Pr,e1);var Ai=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new de("Scale factor must be non-zero");e!==1&&(this._pt=new L(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new L,this._p1Scaled=new L),this.initCorners(this._pt)},i1={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};Ai.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),s=Math.min(t.y,e.y),o=Math.max(t.y,e.y),a=this._maxx<n||this._minx>r||this._maxy<s||this._miny>o;if(a)return!1;var l=this.intersectsToleranceSquare(t,e);return Tt.isTrue(!(a&&l),"Found bad envelope test"),l},Ai.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new L(this._maxx,this._maxy),this._corner[1]=new L(this._minx,this._maxy),this._corner[2]=new L(this._minx,this._miny),this._corner[3]=new L(this._maxx,this._miny)},Ai.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},Ai.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},Ai.prototype.getCoordinate=function(){return this._originalPt},Ai.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},Ai.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=Ai.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new ht(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},Ai.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))},Ai.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||n&&r||t.equals(this._pt)||e.equals(this._pt))},Ai.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return this.intersects(n,r)?(t.addIntersection(this.getCoordinate(),e),!0):!1},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai},i1.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(Ai,i1);var Cc=function(){this.tempEnv1=new ht,this.selectedSegment=new gt};Cc.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}},Cc.prototype.interfaces_=function(){return[]},Cc.prototype.getClass=function(){return Cc};var yu=function(){this._index=null;var t=arguments[0];this._index=t},n1={HotPixelSnapAction:{configurable:!0}};yu.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],n=arguments[1],r=arguments[2],s=e.getSafeEnvelope(),o=new r1(e,n,r);return this._index.query(s,{interfaces_:function(){return[lo]},visitItem:function(a){var l=a;l.select(s,o)}}),o.isNodeAdded()}},yu.prototype.interfaces_=function(){return[]},yu.prototype.getClass=function(){return yu},n1.HotPixelSnapAction.get=function(){return r1},Object.defineProperties(yu,n1);var r1=(function(i){function t(){i.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1],s=n.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&r===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,r)}else return i.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Cc),Xa=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new J};Xa.prototype.processIntersections=function(t,e,n,r){var s=this;if(t===n&&e===r)return null;var o=t.getCoordinates()[e],a=t.getCoordinates()[e+1],l=n.getCoordinates()[r],u=n.getCoordinates()[r+1];if(this._li.computeIntersection(o,a,l,u),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var h=0;h<this._li.getIntersectionNum();h++)s._interiorIntersections.add(s._li.getIntersection(h));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},Xa.prototype.isDone=function(){return!1},Xa.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Xa.prototype.interfaces_=function(){return[Ko]},Xa.prototype.getClass=function(){return Xa};var Yr=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new Ho,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};Yr.prototype.checkCorrectness=function(t){var e=be.getNodedSubstrings(t),n=new Pr(e);try{n.checkValid()}catch(r){if(r instanceof kw)r.printStackTrace();else throw r}finally{}},Yr.prototype.getNodedSubstrings=function(){return be.getNodedSubstrings(this._nodedSegStrings)},Yr.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},Yr.prototype.findInteriorIntersections=function(t,e){var n=new Xa(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},Yr.prototype.computeVertexSnaps=function(){var t=this;if(St(arguments[0],De))for(var e=arguments[0],n=e.iterator();n.hasNext();){var r=n.next();t.computeVertexSnaps(r)}else if(arguments[0]instanceof be)for(var s=arguments[0],o=s.getCoordinates(),a=0;a<o.length;a++){var l=new Ai(o[a],t._scaleFactor,t._li),u=t._pointSnapper.snap(l,s,a);u&&s.addIntersection(o[a],a)}},Yr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new am,this._pointSnapper=new yu(this._noder.getIndex()),this.snapRound(t,this._li)},Yr.prototype.computeIntersectionSnaps=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next(),s=new Ai(r,e._scaleFactor,e._li);e._pointSnapper.snap(s)}},Yr.prototype.interfaces_=function(){return[Jo]},Yr.prototype.getClass=function(){return Yr};var ri=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new qt,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},_u={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};ri.prototype.bufferFixedPrecision=function(t){var e=new co(new Yr(new Ut(1)),t.getScale()),n=new bi(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},ri.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=ri.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(o){if(o instanceof Ms)t._saveException=o;else throw o}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],r=ri.precisionScaleFactor(this._argGeom,this._distance,n),s=new Ut(r);this.bufferFixedPrecision(s)}},ri.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Ut.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},ri.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},ri.prototype.bufferOriginalPrecision=function(){try{var t=new bi(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof Ss)this._saveException=e;else throw e}finally{}},ri.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},ri.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},ri.prototype.interfaces_=function(){return[]},ri.prototype.getClass=function(){return ri},ri.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new ri(t),r=n.getResultGeometry(e);return r}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof _t&&typeof arguments[1]=="number"){var s=arguments[0],o=arguments[1],a=arguments[2],l=new ri(s);l.setQuadrantSegments(a);var u=l.getResultGeometry(o);return u}else if(arguments[2]instanceof qt&&arguments[0]instanceof _t&&typeof arguments[1]=="number"){var h=arguments[0],c=arguments[1],d=arguments[2],g=new ri(h,d),p=g.getResultGeometry(c);return p}}else if(arguments.length===4){var E=arguments[0],b=arguments[1],P=arguments[2],v=arguments[3],_=new ri(E);_.setQuadrantSegments(P),_.setEndCapStyle(v);var m=_.getResultGeometry(b);return m}},ri.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),s=an.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY())),o=e>0?e:0,a=s+2*o,l=Math.trunc(Math.log(a)/Math.log(10)+1),u=n-l,h=Math.pow(10,u);return h},_u.CAP_ROUND.get=function(){return qt.CAP_ROUND},_u.CAP_BUTT.get=function(){return qt.CAP_FLAT},_u.CAP_FLAT.get=function(){return qt.CAP_FLAT},_u.CAP_SQUARE.get=function(){return qt.CAP_SQUARE},_u.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(ri,_u);var Ci=function(){this._pt=[new L,new L],this._distance=Pt.NaN,this._isNull=!0};Ci.prototype.getCoordinates=function(){return this._pt},Ci.prototype.getCoordinate=function(t){return this._pt[t]},Ci.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},Ci.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=s,this._isNull=!1}},Ci.prototype.getDistance=function(){return this._distance},Ci.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var Jr=function(){};Jr.prototype.interfaces_=function(){return[]},Jr.prototype.getClass=function(){return Jr},Jr.computeDistance=function(){if(arguments[2]instanceof Ci&&arguments[0]instanceof ve&&arguments[1]instanceof L)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=t.getCoordinates(),s=new gt,o=0;o<r.length-1;o++){s.setCoordinates(r[o],r[o+1]);var a=s.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof Ci&&arguments[0]instanceof Re&&arguments[1]instanceof L){var l=arguments[0],u=arguments[1],h=arguments[2];Jr.computeDistance(l.getExteriorRing(),u,h);for(var c=0;c<l.getNumInteriorRing();c++)Jr.computeDistance(l.getInteriorRingN(c),u,h)}else if(arguments[2]instanceof Ci&&arguments[0]instanceof _t&&arguments[1]instanceof L){var d=arguments[0],g=arguments[1],p=arguments[2];if(d instanceof ve)Jr.computeDistance(d,g,p);else if(d instanceof Re)Jr.computeDistance(d,g,p);else if(d instanceof wi)for(var E=d,b=0;b<E.getNumGeometries();b++){var P=E.getGeometryN(b);Jr.computeDistance(P,g,p)}else p.setMinimum(d.getCoordinate(),g)}else if(arguments[2]instanceof Ci&&arguments[0]instanceof gt&&arguments[1]instanceof L){var v=arguments[0],_=arguments[1],m=arguments[2],y=v.closestPoint(_);m.setMinimum(y,_)}};var ta=function(t){this._maxPtDist=new Ci,this._inputGeom=t||null},lm={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};ta.prototype.computeMaxMidpointDistance=function(t){var e=new fo(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},ta.prototype.computeMaxVertexDistance=function(t){var e=new $a(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},ta.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},ta.prototype.getDistancePoints=function(){return this._maxPtDist},ta.prototype.interfaces_=function(){return[]},ta.prototype.getClass=function(){return ta},lm.MaxPointDistanceFilter.get=function(){return $a},lm.MaxMidpointDistanceFilter.get=function(){return fo},Object.defineProperties(ta,lm);var $a=function(t){this._maxPtDist=new Ci,this._minPtDist=new Ci,this._geom=t||null};$a.prototype.filter=function(t){this._minPtDist.initialize(),Jr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},$a.prototype.getMaxPointDistance=function(){return this._maxPtDist},$a.prototype.interfaces_=function(){return[Br]},$a.prototype.getClass=function(){return $a};var fo=function(t){this._maxPtDist=new Ci,this._minPtDist=new Ci,this._geom=t||null};fo.prototype.filter=function(t,e){if(e===0)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),s=new L((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),Jr.computeDistance(this._geom,s,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},fo.prototype.isDone=function(){return!1},fo.prototype.isGeometryChanged=function(){return!1},fo.prototype.getMaxPointDistance=function(){return this._maxPtDist},fo.prototype.interfaces_=function(){return[Un]},fo.prototype.getClass=function(){return fo};var Ds=function(t){this._comps=t||null};Ds.prototype.filter=function(t){t instanceof Re&&this._comps.add(t)},Ds.prototype.interfaces_=function(){return[vr]},Ds.prototype.getClass=function(){return Ds},Ds.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return Ds.getPolygons(t,new J)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof Re?n.add(e):e instanceof wi&&e.apply(new Ds(n)),n}};var si=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};si.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof Ur){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof ve&&this._lines.add(t)},si.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},si.prototype.interfaces_=function(){return[bs]},si.prototype.getClass=function(){return si},si.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(si.getLines(t))}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(si.getLines(e,n))}},si.getLines=function(){if(arguments.length===1){var t=arguments[0];return si.getLines(t,!1)}else if(arguments.length===2){if(St(arguments[0],De)&&St(arguments[1],De)){for(var e=arguments[0],n=arguments[1],r=e.iterator();r.hasNext();){var s=r.next();si.getLines(s,n)}return n}else if(arguments[0]instanceof _t&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1],l=new J;return o.apply(new si(l,a)),l}else if(arguments[0]instanceof _t&&St(arguments[1],De)){var u=arguments[0],h=arguments[1];return u instanceof ve?h.add(u):u.apply(new si(h)),h}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&St(arguments[0],De)&&St(arguments[1],De)){for(var c=arguments[0],d=arguments[1],g=arguments[2],p=c.iterator();p.hasNext();){var E=p.next();si.getLines(E,d,g)}return d}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof _t&&St(arguments[1],De)){var b=arguments[0],P=arguments[1],v=arguments[2];return b.apply(new si(P,v)),P}}};var Xn=function(){if(this._boundaryRule=Pn.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t===null)throw new de("Rule must be non-null");this._boundaryRule=t}}};Xn.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof L&&arguments[1]instanceof Re){var e=arguments[0],n=arguments[1];if(n.isEmpty())return k.EXTERIOR;var r=n.getExteriorRing(),s=this.locateInPolygonRing(e,r);if(s===k.EXTERIOR)return k.EXTERIOR;if(s===k.BOUNDARY)return k.BOUNDARY;for(var o=0;o<n.getNumInteriorRing();o++){var a=n.getInteriorRingN(o),l=t.locateInPolygonRing(e,a);if(l===k.INTERIOR)return k.EXTERIOR;if(l===k.BOUNDARY)return k.BOUNDARY}return k.INTERIOR}else if(arguments[0]instanceof L&&arguments[1]instanceof ve){var u=arguments[0],h=arguments[1];if(!h.getEnvelopeInternal().intersects(u))return k.EXTERIOR;var c=h.getCoordinates();return!h.isClosed()&&(u.equals(c[0])||u.equals(c[c.length-1]))?k.BOUNDARY:tt.isOnLine(u,c)?k.INTERIOR:k.EXTERIOR}else if(arguments[0]instanceof L&&arguments[1]instanceof qi){var d=arguments[0],g=arguments[1],p=g.getCoordinate();return p.equals2D(d)?k.INTERIOR:k.EXTERIOR}},Xn.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?tt.locatePointInRing(t,e.getCoordinates()):k.EXTERIOR},Xn.prototype.intersects=function(t,e){return this.locate(t,e)!==k.EXTERIOR},Xn.prototype.updateLocationInfo=function(t){t===k.INTERIOR&&(this._isIn=!0),t===k.BOUNDARY&&this._numBoundaries++},Xn.prototype.computeLocation=function(t,e){var n=this;if(e instanceof qi&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof ve)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Re)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Yo)for(var r=e,s=0;s<r.getNumGeometries();s++){var o=r.getGeometryN(s);n.updateLocationInfo(n.locateInternal(t,o))}else if(e instanceof qr)for(var a=e,l=0;l<a.getNumGeometries();l++){var u=a.getGeometryN(l);n.updateLocationInfo(n.locateInternal(t,u))}else if(e instanceof wi)for(var h=new Xr(e);h.hasNext();){var c=h.next();c!==e&&n.computeLocation(t,c)}},Xn.prototype.locate=function(t,e){return e.isEmpty()?k.EXTERIOR:e instanceof ve?this.locateInternal(t,e):e instanceof Re?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?k.BOUNDARY:this._numBoundaries>0||this._isIn?k.INTERIOR:k.EXTERIOR)},Xn.prototype.interfaces_=function(){return[]},Xn.prototype.getClass=function(){return Xn};var Pi=function i(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];i.call(this,t,i.INSIDE_AREA,e)}else if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];this._component=n,this._segIndex=r,this._pt=s}},s1={INSIDE_AREA:{configurable:!0}};Pi.prototype.isInsideArea=function(){return this._segIndex===Pi.INSIDE_AREA},Pi.prototype.getCoordinate=function(){return this._pt},Pi.prototype.getGeometryComponent=function(){return this._component},Pi.prototype.getSegmentIndex=function(){return this._segIndex},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi},s1.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Pi,s1);var go=function(t){this._pts=t||null};go.prototype.filter=function(t){t instanceof qi&&this._pts.add(t)},go.prototype.interfaces_=function(){return[vr]},go.prototype.getClass=function(){return go},go.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof qi?Wn.singletonList(t):go.getPoints(t,new J)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof qi?n.add(e):e instanceof wi&&e.apply(new go(n)),n}};var Ya=function(){this._locations=null;var t=arguments[0];this._locations=t};Ya.prototype.filter=function(t){(t instanceof qi||t instanceof ve||t instanceof Re)&&this._locations.add(new Pi(t,0,t.getCoordinate()))},Ya.prototype.interfaces_=function(){return[vr]},Ya.prototype.getClass=function(){return Ya},Ya.getLocations=function(t){var e=new J;return t.apply(new Ya(e)),e};var oi=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Xn,this._minDistanceLocation=null,this._minDistance=Pt.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=s}};oi.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var n=arguments[0],r=arguments[1],s=1-n,o=Ds.getPolygons(this._geom[n]);if(o.size()>0){var a=Ya.getLocations(this._geom[s]);if(this.computeContainmentDistance(a,o,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=r[0],this._minDistanceLocation[n]=r[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&St(arguments[0],zn)&&St(arguments[1],zn)){for(var l=arguments[0],u=arguments[1],h=arguments[2],c=0;c<l.size();c++)for(var d=l.get(c),g=0;g<u.size();g++)if(t.computeContainmentDistance(d,u.get(g),h),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Pi&&arguments[1]instanceof Re){var p=arguments[0],E=arguments[1],b=arguments[2],P=p.getCoordinate();if(k.EXTERIOR!==this._ptLocator.locate(P,E))return this._minDistance=0,b[0]=p,b[1]=new Pi(E,P),null}}},oi.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var l=e.get(a);if(r.computeMinDistance(o,l,n),r._minDistance<=r._terminateDistance)return null}},oi.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=si.getLines(this._geom[0]),n=si.getLines(this._geom[1]),r=go.getPoints(this._geom[0]),s=go.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,s,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(r,s,t),this.updateMinDistance(t,!1)},oi.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},oi.prototype.updateMinDistance=function(t,e){if(t[0]===null)return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},oi.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},oi.prototype.computeMinDistance=function(){var t=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof ve&&arguments[1]instanceof qi){var e=arguments[0],n=arguments[1],r=arguments[2];if(e.getEnvelopeInternal().distance(n.getEnvelopeInternal())>this._minDistance)return null;for(var s=e.getCoordinates(),o=n.getCoordinate(),a=0;a<s.length-1;a++){var l=tt.distancePointLine(o,s[a],s[a+1]);if(l<t._minDistance){t._minDistance=l;var u=new gt(s[a],s[a+1]),h=u.closestPoint(o);r[0]=new Pi(e,a,h),r[1]=new Pi(n,0,o)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof ve&&arguments[1]instanceof ve){var c=arguments[0],d=arguments[1],g=arguments[2];if(c.getEnvelopeInternal().distance(d.getEnvelopeInternal())>this._minDistance)return null;for(var p=c.getCoordinates(),E=d.getCoordinates(),b=0;b<p.length-1;b++)for(var P=0;P<E.length-1;P++){var v=tt.distanceLineLine(p[b],p[b+1],E[P],E[P+1]);if(v<t._minDistance){t._minDistance=v;var _=new gt(p[b],p[b+1]),m=new gt(E[P],E[P+1]),y=_.closestPoints(m);g[0]=new Pi(c,b,y[0]),g[1]=new Pi(d,P,y[1])}if(t._minDistance<=t._terminateDistance)return null}}}},oi.prototype.computeMinDistancePoints=function(t,e,n){for(var r=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var l=e.get(a),u=o.getCoordinate().distance(l.getCoordinate());if(u<r._minDistance&&(r._minDistance=u,n[0]=new Pi(o,0,o.getCoordinate()),n[1]=new Pi(l,0,l.getCoordinate())),r._minDistance<=r._terminateDistance)return null}},oi.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new de("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},oi.prototype.computeMinDistanceLines=function(t,e,n){for(var r=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var l=e.get(a);if(r.computeMinDistance(o,l,n),r._minDistance<=r._terminateDistance)return null}},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.distance=function(t,e){var n=new oi(t,e);return n.distance()},oi.isWithinDistance=function(t,e,n){var r=new oi(t,e,n);return r.distance()<=n},oi.nearestPoints=function(t,e){var n=new oi(t,e);return n.nearestPoints()};var mi=function(){this._pt=[new L,new L],this._distance=Pt.NaN,this._isNull=!0};mi.prototype.getCoordinates=function(){return this._pt},mi.prototype.getCoordinate=function(t){return this._pt[t]},mi.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},mi.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=s,this._isNull=!1}},mi.prototype.toString=function(){return Vn.toLineString(this._pt[0],this._pt[1])},mi.prototype.getDistance=function(){return this._distance},mi.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},mi.prototype.interfaces_=function(){return[]},mi.prototype.getClass=function(){return mi};var xr=function(){};xr.prototype.interfaces_=function(){return[]},xr.prototype.getClass=function(){return xr},xr.computeDistance=function(){if(arguments[2]instanceof mi&&arguments[0]instanceof ve&&arguments[1]instanceof L)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new gt,s=t.getCoordinates(),o=0;o<s.length-1;o++){r.setCoordinates(s[o],s[o+1]);var a=r.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof mi&&arguments[0]instanceof Re&&arguments[1]instanceof L){var l=arguments[0],u=arguments[1],h=arguments[2];xr.computeDistance(l.getExteriorRing(),u,h);for(var c=0;c<l.getNumInteriorRing();c++)xr.computeDistance(l.getInteriorRingN(c),u,h)}else if(arguments[2]instanceof mi&&arguments[0]instanceof _t&&arguments[1]instanceof L){var d=arguments[0],g=arguments[1],p=arguments[2];if(d instanceof ve)xr.computeDistance(d,g,p);else if(d instanceof Re)xr.computeDistance(d,g,p);else if(d instanceof wi)for(var E=d,b=0;b<E.getNumGeometries();b++){var P=E.getGeometryN(b);xr.computeDistance(P,g,p)}else p.setMinimum(d.getCoordinate(),g)}else if(arguments[2]instanceof mi&&arguments[0]instanceof gt&&arguments[1]instanceof L){var v=arguments[0],_=arguments[1],m=arguments[2],y=v.closestPoint(_);m.setMinimum(y,_)}};var Nn=function(){this._g0=null,this._g1=null,this._ptDist=new mi,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},um={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Nn.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Nn.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new de("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Nn.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Nn.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Nn.prototype.computeOrientedDistance=function(t,e,n){var r=new Ja(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var s=new po(e,this._densifyFrac);t.apply(s),n.setMaximum(s.getMaxPointDistance())}},Nn.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Nn.prototype.interfaces_=function(){return[]},Nn.prototype.getClass=function(){return Nn},Nn.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Nn(t,e);return n.distance()}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2],a=new Nn(r,s);return a.setDensifyFraction(o),a.distance()}},um.MaxPointDistanceFilter.get=function(){return Ja},um.MaxDensifiedByFractionDistanceFilter.get=function(){return po},Object.defineProperties(Nn,um);var Ja=function(){this._maxPtDist=new mi,this._minPtDist=new mi,this._euclideanDist=new xr,this._geom=null;var t=arguments[0];this._geom=t};Ja.prototype.filter=function(t){this._minPtDist.initialize(),xr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ja.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ja.prototype.interfaces_=function(){return[Br]},Ja.prototype.getClass=function(){return Ja};var po=function(){this._maxPtDist=new mi,this._minPtDist=new mi,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};po.prototype.filter=function(t,e){var n=this;if(e===0)return null;for(var r=t.getCoordinate(e-1),s=t.getCoordinate(e),o=(s.x-r.x)/this._numSubSegs,a=(s.y-r.y)/this._numSubSegs,l=0;l<this._numSubSegs;l++){var u=r.x+l*o,h=r.y+l*a,c=new L(u,h);n._minPtDist.initialize(),xr.computeDistance(n._geom,c,n._minPtDist),n._maxPtDist.setMaximum(n._minPtDist)}},po.prototype.isDone=function(){return!1},po.prototype.isGeometryChanged=function(){return!1},po.prototype.getMaxPointDistance=function(){return this._maxPtDist},po.prototype.interfaces_=function(){return[Un]},po.prototype.getClass=function(){return po};var Xi=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},hm={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Xi.prototype.checkMaximumDistance=function(t,e,n){var r=new Nn(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var s=r.getCoordinates();this._errorLocation=s[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Vn.toLineString(s[0],s[1])+")"}},Xi.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Xi.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Xi.VERBOSE&&ii.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Xi.prototype.checkNegativeValid=function(){if(!(this._input instanceof Re||this._input instanceof qr||this._input instanceof wi))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Xi.prototype.getErrorIndicator=function(){return this._errorIndicator},Xi.prototype.checkMinimumDistance=function(t,e,n){var r=new oi(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var s=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Vn.toLineString(s[0],s[1])+" )"}},Xi.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},Xi.prototype.getErrorLocation=function(){return this._errorLocation},Xi.prototype.getPolygonLines=function(t){for(var e=new J,n=new si(e),r=Ds.getPolygons(t),s=r.iterator();s.hasNext();){var o=s.next();o.apply(n)}return t.getFactory().buildGeometry(e)},Xi.prototype.getErrorMessage=function(){return this._errMsg},Xi.prototype.interfaces_=function(){return[]},Xi.prototype.getClass=function(){return Xi},hm.VERBOSE.get=function(){return!1},hm.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Xi,hm);var ai=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},cm={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};ai.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},ai.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*ai.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new ht(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new ht(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},ai.prototype.checkDistance=function(){var t=new Xi(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},ai.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},ai.prototype.checkPolygonal=function(){this._result instanceof Re||this._result instanceof qr||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},ai.prototype.getErrorIndicator=function(){return this._errorIndicator},ai.prototype.getErrorLocation=function(){return this._errorLocation},ai.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")},ai.prototype.report=function(t){if(!ai.VERBOSE)return null;ii.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},ai.prototype.getErrorMessage=function(){return this._errorMsg},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai},ai.isValidMsg=function(t,e,n){var r=new ai(t,e,n);return r.isValid()?null:r.getErrorMessage()},ai.isValid=function(t,e,n){var r=new ai(t,e,n);return!!r.isValid()},cm.VERBOSE.get=function(){return!1},cm.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(ai,cm);var Ir=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Ir.prototype.getCoordinates=function(){return this._pts},Ir.prototype.size=function(){return this._pts.length},Ir.prototype.getCoordinate=function(t){return this._pts[t]},Ir.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Ir.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:qa.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Ir.prototype.setData=function(t){this._data=t},Ir.prototype.getData=function(){return this._data},Ir.prototype.toString=function(){return Vn.toLineString(new Se(this._pts))},Ir.prototype.interfaces_=function(){return[Hr]},Ir.prototype.getClass=function(){return Ir};var $e=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new J,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};$e.prototype.getInteriorIntersection=function(){return this._interiorIntersection},$e.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},$e.prototype.getIntersectionSegments=function(){return this._intSegments},$e.prototype.count=function(){return this._intersectionCount},$e.prototype.getIntersections=function(){return this._intersections},$e.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},$e.prototype.setKeepIntersections=function(t){this._keepIntersections=t},$e.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection()||t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(t,e)||this.isEndSegment(n,r);if(!s)return null}var o=t.getCoordinates()[e],a=t.getCoordinates()[e+1],l=n.getCoordinates()[r],u=n.getCoordinates()[r+1];this._li.computeIntersection(o,a,l,u),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,this._intSegments[1]=a,this._intSegments[2]=l,this._intSegments[3]=u,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},$e.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},$e.prototype.hasIntersection=function(){return this._interiorIntersection!==null},$e.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},$e.prototype.interfaces_=function(){return[Ko]},$e.prototype.getClass=function(){return $e},$e.createAllIntersectionsFinder=function(t){var e=new $e(t);return e.setFindAllIntersections(!0),e},$e.createAnyIntersectionFinder=function(t){return new $e(t)},$e.createIntersectionCounter=function(t){var e=new $e(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var $n=function(){this._li=new Ho,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};$n.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},$n.prototype.getIntersections=function(){return this._segInt.getIntersections()},$n.prototype.isValid=function(){return this.execute(),this._isValid},$n.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},$n.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new $e(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new am;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},$n.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ms(this.getErrorMessage(),this._segInt.getInteriorIntersection())},$n.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Vn.toLineString(t[0],t[1])+" and "+Vn.toLineString(t[2],t[3])},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n},$n.computeIntersections=function(t){var e=new $n(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var ea=function i(){this._nv=null;var t=arguments[0];this._nv=new $n(i.toSegmentStrings(t))};ea.prototype.checkValid=function(){this._nv.checkValid()},ea.prototype.interfaces_=function(){return[]},ea.prototype.getClass=function(){return ea},ea.toSegmentStrings=function(t){for(var e=new J,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Ir(r.getCoordinates(),r))}return e},ea.checkValid=function(t){var e=new ea(t);e.checkValid()};var Za=function(t){this._mapOp=t};Za.prototype.map=function(t){for(var e=this,n=new J,r=0;r<t.getNumGeometries();r++){var s=e._mapOp.map(t.getGeometryN(r));s.isEmpty()||n.add(s)}return t.getFactory().createGeometryCollection(At.toGeometryArray(n))},Za.prototype.interfaces_=function(){return[]},Za.prototype.getClass=function(){return Za},Za.map=function(t,e){var n=new Za(e);return n.map(t)};var Mr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new J,this._resultLineList=new J;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};Mr.prototype.collectLines=function(t){for(var e=this,n=this._op.getGraph().getEdgeEnds().iterator();n.hasNext();){var r=n.next();e.collectLineEdge(r,t,e._lineEdgesList),e.collectBoundaryTouchEdge(r,t,e._lineEdgesList)}},Mr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Mr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Mr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),s=t.getEdge();t.isLineEdge()&&!t.isVisited()&&It.isResultOfOp(r,e)&&!s.isCovered()&&(n.add(s),t.setVisitedEdge(!0))},Mr.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();n.getEdges().findCoveredLineEdges()}for(var r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var s=r.next(),o=s.getEdge();if(s.isLineEdge()&&!o.isCoveredSet()){var a=t._op.isCoveredByA(s.getCoordinate());o.setCovered(a)}}},Mr.prototype.labelIsolatedLines=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next(),s=r.getLabel();r.isIsolated()&&(s.isNull(0)?e.labelIsolatedLine(r,0):e.labelIsolatedLine(r,1))}},Mr.prototype.buildLines=function(t){for(var e=this,n=this._lineEdgesList.iterator();n.hasNext();){var r=n.next(),s=e._geometryFactory.createLineString(r.getCoordinates());e._resultLineList.add(s),r.setInResult(!0)}},Mr.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;Tt.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),It.isResultOfOp(r,e)&&e===It.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))},Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr};var Ka=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new J;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Ka.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Ka.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,n=this._op.getGraph().getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isInResult()&&!r.isIncidentEdgeInResult()&&(r.getEdges().getDegree()===0||t===It.INTERSECTION)){var s=r.getLabel();It.isResultOfOp(s,t)&&e.filterCoveredNodeToPoint(r)}}},Ka.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Ka.prototype.interfaces_=function(){return[]},Ka.prototype.getClass=function(){return Ka};var Li=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Li.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Li.prototype.transformPolygon=function(t,e){var n=this,r=!0,s=this.transformLinearRing(t.getExteriorRing(),t);(s===null||!(s instanceof Ur)||s.isEmpty())&&(r=!1);for(var o=new J,a=0;a<t.getNumInteriorRing();a++){var l=n.transformLinearRing(t.getInteriorRingN(a),t);l===null||l.isEmpty()||(l instanceof Ur||(r=!1),o.add(l))}if(r)return this._factory.createPolygon(s,o.toArray([]));var u=new J;return s!==null&&u.add(s),u.addAll(o),this._factory.buildGeometry(u)},Li.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Li.prototype.getInputGeometry=function(){return this._inputGeom},Li.prototype.transformMultiLineString=function(t,e){for(var n=this,r=new J,s=0;s<t.getNumGeometries();s++){var o=n.transformLineString(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||r.add(o))}return this._factory.buildGeometry(r)},Li.prototype.transformCoordinates=function(t,e){return this.copy(t)},Li.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Li.prototype.transformMultiPoint=function(t,e){for(var n=this,r=new J,s=0;s<t.getNumGeometries();s++){var o=n.transformPoint(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||r.add(o))}return this._factory.buildGeometry(r)},Li.prototype.transformMultiPolygon=function(t,e){for(var n=this,r=new J,s=0;s<t.getNumGeometries();s++){var o=n.transformPolygon(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||r.add(o))}return this._factory.buildGeometry(r)},Li.prototype.copy=function(t){return t.copy()},Li.prototype.transformGeometryCollection=function(t,e){for(var n=this,r=new J,s=0;s<t.getNumGeometries();s++){var o=n.transform(t.getGeometryN(s));o!==null&&(n._pruneEmptyGeometry&&o.isEmpty()||r.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(At.toGeometryArray(r)):this._factory.buildGeometry(r)},Li.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof qi)return this.transformPoint(t,null);if(t instanceof fu)return this.transformMultiPoint(t,null);if(t instanceof Ur)return this.transformLinearRing(t,null);if(t instanceof ve)return this.transformLineString(t,null);if(t instanceof Yo)return this.transformMultiLineString(t,null);if(t instanceof Re)return this.transformPolygon(t,null);if(t instanceof qr)return this.transformMultiPolygon(t,null);if(t instanceof wi)return this.transformGeometryCollection(t,null);throw new de("Unknown Geometry subtype: "+t.getClass().getName())},Li.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(n===null)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li};var Zr=function i(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new gt,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof ve&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];i.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var n=arguments[0],r=arguments[1];this._srcPts=n,this._isClosed=i.isClosed(n),this._snapTolerance=r}};Zr.prototype.snapVertices=function(t,e){for(var n=this,r=this._isClosed?t.size()-1:t.size(),s=0;s<r;s++){var o=t.get(s),a=n.findSnapForVertex(o,e);a!==null&&(t.set(s,new L(a)),s===0&&n._isClosed&&t.set(t.size()-1,new L(a)))}},Zr.prototype.findSnapForVertex=function(t,e){for(var n=this,r=0;r<e.length;r++){if(t.equals2D(e[r]))return null;if(t.distance(e[r])<n._snapTolerance)return e[r]}return null},Zr.prototype.snapTo=function(t){var e=new hc(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var n=e.toCoordinateArray();return n},Zr.prototype.snapSegments=function(t,e){var n=this;if(e.length===0)return null;var r=e.length;e[0].equals2D(e[e.length-1])&&(r=e.length-1);for(var s=0;s<r;s++){var o=e[s],a=n.findSegmentIndexToSnap(o,t);a>=0&&t.add(a+1,new L(o),!1)}},Zr.prototype.findSegmentIndexToSnap=function(t,e){for(var n=this,r=Pt.MAX_VALUE,s=-1,o=0;o<e.size()-1;o++){if(n._seg.p0=e.get(o),n._seg.p1=e.get(o+1),n._seg.p0.equals2D(t)||n._seg.p1.equals2D(t)){if(n._allowSnappingToSourceVertices)continue;return-1}var a=n._seg.distance(t);a<n._snapTolerance&&a<r&&(r=a,s=o)}return s},Zr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var Ce=function(t){this._srcGeom=t||null},o1={SNAP_PRECISION_FACTOR:{configurable:!0}};Ce.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t),r=new a1(e,n);return r.transform(this._srcGeom)},Ce.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new a1(t,n,!0),s=r.transform(this._srcGeom),o=s;return e&&St(o,ao)&&(o=s.buffer(0)),o},Ce.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),n=e/10;return n},Ce.prototype.extractTargetCoordinates=function(t){for(var e=new mr,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},Ce.prototype.computeMinimumSegmentLength=function(t){for(var e=Pt.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce},Ce.snap=function(t,e,n){var r=new Array(2).fill(null),s=new Ce(t);r[0]=s.snapTo(e,n);var o=new Ce(e);return r[1]=o.snapTo(r[0],n),r},Ce.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=Ce.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===Ut.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return Math.min(Ce.computeOverlaySnapTolerance(s),Ce.computeOverlaySnapTolerance(o))}},Ce.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),n=Math.min(e.getHeight(),e.getWidth()),r=n*Ce.SNAP_PRECISION_FACTOR;return r},Ce.snapToSelf=function(t,e,n){var r=new Ce(t);return r.snapToSelf(e,n)},o1.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Ce,o1);var a1=(function(i){function t(e,n,r){i.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=r!==void 0?r:!1}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(n,r){var s=new Zr(n,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(r)},t.prototype.transformCoordinates=function(n,r){var s=n.toCoordinateArray(),o=this.snapLine(s,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Li),xi=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};xi.prototype.getCommon=function(){return Pt.longBitsToDouble(this._commonBits)},xi.prototype.add=function(t){var e=Pt.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=xi.signExpBits(this._commonBits),this._isFirst=!1,null;var n=xi.signExpBits(e);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=xi.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=xi.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},xi.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=Pt.longBitsToDouble(t),n=Pt.toBinaryString(t),r="0000000000000000000000000000000000000000000000000000000000000000"+n,s=r.substring(r.length-64),o=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+e+" ]";return o}},xi.prototype.interfaces_=function(){return[]},xi.prototype.getClass=function(){return xi},xi.getBit=function(t,e){var n=1<<e;return(t&n)!==0?1:0},xi.signExpBits=function(t){return t>>52},xi.zeroLowerBits=function(t,e){var n=(1<<e)-1,r=~n,s=t&r;return s},xi.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(xi.getBit(t,r)!==xi.getBit(e,r))return n;n++}return 52};var mo=function(){this._commonCoord=null,this._ccFilter=new Qa},dm={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};mo.prototype.addCommonBits=function(t){var e=new vo(this._commonCoord);t.apply(e),t.geometryChanged()},mo.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new L(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new vo(e);return t.apply(n),t.geometryChanged(),t},mo.prototype.getCommonCoordinate=function(){return this._commonCoord},mo.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},mo.prototype.interfaces_=function(){return[]},mo.prototype.getClass=function(){return mo},dm.CommonCoordinateFilter.get=function(){return Qa},dm.Translater.get=function(){return vo},Object.defineProperties(mo,dm);var Qa=function(){this._commonBitsX=new xi,this._commonBitsY=new xi};Qa.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Qa.prototype.getCommonCoordinate=function(){return new L(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Qa.prototype.interfaces_=function(){return[Br]},Qa.prototype.getClass=function(){return Qa};var vo=function(){this.trans=null;var t=arguments[0];this.trans=t};vo.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},vo.prototype.isDone=function(){return!1},vo.prototype.isGeometryChanged=function(){return!0},vo.prototype.interfaces_=function(){return[Un]},vo.prototype.getClass=function(){return vo};var Ye=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};Ye.prototype.selfSnap=function(t){var e=new Ce(t),n=e.snapTo(t,this._snapTolerance);return n},Ye.prototype.removeCommonBits=function(t){this._cbr=new mo,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},Ye.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},Ye.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=It.overlayOp(e[0],e[1],t);return this.prepareResult(n)},Ye.prototype.checkValid=function(t){t.isValid()||ii.out.println("Snapped geometry is invalid")},Ye.prototype.computeSnapTolerance=function(){this._snapTolerance=Ce.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Ye.prototype.snap=function(t){var e=this.removeCommonBits(t),n=Ce.snap(e[0],e[1],this._snapTolerance);return n},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye},Ye.overlayOp=function(t,e,n){var r=new Ye(t,e);return r.getResultGeometry(n)},Ye.union=function(t,e){return Ye.overlayOp(t,e,It.UNION)},Ye.intersection=function(t,e){return Ye.overlayOp(t,e,It.INTERSECTION)},Ye.symDifference=function(t,e){return Ye.overlayOp(t,e,It.SYMDIFFERENCE)},Ye.difference=function(t,e){return Ye.overlayOp(t,e,It.DIFFERENCE)};var Ii=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};Ii.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=It.overlayOp(this._geom[0],this._geom[1],t);var s=!0;s&&(n=!0)}catch(o){if(o instanceof Ss)r=o;else throw o}finally{}if(!n)try{e=Ye.overlayOp(this._geom[0],this._geom[1],t)}catch(o){throw o instanceof Ss?r:o}finally{}return e},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii},Ii.overlayOp=function(t,e,n){var r=new Ii(t,e);return r.getResultGeometry(n)},Ii.union=function(t,e){return Ii.overlayOp(t,e,It.UNION)},Ii.intersection=function(t,e){return Ii.overlayOp(t,e,It.INTERSECTION)},Ii.symDifference=function(t,e){return Ii.overlayOp(t,e,It.SYMDIFFERENCE)},Ii.difference=function(t,e){return Ii.overlayOp(t,e,It.DIFFERENCE)};var Pc=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Pc.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Pc.prototype.interfaces_=function(){return[]},Pc.prototype.getClass=function(){return Pc};var $i=function i(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],e=arguments[1];this._eventType=i.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];this._eventType=i.INSERT,this._label=n,this._xValue=r,this._obj=s}},fm={INSERT:{configurable:!0},DELETE:{configurable:!0}};$i.prototype.isDelete=function(){return this._eventType===$i.DELETE},$i.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},$i.prototype.getObject=function(){return this._obj},$i.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},$i.prototype.getInsertEvent=function(){return this._insertEvent},$i.prototype.isInsert=function(){return this._eventType===$i.INSERT},$i.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},$i.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},$i.prototype.interfaces_=function(){return[bn]},$i.prototype.getClass=function(){return $i},fm.INSERT.get=function(){return 1},fm.DELETE.get=function(){return 2},Object.defineProperties($i,fm);var gf=function(){};gf.prototype.interfaces_=function(){return[]},gf.prototype.getClass=function(){return gf};var li=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};li.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&this._li.getIntersectionNum()===1){if(li.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var s=t.getNumPoints()-1;if(e===0&&r===s||r===0&&e===s)return!0}}return!1},li.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},li.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},li.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},li.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next(),s=r.getCoordinate();if(t.isIntersection(s))return!0}return!1},li.prototype.hasProperIntersection=function(){return this._hasProper},li.prototype.hasIntersection=function(){return this._hasIntersection},li.prototype.isDone=function(){return this._isDone},li.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},li.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},li.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var s=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],l=n.getCoordinates()[r+1];this._li.computeIntersection(s,o,a,l),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li},li.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var $N=(function(i){function t(){i.call(this),this.events=new J,this.nOverlaps=null}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var n=this;Wn.sort(this.events);for(var r=0;r<this.events.size();r++){var s=n.events.get(r);s.isDelete()&&s.getInsertEvent().setDeleteEventIndex(r)}},t.prototype.computeIntersections=function(){var n=this;if(arguments.length===1){var r=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var s=0;s<this.events.size();s++){var o=n.events.get(s);if(o.isInsert()&&n.processOverlaps(s,o.getDeleteEventIndex(),o,r),r.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof li&&St(arguments[0],zn)&&St(arguments[1],zn)){var a=arguments[0],l=arguments[1],u=arguments[2];this.addEdges(a,a),this.addEdges(l,l),this.computeIntersections(u)}else if(typeof arguments[2]=="boolean"&&St(arguments[0],zn)&&arguments[1]instanceof li){var h=arguments[0],c=arguments[1],d=arguments[2];d?this.addEdges(h,null):this.addEdges(h),this.computeIntersections(c)}}},t.prototype.addEdge=function(n,r){for(var s=this,o=n.getMonotoneChainEdge(),a=o.getStartIndexes(),l=0;l<a.length-1;l++){var u=new Pc(o,l),h=new $i(r,o.getMinX(l),u);s.events.add(h),s.events.add(new $i(o.getMaxX(l),h))}},t.prototype.processOverlaps=function(n,r,s,o){for(var a=this,l=s.getObject(),u=n;u<r;u++){var h=a.events.get(u);if(h.isInsert()){var c=h.getObject();s.isSameLabel(h)||(l.computeIntersections(c,o),a.nOverlaps++)}}},t.prototype.addEdges=function(){var n=this;if(arguments.length===1)for(var r=arguments[0],s=r.iterator();s.hasNext();){var o=s.next();n.addEdge(o,o)}else if(arguments.length===2)for(var a=arguments[0],l=arguments[1],u=a.iterator();u.hasNext();){var h=u.next();n.addEdge(h,l)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(gf),Kr=function(){this._min=Pt.POSITIVE_INFINITY,this._max=Pt.NEGATIVE_INFINITY},l1={NodeComparator:{configurable:!0}};Kr.prototype.getMin=function(){return this._min},Kr.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},Kr.prototype.getMax=function(){return this._max},Kr.prototype.toString=function(){return Vn.toLineString(new L(this._min,0),new L(this._max,0))},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr},l1.NodeComparator.get=function(){return xc},Object.defineProperties(Kr,l1);var xc=function(){};xc.prototype.compare=function(t,e){var n=t,r=e,s=(n._min+n._max)/2,o=(r._min+r._max)/2;return s<o?-1:s>o?1:0},xc.prototype.interfaces_=function(){return[iu]},xc.prototype.getClass=function(){return xc};var YN=(function(i){function t(){i.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.query=function(n,r,s){if(!this.intersects(n,r))return null;s.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Kr),JN=(function(i){function t(){i.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(n,r){this._min=Math.min(n._min,r._min),this._max=Math.max(n._max,r._max)},t.prototype.query=function(n,r,s){if(!this.intersects(n,r))return null;this._node1!==null&&this._node1.query(n,r,s),this._node2!==null&&this._node2.query(n,r,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Kr),Qr=function(){this._leaves=new J,this._root=null,this._level=0};Qr.prototype.buildTree=function(){var t=this;Wn.sort(this._leaves,new Kr.NodeComparator);for(var e=this._leaves,n=null,r=new J;;){if(t.buildLevel(e,r),r.size()===1)return r.get(0);n=e,e=r,r=n}},Qr.prototype.insert=function(t,e,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new YN(t,e,n))},Qr.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},Qr.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},Qr.prototype.printNode=function(t){ii.out.println(Vn.toLineString(new L(t._min,this._level),new L(t._max,this._level)))},Qr.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},Qr.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n),s=n+1<t.size()?t.get(n):null;if(s===null)e.add(r);else{var o=new JN(t.get(n),t.get(n+1));e.add(o)}}},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr};var wu=function(){this._items=new J};wu.prototype.visitItem=function(t){this._items.add(t)},wu.prototype.getItems=function(){return this._items},wu.prototype.interfaces_=function(){return[lo]},wu.prototype.getClass=function(){return wu};var Eu=function(){this._index=null;var t=arguments[0];if(!St(t,ao))throw new de("Argument must be Polygonal");this._index=new ia(t)},gm={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Eu.prototype.locate=function(t){var e=new pr(t),n=new Su(e);return this._index.query(t.y,t.y,n),e.getLocation()},Eu.prototype.interfaces_=function(){return[vu]},Eu.prototype.getClass=function(){return Eu},gm.SegmentVisitor.get=function(){return Su},gm.IntervalIndexedGeometry.get=function(){return ia},Object.defineProperties(Eu,gm);var Su=function(){this._counter=null;var t=arguments[0];this._counter=t};Su.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Su.prototype.interfaces_=function(){return[lo]},Su.prototype.getClass=function(){return Su};var ia=function(){this._index=new Qr;var t=arguments[0];this.init(t)};ia.prototype.init=function(t){for(var e=this,n=si.getLines(t),r=n.iterator();r.hasNext();){var s=r.next(),o=s.getCoordinates();e.addLine(o)}},ia.prototype.addLine=function(t){for(var e=this,n=1;n<t.length;n++){var r=new gt(t[n-1],t[n]),s=Math.min(r.p0.y,r.p1.y),o=Math.max(r.p0.y,r.p1.y);e._index.insert(s,o,r)}},ia.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new wu;return this._index.query(t,e,n),n.getItems()}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2];this._index.query(r,s,o)}},ia.prototype.interfaces_=function(){return[]},ia.prototype.getClass=function(){return ia};var Ic=(function(i){function t(){if(i.call(this),this._parentGeom=null,this._lineEdgeMap=new Uw,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Xn,arguments.length===2){var e=arguments[0],n=arguments[1],r=Pn.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,n!==null&&this.add(n)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this._argIndex=s,this._parentGeom=o,this._boundaryNodeRule=a,o!==null&&this.add(o)}}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(n,r){var s=this._nodes.addNode(r),o=s.getLabel(),a=1,l=k.NONE;l=o.getLocation(n,H.ON),l===k.BOUNDARY&&a++;var u=t.determineBoundary(this._boundaryNodeRule,a);o.setLocation(n,u)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.computeSelfNodes(n,r,!1)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2],l=new li(s,!0,!1);l.setIsDoneIfProperInt(a);var u=this.createEdgeSetIntersector(),h=this._parentGeom instanceof Ur||this._parentGeom instanceof Re||this._parentGeom instanceof qr,c=o||!h;return u.computeIntersections(this._edges,l,c),this.addSelfIntersectionNodes(this._argIndex),l}},t.prototype.computeSplitEdges=function(n){for(var r=this._edges.iterator();r.hasNext();){var s=r.next();s.eiList.addSplitEdges(n)}},t.prototype.computeEdgeIntersections=function(n,r,s){var o=new li(r,s,!0);o.setBoundaryNodes(this.getBoundaryNodes(),n.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,n._edges,o),o},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){if(arguments[0]instanceof qi){var n=arguments[0],r=n.getCoordinate();this.insertPoint(this._argIndex,r,k.INTERIOR)}else if(arguments[0]instanceof L){var s=arguments[0];this.insertPoint(this._argIndex,s,k.INTERIOR)}},t.prototype.addPolygon=function(n){var r=this;this.addPolygonRing(n.getExteriorRing(),k.EXTERIOR,k.INTERIOR);for(var s=0;s<n.getNumInteriorRing();s++){var o=n.getInteriorRingN(s);r.addPolygonRing(o,k.INTERIOR,k.EXTERIOR)}},t.prototype.addEdge=function(n){this.insertEdge(n);var r=n.getCoordinates();this.insertPoint(this._argIndex,r[0],k.BOUNDARY),this.insertPoint(this._argIndex,r[r.length-1],k.BOUNDARY)},t.prototype.addLineString=function(n){var r=Rt.removeRepeatedPoints(n.getCoordinates());if(r.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var s=new ff(r,new Yt(this._argIndex,k.INTERIOR));this._lineEdgeMap.put(n,s),this.insertEdge(s),Tt.isTrue(r.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,r[0]),this.insertBoundaryPoint(this._argIndex,r[r.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),r=new Array(n.size()).fill(null),s=0,o=n.iterator();o.hasNext();){var a=o.next();r[s++]=a.getCoordinate().copy()}return r},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(n,r,s){if(this.isBoundaryNode(n,r))return null;s===k.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,r):this.insertPoint(n,r,s)},t.prototype.addPolygonRing=function(n,r,s){if(n.isEmpty())return null;var o=Rt.removeRepeatedPoints(n.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var a=r,l=s;tt.isCCW(o)&&(a=s,l=r);var u=new ff(o,new Yt(this._argIndex,k.BOUNDARY,a,l));this._lineEdgeMap.put(n,u),this.insertEdge(u),this.insertPoint(this._argIndex,o[0],k.BOUNDARY)},t.prototype.insertPoint=function(n,r,s){var o=this._nodes.addNode(r),a=o.getLabel();a===null?o._label=new Yt(n,s):a.setLocation(n,s)},t.prototype.createEdgeSetIntersector=function(){return new $N},t.prototype.addSelfIntersectionNodes=function(n){for(var r=this,s=this._edges.iterator();s.hasNext();)for(var o=s.next(),a=o.getLabel().getLocation(n),l=o.eiList.iterator();l.hasNext();){var u=l.next();r.addSelfIntersectionNode(n,u.coord,a)}},t.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof qr&&(this._useBoundaryDeterminationRule=!1),n instanceof Re)this.addPolygon(n);else if(n instanceof ve)this.addLineString(n);else if(n instanceof qi)this.addPoint(n);else if(n instanceof fu)this.addCollection(n);else if(n instanceof Yo)this.addCollection(n);else if(n instanceof qr)this.addCollection(n);else if(n instanceof wi)this.addCollection(n);else throw new Error(n.getClass().getName())}else return i.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(n){for(var r=this,s=0;s<n.getNumGeometries();s++){var o=n.getGeometryN(s);r.add(o)}},t.prototype.locate=function(n){return St(this._parentGeom,ao)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Eu(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return i.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(n,r){return n.isInBoundary(r)?k.BOUNDARY:k.INTERIOR},t})(pe),bu=function(){if(this._li=new Ho,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Ic(0,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],r=Pn.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ic(0,e,r),this._arg[1]=new Ic(1,n,r)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];s.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(s.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ic(0,s,a),this._arg[1]=new Ic(1,o,a)}};bu.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},bu.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},bu.prototype.interfaces_=function(){return[]},bu.prototype.getClass=function(){return bu};var na=function(){};na.prototype.interfaces_=function(){return[]},na.prototype.getClass=function(){return na},na.map=function(){if(arguments[0]instanceof _t&&St(arguments[1],na.MapOp)){for(var t=arguments[0],e=arguments[1],n=new J,r=0;r<t.getNumGeometries();r++){var s=e.map(t.getGeometryN(r));s!==null&&n.add(s)}return t.getFactory().buildGeometry(n)}else if(St(arguments[0],De)&&St(arguments[1],na.MapOp)){for(var o=arguments[0],a=arguments[1],l=new J,u=o.iterator();u.hasNext();){var h=u.next(),c=a.map(h);c!==null&&l.add(c)}return l}},na.MapOp=function(){};var It=(function(i){function t(){var e=arguments[0],n=arguments[1];i.call(this,e,n),this._ptLocator=new Xn,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Hn,this._resultPolyList=new J,this._resultLineList=new J,this._resultPointList=new J,this._graph=new pe(new Qw),this._geomFact=e.getFactory()}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(n){var r=this._edgeList.findEqualEdge(n);if(r!==null){var s=r.getLabel(),o=n.getLabel();r.isPointwiseEqual(n)||(o=new Yt(n.getLabel()),o.flip());var a=r.getDepth();a.isNull()&&a.add(s),a.add(o),s.merge(o)}else this._edgeList.add(n)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),s=r.getSym();r.isInResult()&&s.isInResult()&&(r.setInResult(!1),s.setInResult(!1))}},t.prototype.isCoveredByLA=function(n){return!!(this.isCovered(n,this._resultLineList)||this.isCovered(n,this._resultPolyList))},t.prototype.computeGeometry=function(n,r,s,o){var a=new J;return a.addAll(n),a.addAll(r),a.addAll(s),a.isEmpty()?t.createEmptyResult(o,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)},t.prototype.mergeSymLabels=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var r=n.next();r.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(n,r){for(var s=this,o=r.iterator();o.hasNext();){var a=o.next(),l=s._ptLocator.locate(n,a);if(l!==k.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var n=new J,r=this._edgeList.iterator();r.hasNext();){var s=r.next();s.isCollapsed()&&(r.remove(),n.add(s.getCollapsedEdge()))}this._edgeList.addAll(n)},t.prototype.updateNodeLabelling=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var r=n.next(),s=r.getEdges().getLabel();r.getLabel().merge(s)}},t.prototype.getResultGeometry=function(n){return this.computeOverlay(n),this._resultGeom},t.prototype.insertUniqueEdges=function(n){for(var r=this,s=n.iterator();s.hasNext();){var o=s.next();r.insertUniqueEdge(o)}},t.prototype.computeOverlay=function(n){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var r=new J;this._arg[0].computeSplitEdges(r),this._arg[1].computeSplitEdges(r),this.insertUniqueEdges(r),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),ea.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(n),this.cancelDuplicateResultEdges();var s=new Wi(this._geomFact);s.add(this._graph),this._resultPolyList=s.getPolygons();var o=new Mr(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(n);var a=new Ka(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(n),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,n)},t.prototype.labelIncompleteNode=function(n,r){var s=this._ptLocator.locate(n.getCoordinate(),this._arg[r].getGeometry());n.getLabel().setLocation(r,s)},t.prototype.copyPoints=function(n){for(var r=this,s=this._arg[n].getNodeIterator();s.hasNext();){var o=s.next(),a=r._graph.addNode(o.getCoordinate());a.setLabel(n,o.getLabel().getLocation(n))}},t.prototype.findResultAreaEdges=function(n){for(var r=this._graph.getEdgeEnds().iterator();r.hasNext();){var s=r.next(),o=s.getLabel();o.isArea()&&!s.isInteriorAreaEdge()&&t.isResultOfOp(o.getLocation(0,H.RIGHT),o.getLocation(1,H.RIGHT),n)&&s.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var n=this._edgeList.iterator();n.hasNext();){var r=n.next(),s=r.getLabel(),o=r.getDepth();if(!o.isNull()){o.normalize();for(var a=0;a<2;a++)!s.isNull(a)&&s.isArea()&&!o.isNull(a)&&(o.getDelta(a)===0?s.toLine(a):(Tt.isTrue(!o.isNull(a,H.LEFT),"depth of LEFT side has not been initialized"),s.setLocation(a,H.LEFT,o.getLocation(a,H.LEFT)),Tt.isTrue(!o.isNull(a,H.RIGHT),"depth of RIGHT side has not been initialized"),s.setLocation(a,H.RIGHT,o.getLocation(a,H.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var n=this,r=this._graph.getNodes().iterator();r.hasNext();){var s=r.next();s.getEdges().computeLabelling(n._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var n=this,r=this._graph.getNodes().iterator();r.hasNext();){var s=r.next(),o=s.getLabel();s.isIsolated()&&(o.isNull(0)?n.labelIncompleteNode(s,0):n.labelIncompleteNode(s,1)),s.getEdges().updateLabelling(o)}},t.prototype.isCoveredByA=function(n){return!!this.isCovered(n,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(bu);It.overlayOp=function(i,t,e){var n=new It(i,t),r=n.getResultGeometry(e);return r},It.intersection=function(i,t){if(i.isEmpty()||t.isEmpty())return It.createEmptyResult(It.INTERSECTION,i,t,i.getFactory());if(i.isGeometryCollection()){var e=t;return Za.map(i,{interfaces_:function(){return[na.MapOp]},map:function(n){return n.intersection(e)}})}return i.checkNotGeometryCollection(i),i.checkNotGeometryCollection(t),Ii.overlayOp(i,t,It.INTERSECTION)},It.symDifference=function(i,t){if(i.isEmpty()||t.isEmpty()){if(i.isEmpty()&&t.isEmpty())return It.createEmptyResult(It.SYMDIFFERENCE,i,t,i.getFactory());if(i.isEmpty())return t.copy();if(t.isEmpty())return i.copy()}return i.checkNotGeometryCollection(i),i.checkNotGeometryCollection(t),Ii.overlayOp(i,t,It.SYMDIFFERENCE)},It.resultDimension=function(i,t,e){var n=t.getDimension(),r=e.getDimension(),s=-1;switch(i){case It.INTERSECTION:s=Math.min(n,r);break;case It.UNION:s=Math.max(n,r);break;case It.DIFFERENCE:s=n;break;case It.SYMDIFFERENCE:s=Math.max(n,r);break}return s},It.createEmptyResult=function(i,t,e,n){var r=null;switch(It.resultDimension(i,t,e)){case-1:r=n.createGeometryCollection(new Array(0).fill(null));break;case 0:r=n.createPoint();break;case 1:r=n.createLineString();break;case 2:r=n.createPolygon();break}return r},It.difference=function(i,t){return i.isEmpty()?It.createEmptyResult(It.DIFFERENCE,i,t,i.getFactory()):t.isEmpty()?i.copy():(i.checkNotGeometryCollection(i),i.checkNotGeometryCollection(t),Ii.overlayOp(i,t,It.DIFFERENCE))},It.isResultOfOp=function(){if(arguments.length===2){var i=arguments[0],t=arguments[1],e=i.getLocation(0),n=i.getLocation(1);return It.isResultOfOp(e,n,t)}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2];switch(r===k.BOUNDARY&&(r=k.INTERIOR),s===k.BOUNDARY&&(s=k.INTERIOR),o){case It.INTERSECTION:return r===k.INTERIOR&&s===k.INTERIOR;case It.UNION:return r===k.INTERIOR||s===k.INTERIOR;case It.DIFFERENCE:return r===k.INTERIOR&&s!==k.INTERIOR;case It.SYMDIFFERENCE:return r===k.INTERIOR&&s!==k.INTERIOR||r!==k.INTERIOR&&s===k.INTERIOR}return!1}},It.INTERSECTION=1,It.UNION=2,It.DIFFERENCE=3,It.SYMDIFFERENCE=4;var yo=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Xn,this._seg=new gt;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};yo.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,n=0;n<this._linework.getNumGeometries();n++)for(var r=e._linework.getGeometryN(n),s=r.getCoordinateSequence(),o=0;o<s.size()-1;o++){s.getCoordinate(o,e._seg.p0),s.getCoordinate(o+1,e._seg.p1);var a=e._seg.distance(t);if(a<=e._boundaryDistanceTolerance)return!0}return!1},yo.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?k.BOUNDARY:this._ptLocator.locate(t,this._g)},yo.prototype.extractLinework=function(t){var e=new Cu;t.apply(e);var n=e.getLinework(),r=At.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},yo.prototype.interfaces_=function(){return[]},yo.prototype.getClass=function(){return yo};var Cu=function(){this._linework=null,this._linework=new J};Cu.prototype.getLinework=function(){return this._linework},Cu.prototype.filter=function(t){var e=this;if(t instanceof Re){var n=t;this._linework.add(n.getExteriorRing());for(var r=0;r<n.getNumInteriorRing();r++)e._linework.add(n.getInteriorRingN(r))}},Cu.prototype.interfaces_=function(){return[vr]},Cu.prototype.getClass=function(){return Cu};var ra=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};ra.prototype.extractPoints=function(t,e,n){for(var r=this,s=t.getCoordinates(),o=0;o<s.length-1;o++)r.computeOffsetPoints(s[o],s[o+1],e,n)},ra.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},ra.prototype.getPoints=function(t){for(var e=this,n=new J,r=si.getLines(this._g),s=r.iterator();s.hasNext();){var o=s.next();e.extractPoints(o,t,n)}return n},ra.prototype.computeOffsetPoints=function(t,e,n,r){var s=e.x-t.x,o=e.y-t.y,a=Math.sqrt(s*s+o*o),l=n*s/a,u=n*o/a,h=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var d=new L(h-u,c+l);r.add(d)}if(this._doRight){var g=new L(h+u,c-l);r.add(g)}},ra.prototype.interfaces_=function(){return[]},ra.prototype.getClass=function(){return ra};var dn=function i(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=i.TOLERANCE,this._testCoords=new J;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundaryDistanceTolerance=i.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,n],this._locFinder=[new yo(this._geom[0],this._boundaryDistanceTolerance),new yo(this._geom[1],this._boundaryDistanceTolerance),new yo(this._geom[2],this._boundaryDistanceTolerance)]},u1={TOLERANCE:{configurable:!0}};dn.prototype.reportResult=function(t,e,n){ii.out.println("Overlay result invalid - A:"+k.toLocationSymbol(e[0])+" B:"+k.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+k.toLocationSymbol(e[2]))},dn.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},dn.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=0;n<this._testCoords.size();n++){var r=t._testCoords.get(n);if(!t.checkValid(e,r))return t._invalidLocation=r,!1}return!0}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._location[0]=this._locFinder[0].getLocation(o),this._location[1]=this._locFinder[1].getLocation(o),this._location[2]=this._locFinder[2].getLocation(o),dn.hasLocation(this._location,k.BOUNDARY)?!0:this.isValidResult(s,this._location)}},dn.prototype.addTestPts=function(t){var e=new ra(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},dn.prototype.isValidResult=function(t,e){var n=It.isResultOfOp(e[0],e[1],t),r=e[2]===k.INTERIOR,s=!(n^r);return s||this.reportResult(t,e,n),s},dn.prototype.getInvalidLocation=function(){return this._invalidLocation},dn.prototype.interfaces_=function(){return[]},dn.prototype.getClass=function(){return dn},dn.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},dn.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Ce.computeSizeBasedSnapTolerance(t),Ce.computeSizeBasedSnapTolerance(e))},dn.isValid=function(t,e,n,r){var s=new dn(t,e,r);return s.isValid(n)},u1.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(dn,u1);var fn=function i(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=i.extractFactory(t),this._inputGeoms=t};fn.prototype.extractElements=function(t,e){var n=this;if(t===null)return null;for(var r=0;r<t.getNumGeometries();r++){var s=t.getGeometryN(r);n._skipEmpty&&s.isEmpty()||e.add(s)}},fn.prototype.combine=function(){for(var t=this,e=new J,n=this._inputGeoms.iterator();n.hasNext();){var r=n.next();t.extractElements(r,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn},fn.combine=function(){if(arguments.length===1){var t=arguments[0],e=new fn(t);return e.combine()}else if(arguments.length===2){var n=arguments[0],r=arguments[1],s=new fn(fn.createList(n,r));return s.combine()}else if(arguments.length===3){var o=arguments[0],a=arguments[1],l=arguments[2],u=new fn(fn.createList(o,a,l));return u.combine()}},fn.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},fn.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new J;return n.add(t),n.add(e),n}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2],a=new J;return a.add(r),a.add(s),a.add(o),a}};var Te=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new J)},h1={STRTREE_NODE_CAPACITY:{configurable:!0}};Te.prototype.reduceToGeometries=function(t){for(var e=this,n=new J,r=t.iterator();r.hasNext();){var s=r.next(),o=null;St(s,zn)?o=e.unionTree(s):s instanceof _t&&(o=s),n.add(o)}return n},Te.prototype.extractByEnvelope=function(t,e,n){for(var r=new J,s=0;s<e.getNumGeometries();s++){var o=e.getGeometryN(s);o.getEnvelopeInternal().intersects(t)?r.add(o):n.add(o)}return this._geomFactory.buildGeometry(r)},Te.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r)){var s=fn.combine(t,e);return s}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var o=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,o)},Te.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new Xw(Te.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var r=t.itemsTree(),s=this.unionTree(r);return s},Te.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var s=Te.getGeometry(e,n);return this.unionSafe(s,null)}else{if(r-n===2)return this.unionSafe(Te.getGeometry(e,n),Te.getGeometry(e,n+1));var o=Math.trunc((r+n)/2),a=this.binaryUnion(e,n,o),l=this.binaryUnion(e,o,r);return this.unionSafe(a,l)}}},Te.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e===null?e=r.copy():e=e.union(r)}return e},Te.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},Te.prototype.unionActual=function(t,e){return Te.restrictToPolygons(t.union(e))},Te.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),n=this.binaryUnion(e);return n},Te.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new J,s=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),a=this.unionActual(s,o);r.add(a);var l=fn.combine(r);return l},Te.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),n=e.buildGeometry(t),r=n.buffer(0);return r}else if(arguments.length===2){var s=arguments[0],o=arguments[1],a=s.getFactory(),l=a.createGeometryCollection([s,o]),u=l.buffer(0);return u}},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te},Te.restrictToPolygons=function(t){if(St(t,ao))return t;var e=Ds.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(At.toPolygonArray(e))},Te.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Te.union=function(t){var e=new Te(t);return e.union()},h1.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Te,h1);var pf=function(){};pf.prototype.interfaces_=function(){return[]},pf.prototype.getClass=function(){return pf},pf.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return It.createEmptyResult(It.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Ii.overlayOp(t,e,It.UNION)};function sa(){return new mf}function mf(){this.reset()}mf.prototype={constructor:mf,reset:function(){this.s=this.t=0},add:function(i){c1(vf,i,this.t),c1(this,vf.s,this.s),this.s?this.t+=vf.t:this.s=vf.t},valueOf:function(){return this.s}};var vf=new mf;function c1(i,t,e){var n=i.s=t+e,r=n-t,s=n-r;i.t=t-s+(e-r)}var _e=1e-6,ie=Math.PI,Rs=ie/2,d1=ie/4,As=ie*2,oa=180/ie,Tr=ie/180,Mi=Math.abs,ZN=Math.atan,Pu=Math.atan2,Le=Math.cos,Fe=Math.sin,xu=Math.sqrt;function f1(i){return i>1?0:i<-1?ie:Math.acos(i)}function tl(i){return i>1?Rs:i<-1?-Rs:Math.asin(i)}function Mc(){}function yf(i,t){i&&p1.hasOwnProperty(i.type)&&p1[i.type](i,t)}var g1={Feature:function(i,t){yf(i.geometry,t)},FeatureCollection:function(i,t){for(var e=i.features,n=-1,r=e.length;++n<r;)yf(e[n].geometry,t)}},p1={Sphere:function(i,t){t.sphere()},Point:function(i,t){i=i.coordinates,t.point(i[0],i[1],i[2])},MultiPoint:function(i,t){for(var e=i.coordinates,n=-1,r=e.length;++n<r;)i=e[n],t.point(i[0],i[1],i[2])},LineString:function(i,t){pm(i.coordinates,t,0)},MultiLineString:function(i,t){for(var e=i.coordinates,n=-1,r=e.length;++n<r;)pm(e[n],t,0)},Polygon:function(i,t){m1(i.coordinates,t)},MultiPolygon:function(i,t){for(var e=i.coordinates,n=-1,r=e.length;++n<r;)m1(e[n],t)},GeometryCollection:function(i,t){for(var e=i.geometries,n=-1,r=e.length;++n<r;)yf(e[n],t)}};function pm(i,t,e){var n=-1,r=i.length-e,s;for(t.lineStart();++n<r;)s=i[n],t.point(s[0],s[1],s[2]);t.lineEnd()}function m1(i,t){var e=-1,n=i.length;for(t.polygonStart();++e<n;)pm(i[e],t,1);t.polygonEnd()}function KN(i,t){i&&g1.hasOwnProperty(i.type)?g1[i.type](i,t):yf(i,t)}sa(),sa();function mm(i){return[Pu(i[1],i[0]),tl(i[2])]}function Iu(i){var t=i[0],e=i[1],n=Le(e);return[n*Le(t),n*Fe(t),Fe(e)]}function _f(i,t){return i[0]*t[0]+i[1]*t[1]+i[2]*t[2]}function wf(i,t){return[i[1]*t[2]-i[2]*t[1],i[2]*t[0]-i[0]*t[2],i[0]*t[1]-i[1]*t[0]]}function vm(i,t){i[0]+=t[0],i[1]+=t[1],i[2]+=t[2]}function Ef(i,t){return[i[0]*t,i[1]*t,i[2]*t]}function ym(i){var t=xu(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);i[0]/=t,i[1]/=t,i[2]/=t}sa();function v1(i,t){function e(n,r){return n=i(n,r),t(n[0],n[1])}return i.invert&&t.invert&&(e.invert=function(n,r){return n=t.invert(n,r),n&&i.invert(n[0],n[1])}),e}function _m(i,t){return[i>ie?i-As:i<-ie?i+As:i,t]}_m.invert=_m;function QN(i,t,e){return(i%=As)?t||e?v1(_1(i),w1(t,e)):_1(i):t||e?w1(t,e):_m}function y1(i){return function(t,e){return t+=i,[t>ie?t-As:t<-ie?t+As:t,e]}}function _1(i){var t=y1(i);return t.invert=y1(-i),t}function w1(i,t){var e=Le(i),n=Fe(i),r=Le(t),s=Fe(t);function o(a,l){var u=Le(l),h=Le(a)*u,c=Fe(a)*u,d=Fe(l),g=d*e+h*n;return[Pu(c*r-g*s,h*e-d*n),tl(g*r+c*s)]}return o.invert=function(a,l){var u=Le(l),h=Le(a)*u,c=Fe(a)*u,d=Fe(l),g=d*r-c*s;return[Pu(c*r+d*s,h*e+g*n),tl(g*e-h*n)]},o}function tO(i,t,e,n,r,s){if(e){var o=Le(t),a=Fe(t),l=n*e;r==null?(r=t+n*As,s=t-l/2):(r=E1(o,r),s=E1(o,s),(n>0?r<s:r>s)&&(r+=n*As));for(var u,h=r;n>0?h>s:h<s;h-=l)u=mm([o,-a*Le(h),-a*Fe(h)]),i.point(u[0],u[1])}}function E1(i,t){t=Iu(t),t[0]-=i,ym(t);var e=f1(-t[1]);return((-t[2]<0?-e:e)+As-_e)%As}function S1(){var i=[],t;return{point:function(e,n){t.push([e,n])},lineStart:function(){i.push(t=[])},lineEnd:Mc,rejoin:function(){i.length>1&&i.push(i.pop().concat(i.shift()))},result:function(){var e=i;return i=[],t=null,e}}}function eO(i,t,e,n,r,s){var o=i[0],a=i[1],l=t[0],u=t[1],h=0,c=1,d=l-o,g=u-a,p;if(p=e-o,!(!d&&p>0)){if(p/=d,d<0){if(p<h)return;p<c&&(c=p)}else if(d>0){if(p>c)return;p>h&&(h=p)}if(p=r-o,!(!d&&p<0)){if(p/=d,d<0){if(p>c)return;p>h&&(h=p)}else if(d>0){if(p<h)return;p<c&&(c=p)}if(p=n-a,!(!g&&p>0)){if(p/=g,g<0){if(p<h)return;p<c&&(c=p)}else if(g>0){if(p>c)return;p>h&&(h=p)}if(p=s-a,!(!g&&p<0)){if(p/=g,g<0){if(p>c)return;p>h&&(h=p)}else if(g>0){if(p<h)return;p<c&&(c=p)}return h>0&&(i[0]=o+h*d,i[1]=a+h*g),c<1&&(t[0]=o+c*d,t[1]=a+c*g),!0}}}}}function Sf(i,t){return Mi(i[0]-t[0])<_e&&Mi(i[1]-t[1])<_e}function bf(i,t,e,n){this.x=i,this.z=t,this.o=e,this.e=n,this.v=!1,this.n=this.p=null}function b1(i,t,e,n,r){var s=[],o=[],a,l;if(i.forEach(function(p){if(!((E=p.length-1)<=0)){var E,b=p[0],P=p[E],v;if(Sf(b,P)){for(r.lineStart(),a=0;a<E;++a)r.point((b=p[a])[0],b[1]);r.lineEnd();return}s.push(v=new bf(b,p,null,!0)),o.push(v.o=new bf(b,null,v,!1)),s.push(v=new bf(P,p,null,!1)),o.push(v.o=new bf(P,null,v,!0))}}),!!s.length){for(o.sort(t),C1(s),C1(o),a=0,l=o.length;a<l;++a)o[a].e=e=!e;for(var u=s[0],h,c;;){for(var d=u,g=!0;d.v;)if((d=d.n)===u)return;h=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(g)for(a=0,l=h.length;a<l;++a)r.point((c=h[a])[0],c[1]);else n(d.x,d.n.x,1,r);d=d.n}else{if(g)for(h=d.p.z,a=h.length-1;a>=0;--a)r.point((c=h[a])[0],c[1]);else n(d.x,d.p.x,-1,r);d=d.p}d=d.o,h=d.z,g=!g}while(!d.v);r.lineEnd()}}}function C1(i){if(t=i.length){for(var t,e=0,n=i[0],r;++e<t;)n.n=r=i[e],r.p=n,n=r;n.n=r=i[0],r.p=n}}function P1(i,t){return i<t?-1:i>t?1:i>=t?0:NaN}function iO(i){return i.length===1&&(i=nO(i)),{left:function(t,e,n,r){for(n==null&&(n=0),r==null&&(r=t.length);n<r;){var s=n+r>>>1;i(t[s],e)<0?n=s+1:r=s}return n},right:function(t,e,n,r){for(n==null&&(n=0),r==null&&(r=t.length);n<r;){var s=n+r>>>1;i(t[s],e)>0?r=s:n=s+1}return n}}}function nO(i){return function(t,e){return P1(i(t),e)}}iO(P1);function x1(i){for(var t=i.length,e,n=-1,r=0,s,o;++n<t;)r+=i[n].length;for(s=new Array(r);--t>=0;)for(o=i[t],e=o.length;--e>=0;)s[--r]=o[e];return s}var Tc=1e9,Cf=-Tc;function rO(i,t,e,n){function r(u,h){return i<=u&&u<=e&&t<=h&&h<=n}function s(u,h,c,d){var g=0,p=0;if(u==null||(g=o(u,c))!==(p=o(h,c))||l(u,h)<0^c>0)do d.point(g===0||g===3?i:e,g>1?n:t);while((g=(g+c+4)%4)!==p);else d.point(h[0],h[1])}function o(u,h){return Mi(u[0]-i)<_e?h>0?0:3:Mi(u[0]-e)<_e?h>0?2:1:Mi(u[1]-t)<_e?h>0?1:0:h>0?3:2}function a(u,h){return l(u.x,h.x)}function l(u,h){var c=o(u,1),d=o(h,1);return c!==d?c-d:c===0?h[1]-u[1]:c===1?u[0]-h[0]:c===2?u[1]-h[1]:h[0]-u[0]}return function(u){var h=u,c=S1(),d,g,p,E,b,P,v,_,m,y,S,C={point:x,lineStart:R,lineEnd:A,polygonStart:M,polygonEnd:T};function x(V,G){r(V,G)&&h.point(V,G)}function I(){for(var V=0,G=0,q=g.length;G<q;++G)for(var at=g[G],dt=1,Q=at.length,K=at[0],it,Ct,Ht=K[0],Vt=K[1];dt<Q;++dt)it=Ht,Ct=Vt,K=at[dt],Ht=K[0],Vt=K[1],Ct<=n?Vt>n&&(Ht-it)*(n-Ct)>(Vt-Ct)*(i-it)&&++V:Vt<=n&&(Ht-it)*(n-Ct)<(Vt-Ct)*(i-it)&&--V;return V}function M(){h=c,d=[],g=[],S=!0}function T(){var V=I(),G=S&&V,q=(d=x1(d)).length;(G||q)&&(u.polygonStart(),G&&(u.lineStart(),s(null,null,1,u),u.lineEnd()),q&&b1(d,a,V,s,u),u.polygonEnd()),h=u,d=g=p=null}function R(){C.point=N,g&&g.push(p=[]),y=!0,m=!1,v=_=NaN}function A(){d&&(N(E,b),P&&m&&c.rejoin(),d.push(c.result())),C.point=x,m&&h.lineEnd()}function N(V,G){var q=r(V,G);if(g&&p.push([V,G]),y)E=V,b=G,P=q,y=!1,q&&(h.lineStart(),h.point(V,G));else if(q&&m)h.point(V,G);else{var at=[v=Math.max(Cf,Math.min(Tc,v)),_=Math.max(Cf,Math.min(Tc,_))],dt=[V=Math.max(Cf,Math.min(Tc,V)),G=Math.max(Cf,Math.min(Tc,G))];eO(at,dt,i,t,e,n)?(m||(h.lineStart(),h.point(at[0],at[1])),h.point(dt[0],dt[1]),q||h.lineEnd(),S=!1):q&&(h.lineStart(),h.point(V,G),S=!1)}v=V,_=G,m=q}return C}}var wm=sa();function sO(i,t){var e=t[0],n=t[1],r=[Fe(e),-Le(e),0],s=0,o=0;wm.reset();for(var a=0,l=i.length;a<l;++a)if(h=(u=i[a]).length)for(var u,h,c=u[h-1],d=c[0],g=c[1]/2+d1,p=Fe(g),E=Le(g),b=0;b<h;++b,d=v,p=m,E=y,c=P){var P=u[b],v=P[0],_=P[1]/2+d1,m=Fe(_),y=Le(_),S=v-d,C=S>=0?1:-1,x=C*S,I=x>ie,M=p*m;if(wm.add(Pu(M*C*Fe(x),E*y+M*Le(x))),s+=I?S+C*As:S,I^d>=e^v>=e){var T=wf(Iu(c),Iu(P));ym(T);var R=wf(r,T);ym(R);var A=(I^S>=0?-1:1)*tl(R[2]);(n>A||n===A&&(T[0]||T[1]))&&(o+=I^S>=0?1:-1)}}return(s<-_e||s<_e&&wm<-_e)^o&1}sa();function I1(i){return i}sa(),sa();var Mu=1/0,Pf=Mu,Nc=-Mu,xf=Nc,M1={point:oO,lineStart:Mc,lineEnd:Mc,polygonStart:Mc,polygonEnd:Mc,result:function(){var i=[[Mu,Pf],[Nc,xf]];return Nc=xf=-(Pf=Mu=1/0),i}};function oO(i,t){i<Mu&&(Mu=i),i>Nc&&(Nc=i),t<Pf&&(Pf=t),t>xf&&(xf=t)}sa();function T1(i,t,e,n){return function(r,s){var o=t(s),a=r.invert(n[0],n[1]),l=S1(),u=t(l),h=!1,c,d,g,p={point:E,lineStart:P,lineEnd:v,polygonStart:function(){p.point=_,p.lineStart=m,p.lineEnd=y,d=[],c=[]},polygonEnd:function(){p.point=E,p.lineStart=P,p.lineEnd=v,d=x1(d);var S=sO(c,a);d.length?(h||(s.polygonStart(),h=!0),b1(d,lO,S,e,s)):S&&(h||(s.polygonStart(),h=!0),s.lineStart(),e(null,null,1,s),s.lineEnd()),h&&(s.polygonEnd(),h=!1),d=c=null},sphere:function(){s.polygonStart(),s.lineStart(),e(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function E(S,C){var x=r(S,C);i(S=x[0],C=x[1])&&s.point(S,C)}function b(S,C){var x=r(S,C);o.point(x[0],x[1])}function P(){p.point=b,o.lineStart()}function v(){p.point=E,o.lineEnd()}function _(S,C){g.push([S,C]);var x=r(S,C);u.point(x[0],x[1])}function m(){u.lineStart(),g=[]}function y(){_(g[0][0],g[0][1]),u.lineEnd();var S=u.clean(),C=l.result(),x,I=C.length,M,T,R;if(g.pop(),c.push(g),g=null,!!I){if(S&1){if(T=C[0],(M=T.length-1)>0){for(h||(s.polygonStart(),h=!0),s.lineStart(),x=0;x<M;++x)s.point((R=T[x])[0],R[1]);s.lineEnd()}return}I>1&&S&2&&C.push(C.pop().concat(C.shift())),d.push(C.filter(aO))}}return p}}function aO(i){return i.length>1}function lO(i,t){return((i=i.x)[0]<0?i[1]-Rs-_e:Rs-i[1])-((t=t.x)[0]<0?t[1]-Rs-_e:Rs-t[1])}const N1=T1(function(){return!0},uO,cO,[-ie,-Rs]);function uO(i){var t=NaN,e=NaN,n=NaN,r;return{lineStart:function(){i.lineStart(),r=1},point:function(s,o){var a=s>0?ie:-ie,l=Mi(s-t);Mi(l-ie)<_e?(i.point(t,e=(e+o)/2>0?Rs:-Rs),i.point(n,e),i.lineEnd(),i.lineStart(),i.point(a,e),i.point(s,e),r=0):n!==a&&l>=ie&&(Mi(t-n)<_e&&(t-=n*_e),Mi(s-a)<_e&&(s-=a*_e),e=hO(t,e,s,o),i.point(n,e),i.lineEnd(),i.lineStart(),i.point(a,e),r=0),i.point(t=s,e=o),n=a},lineEnd:function(){i.lineEnd(),t=e=NaN},clean:function(){return 2-r}}}function hO(i,t,e,n){var r,s,o=Fe(i-e);return Mi(o)>_e?ZN((Fe(t)*(s=Le(n))*Fe(e)-Fe(n)*(r=Le(t))*Fe(i))/(r*s*o)):(t+n)/2}function cO(i,t,e,n){var r;if(i==null)r=e*Rs,n.point(-ie,r),n.point(0,r),n.point(ie,r),n.point(ie,0),n.point(ie,-r),n.point(0,-r),n.point(-ie,-r),n.point(-ie,0),n.point(-ie,r);else if(Mi(i[0]-t[0])>_e){var s=i[0]<t[0]?ie:-ie;r=e*s/2,n.point(-s,r),n.point(0,r),n.point(s,r)}else n.point(t[0],t[1])}function dO(i,t){var e=Le(i),n=e>0,r=Mi(e)>_e;function s(h,c,d,g){tO(g,i,t,d,h,c)}function o(h,c){return Le(h)*Le(c)>e}function a(h){var c,d,g,p,E;return{lineStart:function(){p=g=!1,E=1},point:function(b,P){var v=[b,P],_,m=o(b,P),y=n?m?0:u(b,P):m?u(b+(b<0?ie:-ie),P):0;if(!c&&(p=g=m)&&h.lineStart(),m!==g&&(_=l(c,v),(!_||Sf(c,_)||Sf(v,_))&&(v[0]+=_e,v[1]+=_e,m=o(v[0],v[1]))),m!==g)E=0,m?(h.lineStart(),_=l(v,c),h.point(_[0],_[1])):(_=l(c,v),h.point(_[0],_[1]),h.lineEnd()),c=_;else if(r&&c&&n^m){var S;!(y&d)&&(S=l(v,c,!0))&&(E=0,n?(h.lineStart(),h.point(S[0][0],S[0][1]),h.point(S[1][0],S[1][1]),h.lineEnd()):(h.point(S[1][0],S[1][1]),h.lineEnd(),h.lineStart(),h.point(S[0][0],S[0][1])))}m&&(!c||!Sf(c,v))&&h.point(v[0],v[1]),c=v,g=m,d=y},lineEnd:function(){g&&h.lineEnd(),c=null},clean:function(){return E|(p&&g)<<1}}}function l(h,c,d){var g=Iu(h),p=Iu(c),E=[1,0,0],b=wf(g,p),P=_f(b,b),v=b[0],_=P-v*v;if(!_)return!d&&h;var m=e*P/_,y=-e*v/_,S=wf(E,b),C=Ef(E,m),x=Ef(b,y);vm(C,x);var I=S,M=_f(C,I),T=_f(I,I),R=M*M-T*(_f(C,C)-1);if(!(R<0)){var A=xu(R),N=Ef(I,(-M-A)/T);if(vm(N,C),N=mm(N),!d)return N;var V=h[0],G=c[0],q=h[1],at=c[1],dt;G<V&&(dt=V,V=G,G=dt);var Q=G-V,K=Mi(Q-ie)<_e,it=K||Q<_e;if(!K&&at<q&&(dt=q,q=at,at=dt),it?K?q+at>0^N[1]<(Mi(N[0]-V)<_e?q:at):q<=N[1]&&N[1]<=at:Q>ie^(V<=N[0]&&N[0]<=G)){var Ct=Ef(I,(-M+A)/T);return vm(Ct,C),[N,mm(Ct)]}}}function u(h,c){var d=n?i:ie-i,g=0;return h<-d?g|=1:h>d&&(g|=2),c<-d?g|=4:c>d&&(g|=8),g}return T1(o,a,s,n?[0,-i]:[-ie,i-ie])}function O1(i){return function(t){var e=new Em;for(var n in i)e[n]=i[n];return e.stream=t,e}}function Em(){}Em.prototype={constructor:Em,point:function(i,t){this.stream.point(i,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function D1(i,t,e){var n=t[1][0]-t[0][0],r=t[1][1]-t[0][1],s=i.clipExtent&&i.clipExtent();i.scale(150).translate([0,0]),s!=null&&i.clipExtent(null),KN(e,i.stream(M1));var o=M1.result(),a=Math.min(n/(o[1][0]-o[0][0]),r/(o[1][1]-o[0][1])),l=+t[0][0]+(n-a*(o[1][0]+o[0][0]))/2,u=+t[0][1]+(r-a*(o[1][1]+o[0][1]))/2;return s!=null&&i.clipExtent(s),i.scale(a*150).translate([l,u])}function fO(i,t,e){return D1(i,[[0,0],t],e)}var R1=16,gO=Le(30*Tr);function A1(i,t){return+t?mO(i,t):pO(i)}function pO(i){return O1({point:function(t,e){t=i(t,e),this.stream.point(t[0],t[1])}})}function mO(i,t){function e(n,r,s,o,a,l,u,h,c,d,g,p,E,b){var P=u-n,v=h-r,_=P*P+v*v;if(_>4*t&&E--){var m=o+d,y=a+g,S=l+p,C=xu(m*m+y*y+S*S),x=tl(S/=C),I=Mi(Mi(S)-1)<_e||Mi(s-c)<_e?(s+c)/2:Pu(y,m),M=i(I,x),T=M[0],R=M[1],A=T-n,N=R-r,V=v*A-P*N;(V*V/_>t||Mi((P*A+v*N)/_-.5)>.3||o*d+a*g+l*p<gO)&&(e(n,r,s,o,a,l,T,R,I,m/=C,y/=C,S,E,b),b.point(T,R),e(T,R,I,m,y,S,u,h,c,d,g,p,E,b))}}return function(n){var r,s,o,a,l,u,h,c,d,g,p,E,b={point:P,lineStart:v,lineEnd:m,polygonStart:function(){n.polygonStart(),b.lineStart=y},polygonEnd:function(){n.polygonEnd(),b.lineStart=v}};function P(x,I){x=i(x,I),n.point(x[0],x[1])}function v(){c=NaN,b.point=_,n.lineStart()}function _(x,I){var M=Iu([x,I]),T=i(x,I);e(c,d,h,g,p,E,c=T[0],d=T[1],h=x,g=M[0],p=M[1],E=M[2],R1,n),n.point(c,d)}function m(){b.point=P,n.lineEnd()}function y(){v(),b.point=S,b.lineEnd=C}function S(x,I){_(r=x,I),s=c,o=d,a=g,l=p,u=E,b.point=_}function C(){e(c,d,h,g,p,E,s,o,r,a,l,u,R1,n),b.lineEnd=m,m()}return b}}var vO=O1({point:function(i,t){this.stream.point(i*Tr,t*Tr)}});function yO(i){return _O(function(){return i})()}function _O(i){var t,e=150,n=480,r=250,s,o,a=0,l=0,u=0,h=0,c=0,d,g,p=null,E=N1,b=null,P,v,_,m=I1,y=.5,S=A1(T,y),C,x;function I(N){return N=g(N[0]*Tr,N[1]*Tr),[N[0]*e+s,o-N[1]*e]}function M(N){return N=g.invert((N[0]-s)/e,(o-N[1])/e),N&&[N[0]*oa,N[1]*oa]}function T(N,V){return N=t(N,V),[N[0]*e+s,o-N[1]*e]}I.stream=function(N){return C&&x===N?C:C=vO(E(d,S(m(x=N))))},I.clipAngle=function(N){return arguments.length?(E=+N?dO(p=N*Tr,6*Tr):(p=null,N1),A()):p*oa},I.clipExtent=function(N){return arguments.length?(m=N==null?(b=P=v=_=null,I1):rO(b=+N[0][0],P=+N[0][1],v=+N[1][0],_=+N[1][1]),A()):b==null?null:[[b,P],[v,_]]},I.scale=function(N){return arguments.length?(e=+N,R()):e},I.translate=function(N){return arguments.length?(n=+N[0],r=+N[1],R()):[n,r]},I.center=function(N){return arguments.length?(a=N[0]%360*Tr,l=N[1]%360*Tr,R()):[a*oa,l*oa]},I.rotate=function(N){return arguments.length?(u=N[0]%360*Tr,h=N[1]%360*Tr,c=N.length>2?N[2]%360*Tr:0,R()):[u*oa,h*oa,c*oa]},I.precision=function(N){return arguments.length?(S=A1(T,y=N*N),A()):xu(y)},I.fitExtent=function(N,V){return D1(I,N,V)},I.fitSize=function(N,V){return fO(I,N,V)};function R(){g=v1(d=QN(u,h,c),t);var N=t(a,l);return s=n-N[0]*e,o=r+N[1]*e,A()}function A(){return C=x=null,I}return function(){return t=i.apply(this,arguments),I.invert=t.invert&&M,R()}}function L1(i){return function(t,e){var n=Le(t),r=Le(e),s=i(n*r);return[s*r*Fe(t),s*Fe(e)]}}function F1(i){return function(t,e){var n=xu(t*t+e*e),r=i(n),s=Fe(r),o=Le(r);return[Pu(t*s,n*o),tl(n&&e*s/n)]}}var wO=L1(function(i){return xu(2/(1+i))});wO.invert=F1(function(i){return 2*tl(i/2)});var k1=L1(function(i){return(i=f1(i))&&i/Fe(i)});k1.invert=F1(function(i){return i});function EO(){return yO(k1).scale(79.4188).clipAngle(179.999)}function G1(i,t){return[i,t]}G1.invert=G1;function SO(i,t,e){e=e||{};var n=e.units||"kilometers",r=e.steps||8;if(!i)throw new Error("geojson is required");if(typeof e!="object")throw new Error("options must be an object");if(typeof r!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(r<=0)throw new Error("steps must be greater than 0");var s=[];switch(i.type){case"GeometryCollection":return Wd(i,function(o){var a=If(o,t,n,r);a&&s.push(a)}),Fn(s);case"FeatureCollection":return Ql(i,function(o){var a=If(o,t,n,r);a&&Ql(a,function(l){l&&s.push(l)})}),Fn(s)}return If(i,t,n,r)}function If(i,t,e,n){var r=i.properties||{},s=i.type==="Feature"?i.geometry:i;if(s.type==="GeometryCollection"){var o=[];return Wd(i,function(E){var b=If(E,t,e,n);b&&o.push(b)}),Fn(o)}var a=bO(s),l={type:s.type,coordinates:V1(s.coordinates,a)},u=new sm,h=u.read(l),c=Tp(Np(t,e),"meters"),d=ri.bufferOp(h,c,n),g=new Ww;if(d=g.write(d),!j1(d.coordinates)){var p={type:d.type,coordinates:z1(d.coordinates,a)};return lr(p,r)}}function j1(i){return Array.isArray(i[0])?j1(i[0]):isNaN(i[0])}function V1(i,t){return typeof i[0]!="object"?t(i):i.map(function(e){return V1(e,t)})}function z1(i,t){return typeof i[0]!="object"?t.invert(i):i.map(function(e){return z1(e,t)})}function bO(i){var t=Y_(i).geometry.coordinates,e=[-t[0],-t[1]];return EO().rotate(e).scale(Ni)}function CO(i,t,e){e===void 0&&(e={});var n=Bi(i),r=Bi(t),s=Jp.union(n.coordinates,r.coordinates);return s.length===0?null:s.length===1?ue(s[0],e.properties):Mp(s,e.properties)}function Oc(i,t,e){e===void 0&&(e={});var n=Bi(i),r=Bi(t),s=Jp.intersection(n.coordinates,r.coordinates);return s.length===0?null:s.length===1?ue(s[0],e.properties):Mp(s,e.properties)}function PO(i,t,e){e===void 0&&(e={});var n=JSON.stringify(e.properties||{}),r=i[0],s=i[1],o=i[2],a=i[3],l=(s+a)/2,u=(r+o)/2,h=t*2/di([r,l],[o,l],e),c=h*(o-r),d=t*2/di([u,s],[u,a],e),g=d*(a-s),p=c/2,E=p*2,b=Math.sqrt(3)/2*g,P=o-r,v=a-s,_=3/4*E,m=b,y=(P-E)/(E-p/2),S=Math.floor(y),C=(S*_-p/2-P)/2-p/2+_/2,x=Math.floor((v-b)/b),I=(v-x*b)/2,M=x*b-v>b/2;M&&(I-=b/4);for(var T=[],R=[],A=0;A<6;A++){var N=2*Math.PI/6*A;T.push(Math.cos(N)),R.push(Math.sin(N))}for(var V=[],G=0;G<=S;G++)for(var q=0;q<=x;q++){var at=G%2===1;if(!(q===0&&at)&&!(q===0&&M)){var dt=G*_+r-C,Q=q*m+s+I;if(at&&(Q-=b/2),e.triangles===!0)IO([dt,Q],c/2,g/2,JSON.parse(n),T,R).forEach(function(it){e.mask?Oc(e.mask,it)&&V.push(it):V.push(it)});else{var K=xO([dt,Q],c/2,g/2,JSON.parse(n),T,R);e.mask?Oc(e.mask,K)&&V.push(K):V.push(K)}}}return Fn(V)}function xO(i,t,e,n,r,s){for(var o=[],a=0;a<6;a++){var l=i[0]+t*r[a],u=i[1]+e*s[a];o.push([l,u])}return o.push(o[0].slice()),ue([o],n)}function IO(i,t,e,n,r,s){for(var o=[],a=0;a<6;a++){var l=[];l.push(i),l.push([i[0]+t*r[a],i[1]+e*s[a]]),l.push([i[0]+t*r[(a+1)%6],i[1]+e*s[(a+1)%6]]),l.push(i),o.push(ue([l],n))}return o}function MO(i,t,e,n){n===void 0&&(n={});for(var r=[],s=i[0],o=i[1],a=i[2],l=i[3],u=t/di([s,o],[a,o],n),h=u*(a-s),c=e/di([s,o],[s,l],n),d=c*(l-o),g=a-s,p=l-o,E=Math.floor(g/h),b=Math.floor(p/d),P=(g-E*h)/2,v=(p-b*d)/2,_=s+P,m=0;m<E;m++){for(var y=o+v,S=0;S<b;S++){var C=ue([[[_,y],[_,y+d],[_+h,y+d],[_+h,y],[_,y]]],n.properties);n.mask?uN(n.mask,C)&&r.push(C):r.push(C),y+=d}_+=h}return Fn(r)}function TO(i,t,e){return e===void 0&&(e={}),MO(i,t,t,e)}function NO(i,t,e){e===void 0&&(e={});for(var n=[],r=t/di([i[0],i[1]],[i[2],i[1]],e),s=r*(i[2]-i[0]),o=t/di([i[0],i[1]],[i[0],i[3]],e),a=o*(i[3]-i[1]),l=0,u=i[0];u<=i[2];){for(var h=0,c=i[1];c<=i[3];){var d=null,g=null;l%2===0&&h%2===0?(d=ue([[[u,c],[u,c+a],[u+s,c],[u,c]]],e.properties),g=ue([[[u,c+a],[u+s,c+a],[u+s,c],[u,c+a]]],e.properties)):l%2===0&&h%2===1?(d=ue([[[u,c],[u+s,c+a],[u+s,c],[u,c]]],e.properties),g=ue([[[u,c],[u,c+a],[u+s,c+a],[u,c]]],e.properties)):h%2===0&&l%2===1?(d=ue([[[u,c],[u,c+a],[u+s,c+a],[u,c]]],e.properties),g=ue([[[u,c],[u+s,c+a],[u+s,c],[u,c]]],e.properties)):h%2===1&&l%2===1&&(d=ue([[[u,c],[u,c+a],[u+s,c],[u,c]]],e.properties),g=ue([[[u,c+a],[u+s,c+a],[u+s,c],[u,c+a]]],e.properties)),e.mask?(Oc(e.mask,d)&&n.push(d),Oc(e.mask,g)&&n.push(g)):(n.push(d),n.push(g)),c+=a,h++}l++,u+=s}return Fn(n)}function OO(i,t,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var n=e.gridType,r=e.property,s=e.weight;if(!i)throw new Error("points is required");if(J2(i,"Point","input must contain Points"),!t)throw new Error("cellSize is required");if(s!==void 0&&typeof s!="number")throw new Error("weight must be a number");r=r||"elevation",n=n||"square",s=s||1;var o=ur(i),a;switch(n){case"point":case"points":a=BT(o,t,e);break;case"square":case"squares":a=TO(o,t,e);break;case"hex":case"hexes":a=PO(o,t,e);break;case"triangle":case"triangles":a=NO(o,t,e);break;default:throw new Error("invalid gridType")}var l=[];return Ql(a,function(u){var h=0,c=0;Ql(i,function(g){var p=n==="point"?u:Lp(u),E=di(p,g,e),b;if(r!==void 0&&(b=g.properties[r]),b===void 0&&(b=g.geometry.coordinates[2]),b===void 0)throw new Error("zValue is missing");E===0&&(h=b);var P=1/Math.pow(E,s);c+=P,h+=P*b});var d=dT(u);d.properties[r]=h/c,l.push(d)}),Fn(l)}function DO(i,t){const e=i[0],n=i[i.length-1];(e[0]!==n[0]||e[1]!==n[1]||e[2]!==n[2])&&i.push(e);const r=Kt(t),s=ue([i]);return _i(r,s)}function RO(i,t){const e=yi(i);return jp(e,t,{units:"meters"}).geometry.coordinates}function Sm(i){if((i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),i.length<=3)return 0;const t=ue([i]);return OT(t)}function AO(i){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]);const t=ue([i]),n=J_(t).geometry.coordinates;return[n[0],n[1],n[2]??i[0][2]??0]}function bm(...i){let[t,e,n,r]=i;const[s,o,a]=t;if(Array.isArray(e)){const[l,u,h]=e,c=Math.sqrt(l*l+u*u);let d=0;c>0&&(d=Math.atan2(l,u)*(180/Math.PI),d<0&&(d+=360));const g=hr(Kt([s,o]),c,d,{units:"meters"});return!g||!g.geometry||!g.geometry.coordinates?void 0:(n=n||[0,0,0],n[0]=g.geometry.coordinates[0],n[1]=g.geometry.coordinates[1],n[2]=a+(h||0),n)}else{const l=hr(Kt([s,o]),e,n,{units:"meters"});return!l||!l.geometry||!l.geometry.coordinates?void 0:(r=r||[0,0,0],r[0]=l.geometry.coordinates[0],r[1]=l.geometry.coordinates[1],r[2]=a,r)}}function Mf(i,t){return di(Kt(i),Kt(t),{units:"meters"})}function Dc(i,t){return tu(Kt(i),Kt(t))}function LO(i,t){return Fa(yi(i),yi(t))}function FO(i,t){const e=Kt(i),n=Kt(t),r=mT(e,n),s=(i[2]+t[2])/2;return[...r.geometry.coordinates,s]}function kO(i,t){const e=Kt(t),n=yi(i);return IT(n,e,{units:"meters"})}function GO(i,t){const e=Kt(i),n=yi(t);return TT(e,n,{units:"meters"})}function jO(i,t,e,n){const[r,s,o]=i,a=HT(Kt([r,s]),t,e,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return n=n||[0,0,0],n[0]=a.geometry.coordinates[0],n[1]=a.geometry.coordinates[1],n[2]=o,n}function B1(i,t){return ow(Kt(i),Kt(t),{units:"meters"})}function VO(i,t){return WT(Kt(i),Kt(t))}function U1(i,t){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=Oc(ue([i]),ue([t]));if(e)return e.geometry.coordinates}function q1(i,t){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=CO(ue([i]),ue([t]));if(e)return e.geometry.coordinates}function W1(i,t=500,e="meters"){const n=SO(yi(i),t,{units:e});if(n)return n.geometry.coordinates}function H1(i,t){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=RN(ue([i]),ue([t]));if(e)return e.geometry.coordinates}function X1(i,t,e=10,n="meters"){return gT(i,t,{steps:e,units:n}).geometry.coordinates}function Cm(i,t){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=ue([i]),n=ue([t]);return tN(e,n)?"oneBig":dw(e,n)?"twoBig":!1}function Tf(i){const t=Ao(xa(i,["0"])),e=Ao(xa(i,["1"])),n=Ao(xa(i,["2"])),r=to(xa(i,["0"])),s=to(xa(i,["1"])),o=to(xa(i,["2"]));return{minPos:[t,e,n],maxPos:[r,s,o],center:[(t+r)*.5,(e+s)*.5,(n+o)*.5]}}function $1(i){const{minPos:t,maxPos:e,center:n}=Tf(i);if(t.some(a=>!Number.isFinite(a)||e.some(l=>!Number.isFinite(l))||n.some(l=>!Number.isFinite(l)))){console.warn("geoCenterAndRadiusFromPositions error: minPos.some(e => !Number.isFinite(e) || maxPos.some(e => !Number.isFinite(e)) || center.some(e => !Number.isFinite(e))");return}const r=Mf(t,e);let s=r*.5;const o=Math.abs(t[2]-e[2]);return o!=0&&(s=Math.sqrt(r*r+o*o)*.5),{center:n,radius:s}}function Y1(i,t){const e=jr(i),n=jr(t);return w.Vector.distance(e,n)}function _o(i,t){const e=[],n=i.length;let r=0;for(let s=0;s<n-1;++s){if(t===void 0||t==="GEODESIC"){const o=Mf(i[s],i[s+1]),a=Math.abs(i[s][2]-i[s+1][2]);if(a===0)r+=o;else{const l=Math.sqrt(o*o+a*a);r+=l}}else if(t==="RHUMB"){const o=B1(i[s],i[s+1]),a=Math.abs(i[s][2]-i[s+1][2]);if(a===0)r+=o;else{const l=Math.sqrt(o*o+a*a);r+=l}}else if(t==="NONE"){const o=Y1(i[s],i[s+1]);r+=o}else console.warn(`未知的arcType: ${t},导致距离无法计算!`);e.push(r)}return e}function Pm(i){const t="__getXyzFromPostion";let e=An(i,t);return(!e||!w.Vector.equals(e[0],i))&&(e=[[...i],jr(i)],ps(i,t,e)),e[1]}class zO{constructor(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(let e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(let e=0;e<this.length-1;e++){const n=this.points[e],r=this.points[e+1];this.centers.push({x:(n.x+r.x)/2,y:(n.y+r.y)/2,z:(n.z+r.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(let e=0;e<this.centers.length-1;e++){const n=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,r=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,s=this.points[e+1].z-(this.centers[e].z+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+n),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+r),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+s)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+n),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+r),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+s)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}cacheSteps(t){const e=[];let n=this.pos(0);e.push(0);for(let r=0;r<this.duration;r+=10){const s=this.pos(r);Math.sqrt((s.x-n.x)*(s.x-n.x)+(s.y-n.y)*(s.y-n.y)+(s.z-n.z)*(s.z-n.z))>t&&(e.push(r),n=s)}return e}vector(t){const e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}}pos(t){let e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);const n=e/this.duration;if(n>=1)return this.points[this.length-1];const r=Math.floor((this.points.length-1)*n),s=(this.length-1)*n-r;return BO(s,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])}}function BO(i,t,e,n,r){const s=UO(i);return{x:r.x*s[0]+n.x*s[1]+e.x*s[2]+t.x*s[3],y:r.y*s[0]+n.y*s[1]+e.y*s[2]+t.y*s[3],z:r.z*s[0]+n.z*s[1]+e.z*s[2]+t.z*s[3]}}function UO(i){const t=i*i;return[t*i,3*t*(1-i),3*i*(1-i)*(1-i),(1-i)*(1-i)*(1-i)]}function qO(i,t){t===void 0&&(t={});var e=t.resolution||1e3,n=t.sharpness||.85;const r=[],s=i.map(u=>{const[h,c,d]=jr(u);return{x:h,y:c,z:d}});for(var o=new zO({duration:e,points:s,sharpness:n}),a=function(u){var h=o.pos(u);const c=Ip([h.x,h.y,h.z]);r.push(c)},l=0;l<o.duration;l+=10)a(l);return a(o.duration),r}function Tu(i,t,e){return qO(i,{resolution:t,sharpness:e})}function xm(i){return Do(i,(t,e)=>t[0]===e[0]&&t[1]===e[1],t=>[...t])}function J1(i,t){const e=new Array;for(let n of i)e.push(t(n));return e}function Nf(i,t){return i===void 0&&t===void 0?!0:!i||!t?!1:i[0]===t[0]&&i[1]===t[1]&&i[2]===t[2]}function Z1(i,t,e){var r;((r=t.attachedViewers.values().toArray()[0])==null?void 0:r.getEngineObject(t))?e.call(i):requestAnimationFrame(()=>Z1(i,t,e))}function WO(i,t,e,n=!0){n&&e(),i.dispose(t.disposableOn(e))}function HO(i,t){const{type:e,id:n}=i;if(e){const r=pt.create(e,n);if(r)return r.json=i,r;console.warn(`cannot create sceneObject from type(${e})`)}else console.warn(`cannot create sceneObject from type(${e})`)}function K1(i){const t=i.children&&Cg(i.children,n=>{if(!(n instanceof gn))throw new Error("!(treeItem instanceof SceneTreeItem)");return!n.show})||!1,e=i.sceneTree.getSceneObjectShowFunc(i.sceneObject);return!t||e}class gn extends Rh{constructor(e,n=!1,r,s,o=!0){super(e,n,r);f(this,"_dragDrop");f(this,"_showChangedNotAffectChildren",!1);f(this,"_showChangedNotAffectParent",!1);f(this,"_type",this.dv(z("Unknown")));f(this,"_isExport",this.dv(z(!0)));const a=()=>this.tree&&this.tree.itemsChanged.emit([this]);this.dispose(this.nameChanged.disposableOn(a)),this.name=`未命名条目(${this.id})`,this.extras=s,this._isExport.value=o;let l;const u=()=>{l&&(l(),l=void 0)};this.dispose(u),this.dispose(this.sceneObjectChanged.disposableOn(h=>{u(),h&&(l=lt([this,"name"],[h,"name"]))})),this.dispose(this.showChanged.disposableOn(h=>{if(e.setSceneObjectShowFunc(this.sceneObject,h),this.tree&&this.tree.forceRedraw(),this.children&&!this._showChangedNotAffectChildren)for(let c of this.children)c instanceof gn&&(c._showChangedNotAffectParent=!0,c.show=h,c._showChangedNotAffectParent=!1);this.parent&&this.parent instanceof gn&&!this._showChangedNotAffectParent&&(this.parent._showChangedNotAffectChildren=!0,this.parent.show=K1(this.parent),this.parent._showChangedNotAffectChildren=!1)})),this.dv(new qe(this.sceneObjectChanged,()=>{if(!this.sceneObject)return;const h=new B;if("show"in this.sceneObject&&"showChanged"in this.sceneObject&&this.sceneObject.showChanged instanceof O){const c=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};c(),h.dispose(this.sceneObject.showChanged.disposableOn(c))}else if("enabled"in this.sceneObject&&"enabledChanged"in this.sceneObject&&this.sceneObject.enabledChanged instanceof O){const c=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};c(),h.dispose(this.sceneObject.enabledChanged.disposableOn(c))}return h})),this.childrenChangedEvent.disposableOn(()=>{const h=K1(this);this._showChangedNotAffectChildren=!0,this.show=h,this._showChangedNotAffectChildren=!1});{const h=()=>{let c="Unknown";this.sceneObject?c=this.sceneObject.typeName:this.children&&(c="Folder"),this._type.value=c};this.dispose(this.sceneObjectChanged.disposableOn(h)),this.dispose(this.childrenResetedEvent.disposableOn(h)),h()}}get dragDrop(){return this._dragDrop||(this._dragDrop=this.dv(this.sceneTree.createTreeItemDragDropFunc(this))),this._dragDrop}get type(){return this._type.value}get typeChanged(){return this._type.changed}get isExport(){return this._isExport.value}get isExportChanged(){return this._isExport.changed}set isExport(e){this._isExport.value=e}get sceneTree(){return this.tree}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){try{this.json=JSON.parse(e)}catch(n){console.error(`sceneTreeItem.jsonStr error ${n}`,n)}}get completeJson(){const e=this.children&&[...this.children].filter(n=>n.isExport).map(n=>n.completeJson);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.completeJson,children:e,extras:this.extras}}get json(){const e=this.children&&[...this.children].filter(n=>n.isExport).map(n=>n.json);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.json,children:e,extras:this.extras}}set json(e){if(e.name!==void 0&&(this.name=e.name),this.extras=e.extras,this._showChangedNotAffectChildren=!0,this._showChangedNotAffectParent=!0,this.show=e.show??!0,this._showChangedNotAffectChildren=!1,this._showChangedNotAffectParent=!1,this.uiTreeObject.collapsed=e.collapsed??!1,this.sceneObject=void 0,e.sceneObj&&(this.sceneObject=this.sceneTree.createSceneObjectFunc(e.sceneObj,this)),!!e.children){if(this.resetChildren(!0),!this.children)throw new Error("resetChildren(true) cannot get children!");for(let n of e.children){const r=new gn(this.tree,!0);r.json=n,this.children.push(r)}}}clone(){try{const e=new gn(this.sceneTree,!!this.children,void 0,this.extras,this.isExport);return e.json=this.json,e.name=this.sceneTree.getSceneTreeItemCloneNameFunc(this),e}catch(e){console.error(`SceneTreeItem.clone error: ${e}`,e)}}insertNewTreeItem(e,n){if(e==="FolderInnerOrAfter"||e==="FolderInnerOrBefore"||e==="FolderInner"){if(n&&n.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&!(e.includes("Or")&&this.sceneObject))return n&&this.children.push(n),!0;if(e==="FolderInner")return!1;if(e==="FolderInnerOrAfter")return super.insertNewTreeItem("After",n);if(e==="FolderInnerOrBefore")return super.insertNewTreeItem("Before",n);throw new Error("should not be here!")}else return super.insertNewTreeItem(e,n)}}(i=>{i.createDefaultProps=()=>({name:"未命名条目",nameEditing:!1,sceneObject:void 0,show:!0,extras:fe(void 0)})})(gn||(gn={})),Ro(gn.prototype,gn.createDefaultProps);function Q1(i,t,e){let{offsetY:n}=t;if(!t.target||!("clientTop"in t.target))return"none";n+=2,n+=t.target.clientTop;let r="none";return i.children?n<=e*.3?r="before":n>=e*.7?!i.uiTreeObject.collapsed&&i.children.length>0?r="inner":r="after":r="inner":n<=e*.5?r="before":r="after",r}class tE extends Ty{constructor(t){super(),this._treeItem=t;const{dragStartDataManager:e}=this._treeItem.sceneTree;let n="none";const r=this.disposeVar(L0(()=>{this._treeItem.uiTreeObject.moveToPositionMode=n,console.log(`uiTreeObject.moveToPositionMode = lastDragMode(${n});`)},200));function s(o){n!==o&&(n=o,r.restart())}this.dispose(this._dragStartEvent.disposableOn(o=>{e.data={type:"UITreeA",value:this._treeItem}})),this.dispose(this._dragOverEvent.disposableOn(o=>{if(!o.dataTransfer)return;o.preventDefault();const a=e;if(a.data&&a.data.type==="UITreeA"&&a.data.value!==void 0){const l=a.data.value,u=this._treeItem,{tree:h}=u;if(h){const c=[...h.selectedItems];~c.indexOf(l)||c.push(l);const d=Q1(u,o,h.itemDivHeight);if(d!=="none"&&Oa.canMoveToTreeItems(c,u,d)){o.dataTransfer.dropEffect="move",s(d);return}}}o.dataTransfer.dropEffect="none",s("none")})),this.dispose(this._dropEvent.disposableOn(o=>{const a=e;if(!(a.data&&a.data.type==="UITreeA"&&a.data.value!==void 0))return;const l=a.data.value,u=this._treeItem,{tree:h}=u;if(!h)return;const c=[...h.selectedItems];~c.indexOf(l)||c.push(l);const d=Q1(u,o,h.itemDivHeight);d!=="none"&&Oa.canMoveToTreeItems(c,u,d)&&(Oa.moveToTreeItems(c,u,d),a.data=void 0,s("none"))})),this.dispose(this._dragLeaveEvent.disposableOn(()=>{n="none",r.restart()}))}}function XO(i){if(!(i instanceof gn))throw new Error("defaultCreateTreeItemDragDrop !(treeItem instanceof SceneTreeItem)");return new tE(i)}function $O(i){let t=!1;return i&&("show"in i?t=i.show??!0:"enabled"in i&&(t=i.enabled??!0)),t}function YO(i,t){i&&("show"in i?i.show=t:"enabled"in i&&(i.enabled=t))}const JO=["EnvironmentVariables","ScriptsLoader","SceneScript","ScriptLoader"];function ZO(i){const t=[],{root:e={}}=i,n=[e];for(;n.length>0;){const r=n.pop();if(!r)throw new Error("!todo");if(r.children){for(let s of r.children)if(s.children&&n.unshift(s),s.sceneObj){const{type:o=void 0}=s.sceneObj;o||(console.warn("sceneObjJson has no type! treeItem.sceneObj: "),console.warn(s.sceneObj)),o&&JO.includes(o)&&t.push(s.sceneObj)}}}return t}async function KO(i,t){const e=ZO(i);let n=0;const r=e.length;for(let s of e)if(++n,t){const o=n/r;t(o,n,r)}}class eE extends B{constructor(e,n){super();f(this,"treeItemContexMenuCallback");this._sceneTree=e,this._projectManager=n}get sceneTree(){return this._sceneTree}}class QO extends B{constructor(e){super();f(this,"_jsonLoadingEvent",this.disposeVar(new O));f(this,"_setJsonProcessing",this.disposeVar(Ln(async(e,n)=>{this._jsonLoadingEvent.emit({type:"init"}),this._jsonLoadingEvent.emit({type:"loading"}),n&&await e.promise(this._sceneTree.preloadFunc(n)),this._setJson(n),this._jsonLoadingEvent.emit({type:"loaded"})})));this._sceneTree=e,this._setJsonProcessing.errorFunc=n=>{this._jsonLoadingEvent.emit({type:"error",error:n})}}get jsonLoadingEvent(){return this._jsonLoadingEvent}_setJson(e){try{this._sceneTree.setJson(e||{})}catch(n){console.error(`json数据装配时发生错误!error: ${n}`)}}get json(){return this._sceneTree.getJson()}set json(e){this._setJsonProcessing.restart(new Fr("JSON重新赋值!"),e)}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){this.json=JSON.parse(e)}}function tD(i){return i.name+"_clone"}function Im(i,t,e){if(i instanceof gn)return i.insertNewTreeItem(t,e);{const n={FolderInnerOrAfter:"InnerOrAfter",FolderInnerOrBefore:"InnerOrBefore",FolderInner:"Inner",InnerOrAfter:"InnerOrAfter",InnerOrBefore:"InnerOrBefore",Inner:"Inner",After:"After",Before:"Before"};return i.insertNewTreeItem(n[t],e)}}function eD(i){[i,...i.getDescendants()].forEach(t=>t.destroy())}const Dn=class Dn extends Oa{constructor(e,n,r,s){super(r);f(this,"_jsonLoading",this.disposeVar(new QO(this)));f(this,"createSceneObjectFunc",Dn.defaultCreateSceneObjectFunc);f(this,"createTreeItemDragDropFunc",Dn.defaultCreateTreeItemDragDropFunc);f(this,"preloadFunc",Dn.defaultPreload);f(this,"getSceneObjectShowFunc",Dn.defaultGetSceneObjectShow);f(this,"setSceneObjectShowFunc",Dn.defaultSetSceneObjectShow);f(this,"getSceneTreeItemCloneNameFunc",Dn.defaultGetSceneTreeItemCloneNameFunc);f(this,"debug",!1);f(this,"_contextMenu",this.disposeVar(new eE(this,this.projectManager)));f(this,"_showPropUiOnSelecting",this.disposeVar(z(!0)));this._name=e,this._dragStartDataManager=n,this._projectManager=s,this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{var a,l;window.lssn=this.lastSelectedItem,window.lsso=(a=this.lastSelectedItem)==null?void 0:a.sceneObject,this.debug&&console.log(((l=this.lastSelectedItem)==null?void 0:l.sceneObject)??"select null")}));const{sceneObjectsManager:o}=this._projectManager;this.dispose(this.itemsDeleted.disposableOn(a=>{for(let l of a){const u=l,{sceneObject:h}=u;h&&o.deleteSceneObject(h)&&h.destroy()&&Pd(h,void 0);for(let c of u.getDescendants()){const{sceneObject:d}=c;d&&o.deleteSceneObject(d)&&d.destroy()&&Pd(d,void 0)}eD(l)}})),this.dispose(this.itemsAdded.disposableOn(a=>{for(let l of a){const u=l;u.sceneObject&&o.addSceneObject(u.sceneObject)&&Pd(u.sceneObject,u)}}))}get json(){return this._jsonLoading.json}set json(e){this._jsonLoading.json=e}get jsonStr(){return this._jsonLoading.jsonStr}set jsonStr(e){this._jsonLoading.jsonStr=e}get jsonLoadingEvent(){return this._jsonLoading.jsonLoadingEvent}get name(){return this._name}get projectManager(){return this._projectManager}get contextMenu(){return this._contextMenu}get showPropUiOnSelecting(){return this._showPropUiOnSelecting.value}set showPropUiOnSelecting(e){this._showPropUiOnSelecting.value=e}get showPropUiOnSelectingChanged(){return this._showPropUiOnSelecting.changed}get sceneUiTree(){return this.uiTree}getTreeItemFromSceneObjId(e){const n=this.getDescendants();let r;for(let s of n)if(s.sceneObject&&s.sceneObject.id===e){r=s;break}return r}getTreeItemsFromSceneObjType(e){const n=this.getDescendants(),r=[],s=Array.isArray(e)?e:[e];for(let o of n)o.sceneObject&&s.includes(o.sceneObject.typeName)&&r.push(o);return r}getTreeItemsFromSceneObjName(e){var s;const n=this.getDescendants(),r=[];for(let o of n)(s=o.sceneObject)!=null&&s.name.includes(e)&&r.push(o);return r}get dragStartDataManager(){return this._dragStartDataManager}get completeJson(){return{root:{children:[...this.children].filter(e=>e.isExport).map(e=>e.completeJson)}}}getJson(){return{root:{children:[...this.children].filter(e=>e.isExport).map(e=>e.json)}}}setJson(e){var r;e.root=e.root||{};const n=e.root.children??[];this.root.resetChildren(!0);for(let s of n){const o=new gn(this,!0);o.json=s,(r=this.root.children)==null||r.push(o)}}testAddNewTreeItem(e,n){const r=e||this.lastSelectedItem||this.root;return r?Im(r,n):!1}addNewTreeItem(e,n,r,s){const o=e||this.lastSelectedItem||this.root;if(o&&Im(o,n)){const a=new gn(this,r);if(a.sceneObject=s,!Im(o,n,a))throw new Error("currentTreeItem.insertNewTreeItem return false!");return a}}createSceneObjectTreeItem(e,n,r,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(r,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${r?r.id:"root"})`);return}const a=pt.create(e,n);return a?this.addNewTreeItem(r,s??"FolderInnerOrAfter",!0,a):void 0}createGroupTreeItem(e,n,r,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(r,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${r?r.id:"root"})`);return}const a=this.addNewTreeItem(r,s??"FolderInnerOrAfter",!0);if(!a){console.warn("addNewTreeItem error!");return}return a.name=e??"未命名组节点",a}createSceneObjectTreeItemFromClass(e,n,r,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(r,o))return;const a=pt.createFromClass(e,n);return a?this.addNewTreeItem(r,o,!0,a):void 0}createSceneObjectTreeItemFromJson(e,n,r){const s=r??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(n,s))return;const o=pt.createFromJson(e);return console.log(o),o?this.addNewTreeItem(n,r??"FolderInnerOrAfter",!0,o):void 0}destroySceneObjectTreeItem(e){if(e===this.root){console.warn("cannot destroy root! please use function destroyAllSceneObjectTreeItems!");return}e.detachFromParent()}destroyAllSceneObjectTreeItems(){if(!this.root.children)return;const e=[...this.root.children];for(let n of e)this.destroySceneObjectTreeItem(n)}};f(Dn,"defaultCreateSceneObjectFunc",HO),f(Dn,"defaultCreateTreeItemDragDropFunc",XO),f(Dn,"defaultPreload",KO),f(Dn,"defaultGetSceneObjectShow",$O),f(Dn,"defaultSetSceneObjectShow",YO),f(Dn,"defaultGetSceneTreeItemCloneNameFunc",tD);let Rc=Dn;const Mm={saturation:.35,brightness:1.4,gamma:.8,atmosphereScatteringIntensity:5,groundColor:[0,.09411764705882353,.3137254901960784,1]};class iD extends B{constructor(e){super();f(this,"_currentPosition",this.disposeVar(oe(void 0)));f(this,"_currentRotation",this.disposeVar(oe(void 0)));f(this,"_currentHeading",this.disposeVar(z(void 0)));f(this,"_isRotating",this.disposeVar(z(!1)));f(this,"_isGround",this.disposeVar(z(!1)));f(this,"_startPosition",[0,0,0]);f(this,"_startRotation",[0,0,0]);f(this,"_processing",this.disposeVar(Ln(async(e,n,r,s)=>{const{currentPosition:o,currentRotation:a}=this;if(!o||s<=0||!a){this._currentPosition.value=n,this._currentRotation.value=r;return}const l=this._startPosition;l.splice(0,3,...o);const u=this._startRotation;u.splice(0,3,...a);let h=Date.now();const c=Dc(l,n);this._currentHeading.value=c;const g=Mf(l,n)/s,p=[r[0]-u[0],r[1]-u[1],r[2]-u[2]],E=n[2]-l[2];await e.promise(new Promise(b=>{e.disposer.dispose(cd(async()=>{let P=Date.now()-h;P=P<0?0:P,P=P>s?s:P;const v=P*g,_=bm(l,v,c);if(this.isGround&&_){const m=await this._esviewer.getTerrainHeight([_[0],_[1]]);this._currentPosition.value=[_[0],_[1],m??0]}else _&&(_[2]+=E*(P/s)),this._currentPosition.value=_;if(this.isRotating){const[m,y,S]=p,C=P/s;this._currentRotation.value=[u[0]+m*C,u[1]+y*C,u[2]+S*C]}P===s&&(this._currentPosition.value=n,this.isRotating&&(this._currentRotation.value=r),this.isRotating=!1,this.isGround=!1,b())}))}))})));this._esviewer=e}get currentPosition(){return this._currentPosition.value}get currentPositionChanged(){return this._currentPosition.changed}get currentRotation(){return this._currentRotation.value}get currentRotationChanged(){return this._currentRotation.changed}get currentHeading(){return this._currentHeading.value}get currentHeadingChanged(){return this._currentHeading.changed}get isRotating(){return this._isRotating.value}set isRotating(e){this._isRotating.value=e}get isRotatingChanged(){return this._isRotating.changed}get isGround(){return this._isGround.value}set isGround(e){this._isGround.value=e}get isGroundChanged(){return this._isGround.changed}get processing(){return this._processing}restart(e,n,r){this._processing.restart(void 0,e,n,r)}cancel(){this._processing.cancel()}}const nD=.06,iE=1.5,nE=2,rE=70,sE=60;function el(i){return Kt(i)}function Ls(i,t,e){const n=el(i),r=hr(n,e,t,{units:"meters"}),[s,o]=kn(r);return[s,o,i[2]]}function Of(i,t){return tu(el(i),el(t))}function Df(i,t,e,n,r=1e3){const s=yi([kn(hr(el(i),r,(t+180)%360,{units:"meters"})),i,kn(hr(el(i),r,t,{units:"meters"}))]),o=yi([kn(hr(el(e),r,(n+180)%360,{units:"meters"})),e,kn(hr(el(e),r,n,{units:"meters"}))]),a=Fa(s,o);if(a.features.length>0){const[l,u]=kn(a.features[0]);return[l,u,(i[2]+e[2])/2]}return e}function oE(i,t,e,n){const r=(e-90+360)%360,s=(e+90+360)%360;i.leftPoints.push(Ls(t,r-rE,n*iE)),i.headPoints.push(Ls(t,r-sE,n*nE)),i.headPoints.push(t),i.headPoints.push(Ls(t,s+sE,n*nE)),i.rightPoints.push(Ls(t,s+rE,n*iE))}function rD(i,t,e,n){const r=(t-90+360)%360,s=(t+90+360)%360,o=e*nD*Math.min(.3,1-n);return{leftPoint:Ls(i,r,o),rightPoint:Ls(i,s,o),verticalLen:o}}function sD(i,t){if(!i||i.length<2)return;const e=t==="swallowTailArrow",n=i.length,r=n-1,s=Math.max(..._o(i,"NONE")),o={leftPoints:[],rightPoints:[],headPoints:[]};let a;for(let g=0;g<n;g++){const p=i[g],E=g==r?i[i.length-2]:i[g+1],b=g==r?Of(E,p):Of(p,E),{leftPoint:P,rightPoint:v,verticalLen:_}=rD(p,b,s,g/n);g===0?(o.leftPoints.push(P),o.rightPoints.push(v),e&&(o.tailPoint=Ls(p,b,_))):g===r?oE(o,p,b,_):a!==void 0?(o.leftPoints.push(Df(o.leftPoints[g-1],a,P,b,s)),o.rightPoints.push(Df(o.rightPoints[g-1],a,v,b,s))):(o.leftPoints.push(P),o.rightPoints.push(v)),a=b}const l=o.leftPoints,u=o.rightPoints,h=l.length>=2?Tu(l):l,c=u.length>=2?Tu(u):u,d=[...h,...o.headPoints,...c.reverse()];return o.tailPoint&&d.push(o.tailPoint),d.push(o.leftPoints[0]),d}function oD(i,t,e,n){const r=yi([[i[0],i[1]],[t[0],t[1]]]),s=yi([[e[0],e[1]],[n[0],n[1]]]);return Fa(r,s).features.length>0}function aD(i,t,e,n){const r=(t-90+360)%360,s=(t+90+360)%360,o=e*Math.min(.3,1-n);return{leftPoint:Ls(i,r,o),rightPoint:Ls(i,s,o),verticalLen:o}}function lD(i,t){if(!i||i.length<3)return;const e=t==="swallowTailArrow",n=i.length,r=n-1,s=i.slice(0,2),o=Tf(s),a=_o(s,"NONE").pop()??0,l=Math.max(..._o(i,"NONE")),u={leftPoints:[],rightPoints:[],headPoints:[]};let h;for(let b=1;b<n;b++){const P=b===1?o.center:i[b],v=b===r?i[n-2]:i[b+1],_=b===r?Of(v,P):Of(P,v);let{leftPoint:m,rightPoint:y,verticalLen:S}=aD(P,_,a,b/n);if(b===1)u.leftPoints.push(s[0]),u.rightPoints.push(s[1]),e&&(u.tailPoint=Ls(P,_,a));else if(b===r)oE(u,P,_,S);else if(h!==void 0){if(b===2&&oD(u.leftPoints[0],m,u.rightPoints[0],y)){const x=u.leftPoints[0];u.leftPoints[0]=u.rightPoints[0],u.rightPoints[0]=x}const C=b-2;u.leftPoints.push(Df(u.leftPoints[C],h,m,_,l)),u.rightPoints.push(Df(u.rightPoints[C],h,y,_,l))}else u.leftPoints.push(m),u.rightPoints.push(y);h=_}let c=u.leftPoints,d=u.rightPoints;const g=c.length>=2?Tu(c):c,p=d.length>=2?Tu(d):d,E=[...g,...u.headPoints,...p.reverse()];return u.tailPoint&&E.push(u.tailPoint),E.push(c[0]),E}function Tm(i,t,e=!1){return e?lD(i,t):sD(i,t)}function aE(i){let t=0;function e(n,r){r++,t=Math.max(r,t),n.forEach(s=>{Array.isArray(s)&&e(s,r)})}return e(i,0),t}const Vs=class Vs extends Xt{constructor(e){super(e);f(this,"editingBindMode","lineString");f(this,"_area",this.dv(z(0)));f(this,"_perimeter",this.dv(z(0)));this.d(Ze(this.pointsChanged,()=>{this._updateArea(),this._updatePerimeter()},{immediate:!0}))}updateEditing(){var n;const e=[];this.editingBindMode=="doublePoints"?e.push(nt.DoublePoints):this.editingBindMode=="lineString"?e.push(nt.LineStringAppend,nt.LineStringInsert,nt.Translation):this.editingBindMode=="circular"?(e.push(nt.CircularAppend,nt.CircularInsert,nt.Translation),this.supportEditingModes().includes(nt.HeightModify)&&e.push(nt.HeightModify)):this.editingBindMode=="visibility"?e.push(nt.VisibilityAppend,nt.VisibilityModify):this.editingBindMode=="scatter"&&e.push(nt.ScatterAppend,nt.ScatterModify),(n=this.activeViewer)==null||n.startEditing(this,e,{callSource:"inner"})}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}_updateArea(){this._area.value=this.getArea()??0}_updatePerimeter(){this._perimeter.value=this.getPerimeter()??0}getArea(){if(this.points&&this.points.length>=3)return Sm([...this.points])}getDistance(){if(this.points&&this.points.length>=2){const e=_o(this.points,"GEODESIC");return e[e.length-1]}else return}getPerimeter(){if(this.points&&this.points.length>=3){const e=[...this.points,this.points[0]],n=_o(e,"GEODESIC");return n[n.length-1]}else return}getIntersect(e){if(this.points&&this.points.length>=3&&e.length>=3){const n=U1(this.points,e);if(!n)return;const r=n[0][0][0];if(Array.isArray(r)){const s=[...n],o=[];return s.forEach(a=>{const l=a[0].map(u=>[...u,0]);o.push(l)}),o}else return[[...n][0].map(a=>[...a,0])]}else return}getUnion(e){if(this.points&&this.points.length>=3&&e.length>=3){const n=q1(this.points,e);if(!n)return;const r=n[0][0][0];if(Array.isArray(r)){const s=[...n],o=[];return s.forEach(a=>{const l=a[0].map(u=>[...u,0]);o.push(l)}),o}else return[[...n][0].map(a=>[...a,0])]}else return}getDifference(e){if(this.points&&this.points.length>=3&&e.length>=3){let n=[...e];const r=e[0],s=e[e.length-1];r[0]===s[0]&&r[1]===s[1]&&r[2]===s[2]||n.push(r);const o=H1([...this.points,this.points[0]],[...n]);if(!o)return{status:"undefined",positions:void 0};const a=[...o];if(aE(a)===3){const l=a.map(d=>d.map(g=>[...g,0]));if(l.length<=1)return{status:"notIncluded",positions:l};const u=l[0],h=l[1];return Cm([...u],[...h])==="oneBig"?{status:"included",positions:l}:{status:"notIncluded",positions:l}}else if(aE(a)===4){const u=[...a.map(c=>c.map(d=>d.map(g=>[...g,0])))],h=[];return u.forEach(c=>{h.push(c[0])}),{status:"notIncluded",positions:h}}else return{status:"undefined",positions:void 0}}else return{status:"undefined",positions:void 0}}getBuffer(e=500,n){if(this.points&&this.points.length>=2){const r=W1(this.points,e,n);return r?[r[0].map(s=>[...s,0])]:void 0}else return}geoPolygonOverlap(e){if(this.points&&this.points.length>=3&&e.length>=3){const n=Cm(this.points,e);return n==="oneBig"?!0:n==="twoBig"?!1:void 0}else return}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",coordinate:[...e.coordinate,new X([this,"editing"],"编辑",!1),new Ne([this,"points"],"位置数组",Vs.defaults.points,void 0,!0)],style:[...e.style,new wt("点样式"),new X([this,"pointed"],"开启",!1),new D([this,"pointSize"],"点大小",1),new ft([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new Dt([this,"pointColor"],"点颜色",[1,1,1,1]),new Dt([this,"pointOutlineColor"],"轮廓颜色",Vs.defaults.pointStyle.outlineColor),new D([this,"pointOutlineWidth"],"轮廓宽度",Vs.defaults.pointStyle.outlineWidth),new wt("线样式"),new X([this,"stroked"],"开启线样式",!0),new X([this,"strokeGround"],"贴地",!1),new D([this,"strokeWidth"],"线宽",1),new ft([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new Dt([this,"strokeColor"],"线颜色",[1,1,1,1]),new wt("面样式"),new X([this,"filled"],"开启",!1),new X([this,"fillGround"],"贴地",!1),new Dt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...e.more,new wt("点样式集合"),new mt([this,"pointMaterial"],"点材质"),new Et([this,"pointMaterialParams"],"点材质参数",{}),new wt("线样式集合"),new mt([this,"strokeMaterial"],"线材质"),new Et([this,"strokeMaterialParams"],"线材质参数",{}),new wt("面样式集合"),new mt([this,"fillMaterial"],"面材质"),new Et([this,"fillMaterialParams"],"面材质参数",{})]}}get pointSize(){return this.pointStyle.size}set pointSize(e){this.pointStyle={...this.pointStyle,size:e}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(e){this.pointStyle={...this.pointStyle,sizeType:e}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(e){this.pointStyle={...this.pointStyle,color:[...e]}}get pointColorChanged(){return this.pointStyleChanged}get pointOutlineColor(){return this.pointStyle.outlineColor}set pointOutlineColor(e){this.pointStyle={...this.pointStyle,outlineColor:[...e]}}get pointOutlineColorChanged(){return this.pointStyleChanged}get pointOutlineWidth(){return this.pointStyle.outlineWidth}set pointOutlineWidth(e){this.pointStyle={...this.pointStyle,outlineWidth:e}}get pointOutlineWidthChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(e){this.pointStyle={...this.pointStyle,material:e}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(e){this.pointStyle={...this.pointStyle,materialParams:e}}get pointMaterialParamsChanged(){return this.pointStyleChanged}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(e){this.strokeStyle={...this.strokeStyle,width:e}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(e){this.strokeStyle={...this.strokeStyle,widthType:e}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(e){this.strokeStyle={...this.strokeStyle,color:[...e]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(e){this.strokeStyle={...this.strokeStyle,material:e}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(e){this.strokeStyle={...this.strokeStyle,materialParams:e}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(e){this.strokeStyle={...this.strokeStyle,ground:e}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(e){this.fillStyle={...this.fillStyle,color:[...e]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(e){this.fillStyle={...this.fillStyle,material:e}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(e){this.fillStyle={...this.fillStyle,materialParams:e}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(e){this.fillStyle={...this.fillStyle,ground:e}}get fillGroundChanged(){return this.fillStyleChanged}};f(Vs,"createDefaultProps",()=>({...Xt.createDefaultProps(),pointed:!1,pointStyle:bt({size:10,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),stroked:!1,strokeStyle:bt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:bt({color:[1,1,1,1],material:"",materialParams:{},ground:!1}),points:Pa([])})),f(Vs,"type",Vs.register("ESGeoVector",Vs,{chsName:"地理矢量",tags:["ESObjects"],description:"地理矢量"})),f(Vs,"supportEditingModes",[...Xt.supportEditingModes,nt.Translation]);let Ot=Vs;const hl=class hl extends Xt{constructor(){super(...arguments);f(this,"_statusDis",this.dv(z(!0)));f(this,"_smoothMoveEvent",this.dv(new O));f(this,"_smoothMoveWithRotationEvent",this.dv(new O));f(this,"_smoothMoveOnGroundEvent",this.dv(new O));f(this,"_smoothMoveWithRotationOnGroundEvent",this.dv(new O));f(this,"_automaticLandingEvent",this.dv(new O));f(this,"_smoothMoveKeepPitchEvent",this.dv(new O));f(this,"_smoothMoveRelativelyEvent",this.dv(new O));f(this,"_smoothMoveRelativelyWithRotationEvent",this.dv(new O));f(this,"useCalcFlyToParamInESObjectWithLocation",!0)}updateEditing(){var n;const e=[];this.editingBindMode=="singlePoint"?(e.push(nt.SinglePoint),["ESLocationMeasurement"].includes(this.typeName)||e.push(nt.Rotation),["ESClippingPlane","ESLocationMeasurement","ESLocalRectangle","ESBoxClipping"].includes(this.typeName)||e.push(nt.Scale)):this.editingBindMode=="doublePoints"&&e.push(nt.DoublePoints),(n=this.activeViewer)==null||n.startEditing(this,e,{callSource:"inner"})}get statusDis(){return this._statusDis.value}get statusDisChanged(){return this._statusDis.changed}get smoothMoveEvent(){return this._smoothMoveEvent}smoothMove(e,n){this._smoothMoveEvent.emit(e,n)}get smoothMoveWithRotationEvent(){return this._smoothMoveWithRotationEvent}smoothMoveWithRotation(e,n,r){this._smoothMoveWithRotationEvent.emit(e,n,r)}get smoothMoveOnGroundEvent(){return this._smoothMoveOnGroundEvent}smoothMoveOnGround(e,n,r,s){this._smoothMoveOnGroundEvent.emit(e,n,r,s)}get smoothMoveWithRotationOnGroundEvent(){return this._smoothMoveWithRotationOnGroundEvent}smoothMoveWithRotationOnGround(e,n,r,s,o){this._smoothMoveWithRotationOnGroundEvent.emit(e,n,r,s,o)}get automaticLandingEvent(){return this._automaticLandingEvent}automaticLanding(){const e=this.collision;this.collision=!1,setTimeout(()=>{this._automaticLandingEvent.emit(e)},100)}get smoothMoveKeepPitchEvent(){return this._smoothMoveKeepPitchEvent}smoothMoveKeepPitch(e,n){this._smoothMoveKeepPitchEvent.emit(e,n)}get smoothMoveRelativelyEvent(){return this._smoothMoveRelativelyEvent}smoothMoveRelatively(e,n){this._smoothMoveRelativelyEvent.emit(e,n)}get smoothMoveRelativelyWithRotationEvent(){return this._smoothMoveRelativelyWithRotationEvent}smoothMoveRelativelyWithRotation(e,n,r){this._smoothMoveRelativelyWithRotationEvent.emit(e,n,r)}getESProperties(){const e={...super.getESProperties()},n=[...e.location,new X([this,"editing"],"是否编辑"),new vt("自动落地",this.automaticLanding.bind(this),[]),new _s([this,"position"],"位置数组",[0,0,0]),new Ah([this,"rotation"],"姿态数组",[0,0,0]),new ci([this,"scale"],"缩放",[1,1,1]),new D([this,"minVisibleDistance"],"最小可见距离",0),new D([this,"maxVisibleDistance"],"最大可见距离",0)];return["ESHuman","ESGltfModel","ESFountainParticleSystem","ESHumanFountain"].includes(this.typeName)&&n.push(new ci([this,"positionOffset"],"位置偏移",[0,0,0])),{...e,defaultMenu:"basic",location:n,more:[...e.more,new vt("平滑移动",this.smoothMove.bind(this),[[0,0,0],0]),new vt("固定方向平滑移动",this.smoothMoveKeepPitch.bind(this),[[0,0,0],0]),new vt("平滑偏移",this.smoothMoveWithRotation.bind(this),[[0,0,0],[0,0,0],0]),new vt("贴地平滑移动",this.smoothMoveOnGround.bind(this),[0,0,0,""]),new vt("贴地平滑偏移",this.smoothMoveWithRotationOnGround.bind(this),[[0,0,0],0,0,0,""]),new vt("相对平滑移动",this.smoothMoveRelatively.bind(this),[[0,0,0],0]),new vt("相对平滑偏移",this.smoothMoveRelativelyWithRotation.bind(this),[[0,0,0],[0,0,0],0]),new X([this,"enableVisibleDistance"],"是否应用距离显隐")]}}get pointSize(){return this.pointStyle.size}set pointSize(e){this.pointStyle={...this.pointStyle,size:e}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(e){this.pointStyle={...this.pointStyle,sizeType:e}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(e){this.pointStyle={...this.pointStyle,color:[...e]}}get pointColorChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(e){this.pointStyle={...this.pointStyle,material:e}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(e){this.pointStyle={...this.pointStyle,materialParams:e}}get pointMaterialParamsChanged(){return this.pointStyleChanged}};f(hl,"createDefaultProps",()=>({...Xt.createDefaultProps(),pointed:!1,pointStyle:bt({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),position:ot([0,0,0]),rotation:ot([0,0,0]),positionOffset:ot([0,0,0]),scale:ot([1,1,1]),minVisibleDistance:z(0),maxVisibleDistance:z(0)})),f(hl,"type",hl.register("ESObjectWithLocation",hl,{chsName:"对象位置",tags:["ESObjects"],description:"对象位置"})),f(hl,"supportEditingModes",[...Xt.supportEditingModes,nt.SinglePoint,nt.Place,nt.Translation,nt.Rotation,nt.Scale,nt.DoublePoints,nt.DoublePointsAppend,nt.DoublePointsModify]);let ct=hl;const Bu=class Bu extends ct{getESProperties(){const t={...super.getESProperties()};return{...t,style:[...t.style,new wt("点样式集合"),new X([this,"pointed"],"开启点样式",!1),new D([this,"pointSize"],"点大小",1),new ft([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new Dt([this,"pointColor"],"点颜色",[1,1,1,1]),new wt("线样式集合"),new X([this,"stroked"],"开启线样式",!1),new X([this,"strokeGround"],"是否贴地(线)",!1),new D([this,"strokeWidth"],"线宽",1),new ft([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new Dt([this,"strokeColor"],"线颜色",[1,1,1,1]),new wt("面样式集合"),new X([this,"filled"],"开启填充样式",!1),new X([this,"fillGround"],"是否贴地",!1),new Dt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...t.more,new wt("点样式"),new mt([this,"pointMaterial"],"点材质",""),new Et([this,"pointMaterialParams"],"点材质参数",{}),new wt("线样式"),new mt([this,"strokeMaterial"],"线材质",""),new Et([this,"strokeMaterialParams"],"线材质参数",{}),new wt("填充样式"),new mt([this,"fillMaterial"],"面材质",""),new Et([this,"fillMaterialParams"],"面材质参数",{})]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(t){this.strokeStyle={...this.strokeStyle,width:t}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(t){this.strokeStyle={...this.strokeStyle,widthType:t}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(t){this.strokeStyle={...this.strokeStyle,color:[...t]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(t){this.strokeStyle={...this.strokeStyle,material:t}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(t){this.strokeStyle={...this.strokeStyle,materialParams:t}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(t){this.strokeStyle={...this.strokeStyle,ground:t}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(t){this.fillStyle={...this.fillStyle,color:[...t]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle,materialParams:t}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(t){this.fillStyle={...this.fillStyle,ground:t}}get fillGroundChanged(){return this.fillStyleChanged}};f(Bu,"createDefaultProps",()=>({...ct.createDefaultProps(),pointed:!1,pointStyle:bt({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:1}),stroked:!1,strokeStyle:bt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:bt({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(Bu,"type",Bu.register("ESLocalVector",Bu,{chsName:"本地矢量",tags:["ESObjects"],description:"本地矢量对象"}));let Nu=Bu;const nd=class nd extends Nu{};f(nd,"type",nd.register("ESLocalVector2D",nd,{chsName:"本地矢量2D",tags:["ESObjects"],description:"本地矢量2D对象"}));let wo=nd;const uD=[["固定朝向",0],["面向屏幕旋转",1],["绕自身Z轴旋转",2]],hD=[["单面不透明",0],["双面不透明",1],["单面遮罩",2],["双面遮罩",3],["单面透明",4],["双面透明",5],["单面未遮挡透明",6],["双面未遮挡透明",7]],Uu=class Uu extends ct{constructor(){super(...arguments);f(this,"_widgetEvent",this.dv(new O))}get widgetEvent(){return this._widgetEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new X([this,"screenRender"],"屏幕渲染",!0),new X([this,"sizeByContent"],"尺寸自适应",!0),new Ke([this,"size"],"尺寸大小",[100,100]),new Ke([this,"anchor"],"偏移比例",[.5,1]),new Ke([this,"offset"],"像素偏移",[0,0]),new ft([this,"renderMode"],hD,"渲染模式",0),new ft([this,"rotationType"],uD,"漫游旋转类型",1),new mt([this,"actorTag"],"绑定对象"),new mt([this,"socketName"],"插槽名称"),new ci([this,"positionOffset"],"位置偏移"),new ci([this,"rotationOffset"],"相对姿态")],more:[...e.more,new D([this,"zOrder"],"排序",0)]}}};f(Uu,"createDefaultProps",()=>({...ct.createDefaultProps(),screenRender:!0,size:ot([100,100]),anchor:ot([.5,1]),offset:ot([0,0]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,actorTag:"",socketName:"",positionOffset:ot([0,0,0]),rotationOffset:ot([0,0,0])})),f(Uu,"type",Uu.register("ESLabel",Uu,{chsName:"标签",tags:["ESObjects"],description:"标签对象"}));let Yn=Uu;const Ge=class Ge extends pt{constructor(t){super(t)}func(t,e=!0){t.includes("completeJson")&&console.log("ESTestObject.completeJson",this.completeJson),t.includes("json")&&console.log("ESTestObject.json",this.json),e&&console.log("ESTestObject func")}func1(t,e){t.includes("completeJson")&&console.log("ESTestObject.completeJson",this.completeJson),t.includes("json")&&console.log("ESTestObject.json",this.json),e&&console.log("ESTestObject func")}getESProperties(){return{defaultMenu:"basic",basic:[new mt([this,"typeName"],"类型",void 0,!1,!0),new mt([this,"id"],"id",void 0,!1,!0),new mt([this,"name"],"名称"),new mt([this,"ref"],"引用",void 0,!0),new Et([this,"extras"],"扩展属性",{},void 0,!0),new Qg("JSON",()=>this._jsonStr,t=>t&&(this._jsonStr=t))],general:[new X([this,"show"],"是否显示",Ge.defaults.show),new Dt([this,"color"],"颜色",Ge.defaults.color),new ft([this,"paramType"],[["screen","screen"],["world","world"]],"参数类型",Ge.defaults.paramType),new bd([this,"text"],"内容",Ge.defaults.text)],dataSource:[new ys([this,"startTime"],"开始时间",Ge.defaults.startTime),new io([this,"code"],"js代码",Ge.defaults.code),new Kg([this,"times"],"时间组",Ge.defaults.times),new mt([this,"url"],"服务地址",Ge.defaults.url),new vt("func",this.func.bind(this),[["completeJson","json"]]),new vt("func1",(t,e)=>this.func1(t,e),[["completeJson","json"],!0])],location:[new ci([this,"positionOffset"],"位置偏移",Ge.defaults.positionOffset),new _s([this,"position"],"位置数组",Ge.defaults.position),new Ah([this,"rotation"],"姿态数组",Ge.defaults.rotation)],coordinate:[new D([this,"height"],"高度(m)",Ge.defaults.height),new Ne([this,"points"],"位置数组",Ge.defaults.points)],style:[new rr([this,"padding"],"内边距",Ge.defaults.padding),new Ke([this,"offset"],"像素偏移",Ge.defaults.offset),new wt("样式"),new Py([this,"dashPattern"],"虚线图案",255),new wt("样式2"),new Dt([this,"color"],"颜色",Ge.defaults.color),new Et([this,"strokeStyle"],"线样式参数",Ge.defaults.strokeStyle)],more:[]}}};f(Ge,"createDefaultProps",()=>({...pt.createDefaultProps(),show:!0,url:"http://localhost:8080/earthsdk3/earthsdk3.gltf",height:100,position:ot([116.39,39.9,100]),rotation:ot([0,-90,0]),points:Pa([]),color:ot([1,0,0,1]),strokeStyle:bt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),paramType:"screen",text:"默认",code:'console.log("hello world")',dashPattern:255,startTime:Date.now(),times:ot([]),offset:ot([10,0]),positionOffset:ot([0,2,0]),padding:ot([0,2,0,2])})),f(Ge,"type",Ge.register("ESTestObject",Ge,{chsName:"测试",tags:["ESObjects"],description:""}));let Nm=Ge;const zs=class zs extends Xt{constructor(e){super(e);f(this,"_refreshTilesetEvent",this.dv(new O));f(this,"_tilesetReadyEvent",this.dv(new O));f(this,"_supportEdit",this.dv(z(!0)));f(this,"_highlightFeatureEvent",this.dv(new O));f(this,"_highlightFeatureAndFlyToEvent",this.dv(new O));f(this,"_strokeFeatureEvent",this.disposeVar(new O));f(this,"_getFeatureTableEvent",this.dv(new O));f(this,"_featureTableResultEvent",this.dv(new O));f(this,"_getMaterialNameListEvent",this.disposeVar(new O));f(this,"_setFeatureStyleEvent",this.dv(new O));f(this,"_setFeatureColorEvent",this.dv(new O));f(this,"_setFeatureVisableEvent",this.dv(new O));f(this,"_resetFeatureStyleEvent",this.dv(new O));f(this,"setMaterialInfoEvent",this.ad(new O));f(this,"_setMaterialEvent",this.disposeVar(new O));f(this,"_clippingPlanesId",this.dv(z("")));f(this,"_clippingPlaneIds",this.dv(z([])));f(this,"_flattenedPlaneId",this.dv(z("")));f(this,"_flattenedPlaneEnabled",this.dv(z(!1)));f(this,"_clippingPlaneId",this.dv(z("")));f(this,"_excavateId",this.dv(ot([])))}updateEditing(){var e;(e=this.activeViewer)==null||e.startEditing(this,[nt.Translation,nt.Rotation],{callSource:"inner"})}get refreshTilesetEvent(){return this._refreshTilesetEvent}refreshTileset(){this._refreshTilesetEvent.emit()}get tilesetReady(){return this._tilesetReadyEvent}get supportEdit(){return this._supportEdit.value}set supportEdit(e){this._supportEdit.value=e}get supportEditChanged(){return this._supportEdit.changed}get highlightFeatureEvent(){return this._highlightFeatureEvent}highlightFeature(e,n){this._highlightFeatureEvent.emit(e,n)}get highlightFeatureAndFlyToEvent(){return this._highlightFeatureAndFlyToEvent}highlightFeatureAndFlyTo(e,n,r,s){this._highlightFeatureAndFlyToEvent.emit(e,n,r,s)}get strokeFeatureEvent(){return this._strokeFeatureEvent}strokeFeature(e,n=[1,0,0,1]){this._strokeFeatureEvent.emit(e,n)}get getFeatureTableEvent(){return this._getFeatureTableEvent}getFeatureTable(){return Promise.race([new Promise(e=>{const n=this.d(this._featureTableResultEvent.donce(e));this._getFeatureTableEvent.emit(),setTimeout(()=>{n(),e(void 0)},2e3)})])}get getMaterialNameListEvent(){return this._getMaterialNameListEvent}getMaterialNameList(){return new Promise(e=>{const n=new B;n.d(this.getMaterialNameListEvent.don(r=>{r!=="start"&&(n.destroy(),e(r))})),this.getMaterialNameListEvent.emit("start"),setTimeout(()=>{n.isDestroyed()||(n.destroy(),e(void 0))},2e3)})}get setFeatureStyleEvent(){return this._setFeatureStyleEvent}setFeatureStyle(e,n=!1){this._setFeatureStyleEvent.emit(e,n)}get setFeatureColorEvent(){return this._setFeatureColorEvent}setFeatureColor(e,n,r=!1){this._setFeatureColorEvent.emit(e,typeof n=="string"?JSON.parse(n):n,r)}get setFeatureVisableEvent(){return this._setFeatureVisableEvent}setFeatureVisable(e,n,r=!1){this._setFeatureVisableEvent.emit(e,typeof n=="string"?JSON.parse(n):n,r)}get resetFeatureStyleEvent(){return this._resetFeatureStyleEvent}resetFeatureStyle(e){this._resetFeatureStyleEvent.emit(e)}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){return new Promise(n=>{const r=new B;r.ad(this.setMaterialInfoEvent.donce(s=>{r.destroy(),n(s)})),this._setMaterialEvent.emit(e)})}get clippingPlanesId(){return this._clippingPlanesId.value}set clippingPlanesId(e){this._clippingPlanesId.value=e}get clippingPlanesIdChanged(){return this._clippingPlanesId.changed}get clippingPlaneIds(){return this._clippingPlaneIds.value}set clippingPlaneIds(e){this._clippingPlaneIds.value=e}get clippingPlaneIdsChanged(){return this._clippingPlaneIds.changed}get flattenedPlaneId(){return this._flattenedPlaneId.value}set flattenedPlaneId(e){this._flattenedPlaneId.value=e}get flattenedPlaneIdChanged(){return this._flattenedPlaneId.changed}get flattenedPlaneEnabled(){return this._flattenedPlaneEnabled.value}set flattenedPlaneEnabled(e){this._flattenedPlaneEnabled.value=e}get flattenedPlaneEnabledChanged(){return this._flattenedPlaneEnabled.changed}get clippingPlaneId(){return this._clippingPlaneId.value}set clippingPlaneId(e){this._clippingPlaneId.value=e}get clippingPlaneIdChanged(){return this._clippingPlaneId.changed}get excavateId(){return this._excavateId.value}set excavateId(e){this._excavateId.value=e}get excavateIdChanged(){return this._excavateId.changed}setLight122(){this.czmEnvironmentMapManager={...Mm}}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new Qe([this,"maximumScreenSpaceError"],1,[0,256],"精度",16),new ft([this,"materialMode"],[["常规","normal"],["科技感","technology"]],"材质模式","normal",!0),new ft([this,"colorBlendMode"],[["默认","HIGHLIGHT"],["替换","REPLACE"],["混合","MIX"]],"颜色模式","HIGHLIGHT"),new Et([this,"materialOverrideMap"],"材质替换",zs.defaults.materialOverrideMap)],dataSource:[...e.dataSource,new Et([this,"url"],"服务地址",zs.defaults.url,void 0,!0)],coordinate:[...e.coordinate,new X([this,"editing"],"编辑",!1,!0),new ci([this,"offset"],"偏移",[0,0,0],!0),new Ah([this,"rotation"],"旋转",[0,0,0])],more:[...e.more,new Et([this,"materialParams"],"materialParams",zs.defaults.materialParams),new vt("高亮要素",this.highlightFeature.bind(this),["id_value","rgba(255,0,0,1)"],"highlightFeature"),new vt("高亮并且定位到要素",this.highlightFeatureAndFlyTo.bind(this),["id_value",[1116.39,39.9,100,1e3],"rgba(255,0,0,1)",1],"highlightFeatureAndFlyTo"),new vt("要素着色控制",this.setFeatureColor.bind(this),["height",[{minValue:1e5,color:[1,0,0,1]},{maxValue:5e5,color:[1,1,0,1]}]],"setFeatureColor"),new vt("要素可见性控制",this.setFeatureVisable.bind(this),["height",[{minValue:1e5,visable:!0},{maxValue:5e5,visable:!1}]],"setFeatureVisable"),new vt("重置样式",()=>this.resetFeatureStyle(),[],"resetFeatureStyle"),new wt("ue"),new vt("刷新 tileset",()=>this.refreshTileset(),[],"refreshTileset"),new mt([this,"actorTag"]),new X([this,"highlight"],"是否高亮"),new Dt([this,"highlightColor"]),new D([this,"highlightID"]),new wt("czm"),new Ke([this,"czmImageBasedLightingFactor"],"反射强度"),new D([this,"czmAtmosphereScatteringIntensity"],"大气散射强度"),new Et([this,"czmEnvironmentMapManager"],"动态环境贴图管理器"),new D([this,"czmMaximumMemoryUsage"],"最大内存"),new wt("常用"),new ft([this,"czmClassificationType"],[["NONE","NONE"],["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]],"czmClassificationType","NONE",!0),new Et([this,"czmStyleJson"],"czmStyle"),new X([this,"czmBackFaceCulling"]),new X([this,"czmSkipLevelOfDetail"]),new X([this,"czmDebugWireframe"]),new D([this,"cacheBytes"],"最大缓存",536870912),new wt("调试信息"),new X([this,"czmDebugShowBoundingVolume"]),new X([this,"czmDebugShowContentBoundingVolume"]),new wt("裁剪"),new X([this,"clippingPlaneEnabled"]),new X([this,"unionClippingRegions"]),new Dt([this,"clippingPlaneEdgeColor"]),new D([this,"clippingPlaneEdgeWidth"])]}}};f(zs,"createDefaultProps",()=>({...Xt.createDefaultProps(),url:"",actorTag:"",materialMode:"normal",highlight:!1,maximumScreenSpaceError:16,highlightID:0,highlightColor:ot([1,0,0,1]),offset:oe([0,0,0]),rotation:ot([0,0,0]),czmImageBasedLightingFactor:ot([1,1]),czmEnvironmentMapManager:fe(void 0),czmLuminanceAtZenith:2,czmAtmosphereScatteringIntensity:2,czmMaximumMemoryUsage:512,czmClassificationType:"NONE",czmStyleJson:bt({}),czmBackFaceCulling:!0,czmDebugShowBoundingVolume:!1,czmDebugShowContentBoundingVolume:!1,czmSkipLevelOfDetail:!1,cacheBytes:536870912,colorBlendMode:"HIGHLIGHT",clippingPlaneEnabled:!0,unionClippingRegions:!0,clippingPlaneEdgeColor:ot([1,1,1,1]),clippingPlaneEdgeWidth:2,materialParams:{baseColor:[0,.5,1]},allowPicking:!0,materialOverrideMap:fe({}),featureIdLabel:0,splitDirection:"NONE",czmDebugWireframe:!1})),f(zs,"type",zs.register("ES3DTileset",zs,{chsName:"3DTileset",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"3DTileset"})),f(zs,"supportEditingModes",[...Xt.supportEditingModes,nt.Translation,nt.Rotation]);let Jn=zs;const qu=class qu extends ct{constructor(e){super(e);f(this,"_isFlyInCreated",this.dv(z(!1)));this.collision=!1,this.d(this.createdEvent.don(()=>{setTimeout(()=>{if((this.editing??!1)||!this.position)this.d(Ze([this.positionChanged,this.editingChanged],()=>{this.editing||!this.position||this.isFlyInCreated&&this.flyTo()},{time:"donce"}));else{if(!this.isFlyInCreated)return;this.flyTo()}},1e3)}))}get isFlyInCreated(){return this._isFlyInCreated.value}set isFlyInCreated(e){this._isFlyInCreated.value=e}get isFlyInCreatedChanged(){return this._isFlyInCreated.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ft([this,"mode"],[["柱状警告","cylinder"],["圆形警告","circle"]],"模式","cylinder"),new D([this,"radius"],"半径",10)]}}};f(qu,"createDefaultProps",()=>({...ct.createDefaultProps(),mode:"cylinder",radius:10})),f(qu,"type",qu.register("ESAlarm",qu,{chsName:"报警",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警告类"}));let Om=qu;const cD=[["扫描","scan"],["扩散","diffuse"]],fa=class fa extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new D([this,"radius"],"半径",1),new ft([this,"mode"],cD,"模式",fa.defaults.mode),new Dt([this,"color"],"颜色",fa.defaults.color)]}}};f(fa,"createDefaultProps",()=>({...ct.createDefaultProps(),radius:1,mode:"scan",color:[0,.7,1,1],collision:!1})),f(fa,"type",fa.register("ESApertureEffect",fa,{chsName:"光圈特效",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"光圈特效"}));let Dm=fa;const dD=Object.entries({inner:"inner",outer:"outer",both:"both"}),vn=class vn extends Ot{constructor(e){super(e);f(this,"editingBindMode","circular")}get bufferShow(){var e;return(e=this.buffer)==null?void 0:e.show}set bufferShow(e){this.buffer={...this.buffer,show:e}}get bufferShowChanged(){return this.bufferChanged}get bufferColor(){var e;return(e=this.buffer)==null?void 0:e.color}set bufferColor(e){this.buffer={...this.buffer,color:e}}get bufferColorChanged(){return this.bufferChanged}get bufferGradient(){var e;return(e=this.buffer)==null?void 0:e.gradient}set bufferGradient(e){this.buffer={...this.buffer,gradient:e}}get bufferGradientChanged(){return this.bufferChanged}get bufferDistance(){var e;return(e=this.buffer)==null?void 0:e.distance}set bufferDistance(e){this.buffer={...this.buffer,distance:e}}get bufferDistanceChanged(){return this.bufferChanged}get bufferMode(){var e;return(e=this.buffer)==null?void 0:e.mode}set bufferMode(e){this.buffer={...this.buffer,mode:e}}get bufferModeChanged(){return this.bufferChanged}get bufferLight(){var e;return(e=this.buffer)==null?void 0:e.light}set bufferLight(e){this.buffer={...this.buffer,light:e}}get bufferLightChanged(){return this.bufferChanged}getESProperties(){const e={...super.getESProperties()};return{...e,style:[...e.style,new ft([this,"classificationType"],tp,"贴地附着目标",vn.defaults.classificationType),new X([this,"instancing"],"实例化渲染",vn.defaults.instancing),new X([this,"bufferShow"],"缓冲区显隐",vn.defaults.buffer.show),new Dt([this,"bufferColor"],"缓冲区颜色",vn.defaults.buffer.color),new X([this,"bufferLight"],"缓冲区光照",vn.defaults.buffer.light),new D([this,"bufferDistance"],"缓冲区距离",vn.defaults.buffer.distance),new ft([this,"bufferMode"],dD,"缓冲区模式",vn.defaults.buffer.mode),new X([this,"bufferGradient"],"缓冲区渐变",vn.defaults.buffer.gradient)],coordinate:[...e.coordinate,new D([this,"area"],"面积",0,!1,!0),new D([this,"perimeter"],"周长",0,!1,!0)]}}};f(vn,"createDefaultProps",()=>({...Ot.createDefaultProps(),buffer:bt({show:!1,color:[0,0,0,.8],gradient:!0,distance:100,mode:"outer",light:!1}),classificationType:"TERRAIN",instancing:!1,fillStyle:bt({color:[1,1,1,.5],material:"",materialParams:{},ground:!1}),strokeStyle:bt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!0,stroked:!1,collision:!1})),f(vn,"type",vn.register("ESGeoPolygon",vn,{chsName:"地理多边形",tags:["ESObjects"],description:"地理多边形"})),f(vn,"supportEditingModes",[...Ot.supportEditingModes,nt.CircularAppend,nt.CircularInsert]);let Jt=vn;const Co=class Co extends Jt{get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialParams(){return this.fillStyle?this.fillStyle.materialParams:Co.defaults.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle??Co.defaults.fillStyle,materialParams:t??Co.defaults.fillStyle.materialParams}}constructor(t){super(t)}};f(Co,"createDefaultProps",()=>({...Jt.createDefaultProps(),stroked:!0,filled:!0,units:ot(["SquareMeter_SquareKilometer","MU_Hectare","PerimeterMeter_PerimeterKilometer"]),fillStyle:bt({color:[1,1,1,1],material:"Material'/EarthSDKForUE/M_ES_Material.M_ES_Material'",materialParams:{Opacity:.4},ground:!0}),strokeStyle:bt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(Co,"type",Co.register("ESAreaMeasurement",Co,{chsName:"面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"面积测量"}));let Rm=Co;const Wu=class Wu extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"general",more:[...t.more,new wt("czm"),new mt([this,"image"],"图片"),new ci([this,"translation"],"偏移")]}}};f(Wu,"createDefaultProps",()=>({...ct.createDefaultProps(),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",translation:ot([0,0,0])})),f(Wu,"type",Wu.register("ESBlastParticleSystem",Wu,{chsName:"粒子爆炸",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"粒子爆炸"}));let Am=Wu;const ls=class ls extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new X([this,"reverse"],"反转",ls.defaults.reverse),new ci([this,"size"],"尺寸",ls.defaults.size),new Dt([this,"edgeColor"],"边框颜色",ls.defaults.edgeColor),new D([this,"edgeWidth"],"边框宽度",ls.defaults.edgeWidth),new mt([this,"targetID"],"目标图层id",ls.defaults.targetID)]}}};f(ls,"createDefaultProps",()=>({...ct.createDefaultProps(),reverse:!1,edgeColor:ot([1,1,1,1]),edgeWidth:2,size:ot([10,10,10]),targetID:""})),f(ls,"type",ls.register("ESBoxClipping",ls,{chsName:"体剖切",tags:["ESObjects","_ES_Impl_Cesium"],description:"体剖切,体裁剪,体裁切,盒裁切"}));let Lm=ls;const rd=class rd extends ct{constructor(){super(...arguments);f(this,"_thumbnail",this.dv(z("")));f(this,"_duration",this.dv(z(1)));f(this,"_resetWithCurrentCameraEvent",this.dv(new O));f(this,"_captureEvent",this.dv(new O))}get thumbnail(){return this._thumbnail.value}set thumbnail(e){this._thumbnail.value=e}get thumbnailChanged(){return this._thumbnail.changed}get duration(){return this._duration.value}set duration(e){this._duration.value=e}get durationChanged(){return this._duration.changed}flyIn(e=1,n="default"){this.flyInEvent.emit(e,-1,n)}get resetWithCurrentCameraEvent(){return this._resetWithCurrentCameraEvent}resetWithCurrentCamera(){this._resetWithCurrentCameraEvent.emit()}get captureEvent(){return this._captureEvent}capture(e,n){this._captureEvent.emit(e,n)}execOnCreating(){this.resetWithCurrentCamera()}async initByCurrent(){this.resetWithCurrentCamera()}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new wt("视角信息"),new vt("设置为当前视角",()=>this.resetWithCurrentCamera(),[]),new vt("获取缩略图",(n,r)=>this.capture(n,r),[64,64],"capture"),new mt([this,"thumbnail"],"缩略图","",!0),new D([this,"duration"],"飞行时间",1,!0)]}}};f(rd,"type",rd.register("ESCameraView",rd,{chsName:"视角",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角"}));let Rf=rd;class Af extends B{constructor(e,n,r){super();f(this,"_view",this.dv(new Rf));if(this.d(e.components.disposableAdd(this._view)),this._view.name=(r==null?void 0:r.name)??`视角${e.views.length+1}`,n){const a=this._view,l=n;a.duration=l.duration??1,a.position=l.position,a.rotation=l.rotation??[0,0,0],a.thumbnail=l.thumbnail??"",a.name=l.name}else{const a=(r==null?void 0:r.size)??[64,64];this.d(Fl(()=>{this._view.resetWithCurrentCamera(),this._view.capture(a[0],a[1])}))}const s=this._view,o=this.dv(Ve(s.durationChanged,s.positionChanged,s.rotationChanged,s.thumbnailChanged,s.nameChanged));this.d(o.don(()=>e.emitViewsWarpper()))}get view(){return this._view}get viewInfo(){const e=this._view;return{duration:e.duration,position:e.position,rotation:e.rotation,thumbnail:e.thumbnail,name:e.name}}}const Nr=class Nr extends pt{constructor(e){super(e);f(this,"_currentViewIndex",this.dv(z(-1)));f(this,"_viewWrappers",this.dv(new Ph));f(this,"_currentViewWrapper",this.dv(z(void 0)));f(this,"_container",this.dv(z(void 0)));this.initProcessing();{const n=()=>{if(!this._currentViewWrapper.value)return;this._viewWrappers.indexOf(this._currentViewWrapper.value)===-1&&(this._currentViewWrapper.value=void 0)};n(),this.d(this._viewWrappers.changedEvent.don(n))}{const n=()=>{const r=this._currentViewWrapper.value;this._currentViewIndex.value=r?this._getIndex(r):-1};n(),this.d(this._viewWrappers.changedEvent.don(n)),this.d(this._currentViewWrapper.changed.don(n))}this.d(()=>{this.clearAllViews()})}get json(){return{...this._innerGetJson(),views:this.views}}set json(e){this._innerSetJson(e),this.views=e.views}get currentViewIndex(){return this._currentViewIndex.value}get currentViewIndexChanged(){return this._currentViewIndex.changed}emitViewsWarpper(){this._viewWrappers.changedEvent.emit(this._viewWrappers)}get container(){return this._container.value}get containerChanged(){return this._container.changed}set container(e){this._container.value=e}get views(){return J1(this._viewWrappers,e=>e.viewInfo)}get viewsChanged(){return this._viewWrappers.changedEvent}set views(e){if(e.length===this._viewWrappers.length){const n=this._viewWrappers;if(e.every((r,s)=>{const o=n.get(s).view;return r.duration===o.duration&&Nf(r.position,o.position)&&Nf(r.rotation,o.rotation)&&r.thumbnail===o.thumbnail&&r.name===o.name}))return}this.clearAllViews();for(let n of e)this._viewWrappers.push(new Af(this,n))}_getIndex(e){return this._viewWrappers.indexOf(e)}clearAllViews(){for(let e of this._viewWrappers)e.destroy();this._viewWrappers.length=0}add(e=`视角${this.views.length+1}`,n=[64,64]){this._viewWrappers.push(new Af(this,void 0,{name:e,size:n}))}update(e,n,r=[64,64]){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const s=this._viewWrappers.get(e);return n&&(s.view.name=n),s.view.resetWithCurrentCamera(),s.view.capture(r[0],r[1]),!0}addView(){this._viewWrappers.push(new Af(this))}insertView(e){if(this._viewWrappers.length+1<=e||e<0){console.error("this._views.length <= index || index < 0");return}this._viewWrappers.splice(e,0,new Af(this))}setCurrentView(e){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const n=this._viewWrappers.get(e);return this._currentViewWrapper.value=n,!0}resetView(e){if(e>=this._viewWrappers.length||e<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const n=this._viewWrappers.get(e);n.view.resetWithCurrentCamera(),n.view.capture()}resetViewName(e,n){if(e>=this._viewWrappers.length||e<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const r=this._viewWrappers.get(e);r.view.name=n}updateView(e,n){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const r=this._viewWrappers.get(e);return r.view.position=n.position,r.view.rotation=n.rotation??[0,0,0],r.view.duration=n.duration??1,r.view.thumbnail=n.thumbnail??"",r.view.name=n.name??"",!0}flyToView(e){if(this.setCurrentView(e)){if(!this._currentViewWrapper.value)throw new Error("this._currentViewWrapper.value");const n=this._currentViewWrapper.value.view.duration;this._currentViewWrapper.value.view.flyIn(n,this.flyMode??Nr.defaults.flyMode)}}flyToPrevView(){const e=this._currentViewWrapper.value;if(!e)return this.flyToView(0),!0;const n=this._getIndex(e);return this.loop??Nr.defaults.loop?(this.flyToView((this._viewWrappers.length+n-1)%this._viewWrappers.length),!0):n-1<0?!1:(this.flyToView(n-1),!0)}moveToPreView(){const e=this._currentViewWrapper.value;if(!e)return;const n=this._getIndex(e);if(n===0)return;const r=this._viewWrappers.splice(n-1,1,e)[0];this._viewWrappers.set(n,r)}moveToNextView(){const e=this._currentViewWrapper.value;if(!e)return;const n=this._getIndex(e);if(n===this._viewWrappers.length-1)return;const r=this._viewWrappers.splice(n+1,1,e)[0];this._viewWrappers.set(n,r)}flyToNextView(){const e=this._currentViewWrapper.value;if(!e)return this.flyToView(0),!0;const n=this._getIndex(e);return this.loop??Nr.defaults.loop?(this.flyToView((n+1)%this._viewWrappers.length),!0):n+1>this._viewWrappers.length-1?!1:(this.flyToView(n+1),!0)}stop(){this._currentViewWrapper.value=void 0,this.playing=!1}deleteView(e){if(e<0||e>=this._viewWrappers.length){console.warn("index < 0 || index >= this._viewWrappers.length");return}this._viewWrappers.get(e).destroy(),this._viewWrappers.splice(e,1)}deleteCurrentView(){const e=this._currentViewWrapper.value;if(!e){console.warn("!this._currentViewWrapper.value");return}const n=this._getIndex(e);if(n===-1){console.warn("index === -1");return}this.deleteView(n)}transitionImageUrl(e){return pt.context.getStrFromEnv(e)}_flyStep(e){var o;if(!this.flyToNextView())return this.playing=!1,Promise.resolve();const n=this.intervalTime??Nr.defaults.intervalTime,s=((((o=this._currentViewWrapper.value)==null?void 0:o.viewInfo.duration)??0)+n)*1e3;return e.promise(Mh(s)).then(()=>this._flyStep(e))}initProcessing(){const e=this.dv(Ln(async r=>this._flyStep(r))),n=()=>{this.playing?e.restart():e.cancel()};n(),this.d(this.playingChanged.don(n))}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ft([this,"flyMode"],[["默认","default"],["直线飞行","uniform"]],"飞行模式",Nr.defaults.flyMode),new vt("添加视角",()=>this.addView(),[],"addView"),new vt("插入视角",n=>this.insertView(n),[0],"insertView"),new vt("清空视角",()=>this.clearAllViews(),[],"clearAllViews"),new vt("当前位置插入视角",()=>this.insertView(this.currentViewIndex+1),[],"insertView"),new vt("上一个视角",()=>this.flyToPrevView(),[],"flyToPrevView"),new vt("下一个视角",()=>this.flyToNextView(),[],"flyToNextView"),new vt("飞入指定视角",n=>this.flyToView(n),[0],"flyToView"),new vt("更改指定视角为轮播视角",n=>this.setCurrentView(n),[0],"setCurrentView"),new vt("删除当前视角",()=>this.deleteCurrentView(),[],"deleteCurrentView"),new vt("删除指定视角",n=>this.deleteView(n),[0],"deleteView"),new vt("更改指定视角为当前视角信息",n=>this.resetView(n),[0],"resetView"),new D([this,"currentViewIndex"],"当前序号",-1,!1,!0),new xy([this,"playing"],()=>this.stop(),[this,"loop"],"播放",Nr.defaults),new X([this,"playing"],"是否播放"),new vt("停止播放",()=>this.stop(),[],"stop"),new X([this,"loop"],"是否循环"),new D([this,"intervalTime"],"间隔时间"),new Ne([this,"views"],"视角集合",[],void 0,!0)]}}};f(Nr,"createDefaultProps",()=>({...pt.createDefaultProps(),playing:!1,loop:!0,intervalTime:5,flyMode:"default"})),f(Nr,"type",Nr.register("ESCameraViewCollection",Nr,{chsName:"视角集合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角集合"}));let Lf=Nr;const Hu=class Hu extends ct{constructor(e){super(e);f(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new D([this,"aspectRatio"],"宽高比",1.77778),new D([this,"fov"],"横向夹角",90),new D([this,"far"],"视野长度",100),new D([this,"near"],"近面距离",5)]}}};f(Hu,"createDefaultProps",()=>({...ct.createDefaultProps(),fov:90,aspectRatio:1.77778,far:100,near:5,collision:!1})),f(Hu,"type",Hu.register("ESCameraVisibleRange",Hu,{chsName:"摄像头可视域",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"摄像头可视域"}));let Fm=Hu;const Xu=class Xu extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ft([this,"mode"],[["警车","policeCar"]],"模式","policeCar")]}}};f(Xu,"createDefaultProps",()=>({...ct.createDefaultProps(),mode:"policeCar",allowPicking:!0})),f(Xu,"type",Xu.register("ESCar",Xu,{chsName:"车辆",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警车等基础车辆模型"}));let Ff=Xu;const cl=class cl extends Ot{constructor(e){super(e);f(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new D([this,"height"],"高度",10)],coordinate:[...e.coordinate,new D([this,"area"],"面积",0,!1,!0),new D([this,"perimeter"],"周长",0,!1,!0)]}}};f(cl,"createDefaultProps",()=>({...Ot.createDefaultProps(),height:10,filled:!0,fillStyle:bt({material:"",materialParams:{},ground:!0,color:[1,1,1,1]})})),f(cl,"type",cl.register("ESClassification",cl,{chsName:"倾斜单体化",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"平尾箭头"})),f(cl,"supportEditingModes",[...Ot.supportEditingModes,nt.CircularAppend,nt.CircularInsert,nt.HeightModify]);let kf=cl;const $u=class $u extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new X([this,"showArrow"],"显示箭头",!0),new Dt([this,"edgeColor"],"线框颜色",[1,1,1,1]),new D([this,"edgetWidth"],"线框宽度",2),new D([this,"width"],"裁剪宽度",200),new D([this,"height"],"裁剪高度",200),new mt([this,"targetID"],"目标图层id","")]}}};f($u,"createDefaultProps",()=>({...ct.createDefaultProps(),showArrow:!0,edgeColor:ot([1,1,1,1]),edgetWidth:2,width:200,height:200,targetID:""})),f($u,"type",$u.register("ESClippingPlane",$u,{chsName:"裁切",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESClippingPlane"}));let km=$u;class fD extends B{constructor(t,e,n){super();const r=document.createElement("div");r.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${n.id}) container`);{const l=()=>{const h=` ${e.cssText}
48
+ `)}return t.toString()},pi.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.computeLabel(t)}},pi.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var n=[!1,!1],r=this.iterator();r.hasNext();)for(var s=r.next(),o=s.getLabel(),a=0;a<2;a++)o.isLine(a)&&o.getLocation(a)===k.BOUNDARY&&(n[a]=!0);for(var l=this.iterator();l.hasNext();)for(var u=l.next(),h=u.getLabel(),c=0;c<2;c++)if(h.isAnyNull(c)){var d=k.NONE;if(n[c])d=k.EXTERIOR;else{var g=u.getCoordinate();d=e.getLocation(c,g,t)}h.setAllLocationsIfNull(c,d)}},pi.prototype.getDegree=function(){return this._edgeMap.size()},pi.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},pi.prototype.interfaces_=function(){return[]},pi.prototype.getClass=function(){return pi};var XN=(function(i){function t(){i.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var n=this;this.getResultAreaEdges();for(var r=null,s=null,o=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var l=n._resultAreaEdgeList.get(a),u=l.getSym();if(l.getLabel().isArea())switch(r===null&&l.isInResult()&&(r=l),o){case n._SCANNING_FOR_INCOMING:if(!u.isInResult())continue;s=u,o=n._LINKING_TO_OUTGOING;break;case n._LINKING_TO_OUTGOING:if(!l.isInResult())continue;s.setNext(l),o=n._SCANNING_FOR_INCOMING;break}}if(o===this._LINKING_TO_OUTGOING){if(r===null)throw new Ms("no outgoing dirEdge found",this.getCoordinate());Tt.isTrue(r.isInResult(),"unable to link last incoming dirEdge"),s.setNext(r)}},t.prototype.insert=function(n){var r=n;this.insertEdgeEnd(r,r)},t.prototype.getRightmostEdge=function(){var n=this.getEdges(),r=n.size();if(r<1)return null;var s=n.get(0);if(r===1)return s;var o=n.get(r-1),a=s.getQuadrant(),l=o.getQuadrant();return te.isNorthern(a)&&te.isNorthern(l)?s:!te.isNorthern(a)&&!te.isNorthern(l)?o:s.getDy()!==0?s:o.getDy()!==0?o:(Tt.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(n){ii.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var r=this.iterator();r.hasNext();){var s=r.next();n.print("out "),s.print(n),n.println(),n.print("in "),s.getSym().print(n),n.println()}},t.prototype.getResultAreaEdges=function(){var n=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new J;for(var r=this.iterator();r.hasNext();){var s=r.next();(s.isInResult()||s.getSym().isInResult())&&n._resultAreaEdgeList.add(s)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(n){for(var r=this.iterator();r.hasNext();){var s=r.next(),o=s.getLabel();o.setAllLocationsIfNull(0,n.getLocation(0)),o.setAllLocationsIfNull(1,n.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var n=this;this.getEdges();for(var r=null,s=null,o=this._edgeList.size()-1;o>=0;o--){var a=n._edgeList.get(o),l=a.getSym();s===null&&(s=l),r!==null&&l.setNext(r),r=a}s.setNext(r)},t.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var r=arguments[0],s=this.findIndex(r),o=r.getDepth(X.LEFT),a=r.getDepth(X.RIGHT),l=this.computeDepths(s+1,this._edgeList.size(),o),u=this.computeDepths(0,s,l);if(u!==a)throw new Ms("depth mismatch at "+r.getCoordinate())}else if(arguments.length===3){for(var h=arguments[0],c=arguments[1],d=arguments[2],g=d,p=h;p<c;p++){var E=n._edgeList.get(p);E.setEdgeDepths(X.RIGHT,g),g=E.getDepth(X.LEFT)}return g}},t.prototype.mergeSymLabels=function(){for(var n=this.iterator();n.hasNext();){var r=n.next(),s=r.getLabel();s.merge(r.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(n){for(var r=this,s=null,o=null,a=this._SCANNING_FOR_INCOMING,l=this._resultAreaEdgeList.size()-1;l>=0;l--){var u=r._resultAreaEdgeList.get(l),h=u.getSym();switch(s===null&&u.getEdgeRing()===n&&(s=u),a){case r._SCANNING_FOR_INCOMING:if(h.getEdgeRing()!==n)continue;o=h,a=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(u.getEdgeRing()!==n)continue;o.setNextMin(u),a=r._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(Tt.isTrue(s!==null,"found null for first outgoing dirEdge"),Tt.isTrue(s.getEdgeRing()===n,"unable to link last incoming dirEdge"),o.setNextMin(s))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,r=this.iterator();r.hasNext();){var s=r.next();s.isInResult()&&n++}return n}else if(arguments.length===1){for(var o=arguments[0],a=0,l=this.iterator();l.hasNext();){var u=l.next();u.getEdgeRing()===o&&a++}return a}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var n=k.NONE,r=this.iterator();r.hasNext();){var s=r.next(),o=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){n=k.INTERIOR;break}if(o.isInResult()){n=k.EXTERIOR;break}}}if(n===k.NONE)return null;for(var a=n,l=this.iterator();l.hasNext();){var u=l.next(),h=u.getSym();u.isLineEdge()?u.getEdge().setCovered(a===k.INTERIOR):(u.isInResult()&&(a=k.EXTERIOR),h.isInResult()&&(a=k.INTERIOR))}},t.prototype.computeLabelling=function(n){var r=this;i.prototype.computeLabelling.call(this,n),this._label=new Yt(k.NONE);for(var s=this.iterator();s.hasNext();)for(var o=s.next(),a=o.getEdge(),l=a.getLabel(),u=0;u<2;u++){var h=l.getLocation(u);(h===k.INTERIOR||h===k.BOUNDARY)&&r._label.setLocation(u,k.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(pi),Qw=(function(i){function t(){i.apply(this,arguments)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.createNode=function(n){return new cf(n,new XN)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(gu),ho=function i(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=i.orientation(t)};ho.prototype.compareTo=function(t){var e=t,n=ho.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return n},ho.prototype.interfaces_=function(){return[bn]},ho.prototype.getClass=function(){return ho},ho.orientation=function(t){return Rt.increasingDirection(t)===1},ho.compareOriented=function(t,e,n,r){for(var s=e?1:-1,o=r?1:-1,a=e?t.length:-1,l=r?n.length:-1,u=e?0:t.length-1,h=r?0:n.length-1;;){var c=t[u].compareTo(n[h]);if(c!==0)return c;u+=s,h+=o;var d=u===a,g=h===l;if(d&&!g)return-1;if(!d&&g)return 1;if(d&&g)return 0}};var Hn=function(){this._edges=new J,this._ocaMap=new fi};Hn.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var n=0;n<this._edges.size();n++){var r=e._edges.get(n);n>0&&t.print(","),t.print("(");for(var s=r.getCoordinates(),o=0;o<s.length;o++)o>0&&t.print(","),t.print(s[o].x+" "+s[o].y);t.println(")")}t.print(") ")},Hn.prototype.addAll=function(t){for(var e=this,n=t.iterator();n.hasNext();)e.add(n.next())},Hn.prototype.findEdgeIndex=function(t){for(var e=this,n=0;n<this._edges.size();n++)if(e._edges.get(n).equals(t))return n;return-1},Hn.prototype.iterator=function(){return this._edges.iterator()},Hn.prototype.getEdges=function(){return this._edges},Hn.prototype.get=function(t){return this._edges.get(t)},Hn.prototype.findEqualEdge=function(t){var e=new ho(t.getCoordinates()),n=this._ocaMap.get(e);return n},Hn.prototype.add=function(t){this._edges.add(t);var e=new ho(t.getCoordinates());this._ocaMap.put(e,t)},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var Ko=function(){};Ko.prototype.processIntersections=function(t,e,n,r){},Ko.prototype.isDone=function(){},Ko.prototype.interfaces_=function(){return[]},Ko.prototype.getClass=function(){return Ko};var cn=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};cn.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&this._li.getIntersectionNum()===1){if(cn.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var s=t.size()-1;if(e===0&&r===s||r===0&&e===s)return!0}}return!1},cn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},cn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},cn.prototype.getLineIntersector=function(){return this._li},cn.prototype.hasProperIntersection=function(){return this._hasProper},cn.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var s=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],l=n.getCoordinates()[r+1];this._li.computeIntersection(s,o,a,l),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},cn.prototype.hasIntersection=function(){return this._hasIntersection},cn.prototype.isDone=function(){return!1},cn.prototype.hasInteriorIntersection=function(){return this._hasInterior},cn.prototype.interfaces_=function(){return[Ko]},cn.prototype.getClass=function(){return cn},cn.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var Cr=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new L(t),this.segmentIndex=e,this.dist=n};Cr.prototype.getSegmentIndex=function(){return this.segmentIndex},Cr.prototype.getCoordinate=function(){return this.coord},Cr.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Cr.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Cr.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},Cr.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Cr.prototype.getDistance=function(){return this.dist},Cr.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Cr.prototype.interfaces_=function(){return[bn]},Cr.prototype.getClass=function(){return Cr};var $r=function(){this._nodeMap=new fi,this.edge=null;var t=arguments[0];this.edge=t};$r.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},$r.prototype.iterator=function(){return this._nodeMap.values().iterator()},$r.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var n=this.iterator(),r=n.next();n.hasNext();){var s=n.next(),o=e.createSplitEdge(r,s);t.add(o),r=s}},$r.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},$r.prototype.createSplitEdge=function(t,e){var n=this,r=e.segmentIndex-t.segmentIndex+2,s=this.edge.pts[e.segmentIndex],o=e.dist>0||!e.coord.equals2D(s);o||r--;var a=new Array(r).fill(null),l=0;a[l++]=new L(t.coord);for(var u=t.segmentIndex+1;u<=e.segmentIndex;u++)a[l++]=n.edge.pts[u];return o&&(a[l]=e.coord),new ff(a,new Yt(this.edge._label))},$r.prototype.add=function(t,e,n){var r=new Cr(t,e,n),s=this._nodeMap.get(r);return s!==null?s:(this._nodeMap.put(r,r),r)},$r.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();if(n.coord.equals(t))return!0}return!1},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r};var Qo=function(){};Qo.prototype.getChainStartIndices=function(t){var e=this,n=0,r=new J;r.add(new fr(n));do{var s=e.findChainEnd(t,n);r.add(new fr(s)),n=s}while(n<t.length-1);var o=Qo.toIntArray(r);return o},Qo.prototype.findChainEnd=function(t,e){for(var n=te.quadrant(t[e],t[e+1]),r=e+1;r<t.length;){var s=te.quadrant(t[r-1],t[r]);if(s!==n)break;r++}return r-1},Qo.prototype.interfaces_=function(){return[]},Qo.prototype.getClass=function(){return Qo},Qo.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Os=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new ht,this.env2=new ht;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Qo;this.startIndex=e.getChainStartIndices(this.pts)};Os.prototype.getCoordinates=function(){return this.pts},Os.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},Os.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},Os.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],r)}else if(arguments.length===6){var s=arguments[0],o=arguments[1],a=arguments[2],l=arguments[3],u=arguments[4],h=arguments[5],c=this.pts[s],d=this.pts[o],g=a.pts[l],p=a.pts[u];if(o-s===1&&u-l===1)return h.addIntersections(this.e,s,a.e,l),null;if(this.env1.init(c,d),this.env2.init(g,p),!this.env1.intersects(this.env2))return null;var E=Math.trunc((s+o)/2),b=Math.trunc((l+u)/2);s<E&&(l<b&&this.computeIntersectsForChain(s,E,a,l,b,h),b<u&&this.computeIntersectsForChain(s,E,a,b,u,h)),E<o&&(l<b&&this.computeIntersectsForChain(E,o,a,l,b,h),b<u&&this.computeIntersectsForChain(E,o,a,b,u,h))}},Os.prototype.getStartIndexes=function(){return this.startIndex},Os.prototype.computeIntersects=function(t,e){for(var n=this,r=0;r<this.startIndex.length-1;r++)for(var s=0;s<t.startIndex.length-1;s++)n.computeIntersectsForChain(r,t,s,e)},Os.prototype.interfaces_=function(){return[]},Os.prototype.getClass=function(){return Os};var ni=function i(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var n=0;n<3;n++)t._depth[e][n]=i.NULL_VALUE},t1={NULL_VALUE:{configurable:!0}};ni.prototype.getDepth=function(t,e){return this._depth[t][e]},ni.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},ni.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var n=0;n<3;n++)if(t._depth[e][n]!==ni.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var r=arguments[0];return this._depth[r][1]===ni.NULL_VALUE}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._depth[s][o]===ni.NULL_VALUE}},ni.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var n=t._depth[e][1];t._depth[e][2]<n&&(n=t._depth[e][2]),n<0&&(n=0);for(var r=1;r<3;r++){var s=0;t._depth[e][r]>n&&(s=1),t._depth[e][r]=s}}},ni.prototype.getDelta=function(t){return this._depth[t][X.RIGHT]-this._depth[t][X.LEFT]},ni.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?k.EXTERIOR:k.INTERIOR},ni.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},ni.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],n=0;n<2;n++)for(var r=1;r<3;r++){var s=e.getLocation(n,r);(s===k.EXTERIOR||s===k.INTERIOR)&&(t.isNull(n,r)?t._depth[n][r]=ni.depthAtLocation(s):t._depth[n][r]+=ni.depthAtLocation(s))}else if(arguments.length===3){var o=arguments[0],a=arguments[1],l=arguments[2];l===k.INTERIOR&&this._depth[o][a]++}},ni.prototype.interfaces_=function(){return[]},ni.prototype.getClass=function(){return ni},ni.depthAtLocation=function(t){return t===k.EXTERIOR?0:t===k.INTERIOR?1:ni.NULL_VALUE},t1.NULL_VALUE.get=function(){return-1},Object.defineProperties(ni,t1);var ff=(function(i){function t(){if(i.call(this),this.pts=null,this._env=null,this.eiList=new $r(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new ni,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.pts=n,this._label=r}}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var r=new t(n,Yt.toLineLabel(this._label));return r},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(n){this._isIsolated=n},t.prototype.setName=function(n){this._name=n},t.prototype.equals=function(n){var r=this;if(!(n instanceof t))return!1;var s=n;if(this.pts.length!==s.pts.length)return!1;for(var o=!0,a=!0,l=this.pts.length,u=0;u<this.pts.length;u++)if(r.pts[u].equals2D(s.pts[u])||(o=!1),r.pts[u].equals2D(s.pts[--l])||(a=!1),!o&&!a)return!1;return!0},t.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},t.prototype.print=function(n){var r=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&n.print(","),n.print(r.pts[s].x+" "+r.pts[s].y);n.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(n){t.updateIM(this._label,n)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(n){var r=this;n.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)n.print(r.pts[s]+" ");n.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Os(this)),this._mce},t.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new ht;for(var r=0;r<this.pts.length;r++)n._env.expandToInclude(n.pts[r])}return this._env},t.prototype.addIntersection=function(n,r,s,o){var a=new L(n.getIntersection(o)),l=r,u=n.getEdgeDistance(s,o),h=l+1;if(h<this.pts.length){var c=this.pts[h];a.equals2D(c)&&(l=h,u=0)}this.eiList.add(a,l,u)},t.prototype.toString=function(){var n=this,r=new dr;r.append("edge "+this._name+": "),r.append("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&r.append(","),r.append(n.pts[s].x+" "+n.pts[s].y);return r.append(") "+this._label+" "+this._depthDelta),r.toString()},t.prototype.isPointwiseEqual=function(n){var r=this;if(this.pts.length!==n.pts.length)return!1;for(var s=0;s<this.pts.length;s++)if(!r.pts[s].equals2D(n.pts[s]))return!1;return!0},t.prototype.setDepthDelta=function(n){this._depthDelta=n},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(n,r,s){for(var o=this,a=0;a<n.getIntersectionNum();a++)o.addIntersection(n,r,s,a)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1];r.setAtLeastIfValid(n.getLocation(0,X.ON),n.getLocation(1,X.ON),1),n.isArea()&&(r.setAtLeastIfValid(n.getLocation(0,X.LEFT),n.getLocation(1,X.LEFT),2),r.setAtLeastIfValid(n.getLocation(0,X.RIGHT),n.getLocation(1,X.RIGHT),2))}else return i.prototype.updateIM.apply(this,arguments)},t})(ln),bi=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Hn,this._bufParams=t||null};bi.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},bi.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Yt(t.getLabel()),r.flip()),n.merge(r);var s=bi.depthDelta(r),o=e.getDepthDelta(),a=o+s;e.setDepthDelta(a)}else this._edgeList.add(t),t.setDepthDelta(bi.depthDelta(t.getLabel()))},bi.prototype.buildSubgraphs=function(t,e){for(var n=new J,r=t.iterator();r.hasNext();){var s=r.next(),o=s.getRightmostCoordinate(),a=new Ha(n),l=a.getDepth(o);s.computeDepth(l),s.findResultEdges(),n.add(s),e.add(s.getDirectedEdges(),s.getNodes())}},bi.prototype.createSubgraphs=function(t){for(var e=new J,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var s=new Ei;s.create(r),e.add(s)}}return Wn.sort(e,Wn.reverseOrder()),e},bi.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},bi.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new am,n=new Ho;return n.setPrecisionModel(t),e.setSegmentIntersector(new cn(n)),e},bi.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;n===null&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new Ri(n,this._bufParams),s=new Tn(t,e,r),o=s.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,n),this._graph=new pe(new Qw),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),l=new Wi(this._geomFact);this.buildSubgraphs(a,l);var u=l.getPolygons();if(u.size()<=0)return this.createEmptyResultGeometry();var h=this._geomFact.buildGeometry(u);return h},bi.prototype.computeNodedEdges=function(t,e){var n=this,r=this.getNoder(e);r.computeNodes(t);for(var s=r.getNodedSubstrings(),o=s.iterator();o.hasNext();){var a=o.next(),l=a.getCoordinates();if(!(l.length===2&&l[0].equals2D(l[1]))){var u=a.getData(),h=new ff(a.getCoordinates(),new Yt(u));n.insertUniqueEdge(h)}}},bi.prototype.setNoder=function(t){this._workingNoder=t},bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return bi},bi.depthDelta=function(t){var e=t.getLocation(0,X.LEFT),n=t.getLocation(0,X.RIGHT);return e===k.INTERIOR&&n===k.EXTERIOR?1:e===k.EXTERIOR&&n===k.INTERIOR?-1:0},bi.convertSegStrings=function(t){for(var e=new At,n=new J;t.hasNext();){var r=t.next(),s=e.createLineString(r.getCoordinates());n.add(s)}return e.buildGeometry(n)};var co=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var n=arguments[0],r=arguments[1],s=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=s,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};co.prototype.rescale=function(){var t=this;if(St(arguments[0],De))for(var e=arguments[0],n=e.iterator();n.hasNext();){var r=n.next();t.rescale(r.getCoordinates())}else if(arguments[0]instanceof Array){for(var s=arguments[0],o=0;o<s.length;o++)s[o].x=s[o].x/t._scaleFactor+t._offsetX,s[o].y=s[o].y/t._scaleFactor+t._offsetY;s.length===2&&s[0].equals2D(s[1])&&ii.out.println(s)}},co.prototype.scale=function(){var t=this;if(St(arguments[0],De)){for(var e=arguments[0],n=new J,r=e.iterator();r.hasNext();){var s=r.next();n.add(new be(t.scale(s.getCoordinates()),s.getData()))}return n}else if(arguments[0]instanceof Array){for(var o=arguments[0],a=new Array(o.length).fill(null),l=0;l<o.length;l++)a[l]=new L(Math.round((o[l].x-t._offsetX)*t._scaleFactor),Math.round((o[l].y-t._offsetY)*t._scaleFactor),o[l].z);var u=Rt.removeRepeatedPoints(a);return u}},co.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},co.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},co.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},co.prototype.interfaces_=function(){return[Jo]},co.prototype.getClass=function(){return co};var Pr=function(){this._li=new Ho,this._segStrings=null;var t=arguments[0];this._segStrings=t},e1={fact:{configurable:!0}};Pr.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next(),r=n.getCoordinates();t.checkEndPtVertexIntersections(r[0],t._segStrings),t.checkEndPtVertexIntersections(r[r.length-1],t._segStrings)}else if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=o.iterator();a.hasNext();)for(var l=a.next(),u=l.getCoordinates(),h=1;h<u.length-1;h++)if(u[h].equals(s))throw new Ss("found endpt/interior pt intersection at index "+h+" :pt "+s)}},Pr.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var n=e.next(),r=this._segStrings.iterator();r.hasNext();){var s=r.next();t.checkInteriorIntersections(n,s)}else if(arguments.length===2)for(var o=arguments[0],a=arguments[1],l=o.getCoordinates(),u=a.getCoordinates(),h=0;h<l.length-1;h++)for(var c=0;c<u.length-1;c++)t.checkInteriorIntersections(o,h,a,c);else if(arguments.length===4){var d=arguments[0],g=arguments[1],p=arguments[2],E=arguments[3];if(d===p&&g===E)return null;var b=d.getCoordinates()[g],P=d.getCoordinates()[g+1],v=p.getCoordinates()[E],_=p.getCoordinates()[E+1];if(this._li.computeIntersection(b,P,v,_),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,b,P)||this.hasInteriorIntersection(this._li,v,_)))throw new Ss("found non-noded intersection at "+b+"-"+P+" and "+v+"-"+_)}},Pr.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Pr.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next();t.checkCollapses(n)}else if(arguments.length===1)for(var r=arguments[0],s=r.getCoordinates(),o=0;o<s.length-2;o++)t.checkCollapse(s[o],s[o+1],s[o+2])},Pr.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var s=t.getIntersection(r);if(!(s.equals(e)||s.equals(n)))return!0}return!1},Pr.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Ss("found non-noded collapse at "+Pr.fact.createLineString([t,e,n]))},Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr},e1.fact.get=function(){return new At},Object.defineProperties(Pr,e1);var Ai=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new de("Scale factor must be non-zero");e!==1&&(this._pt=new L(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new L,this._p1Scaled=new L),this.initCorners(this._pt)},i1={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};Ai.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),s=Math.min(t.y,e.y),o=Math.max(t.y,e.y),a=this._maxx<n||this._minx>r||this._maxy<s||this._miny>o;if(a)return!1;var l=this.intersectsToleranceSquare(t,e);return Tt.isTrue(!(a&&l),"Found bad envelope test"),l},Ai.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new L(this._maxx,this._maxy),this._corner[1]=new L(this._minx,this._maxy),this._corner[2]=new L(this._minx,this._miny),this._corner[3]=new L(this._maxx,this._miny)},Ai.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},Ai.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},Ai.prototype.getCoordinate=function(){return this._originalPt},Ai.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},Ai.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=Ai.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new ht(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},Ai.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))},Ai.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||n&&r||t.equals(this._pt)||e.equals(this._pt))},Ai.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return this.intersects(n,r)?(t.addIntersection(this.getCoordinate(),e),!0):!1},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai},i1.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(Ai,i1);var Cc=function(){this.tempEnv1=new ht,this.selectedSegment=new gt};Cc.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}},Cc.prototype.interfaces_=function(){return[]},Cc.prototype.getClass=function(){return Cc};var yu=function(){this._index=null;var t=arguments[0];this._index=t},n1={HotPixelSnapAction:{configurable:!0}};yu.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],n=arguments[1],r=arguments[2],s=e.getSafeEnvelope(),o=new r1(e,n,r);return this._index.query(s,{interfaces_:function(){return[lo]},visitItem:function(a){var l=a;l.select(s,o)}}),o.isNodeAdded()}},yu.prototype.interfaces_=function(){return[]},yu.prototype.getClass=function(){return yu},n1.HotPixelSnapAction.get=function(){return r1},Object.defineProperties(yu,n1);var r1=(function(i){function t(){i.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1],s=n.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&r===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,r)}else return i.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Cc),Xa=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new J};Xa.prototype.processIntersections=function(t,e,n,r){var s=this;if(t===n&&e===r)return null;var o=t.getCoordinates()[e],a=t.getCoordinates()[e+1],l=n.getCoordinates()[r],u=n.getCoordinates()[r+1];if(this._li.computeIntersection(o,a,l,u),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var h=0;h<this._li.getIntersectionNum();h++)s._interiorIntersections.add(s._li.getIntersection(h));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},Xa.prototype.isDone=function(){return!1},Xa.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Xa.prototype.interfaces_=function(){return[Ko]},Xa.prototype.getClass=function(){return Xa};var Yr=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new Ho,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};Yr.prototype.checkCorrectness=function(t){var e=be.getNodedSubstrings(t),n=new Pr(e);try{n.checkValid()}catch(r){if(r instanceof kw)r.printStackTrace();else throw r}finally{}},Yr.prototype.getNodedSubstrings=function(){return be.getNodedSubstrings(this._nodedSegStrings)},Yr.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},Yr.prototype.findInteriorIntersections=function(t,e){var n=new Xa(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},Yr.prototype.computeVertexSnaps=function(){var t=this;if(St(arguments[0],De))for(var e=arguments[0],n=e.iterator();n.hasNext();){var r=n.next();t.computeVertexSnaps(r)}else if(arguments[0]instanceof be)for(var s=arguments[0],o=s.getCoordinates(),a=0;a<o.length;a++){var l=new Ai(o[a],t._scaleFactor,t._li),u=t._pointSnapper.snap(l,s,a);u&&s.addIntersection(o[a],a)}},Yr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new am,this._pointSnapper=new yu(this._noder.getIndex()),this.snapRound(t,this._li)},Yr.prototype.computeIntersectionSnaps=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next(),s=new Ai(r,e._scaleFactor,e._li);e._pointSnapper.snap(s)}},Yr.prototype.interfaces_=function(){return[Jo]},Yr.prototype.getClass=function(){return Yr};var ri=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new qt,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},_u={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};ri.prototype.bufferFixedPrecision=function(t){var e=new co(new Yr(new Ut(1)),t.getScale()),n=new bi(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},ri.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=ri.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(o){if(o instanceof Ms)t._saveException=o;else throw o}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],r=ri.precisionScaleFactor(this._argGeom,this._distance,n),s=new Ut(r);this.bufferFixedPrecision(s)}},ri.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Ut.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},ri.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},ri.prototype.bufferOriginalPrecision=function(){try{var t=new bi(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof Ss)this._saveException=e;else throw e}finally{}},ri.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},ri.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},ri.prototype.interfaces_=function(){return[]},ri.prototype.getClass=function(){return ri},ri.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new ri(t),r=n.getResultGeometry(e);return r}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof _t&&typeof arguments[1]=="number"){var s=arguments[0],o=arguments[1],a=arguments[2],l=new ri(s);l.setQuadrantSegments(a);var u=l.getResultGeometry(o);return u}else if(arguments[2]instanceof qt&&arguments[0]instanceof _t&&typeof arguments[1]=="number"){var h=arguments[0],c=arguments[1],d=arguments[2],g=new ri(h,d),p=g.getResultGeometry(c);return p}}else if(arguments.length===4){var E=arguments[0],b=arguments[1],P=arguments[2],v=arguments[3],_=new ri(E);_.setQuadrantSegments(P),_.setEndCapStyle(v);var m=_.getResultGeometry(b);return m}},ri.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),s=an.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY())),o=e>0?e:0,a=s+2*o,l=Math.trunc(Math.log(a)/Math.log(10)+1),u=n-l,h=Math.pow(10,u);return h},_u.CAP_ROUND.get=function(){return qt.CAP_ROUND},_u.CAP_BUTT.get=function(){return qt.CAP_FLAT},_u.CAP_FLAT.get=function(){return qt.CAP_FLAT},_u.CAP_SQUARE.get=function(){return qt.CAP_SQUARE},_u.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(ri,_u);var Ci=function(){this._pt=[new L,new L],this._distance=Pt.NaN,this._isNull=!0};Ci.prototype.getCoordinates=function(){return this._pt},Ci.prototype.getCoordinate=function(t){return this._pt[t]},Ci.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},Ci.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=s,this._isNull=!1}},Ci.prototype.getDistance=function(){return this._distance},Ci.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var Jr=function(){};Jr.prototype.interfaces_=function(){return[]},Jr.prototype.getClass=function(){return Jr},Jr.computeDistance=function(){if(arguments[2]instanceof Ci&&arguments[0]instanceof ve&&arguments[1]instanceof L)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=t.getCoordinates(),s=new gt,o=0;o<r.length-1;o++){s.setCoordinates(r[o],r[o+1]);var a=s.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof Ci&&arguments[0]instanceof Re&&arguments[1]instanceof L){var l=arguments[0],u=arguments[1],h=arguments[2];Jr.computeDistance(l.getExteriorRing(),u,h);for(var c=0;c<l.getNumInteriorRing();c++)Jr.computeDistance(l.getInteriorRingN(c),u,h)}else if(arguments[2]instanceof Ci&&arguments[0]instanceof _t&&arguments[1]instanceof L){var d=arguments[0],g=arguments[1],p=arguments[2];if(d instanceof ve)Jr.computeDistance(d,g,p);else if(d instanceof Re)Jr.computeDistance(d,g,p);else if(d instanceof wi)for(var E=d,b=0;b<E.getNumGeometries();b++){var P=E.getGeometryN(b);Jr.computeDistance(P,g,p)}else p.setMinimum(d.getCoordinate(),g)}else if(arguments[2]instanceof Ci&&arguments[0]instanceof gt&&arguments[1]instanceof L){var v=arguments[0],_=arguments[1],m=arguments[2],y=v.closestPoint(_);m.setMinimum(y,_)}};var ta=function(t){this._maxPtDist=new Ci,this._inputGeom=t||null},lm={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};ta.prototype.computeMaxMidpointDistance=function(t){var e=new fo(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},ta.prototype.computeMaxVertexDistance=function(t){var e=new $a(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},ta.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},ta.prototype.getDistancePoints=function(){return this._maxPtDist},ta.prototype.interfaces_=function(){return[]},ta.prototype.getClass=function(){return ta},lm.MaxPointDistanceFilter.get=function(){return $a},lm.MaxMidpointDistanceFilter.get=function(){return fo},Object.defineProperties(ta,lm);var $a=function(t){this._maxPtDist=new Ci,this._minPtDist=new Ci,this._geom=t||null};$a.prototype.filter=function(t){this._minPtDist.initialize(),Jr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},$a.prototype.getMaxPointDistance=function(){return this._maxPtDist},$a.prototype.interfaces_=function(){return[Br]},$a.prototype.getClass=function(){return $a};var fo=function(t){this._maxPtDist=new Ci,this._minPtDist=new Ci,this._geom=t||null};fo.prototype.filter=function(t,e){if(e===0)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),s=new L((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),Jr.computeDistance(this._geom,s,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},fo.prototype.isDone=function(){return!1},fo.prototype.isGeometryChanged=function(){return!1},fo.prototype.getMaxPointDistance=function(){return this._maxPtDist},fo.prototype.interfaces_=function(){return[Un]},fo.prototype.getClass=function(){return fo};var Ds=function(t){this._comps=t||null};Ds.prototype.filter=function(t){t instanceof Re&&this._comps.add(t)},Ds.prototype.interfaces_=function(){return[vr]},Ds.prototype.getClass=function(){return Ds},Ds.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return Ds.getPolygons(t,new J)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof Re?n.add(e):e instanceof wi&&e.apply(new Ds(n)),n}};var si=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};si.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof Ur){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof ve&&this._lines.add(t)},si.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},si.prototype.interfaces_=function(){return[bs]},si.prototype.getClass=function(){return si},si.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(si.getLines(t))}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(si.getLines(e,n))}},si.getLines=function(){if(arguments.length===1){var t=arguments[0];return si.getLines(t,!1)}else if(arguments.length===2){if(St(arguments[0],De)&&St(arguments[1],De)){for(var e=arguments[0],n=arguments[1],r=e.iterator();r.hasNext();){var s=r.next();si.getLines(s,n)}return n}else if(arguments[0]instanceof _t&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1],l=new J;return o.apply(new si(l,a)),l}else if(arguments[0]instanceof _t&&St(arguments[1],De)){var u=arguments[0],h=arguments[1];return u instanceof ve?h.add(u):u.apply(new si(h)),h}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&St(arguments[0],De)&&St(arguments[1],De)){for(var c=arguments[0],d=arguments[1],g=arguments[2],p=c.iterator();p.hasNext();){var E=p.next();si.getLines(E,d,g)}return d}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof _t&&St(arguments[1],De)){var b=arguments[0],P=arguments[1],v=arguments[2];return b.apply(new si(P,v)),P}}};var Xn=function(){if(this._boundaryRule=Pn.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t===null)throw new de("Rule must be non-null");this._boundaryRule=t}}};Xn.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof L&&arguments[1]instanceof Re){var e=arguments[0],n=arguments[1];if(n.isEmpty())return k.EXTERIOR;var r=n.getExteriorRing(),s=this.locateInPolygonRing(e,r);if(s===k.EXTERIOR)return k.EXTERIOR;if(s===k.BOUNDARY)return k.BOUNDARY;for(var o=0;o<n.getNumInteriorRing();o++){var a=n.getInteriorRingN(o),l=t.locateInPolygonRing(e,a);if(l===k.INTERIOR)return k.EXTERIOR;if(l===k.BOUNDARY)return k.BOUNDARY}return k.INTERIOR}else if(arguments[0]instanceof L&&arguments[1]instanceof ve){var u=arguments[0],h=arguments[1];if(!h.getEnvelopeInternal().intersects(u))return k.EXTERIOR;var c=h.getCoordinates();return!h.isClosed()&&(u.equals(c[0])||u.equals(c[c.length-1]))?k.BOUNDARY:tt.isOnLine(u,c)?k.INTERIOR:k.EXTERIOR}else if(arguments[0]instanceof L&&arguments[1]instanceof qi){var d=arguments[0],g=arguments[1],p=g.getCoordinate();return p.equals2D(d)?k.INTERIOR:k.EXTERIOR}},Xn.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?tt.locatePointInRing(t,e.getCoordinates()):k.EXTERIOR},Xn.prototype.intersects=function(t,e){return this.locate(t,e)!==k.EXTERIOR},Xn.prototype.updateLocationInfo=function(t){t===k.INTERIOR&&(this._isIn=!0),t===k.BOUNDARY&&this._numBoundaries++},Xn.prototype.computeLocation=function(t,e){var n=this;if(e instanceof qi&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof ve)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Re)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Yo)for(var r=e,s=0;s<r.getNumGeometries();s++){var o=r.getGeometryN(s);n.updateLocationInfo(n.locateInternal(t,o))}else if(e instanceof qr)for(var a=e,l=0;l<a.getNumGeometries();l++){var u=a.getGeometryN(l);n.updateLocationInfo(n.locateInternal(t,u))}else if(e instanceof wi)for(var h=new Xr(e);h.hasNext();){var c=h.next();c!==e&&n.computeLocation(t,c)}},Xn.prototype.locate=function(t,e){return e.isEmpty()?k.EXTERIOR:e instanceof ve?this.locateInternal(t,e):e instanceof Re?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?k.BOUNDARY:this._numBoundaries>0||this._isIn?k.INTERIOR:k.EXTERIOR)},Xn.prototype.interfaces_=function(){return[]},Xn.prototype.getClass=function(){return Xn};var Pi=function i(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];i.call(this,t,i.INSIDE_AREA,e)}else if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];this._component=n,this._segIndex=r,this._pt=s}},s1={INSIDE_AREA:{configurable:!0}};Pi.prototype.isInsideArea=function(){return this._segIndex===Pi.INSIDE_AREA},Pi.prototype.getCoordinate=function(){return this._pt},Pi.prototype.getGeometryComponent=function(){return this._component},Pi.prototype.getSegmentIndex=function(){return this._segIndex},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi},s1.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Pi,s1);var go=function(t){this._pts=t||null};go.prototype.filter=function(t){t instanceof qi&&this._pts.add(t)},go.prototype.interfaces_=function(){return[vr]},go.prototype.getClass=function(){return go},go.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof qi?Wn.singletonList(t):go.getPoints(t,new J)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof qi?n.add(e):e instanceof wi&&e.apply(new go(n)),n}};var Ya=function(){this._locations=null;var t=arguments[0];this._locations=t};Ya.prototype.filter=function(t){(t instanceof qi||t instanceof ve||t instanceof Re)&&this._locations.add(new Pi(t,0,t.getCoordinate()))},Ya.prototype.interfaces_=function(){return[vr]},Ya.prototype.getClass=function(){return Ya},Ya.getLocations=function(t){var e=new J;return t.apply(new Ya(e)),e};var oi=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Xn,this._minDistanceLocation=null,this._minDistance=Pt.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=s}};oi.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var n=arguments[0],r=arguments[1],s=1-n,o=Ds.getPolygons(this._geom[n]);if(o.size()>0){var a=Ya.getLocations(this._geom[s]);if(this.computeContainmentDistance(a,o,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=r[0],this._minDistanceLocation[n]=r[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&St(arguments[0],zn)&&St(arguments[1],zn)){for(var l=arguments[0],u=arguments[1],h=arguments[2],c=0;c<l.size();c++)for(var d=l.get(c),g=0;g<u.size();g++)if(t.computeContainmentDistance(d,u.get(g),h),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Pi&&arguments[1]instanceof Re){var p=arguments[0],E=arguments[1],b=arguments[2],P=p.getCoordinate();if(k.EXTERIOR!==this._ptLocator.locate(P,E))return this._minDistance=0,b[0]=p,b[1]=new Pi(E,P),null}}},oi.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var l=e.get(a);if(r.computeMinDistance(o,l,n),r._minDistance<=r._terminateDistance)return null}},oi.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=si.getLines(this._geom[0]),n=si.getLines(this._geom[1]),r=go.getPoints(this._geom[0]),s=go.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,s,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(r,s,t),this.updateMinDistance(t,!1)},oi.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},oi.prototype.updateMinDistance=function(t,e){if(t[0]===null)return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},oi.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},oi.prototype.computeMinDistance=function(){var t=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof ve&&arguments[1]instanceof qi){var e=arguments[0],n=arguments[1],r=arguments[2];if(e.getEnvelopeInternal().distance(n.getEnvelopeInternal())>this._minDistance)return null;for(var s=e.getCoordinates(),o=n.getCoordinate(),a=0;a<s.length-1;a++){var l=tt.distancePointLine(o,s[a],s[a+1]);if(l<t._minDistance){t._minDistance=l;var u=new gt(s[a],s[a+1]),h=u.closestPoint(o);r[0]=new Pi(e,a,h),r[1]=new Pi(n,0,o)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof ve&&arguments[1]instanceof ve){var c=arguments[0],d=arguments[1],g=arguments[2];if(c.getEnvelopeInternal().distance(d.getEnvelopeInternal())>this._minDistance)return null;for(var p=c.getCoordinates(),E=d.getCoordinates(),b=0;b<p.length-1;b++)for(var P=0;P<E.length-1;P++){var v=tt.distanceLineLine(p[b],p[b+1],E[P],E[P+1]);if(v<t._minDistance){t._minDistance=v;var _=new gt(p[b],p[b+1]),m=new gt(E[P],E[P+1]),y=_.closestPoints(m);g[0]=new Pi(c,b,y[0]),g[1]=new Pi(d,P,y[1])}if(t._minDistance<=t._terminateDistance)return null}}}},oi.prototype.computeMinDistancePoints=function(t,e,n){for(var r=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var l=e.get(a),u=o.getCoordinate().distance(l.getCoordinate());if(u<r._minDistance&&(r._minDistance=u,n[0]=new Pi(o,0,o.getCoordinate()),n[1]=new Pi(l,0,l.getCoordinate())),r._minDistance<=r._terminateDistance)return null}},oi.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new de("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},oi.prototype.computeMinDistanceLines=function(t,e,n){for(var r=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var l=e.get(a);if(r.computeMinDistance(o,l,n),r._minDistance<=r._terminateDistance)return null}},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.distance=function(t,e){var n=new oi(t,e);return n.distance()},oi.isWithinDistance=function(t,e,n){var r=new oi(t,e,n);return r.distance()<=n},oi.nearestPoints=function(t,e){var n=new oi(t,e);return n.nearestPoints()};var mi=function(){this._pt=[new L,new L],this._distance=Pt.NaN,this._isNull=!0};mi.prototype.getCoordinates=function(){return this._pt},mi.prototype.getCoordinate=function(t){return this._pt[t]},mi.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},mi.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=s,this._isNull=!1}},mi.prototype.toString=function(){return Vn.toLineString(this._pt[0],this._pt[1])},mi.prototype.getDistance=function(){return this._distance},mi.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},mi.prototype.interfaces_=function(){return[]},mi.prototype.getClass=function(){return mi};var xr=function(){};xr.prototype.interfaces_=function(){return[]},xr.prototype.getClass=function(){return xr},xr.computeDistance=function(){if(arguments[2]instanceof mi&&arguments[0]instanceof ve&&arguments[1]instanceof L)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new gt,s=t.getCoordinates(),o=0;o<s.length-1;o++){r.setCoordinates(s[o],s[o+1]);var a=r.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof mi&&arguments[0]instanceof Re&&arguments[1]instanceof L){var l=arguments[0],u=arguments[1],h=arguments[2];xr.computeDistance(l.getExteriorRing(),u,h);for(var c=0;c<l.getNumInteriorRing();c++)xr.computeDistance(l.getInteriorRingN(c),u,h)}else if(arguments[2]instanceof mi&&arguments[0]instanceof _t&&arguments[1]instanceof L){var d=arguments[0],g=arguments[1],p=arguments[2];if(d instanceof ve)xr.computeDistance(d,g,p);else if(d instanceof Re)xr.computeDistance(d,g,p);else if(d instanceof wi)for(var E=d,b=0;b<E.getNumGeometries();b++){var P=E.getGeometryN(b);xr.computeDistance(P,g,p)}else p.setMinimum(d.getCoordinate(),g)}else if(arguments[2]instanceof mi&&arguments[0]instanceof gt&&arguments[1]instanceof L){var v=arguments[0],_=arguments[1],m=arguments[2],y=v.closestPoint(_);m.setMinimum(y,_)}};var Nn=function(){this._g0=null,this._g1=null,this._ptDist=new mi,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},um={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Nn.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Nn.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new de("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Nn.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Nn.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Nn.prototype.computeOrientedDistance=function(t,e,n){var r=new Ja(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var s=new po(e,this._densifyFrac);t.apply(s),n.setMaximum(s.getMaxPointDistance())}},Nn.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Nn.prototype.interfaces_=function(){return[]},Nn.prototype.getClass=function(){return Nn},Nn.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Nn(t,e);return n.distance()}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2],a=new Nn(r,s);return a.setDensifyFraction(o),a.distance()}},um.MaxPointDistanceFilter.get=function(){return Ja},um.MaxDensifiedByFractionDistanceFilter.get=function(){return po},Object.defineProperties(Nn,um);var Ja=function(){this._maxPtDist=new mi,this._minPtDist=new mi,this._euclideanDist=new xr,this._geom=null;var t=arguments[0];this._geom=t};Ja.prototype.filter=function(t){this._minPtDist.initialize(),xr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ja.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ja.prototype.interfaces_=function(){return[Br]},Ja.prototype.getClass=function(){return Ja};var po=function(){this._maxPtDist=new mi,this._minPtDist=new mi,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};po.prototype.filter=function(t,e){var n=this;if(e===0)return null;for(var r=t.getCoordinate(e-1),s=t.getCoordinate(e),o=(s.x-r.x)/this._numSubSegs,a=(s.y-r.y)/this._numSubSegs,l=0;l<this._numSubSegs;l++){var u=r.x+l*o,h=r.y+l*a,c=new L(u,h);n._minPtDist.initialize(),xr.computeDistance(n._geom,c,n._minPtDist),n._maxPtDist.setMaximum(n._minPtDist)}},po.prototype.isDone=function(){return!1},po.prototype.isGeometryChanged=function(){return!1},po.prototype.getMaxPointDistance=function(){return this._maxPtDist},po.prototype.interfaces_=function(){return[Un]},po.prototype.getClass=function(){return po};var Xi=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},hm={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Xi.prototype.checkMaximumDistance=function(t,e,n){var r=new Nn(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var s=r.getCoordinates();this._errorLocation=s[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Vn.toLineString(s[0],s[1])+")"}},Xi.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Xi.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Xi.VERBOSE&&ii.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Xi.prototype.checkNegativeValid=function(){if(!(this._input instanceof Re||this._input instanceof qr||this._input instanceof wi))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Xi.prototype.getErrorIndicator=function(){return this._errorIndicator},Xi.prototype.checkMinimumDistance=function(t,e,n){var r=new oi(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var s=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Vn.toLineString(s[0],s[1])+" )"}},Xi.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},Xi.prototype.getErrorLocation=function(){return this._errorLocation},Xi.prototype.getPolygonLines=function(t){for(var e=new J,n=new si(e),r=Ds.getPolygons(t),s=r.iterator();s.hasNext();){var o=s.next();o.apply(n)}return t.getFactory().buildGeometry(e)},Xi.prototype.getErrorMessage=function(){return this._errMsg},Xi.prototype.interfaces_=function(){return[]},Xi.prototype.getClass=function(){return Xi},hm.VERBOSE.get=function(){return!1},hm.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Xi,hm);var ai=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},cm={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};ai.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},ai.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*ai.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new ht(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new ht(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},ai.prototype.checkDistance=function(){var t=new Xi(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},ai.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},ai.prototype.checkPolygonal=function(){this._result instanceof Re||this._result instanceof qr||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},ai.prototype.getErrorIndicator=function(){return this._errorIndicator},ai.prototype.getErrorLocation=function(){return this._errorLocation},ai.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")},ai.prototype.report=function(t){if(!ai.VERBOSE)return null;ii.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},ai.prototype.getErrorMessage=function(){return this._errorMsg},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai},ai.isValidMsg=function(t,e,n){var r=new ai(t,e,n);return r.isValid()?null:r.getErrorMessage()},ai.isValid=function(t,e,n){var r=new ai(t,e,n);return!!r.isValid()},cm.VERBOSE.get=function(){return!1},cm.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(ai,cm);var Ir=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Ir.prototype.getCoordinates=function(){return this._pts},Ir.prototype.size=function(){return this._pts.length},Ir.prototype.getCoordinate=function(t){return this._pts[t]},Ir.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Ir.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:qa.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Ir.prototype.setData=function(t){this._data=t},Ir.prototype.getData=function(){return this._data},Ir.prototype.toString=function(){return Vn.toLineString(new Se(this._pts))},Ir.prototype.interfaces_=function(){return[Hr]},Ir.prototype.getClass=function(){return Ir};var $e=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new J,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};$e.prototype.getInteriorIntersection=function(){return this._interiorIntersection},$e.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},$e.prototype.getIntersectionSegments=function(){return this._intSegments},$e.prototype.count=function(){return this._intersectionCount},$e.prototype.getIntersections=function(){return this._intersections},$e.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},$e.prototype.setKeepIntersections=function(t){this._keepIntersections=t},$e.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection()||t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(t,e)||this.isEndSegment(n,r);if(!s)return null}var o=t.getCoordinates()[e],a=t.getCoordinates()[e+1],l=n.getCoordinates()[r],u=n.getCoordinates()[r+1];this._li.computeIntersection(o,a,l,u),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,this._intSegments[1]=a,this._intSegments[2]=l,this._intSegments[3]=u,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},$e.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},$e.prototype.hasIntersection=function(){return this._interiorIntersection!==null},$e.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},$e.prototype.interfaces_=function(){return[Ko]},$e.prototype.getClass=function(){return $e},$e.createAllIntersectionsFinder=function(t){var e=new $e(t);return e.setFindAllIntersections(!0),e},$e.createAnyIntersectionFinder=function(t){return new $e(t)},$e.createIntersectionCounter=function(t){var e=new $e(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var $n=function(){this._li=new Ho,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};$n.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},$n.prototype.getIntersections=function(){return this._segInt.getIntersections()},$n.prototype.isValid=function(){return this.execute(),this._isValid},$n.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},$n.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new $e(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new am;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},$n.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ms(this.getErrorMessage(),this._segInt.getInteriorIntersection())},$n.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Vn.toLineString(t[0],t[1])+" and "+Vn.toLineString(t[2],t[3])},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n},$n.computeIntersections=function(t){var e=new $n(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var ea=function i(){this._nv=null;var t=arguments[0];this._nv=new $n(i.toSegmentStrings(t))};ea.prototype.checkValid=function(){this._nv.checkValid()},ea.prototype.interfaces_=function(){return[]},ea.prototype.getClass=function(){return ea},ea.toSegmentStrings=function(t){for(var e=new J,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Ir(r.getCoordinates(),r))}return e},ea.checkValid=function(t){var e=new ea(t);e.checkValid()};var Za=function(t){this._mapOp=t};Za.prototype.map=function(t){for(var e=this,n=new J,r=0;r<t.getNumGeometries();r++){var s=e._mapOp.map(t.getGeometryN(r));s.isEmpty()||n.add(s)}return t.getFactory().createGeometryCollection(At.toGeometryArray(n))},Za.prototype.interfaces_=function(){return[]},Za.prototype.getClass=function(){return Za},Za.map=function(t,e){var n=new Za(e);return n.map(t)};var Mr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new J,this._resultLineList=new J;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};Mr.prototype.collectLines=function(t){for(var e=this,n=this._op.getGraph().getEdgeEnds().iterator();n.hasNext();){var r=n.next();e.collectLineEdge(r,t,e._lineEdgesList),e.collectBoundaryTouchEdge(r,t,e._lineEdgesList)}},Mr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Mr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Mr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),s=t.getEdge();t.isLineEdge()&&!t.isVisited()&&It.isResultOfOp(r,e)&&!s.isCovered()&&(n.add(s),t.setVisitedEdge(!0))},Mr.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();n.getEdges().findCoveredLineEdges()}for(var r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var s=r.next(),o=s.getEdge();if(s.isLineEdge()&&!o.isCoveredSet()){var a=t._op.isCoveredByA(s.getCoordinate());o.setCovered(a)}}},Mr.prototype.labelIsolatedLines=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next(),s=r.getLabel();r.isIsolated()&&(s.isNull(0)?e.labelIsolatedLine(r,0):e.labelIsolatedLine(r,1))}},Mr.prototype.buildLines=function(t){for(var e=this,n=this._lineEdgesList.iterator();n.hasNext();){var r=n.next(),s=e._geometryFactory.createLineString(r.getCoordinates());e._resultLineList.add(s),r.setInResult(!0)}},Mr.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;Tt.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),It.isResultOfOp(r,e)&&e===It.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))},Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr};var Ka=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new J;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Ka.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Ka.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,n=this._op.getGraph().getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isInResult()&&!r.isIncidentEdgeInResult()&&(r.getEdges().getDegree()===0||t===It.INTERSECTION)){var s=r.getLabel();It.isResultOfOp(s,t)&&e.filterCoveredNodeToPoint(r)}}},Ka.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Ka.prototype.interfaces_=function(){return[]},Ka.prototype.getClass=function(){return Ka};var Li=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Li.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Li.prototype.transformPolygon=function(t,e){var n=this,r=!0,s=this.transformLinearRing(t.getExteriorRing(),t);(s===null||!(s instanceof Ur)||s.isEmpty())&&(r=!1);for(var o=new J,a=0;a<t.getNumInteriorRing();a++){var l=n.transformLinearRing(t.getInteriorRingN(a),t);l===null||l.isEmpty()||(l instanceof Ur||(r=!1),o.add(l))}if(r)return this._factory.createPolygon(s,o.toArray([]));var u=new J;return s!==null&&u.add(s),u.addAll(o),this._factory.buildGeometry(u)},Li.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Li.prototype.getInputGeometry=function(){return this._inputGeom},Li.prototype.transformMultiLineString=function(t,e){for(var n=this,r=new J,s=0;s<t.getNumGeometries();s++){var o=n.transformLineString(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||r.add(o))}return this._factory.buildGeometry(r)},Li.prototype.transformCoordinates=function(t,e){return this.copy(t)},Li.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Li.prototype.transformMultiPoint=function(t,e){for(var n=this,r=new J,s=0;s<t.getNumGeometries();s++){var o=n.transformPoint(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||r.add(o))}return this._factory.buildGeometry(r)},Li.prototype.transformMultiPolygon=function(t,e){for(var n=this,r=new J,s=0;s<t.getNumGeometries();s++){var o=n.transformPolygon(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||r.add(o))}return this._factory.buildGeometry(r)},Li.prototype.copy=function(t){return t.copy()},Li.prototype.transformGeometryCollection=function(t,e){for(var n=this,r=new J,s=0;s<t.getNumGeometries();s++){var o=n.transform(t.getGeometryN(s));o!==null&&(n._pruneEmptyGeometry&&o.isEmpty()||r.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(At.toGeometryArray(r)):this._factory.buildGeometry(r)},Li.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof qi)return this.transformPoint(t,null);if(t instanceof fu)return this.transformMultiPoint(t,null);if(t instanceof Ur)return this.transformLinearRing(t,null);if(t instanceof ve)return this.transformLineString(t,null);if(t instanceof Yo)return this.transformMultiLineString(t,null);if(t instanceof Re)return this.transformPolygon(t,null);if(t instanceof qr)return this.transformMultiPolygon(t,null);if(t instanceof wi)return this.transformGeometryCollection(t,null);throw new de("Unknown Geometry subtype: "+t.getClass().getName())},Li.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(n===null)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li};var Zr=function i(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new gt,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof ve&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];i.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var n=arguments[0],r=arguments[1];this._srcPts=n,this._isClosed=i.isClosed(n),this._snapTolerance=r}};Zr.prototype.snapVertices=function(t,e){for(var n=this,r=this._isClosed?t.size()-1:t.size(),s=0;s<r;s++){var o=t.get(s),a=n.findSnapForVertex(o,e);a!==null&&(t.set(s,new L(a)),s===0&&n._isClosed&&t.set(t.size()-1,new L(a)))}},Zr.prototype.findSnapForVertex=function(t,e){for(var n=this,r=0;r<e.length;r++){if(t.equals2D(e[r]))return null;if(t.distance(e[r])<n._snapTolerance)return e[r]}return null},Zr.prototype.snapTo=function(t){var e=new hc(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var n=e.toCoordinateArray();return n},Zr.prototype.snapSegments=function(t,e){var n=this;if(e.length===0)return null;var r=e.length;e[0].equals2D(e[e.length-1])&&(r=e.length-1);for(var s=0;s<r;s++){var o=e[s],a=n.findSegmentIndexToSnap(o,t);a>=0&&t.add(a+1,new L(o),!1)}},Zr.prototype.findSegmentIndexToSnap=function(t,e){for(var n=this,r=Pt.MAX_VALUE,s=-1,o=0;o<e.size()-1;o++){if(n._seg.p0=e.get(o),n._seg.p1=e.get(o+1),n._seg.p0.equals2D(t)||n._seg.p1.equals2D(t)){if(n._allowSnappingToSourceVertices)continue;return-1}var a=n._seg.distance(t);a<n._snapTolerance&&a<r&&(r=a,s=o)}return s},Zr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var Ce=function(t){this._srcGeom=t||null},o1={SNAP_PRECISION_FACTOR:{configurable:!0}};Ce.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t),r=new a1(e,n);return r.transform(this._srcGeom)},Ce.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new a1(t,n,!0),s=r.transform(this._srcGeom),o=s;return e&&St(o,ao)&&(o=s.buffer(0)),o},Ce.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),n=e/10;return n},Ce.prototype.extractTargetCoordinates=function(t){for(var e=new mr,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},Ce.prototype.computeMinimumSegmentLength=function(t){for(var e=Pt.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce},Ce.snap=function(t,e,n){var r=new Array(2).fill(null),s=new Ce(t);r[0]=s.snapTo(e,n);var o=new Ce(e);return r[1]=o.snapTo(r[0],n),r},Ce.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=Ce.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===Ut.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return Math.min(Ce.computeOverlaySnapTolerance(s),Ce.computeOverlaySnapTolerance(o))}},Ce.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),n=Math.min(e.getHeight(),e.getWidth()),r=n*Ce.SNAP_PRECISION_FACTOR;return r},Ce.snapToSelf=function(t,e,n){var r=new Ce(t);return r.snapToSelf(e,n)},o1.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Ce,o1);var a1=(function(i){function t(e,n,r){i.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=r!==void 0?r:!1}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(n,r){var s=new Zr(n,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(r)},t.prototype.transformCoordinates=function(n,r){var s=n.toCoordinateArray(),o=this.snapLine(s,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Li),xi=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};xi.prototype.getCommon=function(){return Pt.longBitsToDouble(this._commonBits)},xi.prototype.add=function(t){var e=Pt.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=xi.signExpBits(this._commonBits),this._isFirst=!1,null;var n=xi.signExpBits(e);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=xi.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=xi.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},xi.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=Pt.longBitsToDouble(t),n=Pt.toBinaryString(t),r="0000000000000000000000000000000000000000000000000000000000000000"+n,s=r.substring(r.length-64),o=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+e+" ]";return o}},xi.prototype.interfaces_=function(){return[]},xi.prototype.getClass=function(){return xi},xi.getBit=function(t,e){var n=1<<e;return(t&n)!==0?1:0},xi.signExpBits=function(t){return t>>52},xi.zeroLowerBits=function(t,e){var n=(1<<e)-1,r=~n,s=t&r;return s},xi.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(xi.getBit(t,r)!==xi.getBit(e,r))return n;n++}return 52};var mo=function(){this._commonCoord=null,this._ccFilter=new Qa},dm={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};mo.prototype.addCommonBits=function(t){var e=new vo(this._commonCoord);t.apply(e),t.geometryChanged()},mo.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new L(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new vo(e);return t.apply(n),t.geometryChanged(),t},mo.prototype.getCommonCoordinate=function(){return this._commonCoord},mo.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},mo.prototype.interfaces_=function(){return[]},mo.prototype.getClass=function(){return mo},dm.CommonCoordinateFilter.get=function(){return Qa},dm.Translater.get=function(){return vo},Object.defineProperties(mo,dm);var Qa=function(){this._commonBitsX=new xi,this._commonBitsY=new xi};Qa.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Qa.prototype.getCommonCoordinate=function(){return new L(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Qa.prototype.interfaces_=function(){return[Br]},Qa.prototype.getClass=function(){return Qa};var vo=function(){this.trans=null;var t=arguments[0];this.trans=t};vo.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},vo.prototype.isDone=function(){return!1},vo.prototype.isGeometryChanged=function(){return!0},vo.prototype.interfaces_=function(){return[Un]},vo.prototype.getClass=function(){return vo};var Ye=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};Ye.prototype.selfSnap=function(t){var e=new Ce(t),n=e.snapTo(t,this._snapTolerance);return n},Ye.prototype.removeCommonBits=function(t){this._cbr=new mo,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},Ye.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},Ye.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=It.overlayOp(e[0],e[1],t);return this.prepareResult(n)},Ye.prototype.checkValid=function(t){t.isValid()||ii.out.println("Snapped geometry is invalid")},Ye.prototype.computeSnapTolerance=function(){this._snapTolerance=Ce.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Ye.prototype.snap=function(t){var e=this.removeCommonBits(t),n=Ce.snap(e[0],e[1],this._snapTolerance);return n},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye},Ye.overlayOp=function(t,e,n){var r=new Ye(t,e);return r.getResultGeometry(n)},Ye.union=function(t,e){return Ye.overlayOp(t,e,It.UNION)},Ye.intersection=function(t,e){return Ye.overlayOp(t,e,It.INTERSECTION)},Ye.symDifference=function(t,e){return Ye.overlayOp(t,e,It.SYMDIFFERENCE)},Ye.difference=function(t,e){return Ye.overlayOp(t,e,It.DIFFERENCE)};var Ii=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};Ii.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=It.overlayOp(this._geom[0],this._geom[1],t);var s=!0;s&&(n=!0)}catch(o){if(o instanceof Ss)r=o;else throw o}finally{}if(!n)try{e=Ye.overlayOp(this._geom[0],this._geom[1],t)}catch(o){throw o instanceof Ss?r:o}finally{}return e},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii},Ii.overlayOp=function(t,e,n){var r=new Ii(t,e);return r.getResultGeometry(n)},Ii.union=function(t,e){return Ii.overlayOp(t,e,It.UNION)},Ii.intersection=function(t,e){return Ii.overlayOp(t,e,It.INTERSECTION)},Ii.symDifference=function(t,e){return Ii.overlayOp(t,e,It.SYMDIFFERENCE)},Ii.difference=function(t,e){return Ii.overlayOp(t,e,It.DIFFERENCE)};var Pc=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Pc.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Pc.prototype.interfaces_=function(){return[]},Pc.prototype.getClass=function(){return Pc};var $i=function i(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],e=arguments[1];this._eventType=i.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];this._eventType=i.INSERT,this._label=n,this._xValue=r,this._obj=s}},fm={INSERT:{configurable:!0},DELETE:{configurable:!0}};$i.prototype.isDelete=function(){return this._eventType===$i.DELETE},$i.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},$i.prototype.getObject=function(){return this._obj},$i.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},$i.prototype.getInsertEvent=function(){return this._insertEvent},$i.prototype.isInsert=function(){return this._eventType===$i.INSERT},$i.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},$i.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},$i.prototype.interfaces_=function(){return[bn]},$i.prototype.getClass=function(){return $i},fm.INSERT.get=function(){return 1},fm.DELETE.get=function(){return 2},Object.defineProperties($i,fm);var gf=function(){};gf.prototype.interfaces_=function(){return[]},gf.prototype.getClass=function(){return gf};var li=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};li.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&this._li.getIntersectionNum()===1){if(li.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var s=t.getNumPoints()-1;if(e===0&&r===s||r===0&&e===s)return!0}}return!1},li.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},li.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},li.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},li.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next(),s=r.getCoordinate();if(t.isIntersection(s))return!0}return!1},li.prototype.hasProperIntersection=function(){return this._hasProper},li.prototype.hasIntersection=function(){return this._hasIntersection},li.prototype.isDone=function(){return this._isDone},li.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},li.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},li.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var s=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],l=n.getCoordinates()[r+1];this._li.computeIntersection(s,o,a,l),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li},li.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var $N=(function(i){function t(){i.call(this),this.events=new J,this.nOverlaps=null}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var n=this;Wn.sort(this.events);for(var r=0;r<this.events.size();r++){var s=n.events.get(r);s.isDelete()&&s.getInsertEvent().setDeleteEventIndex(r)}},t.prototype.computeIntersections=function(){var n=this;if(arguments.length===1){var r=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var s=0;s<this.events.size();s++){var o=n.events.get(s);if(o.isInsert()&&n.processOverlaps(s,o.getDeleteEventIndex(),o,r),r.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof li&&St(arguments[0],zn)&&St(arguments[1],zn)){var a=arguments[0],l=arguments[1],u=arguments[2];this.addEdges(a,a),this.addEdges(l,l),this.computeIntersections(u)}else if(typeof arguments[2]=="boolean"&&St(arguments[0],zn)&&arguments[1]instanceof li){var h=arguments[0],c=arguments[1],d=arguments[2];d?this.addEdges(h,null):this.addEdges(h),this.computeIntersections(c)}}},t.prototype.addEdge=function(n,r){for(var s=this,o=n.getMonotoneChainEdge(),a=o.getStartIndexes(),l=0;l<a.length-1;l++){var u=new Pc(o,l),h=new $i(r,o.getMinX(l),u);s.events.add(h),s.events.add(new $i(o.getMaxX(l),h))}},t.prototype.processOverlaps=function(n,r,s,o){for(var a=this,l=s.getObject(),u=n;u<r;u++){var h=a.events.get(u);if(h.isInsert()){var c=h.getObject();s.isSameLabel(h)||(l.computeIntersections(c,o),a.nOverlaps++)}}},t.prototype.addEdges=function(){var n=this;if(arguments.length===1)for(var r=arguments[0],s=r.iterator();s.hasNext();){var o=s.next();n.addEdge(o,o)}else if(arguments.length===2)for(var a=arguments[0],l=arguments[1],u=a.iterator();u.hasNext();){var h=u.next();n.addEdge(h,l)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(gf),Kr=function(){this._min=Pt.POSITIVE_INFINITY,this._max=Pt.NEGATIVE_INFINITY},l1={NodeComparator:{configurable:!0}};Kr.prototype.getMin=function(){return this._min},Kr.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},Kr.prototype.getMax=function(){return this._max},Kr.prototype.toString=function(){return Vn.toLineString(new L(this._min,0),new L(this._max,0))},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr},l1.NodeComparator.get=function(){return xc},Object.defineProperties(Kr,l1);var xc=function(){};xc.prototype.compare=function(t,e){var n=t,r=e,s=(n._min+n._max)/2,o=(r._min+r._max)/2;return s<o?-1:s>o?1:0},xc.prototype.interfaces_=function(){return[iu]},xc.prototype.getClass=function(){return xc};var YN=(function(i){function t(){i.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.query=function(n,r,s){if(!this.intersects(n,r))return null;s.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Kr),JN=(function(i){function t(){i.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(n,r){this._min=Math.min(n._min,r._min),this._max=Math.max(n._max,r._max)},t.prototype.query=function(n,r,s){if(!this.intersects(n,r))return null;this._node1!==null&&this._node1.query(n,r,s),this._node2!==null&&this._node2.query(n,r,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Kr),Qr=function(){this._leaves=new J,this._root=null,this._level=0};Qr.prototype.buildTree=function(){var t=this;Wn.sort(this._leaves,new Kr.NodeComparator);for(var e=this._leaves,n=null,r=new J;;){if(t.buildLevel(e,r),r.size()===1)return r.get(0);n=e,e=r,r=n}},Qr.prototype.insert=function(t,e,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new YN(t,e,n))},Qr.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},Qr.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},Qr.prototype.printNode=function(t){ii.out.println(Vn.toLineString(new L(t._min,this._level),new L(t._max,this._level)))},Qr.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},Qr.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n),s=n+1<t.size()?t.get(n):null;if(s===null)e.add(r);else{var o=new JN(t.get(n),t.get(n+1));e.add(o)}}},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr};var wu=function(){this._items=new J};wu.prototype.visitItem=function(t){this._items.add(t)},wu.prototype.getItems=function(){return this._items},wu.prototype.interfaces_=function(){return[lo]},wu.prototype.getClass=function(){return wu};var Eu=function(){this._index=null;var t=arguments[0];if(!St(t,ao))throw new de("Argument must be Polygonal");this._index=new ia(t)},gm={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Eu.prototype.locate=function(t){var e=new pr(t),n=new Su(e);return this._index.query(t.y,t.y,n),e.getLocation()},Eu.prototype.interfaces_=function(){return[vu]},Eu.prototype.getClass=function(){return Eu},gm.SegmentVisitor.get=function(){return Su},gm.IntervalIndexedGeometry.get=function(){return ia},Object.defineProperties(Eu,gm);var Su=function(){this._counter=null;var t=arguments[0];this._counter=t};Su.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Su.prototype.interfaces_=function(){return[lo]},Su.prototype.getClass=function(){return Su};var ia=function(){this._index=new Qr;var t=arguments[0];this.init(t)};ia.prototype.init=function(t){for(var e=this,n=si.getLines(t),r=n.iterator();r.hasNext();){var s=r.next(),o=s.getCoordinates();e.addLine(o)}},ia.prototype.addLine=function(t){for(var e=this,n=1;n<t.length;n++){var r=new gt(t[n-1],t[n]),s=Math.min(r.p0.y,r.p1.y),o=Math.max(r.p0.y,r.p1.y);e._index.insert(s,o,r)}},ia.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new wu;return this._index.query(t,e,n),n.getItems()}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2];this._index.query(r,s,o)}},ia.prototype.interfaces_=function(){return[]},ia.prototype.getClass=function(){return ia};var Ic=(function(i){function t(){if(i.call(this),this._parentGeom=null,this._lineEdgeMap=new Uw,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Xn,arguments.length===2){var e=arguments[0],n=arguments[1],r=Pn.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,n!==null&&this.add(n)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this._argIndex=s,this._parentGeom=o,this._boundaryNodeRule=a,o!==null&&this.add(o)}}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(n,r){var s=this._nodes.addNode(r),o=s.getLabel(),a=1,l=k.NONE;l=o.getLocation(n,X.ON),l===k.BOUNDARY&&a++;var u=t.determineBoundary(this._boundaryNodeRule,a);o.setLocation(n,u)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.computeSelfNodes(n,r,!1)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2],l=new li(s,!0,!1);l.setIsDoneIfProperInt(a);var u=this.createEdgeSetIntersector(),h=this._parentGeom instanceof Ur||this._parentGeom instanceof Re||this._parentGeom instanceof qr,c=o||!h;return u.computeIntersections(this._edges,l,c),this.addSelfIntersectionNodes(this._argIndex),l}},t.prototype.computeSplitEdges=function(n){for(var r=this._edges.iterator();r.hasNext();){var s=r.next();s.eiList.addSplitEdges(n)}},t.prototype.computeEdgeIntersections=function(n,r,s){var o=new li(r,s,!0);o.setBoundaryNodes(this.getBoundaryNodes(),n.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,n._edges,o),o},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){if(arguments[0]instanceof qi){var n=arguments[0],r=n.getCoordinate();this.insertPoint(this._argIndex,r,k.INTERIOR)}else if(arguments[0]instanceof L){var s=arguments[0];this.insertPoint(this._argIndex,s,k.INTERIOR)}},t.prototype.addPolygon=function(n){var r=this;this.addPolygonRing(n.getExteriorRing(),k.EXTERIOR,k.INTERIOR);for(var s=0;s<n.getNumInteriorRing();s++){var o=n.getInteriorRingN(s);r.addPolygonRing(o,k.INTERIOR,k.EXTERIOR)}},t.prototype.addEdge=function(n){this.insertEdge(n);var r=n.getCoordinates();this.insertPoint(this._argIndex,r[0],k.BOUNDARY),this.insertPoint(this._argIndex,r[r.length-1],k.BOUNDARY)},t.prototype.addLineString=function(n){var r=Rt.removeRepeatedPoints(n.getCoordinates());if(r.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var s=new ff(r,new Yt(this._argIndex,k.INTERIOR));this._lineEdgeMap.put(n,s),this.insertEdge(s),Tt.isTrue(r.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,r[0]),this.insertBoundaryPoint(this._argIndex,r[r.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),r=new Array(n.size()).fill(null),s=0,o=n.iterator();o.hasNext();){var a=o.next();r[s++]=a.getCoordinate().copy()}return r},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(n,r,s){if(this.isBoundaryNode(n,r))return null;s===k.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,r):this.insertPoint(n,r,s)},t.prototype.addPolygonRing=function(n,r,s){if(n.isEmpty())return null;var o=Rt.removeRepeatedPoints(n.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var a=r,l=s;tt.isCCW(o)&&(a=s,l=r);var u=new ff(o,new Yt(this._argIndex,k.BOUNDARY,a,l));this._lineEdgeMap.put(n,u),this.insertEdge(u),this.insertPoint(this._argIndex,o[0],k.BOUNDARY)},t.prototype.insertPoint=function(n,r,s){var o=this._nodes.addNode(r),a=o.getLabel();a===null?o._label=new Yt(n,s):a.setLocation(n,s)},t.prototype.createEdgeSetIntersector=function(){return new $N},t.prototype.addSelfIntersectionNodes=function(n){for(var r=this,s=this._edges.iterator();s.hasNext();)for(var o=s.next(),a=o.getLabel().getLocation(n),l=o.eiList.iterator();l.hasNext();){var u=l.next();r.addSelfIntersectionNode(n,u.coord,a)}},t.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof qr&&(this._useBoundaryDeterminationRule=!1),n instanceof Re)this.addPolygon(n);else if(n instanceof ve)this.addLineString(n);else if(n instanceof qi)this.addPoint(n);else if(n instanceof fu)this.addCollection(n);else if(n instanceof Yo)this.addCollection(n);else if(n instanceof qr)this.addCollection(n);else if(n instanceof wi)this.addCollection(n);else throw new Error(n.getClass().getName())}else return i.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(n){for(var r=this,s=0;s<n.getNumGeometries();s++){var o=n.getGeometryN(s);r.add(o)}},t.prototype.locate=function(n){return St(this._parentGeom,ao)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Eu(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return i.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(n,r){return n.isInBoundary(r)?k.BOUNDARY:k.INTERIOR},t})(pe),bu=function(){if(this._li=new Ho,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Ic(0,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],r=Pn.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ic(0,e,r),this._arg[1]=new Ic(1,n,r)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];s.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(s.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ic(0,s,a),this._arg[1]=new Ic(1,o,a)}};bu.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},bu.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},bu.prototype.interfaces_=function(){return[]},bu.prototype.getClass=function(){return bu};var na=function(){};na.prototype.interfaces_=function(){return[]},na.prototype.getClass=function(){return na},na.map=function(){if(arguments[0]instanceof _t&&St(arguments[1],na.MapOp)){for(var t=arguments[0],e=arguments[1],n=new J,r=0;r<t.getNumGeometries();r++){var s=e.map(t.getGeometryN(r));s!==null&&n.add(s)}return t.getFactory().buildGeometry(n)}else if(St(arguments[0],De)&&St(arguments[1],na.MapOp)){for(var o=arguments[0],a=arguments[1],l=new J,u=o.iterator();u.hasNext();){var h=u.next(),c=a.map(h);c!==null&&l.add(c)}return l}},na.MapOp=function(){};var It=(function(i){function t(){var e=arguments[0],n=arguments[1];i.call(this,e,n),this._ptLocator=new Xn,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Hn,this._resultPolyList=new J,this._resultLineList=new J,this._resultPointList=new J,this._graph=new pe(new Qw),this._geomFact=e.getFactory()}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(n){var r=this._edgeList.findEqualEdge(n);if(r!==null){var s=r.getLabel(),o=n.getLabel();r.isPointwiseEqual(n)||(o=new Yt(n.getLabel()),o.flip());var a=r.getDepth();a.isNull()&&a.add(s),a.add(o),s.merge(o)}else this._edgeList.add(n)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),s=r.getSym();r.isInResult()&&s.isInResult()&&(r.setInResult(!1),s.setInResult(!1))}},t.prototype.isCoveredByLA=function(n){return!!(this.isCovered(n,this._resultLineList)||this.isCovered(n,this._resultPolyList))},t.prototype.computeGeometry=function(n,r,s,o){var a=new J;return a.addAll(n),a.addAll(r),a.addAll(s),a.isEmpty()?t.createEmptyResult(o,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)},t.prototype.mergeSymLabels=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var r=n.next();r.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(n,r){for(var s=this,o=r.iterator();o.hasNext();){var a=o.next(),l=s._ptLocator.locate(n,a);if(l!==k.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var n=new J,r=this._edgeList.iterator();r.hasNext();){var s=r.next();s.isCollapsed()&&(r.remove(),n.add(s.getCollapsedEdge()))}this._edgeList.addAll(n)},t.prototype.updateNodeLabelling=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var r=n.next(),s=r.getEdges().getLabel();r.getLabel().merge(s)}},t.prototype.getResultGeometry=function(n){return this.computeOverlay(n),this._resultGeom},t.prototype.insertUniqueEdges=function(n){for(var r=this,s=n.iterator();s.hasNext();){var o=s.next();r.insertUniqueEdge(o)}},t.prototype.computeOverlay=function(n){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var r=new J;this._arg[0].computeSplitEdges(r),this._arg[1].computeSplitEdges(r),this.insertUniqueEdges(r),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),ea.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(n),this.cancelDuplicateResultEdges();var s=new Wi(this._geomFact);s.add(this._graph),this._resultPolyList=s.getPolygons();var o=new Mr(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(n);var a=new Ka(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(n),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,n)},t.prototype.labelIncompleteNode=function(n,r){var s=this._ptLocator.locate(n.getCoordinate(),this._arg[r].getGeometry());n.getLabel().setLocation(r,s)},t.prototype.copyPoints=function(n){for(var r=this,s=this._arg[n].getNodeIterator();s.hasNext();){var o=s.next(),a=r._graph.addNode(o.getCoordinate());a.setLabel(n,o.getLabel().getLocation(n))}},t.prototype.findResultAreaEdges=function(n){for(var r=this._graph.getEdgeEnds().iterator();r.hasNext();){var s=r.next(),o=s.getLabel();o.isArea()&&!s.isInteriorAreaEdge()&&t.isResultOfOp(o.getLocation(0,X.RIGHT),o.getLocation(1,X.RIGHT),n)&&s.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var n=this._edgeList.iterator();n.hasNext();){var r=n.next(),s=r.getLabel(),o=r.getDepth();if(!o.isNull()){o.normalize();for(var a=0;a<2;a++)!s.isNull(a)&&s.isArea()&&!o.isNull(a)&&(o.getDelta(a)===0?s.toLine(a):(Tt.isTrue(!o.isNull(a,X.LEFT),"depth of LEFT side has not been initialized"),s.setLocation(a,X.LEFT,o.getLocation(a,X.LEFT)),Tt.isTrue(!o.isNull(a,X.RIGHT),"depth of RIGHT side has not been initialized"),s.setLocation(a,X.RIGHT,o.getLocation(a,X.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var n=this,r=this._graph.getNodes().iterator();r.hasNext();){var s=r.next();s.getEdges().computeLabelling(n._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var n=this,r=this._graph.getNodes().iterator();r.hasNext();){var s=r.next(),o=s.getLabel();s.isIsolated()&&(o.isNull(0)?n.labelIncompleteNode(s,0):n.labelIncompleteNode(s,1)),s.getEdges().updateLabelling(o)}},t.prototype.isCoveredByA=function(n){return!!this.isCovered(n,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(bu);It.overlayOp=function(i,t,e){var n=new It(i,t),r=n.getResultGeometry(e);return r},It.intersection=function(i,t){if(i.isEmpty()||t.isEmpty())return It.createEmptyResult(It.INTERSECTION,i,t,i.getFactory());if(i.isGeometryCollection()){var e=t;return Za.map(i,{interfaces_:function(){return[na.MapOp]},map:function(n){return n.intersection(e)}})}return i.checkNotGeometryCollection(i),i.checkNotGeometryCollection(t),Ii.overlayOp(i,t,It.INTERSECTION)},It.symDifference=function(i,t){if(i.isEmpty()||t.isEmpty()){if(i.isEmpty()&&t.isEmpty())return It.createEmptyResult(It.SYMDIFFERENCE,i,t,i.getFactory());if(i.isEmpty())return t.copy();if(t.isEmpty())return i.copy()}return i.checkNotGeometryCollection(i),i.checkNotGeometryCollection(t),Ii.overlayOp(i,t,It.SYMDIFFERENCE)},It.resultDimension=function(i,t,e){var n=t.getDimension(),r=e.getDimension(),s=-1;switch(i){case It.INTERSECTION:s=Math.min(n,r);break;case It.UNION:s=Math.max(n,r);break;case It.DIFFERENCE:s=n;break;case It.SYMDIFFERENCE:s=Math.max(n,r);break}return s},It.createEmptyResult=function(i,t,e,n){var r=null;switch(It.resultDimension(i,t,e)){case-1:r=n.createGeometryCollection(new Array(0).fill(null));break;case 0:r=n.createPoint();break;case 1:r=n.createLineString();break;case 2:r=n.createPolygon();break}return r},It.difference=function(i,t){return i.isEmpty()?It.createEmptyResult(It.DIFFERENCE,i,t,i.getFactory()):t.isEmpty()?i.copy():(i.checkNotGeometryCollection(i),i.checkNotGeometryCollection(t),Ii.overlayOp(i,t,It.DIFFERENCE))},It.isResultOfOp=function(){if(arguments.length===2){var i=arguments[0],t=arguments[1],e=i.getLocation(0),n=i.getLocation(1);return It.isResultOfOp(e,n,t)}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2];switch(r===k.BOUNDARY&&(r=k.INTERIOR),s===k.BOUNDARY&&(s=k.INTERIOR),o){case It.INTERSECTION:return r===k.INTERIOR&&s===k.INTERIOR;case It.UNION:return r===k.INTERIOR||s===k.INTERIOR;case It.DIFFERENCE:return r===k.INTERIOR&&s!==k.INTERIOR;case It.SYMDIFFERENCE:return r===k.INTERIOR&&s!==k.INTERIOR||r!==k.INTERIOR&&s===k.INTERIOR}return!1}},It.INTERSECTION=1,It.UNION=2,It.DIFFERENCE=3,It.SYMDIFFERENCE=4;var yo=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Xn,this._seg=new gt;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};yo.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,n=0;n<this._linework.getNumGeometries();n++)for(var r=e._linework.getGeometryN(n),s=r.getCoordinateSequence(),o=0;o<s.size()-1;o++){s.getCoordinate(o,e._seg.p0),s.getCoordinate(o+1,e._seg.p1);var a=e._seg.distance(t);if(a<=e._boundaryDistanceTolerance)return!0}return!1},yo.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?k.BOUNDARY:this._ptLocator.locate(t,this._g)},yo.prototype.extractLinework=function(t){var e=new Cu;t.apply(e);var n=e.getLinework(),r=At.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},yo.prototype.interfaces_=function(){return[]},yo.prototype.getClass=function(){return yo};var Cu=function(){this._linework=null,this._linework=new J};Cu.prototype.getLinework=function(){return this._linework},Cu.prototype.filter=function(t){var e=this;if(t instanceof Re){var n=t;this._linework.add(n.getExteriorRing());for(var r=0;r<n.getNumInteriorRing();r++)e._linework.add(n.getInteriorRingN(r))}},Cu.prototype.interfaces_=function(){return[vr]},Cu.prototype.getClass=function(){return Cu};var ra=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};ra.prototype.extractPoints=function(t,e,n){for(var r=this,s=t.getCoordinates(),o=0;o<s.length-1;o++)r.computeOffsetPoints(s[o],s[o+1],e,n)},ra.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},ra.prototype.getPoints=function(t){for(var e=this,n=new J,r=si.getLines(this._g),s=r.iterator();s.hasNext();){var o=s.next();e.extractPoints(o,t,n)}return n},ra.prototype.computeOffsetPoints=function(t,e,n,r){var s=e.x-t.x,o=e.y-t.y,a=Math.sqrt(s*s+o*o),l=n*s/a,u=n*o/a,h=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var d=new L(h-u,c+l);r.add(d)}if(this._doRight){var g=new L(h+u,c-l);r.add(g)}},ra.prototype.interfaces_=function(){return[]},ra.prototype.getClass=function(){return ra};var dn=function i(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=i.TOLERANCE,this._testCoords=new J;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundaryDistanceTolerance=i.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,n],this._locFinder=[new yo(this._geom[0],this._boundaryDistanceTolerance),new yo(this._geom[1],this._boundaryDistanceTolerance),new yo(this._geom[2],this._boundaryDistanceTolerance)]},u1={TOLERANCE:{configurable:!0}};dn.prototype.reportResult=function(t,e,n){ii.out.println("Overlay result invalid - A:"+k.toLocationSymbol(e[0])+" B:"+k.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+k.toLocationSymbol(e[2]))},dn.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},dn.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=0;n<this._testCoords.size();n++){var r=t._testCoords.get(n);if(!t.checkValid(e,r))return t._invalidLocation=r,!1}return!0}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._location[0]=this._locFinder[0].getLocation(o),this._location[1]=this._locFinder[1].getLocation(o),this._location[2]=this._locFinder[2].getLocation(o),dn.hasLocation(this._location,k.BOUNDARY)?!0:this.isValidResult(s,this._location)}},dn.prototype.addTestPts=function(t){var e=new ra(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},dn.prototype.isValidResult=function(t,e){var n=It.isResultOfOp(e[0],e[1],t),r=e[2]===k.INTERIOR,s=!(n^r);return s||this.reportResult(t,e,n),s},dn.prototype.getInvalidLocation=function(){return this._invalidLocation},dn.prototype.interfaces_=function(){return[]},dn.prototype.getClass=function(){return dn},dn.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},dn.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Ce.computeSizeBasedSnapTolerance(t),Ce.computeSizeBasedSnapTolerance(e))},dn.isValid=function(t,e,n,r){var s=new dn(t,e,r);return s.isValid(n)},u1.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(dn,u1);var fn=function i(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=i.extractFactory(t),this._inputGeoms=t};fn.prototype.extractElements=function(t,e){var n=this;if(t===null)return null;for(var r=0;r<t.getNumGeometries();r++){var s=t.getGeometryN(r);n._skipEmpty&&s.isEmpty()||e.add(s)}},fn.prototype.combine=function(){for(var t=this,e=new J,n=this._inputGeoms.iterator();n.hasNext();){var r=n.next();t.extractElements(r,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn},fn.combine=function(){if(arguments.length===1){var t=arguments[0],e=new fn(t);return e.combine()}else if(arguments.length===2){var n=arguments[0],r=arguments[1],s=new fn(fn.createList(n,r));return s.combine()}else if(arguments.length===3){var o=arguments[0],a=arguments[1],l=arguments[2],u=new fn(fn.createList(o,a,l));return u.combine()}},fn.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},fn.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new J;return n.add(t),n.add(e),n}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2],a=new J;return a.add(r),a.add(s),a.add(o),a}};var Te=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new J)},h1={STRTREE_NODE_CAPACITY:{configurable:!0}};Te.prototype.reduceToGeometries=function(t){for(var e=this,n=new J,r=t.iterator();r.hasNext();){var s=r.next(),o=null;St(s,zn)?o=e.unionTree(s):s instanceof _t&&(o=s),n.add(o)}return n},Te.prototype.extractByEnvelope=function(t,e,n){for(var r=new J,s=0;s<e.getNumGeometries();s++){var o=e.getGeometryN(s);o.getEnvelopeInternal().intersects(t)?r.add(o):n.add(o)}return this._geomFactory.buildGeometry(r)},Te.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r)){var s=fn.combine(t,e);return s}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var o=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,o)},Te.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new Xw(Te.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var r=t.itemsTree(),s=this.unionTree(r);return s},Te.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var s=Te.getGeometry(e,n);return this.unionSafe(s,null)}else{if(r-n===2)return this.unionSafe(Te.getGeometry(e,n),Te.getGeometry(e,n+1));var o=Math.trunc((r+n)/2),a=this.binaryUnion(e,n,o),l=this.binaryUnion(e,o,r);return this.unionSafe(a,l)}}},Te.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e===null?e=r.copy():e=e.union(r)}return e},Te.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},Te.prototype.unionActual=function(t,e){return Te.restrictToPolygons(t.union(e))},Te.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),n=this.binaryUnion(e);return n},Te.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new J,s=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),a=this.unionActual(s,o);r.add(a);var l=fn.combine(r);return l},Te.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),n=e.buildGeometry(t),r=n.buffer(0);return r}else if(arguments.length===2){var s=arguments[0],o=arguments[1],a=s.getFactory(),l=a.createGeometryCollection([s,o]),u=l.buffer(0);return u}},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te},Te.restrictToPolygons=function(t){if(St(t,ao))return t;var e=Ds.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(At.toPolygonArray(e))},Te.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Te.union=function(t){var e=new Te(t);return e.union()},h1.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Te,h1);var pf=function(){};pf.prototype.interfaces_=function(){return[]},pf.prototype.getClass=function(){return pf},pf.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return It.createEmptyResult(It.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Ii.overlayOp(t,e,It.UNION)};function sa(){return new mf}function mf(){this.reset()}mf.prototype={constructor:mf,reset:function(){this.s=this.t=0},add:function(i){c1(vf,i,this.t),c1(this,vf.s,this.s),this.s?this.t+=vf.t:this.s=vf.t},valueOf:function(){return this.s}};var vf=new mf;function c1(i,t,e){var n=i.s=t+e,r=n-t,s=n-r;i.t=t-s+(e-r)}var _e=1e-6,ie=Math.PI,Rs=ie/2,d1=ie/4,As=ie*2,oa=180/ie,Tr=ie/180,Mi=Math.abs,ZN=Math.atan,Pu=Math.atan2,Le=Math.cos,Fe=Math.sin,xu=Math.sqrt;function f1(i){return i>1?0:i<-1?ie:Math.acos(i)}function tl(i){return i>1?Rs:i<-1?-Rs:Math.asin(i)}function Mc(){}function yf(i,t){i&&p1.hasOwnProperty(i.type)&&p1[i.type](i,t)}var g1={Feature:function(i,t){yf(i.geometry,t)},FeatureCollection:function(i,t){for(var e=i.features,n=-1,r=e.length;++n<r;)yf(e[n].geometry,t)}},p1={Sphere:function(i,t){t.sphere()},Point:function(i,t){i=i.coordinates,t.point(i[0],i[1],i[2])},MultiPoint:function(i,t){for(var e=i.coordinates,n=-1,r=e.length;++n<r;)i=e[n],t.point(i[0],i[1],i[2])},LineString:function(i,t){pm(i.coordinates,t,0)},MultiLineString:function(i,t){for(var e=i.coordinates,n=-1,r=e.length;++n<r;)pm(e[n],t,0)},Polygon:function(i,t){m1(i.coordinates,t)},MultiPolygon:function(i,t){for(var e=i.coordinates,n=-1,r=e.length;++n<r;)m1(e[n],t)},GeometryCollection:function(i,t){for(var e=i.geometries,n=-1,r=e.length;++n<r;)yf(e[n],t)}};function pm(i,t,e){var n=-1,r=i.length-e,s;for(t.lineStart();++n<r;)s=i[n],t.point(s[0],s[1],s[2]);t.lineEnd()}function m1(i,t){var e=-1,n=i.length;for(t.polygonStart();++e<n;)pm(i[e],t,1);t.polygonEnd()}function KN(i,t){i&&g1.hasOwnProperty(i.type)?g1[i.type](i,t):yf(i,t)}sa(),sa();function mm(i){return[Pu(i[1],i[0]),tl(i[2])]}function Iu(i){var t=i[0],e=i[1],n=Le(e);return[n*Le(t),n*Fe(t),Fe(e)]}function _f(i,t){return i[0]*t[0]+i[1]*t[1]+i[2]*t[2]}function wf(i,t){return[i[1]*t[2]-i[2]*t[1],i[2]*t[0]-i[0]*t[2],i[0]*t[1]-i[1]*t[0]]}function vm(i,t){i[0]+=t[0],i[1]+=t[1],i[2]+=t[2]}function Ef(i,t){return[i[0]*t,i[1]*t,i[2]*t]}function ym(i){var t=xu(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);i[0]/=t,i[1]/=t,i[2]/=t}sa();function v1(i,t){function e(n,r){return n=i(n,r),t(n[0],n[1])}return i.invert&&t.invert&&(e.invert=function(n,r){return n=t.invert(n,r),n&&i.invert(n[0],n[1])}),e}function _m(i,t){return[i>ie?i-As:i<-ie?i+As:i,t]}_m.invert=_m;function QN(i,t,e){return(i%=As)?t||e?v1(_1(i),w1(t,e)):_1(i):t||e?w1(t,e):_m}function y1(i){return function(t,e){return t+=i,[t>ie?t-As:t<-ie?t+As:t,e]}}function _1(i){var t=y1(i);return t.invert=y1(-i),t}function w1(i,t){var e=Le(i),n=Fe(i),r=Le(t),s=Fe(t);function o(a,l){var u=Le(l),h=Le(a)*u,c=Fe(a)*u,d=Fe(l),g=d*e+h*n;return[Pu(c*r-g*s,h*e-d*n),tl(g*r+c*s)]}return o.invert=function(a,l){var u=Le(l),h=Le(a)*u,c=Fe(a)*u,d=Fe(l),g=d*r-c*s;return[Pu(c*r+d*s,h*e+g*n),tl(g*e-h*n)]},o}function tO(i,t,e,n,r,s){if(e){var o=Le(t),a=Fe(t),l=n*e;r==null?(r=t+n*As,s=t-l/2):(r=E1(o,r),s=E1(o,s),(n>0?r<s:r>s)&&(r+=n*As));for(var u,h=r;n>0?h>s:h<s;h-=l)u=mm([o,-a*Le(h),-a*Fe(h)]),i.point(u[0],u[1])}}function E1(i,t){t=Iu(t),t[0]-=i,ym(t);var e=f1(-t[1]);return((-t[2]<0?-e:e)+As-_e)%As}function S1(){var i=[],t;return{point:function(e,n){t.push([e,n])},lineStart:function(){i.push(t=[])},lineEnd:Mc,rejoin:function(){i.length>1&&i.push(i.pop().concat(i.shift()))},result:function(){var e=i;return i=[],t=null,e}}}function eO(i,t,e,n,r,s){var o=i[0],a=i[1],l=t[0],u=t[1],h=0,c=1,d=l-o,g=u-a,p;if(p=e-o,!(!d&&p>0)){if(p/=d,d<0){if(p<h)return;p<c&&(c=p)}else if(d>0){if(p>c)return;p>h&&(h=p)}if(p=r-o,!(!d&&p<0)){if(p/=d,d<0){if(p>c)return;p>h&&(h=p)}else if(d>0){if(p<h)return;p<c&&(c=p)}if(p=n-a,!(!g&&p>0)){if(p/=g,g<0){if(p<h)return;p<c&&(c=p)}else if(g>0){if(p>c)return;p>h&&(h=p)}if(p=s-a,!(!g&&p<0)){if(p/=g,g<0){if(p>c)return;p>h&&(h=p)}else if(g>0){if(p<h)return;p<c&&(c=p)}return h>0&&(i[0]=o+h*d,i[1]=a+h*g),c<1&&(t[0]=o+c*d,t[1]=a+c*g),!0}}}}}function Sf(i,t){return Mi(i[0]-t[0])<_e&&Mi(i[1]-t[1])<_e}function bf(i,t,e,n){this.x=i,this.z=t,this.o=e,this.e=n,this.v=!1,this.n=this.p=null}function b1(i,t,e,n,r){var s=[],o=[],a,l;if(i.forEach(function(p){if(!((E=p.length-1)<=0)){var E,b=p[0],P=p[E],v;if(Sf(b,P)){for(r.lineStart(),a=0;a<E;++a)r.point((b=p[a])[0],b[1]);r.lineEnd();return}s.push(v=new bf(b,p,null,!0)),o.push(v.o=new bf(b,null,v,!1)),s.push(v=new bf(P,p,null,!1)),o.push(v.o=new bf(P,null,v,!0))}}),!!s.length){for(o.sort(t),C1(s),C1(o),a=0,l=o.length;a<l;++a)o[a].e=e=!e;for(var u=s[0],h,c;;){for(var d=u,g=!0;d.v;)if((d=d.n)===u)return;h=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(g)for(a=0,l=h.length;a<l;++a)r.point((c=h[a])[0],c[1]);else n(d.x,d.n.x,1,r);d=d.n}else{if(g)for(h=d.p.z,a=h.length-1;a>=0;--a)r.point((c=h[a])[0],c[1]);else n(d.x,d.p.x,-1,r);d=d.p}d=d.o,h=d.z,g=!g}while(!d.v);r.lineEnd()}}}function C1(i){if(t=i.length){for(var t,e=0,n=i[0],r;++e<t;)n.n=r=i[e],r.p=n,n=r;n.n=r=i[0],r.p=n}}function P1(i,t){return i<t?-1:i>t?1:i>=t?0:NaN}function iO(i){return i.length===1&&(i=nO(i)),{left:function(t,e,n,r){for(n==null&&(n=0),r==null&&(r=t.length);n<r;){var s=n+r>>>1;i(t[s],e)<0?n=s+1:r=s}return n},right:function(t,e,n,r){for(n==null&&(n=0),r==null&&(r=t.length);n<r;){var s=n+r>>>1;i(t[s],e)>0?r=s:n=s+1}return n}}}function nO(i){return function(t,e){return P1(i(t),e)}}iO(P1);function x1(i){for(var t=i.length,e,n=-1,r=0,s,o;++n<t;)r+=i[n].length;for(s=new Array(r);--t>=0;)for(o=i[t],e=o.length;--e>=0;)s[--r]=o[e];return s}var Tc=1e9,Cf=-Tc;function rO(i,t,e,n){function r(u,h){return i<=u&&u<=e&&t<=h&&h<=n}function s(u,h,c,d){var g=0,p=0;if(u==null||(g=o(u,c))!==(p=o(h,c))||l(u,h)<0^c>0)do d.point(g===0||g===3?i:e,g>1?n:t);while((g=(g+c+4)%4)!==p);else d.point(h[0],h[1])}function o(u,h){return Mi(u[0]-i)<_e?h>0?0:3:Mi(u[0]-e)<_e?h>0?2:1:Mi(u[1]-t)<_e?h>0?1:0:h>0?3:2}function a(u,h){return l(u.x,h.x)}function l(u,h){var c=o(u,1),d=o(h,1);return c!==d?c-d:c===0?h[1]-u[1]:c===1?u[0]-h[0]:c===2?u[1]-h[1]:h[0]-u[0]}return function(u){var h=u,c=S1(),d,g,p,E,b,P,v,_,m,y,S,C={point:x,lineStart:R,lineEnd:A,polygonStart:M,polygonEnd:T};function x(V,G){r(V,G)&&h.point(V,G)}function I(){for(var V=0,G=0,q=g.length;G<q;++G)for(var at=g[G],dt=1,Q=at.length,K=at[0],it,Ct,Ht=K[0],Vt=K[1];dt<Q;++dt)it=Ht,Ct=Vt,K=at[dt],Ht=K[0],Vt=K[1],Ct<=n?Vt>n&&(Ht-it)*(n-Ct)>(Vt-Ct)*(i-it)&&++V:Vt<=n&&(Ht-it)*(n-Ct)<(Vt-Ct)*(i-it)&&--V;return V}function M(){h=c,d=[],g=[],S=!0}function T(){var V=I(),G=S&&V,q=(d=x1(d)).length;(G||q)&&(u.polygonStart(),G&&(u.lineStart(),s(null,null,1,u),u.lineEnd()),q&&b1(d,a,V,s,u),u.polygonEnd()),h=u,d=g=p=null}function R(){C.point=N,g&&g.push(p=[]),y=!0,m=!1,v=_=NaN}function A(){d&&(N(E,b),P&&m&&c.rejoin(),d.push(c.result())),C.point=x,m&&h.lineEnd()}function N(V,G){var q=r(V,G);if(g&&p.push([V,G]),y)E=V,b=G,P=q,y=!1,q&&(h.lineStart(),h.point(V,G));else if(q&&m)h.point(V,G);else{var at=[v=Math.max(Cf,Math.min(Tc,v)),_=Math.max(Cf,Math.min(Tc,_))],dt=[V=Math.max(Cf,Math.min(Tc,V)),G=Math.max(Cf,Math.min(Tc,G))];eO(at,dt,i,t,e,n)?(m||(h.lineStart(),h.point(at[0],at[1])),h.point(dt[0],dt[1]),q||h.lineEnd(),S=!1):q&&(h.lineStart(),h.point(V,G),S=!1)}v=V,_=G,m=q}return C}}var wm=sa();function sO(i,t){var e=t[0],n=t[1],r=[Fe(e),-Le(e),0],s=0,o=0;wm.reset();for(var a=0,l=i.length;a<l;++a)if(h=(u=i[a]).length)for(var u,h,c=u[h-1],d=c[0],g=c[1]/2+d1,p=Fe(g),E=Le(g),b=0;b<h;++b,d=v,p=m,E=y,c=P){var P=u[b],v=P[0],_=P[1]/2+d1,m=Fe(_),y=Le(_),S=v-d,C=S>=0?1:-1,x=C*S,I=x>ie,M=p*m;if(wm.add(Pu(M*C*Fe(x),E*y+M*Le(x))),s+=I?S+C*As:S,I^d>=e^v>=e){var T=wf(Iu(c),Iu(P));ym(T);var R=wf(r,T);ym(R);var A=(I^S>=0?-1:1)*tl(R[2]);(n>A||n===A&&(T[0]||T[1]))&&(o+=I^S>=0?1:-1)}}return(s<-_e||s<_e&&wm<-_e)^o&1}sa();function I1(i){return i}sa(),sa();var Mu=1/0,Pf=Mu,Nc=-Mu,xf=Nc,M1={point:oO,lineStart:Mc,lineEnd:Mc,polygonStart:Mc,polygonEnd:Mc,result:function(){var i=[[Mu,Pf],[Nc,xf]];return Nc=xf=-(Pf=Mu=1/0),i}};function oO(i,t){i<Mu&&(Mu=i),i>Nc&&(Nc=i),t<Pf&&(Pf=t),t>xf&&(xf=t)}sa();function T1(i,t,e,n){return function(r,s){var o=t(s),a=r.invert(n[0],n[1]),l=S1(),u=t(l),h=!1,c,d,g,p={point:E,lineStart:P,lineEnd:v,polygonStart:function(){p.point=_,p.lineStart=m,p.lineEnd=y,d=[],c=[]},polygonEnd:function(){p.point=E,p.lineStart=P,p.lineEnd=v,d=x1(d);var S=sO(c,a);d.length?(h||(s.polygonStart(),h=!0),b1(d,lO,S,e,s)):S&&(h||(s.polygonStart(),h=!0),s.lineStart(),e(null,null,1,s),s.lineEnd()),h&&(s.polygonEnd(),h=!1),d=c=null},sphere:function(){s.polygonStart(),s.lineStart(),e(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function E(S,C){var x=r(S,C);i(S=x[0],C=x[1])&&s.point(S,C)}function b(S,C){var x=r(S,C);o.point(x[0],x[1])}function P(){p.point=b,o.lineStart()}function v(){p.point=E,o.lineEnd()}function _(S,C){g.push([S,C]);var x=r(S,C);u.point(x[0],x[1])}function m(){u.lineStart(),g=[]}function y(){_(g[0][0],g[0][1]),u.lineEnd();var S=u.clean(),C=l.result(),x,I=C.length,M,T,R;if(g.pop(),c.push(g),g=null,!!I){if(S&1){if(T=C[0],(M=T.length-1)>0){for(h||(s.polygonStart(),h=!0),s.lineStart(),x=0;x<M;++x)s.point((R=T[x])[0],R[1]);s.lineEnd()}return}I>1&&S&2&&C.push(C.pop().concat(C.shift())),d.push(C.filter(aO))}}return p}}function aO(i){return i.length>1}function lO(i,t){return((i=i.x)[0]<0?i[1]-Rs-_e:Rs-i[1])-((t=t.x)[0]<0?t[1]-Rs-_e:Rs-t[1])}const N1=T1(function(){return!0},uO,cO,[-ie,-Rs]);function uO(i){var t=NaN,e=NaN,n=NaN,r;return{lineStart:function(){i.lineStart(),r=1},point:function(s,o){var a=s>0?ie:-ie,l=Mi(s-t);Mi(l-ie)<_e?(i.point(t,e=(e+o)/2>0?Rs:-Rs),i.point(n,e),i.lineEnd(),i.lineStart(),i.point(a,e),i.point(s,e),r=0):n!==a&&l>=ie&&(Mi(t-n)<_e&&(t-=n*_e),Mi(s-a)<_e&&(s-=a*_e),e=hO(t,e,s,o),i.point(n,e),i.lineEnd(),i.lineStart(),i.point(a,e),r=0),i.point(t=s,e=o),n=a},lineEnd:function(){i.lineEnd(),t=e=NaN},clean:function(){return 2-r}}}function hO(i,t,e,n){var r,s,o=Fe(i-e);return Mi(o)>_e?ZN((Fe(t)*(s=Le(n))*Fe(e)-Fe(n)*(r=Le(t))*Fe(i))/(r*s*o)):(t+n)/2}function cO(i,t,e,n){var r;if(i==null)r=e*Rs,n.point(-ie,r),n.point(0,r),n.point(ie,r),n.point(ie,0),n.point(ie,-r),n.point(0,-r),n.point(-ie,-r),n.point(-ie,0),n.point(-ie,r);else if(Mi(i[0]-t[0])>_e){var s=i[0]<t[0]?ie:-ie;r=e*s/2,n.point(-s,r),n.point(0,r),n.point(s,r)}else n.point(t[0],t[1])}function dO(i,t){var e=Le(i),n=e>0,r=Mi(e)>_e;function s(h,c,d,g){tO(g,i,t,d,h,c)}function o(h,c){return Le(h)*Le(c)>e}function a(h){var c,d,g,p,E;return{lineStart:function(){p=g=!1,E=1},point:function(b,P){var v=[b,P],_,m=o(b,P),y=n?m?0:u(b,P):m?u(b+(b<0?ie:-ie),P):0;if(!c&&(p=g=m)&&h.lineStart(),m!==g&&(_=l(c,v),(!_||Sf(c,_)||Sf(v,_))&&(v[0]+=_e,v[1]+=_e,m=o(v[0],v[1]))),m!==g)E=0,m?(h.lineStart(),_=l(v,c),h.point(_[0],_[1])):(_=l(c,v),h.point(_[0],_[1]),h.lineEnd()),c=_;else if(r&&c&&n^m){var S;!(y&d)&&(S=l(v,c,!0))&&(E=0,n?(h.lineStart(),h.point(S[0][0],S[0][1]),h.point(S[1][0],S[1][1]),h.lineEnd()):(h.point(S[1][0],S[1][1]),h.lineEnd(),h.lineStart(),h.point(S[0][0],S[0][1])))}m&&(!c||!Sf(c,v))&&h.point(v[0],v[1]),c=v,g=m,d=y},lineEnd:function(){g&&h.lineEnd(),c=null},clean:function(){return E|(p&&g)<<1}}}function l(h,c,d){var g=Iu(h),p=Iu(c),E=[1,0,0],b=wf(g,p),P=_f(b,b),v=b[0],_=P-v*v;if(!_)return!d&&h;var m=e*P/_,y=-e*v/_,S=wf(E,b),C=Ef(E,m),x=Ef(b,y);vm(C,x);var I=S,M=_f(C,I),T=_f(I,I),R=M*M-T*(_f(C,C)-1);if(!(R<0)){var A=xu(R),N=Ef(I,(-M-A)/T);if(vm(N,C),N=mm(N),!d)return N;var V=h[0],G=c[0],q=h[1],at=c[1],dt;G<V&&(dt=V,V=G,G=dt);var Q=G-V,K=Mi(Q-ie)<_e,it=K||Q<_e;if(!K&&at<q&&(dt=q,q=at,at=dt),it?K?q+at>0^N[1]<(Mi(N[0]-V)<_e?q:at):q<=N[1]&&N[1]<=at:Q>ie^(V<=N[0]&&N[0]<=G)){var Ct=Ef(I,(-M+A)/T);return vm(Ct,C),[N,mm(Ct)]}}}function u(h,c){var d=n?i:ie-i,g=0;return h<-d?g|=1:h>d&&(g|=2),c<-d?g|=4:c>d&&(g|=8),g}return T1(o,a,s,n?[0,-i]:[-ie,i-ie])}function O1(i){return function(t){var e=new Em;for(var n in i)e[n]=i[n];return e.stream=t,e}}function Em(){}Em.prototype={constructor:Em,point:function(i,t){this.stream.point(i,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function D1(i,t,e){var n=t[1][0]-t[0][0],r=t[1][1]-t[0][1],s=i.clipExtent&&i.clipExtent();i.scale(150).translate([0,0]),s!=null&&i.clipExtent(null),KN(e,i.stream(M1));var o=M1.result(),a=Math.min(n/(o[1][0]-o[0][0]),r/(o[1][1]-o[0][1])),l=+t[0][0]+(n-a*(o[1][0]+o[0][0]))/2,u=+t[0][1]+(r-a*(o[1][1]+o[0][1]))/2;return s!=null&&i.clipExtent(s),i.scale(a*150).translate([l,u])}function fO(i,t,e){return D1(i,[[0,0],t],e)}var R1=16,gO=Le(30*Tr);function A1(i,t){return+t?mO(i,t):pO(i)}function pO(i){return O1({point:function(t,e){t=i(t,e),this.stream.point(t[0],t[1])}})}function mO(i,t){function e(n,r,s,o,a,l,u,h,c,d,g,p,E,b){var P=u-n,v=h-r,_=P*P+v*v;if(_>4*t&&E--){var m=o+d,y=a+g,S=l+p,C=xu(m*m+y*y+S*S),x=tl(S/=C),I=Mi(Mi(S)-1)<_e||Mi(s-c)<_e?(s+c)/2:Pu(y,m),M=i(I,x),T=M[0],R=M[1],A=T-n,N=R-r,V=v*A-P*N;(V*V/_>t||Mi((P*A+v*N)/_-.5)>.3||o*d+a*g+l*p<gO)&&(e(n,r,s,o,a,l,T,R,I,m/=C,y/=C,S,E,b),b.point(T,R),e(T,R,I,m,y,S,u,h,c,d,g,p,E,b))}}return function(n){var r,s,o,a,l,u,h,c,d,g,p,E,b={point:P,lineStart:v,lineEnd:m,polygonStart:function(){n.polygonStart(),b.lineStart=y},polygonEnd:function(){n.polygonEnd(),b.lineStart=v}};function P(x,I){x=i(x,I),n.point(x[0],x[1])}function v(){c=NaN,b.point=_,n.lineStart()}function _(x,I){var M=Iu([x,I]),T=i(x,I);e(c,d,h,g,p,E,c=T[0],d=T[1],h=x,g=M[0],p=M[1],E=M[2],R1,n),n.point(c,d)}function m(){b.point=P,n.lineEnd()}function y(){v(),b.point=S,b.lineEnd=C}function S(x,I){_(r=x,I),s=c,o=d,a=g,l=p,u=E,b.point=_}function C(){e(c,d,h,g,p,E,s,o,r,a,l,u,R1,n),b.lineEnd=m,m()}return b}}var vO=O1({point:function(i,t){this.stream.point(i*Tr,t*Tr)}});function yO(i){return _O(function(){return i})()}function _O(i){var t,e=150,n=480,r=250,s,o,a=0,l=0,u=0,h=0,c=0,d,g,p=null,E=N1,b=null,P,v,_,m=I1,y=.5,S=A1(T,y),C,x;function I(N){return N=g(N[0]*Tr,N[1]*Tr),[N[0]*e+s,o-N[1]*e]}function M(N){return N=g.invert((N[0]-s)/e,(o-N[1])/e),N&&[N[0]*oa,N[1]*oa]}function T(N,V){return N=t(N,V),[N[0]*e+s,o-N[1]*e]}I.stream=function(N){return C&&x===N?C:C=vO(E(d,S(m(x=N))))},I.clipAngle=function(N){return arguments.length?(E=+N?dO(p=N*Tr,6*Tr):(p=null,N1),A()):p*oa},I.clipExtent=function(N){return arguments.length?(m=N==null?(b=P=v=_=null,I1):rO(b=+N[0][0],P=+N[0][1],v=+N[1][0],_=+N[1][1]),A()):b==null?null:[[b,P],[v,_]]},I.scale=function(N){return arguments.length?(e=+N,R()):e},I.translate=function(N){return arguments.length?(n=+N[0],r=+N[1],R()):[n,r]},I.center=function(N){return arguments.length?(a=N[0]%360*Tr,l=N[1]%360*Tr,R()):[a*oa,l*oa]},I.rotate=function(N){return arguments.length?(u=N[0]%360*Tr,h=N[1]%360*Tr,c=N.length>2?N[2]%360*Tr:0,R()):[u*oa,h*oa,c*oa]},I.precision=function(N){return arguments.length?(S=A1(T,y=N*N),A()):xu(y)},I.fitExtent=function(N,V){return D1(I,N,V)},I.fitSize=function(N,V){return fO(I,N,V)};function R(){g=v1(d=QN(u,h,c),t);var N=t(a,l);return s=n-N[0]*e,o=r+N[1]*e,A()}function A(){return C=x=null,I}return function(){return t=i.apply(this,arguments),I.invert=t.invert&&M,R()}}function L1(i){return function(t,e){var n=Le(t),r=Le(e),s=i(n*r);return[s*r*Fe(t),s*Fe(e)]}}function F1(i){return function(t,e){var n=xu(t*t+e*e),r=i(n),s=Fe(r),o=Le(r);return[Pu(t*s,n*o),tl(n&&e*s/n)]}}var wO=L1(function(i){return xu(2/(1+i))});wO.invert=F1(function(i){return 2*tl(i/2)});var k1=L1(function(i){return(i=f1(i))&&i/Fe(i)});k1.invert=F1(function(i){return i});function EO(){return yO(k1).scale(79.4188).clipAngle(179.999)}function G1(i,t){return[i,t]}G1.invert=G1;function SO(i,t,e){e=e||{};var n=e.units||"kilometers",r=e.steps||8;if(!i)throw new Error("geojson is required");if(typeof e!="object")throw new Error("options must be an object");if(typeof r!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(r<=0)throw new Error("steps must be greater than 0");var s=[];switch(i.type){case"GeometryCollection":return Wd(i,function(o){var a=If(o,t,n,r);a&&s.push(a)}),Fn(s);case"FeatureCollection":return Ql(i,function(o){var a=If(o,t,n,r);a&&Ql(a,function(l){l&&s.push(l)})}),Fn(s)}return If(i,t,n,r)}function If(i,t,e,n){var r=i.properties||{},s=i.type==="Feature"?i.geometry:i;if(s.type==="GeometryCollection"){var o=[];return Wd(i,function(E){var b=If(E,t,e,n);b&&o.push(b)}),Fn(o)}var a=bO(s),l={type:s.type,coordinates:V1(s.coordinates,a)},u=new sm,h=u.read(l),c=Tp(Np(t,e),"meters"),d=ri.bufferOp(h,c,n),g=new Ww;if(d=g.write(d),!j1(d.coordinates)){var p={type:d.type,coordinates:z1(d.coordinates,a)};return lr(p,r)}}function j1(i){return Array.isArray(i[0])?j1(i[0]):isNaN(i[0])}function V1(i,t){return typeof i[0]!="object"?t(i):i.map(function(e){return V1(e,t)})}function z1(i,t){return typeof i[0]!="object"?t.invert(i):i.map(function(e){return z1(e,t)})}function bO(i){var t=Y_(i).geometry.coordinates,e=[-t[0],-t[1]];return EO().rotate(e).scale(Ni)}function CO(i,t,e){e===void 0&&(e={});var n=Bi(i),r=Bi(t),s=Jp.union(n.coordinates,r.coordinates);return s.length===0?null:s.length===1?ue(s[0],e.properties):Mp(s,e.properties)}function Oc(i,t,e){e===void 0&&(e={});var n=Bi(i),r=Bi(t),s=Jp.intersection(n.coordinates,r.coordinates);return s.length===0?null:s.length===1?ue(s[0],e.properties):Mp(s,e.properties)}function PO(i,t,e){e===void 0&&(e={});var n=JSON.stringify(e.properties||{}),r=i[0],s=i[1],o=i[2],a=i[3],l=(s+a)/2,u=(r+o)/2,h=t*2/di([r,l],[o,l],e),c=h*(o-r),d=t*2/di([u,s],[u,a],e),g=d*(a-s),p=c/2,E=p*2,b=Math.sqrt(3)/2*g,P=o-r,v=a-s,_=3/4*E,m=b,y=(P-E)/(E-p/2),S=Math.floor(y),C=(S*_-p/2-P)/2-p/2+_/2,x=Math.floor((v-b)/b),I=(v-x*b)/2,M=x*b-v>b/2;M&&(I-=b/4);for(var T=[],R=[],A=0;A<6;A++){var N=2*Math.PI/6*A;T.push(Math.cos(N)),R.push(Math.sin(N))}for(var V=[],G=0;G<=S;G++)for(var q=0;q<=x;q++){var at=G%2===1;if(!(q===0&&at)&&!(q===0&&M)){var dt=G*_+r-C,Q=q*m+s+I;if(at&&(Q-=b/2),e.triangles===!0)IO([dt,Q],c/2,g/2,JSON.parse(n),T,R).forEach(function(it){e.mask?Oc(e.mask,it)&&V.push(it):V.push(it)});else{var K=xO([dt,Q],c/2,g/2,JSON.parse(n),T,R);e.mask?Oc(e.mask,K)&&V.push(K):V.push(K)}}}return Fn(V)}function xO(i,t,e,n,r,s){for(var o=[],a=0;a<6;a++){var l=i[0]+t*r[a],u=i[1]+e*s[a];o.push([l,u])}return o.push(o[0].slice()),ue([o],n)}function IO(i,t,e,n,r,s){for(var o=[],a=0;a<6;a++){var l=[];l.push(i),l.push([i[0]+t*r[a],i[1]+e*s[a]]),l.push([i[0]+t*r[(a+1)%6],i[1]+e*s[(a+1)%6]]),l.push(i),o.push(ue([l],n))}return o}function MO(i,t,e,n){n===void 0&&(n={});for(var r=[],s=i[0],o=i[1],a=i[2],l=i[3],u=t/di([s,o],[a,o],n),h=u*(a-s),c=e/di([s,o],[s,l],n),d=c*(l-o),g=a-s,p=l-o,E=Math.floor(g/h),b=Math.floor(p/d),P=(g-E*h)/2,v=(p-b*d)/2,_=s+P,m=0;m<E;m++){for(var y=o+v,S=0;S<b;S++){var C=ue([[[_,y],[_,y+d],[_+h,y+d],[_+h,y],[_,y]]],n.properties);n.mask?uN(n.mask,C)&&r.push(C):r.push(C),y+=d}_+=h}return Fn(r)}function TO(i,t,e){return e===void 0&&(e={}),MO(i,t,t,e)}function NO(i,t,e){e===void 0&&(e={});for(var n=[],r=t/di([i[0],i[1]],[i[2],i[1]],e),s=r*(i[2]-i[0]),o=t/di([i[0],i[1]],[i[0],i[3]],e),a=o*(i[3]-i[1]),l=0,u=i[0];u<=i[2];){for(var h=0,c=i[1];c<=i[3];){var d=null,g=null;l%2===0&&h%2===0?(d=ue([[[u,c],[u,c+a],[u+s,c],[u,c]]],e.properties),g=ue([[[u,c+a],[u+s,c+a],[u+s,c],[u,c+a]]],e.properties)):l%2===0&&h%2===1?(d=ue([[[u,c],[u+s,c+a],[u+s,c],[u,c]]],e.properties),g=ue([[[u,c],[u,c+a],[u+s,c+a],[u,c]]],e.properties)):h%2===0&&l%2===1?(d=ue([[[u,c],[u,c+a],[u+s,c+a],[u,c]]],e.properties),g=ue([[[u,c],[u+s,c+a],[u+s,c],[u,c]]],e.properties)):h%2===1&&l%2===1&&(d=ue([[[u,c],[u,c+a],[u+s,c],[u,c]]],e.properties),g=ue([[[u,c+a],[u+s,c+a],[u+s,c],[u,c+a]]],e.properties)),e.mask?(Oc(e.mask,d)&&n.push(d),Oc(e.mask,g)&&n.push(g)):(n.push(d),n.push(g)),c+=a,h++}l++,u+=s}return Fn(n)}function OO(i,t,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var n=e.gridType,r=e.property,s=e.weight;if(!i)throw new Error("points is required");if(J2(i,"Point","input must contain Points"),!t)throw new Error("cellSize is required");if(s!==void 0&&typeof s!="number")throw new Error("weight must be a number");r=r||"elevation",n=n||"square",s=s||1;var o=ur(i),a;switch(n){case"point":case"points":a=BT(o,t,e);break;case"square":case"squares":a=TO(o,t,e);break;case"hex":case"hexes":a=PO(o,t,e);break;case"triangle":case"triangles":a=NO(o,t,e);break;default:throw new Error("invalid gridType")}var l=[];return Ql(a,function(u){var h=0,c=0;Ql(i,function(g){var p=n==="point"?u:Lp(u),E=di(p,g,e),b;if(r!==void 0&&(b=g.properties[r]),b===void 0&&(b=g.geometry.coordinates[2]),b===void 0)throw new Error("zValue is missing");E===0&&(h=b);var P=1/Math.pow(E,s);c+=P,h+=P*b});var d=dT(u);d.properties[r]=h/c,l.push(d)}),Fn(l)}function DO(i,t){const e=i[0],n=i[i.length-1];(e[0]!==n[0]||e[1]!==n[1]||e[2]!==n[2])&&i.push(e);const r=Kt(t),s=ue([i]);return _i(r,s)}function RO(i,t){const e=yi(i);return jp(e,t,{units:"meters"}).geometry.coordinates}function Sm(i){if((i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),i.length<=3)return 0;const t=ue([i]);return OT(t)}function AO(i){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]);const t=ue([i]),n=J_(t).geometry.coordinates;return[n[0],n[1],n[2]??i[0][2]??0]}function bm(...i){let[t,e,n,r]=i;const[s,o,a]=t;if(Array.isArray(e)){const[l,u,h]=e,c=Math.sqrt(l*l+u*u);let d=0;c>0&&(d=Math.atan2(l,u)*(180/Math.PI),d<0&&(d+=360));const g=hr(Kt([s,o]),c,d,{units:"meters"});return!g||!g.geometry||!g.geometry.coordinates?void 0:(n=n||[0,0,0],n[0]=g.geometry.coordinates[0],n[1]=g.geometry.coordinates[1],n[2]=a+(h||0),n)}else{const l=hr(Kt([s,o]),e,n,{units:"meters"});return!l||!l.geometry||!l.geometry.coordinates?void 0:(r=r||[0,0,0],r[0]=l.geometry.coordinates[0],r[1]=l.geometry.coordinates[1],r[2]=a,r)}}function Mf(i,t){return di(Kt(i),Kt(t),{units:"meters"})}function Dc(i,t){return tu(Kt(i),Kt(t))}function LO(i,t){return Fa(yi(i),yi(t))}function FO(i,t){const e=Kt(i),n=Kt(t),r=mT(e,n),s=(i[2]+t[2])/2;return[...r.geometry.coordinates,s]}function kO(i,t){const e=Kt(t),n=yi(i);return IT(n,e,{units:"meters"})}function GO(i,t){const e=Kt(i),n=yi(t);return TT(e,n,{units:"meters"})}function jO(i,t,e,n){const[r,s,o]=i,a=HT(Kt([r,s]),t,e,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return n=n||[0,0,0],n[0]=a.geometry.coordinates[0],n[1]=a.geometry.coordinates[1],n[2]=o,n}function B1(i,t){return ow(Kt(i),Kt(t),{units:"meters"})}function VO(i,t){return WT(Kt(i),Kt(t))}function U1(i,t){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=Oc(ue([i]),ue([t]));if(e)return e.geometry.coordinates}function q1(i,t){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=CO(ue([i]),ue([t]));if(e)return e.geometry.coordinates}function W1(i,t=500,e="meters"){const n=SO(yi(i),t,{units:e});if(n)return n.geometry.coordinates}function H1(i,t){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=RN(ue([i]),ue([t]));if(e)return e.geometry.coordinates}function X1(i,t,e=10,n="meters"){return gT(i,t,{steps:e,units:n}).geometry.coordinates}function Cm(i,t){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=ue([i]),n=ue([t]);return tN(e,n)?"oneBig":dw(e,n)?"twoBig":!1}function Tf(i){const t=Ao(xa(i,["0"])),e=Ao(xa(i,["1"])),n=Ao(xa(i,["2"])),r=to(xa(i,["0"])),s=to(xa(i,["1"])),o=to(xa(i,["2"]));return{minPos:[t,e,n],maxPos:[r,s,o],center:[(t+r)*.5,(e+s)*.5,(n+o)*.5]}}function $1(i){const{minPos:t,maxPos:e,center:n}=Tf(i);if(t.some(a=>!Number.isFinite(a)||e.some(l=>!Number.isFinite(l))||n.some(l=>!Number.isFinite(l)))){console.warn("geoCenterAndRadiusFromPositions error: minPos.some(e => !Number.isFinite(e) || maxPos.some(e => !Number.isFinite(e)) || center.some(e => !Number.isFinite(e))");return}const r=Mf(t,e);let s=r*.5;const o=Math.abs(t[2]-e[2]);return o!=0&&(s=Math.sqrt(r*r+o*o)*.5),{center:n,radius:s}}function Y1(i,t){const e=jr(i),n=jr(t);return w.Vector.distance(e,n)}function _o(i,t){const e=[],n=i.length;let r=0;for(let s=0;s<n-1;++s){if(t===void 0||t==="GEODESIC"){const o=Mf(i[s],i[s+1]),a=Math.abs(i[s][2]-i[s+1][2]);if(a===0)r+=o;else{const l=Math.sqrt(o*o+a*a);r+=l}}else if(t==="RHUMB"){const o=B1(i[s],i[s+1]),a=Math.abs(i[s][2]-i[s+1][2]);if(a===0)r+=o;else{const l=Math.sqrt(o*o+a*a);r+=l}}else if(t==="NONE"){const o=Y1(i[s],i[s+1]);r+=o}else console.warn(`未知的arcType: ${t},导致距离无法计算!`);e.push(r)}return e}function Pm(i){const t="__getXyzFromPostion";let e=An(i,t);return(!e||!w.Vector.equals(e[0],i))&&(e=[[...i],jr(i)],ps(i,t,e)),e[1]}class zO{constructor(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(let e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(let e=0;e<this.length-1;e++){const n=this.points[e],r=this.points[e+1];this.centers.push({x:(n.x+r.x)/2,y:(n.y+r.y)/2,z:(n.z+r.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(let e=0;e<this.centers.length-1;e++){const n=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,r=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,s=this.points[e+1].z-(this.centers[e].z+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+n),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+r),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+s)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+n),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+r),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+s)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}cacheSteps(t){const e=[];let n=this.pos(0);e.push(0);for(let r=0;r<this.duration;r+=10){const s=this.pos(r);Math.sqrt((s.x-n.x)*(s.x-n.x)+(s.y-n.y)*(s.y-n.y)+(s.z-n.z)*(s.z-n.z))>t&&(e.push(r),n=s)}return e}vector(t){const e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}}pos(t){let e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);const n=e/this.duration;if(n>=1)return this.points[this.length-1];const r=Math.floor((this.points.length-1)*n),s=(this.length-1)*n-r;return BO(s,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])}}function BO(i,t,e,n,r){const s=UO(i);return{x:r.x*s[0]+n.x*s[1]+e.x*s[2]+t.x*s[3],y:r.y*s[0]+n.y*s[1]+e.y*s[2]+t.y*s[3],z:r.z*s[0]+n.z*s[1]+e.z*s[2]+t.z*s[3]}}function UO(i){const t=i*i;return[t*i,3*t*(1-i),3*i*(1-i)*(1-i),(1-i)*(1-i)*(1-i)]}function qO(i,t){t===void 0&&(t={});var e=t.resolution||1e3,n=t.sharpness||.85;const r=[],s=i.map(u=>{const[h,c,d]=jr(u);return{x:h,y:c,z:d}});for(var o=new zO({duration:e,points:s,sharpness:n}),a=function(u){var h=o.pos(u);const c=Ip([h.x,h.y,h.z]);r.push(c)},l=0;l<o.duration;l+=10)a(l);return a(o.duration),r}function Tu(i,t,e){return qO(i,{resolution:t,sharpness:e})}function xm(i){return Do(i,(t,e)=>t[0]===e[0]&&t[1]===e[1],t=>[...t])}function J1(i,t){const e=new Array;for(let n of i)e.push(t(n));return e}function Nf(i,t){return i===void 0&&t===void 0?!0:!i||!t?!1:i[0]===t[0]&&i[1]===t[1]&&i[2]===t[2]}function Z1(i,t,e){var r;((r=t.attachedViewers.values().toArray()[0])==null?void 0:r.getEngineObject(t))?e.call(i):requestAnimationFrame(()=>Z1(i,t,e))}function WO(i,t,e,n=!0){n&&e(),i.dispose(t.disposableOn(e))}function HO(i,t){const{type:e,id:n}=i;if(e){const r=pt.create(e,n);if(r)return r.json=i,r;console.warn(`cannot create sceneObject from type(${e})`)}else console.warn(`cannot create sceneObject from type(${e})`)}function K1(i){const t=i.children&&Cg(i.children,n=>{if(!(n instanceof gn))throw new Error("!(treeItem instanceof SceneTreeItem)");return!n.show})||!1,e=i.sceneTree.getSceneObjectShowFunc(i.sceneObject);return!t||e}class gn extends Rh{constructor(e,n=!1,r,s,o=!0){super(e,n,r);f(this,"_dragDrop");f(this,"_showChangedNotAffectChildren",!1);f(this,"_showChangedNotAffectParent",!1);f(this,"_type",this.dv(z("Unknown")));f(this,"_isExport",this.dv(z(!0)));const a=()=>this.tree&&this.tree.itemsChanged.emit([this]);this.dispose(this.nameChanged.disposableOn(a)),this.name=`未命名条目(${this.id})`,this.extras=s,this._isExport.value=o;let l;const u=()=>{l&&(l(),l=void 0)};this.dispose(u),this.dispose(this.sceneObjectChanged.disposableOn(h=>{u(),h&&(l=lt([this,"name"],[h,"name"]))})),this.dispose(this.showChanged.disposableOn(h=>{if(e.setSceneObjectShowFunc(this.sceneObject,h),this.tree&&this.tree.forceRedraw(),this.children&&!this._showChangedNotAffectChildren)for(let c of this.children)c instanceof gn&&(c._showChangedNotAffectParent=!0,c.show=h,c._showChangedNotAffectParent=!1);this.parent&&this.parent instanceof gn&&!this._showChangedNotAffectParent&&(this.parent._showChangedNotAffectChildren=!0,this.parent.show=K1(this.parent),this.parent._showChangedNotAffectChildren=!1)})),this.dv(new qe(this.sceneObjectChanged,()=>{if(!this.sceneObject)return;const h=new B;if("show"in this.sceneObject&&"showChanged"in this.sceneObject&&this.sceneObject.showChanged instanceof O){const c=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};c(),h.dispose(this.sceneObject.showChanged.disposableOn(c))}else if("enabled"in this.sceneObject&&"enabledChanged"in this.sceneObject&&this.sceneObject.enabledChanged instanceof O){const c=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};c(),h.dispose(this.sceneObject.enabledChanged.disposableOn(c))}return h})),this.childrenChangedEvent.disposableOn(()=>{const h=K1(this);this._showChangedNotAffectChildren=!0,this.show=h,this._showChangedNotAffectChildren=!1});{const h=()=>{let c="Unknown";this.sceneObject?c=this.sceneObject.typeName:this.children&&(c="Folder"),this._type.value=c};this.dispose(this.sceneObjectChanged.disposableOn(h)),this.dispose(this.childrenResetedEvent.disposableOn(h)),h()}}get dragDrop(){return this._dragDrop||(this._dragDrop=this.dv(this.sceneTree.createTreeItemDragDropFunc(this))),this._dragDrop}get type(){return this._type.value}get typeChanged(){return this._type.changed}get isExport(){return this._isExport.value}get isExportChanged(){return this._isExport.changed}set isExport(e){this._isExport.value=e}get sceneTree(){return this.tree}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){try{this.json=JSON.parse(e)}catch(n){console.error(`sceneTreeItem.jsonStr error ${n}`,n)}}get completeJson(){const e=this.children&&[...this.children].filter(n=>n.isExport).map(n=>n.completeJson);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.completeJson,children:e,extras:this.extras}}get json(){const e=this.children&&[...this.children].filter(n=>n.isExport).map(n=>n.json);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.json,children:e,extras:this.extras}}set json(e){if(e.name!==void 0&&(this.name=e.name),this.extras=e.extras,this._showChangedNotAffectChildren=!0,this._showChangedNotAffectParent=!0,this.show=e.show??!0,this._showChangedNotAffectChildren=!1,this._showChangedNotAffectParent=!1,this.uiTreeObject.collapsed=e.collapsed??!1,this.sceneObject=void 0,e.sceneObj&&(this.sceneObject=this.sceneTree.createSceneObjectFunc(e.sceneObj,this)),!!e.children){if(this.resetChildren(!0),!this.children)throw new Error("resetChildren(true) cannot get children!");for(let n of e.children){const r=new gn(this.tree,!0);r.json=n,this.children.push(r)}}}clone(){try{const e=new gn(this.sceneTree,!!this.children,void 0,this.extras,this.isExport);return e.json=this.json,e.name=this.sceneTree.getSceneTreeItemCloneNameFunc(this),e}catch(e){console.error(`SceneTreeItem.clone error: ${e}`,e)}}insertNewTreeItem(e,n){if(e==="FolderInnerOrAfter"||e==="FolderInnerOrBefore"||e==="FolderInner"){if(n&&n.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&!(e.includes("Or")&&this.sceneObject))return n&&this.children.push(n),!0;if(e==="FolderInner")return!1;if(e==="FolderInnerOrAfter")return super.insertNewTreeItem("After",n);if(e==="FolderInnerOrBefore")return super.insertNewTreeItem("Before",n);throw new Error("should not be here!")}else return super.insertNewTreeItem(e,n)}}(i=>{i.createDefaultProps=()=>({name:"未命名条目",nameEditing:!1,sceneObject:void 0,show:!0,extras:fe(void 0)})})(gn||(gn={})),Ro(gn.prototype,gn.createDefaultProps);function Q1(i,t,e){let{offsetY:n}=t;if(!t.target||!("clientTop"in t.target))return"none";n+=2,n+=t.target.clientTop;let r="none";return i.children?n<=e*.3?r="before":n>=e*.7?!i.uiTreeObject.collapsed&&i.children.length>0?r="inner":r="after":r="inner":n<=e*.5?r="before":r="after",r}class tE extends Ty{constructor(t){super(),this._treeItem=t;const{dragStartDataManager:e}=this._treeItem.sceneTree;let n="none";const r=this.disposeVar(L0(()=>{this._treeItem.uiTreeObject.moveToPositionMode=n,console.log(`uiTreeObject.moveToPositionMode = lastDragMode(${n});`)},200));function s(o){n!==o&&(n=o,r.restart())}this.dispose(this._dragStartEvent.disposableOn(o=>{e.data={type:"UITreeA",value:this._treeItem}})),this.dispose(this._dragOverEvent.disposableOn(o=>{if(!o.dataTransfer)return;o.preventDefault();const a=e;if(a.data&&a.data.type==="UITreeA"&&a.data.value!==void 0){const l=a.data.value,u=this._treeItem,{tree:h}=u;if(h){const c=[...h.selectedItems];~c.indexOf(l)||c.push(l);const d=Q1(u,o,h.itemDivHeight);if(d!=="none"&&Oa.canMoveToTreeItems(c,u,d)){o.dataTransfer.dropEffect="move",s(d);return}}}o.dataTransfer.dropEffect="none",s("none")})),this.dispose(this._dropEvent.disposableOn(o=>{const a=e;if(!(a.data&&a.data.type==="UITreeA"&&a.data.value!==void 0))return;const l=a.data.value,u=this._treeItem,{tree:h}=u;if(!h)return;const c=[...h.selectedItems];~c.indexOf(l)||c.push(l);const d=Q1(u,o,h.itemDivHeight);d!=="none"&&Oa.canMoveToTreeItems(c,u,d)&&(Oa.moveToTreeItems(c,u,d),a.data=void 0,s("none"))})),this.dispose(this._dragLeaveEvent.disposableOn(()=>{n="none",r.restart()}))}}function XO(i){if(!(i instanceof gn))throw new Error("defaultCreateTreeItemDragDrop !(treeItem instanceof SceneTreeItem)");return new tE(i)}function $O(i){let t=!1;return i&&("show"in i?t=i.show??!0:"enabled"in i&&(t=i.enabled??!0)),t}function YO(i,t){i&&("show"in i?i.show=t:"enabled"in i&&(i.enabled=t))}const JO=["EnvironmentVariables","ScriptsLoader","SceneScript","ScriptLoader"];function ZO(i){const t=[],{root:e={}}=i,n=[e];for(;n.length>0;){const r=n.pop();if(!r)throw new Error("!todo");if(r.children){for(let s of r.children)if(s.children&&n.unshift(s),s.sceneObj){const{type:o=void 0}=s.sceneObj;o||(console.warn("sceneObjJson has no type! treeItem.sceneObj: "),console.warn(s.sceneObj)),o&&JO.includes(o)&&t.push(s.sceneObj)}}}return t}async function KO(i,t){const e=ZO(i);let n=0;const r=e.length;for(let s of e)if(++n,t){const o=n/r;t(o,n,r)}}class eE extends B{constructor(e,n){super();f(this,"treeItemContexMenuCallback");this._sceneTree=e,this._projectManager=n}get sceneTree(){return this._sceneTree}}class QO extends B{constructor(e){super();f(this,"_jsonLoadingEvent",this.disposeVar(new O));f(this,"_setJsonProcessing",this.disposeVar(Ln(async(e,n)=>{this._jsonLoadingEvent.emit({type:"init"}),this._jsonLoadingEvent.emit({type:"loading"}),n&&await e.promise(this._sceneTree.preloadFunc(n)),this._setJson(n),this._jsonLoadingEvent.emit({type:"loaded"})})));this._sceneTree=e,this._setJsonProcessing.errorFunc=n=>{this._jsonLoadingEvent.emit({type:"error",error:n})}}get jsonLoadingEvent(){return this._jsonLoadingEvent}_setJson(e){try{this._sceneTree.setJson(e||{})}catch(n){console.error(`json数据装配时发生错误!error: ${n}`)}}get json(){return this._sceneTree.getJson()}set json(e){this._setJsonProcessing.restart(new Fr("JSON重新赋值!"),e)}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){this.json=JSON.parse(e)}}function tD(i){return i.name+"_clone"}function Im(i,t,e){if(i instanceof gn)return i.insertNewTreeItem(t,e);{const n={FolderInnerOrAfter:"InnerOrAfter",FolderInnerOrBefore:"InnerOrBefore",FolderInner:"Inner",InnerOrAfter:"InnerOrAfter",InnerOrBefore:"InnerOrBefore",Inner:"Inner",After:"After",Before:"Before"};return i.insertNewTreeItem(n[t],e)}}function eD(i){[i,...i.getDescendants()].forEach(t=>t.destroy())}const Dn=class Dn extends Oa{constructor(e,n,r,s){super(r);f(this,"_jsonLoading",this.disposeVar(new QO(this)));f(this,"createSceneObjectFunc",Dn.defaultCreateSceneObjectFunc);f(this,"createTreeItemDragDropFunc",Dn.defaultCreateTreeItemDragDropFunc);f(this,"preloadFunc",Dn.defaultPreload);f(this,"getSceneObjectShowFunc",Dn.defaultGetSceneObjectShow);f(this,"setSceneObjectShowFunc",Dn.defaultSetSceneObjectShow);f(this,"getSceneTreeItemCloneNameFunc",Dn.defaultGetSceneTreeItemCloneNameFunc);f(this,"debug",!1);f(this,"_contextMenu",this.disposeVar(new eE(this,this.projectManager)));f(this,"_showPropUiOnSelecting",this.disposeVar(z(!0)));this._name=e,this._dragStartDataManager=n,this._projectManager=s,this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{var a,l;window.lssn=this.lastSelectedItem,window.lsso=(a=this.lastSelectedItem)==null?void 0:a.sceneObject,this.debug&&console.log(((l=this.lastSelectedItem)==null?void 0:l.sceneObject)??"select null")}));const{sceneObjectsManager:o}=this._projectManager;this.dispose(this.itemsDeleted.disposableOn(a=>{for(let l of a){const u=l,{sceneObject:h}=u;h&&o.deleteSceneObject(h)&&h.destroy()&&Pd(h,void 0);for(let c of u.getDescendants()){const{sceneObject:d}=c;d&&o.deleteSceneObject(d)&&d.destroy()&&Pd(d,void 0)}eD(l)}})),this.dispose(this.itemsAdded.disposableOn(a=>{for(let l of a){const u=l;u.sceneObject&&o.addSceneObject(u.sceneObject)&&Pd(u.sceneObject,u)}}))}get json(){return this._jsonLoading.json}set json(e){this._jsonLoading.json=e}get jsonStr(){return this._jsonLoading.jsonStr}set jsonStr(e){this._jsonLoading.jsonStr=e}get jsonLoadingEvent(){return this._jsonLoading.jsonLoadingEvent}get name(){return this._name}get projectManager(){return this._projectManager}get contextMenu(){return this._contextMenu}get showPropUiOnSelecting(){return this._showPropUiOnSelecting.value}set showPropUiOnSelecting(e){this._showPropUiOnSelecting.value=e}get showPropUiOnSelectingChanged(){return this._showPropUiOnSelecting.changed}get sceneUiTree(){return this.uiTree}getTreeItemFromSceneObjId(e){const n=this.getDescendants();let r;for(let s of n)if(s.sceneObject&&s.sceneObject.id===e){r=s;break}return r}getTreeItemsFromSceneObjType(e){const n=this.getDescendants(),r=[],s=Array.isArray(e)?e:[e];for(let o of n)o.sceneObject&&s.includes(o.sceneObject.typeName)&&r.push(o);return r}getTreeItemsFromSceneObjName(e){var s;const n=this.getDescendants(),r=[];for(let o of n)(s=o.sceneObject)!=null&&s.name.includes(e)&&r.push(o);return r}get dragStartDataManager(){return this._dragStartDataManager}get completeJson(){return{root:{children:[...this.children].filter(e=>e.isExport).map(e=>e.completeJson)}}}getJson(){return{root:{children:[...this.children].filter(e=>e.isExport).map(e=>e.json)}}}setJson(e){var r;e.root=e.root||{};const n=e.root.children??[];this.root.resetChildren(!0);for(let s of n){const o=new gn(this,!0);o.json=s,(r=this.root.children)==null||r.push(o)}}testAddNewTreeItem(e,n){const r=e||this.lastSelectedItem||this.root;return r?Im(r,n):!1}addNewTreeItem(e,n,r,s){const o=e||this.lastSelectedItem||this.root;if(o&&Im(o,n)){const a=new gn(this,r);if(a.sceneObject=s,!Im(o,n,a))throw new Error("currentTreeItem.insertNewTreeItem return false!");return a}}createSceneObjectTreeItem(e,n,r,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(r,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${r?r.id:"root"})`);return}const a=pt.create(e,n);return a?this.addNewTreeItem(r,s??"FolderInnerOrAfter",!0,a):void 0}createGroupTreeItem(e,n,r,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(r,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${r?r.id:"root"})`);return}const a=this.addNewTreeItem(r,s??"FolderInnerOrAfter",!0);if(!a){console.warn("addNewTreeItem error!");return}return a.name=e??"未命名组节点",a}createSceneObjectTreeItemFromClass(e,n,r,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(r,o))return;const a=pt.createFromClass(e,n);return a?this.addNewTreeItem(r,o,!0,a):void 0}createSceneObjectTreeItemFromJson(e,n,r){const s=r??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(n,s))return;const o=pt.createFromJson(e);return console.log(o),o?this.addNewTreeItem(n,r??"FolderInnerOrAfter",!0,o):void 0}destroySceneObjectTreeItem(e){if(e===this.root){console.warn("cannot destroy root! please use function destroyAllSceneObjectTreeItems!");return}e.detachFromParent()}destroyAllSceneObjectTreeItems(){if(!this.root.children)return;const e=[...this.root.children];for(let n of e)this.destroySceneObjectTreeItem(n)}};f(Dn,"defaultCreateSceneObjectFunc",HO),f(Dn,"defaultCreateTreeItemDragDropFunc",XO),f(Dn,"defaultPreload",KO),f(Dn,"defaultGetSceneObjectShow",$O),f(Dn,"defaultSetSceneObjectShow",YO),f(Dn,"defaultGetSceneTreeItemCloneNameFunc",tD);let Rc=Dn;const Mm={saturation:.35,brightness:1.4,gamma:.8,atmosphereScatteringIntensity:5,groundColor:[0,.09411764705882353,.3137254901960784,1]};class iD extends B{constructor(e){super();f(this,"_currentPosition",this.disposeVar(oe(void 0)));f(this,"_currentRotation",this.disposeVar(oe(void 0)));f(this,"_currentHeading",this.disposeVar(z(void 0)));f(this,"_isRotating",this.disposeVar(z(!1)));f(this,"_isGround",this.disposeVar(z(!1)));f(this,"_startPosition",[0,0,0]);f(this,"_startRotation",[0,0,0]);f(this,"_processing",this.disposeVar(Ln(async(e,n,r,s)=>{const{currentPosition:o,currentRotation:a}=this;if(!o||s<=0||!a){this._currentPosition.value=n,this._currentRotation.value=r;return}const l=this._startPosition;l.splice(0,3,...o);const u=this._startRotation;u.splice(0,3,...a);let h=Date.now();const c=Dc(l,n);this._currentHeading.value=c;const g=Mf(l,n)/s,p=[r[0]-u[0],r[1]-u[1],r[2]-u[2]],E=n[2]-l[2];await e.promise(new Promise(b=>{e.disposer.dispose(cd(async()=>{let P=Date.now()-h;P=P<0?0:P,P=P>s?s:P;const v=P*g,_=bm(l,v,c);if(this.isGround&&_){const m=await this._esviewer.getTerrainHeight([_[0],_[1]]);this._currentPosition.value=[_[0],_[1],m??0]}else _&&(_[2]+=E*(P/s)),this._currentPosition.value=_;if(this.isRotating){const[m,y,S]=p,C=P/s;this._currentRotation.value=[u[0]+m*C,u[1]+y*C,u[2]+S*C]}P===s&&(this._currentPosition.value=n,this.isRotating&&(this._currentRotation.value=r),this.isRotating=!1,this.isGround=!1,b())}))}))})));this._esviewer=e}get currentPosition(){return this._currentPosition.value}get currentPositionChanged(){return this._currentPosition.changed}get currentRotation(){return this._currentRotation.value}get currentRotationChanged(){return this._currentRotation.changed}get currentHeading(){return this._currentHeading.value}get currentHeadingChanged(){return this._currentHeading.changed}get isRotating(){return this._isRotating.value}set isRotating(e){this._isRotating.value=e}get isRotatingChanged(){return this._isRotating.changed}get isGround(){return this._isGround.value}set isGround(e){this._isGround.value=e}get isGroundChanged(){return this._isGround.changed}get processing(){return this._processing}restart(e,n,r){this._processing.restart(void 0,e,n,r)}cancel(){this._processing.cancel()}}const nD=.06,iE=1.5,nE=2,rE=70,sE=60;function el(i){return Kt(i)}function Ls(i,t,e){const n=el(i),r=hr(n,e,t,{units:"meters"}),[s,o]=kn(r);return[s,o,i[2]]}function Of(i,t){return tu(el(i),el(t))}function Df(i,t,e,n,r=1e3){const s=yi([kn(hr(el(i),r,(t+180)%360,{units:"meters"})),i,kn(hr(el(i),r,t,{units:"meters"}))]),o=yi([kn(hr(el(e),r,(n+180)%360,{units:"meters"})),e,kn(hr(el(e),r,n,{units:"meters"}))]),a=Fa(s,o);if(a.features.length>0){const[l,u]=kn(a.features[0]);return[l,u,(i[2]+e[2])/2]}return e}function oE(i,t,e,n){const r=(e-90+360)%360,s=(e+90+360)%360;i.leftPoints.push(Ls(t,r-rE,n*iE)),i.headPoints.push(Ls(t,r-sE,n*nE)),i.headPoints.push(t),i.headPoints.push(Ls(t,s+sE,n*nE)),i.rightPoints.push(Ls(t,s+rE,n*iE))}function rD(i,t,e,n){const r=(t-90+360)%360,s=(t+90+360)%360,o=e*nD*Math.min(.3,1-n);return{leftPoint:Ls(i,r,o),rightPoint:Ls(i,s,o),verticalLen:o}}function sD(i,t){if(!i||i.length<2)return;const e=t==="swallowTailArrow",n=i.length,r=n-1,s=Math.max(..._o(i,"NONE")),o={leftPoints:[],rightPoints:[],headPoints:[]};let a;for(let g=0;g<n;g++){const p=i[g],E=g==r?i[i.length-2]:i[g+1],b=g==r?Of(E,p):Of(p,E),{leftPoint:P,rightPoint:v,verticalLen:_}=rD(p,b,s,g/n);g===0?(o.leftPoints.push(P),o.rightPoints.push(v),e&&(o.tailPoint=Ls(p,b,_))):g===r?oE(o,p,b,_):a!==void 0?(o.leftPoints.push(Df(o.leftPoints[g-1],a,P,b,s)),o.rightPoints.push(Df(o.rightPoints[g-1],a,v,b,s))):(o.leftPoints.push(P),o.rightPoints.push(v)),a=b}const l=o.leftPoints,u=o.rightPoints,h=l.length>=2?Tu(l):l,c=u.length>=2?Tu(u):u,d=[...h,...o.headPoints,...c.reverse()];return o.tailPoint&&d.push(o.tailPoint),d.push(o.leftPoints[0]),d}function oD(i,t,e,n){const r=yi([[i[0],i[1]],[t[0],t[1]]]),s=yi([[e[0],e[1]],[n[0],n[1]]]);return Fa(r,s).features.length>0}function aD(i,t,e,n){const r=(t-90+360)%360,s=(t+90+360)%360,o=e*Math.min(.3,1-n);return{leftPoint:Ls(i,r,o),rightPoint:Ls(i,s,o),verticalLen:o}}function lD(i,t){if(!i||i.length<3)return;const e=t==="swallowTailArrow",n=i.length,r=n-1,s=i.slice(0,2),o=Tf(s),a=_o(s,"NONE").pop()??0,l=Math.max(..._o(i,"NONE")),u={leftPoints:[],rightPoints:[],headPoints:[]};let h;for(let b=1;b<n;b++){const P=b===1?o.center:i[b],v=b===r?i[n-2]:i[b+1],_=b===r?Of(v,P):Of(P,v);let{leftPoint:m,rightPoint:y,verticalLen:S}=aD(P,_,a,b/n);if(b===1)u.leftPoints.push(s[0]),u.rightPoints.push(s[1]),e&&(u.tailPoint=Ls(P,_,a));else if(b===r)oE(u,P,_,S);else if(h!==void 0){if(b===2&&oD(u.leftPoints[0],m,u.rightPoints[0],y)){const x=u.leftPoints[0];u.leftPoints[0]=u.rightPoints[0],u.rightPoints[0]=x}const C=b-2;u.leftPoints.push(Df(u.leftPoints[C],h,m,_,l)),u.rightPoints.push(Df(u.rightPoints[C],h,y,_,l))}else u.leftPoints.push(m),u.rightPoints.push(y);h=_}let c=u.leftPoints,d=u.rightPoints;const g=c.length>=2?Tu(c):c,p=d.length>=2?Tu(d):d,E=[...g,...u.headPoints,...p.reverse()];return u.tailPoint&&E.push(u.tailPoint),E.push(c[0]),E}function Tm(i,t,e=!1){return e?lD(i,t):sD(i,t)}function aE(i){let t=0;function e(n,r){r++,t=Math.max(r,t),n.forEach(s=>{Array.isArray(s)&&e(s,r)})}return e(i,0),t}const Vs=class Vs extends Xt{constructor(e){super(e);f(this,"editingBindMode","lineString");f(this,"_area",this.dv(z(0)));f(this,"_perimeter",this.dv(z(0)));this.d(Ze(this.pointsChanged,()=>{this._updateArea(),this._updatePerimeter()},{immediate:!0}))}updateEditing(){var n;const e=[];this.editingBindMode=="doublePoints"?e.push(nt.DoublePoints):this.editingBindMode=="lineString"?e.push(nt.LineStringAppend,nt.LineStringInsert,nt.Translation):this.editingBindMode=="circular"?(e.push(nt.CircularAppend,nt.CircularInsert,nt.Translation),this.supportEditingModes().includes(nt.HeightModify)&&e.push(nt.HeightModify)):this.editingBindMode=="visibility"?e.push(nt.VisibilityAppend,nt.VisibilityModify):this.editingBindMode=="scatter"&&e.push(nt.ScatterAppend,nt.ScatterModify),(n=this.activeViewer)==null||n.startEditing(this,e,{callSource:"inner"})}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}_updateArea(){this._area.value=this.getArea()??0}_updatePerimeter(){this._perimeter.value=this.getPerimeter()??0}getArea(){if(this.points&&this.points.length>=3)return Sm([...this.points])}getDistance(){if(this.points&&this.points.length>=2){const e=_o(this.points,"GEODESIC");return e[e.length-1]}else return}getPerimeter(){if(this.points&&this.points.length>=3){const e=[...this.points,this.points[0]],n=_o(e,"GEODESIC");return n[n.length-1]}else return}getIntersect(e){if(this.points&&this.points.length>=3&&e.length>=3){const n=U1(this.points,e);if(!n)return;const r=n[0][0][0];if(Array.isArray(r)){const s=[...n],o=[];return s.forEach(a=>{const l=a[0].map(u=>[...u,0]);o.push(l)}),o}else return[[...n][0].map(a=>[...a,0])]}else return}getUnion(e){if(this.points&&this.points.length>=3&&e.length>=3){const n=q1(this.points,e);if(!n)return;const r=n[0][0][0];if(Array.isArray(r)){const s=[...n],o=[];return s.forEach(a=>{const l=a[0].map(u=>[...u,0]);o.push(l)}),o}else return[[...n][0].map(a=>[...a,0])]}else return}getDifference(e){if(this.points&&this.points.length>=3&&e.length>=3){let n=[...e];const r=e[0],s=e[e.length-1];r[0]===s[0]&&r[1]===s[1]&&r[2]===s[2]||n.push(r);const o=H1([...this.points,this.points[0]],[...n]);if(!o)return{status:"undefined",positions:void 0};const a=[...o];if(aE(a)===3){const l=a.map(d=>d.map(g=>[...g,0]));if(l.length<=1)return{status:"notIncluded",positions:l};const u=l[0],h=l[1];return Cm([...u],[...h])==="oneBig"?{status:"included",positions:l}:{status:"notIncluded",positions:l}}else if(aE(a)===4){const u=[...a.map(c=>c.map(d=>d.map(g=>[...g,0])))],h=[];return u.forEach(c=>{h.push(c[0])}),{status:"notIncluded",positions:h}}else return{status:"undefined",positions:void 0}}else return{status:"undefined",positions:void 0}}getBuffer(e=500,n){if(this.points&&this.points.length>=2){const r=W1(this.points,e,n);return r?[r[0].map(s=>[...s,0])]:void 0}else return}geoPolygonOverlap(e){if(this.points&&this.points.length>=3&&e.length>=3){const n=Cm(this.points,e);return n==="oneBig"?!0:n==="twoBig"?!1:void 0}else return}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",coordinate:[...e.coordinate,new H([this,"editing"],"编辑",!1),new Ne([this,"points"],"位置数组",Vs.defaults.points,void 0,!0)],style:[...e.style,new wt("点样式"),new H([this,"pointed"],"开启",!1),new D([this,"pointSize"],"点大小",1),new ft([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new Dt([this,"pointColor"],"点颜色",[1,1,1,1]),new Dt([this,"pointOutlineColor"],"轮廓颜色",Vs.defaults.pointStyle.outlineColor),new D([this,"pointOutlineWidth"],"轮廓宽度",Vs.defaults.pointStyle.outlineWidth),new wt("线样式"),new H([this,"stroked"],"开启线样式",!0),new H([this,"strokeGround"],"贴地",!1),new D([this,"strokeWidth"],"线宽",1),new ft([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new Dt([this,"strokeColor"],"线颜色",[1,1,1,1]),new wt("面样式"),new H([this,"filled"],"开启",!1),new H([this,"fillGround"],"贴地",!1),new Dt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...e.more,new wt("点样式集合"),new mt([this,"pointMaterial"],"点材质"),new Et([this,"pointMaterialParams"],"点材质参数",{}),new wt("线样式集合"),new mt([this,"strokeMaterial"],"线材质"),new Et([this,"strokeMaterialParams"],"线材质参数",{}),new wt("面样式集合"),new mt([this,"fillMaterial"],"面材质"),new Et([this,"fillMaterialParams"],"面材质参数",{})]}}get pointSize(){return this.pointStyle.size}set pointSize(e){this.pointStyle={...this.pointStyle,size:e}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(e){this.pointStyle={...this.pointStyle,sizeType:e}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(e){this.pointStyle={...this.pointStyle,color:[...e]}}get pointColorChanged(){return this.pointStyleChanged}get pointOutlineColor(){return this.pointStyle.outlineColor}set pointOutlineColor(e){this.pointStyle={...this.pointStyle,outlineColor:[...e]}}get pointOutlineColorChanged(){return this.pointStyleChanged}get pointOutlineWidth(){return this.pointStyle.outlineWidth}set pointOutlineWidth(e){this.pointStyle={...this.pointStyle,outlineWidth:e}}get pointOutlineWidthChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(e){this.pointStyle={...this.pointStyle,material:e}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(e){this.pointStyle={...this.pointStyle,materialParams:e}}get pointMaterialParamsChanged(){return this.pointStyleChanged}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(e){this.strokeStyle={...this.strokeStyle,width:e}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(e){this.strokeStyle={...this.strokeStyle,widthType:e}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(e){this.strokeStyle={...this.strokeStyle,color:[...e]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(e){this.strokeStyle={...this.strokeStyle,material:e}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(e){this.strokeStyle={...this.strokeStyle,materialParams:e}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(e){this.strokeStyle={...this.strokeStyle,ground:e}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(e){this.fillStyle={...this.fillStyle,color:[...e]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(e){this.fillStyle={...this.fillStyle,material:e}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(e){this.fillStyle={...this.fillStyle,materialParams:e}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(e){this.fillStyle={...this.fillStyle,ground:e}}get fillGroundChanged(){return this.fillStyleChanged}};f(Vs,"createDefaultProps",()=>({...Xt.createDefaultProps(),pointed:!1,pointStyle:bt({size:10,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),stroked:!1,strokeStyle:bt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:bt({color:[1,1,1,1],material:"",materialParams:{},ground:!1}),points:Pa([])})),f(Vs,"type",Vs.register("ESGeoVector",Vs,{chsName:"地理矢量",tags:["ESObjects"],description:"地理矢量"})),f(Vs,"supportEditingModes",[...Xt.supportEditingModes,nt.Translation]);let Ot=Vs;const hl=class hl extends Xt{constructor(){super(...arguments);f(this,"_statusDis",this.dv(z(!0)));f(this,"_smoothMoveEvent",this.dv(new O));f(this,"_smoothMoveWithRotationEvent",this.dv(new O));f(this,"_smoothMoveOnGroundEvent",this.dv(new O));f(this,"_smoothMoveWithRotationOnGroundEvent",this.dv(new O));f(this,"_automaticLandingEvent",this.dv(new O));f(this,"_smoothMoveKeepPitchEvent",this.dv(new O));f(this,"_smoothMoveRelativelyEvent",this.dv(new O));f(this,"_smoothMoveRelativelyWithRotationEvent",this.dv(new O));f(this,"useCalcFlyToParamInESObjectWithLocation",!0)}updateEditing(){var n;const e=[];this.editingBindMode=="singlePoint"?(e.push(nt.SinglePoint),["ESLocationMeasurement"].includes(this.typeName)||e.push(nt.Rotation),["ESClippingPlane","ESLocationMeasurement","ESLocalRectangle","ESBoxClipping"].includes(this.typeName)||e.push(nt.Scale)):this.editingBindMode=="doublePoints"&&e.push(nt.DoublePoints),(n=this.activeViewer)==null||n.startEditing(this,e,{callSource:"inner"})}get statusDis(){return this._statusDis.value}get statusDisChanged(){return this._statusDis.changed}get smoothMoveEvent(){return this._smoothMoveEvent}smoothMove(e,n){this._smoothMoveEvent.emit(e,n)}get smoothMoveWithRotationEvent(){return this._smoothMoveWithRotationEvent}smoothMoveWithRotation(e,n,r){this._smoothMoveWithRotationEvent.emit(e,n,r)}get smoothMoveOnGroundEvent(){return this._smoothMoveOnGroundEvent}smoothMoveOnGround(e,n,r,s){this._smoothMoveOnGroundEvent.emit(e,n,r,s)}get smoothMoveWithRotationOnGroundEvent(){return this._smoothMoveWithRotationOnGroundEvent}smoothMoveWithRotationOnGround(e,n,r,s,o){this._smoothMoveWithRotationOnGroundEvent.emit(e,n,r,s,o)}get automaticLandingEvent(){return this._automaticLandingEvent}automaticLanding(){const e=this.collision;this.collision=!1,setTimeout(()=>{this._automaticLandingEvent.emit(e)},100)}get smoothMoveKeepPitchEvent(){return this._smoothMoveKeepPitchEvent}smoothMoveKeepPitch(e,n){this._smoothMoveKeepPitchEvent.emit(e,n)}get smoothMoveRelativelyEvent(){return this._smoothMoveRelativelyEvent}smoothMoveRelatively(e,n){this._smoothMoveRelativelyEvent.emit(e,n)}get smoothMoveRelativelyWithRotationEvent(){return this._smoothMoveRelativelyWithRotationEvent}smoothMoveRelativelyWithRotation(e,n,r){this._smoothMoveRelativelyWithRotationEvent.emit(e,n,r)}getESProperties(){const e={...super.getESProperties()},n=[...e.location,new H([this,"editing"],"是否编辑"),new vt("自动落地",this.automaticLanding.bind(this),[]),new _s([this,"position"],"位置数组",[0,0,0]),new Ah([this,"rotation"],"姿态数组",[0,0,0]),new ci([this,"scale"],"缩放",[1,1,1]),new D([this,"minVisibleDistance"],"最小可见距离",0),new D([this,"maxVisibleDistance"],"最大可见距离",0)];return["ESHuman","ESGltfModel","ESFountainParticleSystem","ESHumanFountain"].includes(this.typeName)&&n.push(new ci([this,"positionOffset"],"位置偏移",[0,0,0])),{...e,defaultMenu:"basic",location:n,more:[...e.more,new vt("平滑移动",this.smoothMove.bind(this),[[0,0,0],0]),new vt("固定方向平滑移动",this.smoothMoveKeepPitch.bind(this),[[0,0,0],0]),new vt("平滑偏移",this.smoothMoveWithRotation.bind(this),[[0,0,0],[0,0,0],0]),new vt("贴地平滑移动",this.smoothMoveOnGround.bind(this),[0,0,0,""]),new vt("贴地平滑偏移",this.smoothMoveWithRotationOnGround.bind(this),[[0,0,0],0,0,0,""]),new vt("相对平滑移动",this.smoothMoveRelatively.bind(this),[[0,0,0],0]),new vt("相对平滑偏移",this.smoothMoveRelativelyWithRotation.bind(this),[[0,0,0],[0,0,0],0]),new H([this,"enableVisibleDistance"],"是否应用距离显隐")]}}get pointSize(){return this.pointStyle.size}set pointSize(e){this.pointStyle={...this.pointStyle,size:e}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(e){this.pointStyle={...this.pointStyle,sizeType:e}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(e){this.pointStyle={...this.pointStyle,color:[...e]}}get pointColorChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(e){this.pointStyle={...this.pointStyle,material:e}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(e){this.pointStyle={...this.pointStyle,materialParams:e}}get pointMaterialParamsChanged(){return this.pointStyleChanged}};f(hl,"createDefaultProps",()=>({...Xt.createDefaultProps(),pointed:!1,pointStyle:bt({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),position:ot([0,0,0]),rotation:ot([0,0,0]),positionOffset:ot([0,0,0]),scale:ot([1,1,1]),minVisibleDistance:z(0),maxVisibleDistance:z(0)})),f(hl,"type",hl.register("ESObjectWithLocation",hl,{chsName:"对象位置",tags:["ESObjects"],description:"对象位置"})),f(hl,"supportEditingModes",[...Xt.supportEditingModes,nt.SinglePoint,nt.Place,nt.Translation,nt.Rotation,nt.Scale,nt.DoublePoints,nt.DoublePointsAppend,nt.DoublePointsModify]);let ct=hl;const Bu=class Bu extends ct{getESProperties(){const t={...super.getESProperties()};return{...t,style:[...t.style,new wt("点样式集合"),new H([this,"pointed"],"开启点样式",!1),new D([this,"pointSize"],"点大小",1),new ft([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new Dt([this,"pointColor"],"点颜色",[1,1,1,1]),new wt("线样式集合"),new H([this,"stroked"],"开启线样式",!1),new H([this,"strokeGround"],"是否贴地(线)",!1),new D([this,"strokeWidth"],"线宽",1),new ft([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new Dt([this,"strokeColor"],"线颜色",[1,1,1,1]),new wt("面样式集合"),new H([this,"filled"],"开启填充样式",!1),new H([this,"fillGround"],"是否贴地",!1),new Dt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...t.more,new wt("点样式"),new mt([this,"pointMaterial"],"点材质",""),new Et([this,"pointMaterialParams"],"点材质参数",{}),new wt("线样式"),new mt([this,"strokeMaterial"],"线材质",""),new Et([this,"strokeMaterialParams"],"线材质参数",{}),new wt("填充样式"),new mt([this,"fillMaterial"],"面材质",""),new Et([this,"fillMaterialParams"],"面材质参数",{})]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(t){this.strokeStyle={...this.strokeStyle,width:t}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(t){this.strokeStyle={...this.strokeStyle,widthType:t}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(t){this.strokeStyle={...this.strokeStyle,color:[...t]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(t){this.strokeStyle={...this.strokeStyle,material:t}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(t){this.strokeStyle={...this.strokeStyle,materialParams:t}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(t){this.strokeStyle={...this.strokeStyle,ground:t}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(t){this.fillStyle={...this.fillStyle,color:[...t]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle,materialParams:t}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(t){this.fillStyle={...this.fillStyle,ground:t}}get fillGroundChanged(){return this.fillStyleChanged}};f(Bu,"createDefaultProps",()=>({...ct.createDefaultProps(),pointed:!1,pointStyle:bt({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:1}),stroked:!1,strokeStyle:bt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:bt({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(Bu,"type",Bu.register("ESLocalVector",Bu,{chsName:"本地矢量",tags:["ESObjects"],description:"本地矢量对象"}));let Nu=Bu;const nd=class nd extends Nu{};f(nd,"type",nd.register("ESLocalVector2D",nd,{chsName:"本地矢量2D",tags:["ESObjects"],description:"本地矢量2D对象"}));let wo=nd;const uD=[["固定朝向",0],["面向屏幕旋转",1],["绕自身Z轴旋转",2]],hD=[["单面不透明",0],["双面不透明",1],["单面遮罩",2],["双面遮罩",3],["单面透明",4],["双面透明",5],["单面未遮挡透明",6],["双面未遮挡透明",7]],Uu=class Uu extends ct{constructor(){super(...arguments);f(this,"_widgetEvent",this.dv(new O))}get widgetEvent(){return this._widgetEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new H([this,"screenRender"],"屏幕渲染",!0),new H([this,"sizeByContent"],"尺寸自适应",!0),new Ke([this,"size"],"尺寸大小",[100,100]),new Ke([this,"anchor"],"偏移比例",[.5,1]),new Ke([this,"offset"],"像素偏移",[0,0]),new ft([this,"renderMode"],hD,"渲染模式",0),new ft([this,"rotationType"],uD,"漫游旋转类型",1),new mt([this,"actorTag"],"绑定对象"),new mt([this,"socketName"],"插槽名称"),new ci([this,"positionOffset"],"位置偏移"),new ci([this,"rotationOffset"],"相对姿态")],more:[...e.more,new D([this,"zOrder"],"排序",0)]}}};f(Uu,"createDefaultProps",()=>({...ct.createDefaultProps(),screenRender:!0,size:ot([100,100]),anchor:ot([.5,1]),offset:ot([0,0]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,actorTag:"",socketName:"",positionOffset:ot([0,0,0]),rotationOffset:ot([0,0,0])})),f(Uu,"type",Uu.register("ESLabel",Uu,{chsName:"标签",tags:["ESObjects"],description:"标签对象"}));let Yn=Uu;const Ge=class Ge extends pt{constructor(t){super(t)}func(t,e=!0){t.includes("completeJson")&&console.log("ESTestObject.completeJson",this.completeJson),t.includes("json")&&console.log("ESTestObject.json",this.json),e&&console.log("ESTestObject func")}func1(t,e){t.includes("completeJson")&&console.log("ESTestObject.completeJson",this.completeJson),t.includes("json")&&console.log("ESTestObject.json",this.json),e&&console.log("ESTestObject func")}getESProperties(){return{defaultMenu:"basic",basic:[new mt([this,"typeName"],"类型",void 0,!1,!0),new mt([this,"id"],"id",void 0,!1,!0),new mt([this,"name"],"名称"),new mt([this,"ref"],"引用",void 0,!0),new Et([this,"extras"],"扩展属性",{},void 0,!0),new Qg("JSON",()=>this._jsonStr,t=>t&&(this._jsonStr=t))],general:[new H([this,"show"],"是否显示",Ge.defaults.show),new Dt([this,"color"],"颜色",Ge.defaults.color),new ft([this,"paramType"],[["screen","screen"],["world","world"]],"参数类型",Ge.defaults.paramType),new bd([this,"text"],"内容",Ge.defaults.text)],dataSource:[new ys([this,"startTime"],"开始时间",Ge.defaults.startTime),new io([this,"code"],"js代码",Ge.defaults.code),new Kg([this,"times"],"时间组",Ge.defaults.times),new mt([this,"url"],"服务地址",Ge.defaults.url),new vt("func",this.func.bind(this),[["completeJson","json"]]),new vt("func1",(t,e)=>this.func1(t,e),[["completeJson","json"],!0])],location:[new ci([this,"positionOffset"],"位置偏移",Ge.defaults.positionOffset),new _s([this,"position"],"位置数组",Ge.defaults.position),new Ah([this,"rotation"],"姿态数组",Ge.defaults.rotation)],coordinate:[new D([this,"height"],"高度(m)",Ge.defaults.height),new Ne([this,"points"],"位置数组",Ge.defaults.points)],style:[new rr([this,"padding"],"内边距",Ge.defaults.padding),new Ke([this,"offset"],"像素偏移",Ge.defaults.offset),new wt("样式"),new Py([this,"dashPattern"],"虚线图案",255),new wt("样式2"),new Dt([this,"color"],"颜色",Ge.defaults.color),new Et([this,"strokeStyle"],"线样式参数",Ge.defaults.strokeStyle)],more:[]}}};f(Ge,"createDefaultProps",()=>({...pt.createDefaultProps(),show:!0,url:"http://localhost:8080/earthsdk3/earthsdk3.gltf",height:100,position:ot([116.39,39.9,100]),rotation:ot([0,-90,0]),points:Pa([]),color:ot([1,0,0,1]),strokeStyle:bt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),paramType:"screen",text:"默认",code:'console.log("hello world")',dashPattern:255,startTime:Date.now(),times:ot([]),offset:ot([10,0]),positionOffset:ot([0,2,0]),padding:ot([0,2,0,2])})),f(Ge,"type",Ge.register("ESTestObject",Ge,{chsName:"测试",tags:["ESObjects"],description:""}));let Nm=Ge;const zs=class zs extends Xt{constructor(e){super(e);f(this,"_refreshTilesetEvent",this.dv(new O));f(this,"_tilesetReadyEvent",this.dv(new O));f(this,"_supportEdit",this.dv(z(!0)));f(this,"_highlightFeatureEvent",this.dv(new O));f(this,"_highlightFeatureAndFlyToEvent",this.dv(new O));f(this,"_strokeFeatureEvent",this.disposeVar(new O));f(this,"_getFeatureTableEvent",this.dv(new O));f(this,"_featureTableResultEvent",this.dv(new O));f(this,"_getMaterialNameListEvent",this.disposeVar(new O));f(this,"_setFeatureStyleEvent",this.dv(new O));f(this,"_setFeatureColorEvent",this.dv(new O));f(this,"_setFeatureVisableEvent",this.dv(new O));f(this,"_resetFeatureStyleEvent",this.dv(new O));f(this,"setMaterialInfoEvent",this.ad(new O));f(this,"_setMaterialEvent",this.disposeVar(new O));f(this,"_clippingPlanesId",this.dv(z("")));f(this,"_clippingPlaneIds",this.dv(z([])));f(this,"_flattenedPlaneId",this.dv(z("")));f(this,"_flattenedPlaneEnabled",this.dv(z(!1)));f(this,"_clippingPlaneId",this.dv(z("")));f(this,"_excavateId",this.dv(ot([])))}updateEditing(){var e;(e=this.activeViewer)==null||e.startEditing(this,[nt.Translation,nt.Rotation],{callSource:"inner"})}get refreshTilesetEvent(){return this._refreshTilesetEvent}refreshTileset(){this._refreshTilesetEvent.emit()}get tilesetReady(){return this._tilesetReadyEvent}get supportEdit(){return this._supportEdit.value}set supportEdit(e){this._supportEdit.value=e}get supportEditChanged(){return this._supportEdit.changed}get highlightFeatureEvent(){return this._highlightFeatureEvent}highlightFeature(e,n){this._highlightFeatureEvent.emit(e,n)}get highlightFeatureAndFlyToEvent(){return this._highlightFeatureAndFlyToEvent}highlightFeatureAndFlyTo(e,n,r,s){this._highlightFeatureAndFlyToEvent.emit(e,n,r,s)}get strokeFeatureEvent(){return this._strokeFeatureEvent}strokeFeature(e,n=[1,0,0,1]){this._strokeFeatureEvent.emit(e,n)}get getFeatureTableEvent(){return this._getFeatureTableEvent}getFeatureTable(){return Promise.race([new Promise(e=>{const n=this.d(this._featureTableResultEvent.donce(e));this._getFeatureTableEvent.emit(),setTimeout(()=>{n(),e(void 0)},2e3)})])}get getMaterialNameListEvent(){return this._getMaterialNameListEvent}getMaterialNameList(){return new Promise(e=>{const n=new B;n.d(this.getMaterialNameListEvent.don(r=>{r!=="start"&&(n.destroy(),e(r))})),this.getMaterialNameListEvent.emit("start"),setTimeout(()=>{n.isDestroyed()||(n.destroy(),e(void 0))},2e3)})}get setFeatureStyleEvent(){return this._setFeatureStyleEvent}setFeatureStyle(e,n=!1){this._setFeatureStyleEvent.emit(e,n)}get setFeatureColorEvent(){return this._setFeatureColorEvent}setFeatureColor(e,n,r=!1){this._setFeatureColorEvent.emit(e,typeof n=="string"?JSON.parse(n):n,r)}get setFeatureVisableEvent(){return this._setFeatureVisableEvent}setFeatureVisable(e,n,r=!1){this._setFeatureVisableEvent.emit(e,typeof n=="string"?JSON.parse(n):n,r)}get resetFeatureStyleEvent(){return this._resetFeatureStyleEvent}resetFeatureStyle(e){this._resetFeatureStyleEvent.emit(e)}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){return new Promise(n=>{const r=new B;r.ad(this.setMaterialInfoEvent.donce(s=>{r.destroy(),n(s)})),this._setMaterialEvent.emit(e)})}get clippingPlanesId(){return this._clippingPlanesId.value}set clippingPlanesId(e){this._clippingPlanesId.value=e}get clippingPlanesIdChanged(){return this._clippingPlanesId.changed}get clippingPlaneIds(){return this._clippingPlaneIds.value}set clippingPlaneIds(e){this._clippingPlaneIds.value=e}get clippingPlaneIdsChanged(){return this._clippingPlaneIds.changed}get flattenedPlaneId(){return this._flattenedPlaneId.value}set flattenedPlaneId(e){this._flattenedPlaneId.value=e}get flattenedPlaneIdChanged(){return this._flattenedPlaneId.changed}get flattenedPlaneEnabled(){return this._flattenedPlaneEnabled.value}set flattenedPlaneEnabled(e){this._flattenedPlaneEnabled.value=e}get flattenedPlaneEnabledChanged(){return this._flattenedPlaneEnabled.changed}get clippingPlaneId(){return this._clippingPlaneId.value}set clippingPlaneId(e){this._clippingPlaneId.value=e}get clippingPlaneIdChanged(){return this._clippingPlaneId.changed}get excavateId(){return this._excavateId.value}set excavateId(e){this._excavateId.value=e}get excavateIdChanged(){return this._excavateId.changed}setLight122(){this.czmEnvironmentMapManager={...Mm}}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new Qe([this,"maximumScreenSpaceError"],1,[0,256],"精度",16),new ft([this,"materialMode"],[["常规","normal"],["科技感","technology"]],"材质模式","normal",!0),new ft([this,"colorBlendMode"],[["默认","HIGHLIGHT"],["替换","REPLACE"],["混合","MIX"]],"颜色模式","HIGHLIGHT"),new Et([this,"materialOverrideMap"],"材质替换",zs.defaults.materialOverrideMap)],dataSource:[...e.dataSource,new Et([this,"url"],"服务地址",zs.defaults.url,void 0,!0)],coordinate:[...e.coordinate,new H([this,"editing"],"编辑",!1,!0),new ci([this,"offset"],"偏移",[0,0,0],!0),new Ah([this,"rotation"],"旋转",[0,0,0])],more:[...e.more,new Et([this,"materialParams"],"materialParams",zs.defaults.materialParams),new vt("高亮要素",this.highlightFeature.bind(this),["id_value","rgba(255,0,0,1)"],"highlightFeature"),new vt("高亮并且定位到要素",this.highlightFeatureAndFlyTo.bind(this),["id_value",[1116.39,39.9,100,1e3],"rgba(255,0,0,1)",1],"highlightFeatureAndFlyTo"),new vt("要素着色控制",this.setFeatureColor.bind(this),["height",[{minValue:1e5,color:[1,0,0,1]},{maxValue:5e5,color:[1,1,0,1]}]],"setFeatureColor"),new vt("要素可见性控制",this.setFeatureVisable.bind(this),["height",[{minValue:1e5,visable:!0},{maxValue:5e5,visable:!1}]],"setFeatureVisable"),new vt("重置样式",()=>this.resetFeatureStyle(),[],"resetFeatureStyle"),new wt("ue"),new vt("刷新 tileset",()=>this.refreshTileset(),[],"refreshTileset"),new mt([this,"actorTag"]),new H([this,"highlight"],"是否高亮"),new Dt([this,"highlightColor"]),new D([this,"highlightID"]),new wt("czm"),new Ke([this,"czmImageBasedLightingFactor"],"反射强度"),new D([this,"czmAtmosphereScatteringIntensity"],"大气散射强度"),new Et([this,"czmEnvironmentMapManager"],"动态环境贴图管理器"),new D([this,"czmMaximumMemoryUsage"],"最大内存"),new wt("常用"),new ft([this,"czmClassificationType"],[["NONE","NONE"],["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]],"czmClassificationType","NONE",!0),new Et([this,"czmStyleJson"],"czmStyle"),new H([this,"czmBackFaceCulling"]),new H([this,"czmSkipLevelOfDetail"]),new H([this,"czmDebugWireframe"]),new D([this,"cacheBytes"],"最大缓存",536870912),new wt("调试信息"),new H([this,"czmDebugShowBoundingVolume"]),new H([this,"czmDebugShowContentBoundingVolume"]),new wt("裁剪"),new H([this,"clippingPlaneEnabled"]),new H([this,"unionClippingRegions"]),new Dt([this,"clippingPlaneEdgeColor"]),new D([this,"clippingPlaneEdgeWidth"])]}}};f(zs,"createDefaultProps",()=>({...Xt.createDefaultProps(),url:"",actorTag:"",materialMode:"normal",highlight:!1,maximumScreenSpaceError:16,highlightID:0,highlightColor:ot([1,0,0,1]),offset:oe([0,0,0]),rotation:ot([0,0,0]),czmImageBasedLightingFactor:ot([1,1]),czmEnvironmentMapManager:fe(void 0),czmLuminanceAtZenith:2,czmAtmosphereScatteringIntensity:2,czmMaximumMemoryUsage:512,czmClassificationType:"NONE",czmStyleJson:bt({}),czmBackFaceCulling:!0,czmDebugShowBoundingVolume:!1,czmDebugShowContentBoundingVolume:!1,czmSkipLevelOfDetail:!1,cacheBytes:536870912,colorBlendMode:"HIGHLIGHT",clippingPlaneEnabled:!0,unionClippingRegions:!0,clippingPlaneEdgeColor:ot([1,1,1,1]),clippingPlaneEdgeWidth:2,materialParams:{baseColor:[0,.5,1]},allowPicking:!0,materialOverrideMap:fe({}),featureIdLabel:0,splitDirection:"NONE",czmDebugWireframe:!1})),f(zs,"type",zs.register("ES3DTileset",zs,{chsName:"3DTileset",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"3DTileset"})),f(zs,"supportEditingModes",[...Xt.supportEditingModes,nt.Translation,nt.Rotation]);let Jn=zs;const qu=class qu extends ct{constructor(e){super(e);f(this,"_isFlyInCreated",this.dv(z(!1)));this.collision=!1,this.d(this.createdEvent.don(()=>{setTimeout(()=>{if((this.editing??!1)||!this.position)this.d(Ze([this.positionChanged,this.editingChanged],()=>{this.editing||!this.position||this.isFlyInCreated&&this.flyTo()},{time:"donce"}));else{if(!this.isFlyInCreated)return;this.flyTo()}},1e3)}))}get isFlyInCreated(){return this._isFlyInCreated.value}set isFlyInCreated(e){this._isFlyInCreated.value=e}get isFlyInCreatedChanged(){return this._isFlyInCreated.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ft([this,"mode"],[["柱状警告","cylinder"],["圆形警告","circle"]],"模式","cylinder"),new D([this,"radius"],"半径",10)]}}};f(qu,"createDefaultProps",()=>({...ct.createDefaultProps(),mode:"cylinder",radius:10})),f(qu,"type",qu.register("ESAlarm",qu,{chsName:"报警",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警告类"}));let Om=qu;const cD=[["扫描","scan"],["扩散","diffuse"]],fa=class fa extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new D([this,"radius"],"半径",1),new ft([this,"mode"],cD,"模式",fa.defaults.mode),new Dt([this,"color"],"颜色",fa.defaults.color)]}}};f(fa,"createDefaultProps",()=>({...ct.createDefaultProps(),radius:1,mode:"scan",color:[0,.7,1,1],collision:!1})),f(fa,"type",fa.register("ESApertureEffect",fa,{chsName:"光圈特效",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"光圈特效"}));let Dm=fa;const dD=Object.entries({inner:"inner",outer:"outer",both:"both"}),vn=class vn extends Ot{constructor(e){super(e);f(this,"editingBindMode","circular")}get bufferShow(){var e;return(e=this.buffer)==null?void 0:e.show}set bufferShow(e){this.buffer={...this.buffer,show:e}}get bufferShowChanged(){return this.bufferChanged}get bufferColor(){var e;return(e=this.buffer)==null?void 0:e.color}set bufferColor(e){this.buffer={...this.buffer,color:e}}get bufferColorChanged(){return this.bufferChanged}get bufferGradient(){var e;return(e=this.buffer)==null?void 0:e.gradient}set bufferGradient(e){this.buffer={...this.buffer,gradient:e}}get bufferGradientChanged(){return this.bufferChanged}get bufferDistance(){var e;return(e=this.buffer)==null?void 0:e.distance}set bufferDistance(e){this.buffer={...this.buffer,distance:e}}get bufferDistanceChanged(){return this.bufferChanged}get bufferMode(){var e;return(e=this.buffer)==null?void 0:e.mode}set bufferMode(e){this.buffer={...this.buffer,mode:e}}get bufferModeChanged(){return this.bufferChanged}get bufferLight(){var e;return(e=this.buffer)==null?void 0:e.light}set bufferLight(e){this.buffer={...this.buffer,light:e}}get bufferLightChanged(){return this.bufferChanged}getESProperties(){const e={...super.getESProperties()};return{...e,style:[...e.style,new ft([this,"classificationType"],tp,"贴地附着目标",vn.defaults.classificationType),new H([this,"instancing"],"实例化渲染",vn.defaults.instancing),new H([this,"bufferShow"],"缓冲区显隐",vn.defaults.buffer.show),new Dt([this,"bufferColor"],"缓冲区颜色",vn.defaults.buffer.color),new H([this,"bufferLight"],"缓冲区光照",vn.defaults.buffer.light),new D([this,"bufferDistance"],"缓冲区距离",vn.defaults.buffer.distance),new ft([this,"bufferMode"],dD,"缓冲区模式",vn.defaults.buffer.mode),new H([this,"bufferGradient"],"缓冲区渐变",vn.defaults.buffer.gradient)],coordinate:[...e.coordinate,new D([this,"area"],"面积",0,!1,!0),new D([this,"perimeter"],"周长",0,!1,!0)]}}};f(vn,"createDefaultProps",()=>({...Ot.createDefaultProps(),buffer:bt({show:!1,color:[0,0,0,.8],gradient:!0,distance:100,mode:"outer",light:!1}),classificationType:"TERRAIN",instancing:!1,fillStyle:bt({color:[1,1,1,.5],material:"",materialParams:{},ground:!1}),strokeStyle:bt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!0,stroked:!1,collision:!1})),f(vn,"type",vn.register("ESGeoPolygon",vn,{chsName:"地理多边形",tags:["ESObjects"],description:"地理多边形"})),f(vn,"supportEditingModes",[...Ot.supportEditingModes,nt.CircularAppend,nt.CircularInsert]);let Jt=vn;const Co=class Co extends Jt{get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialParams(){return this.fillStyle?this.fillStyle.materialParams:Co.defaults.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle??Co.defaults.fillStyle,materialParams:t??Co.defaults.fillStyle.materialParams}}constructor(t){super(t)}};f(Co,"createDefaultProps",()=>({...Jt.createDefaultProps(),stroked:!0,filled:!0,units:ot(["SquareMeter_SquareKilometer","MU_Hectare","PerimeterMeter_PerimeterKilometer"]),fillStyle:bt({color:[1,1,1,1],material:"Material'/EarthSDKForUE/M_ES_Material.M_ES_Material'",materialParams:{Opacity:.4},ground:!0}),strokeStyle:bt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(Co,"type",Co.register("ESAreaMeasurement",Co,{chsName:"面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"面积测量"}));let Rm=Co;const Wu=class Wu extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"general",more:[...t.more,new wt("czm"),new mt([this,"image"],"图片"),new ci([this,"translation"],"偏移")]}}};f(Wu,"createDefaultProps",()=>({...ct.createDefaultProps(),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",translation:ot([0,0,0])})),f(Wu,"type",Wu.register("ESBlastParticleSystem",Wu,{chsName:"粒子爆炸",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"粒子爆炸"}));let Am=Wu;const ls=class ls extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new H([this,"reverse"],"反转",ls.defaults.reverse),new ci([this,"size"],"尺寸",ls.defaults.size),new Dt([this,"edgeColor"],"边框颜色",ls.defaults.edgeColor),new D([this,"edgeWidth"],"边框宽度",ls.defaults.edgeWidth),new mt([this,"targetID"],"目标图层id",ls.defaults.targetID)]}}};f(ls,"createDefaultProps",()=>({...ct.createDefaultProps(),reverse:!1,edgeColor:ot([1,1,1,1]),edgeWidth:2,size:ot([10,10,10]),targetID:""})),f(ls,"type",ls.register("ESBoxClipping",ls,{chsName:"体剖切",tags:["ESObjects","_ES_Impl_Cesium"],description:"体剖切,体裁剪,体裁切,盒裁切"}));let Lm=ls;const rd=class rd extends ct{constructor(){super(...arguments);f(this,"_thumbnail",this.dv(z("")));f(this,"_duration",this.dv(z(1)));f(this,"_resetWithCurrentCameraEvent",this.dv(new O));f(this,"_captureEvent",this.dv(new O))}get thumbnail(){return this._thumbnail.value}set thumbnail(e){this._thumbnail.value=e}get thumbnailChanged(){return this._thumbnail.changed}get duration(){return this._duration.value}set duration(e){this._duration.value=e}get durationChanged(){return this._duration.changed}flyIn(e=1,n="default"){this.flyInEvent.emit(e,-1,n)}get resetWithCurrentCameraEvent(){return this._resetWithCurrentCameraEvent}resetWithCurrentCamera(){this._resetWithCurrentCameraEvent.emit()}get captureEvent(){return this._captureEvent}capture(e,n){this._captureEvent.emit(e,n)}execOnCreating(){this.resetWithCurrentCamera()}async initByCurrent(){this.resetWithCurrentCamera()}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new wt("视角信息"),new vt("设置为当前视角",()=>this.resetWithCurrentCamera(),[]),new vt("获取缩略图",(n,r)=>this.capture(n,r),[64,64],"capture"),new mt([this,"thumbnail"],"缩略图","",!0),new D([this,"duration"],"飞行时间",1,!0)]}}};f(rd,"type",rd.register("ESCameraView",rd,{chsName:"视角",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角"}));let Rf=rd;class Af extends B{constructor(e,n,r){super();f(this,"_view",this.dv(new Rf));if(this.d(e.components.disposableAdd(this._view)),this._view.name=(r==null?void 0:r.name)??`视角${e.views.length+1}`,n){const a=this._view,l=n;a.duration=l.duration??1,a.position=l.position,a.rotation=l.rotation??[0,0,0],a.thumbnail=l.thumbnail??"",a.name=l.name}else{const a=(r==null?void 0:r.size)??[64,64];this.d(Fl(()=>{this._view.resetWithCurrentCamera(),this._view.capture(a[0],a[1])}))}const s=this._view,o=this.dv(Ve(s.durationChanged,s.positionChanged,s.rotationChanged,s.thumbnailChanged,s.nameChanged));this.d(o.don(()=>e.emitViewsWarpper()))}get view(){return this._view}get viewInfo(){const e=this._view;return{duration:e.duration,position:e.position,rotation:e.rotation,thumbnail:e.thumbnail,name:e.name}}}const Nr=class Nr extends pt{constructor(e){super(e);f(this,"_currentViewIndex",this.dv(z(-1)));f(this,"_viewWrappers",this.dv(new Ph));f(this,"_currentViewWrapper",this.dv(z(void 0)));f(this,"_container",this.dv(z(void 0)));this.initProcessing();{const n=()=>{if(!this._currentViewWrapper.value)return;this._viewWrappers.indexOf(this._currentViewWrapper.value)===-1&&(this._currentViewWrapper.value=void 0)};n(),this.d(this._viewWrappers.changedEvent.don(n))}{const n=()=>{const r=this._currentViewWrapper.value;this._currentViewIndex.value=r?this._getIndex(r):-1};n(),this.d(this._viewWrappers.changedEvent.don(n)),this.d(this._currentViewWrapper.changed.don(n))}this.d(()=>{this.clearAllViews()})}get json(){return{...this._innerGetJson(),views:this.views}}set json(e){this._innerSetJson(e),this.views=e.views}get currentViewIndex(){return this._currentViewIndex.value}get currentViewIndexChanged(){return this._currentViewIndex.changed}emitViewsWarpper(){this._viewWrappers.changedEvent.emit(this._viewWrappers)}get container(){return this._container.value}get containerChanged(){return this._container.changed}set container(e){this._container.value=e}get views(){return J1(this._viewWrappers,e=>e.viewInfo)}get viewsChanged(){return this._viewWrappers.changedEvent}set views(e){if(e.length===this._viewWrappers.length){const n=this._viewWrappers;if(e.every((r,s)=>{const o=n.get(s).view;return r.duration===o.duration&&Nf(r.position,o.position)&&Nf(r.rotation,o.rotation)&&r.thumbnail===o.thumbnail&&r.name===o.name}))return}this.clearAllViews();for(let n of e)this._viewWrappers.push(new Af(this,n))}_getIndex(e){return this._viewWrappers.indexOf(e)}clearAllViews(){for(let e of this._viewWrappers)e.destroy();this._viewWrappers.length=0}add(e=`视角${this.views.length+1}`,n=[64,64]){this._viewWrappers.push(new Af(this,void 0,{name:e,size:n}))}update(e,n,r=[64,64]){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const s=this._viewWrappers.get(e);return n&&(s.view.name=n),s.view.resetWithCurrentCamera(),s.view.capture(r[0],r[1]),!0}addView(){this._viewWrappers.push(new Af(this))}insertView(e){if(this._viewWrappers.length+1<=e||e<0){console.error("this._views.length <= index || index < 0");return}this._viewWrappers.splice(e,0,new Af(this))}setCurrentView(e){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const n=this._viewWrappers.get(e);return this._currentViewWrapper.value=n,!0}resetView(e){if(e>=this._viewWrappers.length||e<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const n=this._viewWrappers.get(e);n.view.resetWithCurrentCamera(),n.view.capture()}resetViewName(e,n){if(e>=this._viewWrappers.length||e<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const r=this._viewWrappers.get(e);r.view.name=n}updateView(e,n){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const r=this._viewWrappers.get(e);return r.view.position=n.position,r.view.rotation=n.rotation??[0,0,0],r.view.duration=n.duration??1,r.view.thumbnail=n.thumbnail??"",r.view.name=n.name??"",!0}flyToView(e){if(this.setCurrentView(e)){if(!this._currentViewWrapper.value)throw new Error("this._currentViewWrapper.value");const n=this._currentViewWrapper.value.view.duration;this._currentViewWrapper.value.view.flyIn(n,this.flyMode??Nr.defaults.flyMode)}}flyToPrevView(){const e=this._currentViewWrapper.value;if(!e)return this.flyToView(0),!0;const n=this._getIndex(e);return this.loop??Nr.defaults.loop?(this.flyToView((this._viewWrappers.length+n-1)%this._viewWrappers.length),!0):n-1<0?!1:(this.flyToView(n-1),!0)}moveToPreView(){const e=this._currentViewWrapper.value;if(!e)return;const n=this._getIndex(e);if(n===0)return;const r=this._viewWrappers.splice(n-1,1,e)[0];this._viewWrappers.set(n,r)}moveToNextView(){const e=this._currentViewWrapper.value;if(!e)return;const n=this._getIndex(e);if(n===this._viewWrappers.length-1)return;const r=this._viewWrappers.splice(n+1,1,e)[0];this._viewWrappers.set(n,r)}flyToNextView(){const e=this._currentViewWrapper.value;if(!e)return this.flyToView(0),!0;const n=this._getIndex(e);return this.loop??Nr.defaults.loop?(this.flyToView((n+1)%this._viewWrappers.length),!0):n+1>this._viewWrappers.length-1?!1:(this.flyToView(n+1),!0)}stop(){this._currentViewWrapper.value=void 0,this.playing=!1}deleteView(e){if(e<0||e>=this._viewWrappers.length){console.warn("index < 0 || index >= this._viewWrappers.length");return}this._viewWrappers.get(e).destroy(),this._viewWrappers.splice(e,1)}deleteCurrentView(){const e=this._currentViewWrapper.value;if(!e){console.warn("!this._currentViewWrapper.value");return}const n=this._getIndex(e);if(n===-1){console.warn("index === -1");return}this.deleteView(n)}transitionImageUrl(e){return pt.context.getStrFromEnv(e)}_flyStep(e){var o;if(!this.flyToNextView())return this.playing=!1,Promise.resolve();const n=this.intervalTime??Nr.defaults.intervalTime,s=((((o=this._currentViewWrapper.value)==null?void 0:o.viewInfo.duration)??0)+n)*1e3;return e.promise(Mh(s)).then(()=>this._flyStep(e))}initProcessing(){const e=this.dv(Ln(async r=>this._flyStep(r))),n=()=>{this.playing?e.restart():e.cancel()};n(),this.d(this.playingChanged.don(n))}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ft([this,"flyMode"],[["默认","default"],["直线飞行","uniform"]],"飞行模式",Nr.defaults.flyMode),new vt("添加视角",()=>this.addView(),[],"addView"),new vt("插入视角",n=>this.insertView(n),[0],"insertView"),new vt("清空视角",()=>this.clearAllViews(),[],"clearAllViews"),new vt("当前位置插入视角",()=>this.insertView(this.currentViewIndex+1),[],"insertView"),new vt("上一个视角",()=>this.flyToPrevView(),[],"flyToPrevView"),new vt("下一个视角",()=>this.flyToNextView(),[],"flyToNextView"),new vt("飞入指定视角",n=>this.flyToView(n),[0],"flyToView"),new vt("更改指定视角为轮播视角",n=>this.setCurrentView(n),[0],"setCurrentView"),new vt("删除当前视角",()=>this.deleteCurrentView(),[],"deleteCurrentView"),new vt("删除指定视角",n=>this.deleteView(n),[0],"deleteView"),new vt("更改指定视角为当前视角信息",n=>this.resetView(n),[0],"resetView"),new D([this,"currentViewIndex"],"当前序号",-1,!1,!0),new xy([this,"playing"],()=>this.stop(),[this,"loop"],"播放",Nr.defaults),new H([this,"playing"],"是否播放"),new vt("停止播放",()=>this.stop(),[],"stop"),new H([this,"loop"],"是否循环"),new D([this,"intervalTime"],"间隔时间"),new Ne([this,"views"],"视角集合",[],void 0,!0)]}}};f(Nr,"createDefaultProps",()=>({...pt.createDefaultProps(),playing:!1,loop:!0,intervalTime:5,flyMode:"default"})),f(Nr,"type",Nr.register("ESCameraViewCollection",Nr,{chsName:"视角集合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角集合"}));let Lf=Nr;const Hu=class Hu extends ct{constructor(e){super(e);f(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new D([this,"aspectRatio"],"宽高比",1.77778),new D([this,"fov"],"横向夹角",90),new D([this,"far"],"视野长度",100),new D([this,"near"],"近面距离",5)]}}};f(Hu,"createDefaultProps",()=>({...ct.createDefaultProps(),fov:90,aspectRatio:1.77778,far:100,near:5,collision:!1})),f(Hu,"type",Hu.register("ESCameraVisibleRange",Hu,{chsName:"摄像头可视域",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"摄像头可视域"}));let Fm=Hu;const Xu=class Xu extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ft([this,"mode"],[["警车","policeCar"]],"模式","policeCar")]}}};f(Xu,"createDefaultProps",()=>({...ct.createDefaultProps(),mode:"policeCar",allowPicking:!0})),f(Xu,"type",Xu.register("ESCar",Xu,{chsName:"车辆",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警车等基础车辆模型"}));let Ff=Xu;const cl=class cl extends Ot{constructor(e){super(e);f(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new D([this,"height"],"高度",10)],coordinate:[...e.coordinate,new D([this,"area"],"面积",0,!1,!0),new D([this,"perimeter"],"周长",0,!1,!0)]}}};f(cl,"createDefaultProps",()=>({...Ot.createDefaultProps(),height:10,filled:!0,fillStyle:bt({material:"",materialParams:{},ground:!0,color:[1,1,1,1]})})),f(cl,"type",cl.register("ESClassification",cl,{chsName:"倾斜单体化",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"平尾箭头"})),f(cl,"supportEditingModes",[...Ot.supportEditingModes,nt.CircularAppend,nt.CircularInsert,nt.HeightModify]);let kf=cl;const $u=class $u extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new H([this,"showArrow"],"显示箭头",!0),new Dt([this,"edgeColor"],"线框颜色",[1,1,1,1]),new D([this,"edgetWidth"],"线框宽度",2),new D([this,"width"],"裁剪宽度",200),new D([this,"height"],"裁剪高度",200),new mt([this,"targetID"],"目标图层id","")]}}};f($u,"createDefaultProps",()=>({...ct.createDefaultProps(),showArrow:!0,edgeColor:ot([1,1,1,1]),edgetWidth:2,width:200,height:200,targetID:""})),f($u,"type",$u.register("ESClippingPlane",$u,{chsName:"裁切",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESClippingPlane"}));let km=$u;class fD extends B{constructor(t,e,n){super();const r=document.createElement("div");r.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${n.id}) container`);{const l=()=>{const h=` ${e.cssText}
49
49
  ${e.cssAllInitial?"all: initial;":""}
50
50
  ${e.show?"":"display: none"}
51
51
  `;r.style.cssText=h};l();const u=this.dv(Ve(e.cssAllInitialChanged,e.cssTextChanged,e.showChanged));this.d(u.don(l))}t.appendChild(r),this.d(()=>t.removeChild(r));const s=this.dv(Ve(e.instanceClassChanged,e.containerChanged,e.shadowDomChanged)),o=this.dv(new qe(s,()=>{const{instanceClass:l,container:u}=e;if(!l||u)return;let h=r;if(r.firstElementChild&&r.removeChild(r.firstElementChild),e.shadowDom){const c=r.appendChild(document.createElement("div"));c.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${n.id}) container shadowDiv`),h=c.attachShadow({mode:"open"}).appendChild(document.createElement("div")),h.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${n.id}) container shadowDiv div`)}return new l(h,e,n)})),{_updateEvent:a}=e;this.d(a.don(l=>{if(o.obj)try{l(o.obj,e,n)}catch(u){console.error(`ESCustomDiv update error! ${u}`)}}))}}const lE=`class MyDiv {
@@ -111,13 +111,13 @@ ${lE}
111
111
  }`;this.instanceClassStr=s};r(),this.d(this.innerHTMLChanged.don(r))}const n=document.createElement("div");n.setAttribute("xe2-div",`ESCustomDiv(${this.id}) container`);{const r=()=>{const o=` ${this.cssText};
112
112
  ${this.cssAllInitial?"all: initial;":""}
113
113
  ${this.show?"":"display: none;"}
114
- `;n.style.cssText=o};r();const s=this.dv(Ve(this.cssAllInitialChanged,this.cssTextChanged,this.showChanged));this.d(s.don(r))}{const r=()=>{if(this.containerId===void 0||this.containerId==="")this.container=void 0;else{const s=document.getElementById(this.containerId);s instanceof HTMLElement?this.container=s:(this.container=void 0,console.warn(`Div from containerId(${this.containerId}) is not HTMLDivElement!`))}};r(),this.d(this.containerIdChanged.don(r))}{class r extends B{constructor(o){super(),o.appendChild(n),this.d(()=>o.removeChild(n))}}this.dv(new qe(this.containerChanged,()=>{if(this.container)return new r(this.container)}))}{const r=this.dv(Ve(this.containerChanged,this.instanceClassChanged,this.shadowDomChanged));this.dv(new qe(r,()=>{if(!this.container||!this.instanceClass)return;let s=n;if(n.firstElementChild&&n.removeChild(n.firstElementChild),this.shadowDom){const o=n.appendChild(document.createElement("div"));o.setAttribute("xe2-div","ESCustomDiv container shadowDiv"),s=o.attachShadow({mode:"open"}).appendChild(document.createElement("div")),s.setAttribute("xe2-div","ESCustomDiv container shadowDiv div")}return new this.instanceClass(s,this,void 0)}))}}update(e){this._updateEvent.emit(e)}get instanceClass(){return this._instanceClassReact.value}set instanceClass(e){this._instanceClassReact.value=e}get instanceClassChanged(){return this._instanceClassReact.changed}get innerHtmlMounted(){return this._innerHtmlMounted}get container(){return this._container.value}get containerChanged(){return this._container.changed}set container(e){this._container.value=e}getESProperties(){const e={...super.getESProperties()},n=r=>{r||alert("evalFuncStr为空,无法执行!");try{const s=r&&Function(`"use strict";return (${r})`)();this.update(s)}catch(s){alert(`updateDivFunc error: ${s}`)}};return{...e,more:[...e.more,new wt("ESCustomDiv"),new X([this,"show"],"显示"),new io([this,"instanceClassStr"],"实例类",lE,gD,!0),new io([this,"innerHTML"],"innerHTML",Or.defaultInnerHTML,Or.innerHTMLReadMe,!0),new vt("强制更新",n,["(divClass, dom, viewer) => divClass.update && divClass.update()"],"update"),new X([this,"allowPicking"],"允许拾取",!0),new mt([this,"containerId"],"容器ID",Or.defaults.containerId,!0),new X([this,"shadowDom"],"shadowDom"),new X([this,"cssAllInitial"],"cssAllInitial"),new mt([this,"cssText"],"cssText")]}}};f(Or,"createDefaultProps",()=>({...pt.createDefaultProps(),show:!0,instanceClassStr:void 0,innerHTML:void 0,allowPicking:void 0,containerId:"",shadowDom:!1,cssAllInitial:!1,cssText:""})),f(Or,"type",Or.register("ESCustomDiv",Or,{chsName:"ESCustomDiv",tags:["ESObjects"],description:"自定义div"})),f(Or,"defaultInnerHTML",` <!-- z-index样式需要设置,否则可能导致看不到!-->
114
+ `;n.style.cssText=o};r();const s=this.dv(Ve(this.cssAllInitialChanged,this.cssTextChanged,this.showChanged));this.d(s.don(r))}{const r=()=>{if(this.containerId===void 0||this.containerId==="")this.container=void 0;else{const s=document.getElementById(this.containerId);s instanceof HTMLElement?this.container=s:(this.container=void 0,console.warn(`Div from containerId(${this.containerId}) is not HTMLDivElement!`))}};r(),this.d(this.containerIdChanged.don(r))}{class r extends B{constructor(o){super(),o.appendChild(n),this.d(()=>o.removeChild(n))}}this.dv(new qe(this.containerChanged,()=>{if(this.container)return new r(this.container)}))}{const r=this.dv(Ve(this.containerChanged,this.instanceClassChanged,this.shadowDomChanged));this.dv(new qe(r,()=>{if(!this.container||!this.instanceClass)return;let s=n;if(n.firstElementChild&&n.removeChild(n.firstElementChild),this.shadowDom){const o=n.appendChild(document.createElement("div"));o.setAttribute("xe2-div","ESCustomDiv container shadowDiv"),s=o.attachShadow({mode:"open"}).appendChild(document.createElement("div")),s.setAttribute("xe2-div","ESCustomDiv container shadowDiv div")}return new this.instanceClass(s,this,void 0)}))}}update(e){this._updateEvent.emit(e)}get instanceClass(){return this._instanceClassReact.value}set instanceClass(e){this._instanceClassReact.value=e}get instanceClassChanged(){return this._instanceClassReact.changed}get innerHtmlMounted(){return this._innerHtmlMounted}get container(){return this._container.value}get containerChanged(){return this._container.changed}set container(e){this._container.value=e}getESProperties(){const e={...super.getESProperties()},n=r=>{r||alert("evalFuncStr为空,无法执行!");try{const s=r&&Function(`"use strict";return (${r})`)();this.update(s)}catch(s){alert(`updateDivFunc error: ${s}`)}};return{...e,more:[...e.more,new wt("ESCustomDiv"),new H([this,"show"],"显示"),new io([this,"instanceClassStr"],"实例类",lE,gD,!0),new io([this,"innerHTML"],"innerHTML",Or.defaultInnerHTML,Or.innerHTMLReadMe,!0),new vt("强制更新",n,["(divClass, dom, viewer) => divClass.update && divClass.update()"],"update"),new H([this,"allowPicking"],"允许拾取",!0),new mt([this,"containerId"],"容器ID",Or.defaults.containerId,!0),new H([this,"shadowDom"],"shadowDom"),new H([this,"cssAllInitial"],"cssAllInitial"),new mt([this,"cssText"],"cssText")]}}};f(Or,"createDefaultProps",()=>({...pt.createDefaultProps(),show:!0,instanceClassStr:void 0,innerHTML:void 0,allowPicking:void 0,containerId:"",shadowDom:!1,cssAllInitial:!1,cssText:""})),f(Or,"type",Or.register("ESCustomDiv",Or,{chsName:"ESCustomDiv",tags:["ESObjects"],description:"自定义div"})),f(Or,"defaultInnerHTML",` <!-- z-index样式需要设置,否则可能导致看不到!-->
115
115
  <div style="width: 300px; height: 50px; z-index: 100; position: absolute; left: 10px; top: 10px; background: rgba(120, 120, 0, 0.7); color: white; font-size: 30px; line-height: 50px; border: 1px solid white;">Hello world!</div>
116
116
  `),f(Or,"innerHTMLReadMe",` 示例代码:
117
117
  \`\`\`
118
118
  ${Or.defaultInnerHTML}
119
119
  \`\`\`
120
- `);let Gf=Or;const dl=class dl extends ct{constructor(e){super(e);f(this,"_maxTime",this.dv(z(23)))}get maxTime(){return this._maxTime.value}get maxTimeChanged(){return this._maxTime.changed}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Et([this,"url"]),new D([this,"maxTime"],"maxTime",23,!0,!0),new D([this,"currentTime"]),new D([this,"minPropValue"]),new D([this,"maxPropValue"]),new Ne([this,"colorStops"],"colorStops",dl.defaults.colorStops,void 0,!0)]}}};f(dl,"createDefaultProps",()=>({...ct.createDefaultProps(),url:"http://114.242.26.126:6003/ESDataMesh/water-assets2/",currentTime:0,minPropValue:0,maxPropValue:1,colorStops:fe([{ratio:0,rgba:[0,0,1,1]},{ratio:.2,rgba:[0,1,0,1]},{ratio:.8,rgba:[1,1,0,1]},{ratio:1,rgba:[1,0,0,1]}])})),f(dl,"type",dl.register("ESDataMesh",dl,{chsName:"数值面着色",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"数值面着色"}));let Gm=dl;const ga=class ga extends Ot{constructor(e){super(e);f(this,"_distance",this.dv(z(0)));f(this,"editingBindMode","lineString");const n=()=>{this._distance.value=this.getDistance()??0};n(),this.d(this.pointsChanged.don(n))}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}getESProperties(){const e={...super.getESProperties()};return{...e,style:[...e.style,new ft([this,"classificationType"],tp,"贴地附着目标",ga.defaults.classificationType)],coordinate:[...e.coordinate,new D([this,"distance"],"长度",0,!1,!0)]}}};f(ga,"createDefaultProps",()=>({...Ot.createDefaultProps(),classificationType:"TERRAIN",stroked:!0,strokeStyle:bt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(ga,"type",ga.register("ESGeoLineString",ga,{chsName:"地理折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地理折线"})),f(ga,"supportEditingModes",[...Ot.supportEditingModes,nt.LineStringAppend,nt.LineStringInsert]);let Fi=ga;const Yu=class Yu extends Fi{constructor(t){super(t)}};f(Yu,"createDefaultProps",()=>({...Fi.createDefaultProps(),strokeStyle:bt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(Yu,"type",Yu.register("ESDistanceMeasurement",Yu,{chsName:"距离测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"距离测量"}));let jm=Yu;const pa=class pa extends Jt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ft([this,"mode"],pa.modes,"模式","in"),new mt([this,"targetID"],"目标图层id","")]}}};f(pa,"createDefaultProps",()=>({...Jt.createDefaultProps(),mode:"in",targetID:"",filled:!1})),f(pa,"type",pa.register("ESExcavate",pa,{chsName:"挖坑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"挖坑"})),f(pa,"modes",[["向内","in"],["向外","out"]]);let Ac=pa;const Ju=class Ju extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"general",basic:[...t.basic,new X([this,"smokeShow"],"显示烟雾")],more:[...t.more,new mt([this,"image"],"图片"),new ci([this,"translation"],"偏移")]}}};f(Ju,"createDefaultProps",()=>({...ct.createDefaultProps(),image:"${earthsdk3-assets-script-dir}/assets/img/fire.png",translation:ot([0,0,0]),smokeShow:!1})),f(Ju,"type",Ju.register("ESFireParticleSystem",Ju,{chsName:"粒子烟火",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"粒子烟火"}));let jf=Ju;const pD=`
120
+ `);let Gf=Or;const dl=class dl extends ct{constructor(e){super(e);f(this,"_maxTime",this.dv(z(23)))}get maxTime(){return this._maxTime.value}get maxTimeChanged(){return this._maxTime.changed}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Et([this,"url"]),new D([this,"maxTime"],"maxTime",23,!0,!0),new D([this,"currentTime"]),new D([this,"minPropValue"]),new D([this,"maxPropValue"]),new Ne([this,"colorStops"],"colorStops",dl.defaults.colorStops,void 0,!0)]}}};f(dl,"createDefaultProps",()=>({...ct.createDefaultProps(),url:"http://114.242.26.126:6003/ESDataMesh/water-assets2/",currentTime:0,minPropValue:0,maxPropValue:1,colorStops:fe([{ratio:0,rgba:[0,0,1,1]},{ratio:.2,rgba:[0,1,0,1]},{ratio:.8,rgba:[1,1,0,1]},{ratio:1,rgba:[1,0,0,1]}])})),f(dl,"type",dl.register("ESDataMesh",dl,{chsName:"数值面着色",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"数值面着色"}));let Gm=dl;const ga=class ga extends Ot{constructor(e){super(e);f(this,"_distance",this.dv(z(0)));f(this,"editingBindMode","lineString");const n=()=>{this._distance.value=this.getDistance()??0};n(),this.d(this.pointsChanged.don(n))}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}getESProperties(){const e={...super.getESProperties()};return{...e,style:[...e.style,new ft([this,"classificationType"],tp,"贴地附着目标",ga.defaults.classificationType)],coordinate:[...e.coordinate,new D([this,"distance"],"长度",0,!1,!0)]}}};f(ga,"createDefaultProps",()=>({...Ot.createDefaultProps(),classificationType:"TERRAIN",stroked:!0,strokeStyle:bt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(ga,"type",ga.register("ESGeoLineString",ga,{chsName:"地理折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地理折线"})),f(ga,"supportEditingModes",[...Ot.supportEditingModes,nt.LineStringAppend,nt.LineStringInsert]);let Fi=ga;const Yu=class Yu extends Fi{constructor(t){super(t)}};f(Yu,"createDefaultProps",()=>({...Fi.createDefaultProps(),strokeStyle:bt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(Yu,"type",Yu.register("ESDistanceMeasurement",Yu,{chsName:"距离测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"距离测量"}));let jm=Yu;const pa=class pa extends Jt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ft([this,"mode"],pa.modes,"模式","in"),new mt([this,"targetID"],"目标图层id","")]}}};f(pa,"createDefaultProps",()=>({...Jt.createDefaultProps(),mode:"in",targetID:"",filled:!1})),f(pa,"type",pa.register("ESExcavate",pa,{chsName:"挖坑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"挖坑"})),f(pa,"modes",[["向内","in"],["向外","out"]]);let Ac=pa;const Ju=class Ju extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"general",basic:[...t.basic,new H([this,"smokeShow"],"显示烟雾")],more:[...t.more,new mt([this,"image"],"图片"),new ci([this,"translation"],"偏移")]}}};f(Ju,"createDefaultProps",()=>({...ct.createDefaultProps(),image:"${earthsdk3-assets-script-dir}/assets/img/fire.png",translation:ot([0,0,0]),smokeShow:!1})),f(Ju,"type",Ju.register("ESFireParticleSystem",Ju,{chsName:"粒子烟火",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"粒子烟火"}));let jf=Ju;const pD=`
121
121
  ## 参数类型为 ESTreeType
122
122
  \`\`\`js
123
123
  type ESJVector2D = [number, number]
@@ -183,7 +183,7 @@ ${hE}
183
183
  destroy() {
184
184
  this._container.removeChild(this._div);
185
185
  }
186
- }`;this.instanceClassStr=s};r(),this.d(this.innerHTMLChanged.don(r))}}get widgetEvent(){return this._widgetEvent}get echartsFun(){return this._echartsFunReact.value}set echartsFun(e){this._echartsFunReact.value=e}get echartsFunChanged(){return this._echartsFunReact.changed}get instanceClass(){return this._instanceClassReact.value}set instanceClass(e){this._instanceClassReact.value=e}get instanceClassChanged(){return this._instanceClassReact.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new D([this,"opacity"],"透明度",us.defaults.opacity,!0),new D([this,"zOrder"],"zOrder",us.defaults.zOrder,!0),new Ke([this,"anchor"],"偏移比例",us.defaults.anchor,!0),new io([this,"innerHTML"],"innerHTML",us.defaults.innerHTML,vD,!0),new io([this,"instanceClassStr"],"实例类",us.defaults.instanceClassStr,mD,!0),new X([this,"renderInUE"],"是否在UE中渲染",!0,!1)]}}};f(us,"createDefaultProps",()=>({...ct.createDefaultProps(),opacity:1,anchor:ot([.5,1]),instanceClassStr:uE,innerHTML:hE,zOrder:0,renderInUE:!1})),f(us,"type",us.register("ESGeoDiv",us,{chsName:"ESGeoDiv",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESGeoDiv"}));let zm=us;const gl=class gl extends Fi{constructor(e){super(e);f(this,"_line",this.ad(new Fi));f(this,"_arrowPolygon",this.ad(new Jt));this.ad(this.components.disposableAdd(this.line,!0)),this.line.show=!1,this.ad(this.components.disposableAdd(this.arrowPolygon));const{line:n,arrowPolygon:r}=this;this.ad(lt([n,"points"],[this,"points"])),this.ad(Ze([this.pointsChanged,this.modeChanged],()=>{this.updateArrowPolygon()},{immediate:!0})),this.ad(F([r,"show"],[this,"show"])),this.ad(F([r,"collision"],[this,"collision"])),this.ad(F([r,"allowPicking"],[this,"allowPicking"])),this.ad(F([r,"filled"],[this,"filled"])),this.ad(F([r,"fillGround"],[this,"fillGround"])),this.ad(F([r,"fillColor"],[this,"fillColor"])),this.ad(F([r,"fillMaterial"],[this,"fillMaterial"])),this.ad(F([r,"fillMaterialParams"],[this,"fillMaterialParams"])),this.ad(F([r,"stroked"],[this,"stroked"])),this.ad(F([r,"strokeGround"],[this,"strokeGround"])),this.ad(F([r,"strokeColor"],[this,"strokeColor"])),this.ad(F([r,"strokeMaterial"],[this,"strokeMaterial"])),this.ad(F([r,"strokeMaterialParams"],[this,"strokeMaterialParams"])),this.ad(F([r,"strokeWidth"],[this,"strokeWidth"])),this.ad(F([r,"strokeWidthType"],[this,"strokeWidthType"])),this.ad(F([r,"classificationType"],[this,"classificationType"]))}get line(){return this._line}get arrowPolygon(){return this._arrowPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,style:[...e.style,new ft([this,"mode"],ep,"箭头模式",gl.defaults.mode)]}}updateArrowPolygon(){const e=this.points;if(!e||e.length<2){this._arrowPolygon.points=[];return}let n=Tm(e,this.mode);n&&n.length>=3?this._arrowPolygon.points=[...n,n[0]]:this._arrowPolygon.points=[]}};f(gl,"createDefaultProps",()=>({...Fi.createDefaultProps(),mode:"straightArrow",stroked:!1,filled:!0,fillStyle:bt({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),f(gl,"type",gl.register("ESSquadCombatArrow",gl,{chsName:"分队战斗箭头",tags:["ESObjects","_ES_Impl_Cesium"],description:"分队战斗箭头,军事标绘箭头类,支持直箭头和燕尾箭头"}));let Bm=gl;const pl=class pl extends Jt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new X([this,"fireShow"],"显示火焰",!0),new D([this,"fireHeight"],"火焰高度",pl.defaults.fireHeight)]}}};f(pl,"createDefaultProps",()=>({...Jt.createDefaultProps(),fireShow:!0,fireHeight:bt(15)})),f(pl,"type",pl.register("ESGeoPolygonWithFire",pl,{chsName:"火焰多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_OL","_ES_Impl_UE"],description:"带火焰效果的地理多边形"}));let Um=pl;const Qn=class Qn extends Ot{constructor(e){super(e);f(this,"editingBindMode","circular");f(this,"fires",[]);this.ad(()=>{this.clear()}),this.ad(Ze([this.pointsChanged,this.interpolationCountChanged,this.useFireParticleSystemChanged],()=>{this.clear(),this.createFires()},{immediate:!0}))}createFires(){if(!this.points||this.points.length<2||!this.useFireParticleSystem)return;let e=this.interpolationCount,n=this.points;for(;e>0;)e--,n=this.interpolationPoints(n);n.forEach(r=>{const s=new jf;this.fires.push(s),this.components.add(s),s.position=r,s.ad(F([s,"show"],[this,"show"])),s.ad(F([s,"collision"],[this,"collision"])),s.ad(F([s,"allowPicking"],[this,"allowPicking"])),s.ad(F([s,"smokeShow"],[this,"smokeShow"])),s.ad(F([s,"scale"],[this,"scale"]))})}interpolationPoints(e){return e.map((n,r)=>{const s=e[(r+1)%e.length],{center:o}=Tf([n,s]);return[n,o]}).flat()}clear(){this.fires.forEach(e=>{this.components.delete(e),e.destroy()}),this.fires=[]}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new wt("火焰参数"),new X([this,"useFireParticleSystem"],"使用粒子系统",Qn.defaults.useFireParticleSystem),new D([this,"interpolationCount"],"火焰粒子插值次数",Qn.defaults.interpolationCount),new X([this,"smokeShow"],"粒子显示烟雾",Qn.defaults.smokeShow),new ci([this,"scale"],"缩放",[1,1,1]),new D([this,"fireWidth"],"火焰宽度(米)",Qn.defaults.fireWidth),new D([this,"fireHeight"],"火焰高度(米)",Qn.defaults.fireHeight),new D([this,"fireIntensity"],"火焰强度",Qn.defaults.fireIntensity),new D([this,"stepCount"],"步进次数(16-256)",void 0)]}}};f(Qn,"createDefaultProps",()=>({...Ot.createDefaultProps(),fireWidth:5,fireHeight:10,fireIntensity:1,stepCount:64,interpolationCount:1,useFireParticleSystem:!0,smokeShow:!1,scale:ot([1,1,1])})),f(Qn,"type",Qn.register("ESFireWall",Qn,{chsName:"火焰墙",tags:["ESObjects","_ES_Impl_Cesium"],description:"火焰墙效果对象"})),f(Qn,"supportEditingModes",[...Ot.supportEditingModes,nt.CircularAppend,nt.CircularInsert,nt.Translation,nt.HeightModify]);let qm=Qn;const ml=class ml extends Ot{constructor(e){super(e);f(this,"editingBindMode","doublePoints")}toPolygon(){if(this.points&&this.points.length>=2){const e=[...this.points][0],n=[...this.points][1];return[e,[e[0],n[1],e[2]],n,[n[0],e[1],n[2]]]}else return}_updateArea(){if(this.points&&this.points.length>=2){const e=[...this.points],n=e[0],r=e[1],s=[n,[n[0],r[1],n[2]],r,[r[0],n[1],r[2]]];this._area.value=Sm(s)}else this._area.value=0}_updatePerimeter(){if(this.points&&this.points.length>=2){const e=[...this.points],n=e[0],r=e[1],s=[n,[n[0],r[1],n[2]],r,[r[0],n[1],r[2]]],o=[...s,s[0]],a=_o(o,"GEODESIC"),l=a[a.length-1];this._perimeter.value=l}else this._perimeter.value=0}getESProperties(){const e=super.getESProperties();return{...e,coordinate:[...e.coordinate,new D([this,"area"],"面积",0,!1,!0),new D([this,"perimeter"],"周长",0,!1,!0)]}}};f(ml,"createDefaultProps",()=>({...Ot.createDefaultProps(),collision:!1,stroked:!0,filled:!0,fillStyle:bt({color:[1,1,1,.5],material:"",materialParams:{},ground:!1})})),f(ml,"type",ml.register("ESGeoRectangle",ml,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"矩形"})),f(ml,"supportEditingModes",[...Ot.supportEditingModes,nt.DoublePoints,nt.DoublePointsAppend,nt.DoublePointsModify]);let Wm=ml;const Hm={translationX:0,translationY:0,translationZ:0,rotationHeading:0,rotationPitch:0,rotationRoll:0,scaleX:1,scaleY:1,scaleZ:1},ma=class ma extends ct{constructor(e){super(e);f(this,"_nodeTransformations",this.dv(z(void 0)));f(this,"_czmModelReadyEvent",this.dv(new O));f(this,"_setNodePositionEvent",this.dv(new O));f(this,"_setNodeRotationEvent",this.dv(new O));f(this,"_setNodeScaleEvent",this.dv(new O));f(this,"_printDebugInfoEvent",this.dv(new O));f(this,"setMaterialInfoEvent",this.ad(new O));f(this,"_setMaterialEvent",this.disposeVar(new O))}get nodeTransformations(){return this._nodeTransformations.value}set nodeTransformations(e){this._nodeTransformations.value=e}get nodeTransformationsChanged(){return this._nodeTransformations.changed}get czmModelReadyEvent(){return this._czmModelReadyEvent}deleteNodeTransformation(e){if(!this.nodeTransformations||!this.nodeTransformations[e])return;const n={...this.nodeTransformations};delete n[e],this.nodeTransformations=n}get setNodePositionEvent(){return this._setNodePositionEvent}setNodePosition(e,n){this._setNodePositionEvent.emit(e,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const r=this._nodeTransformations.value[e]??{...Hm};if(n.some(s=>!Number.isFinite(s))){console.error(`setNodePosition error: ${e} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[e]:{...r,translationX:n[0],translationY:n[1],translationZ:n[2]}}}get setNodeRotationEvent(){return this._setNodeRotationEvent}setNodeRotation(e,n){this._setNodeRotationEvent.emit(e,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const r=this._nodeTransformations.value[e]??{...Hm};if(n.some(s=>!Number.isFinite(s))){console.error(`setNodeRotation error: ${e} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[e]:{...r,rotationHeading:n[0],rotationPitch:n[1],rotationRoll:n[2]}}}get setNodeScaleEvent(){return this._setNodeScaleEvent}setNodeScale(e,n){this._setNodeScaleEvent.emit(e,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const r=this._nodeTransformations.value[e]??{...Hm};if(n.some(s=>!Number.isFinite(s)||s<0)){console.error(`setNodeScale error: !Number.isFinite(e) || e < 0 ${e} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[e]:{...r,scaleX:n[0],scaleY:n[1],scaleZ:n[2]}}}getNodePosition(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.translationX,n.translationY,n.translationZ]}getNodeRotation(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.rotationHeading,n.rotationPitch,n.rotationRoll]}getNodeScale(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.scaleX,n.scaleY,n.scaleZ]}get printDebugInfoEvent(){return this._printDebugInfoEvent}printDebugInfo(){this._printDebugInfoEvent.emit()}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){return new Promise(n=>{const r=new B;r.ad(this.setMaterialInfoEvent.donce(s=>{r.destroy(),n(s)})),this._setMaterialEvent.emit(e)})}setLight122(){this.czmEnvironmentMapManager={...Mm}}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",dataSource:[...e.dataSource,new Et([this,"url"],"模型路径",ma.defaults.url,void 0,!0),new Ne([this,"instances"],"实例化矩阵",ma.defaults.instances,void 0,!0)],more:[...e.more,new D([this,"czmAnimationsIndex"],"动画索引",void 0,!0),new Ke([this,"czmImageBasedLightingFactor"]),new D([this,"czmAtmosphereScatteringIntensity"]),new Et([this,"czmEnvironmentMapManager"]),new vt("控制台输出模型信息",()=>this.printDebugInfo(),[],"printDebugInfo"),new D([this,"czmMaximumScale"],"最大缩放比例",void 0,!0),new D([this,"czmNativeScale"],"统一缩放值"),new D([this,"czmMinimumPixelSize"],"最小像素尺寸"),new Dt([this,"czmColor"],"颜色")]}}};f(ma,"createDefaultProps",()=>({...ct.createDefaultProps(),url:"${earthsdk3-assets-script-dir}/assets/glb/building.glb",czmAnimationsIndex:void 0,czmMaximumScale:void 0,czmMinimumPixelSize:0,czmNativeScale:1,czmColor:ot([1,1,1,1]),allowPicking:!0,instances:oe([]),czmImageBasedLightingFactor:ot([1,1]),czmAtmosphereScatteringIntensity:2,czmEnvironmentMapManager:fe(void 0)})),f(ma,"type",ma.register("ESGltfModel",ma,{chsName:"模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"gltf模型"}));let Fs=ma;const tr=class tr extends ct{constructor(e){super(e);f(this,"_aiMoveToEvent",this.dv(new O));f(this,"_stopAIMoveEvent",this.dv(new O))}get aiMoveToEvent(){return this._aiMoveToEvent}aiMoveTo(e,n){this._aiMoveToEvent.emit(e,n)}get stopAIMoveEvent(){return this._stopAIMoveEvent}stopAIMove(){this._stopAIMoveEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ft([this,"mode"],tr.modes,"模式",tr.defaults.mode,!0),new ft([this,"animation"],tr.animations,"动画",tr.defaults.animation,!0),new Ne([this,"instances"],"实例化矩阵",tr.defaults.instances,void 0,!0)],more:[...e.more,new vt("自动寻路",this.aiMoveTo.bind(this),[[0,0,0],0],"aiMoveTo,UE生效"),new vt("停止自动寻路",()=>this.stopAIMove(),[],"stopAIMove")]}}};f(tr,"createDefaultProps",()=>({...ct.createDefaultProps(),mode:"worker",animation:"standing",allowPicking:!0,instances:oe([])})),f(tr,"type",tr.register("ESHuman",tr,{chsName:"人员",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"工人 警察 路人"})),f(tr,"modes",[["工人","worker"],["警察","police"],["路人","pedestrian"],["陌生人","stranger"],["男士","suitMan"],["女士","suitWoman"],["维修工","repairMan"],["消防员","fireMan"],["消防员-水泵","firefighterWithWaterPump"],["消防员-打火鞭","firefighterWithFirestick"],["消防员-点火器","firefighterWithDripIgniter"],["消防员-风力灭火机","firefighterWithBlower"],["消防员-水枪","firefighterWithHose"],["消防员-灭火弹","firefighterWithThrowable"],["消防员-工具包","firefighterWithToolkit"],["消防员-行走","firefighterWalking"],["消防员-防护服","firefighterUniform"]]),f(tr,"animations",[["站立","standing"],["行走","walking"],["奔跑","running"]]);let Zn=tr;const vl=class vl extends Yn{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Et([this,"url"],"图片路径",vl.defaults.url),new X([this,"isHoverZoom"],"悬浮放大"),new X([this,"hoverHighlight"],"悬浮高亮")]}}};f(vl,"createDefaultProps",()=>({...Yn.createDefaultProps(),url:"inner://CameraBlue.png",isHoverZoom:!1,hoverHighlight:!1,renderMode:4})),f(vl,"type",vl.register("ESImageLabel",vl,{chsName:"图片标签",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"基础图片标签。"}));let Vf=vl;const Bs=class Bs extends Xt{constructor(t){super(t),this.ad(lt([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(lt([this,"czmAlpha"],[this,"opacity"]))}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"dataSource",basic:[...t.basic,new D([this,"zIndex"],"层级序号",Bs.defaults.zIndex)],dataSource:[...t.dataSource,new Et([this,"url"],"影像服务地址"),new rr([this,"rectangle"],"矩形范围",Bs.defaults.rectangle,!0),new Qe([this,"maximumLevel"],1,[1,24],"最大级别",Bs.defaults.maximumLevel,!0),new Et([this,"options"],"options",Bs.defaults.options,void 0,!0),new mt([this,"targetID"],"targetID"),new Qe([this,"opacity"],.01,[0,1],"opacity",1)],more:[...t.more,new wt("通用"),new D([this,"height"],"高度"),new mt([this,"actorTag"]),new mt([this,"componentTag"]),new D([this,"minimumLevel"]),new wt("图像"),new D([this,"czmAlpha"],"透明度"),new D([this,"czmBrightness"],"亮度"),new D([this,"czmContrast"],"对比度"),new D([this,"czmHue"],"色相"),new D([this,"czmSaturation"],"饱和度"),new D([this,"czmGamma"],"伽马值")]}}};f(Bs,"createDefaultProps",()=>({...Xt.createDefaultProps(),url:"",rectangle:fe([-180,-90,180,90]),options:fe(void 0),zIndex:0,actorTag:"",componentTag:"",maximumLevel:22,minimumLevel:0,targetID:"",czmSplitDirection:"NONE",czmAlpha:1,czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1,opacity:1,splitDirection:"NONE"})),f(Bs,"type",Bs.register("ESImageryLayer",Bs,{chsName:"影像图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"影像图层"}));let Lc=Bs;const yD=`
186
+ }`;this.instanceClassStr=s};r(),this.d(this.innerHTMLChanged.don(r))}}get widgetEvent(){return this._widgetEvent}get echartsFun(){return this._echartsFunReact.value}set echartsFun(e){this._echartsFunReact.value=e}get echartsFunChanged(){return this._echartsFunReact.changed}get instanceClass(){return this._instanceClassReact.value}set instanceClass(e){this._instanceClassReact.value=e}get instanceClassChanged(){return this._instanceClassReact.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new D([this,"opacity"],"透明度",us.defaults.opacity,!0),new D([this,"zOrder"],"zOrder",us.defaults.zOrder,!0),new Ke([this,"anchor"],"偏移比例",us.defaults.anchor,!0),new io([this,"innerHTML"],"innerHTML",us.defaults.innerHTML,vD,!0),new io([this,"instanceClassStr"],"实例类",us.defaults.instanceClassStr,mD,!0),new H([this,"renderInUE"],"是否在UE中渲染",!0,!1)]}}};f(us,"createDefaultProps",()=>({...ct.createDefaultProps(),opacity:1,anchor:ot([.5,1]),instanceClassStr:uE,innerHTML:hE,zOrder:0,renderInUE:!1})),f(us,"type",us.register("ESGeoDiv",us,{chsName:"ESGeoDiv",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESGeoDiv"}));let zm=us;const gl=class gl extends Fi{constructor(e){super(e);f(this,"_line",this.ad(new Fi));f(this,"_arrowPolygon",this.ad(new Jt));this.ad(this.components.disposableAdd(this.line,!0)),this.line.show=!1,this.ad(this.components.disposableAdd(this.arrowPolygon));const{line:n,arrowPolygon:r}=this;this.ad(lt([n,"points"],[this,"points"])),this.ad(Ze([this.pointsChanged,this.modeChanged],()=>{this.updateArrowPolygon()},{immediate:!0})),this.ad(F([r,"show"],[this,"show"])),this.ad(F([r,"collision"],[this,"collision"])),this.ad(F([r,"allowPicking"],[this,"allowPicking"])),this.ad(F([r,"filled"],[this,"filled"])),this.ad(F([r,"fillGround"],[this,"fillGround"])),this.ad(F([r,"fillColor"],[this,"fillColor"])),this.ad(F([r,"fillMaterial"],[this,"fillMaterial"])),this.ad(F([r,"fillMaterialParams"],[this,"fillMaterialParams"])),this.ad(F([r,"stroked"],[this,"stroked"])),this.ad(F([r,"strokeGround"],[this,"strokeGround"])),this.ad(F([r,"strokeColor"],[this,"strokeColor"])),this.ad(F([r,"strokeMaterial"],[this,"strokeMaterial"])),this.ad(F([r,"strokeMaterialParams"],[this,"strokeMaterialParams"])),this.ad(F([r,"strokeWidth"],[this,"strokeWidth"])),this.ad(F([r,"strokeWidthType"],[this,"strokeWidthType"])),this.ad(F([r,"classificationType"],[this,"classificationType"]))}get line(){return this._line}get arrowPolygon(){return this._arrowPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,style:[...e.style,new ft([this,"mode"],ep,"箭头模式",gl.defaults.mode)]}}updateArrowPolygon(){const e=this.points;if(!e||e.length<2){this._arrowPolygon.points=[];return}let n=Tm(e,this.mode);n&&n.length>=3?this._arrowPolygon.points=[...n,n[0]]:this._arrowPolygon.points=[]}};f(gl,"createDefaultProps",()=>({...Fi.createDefaultProps(),mode:"straightArrow",stroked:!1,filled:!0,fillStyle:bt({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),f(gl,"type",gl.register("ESSquadCombatArrow",gl,{chsName:"分队战斗箭头",tags:["ESObjects","_ES_Impl_Cesium"],description:"分队战斗箭头,军事标绘箭头类,支持直箭头和燕尾箭头"}));let Bm=gl;const pl=class pl extends Jt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new H([this,"fireShow"],"显示火焰",!0),new D([this,"fireHeight"],"火焰高度",pl.defaults.fireHeight)]}}};f(pl,"createDefaultProps",()=>({...Jt.createDefaultProps(),fireShow:!0,fireHeight:bt(15)})),f(pl,"type",pl.register("ESGeoPolygonWithFire",pl,{chsName:"火焰多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_OL","_ES_Impl_UE"],description:"带火焰效果的地理多边形"}));let Um=pl;const Qn=class Qn extends Ot{constructor(e){super(e);f(this,"editingBindMode","circular");f(this,"fires",[]);this.ad(()=>{this.clear()}),this.ad(Ze([this.pointsChanged,this.interpolationCountChanged,this.useFireParticleSystemChanged],()=>{this.clear(),this.createFires()},{immediate:!0}))}createFires(){if(!this.points||this.points.length<2||!this.useFireParticleSystem)return;let e=this.interpolationCount,n=this.points;for(;e>0;)e--,n=this.interpolationPoints(n);n.forEach(r=>{const s=new jf;this.fires.push(s),this.components.add(s),s.position=r,s.ad(F([s,"show"],[this,"show"])),s.ad(F([s,"collision"],[this,"collision"])),s.ad(F([s,"allowPicking"],[this,"allowPicking"])),s.ad(F([s,"smokeShow"],[this,"smokeShow"])),s.ad(F([s,"scale"],[this,"scale"]))})}interpolationPoints(e){return e.map((n,r)=>{const s=e[(r+1)%e.length],{center:o}=Tf([n,s]);return[n,o]}).flat()}clear(){this.fires.forEach(e=>{this.components.delete(e),e.destroy()}),this.fires=[]}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new wt("火焰参数"),new H([this,"useFireParticleSystem"],"使用粒子系统",Qn.defaults.useFireParticleSystem),new D([this,"interpolationCount"],"火焰粒子插值次数",Qn.defaults.interpolationCount),new H([this,"smokeShow"],"粒子显示烟雾",Qn.defaults.smokeShow),new ci([this,"scale"],"缩放",[1,1,1]),new D([this,"fireWidth"],"火焰宽度(米)",Qn.defaults.fireWidth),new D([this,"fireHeight"],"火焰高度(米)",Qn.defaults.fireHeight),new D([this,"fireIntensity"],"火焰强度",Qn.defaults.fireIntensity),new D([this,"stepCount"],"步进次数(16-256)",void 0)]}}};f(Qn,"createDefaultProps",()=>({...Ot.createDefaultProps(),fireWidth:5,fireHeight:10,fireIntensity:1,stepCount:64,interpolationCount:1,useFireParticleSystem:!0,smokeShow:!1,scale:ot([1,1,1])})),f(Qn,"type",Qn.register("ESFireWall",Qn,{chsName:"火焰墙",tags:["ESObjects","_ES_Impl_Cesium"],description:"火焰墙效果对象"})),f(Qn,"supportEditingModes",[...Ot.supportEditingModes,nt.CircularAppend,nt.CircularInsert,nt.Translation,nt.HeightModify]);let qm=Qn;const ml=class ml extends Ot{constructor(e){super(e);f(this,"editingBindMode","doublePoints")}toPolygon(){if(this.points&&this.points.length>=2){const e=[...this.points][0],n=[...this.points][1];return[e,[e[0],n[1],e[2]],n,[n[0],e[1],n[2]]]}else return}_updateArea(){if(this.points&&this.points.length>=2){const e=[...this.points],n=e[0],r=e[1],s=[n,[n[0],r[1],n[2]],r,[r[0],n[1],r[2]]];this._area.value=Sm(s)}else this._area.value=0}_updatePerimeter(){if(this.points&&this.points.length>=2){const e=[...this.points],n=e[0],r=e[1],s=[n,[n[0],r[1],n[2]],r,[r[0],n[1],r[2]]],o=[...s,s[0]],a=_o(o,"GEODESIC"),l=a[a.length-1];this._perimeter.value=l}else this._perimeter.value=0}getESProperties(){const e=super.getESProperties();return{...e,coordinate:[...e.coordinate,new D([this,"area"],"面积",0,!1,!0),new D([this,"perimeter"],"周长",0,!1,!0)]}}};f(ml,"createDefaultProps",()=>({...Ot.createDefaultProps(),collision:!1,stroked:!0,filled:!0,fillStyle:bt({color:[1,1,1,.5],material:"",materialParams:{},ground:!1})})),f(ml,"type",ml.register("ESGeoRectangle",ml,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"矩形"})),f(ml,"supportEditingModes",[...Ot.supportEditingModes,nt.DoublePoints,nt.DoublePointsAppend,nt.DoublePointsModify]);let Wm=ml;const Hm={translationX:0,translationY:0,translationZ:0,rotationHeading:0,rotationPitch:0,rotationRoll:0,scaleX:1,scaleY:1,scaleZ:1},ma=class ma extends ct{constructor(e){super(e);f(this,"_nodeTransformations",this.dv(z(void 0)));f(this,"_czmModelReadyEvent",this.dv(new O));f(this,"_setNodePositionEvent",this.dv(new O));f(this,"_setNodeRotationEvent",this.dv(new O));f(this,"_setNodeScaleEvent",this.dv(new O));f(this,"_printDebugInfoEvent",this.dv(new O));f(this,"setMaterialInfoEvent",this.ad(new O));f(this,"_setMaterialEvent",this.disposeVar(new O))}get nodeTransformations(){return this._nodeTransformations.value}set nodeTransformations(e){this._nodeTransformations.value=e}get nodeTransformationsChanged(){return this._nodeTransformations.changed}get czmModelReadyEvent(){return this._czmModelReadyEvent}deleteNodeTransformation(e){if(!this.nodeTransformations||!this.nodeTransformations[e])return;const n={...this.nodeTransformations};delete n[e],this.nodeTransformations=n}get setNodePositionEvent(){return this._setNodePositionEvent}setNodePosition(e,n){this._setNodePositionEvent.emit(e,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const r=this._nodeTransformations.value[e]??{...Hm};if(n.some(s=>!Number.isFinite(s))){console.error(`setNodePosition error: ${e} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[e]:{...r,translationX:n[0],translationY:n[1],translationZ:n[2]}}}get setNodeRotationEvent(){return this._setNodeRotationEvent}setNodeRotation(e,n){this._setNodeRotationEvent.emit(e,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const r=this._nodeTransformations.value[e]??{...Hm};if(n.some(s=>!Number.isFinite(s))){console.error(`setNodeRotation error: ${e} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[e]:{...r,rotationHeading:n[0],rotationPitch:n[1],rotationRoll:n[2]}}}get setNodeScaleEvent(){return this._setNodeScaleEvent}setNodeScale(e,n){this._setNodeScaleEvent.emit(e,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const r=this._nodeTransformations.value[e]??{...Hm};if(n.some(s=>!Number.isFinite(s)||s<0)){console.error(`setNodeScale error: !Number.isFinite(e) || e < 0 ${e} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[e]:{...r,scaleX:n[0],scaleY:n[1],scaleZ:n[2]}}}getNodePosition(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.translationX,n.translationY,n.translationZ]}getNodeRotation(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.rotationHeading,n.rotationPitch,n.rotationRoll]}getNodeScale(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.scaleX,n.scaleY,n.scaleZ]}get printDebugInfoEvent(){return this._printDebugInfoEvent}printDebugInfo(){this._printDebugInfoEvent.emit()}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){return new Promise(n=>{const r=new B;r.ad(this.setMaterialInfoEvent.donce(s=>{r.destroy(),n(s)})),this._setMaterialEvent.emit(e)})}setLight122(){this.czmEnvironmentMapManager={...Mm}}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",dataSource:[...e.dataSource,new Et([this,"url"],"模型路径",ma.defaults.url,void 0,!0),new Ne([this,"instances"],"实例化矩阵",ma.defaults.instances,void 0,!0)],more:[...e.more,new D([this,"czmAnimationsIndex"],"动画索引",void 0,!0),new Ke([this,"czmImageBasedLightingFactor"]),new D([this,"czmAtmosphereScatteringIntensity"]),new Et([this,"czmEnvironmentMapManager"]),new vt("控制台输出模型信息",()=>this.printDebugInfo(),[],"printDebugInfo"),new D([this,"czmMaximumScale"],"最大缩放比例",void 0,!0),new D([this,"czmNativeScale"],"统一缩放值"),new D([this,"czmMinimumPixelSize"],"最小像素尺寸"),new Dt([this,"czmColor"],"颜色")]}}};f(ma,"createDefaultProps",()=>({...ct.createDefaultProps(),url:"${earthsdk3-assets-script-dir}/assets/glb/building.glb",czmAnimationsIndex:void 0,czmMaximumScale:void 0,czmMinimumPixelSize:0,czmNativeScale:1,czmColor:ot([1,1,1,1]),allowPicking:!0,instances:oe([]),czmImageBasedLightingFactor:ot([1,1]),czmAtmosphereScatteringIntensity:2,czmEnvironmentMapManager:fe(void 0)})),f(ma,"type",ma.register("ESGltfModel",ma,{chsName:"模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"gltf模型"}));let Fs=ma;const tr=class tr extends ct{constructor(e){super(e);f(this,"_aiMoveToEvent",this.dv(new O));f(this,"_stopAIMoveEvent",this.dv(new O))}get aiMoveToEvent(){return this._aiMoveToEvent}aiMoveTo(e,n){this._aiMoveToEvent.emit(e,n)}get stopAIMoveEvent(){return this._stopAIMoveEvent}stopAIMove(){this._stopAIMoveEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ft([this,"mode"],tr.modes,"模式",tr.defaults.mode,!0),new ft([this,"animation"],tr.animations,"动画",tr.defaults.animation,!0),new Ne([this,"instances"],"实例化矩阵",tr.defaults.instances,void 0,!0)],more:[...e.more,new vt("自动寻路",this.aiMoveTo.bind(this),[[0,0,0],0],"aiMoveTo,UE生效"),new vt("停止自动寻路",()=>this.stopAIMove(),[],"stopAIMove")]}}};f(tr,"createDefaultProps",()=>({...ct.createDefaultProps(),mode:"worker",animation:"standing",allowPicking:!0,instances:oe([])})),f(tr,"type",tr.register("ESHuman",tr,{chsName:"人员",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"工人 警察 路人"})),f(tr,"modes",[["工人","worker"],["警察","police"],["路人","pedestrian"],["陌生人","stranger"],["男士","suitMan"],["女士","suitWoman"],["维修工","repairMan"],["消防员","fireMan"],["消防员-水泵","firefighterWithWaterPump"],["消防员-打火鞭","firefighterWithFirestick"],["消防员-点火器","firefighterWithDripIgniter"],["消防员-风力灭火机","firefighterWithBlower"],["消防员-水枪","firefighterWithHose"],["消防员-灭火弹","firefighterWithThrowable"],["消防员-工具包","firefighterWithToolkit"],["消防员-行走","firefighterWalking"],["消防员-防护服","firefighterUniform"]]),f(tr,"animations",[["站立","standing"],["行走","walking"],["奔跑","running"]]);let Zn=tr;const vl=class vl extends Yn{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Et([this,"url"],"图片路径",vl.defaults.url),new H([this,"isHoverZoom"],"悬浮放大"),new H([this,"hoverHighlight"],"悬浮高亮")]}}};f(vl,"createDefaultProps",()=>({...Yn.createDefaultProps(),url:"inner://CameraBlue.png",isHoverZoom:!1,hoverHighlight:!1,renderMode:4})),f(vl,"type",vl.register("ESImageLabel",vl,{chsName:"图片标签",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"基础图片标签。"}));let Vf=vl;const Bs=class Bs extends Xt{constructor(t){super(t),this.ad(lt([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(lt([this,"czmAlpha"],[this,"opacity"]))}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"dataSource",basic:[...t.basic,new D([this,"zIndex"],"层级序号",Bs.defaults.zIndex)],dataSource:[...t.dataSource,new Et([this,"url"],"影像服务地址"),new rr([this,"rectangle"],"矩形范围",Bs.defaults.rectangle,!0),new Qe([this,"maximumLevel"],1,[1,24],"最大级别",Bs.defaults.maximumLevel,!0),new Et([this,"options"],"options",Bs.defaults.options,void 0,!0),new mt([this,"targetID"],"targetID"),new Qe([this,"opacity"],.01,[0,1],"opacity",1)],more:[...t.more,new wt("通用"),new D([this,"height"],"高度"),new mt([this,"actorTag"]),new mt([this,"componentTag"]),new D([this,"minimumLevel"]),new wt("图像"),new D([this,"czmAlpha"],"透明度"),new D([this,"czmBrightness"],"亮度"),new D([this,"czmContrast"],"对比度"),new D([this,"czmHue"],"色相"),new D([this,"czmSaturation"],"饱和度"),new D([this,"czmGamma"],"伽马值")]}}};f(Bs,"createDefaultProps",()=>({...Xt.createDefaultProps(),url:"",rectangle:fe([-180,-90,180,90]),options:fe(void 0),zIndex:0,actorTag:"",componentTag:"",maximumLevel:22,minimumLevel:0,targetID:"",czmSplitDirection:"NONE",czmAlpha:1,czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1,opacity:1,splitDirection:"NONE"})),f(Bs,"type",Bs.register("ESImageryLayer",Bs,{chsName:"影像图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"影像图层"}));let Lc=Bs;const yD=`
187
187
  # 声明文件
188
188
  ### options 类型
189
189
  \`\`\`javascript
@@ -289,14 +289,14 @@ export type ESJTimeIntervalCollectionJsonType = {
289
289
  };
290
290
 
291
291
  \`\`\`
292
- `,hs=class hs extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new D([this,"size"],"尺寸",hs.defaults.size),new X([this,"autoFollow"],"自动跟随",hs.defaults.autoFollow),new ft([this,"mode"],hs.modes,"模式","blueSky")],more:[...t.more,new D([this,"autoOpacityFactor"],"自动消失系数",hs.defaults.autoOpacityFactor)]}}};f(hs,"createDefaultProps",()=>({...ct.createDefaultProps(),size:1e4,autoFollow:!0,autoOpacityFactor:2,mode:"blueSky",collision:!1,allowPicking:!1})),f(hs,"type",hs.register("ESLocalSkyBox",hs,{chsName:"局部天空盒",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"效果类"})),f(hs,"modes",[["baiyun","baiyun"],["blueSky","blueSky"],["clearSky","clearSky"],["dream","dream"],["starrySky","starrySky"],["sunnySky","sunnySky"],["sunSets","sunSets"]]);let Xm=hs;const sd=class sd extends ct{constructor(e){super(e);f(this,"_location",this.disposeVar(z(void 0)));{const n=()=>{this.location=this.position};n(),this.ad(this.positionChanged.don(n))}}get location(){return this._location.value}set location(e){this._location.value=e}get locationChanged(){return this._location.changed}};f(sd,"type",sd.register("ESLocationMeasurement",sd,{chsName:"位置测量点",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"位置测量点"}));let $m=sd;const Gi=class Gi extends ct{constructor(e){super(e);f(this,"_player",this.dv(new kr));{const n=Gi.defaults;this.d(lt([this._player,"loop"],[this,"playingLoop"],r=>r??n.playingLoop,r=>r??n.playingLoop)),this.d(lt([this._player,"currentTime"],[this,"currentTime"],r=>r??n.currentTime,r=>r??n.currentTime)),this.d(lt([this._player,"duration"],[this,"duration"],r=>r??n.duration,r=>r??n.duration)),this.d(lt([this._player,"playing"],[this,"playing"],r=>r??n.playing,r=>r??n.playing)),this.d(lt([this._player,"speed"],[this,"playingSpeed"],r=>r??n.playingSpeed,r=>r??n.playingSpeed))}}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new wt("通用"),new vt("飞入",n=>this.flyTo(n),[1e3],"flyTo"),new io([this,"updateCallback"],"更新回调函数",void 0,void 0,!0),new D([this,"emissionRate"],"发射率",5,!0),new X([this,"loop"],"是否循环",!0,!0),new D([this,"particleScale"],"等级",1,!0),new D([this,"startScale"],"初始等级",void 0,!0),new D([this,"endScale"],"结束等级",Gi.defaults.endScale,!0),new Dt([this,"color"],"颜色",void 0,!0),new Dt([this,"startColor"],"初始颜色",void 0,!0),new Dt([this,"endColor"],"结束颜色",void 0,!0),new X([this,"sizeInMeters"],"尺寸单位为米",void 0,!0),new D([this,"speed"],"速度",1,!0),new D([this,"minimumSpeed"],"最小速度",void 0,!0),new D([this,"maximumSpeed"],"最大速度",void 0,!0),new D([this,"lifetime"],"生命周期",Number.MAX_VALUE,!0),new D([this,"particleLife"],"粒子生命周期",Gi.defaults.particleLife,!0),new D([this,"minimumParticleLife"],"最小粒子生命周期",void 0,!0),new D([this,"maximumParticleLife"],"最大粒子生命周期",void 0,!0),new D([this,"mass"],"块数量",1,!0),new D([this,"minimumMass"],"最小块数量",void 0,!0),new D([this,"maximumMass"],"最大块数量",void 0,!0),new Ke([this,"imageSize"],"图片尺寸",Gi.defaults.imageSize,!0),new Ke([this,"minimumImageSize"],"最小图片尺寸",void 0,!0),new Ke([this,"maximumImageSize"],"最大图片尺寸",void 0,!0),new mt([this,"image"],"图片",Gi.defaults.image,!0),new ci([this,"translation"],"偏移",[0,0,0],!0),new Ne([this,"bursts"],"bursts",[]),new Et([this,"emitter"],"emitter",Gi.defaults.emitter),new wt("播放器"),new D([this,"ratio"],"播放比率",0,!0),new Cd([this,"playing"],[this,"ratio"],[this,"playingLoop"],"播放器"),new X([this,"playingLoop"],"是否循环",Gi.defaults.playingLoop,!0),new D([this,"currentTime"],"当前时间",Gi.defaults.currentTime,!0),new D([this,"duration"],"过渡时间",Gi.defaults.duration,!0),new X([this,"playing"],"是否播放",Gi.defaults.playing,!0),new D([this,"playingSpeed"],"播放速度",Gi.defaults.playingSpeed,!0)]}}};f(Gi,"createDefaultProps",()=>({...ct.createDefaultProps(),emitter:fe({type:"CircleEmitter",radius:.5}),bursts:vg(void 0),translation:oe(void 0),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",imageSize:oe([20,20]),minimumImageSize:oe(void 0),maximumImageSize:oe(void 0),updateCallback:void 0,emissionRate:void 0,loop:void 0,particleScale:void 0,startScale:void 0,endScale:4,color:oe(void 0),startColor:oe(void 0),endColor:oe(void 0),sizeInMeters:void 0,speed:void 0,minimumSpeed:void 0,maximumSpeed:void 0,lifetime:void 0,particleLife:.5,minimumParticleLife:void 0,maximumParticleLife:void 0,mass:void 0,minimumMass:void 0,maximumMass:void 0,playingLoop:!0,currentTime:0,duration:6e3,playingSpeed:1,playing:!0})),f(Gi,"type",Gi.register("ESParticleSystemPrimitive",Gi,{chsName:"粒子",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"通过Cesium的Primitive API 实现的粒子特效。"}));let zf=Gi;const cs=class cs extends Yn{constructor(e){super(e);f(this,"initialStyle",this.ad(fe(void 0)));f(this,"_getInitialStyleEvent",this.disposeVar(new O))}get getInitialStyleEvent(){return this._getInitialStyleEvent}getInitialStyle(){return Promise.race([new Promise(e=>{const n=this.d(this.initialStyle.changed.disposableOnce(e));this.getInitialStyleEvent.emit(),setTimeout(()=>{n(),e(void 0)},2e3)})])}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ft([this,"mode"],cs.modes,"模式",cs.defaults.mode),new Et([this,"style"],"样式",cs.defaults.style),new X([this,"autoAnchor"],"自动锚点对齐",cs.defaults.autoAnchor)]}}};f(cs,"createDefaultProps",()=>({...Yn.createDefaultProps(),mode:"SquareH01",style:bt({fontSize:16,imageSize:[60,60],textBackgroundColor:[1,1,1,0],textBackgroundSize:[120,30],textColor:[1,1,1,1],textOffset:[10,2],textBoxOffset:[40,0],textBoxAlign:"start",textBoxShow:!0,textBoxMode:"default"}),autoAnchor:!0})),f(cs,"type",cs.register("ESPoi2D",cs,{chsName:"ESPoi2D",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"三角形,菱形"})),f(cs,"modes",[["自定义","Custom"],["SquareH01","SquareH01"],["SquareH02","SquareH02"],["SquareV01","SquareV01"],["SquareV02","SquareV02"],["SquareV03","SquareV03"],["SquareV04","SquareV04"],["Flag01","Flag01"],["Flag02","Flag02"],["Linear01","Linear01"],["Linear02","Linear02"],["Linear03","Linear03"],["CircularH01","CircularH01"],["CircularH02","CircularH02"],["CircularV01","CircularV01"],["CircularV02","CircularV02"],["CircularV03","CircularV03"],["CircularV04","CircularV04"],["CircularV05","CircularV05"],["P3D01","P3D01"],["P3D02","P3D02"],["P3D03","P3D03"],["P3D04","P3D04"],["P3D05","P3D05"],["P3D06","P3D06"],["P3D07","P3D07"],["Diamond01","Diamond01"],["Diamond02","Diamond02"],["Stranger","Stranger"],["ManNormal","ManNormal"],["ManAbnormal","ManAbnormal"],["WomanNormal","WomanNormal"],["WomanAbnormal","WomanAbnormal"],["Camera","Camera"]]);let Fc=cs;const Us=class Us extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ft([this,"mode"],Us.modes,"模式",Us.defaults.mode),new Et([this,"style"],"样式",Us.defaults.style)]}}};f(Us,"createDefaultProps",()=>({...ct.createDefaultProps(),mode:"triangle",style:bt({UI_Color:[.09803921568627451,.40784313725490196,.8,1],FX_Color:[.09803921568627451,.40784313725490196,.8,1]})})),f(Us,"type",Us.register("ESPoi3D",Us,{chsName:"ESPoi3D",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"三角形,菱形"})),f(Us,"modes",[["三角形","triangle"],["菱形","diamond"],["制(存)梁场","BridgePrefabricationSite"],["汽车运输便道","ExportRoad"],["拌合站","MixingStation"],["小型预制构件厂","PrefabricatedComponentsSite"],["项目部","ProjectDepartment"],["铁路岔线","RailwayFork"],["钢筋加工厂","RebarMachining"],["临时电力干线","TempElectricMain"],["铺轨基地","TrackLayingBase"],["汽车运梁通道","TransportationBridge"]]);let Ym=Us;const Zu=class Zu extends Jt{constructor(e){super(e);f(this,"_czmFlattenedPlaneId",this.dv(z("")))}get czmFlattenedPlaneId(){return this._czmFlattenedPlaneId.value}set czmFlattenedPlaneId(e){this._czmFlattenedPlaneId.value=e}get czmFlattenedPlaneIdChanged(){return this._czmFlattenedPlaneId.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new mt([this,"targetID"],"目标图层id","")]}}};f(Zu,"createDefaultProps",()=>({...Jt.createDefaultProps(),targetID:"",filled:!1})),f(Zu,"type",Zu.register("ESPolygonFlattenedPlane",Zu,{chsName:"压平",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPolygonFlattenedPlane"}));let Jm=Zu;const Ku=class Ku extends Xt{constructor(e){super(e);f(this,"_czmFlattenedPlaneId",this.dv(z("")))}get czmFlattenedPlaneId(){return this._czmFlattenedPlaneId.value}set czmFlattenedPlaneId(e){this._czmFlattenedPlaneId.value=e}get czmFlattenedPlaneIdChanged(){return this._czmFlattenedPlaneId.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new mt([this,"targetID"],"目标图层id","")],style:[...e.style,new X([this,"stroked"],"开启线样式",!1),new Dt([this,"strokeColor"],"线颜色",[1,1,1,1]),new D([this,"strokeWidth"],"线宽",1),new X([this,"filled"],"开启填充样式",!1),new Dt([this,"fillColor"],"填充颜色",[1,1,1,.5]),new X([this,"strokeGround"],"线贴地",!1),new X([this,"fillGround"],"填充贴地",!1)]}}};f(Ku,"createDefaultProps",()=>({...Xt.createDefaultProps(),targetID:"",filled:!1,stroked:!1,strokeColor:ot([1,1,1,1]),strokeWidth:1,fillColor:ot([1,1,1,.5]),strokeGround:!1,fillGround:!1,pointsSet:yg([])})),f(Ku,"type",Ku.register("ESPolygonsFlattenedPlane",Ku,{chsName:"多压平",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPolygonsFlattenedPlane"}));let Zm=Ku;const cE=async(i,t,e)=>{const{viewer:n}=i;if(!n){console.error("AddTrees: ueViewer.viewer is undefined");return}const r=await n.callUeFunc({f:"AddTrees",p:{id:t,TreeParams:e}});return r.error&&console.error("AddTrees:",r.error),r},dE=async(i,t)=>{const{viewer:e}=i;if(!e){console.error("RemoveAllTrees: ueViewer.viewer is undefined");return}const n=await e.callUeFunc({f:"RemoveAllTrees",p:{id:t}});return n.error&&console.error("RemoveAllTrees:",n.error),n},fE=async(i,t,e)=>{const{viewer:n}=i;if(!n){console.error("UpdateTreeParams: ueViewer.viewer is undefined");return}const r=await n.callUeFunc({f:"UpdateTreeParams",p:{id:t,TreeParams:e}});return r.error&&console.error("UpdateTreeParams:",r.error),r},gE=async(i,t,e,n)=>{const{viewer:r}=i;if(!r){console.error("CutDownTrees: ueViewer.viewer is undefined");return}const s=await r.callUeFunc({f:"CutDownTrees",p:{id:t,TreeIds:e,TimeLength:n}});return s.error&&console.error("CutDownTrees:",s.error),s},pE=async(i,t,e,n,r)=>{const{viewer:s}=i;if(!s){console.error("GrowthSimulation: ueViewer.viewer is undefined");return}const o=await s.callUeFunc({f:"GrowthSimulation",p:{id:t,ToParams:e,SwitchTime:r,TimeLength:n}});return o.error&&console.error("GrowthSimulation:",o.error),o},Qu=class Qu extends Xt{constructor(e){super(e);f(this,"_addTreesEvent",this.dv(new O));f(this,"_removeAllTreesEvent",this.dv(new O));f(this,"_updateTreeParamsEvent",this.dv(new O));f(this,"_cutDownTreesEvent",this.dv(new O));f(this,"_growthSimulationEvent",this.dv(new O))}async addTreesCallFunc(e,n){return await cE(e,this.id,n)}async updateTreeParamsCallFunc(e,n){return await fE(e,this.id,n)}async cutDownTreesCallFunc(e,n,r){return await gE(e,this.id,n,r)}async removeAllTreesCallFunc(e){return await dE(e,this.id)}async growthSimulationCallFunc(e,n,r,s){return await pE(e,this.id,n,r,s)}async getIdByComponentNameAndHitItem(e,n,r){return await e.getIdByComponentNameAndHitItem(this.id,n,r)}get addTreesEvent(){return this._addTreesEvent}addTrees(e){this._addTreesEvent.emit(e)}get removeAllTreesEvent(){return this._removeAllTreesEvent}removeAllTrees(){this._removeAllTreesEvent.emit()}get updateTreeParamsEvent(){return this._updateTreeParamsEvent}updateTreeParams(e){this._updateTreeParamsEvent.emit(e)}get cutDownTreesEvent(){return this._cutDownTreesEvent}cutDownTrees(e,n){this._cutDownTreesEvent.emit(e,n)}get growthSimulationEvent(){return this._growthSimulationEvent}growthSimulation(e,n,r){this._growthSimulationEvent.emit(e,n,r)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new wt("通用"),new Ne([this,"treeTypes"],"treeTypes",[],"{ name: string, meshPath: string }[]",!0),new D([this,"stumpId"],"树桩id"),new D([this,"intervalTime"],"动画间隔时间"),new D([this,"switchIntervalTime"],"切换间隔时间")]}}};f(Qu,"createDefaultProps",()=>({...Xt.createDefaultProps(),treeTypes:fe([]),stumpId:-1,intervalTime:.1,switchIntervalTime:.5})),f(Qu,"type",Qu.register("ESSeparateFoliage",Qu,{chsName:"单体控制森林",tags:["ESObjects","_ES_Impl_UE"],description:"ESSeparateFoliage"}));let Km=Qu;function Bf(i,t,e){const n="buffer"in i,r=n?i.buffer:i;n&&(t+=i.byteOffset);const s=new Array(e),o=new DataView(r);for(let a=0;a<e;++a){const l=o.getUint8(t+a);s[a]=String.fromCharCode(l)}return s.join("")}function Uf(i,t){const e="buffer"in i,n=e?i.buffer:i;return e&&(t+=i.byteOffset),new DataView(n).getUint32(t,!0)}function mE(i,t,e){const n="buffer"in i,r=n?i.buffer:i;if(n&&(t+=i.byteOffset),t+e>r.byteLength){console.error("byteOffset + length > buffer.byteLength");return}return new Uint8Array(r,t,e)}function _D(i,t,e){const n="buffer"in i,r=n?i.buffer:i;if(n&&(t+=i.byteOffset),t+e*2>r.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Uint16Array(r,t,e)}function wD(i,t,e){const n="buffer"in i,r=n?i.buffer:i;if(n&&(t+=i.byteOffset),t+e*4>r.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Uint32Array(r,t,e)}function ED(i,t,e){const n="buffer"in i,r=n?i.buffer:i;if(n&&(t+=i.byteOffset),t+e*4>r.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Float32Array(r,t,e)}function vE(i){if(Bf(i,0,4)!=="glTF"){console.error("Not a glTF file");return}const e=Uf(i,4);if(e!==2){console.error("Unsupported glTF version");return}const n=Uf(i,8);if(n!==i.byteLength){console.error("Invalid glTF length");return}const r=Uf(i,12);if(r+12+4>n){console.error("Invalid glTF chunk length");return}if(Bf(i,16,4)!=="JSON"){console.error("Invalid glTF chunk type");return}const o=Bf(i,20,r),a={version:e,length:n,gltfJson:o};if(20+r<i.byteLength){const l=Uf(i,20+r);if(Bf(i,20+r+4,4)!=="BIN\0"){console.error("Invalid glTF chunk type");return}const h=mE(i,20+r+8,l);a.gltfBinary=h}return a}window.parseGlb=vE;function yE(i){const t=vE(i);if(t===void 0||!t.gltfBinary)return;const e=JSON.parse(t.gltfJson);return e.nodes.map(n=>{var r=e.meshes[n.mesh],s=r.primitives[0].attributes.POSITION,o=r.primitives[0].indices,a=e.accessors[s],l=e.bufferViews[a.bufferView];if(!t.gltfBinary)throw new Error("!glbParseResult.gltfBinary");const u=ED(t.gltfBinary,l.byteOffset??0,l.byteLength/4);var h=e.accessors[o],c=e.bufferViews[h.bufferView];if(!t.gltfBinary)throw new Error("!glbParseResult.gltfBinary");let d;return h.componentType===5121?d=mE(t.gltfBinary,c.byteOffset??0,c.byteLength/1):h.componentType===5123?d=_D(t.gltfBinary,c.byteOffset??0,c.byteLength/2):h.componentType===5125&&(d=wD(t.gltfBinary,c.byteOffset??0,c.byteLength/4)),{name:n.name,posBuffer:u,indicesBuffer:d}})}window.parseWaterGlb=yE;const Ji=class Ji extends ct{constructor(e){super(e);f(this,"_submergingData");f(this,"_allMoments",[]);{const n=()=>{this.url!=""&&fetch(this.url).then(r=>{r.status==200&&r.ok&&r.arrayBuffer().then(s=>{this._submergingData=yE(s);const o=this._submergingData.map(a=>Date.parse(a.name)).sort();this._allMoments=o,this.currentTime==0&&(this.currentTime=o[0]),this.readyEvent.emit(void 0)})}).catch(r=>{console.log(r)})};n(),this.d(this.urlChanged.don(()=>{n()}))}this.ad(Ze([this.waterColorChanged,this.frequencyChanged,this.amplitudeChanged,this.waveVelocityChanged,this.specularIntensityChanged,this.murkinessChanged,this.flowSpeedChanged],()=>{this.waterType="custom"}))}get getSubmergingData(){return this._submergingData}getAllMoments(){return this._allMoments}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new mt([this,"url"],"Url地址",Ji.defaults.url),new Qe([this,"amplitude"],.01,[0,1],"振幅",Ji.defaults.amplitude),new D([this,"frequency"],"频率",Ji.defaults.frequency),new D([this,"currentTime"],"当前时间",Ji.defaults.currentTime),new Et([this,"materialParams"],"材质参数",Ji.defaults.materialParams),new ft([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型","river"),new Dt([this,"waterColor"],"水的底色",Ji.defaults.waterColor),new Qe([this,"waveVelocity"],.01,[0,1],"波动频率",Ji.defaults.waveVelocity),new D([this,"flowSpeed"],"水流速度",Ji.defaults.flowSpeed),new Qe([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Ji.defaults.specularIntensity),new Qe([this,"murkiness"],.01,[0,10],"水体浑浊度",Ji.defaults.murkiness)]}}};f(Ji,"createDefaultProps",()=>({...ct.createDefaultProps(),allowPicking:!0,url:"",currentTime:0,materialParams:bt({}),waterColor:[.15,.16,0,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowSpeed:0,murkiness:5})),f(Ji,"type",Ji.register("ESSubmergingAnalysis",Ji,{chsName:"淹没分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESSubmergingAnalysis"}));let Qm=Ji;const yl=class yl extends Jt{constructor(e){super(e);f(this,"_groundHeight",this.disposeVar(z(0)));f(this,"_startEvent",this.dv(new O));f(this,"_stopEvent",this.dv(new O));this.ad(Ze(this.pointsChanged,()=>{var n,r;this.groundHeight=((r=(n=this.points)==null?void 0:n[0])==null?void 0:r[2])??0},{immediate:!0}))}get groundHeight(){return this._groundHeight.value}set groundHeight(e){this._groundHeight.value=e}get groundHeightChanged(){return this._groundHeight.changed}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Dt([this,"startColor"],"起始颜色"),new Dt([this,"endColor"],"结束颜色"),new D([this,"progress"],"计算进度(%)",0,!0),new D([this,"height"],"分析区域高度(m)"),new D([this,"groundHeight"],"地面高度(m)",0,!1,!0),new D([this,"sampleDistance"],"采样间距(m)"),new ys([this,"startTime"],"起始时间(ms)"),new ys([this,"endTime"],"结束时间(ms)"),new D([this,"spanTime"],"时间跨度(h)"),new vt("开始分析",()=>this.start(),[],"start"),new vt("结束分析",()=>this.stop(),[],"stop")]}}};f(yl,"createDefaultProps",()=>({...Jt.createDefaultProps(),height:30,sampleDistance:10,startColor:ot([1,1,0,1]),endColor:ot([1,0,0,1]),startTime:0,endTime:36e6,spanTime:1,progress:0,filled:!1,stroked:!1})),f(yl,"type",yl.register("ESSunshineAnalysis",yl,{chsName:"日照分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"日照分析"})),f(yl,"supportEditingModes",[...Jt.supportEditingModes,nt.HeightModify]);let tv=yl;const Po=class Po extends Xt{constructor(e){super(e);f(this,"_activateEvent",this.disposeVar(new O));f(this,"activate",!1)}get activateEvent(){return this._activateEvent}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new D([this,"zIndex"],"层级序号",Po.defaults.zIndex)],dataSource:[...e.dataSource,new Et([this,"url"],"地形服务地址",Po.defaults.url),new rr([this,"rectangle"],"矩形范围",Po.defaults.rectangle)],more:[...e.more,new D([this,"czmMinzoom"],"czmMinzoom",void 0,!0),new D([this,"czmMaxzoom"],"czmMaxzoom",void 0,!0)]}}};f(Po,"createDefaultProps",()=>({...Xt.createDefaultProps(),url:"http://inner.earthsdk.com/layer.json",rectangle:ot([-180,-90,180,90]),zIndex:0,czmMaxzoom:void 0,czmMinzoom:void 0})),f(Po,"type",Po.register("ESTerrainLayer",Po,{chsName:"地形图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地形图层"}));let ev=Po;const ds=class ds extends Yn{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Dt([this,"color"],"文本颜色",[1,1,1,1]),new D([this,"fontSize"],"文字大小",14),new bd([this,"text"],"内容",ds.defaults.text,void 0,!0),new Dt([this,"backgroundColor"],"背景颜色",ds.defaults.backgroundColor),new rr([this,"padding"],"内边距",ds.defaults.padding),new Dt([this,"borderColor"],"边界颜色"),new rr([this,"borderRadius"],"边界圆角"),new D([this,"borderWidth"],"边界宽度"),new D([this,"rotate"],"旋转角度",ds.defaults.rotate)],more:[...t.more,new wt("czm"),new X([this,"textEditingInteraction"],"文本编辑交互"),new X([this,"textEditing"],"文本编辑"),new D([this,"width"],"宽度",ds.defaults.width,!0),new D([this,"opacity"],"透明度"),new ft([this,"textAlign"],[["center","center"],["left","left"],["right","right"]],"文字位置","left"),new ft([this,"borderStyle"],[["none","none"],["hidden","hidden"],["dotted","dotted"],["dashed","dashed"],["solid","solid"],["double","double"],["groove","groove"],["ridge","ridge"],["inset","inset"],["outset","outset"]],"边框类型")]}}};f(ds,"createDefaultProps",()=>({...Yn.createDefaultProps(),text:"请输入文字",width:80,textEditing:!1,textEditingInteraction:!1,opacity:1,fontSize:14,textAlign:"left",color:ot([1,1,1,1]),backgroundColor:ot([0,0,0,.8]),padding:ot([5,5,5,5]),borderRadius:ot([6,6,6,6]),borderWidth:0,borderColor:ot([1,1,1,1]),borderStyle:"solid",rotate:0})),f(ds,"type",ds.register("ESTextLabel",ds,{chsName:"文本标签",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"文本标签。"}));let Ou=ds;const SD=`
292
+ `,hs=class hs extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new D([this,"size"],"尺寸",hs.defaults.size),new H([this,"autoFollow"],"自动跟随",hs.defaults.autoFollow),new ft([this,"mode"],hs.modes,"模式","blueSky")],more:[...t.more,new D([this,"autoOpacityFactor"],"自动消失系数",hs.defaults.autoOpacityFactor)]}}};f(hs,"createDefaultProps",()=>({...ct.createDefaultProps(),size:1e4,autoFollow:!0,autoOpacityFactor:2,mode:"blueSky",collision:!1,allowPicking:!1})),f(hs,"type",hs.register("ESLocalSkyBox",hs,{chsName:"局部天空盒",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"效果类"})),f(hs,"modes",[["baiyun","baiyun"],["blueSky","blueSky"],["clearSky","clearSky"],["dream","dream"],["starrySky","starrySky"],["sunnySky","sunnySky"],["sunSets","sunSets"]]);let Xm=hs;const sd=class sd extends ct{constructor(e){super(e);f(this,"_location",this.disposeVar(z(void 0)));{const n=()=>{this.location=this.position};n(),this.ad(this.positionChanged.don(n))}}get location(){return this._location.value}set location(e){this._location.value=e}get locationChanged(){return this._location.changed}};f(sd,"type",sd.register("ESLocationMeasurement",sd,{chsName:"位置测量点",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"位置测量点"}));let $m=sd;const Gi=class Gi extends ct{constructor(e){super(e);f(this,"_player",this.dv(new kr));{const n=Gi.defaults;this.d(lt([this._player,"loop"],[this,"playingLoop"],r=>r??n.playingLoop,r=>r??n.playingLoop)),this.d(lt([this._player,"currentTime"],[this,"currentTime"],r=>r??n.currentTime,r=>r??n.currentTime)),this.d(lt([this._player,"duration"],[this,"duration"],r=>r??n.duration,r=>r??n.duration)),this.d(lt([this._player,"playing"],[this,"playing"],r=>r??n.playing,r=>r??n.playing)),this.d(lt([this._player,"speed"],[this,"playingSpeed"],r=>r??n.playingSpeed,r=>r??n.playingSpeed))}}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new wt("通用"),new vt("飞入",n=>this.flyTo(n),[1e3],"flyTo"),new io([this,"updateCallback"],"更新回调函数",void 0,void 0,!0),new D([this,"emissionRate"],"发射率",5,!0),new H([this,"loop"],"是否循环",!0,!0),new D([this,"particleScale"],"等级",1,!0),new D([this,"startScale"],"初始等级",void 0,!0),new D([this,"endScale"],"结束等级",Gi.defaults.endScale,!0),new Dt([this,"color"],"颜色",void 0,!0),new Dt([this,"startColor"],"初始颜色",void 0,!0),new Dt([this,"endColor"],"结束颜色",void 0,!0),new H([this,"sizeInMeters"],"尺寸单位为米",void 0,!0),new D([this,"speed"],"速度",1,!0),new D([this,"minimumSpeed"],"最小速度",void 0,!0),new D([this,"maximumSpeed"],"最大速度",void 0,!0),new D([this,"lifetime"],"生命周期",Number.MAX_VALUE,!0),new D([this,"particleLife"],"粒子生命周期",Gi.defaults.particleLife,!0),new D([this,"minimumParticleLife"],"最小粒子生命周期",void 0,!0),new D([this,"maximumParticleLife"],"最大粒子生命周期",void 0,!0),new D([this,"mass"],"块数量",1,!0),new D([this,"minimumMass"],"最小块数量",void 0,!0),new D([this,"maximumMass"],"最大块数量",void 0,!0),new Ke([this,"imageSize"],"图片尺寸",Gi.defaults.imageSize,!0),new Ke([this,"minimumImageSize"],"最小图片尺寸",void 0,!0),new Ke([this,"maximumImageSize"],"最大图片尺寸",void 0,!0),new mt([this,"image"],"图片",Gi.defaults.image,!0),new ci([this,"translation"],"偏移",[0,0,0],!0),new Ne([this,"bursts"],"bursts",[]),new Et([this,"emitter"],"emitter",Gi.defaults.emitter),new wt("播放器"),new D([this,"ratio"],"播放比率",0,!0),new Cd([this,"playing"],[this,"ratio"],[this,"playingLoop"],"播放器"),new H([this,"playingLoop"],"是否循环",Gi.defaults.playingLoop,!0),new D([this,"currentTime"],"当前时间",Gi.defaults.currentTime,!0),new D([this,"duration"],"过渡时间",Gi.defaults.duration,!0),new H([this,"playing"],"是否播放",Gi.defaults.playing,!0),new D([this,"playingSpeed"],"播放速度",Gi.defaults.playingSpeed,!0)]}}};f(Gi,"createDefaultProps",()=>({...ct.createDefaultProps(),emitter:fe({type:"CircleEmitter",radius:.5}),bursts:vg(void 0),translation:oe(void 0),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",imageSize:oe([20,20]),minimumImageSize:oe(void 0),maximumImageSize:oe(void 0),updateCallback:void 0,emissionRate:void 0,loop:void 0,particleScale:void 0,startScale:void 0,endScale:4,color:oe(void 0),startColor:oe(void 0),endColor:oe(void 0),sizeInMeters:void 0,speed:void 0,minimumSpeed:void 0,maximumSpeed:void 0,lifetime:void 0,particleLife:.5,minimumParticleLife:void 0,maximumParticleLife:void 0,mass:void 0,minimumMass:void 0,maximumMass:void 0,playingLoop:!0,currentTime:0,duration:6e3,playingSpeed:1,playing:!0})),f(Gi,"type",Gi.register("ESParticleSystemPrimitive",Gi,{chsName:"粒子",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"通过Cesium的Primitive API 实现的粒子特效。"}));let zf=Gi;const cs=class cs extends Yn{constructor(e){super(e);f(this,"initialStyle",this.ad(fe(void 0)));f(this,"_getInitialStyleEvent",this.disposeVar(new O))}get getInitialStyleEvent(){return this._getInitialStyleEvent}getInitialStyle(){return Promise.race([new Promise(e=>{const n=this.d(this.initialStyle.changed.disposableOnce(e));this.getInitialStyleEvent.emit(),setTimeout(()=>{n(),e(void 0)},2e3)})])}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ft([this,"mode"],cs.modes,"模式",cs.defaults.mode),new Et([this,"style"],"样式",cs.defaults.style),new H([this,"autoAnchor"],"自动锚点对齐",cs.defaults.autoAnchor)]}}};f(cs,"createDefaultProps",()=>({...Yn.createDefaultProps(),mode:"SquareH01",style:bt({fontSize:16,imageSize:[60,60],textBackgroundColor:[1,1,1,0],textBackgroundSize:[120,30],textColor:[1,1,1,1],textOffset:[10,2],textBoxOffset:[40,0],textBoxAlign:"start",textBoxShow:!0,textBoxMode:"default"}),autoAnchor:!0})),f(cs,"type",cs.register("ESPoi2D",cs,{chsName:"ESPoi2D",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"三角形,菱形"})),f(cs,"modes",[["自定义","Custom"],["SquareH01","SquareH01"],["SquareH02","SquareH02"],["SquareV01","SquareV01"],["SquareV02","SquareV02"],["SquareV03","SquareV03"],["SquareV04","SquareV04"],["Flag01","Flag01"],["Flag02","Flag02"],["Linear01","Linear01"],["Linear02","Linear02"],["Linear03","Linear03"],["CircularH01","CircularH01"],["CircularH02","CircularH02"],["CircularV01","CircularV01"],["CircularV02","CircularV02"],["CircularV03","CircularV03"],["CircularV04","CircularV04"],["CircularV05","CircularV05"],["P3D01","P3D01"],["P3D02","P3D02"],["P3D03","P3D03"],["P3D04","P3D04"],["P3D05","P3D05"],["P3D06","P3D06"],["P3D07","P3D07"],["Diamond01","Diamond01"],["Diamond02","Diamond02"],["Stranger","Stranger"],["ManNormal","ManNormal"],["ManAbnormal","ManAbnormal"],["WomanNormal","WomanNormal"],["WomanAbnormal","WomanAbnormal"],["Camera","Camera"]]);let Fc=cs;const Us=class Us extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ft([this,"mode"],Us.modes,"模式",Us.defaults.mode),new Et([this,"style"],"样式",Us.defaults.style)]}}};f(Us,"createDefaultProps",()=>({...ct.createDefaultProps(),mode:"triangle",style:bt({UI_Color:[.09803921568627451,.40784313725490196,.8,1],FX_Color:[.09803921568627451,.40784313725490196,.8,1]})})),f(Us,"type",Us.register("ESPoi3D",Us,{chsName:"ESPoi3D",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"三角形,菱形"})),f(Us,"modes",[["三角形","triangle"],["菱形","diamond"],["制(存)梁场","BridgePrefabricationSite"],["汽车运输便道","ExportRoad"],["拌合站","MixingStation"],["小型预制构件厂","PrefabricatedComponentsSite"],["项目部","ProjectDepartment"],["铁路岔线","RailwayFork"],["钢筋加工厂","RebarMachining"],["临时电力干线","TempElectricMain"],["铺轨基地","TrackLayingBase"],["汽车运梁通道","TransportationBridge"]]);let Ym=Us;const Zu=class Zu extends Jt{constructor(e){super(e);f(this,"_czmFlattenedPlaneId",this.dv(z("")))}get czmFlattenedPlaneId(){return this._czmFlattenedPlaneId.value}set czmFlattenedPlaneId(e){this._czmFlattenedPlaneId.value=e}get czmFlattenedPlaneIdChanged(){return this._czmFlattenedPlaneId.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new mt([this,"targetID"],"目标图层id","")]}}};f(Zu,"createDefaultProps",()=>({...Jt.createDefaultProps(),targetID:"",filled:!1})),f(Zu,"type",Zu.register("ESPolygonFlattenedPlane",Zu,{chsName:"压平",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPolygonFlattenedPlane"}));let Jm=Zu;const Ku=class Ku extends Xt{constructor(e){super(e);f(this,"_czmFlattenedPlaneId",this.dv(z("")))}get czmFlattenedPlaneId(){return this._czmFlattenedPlaneId.value}set czmFlattenedPlaneId(e){this._czmFlattenedPlaneId.value=e}get czmFlattenedPlaneIdChanged(){return this._czmFlattenedPlaneId.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new mt([this,"targetID"],"目标图层id","")],style:[...e.style,new H([this,"stroked"],"开启线样式",!1),new Dt([this,"strokeColor"],"线颜色",[1,1,1,1]),new D([this,"strokeWidth"],"线宽",1),new H([this,"filled"],"开启填充样式",!1),new Dt([this,"fillColor"],"填充颜色",[1,1,1,.5]),new H([this,"strokeGround"],"线贴地",!1),new H([this,"fillGround"],"填充贴地",!1)]}}};f(Ku,"createDefaultProps",()=>({...Xt.createDefaultProps(),targetID:"",filled:!1,stroked:!1,strokeColor:ot([1,1,1,1]),strokeWidth:1,fillColor:ot([1,1,1,.5]),strokeGround:!1,fillGround:!1,pointsSet:yg([])})),f(Ku,"type",Ku.register("ESPolygonsFlattenedPlane",Ku,{chsName:"多压平",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPolygonsFlattenedPlane"}));let Zm=Ku;const cE=async(i,t,e)=>{const{viewer:n}=i;if(!n){console.error("AddTrees: ueViewer.viewer is undefined");return}const r=await n.callUeFunc({f:"AddTrees",p:{id:t,TreeParams:e}});return r.error&&console.error("AddTrees:",r.error),r},dE=async(i,t)=>{const{viewer:e}=i;if(!e){console.error("RemoveAllTrees: ueViewer.viewer is undefined");return}const n=await e.callUeFunc({f:"RemoveAllTrees",p:{id:t}});return n.error&&console.error("RemoveAllTrees:",n.error),n},fE=async(i,t,e)=>{const{viewer:n}=i;if(!n){console.error("UpdateTreeParams: ueViewer.viewer is undefined");return}const r=await n.callUeFunc({f:"UpdateTreeParams",p:{id:t,TreeParams:e}});return r.error&&console.error("UpdateTreeParams:",r.error),r},gE=async(i,t,e,n)=>{const{viewer:r}=i;if(!r){console.error("CutDownTrees: ueViewer.viewer is undefined");return}const s=await r.callUeFunc({f:"CutDownTrees",p:{id:t,TreeIds:e,TimeLength:n}});return s.error&&console.error("CutDownTrees:",s.error),s},pE=async(i,t,e,n,r)=>{const{viewer:s}=i;if(!s){console.error("GrowthSimulation: ueViewer.viewer is undefined");return}const o=await s.callUeFunc({f:"GrowthSimulation",p:{id:t,ToParams:e,SwitchTime:r,TimeLength:n}});return o.error&&console.error("GrowthSimulation:",o.error),o},Qu=class Qu extends Xt{constructor(e){super(e);f(this,"_addTreesEvent",this.dv(new O));f(this,"_removeAllTreesEvent",this.dv(new O));f(this,"_updateTreeParamsEvent",this.dv(new O));f(this,"_cutDownTreesEvent",this.dv(new O));f(this,"_growthSimulationEvent",this.dv(new O))}async addTreesCallFunc(e,n){return await cE(e,this.id,n)}async updateTreeParamsCallFunc(e,n){return await fE(e,this.id,n)}async cutDownTreesCallFunc(e,n,r){return await gE(e,this.id,n,r)}async removeAllTreesCallFunc(e){return await dE(e,this.id)}async growthSimulationCallFunc(e,n,r,s){return await pE(e,this.id,n,r,s)}async getIdByComponentNameAndHitItem(e,n,r){return await e.getIdByComponentNameAndHitItem(this.id,n,r)}get addTreesEvent(){return this._addTreesEvent}addTrees(e){this._addTreesEvent.emit(e)}get removeAllTreesEvent(){return this._removeAllTreesEvent}removeAllTrees(){this._removeAllTreesEvent.emit()}get updateTreeParamsEvent(){return this._updateTreeParamsEvent}updateTreeParams(e){this._updateTreeParamsEvent.emit(e)}get cutDownTreesEvent(){return this._cutDownTreesEvent}cutDownTrees(e,n){this._cutDownTreesEvent.emit(e,n)}get growthSimulationEvent(){return this._growthSimulationEvent}growthSimulation(e,n,r){this._growthSimulationEvent.emit(e,n,r)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new wt("通用"),new Ne([this,"treeTypes"],"treeTypes",[],"{ name: string, meshPath: string }[]",!0),new D([this,"stumpId"],"树桩id"),new D([this,"intervalTime"],"动画间隔时间"),new D([this,"switchIntervalTime"],"切换间隔时间")]}}};f(Qu,"createDefaultProps",()=>({...Xt.createDefaultProps(),treeTypes:fe([]),stumpId:-1,intervalTime:.1,switchIntervalTime:.5})),f(Qu,"type",Qu.register("ESSeparateFoliage",Qu,{chsName:"单体控制森林",tags:["ESObjects","_ES_Impl_UE"],description:"ESSeparateFoliage"}));let Km=Qu;function Bf(i,t,e){const n="buffer"in i,r=n?i.buffer:i;n&&(t+=i.byteOffset);const s=new Array(e),o=new DataView(r);for(let a=0;a<e;++a){const l=o.getUint8(t+a);s[a]=String.fromCharCode(l)}return s.join("")}function Uf(i,t){const e="buffer"in i,n=e?i.buffer:i;return e&&(t+=i.byteOffset),new DataView(n).getUint32(t,!0)}function mE(i,t,e){const n="buffer"in i,r=n?i.buffer:i;if(n&&(t+=i.byteOffset),t+e>r.byteLength){console.error("byteOffset + length > buffer.byteLength");return}return new Uint8Array(r,t,e)}function _D(i,t,e){const n="buffer"in i,r=n?i.buffer:i;if(n&&(t+=i.byteOffset),t+e*2>r.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Uint16Array(r,t,e)}function wD(i,t,e){const n="buffer"in i,r=n?i.buffer:i;if(n&&(t+=i.byteOffset),t+e*4>r.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Uint32Array(r,t,e)}function ED(i,t,e){const n="buffer"in i,r=n?i.buffer:i;if(n&&(t+=i.byteOffset),t+e*4>r.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Float32Array(r,t,e)}function vE(i){if(Bf(i,0,4)!=="glTF"){console.error("Not a glTF file");return}const e=Uf(i,4);if(e!==2){console.error("Unsupported glTF version");return}const n=Uf(i,8);if(n!==i.byteLength){console.error("Invalid glTF length");return}const r=Uf(i,12);if(r+12+4>n){console.error("Invalid glTF chunk length");return}if(Bf(i,16,4)!=="JSON"){console.error("Invalid glTF chunk type");return}const o=Bf(i,20,r),a={version:e,length:n,gltfJson:o};if(20+r<i.byteLength){const l=Uf(i,20+r);if(Bf(i,20+r+4,4)!=="BIN\0"){console.error("Invalid glTF chunk type");return}const h=mE(i,20+r+8,l);a.gltfBinary=h}return a}window.parseGlb=vE;function yE(i){const t=vE(i);if(t===void 0||!t.gltfBinary)return;const e=JSON.parse(t.gltfJson);return e.nodes.map(n=>{var r=e.meshes[n.mesh],s=r.primitives[0].attributes.POSITION,o=r.primitives[0].indices,a=e.accessors[s],l=e.bufferViews[a.bufferView];if(!t.gltfBinary)throw new Error("!glbParseResult.gltfBinary");const u=ED(t.gltfBinary,l.byteOffset??0,l.byteLength/4);var h=e.accessors[o],c=e.bufferViews[h.bufferView];if(!t.gltfBinary)throw new Error("!glbParseResult.gltfBinary");let d;return h.componentType===5121?d=mE(t.gltfBinary,c.byteOffset??0,c.byteLength/1):h.componentType===5123?d=_D(t.gltfBinary,c.byteOffset??0,c.byteLength/2):h.componentType===5125&&(d=wD(t.gltfBinary,c.byteOffset??0,c.byteLength/4)),{name:n.name,posBuffer:u,indicesBuffer:d}})}window.parseWaterGlb=yE;const Ji=class Ji extends ct{constructor(e){super(e);f(this,"_submergingData");f(this,"_allMoments",[]);{const n=()=>{this.url!=""&&fetch(this.url).then(r=>{r.status==200&&r.ok&&r.arrayBuffer().then(s=>{this._submergingData=yE(s);const o=this._submergingData.map(a=>Date.parse(a.name)).sort();this._allMoments=o,this.currentTime==0&&(this.currentTime=o[0]),this.readyEvent.emit(void 0)})}).catch(r=>{console.log(r)})};n(),this.d(this.urlChanged.don(()=>{n()}))}this.ad(Ze([this.waterColorChanged,this.frequencyChanged,this.amplitudeChanged,this.waveVelocityChanged,this.specularIntensityChanged,this.murkinessChanged,this.flowSpeedChanged],()=>{this.waterType="custom"}))}get getSubmergingData(){return this._submergingData}getAllMoments(){return this._allMoments}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new mt([this,"url"],"Url地址",Ji.defaults.url),new Qe([this,"amplitude"],.01,[0,1],"振幅",Ji.defaults.amplitude),new D([this,"frequency"],"频率",Ji.defaults.frequency),new D([this,"currentTime"],"当前时间",Ji.defaults.currentTime),new Et([this,"materialParams"],"材质参数",Ji.defaults.materialParams),new ft([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型","river"),new Dt([this,"waterColor"],"水的底色",Ji.defaults.waterColor),new Qe([this,"waveVelocity"],.01,[0,1],"波动频率",Ji.defaults.waveVelocity),new D([this,"flowSpeed"],"水流速度",Ji.defaults.flowSpeed),new Qe([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Ji.defaults.specularIntensity),new Qe([this,"murkiness"],.01,[0,10],"水体浑浊度",Ji.defaults.murkiness)]}}};f(Ji,"createDefaultProps",()=>({...ct.createDefaultProps(),allowPicking:!0,url:"",currentTime:0,materialParams:bt({}),waterColor:[.15,.16,0,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowSpeed:0,murkiness:5})),f(Ji,"type",Ji.register("ESSubmergingAnalysis",Ji,{chsName:"淹没分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESSubmergingAnalysis"}));let Qm=Ji;const yl=class yl extends Jt{constructor(e){super(e);f(this,"_groundHeight",this.disposeVar(z(0)));f(this,"_startEvent",this.dv(new O));f(this,"_stopEvent",this.dv(new O));this.ad(Ze(this.pointsChanged,()=>{var n,r;this.groundHeight=((r=(n=this.points)==null?void 0:n[0])==null?void 0:r[2])??0},{immediate:!0}))}get groundHeight(){return this._groundHeight.value}set groundHeight(e){this._groundHeight.value=e}get groundHeightChanged(){return this._groundHeight.changed}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Dt([this,"startColor"],"起始颜色"),new Dt([this,"endColor"],"结束颜色"),new D([this,"progress"],"计算进度(%)",0,!0),new D([this,"height"],"分析区域高度(m)"),new D([this,"groundHeight"],"地面高度(m)",0,!1,!0),new D([this,"sampleDistance"],"采样间距(m)"),new ys([this,"startTime"],"起始时间(ms)"),new ys([this,"endTime"],"结束时间(ms)"),new D([this,"spanTime"],"时间跨度(h)"),new vt("开始分析",()=>this.start(),[],"start"),new vt("结束分析",()=>this.stop(),[],"stop")]}}};f(yl,"createDefaultProps",()=>({...Jt.createDefaultProps(),height:30,sampleDistance:10,startColor:ot([1,1,0,1]),endColor:ot([1,0,0,1]),startTime:0,endTime:36e6,spanTime:1,progress:0,filled:!1,stroked:!1})),f(yl,"type",yl.register("ESSunshineAnalysis",yl,{chsName:"日照分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"日照分析"})),f(yl,"supportEditingModes",[...Jt.supportEditingModes,nt.HeightModify]);let tv=yl;const Po=class Po extends Xt{constructor(e){super(e);f(this,"_activateEvent",this.disposeVar(new O));f(this,"activate",!1)}get activateEvent(){return this._activateEvent}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new D([this,"zIndex"],"层级序号",Po.defaults.zIndex)],dataSource:[...e.dataSource,new Et([this,"url"],"地形服务地址",Po.defaults.url),new rr([this,"rectangle"],"矩形范围",Po.defaults.rectangle)],more:[...e.more,new D([this,"czmMinzoom"],"czmMinzoom",void 0,!0),new D([this,"czmMaxzoom"],"czmMaxzoom",void 0,!0)]}}};f(Po,"createDefaultProps",()=>({...Xt.createDefaultProps(),url:"http://inner.earthsdk.com/layer.json",rectangle:ot([-180,-90,180,90]),zIndex:0,czmMaxzoom:void 0,czmMinzoom:void 0})),f(Po,"type",Po.register("ESTerrainLayer",Po,{chsName:"地形图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地形图层"}));let ev=Po;const ds=class ds extends Yn{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Dt([this,"color"],"文本颜色",[1,1,1,1]),new D([this,"fontSize"],"文字大小",14),new bd([this,"text"],"内容",ds.defaults.text,void 0,!0),new Dt([this,"backgroundColor"],"背景颜色",ds.defaults.backgroundColor),new rr([this,"padding"],"内边距",ds.defaults.padding),new Dt([this,"borderColor"],"边界颜色"),new rr([this,"borderRadius"],"边界圆角"),new D([this,"borderWidth"],"边界宽度"),new D([this,"rotate"],"旋转角度",ds.defaults.rotate)],more:[...t.more,new wt("czm"),new H([this,"textEditingInteraction"],"文本编辑交互"),new H([this,"textEditing"],"文本编辑"),new D([this,"width"],"宽度",ds.defaults.width,!0),new D([this,"opacity"],"透明度"),new ft([this,"textAlign"],[["center","center"],["left","left"],["right","right"]],"文字位置","left"),new ft([this,"borderStyle"],[["none","none"],["hidden","hidden"],["dotted","dotted"],["dashed","dashed"],["solid","solid"],["double","double"],["groove","groove"],["ridge","ridge"],["inset","inset"],["outset","outset"]],"边框类型")]}}};f(ds,"createDefaultProps",()=>({...Yn.createDefaultProps(),text:"请输入文字",width:80,textEditing:!1,textEditingInteraction:!1,opacity:1,fontSize:14,textAlign:"left",color:ot([1,1,1,1]),backgroundColor:ot([0,0,0,.8]),padding:ot([5,5,5,5]),borderRadius:ot([6,6,6,6]),borderWidth:0,borderColor:ot([1,1,1,1]),borderStyle:"solid",rotate:0})),f(ds,"type",ds.register("ESTextLabel",ds,{chsName:"文本标签",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"文本标签。"}));let Ou=ds;const SD=`
293
293
  #### 默认值如下
294
294
  \`\`\`js
295
295
  {
296
296
  "Title": "示例",
297
297
  "Content": "这是一个示例\\n帮助你理解info的数据形式\\nnum:1\\nkey:'value'\\n"
298
298
  }
299
- \`\`\``,Dr=class Dr extends Yn{constructor(e){super(e);f(this,"_callFunctionEvent",this.disposeVar(new O));f(this,"_callFunctionResultEvent",this.dv(new O))}get __callFunctionResultEvent(){return this._callFunctionResultEvent}get callFunctionEvent(){return this._callFunctionEvent}callFunction(e,n){return new Promise(r=>{const s=new B,o=setTimeout(()=>{s.isDestroyed()||(s.destroy(),r(void 0))},1e4);s.d(this._callFunctionResultEvent.donce(a=>{s.isDestroyed()||(s.destroy(),r(a),clearTimeout(o))})),this._callFunctionEvent.emit(e,n)})}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ci([this,"positionOffset"],"positionOffset",Dr.defaults.positionOffset),new ci([this,"rotationOffset"],"rotationOffset",Dr.defaults.rotationOffset),new mt([this,"actorTag"],"actorTag",Dr.defaults.actorTag),new mt([this,"widgetClass"],"widgetClass",Dr.defaults.widgetClass),new mt([this,"socketName"],"socketName",Dr.defaults.socketName),new Et([this,"info"],"info",Dr.defaults.info,SD,!0)],more:[...e.more,new vt("回调函数",this.callFunction.bind(this),["",""],"callFunction")]}}};f(Dr,"createDefaultProps",()=>({...Yn.createDefaultProps(),widgetClass:"",info:fe({Title:"标题示例",Content:"内容示例"})})),f(Dr,"type",Dr.register("ESUEWidget",Dr,{chsName:"部件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"3DTileset"}));let iv=Dr;const th=class th extends ct{constructor(){super(...arguments);f(this,"_callFunctionEvent",this.dv(new O));f(this,"_callFunctionResultEvent",this.dv(new O));f(this,"_actorEvent",this.dv(new O));f(this,"_lastActorStatus",this.dv(z("null")))}get __callFunctionResultEvent(){return this._callFunctionResultEvent}get callFunctionEvent(){return this._callFunctionEvent}callFunction(e,n){return new Promise(r=>{const s=new B,o=setTimeout(()=>{s.isDestroyed()||(s.destroy(),r(void 0))},1e4);s.d(this._callFunctionResultEvent.donce(a=>{s.isDestroyed()||(s.destroy(),r(a),clearTimeout(o))})),this._callFunctionEvent.emit(e,n)})}getBoundSphereWithChildren(e){return new Promise((n,r)=>{n(void 0)})}get actorEvent(){return this._actorEvent}get lastActorStatus(){return this._lastActorStatus.value}set lastActorStatus(e){this._lastActorStatus.value=e}get lastActorStatusChanged(){return this._lastActorStatus.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new mt([this,"actorTag"],"actorTag",""),new mt([this,"actorClass"],"actorClass",""),new X([this,"highlight"],"是否高亮",!1)],more:[...e.more,new vt("回调函数",this.callFunction.bind(this),["",""],"callFunction")]}}};f(th,"createDefaultProps",()=>({...ct.createDefaultProps(),actorTag:"",actorClass:"",highlight:!1,allowPicking:!0})),f(th,"type",th.register("ESUnrealActor",th,{chsName:"UnrealActor",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"UnrealActor"}));let nv=th;const Zi=class Zi extends ct{constructor(e){super(e);f(this,"editingBindMode","doublePoints");f(this,"_resetWithCameraInfoEvent",this.dv(new O));this.collision=!1}get resetWithCameraInfoEvent(){return this._resetWithCameraInfoEvent}resetWithCameraInfo(){this._resetWithCameraInfoEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new X([this,"looping"],"循环",Zi.defaults.looping),new X([this,"showFrustum"],"视椎体",Zi.defaults.showFrustum),new D([this,"aspectRatio"],"宽高比",Zi.defaults.aspectRatio),new D([this,"fov"],"横向夹角",Zi.defaults.fov),new D([this,"far"],"视野长度",Zi.defaults.far),new D([this,"near"],"近面距离",Zi.defaults.near),new Et([this,"videoStreamUrl"],"视频路径",Zi.defaults.videoStreamUrl),new D([this,"zIndex"],"显示优先级",Zi.defaults.zIndex),new ft([this,"videoStreamType"],Zi.videoStreamTypes,"视频类型","video")],more:[...e.more,new vt("以当前相机状态重置",()=>this.resetWithCameraInfo(),[],"resetWithCameraInfo")]}}};f(Zi,"createDefaultProps",()=>({...ct.createDefaultProps(),fov:90,aspectRatio:1.77778,far:100,near:5,videoStreamUrl:"",zIndex:1,showFrustum:!0,looping:!0,videoStreamType:"video"})),f(Zi,"type",Zi.register("ESVideoFusion",Zi,{chsName:"视频融合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视频融合"})),f(Zi,"videoStreamTypes",[["video","video"],["hls","hls"],["flv","flv"],["img","img"],["gif","gif"]]);let rv=Zi;const Rr=class Rr extends ct{constructor(e){super(e);f(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new X([this,"showFrustum"],"视椎体",Rr.defaults.showFrustum),new D([this,"aspectRatio"],"宽高比",Rr.defaults.aspectRatio),new D([this,"fov"],"横向夹角",Rr.defaults.fov),new D([this,"near"],"近面距离",Rr.defaults.near),new D([this,"far"],"视野长度",Rr.defaults.far),new D([this,"zIndex"],"显示优先级",Rr.defaults.zIndex)]}}};f(Rr,"createDefaultProps",()=>({...ct.createDefaultProps(),fov:90,aspectRatio:1.77778,near:10,far:100,zIndex:1,showFrustum:!0,collision:!1})),f(Rr,"type",Rr.register("ESViewShed",Rr,{chsName:"视域分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"信号传输器"}));let sv=Rr;const bD=`
299
+ \`\`\``,Dr=class Dr extends Yn{constructor(e){super(e);f(this,"_callFunctionEvent",this.disposeVar(new O));f(this,"_callFunctionResultEvent",this.dv(new O))}get __callFunctionResultEvent(){return this._callFunctionResultEvent}get callFunctionEvent(){return this._callFunctionEvent}callFunction(e,n){return new Promise(r=>{const s=new B,o=setTimeout(()=>{s.isDestroyed()||(s.destroy(),r(void 0))},1e4);s.d(this._callFunctionResultEvent.donce(a=>{s.isDestroyed()||(s.destroy(),r(a),clearTimeout(o))})),this._callFunctionEvent.emit(e,n)})}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ci([this,"positionOffset"],"positionOffset",Dr.defaults.positionOffset),new ci([this,"rotationOffset"],"rotationOffset",Dr.defaults.rotationOffset),new mt([this,"actorTag"],"actorTag",Dr.defaults.actorTag),new mt([this,"widgetClass"],"widgetClass",Dr.defaults.widgetClass),new mt([this,"socketName"],"socketName",Dr.defaults.socketName),new Et([this,"info"],"info",Dr.defaults.info,SD,!0)],more:[...e.more,new vt("回调函数",this.callFunction.bind(this),["",""],"callFunction")]}}};f(Dr,"createDefaultProps",()=>({...Yn.createDefaultProps(),widgetClass:"",info:fe({Title:"标题示例",Content:"内容示例"})})),f(Dr,"type",Dr.register("ESUEWidget",Dr,{chsName:"部件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"3DTileset"}));let iv=Dr;const th=class th extends ct{constructor(){super(...arguments);f(this,"_callFunctionEvent",this.dv(new O));f(this,"_callFunctionResultEvent",this.dv(new O));f(this,"_actorEvent",this.dv(new O));f(this,"_lastActorStatus",this.dv(z("null")))}get __callFunctionResultEvent(){return this._callFunctionResultEvent}get callFunctionEvent(){return this._callFunctionEvent}callFunction(e,n){return new Promise(r=>{const s=new B,o=setTimeout(()=>{s.isDestroyed()||(s.destroy(),r(void 0))},1e4);s.d(this._callFunctionResultEvent.donce(a=>{s.isDestroyed()||(s.destroy(),r(a),clearTimeout(o))})),this._callFunctionEvent.emit(e,n)})}getBoundSphereWithChildren(e){return new Promise((n,r)=>{n(void 0)})}get actorEvent(){return this._actorEvent}get lastActorStatus(){return this._lastActorStatus.value}set lastActorStatus(e){this._lastActorStatus.value=e}get lastActorStatusChanged(){return this._lastActorStatus.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new mt([this,"actorTag"],"actorTag",""),new mt([this,"actorClass"],"actorClass",""),new H([this,"highlight"],"是否高亮",!1)],more:[...e.more,new vt("回调函数",this.callFunction.bind(this),["",""],"callFunction")]}}};f(th,"createDefaultProps",()=>({...ct.createDefaultProps(),actorTag:"",actorClass:"",highlight:!1,allowPicking:!0})),f(th,"type",th.register("ESUnrealActor",th,{chsName:"UnrealActor",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"UnrealActor"}));let nv=th;const Zi=class Zi extends ct{constructor(e){super(e);f(this,"editingBindMode","doublePoints");f(this,"_resetWithCameraInfoEvent",this.dv(new O));this.collision=!1}get resetWithCameraInfoEvent(){return this._resetWithCameraInfoEvent}resetWithCameraInfo(){this._resetWithCameraInfoEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new H([this,"looping"],"循环",Zi.defaults.looping),new H([this,"showFrustum"],"视椎体",Zi.defaults.showFrustum),new D([this,"aspectRatio"],"宽高比",Zi.defaults.aspectRatio),new D([this,"fov"],"横向夹角",Zi.defaults.fov),new D([this,"far"],"视野长度",Zi.defaults.far),new D([this,"near"],"近面距离",Zi.defaults.near),new Et([this,"videoStreamUrl"],"视频路径",Zi.defaults.videoStreamUrl),new D([this,"zIndex"],"显示优先级",Zi.defaults.zIndex),new ft([this,"videoStreamType"],Zi.videoStreamTypes,"视频类型","video")],more:[...e.more,new vt("以当前相机状态重置",()=>this.resetWithCameraInfo(),[],"resetWithCameraInfo")]}}};f(Zi,"createDefaultProps",()=>({...ct.createDefaultProps(),fov:90,aspectRatio:1.77778,far:100,near:5,videoStreamUrl:"",zIndex:1,showFrustum:!0,looping:!0,videoStreamType:"video"})),f(Zi,"type",Zi.register("ESVideoFusion",Zi,{chsName:"视频融合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视频融合"})),f(Zi,"videoStreamTypes",[["video","video"],["hls","hls"],["flv","flv"],["img","img"],["gif","gif"]]);let rv=Zi;const Rr=class Rr extends ct{constructor(e){super(e);f(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new H([this,"showFrustum"],"视椎体",Rr.defaults.showFrustum),new D([this,"aspectRatio"],"宽高比",Rr.defaults.aspectRatio),new D([this,"fov"],"横向夹角",Rr.defaults.fov),new D([this,"near"],"近面距离",Rr.defaults.near),new D([this,"far"],"视野长度",Rr.defaults.far),new D([this,"zIndex"],"显示优先级",Rr.defaults.zIndex)]}}};f(Rr,"createDefaultProps",()=>({...ct.createDefaultProps(),fov:90,aspectRatio:1.77778,near:10,far:100,zIndex:1,showFrustum:!0,collision:!1})),f(Rr,"type",Rr.register("ESViewShed",Rr,{chsName:"视域分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"信号传输器"}));let sv=Rr;const bD=`
300
300
  #### 默认值如下
301
301
  \`\`\`js
302
302
  {
@@ -387,7 +387,7 @@ export type ESJTimeIntervalCollectionJsonType = {
387
387
  \`\`\`
388
388
  ${lv}
389
389
  \`\`\`
390
- `,xD="${earthsdk3-assets-script-dir}/assets/misc/2.geojson",Lt=class Lt extends Xt{constructor(e){super(e);f(this,"_flyToFeatureEvent",this.dv(new O));f(this,"_flyToFeatureIndexEvent",this.dv(new O));f(this,"_setFeatureStyleEvent",this.disposeVar(new O));f(this,"_resetFeatureStyleEvent",this.disposeVar(new O));f(this,"_features",this.disposeVar(fe(void 0)));f(this,"pickedInfoType","FeatureCollection");f(this,"abortController");this._updateUrl(),this.ad(this.urlChanged.don(()=>{this._updateUrl()})),this.ad(this.editingChanged.don(()=>{console.warn("ESGeoJson暂不支持编辑!")}))}get flyToFeatureEvent(){return this._flyToFeatureEvent}flyToFeature(e,n,r){this._flyToFeatureEvent.emit(e,n,r)}get flyToFeatureIndexEvent(){return this._flyToFeatureIndexEvent}flyToFeatureIndex(e,n){this._flyToFeatureIndexEvent.emit(e,n)}get setFeatureStyleEvent(){return this._setFeatureStyleEvent}setFeatureStyle(e,n=!1){this._setFeatureStyleEvent.emit(e,n)}get resetFeatureStyleEvent(){return this._resetFeatureStyleEvent}resetFeatureStyle(){this._resetFeatureStyleEvent.emit()}get features(){return this._features.value}set features(e){this._features.value=e}get featuresChanged(){return this._features.changed}getFeatures(){if(this.features)return this.features;console.log("数据未加载完成,请稍后调用此方法getFeatures()")}getFeatureTable(){if(this.features){let e={};return Ay(this.features).features.forEach(n=>{Object.assign(e,n.properties)}),Object.keys(e).forEach(n=>{e[n]=typeof e[n]}),e}else console.log("数据未加载完成,请稍后调用此方法getFeatureTable()")}_updateUrl(){var e;if(this.abortController&&this.abortController.abort(),!this.url){this.features=void 0;return}if(typeof this.url=="object")this.features=this.url;else if(ip(this.url))this.features=JSON.parse(this.url);else{this.abortController=new AbortController;const n=this.abortController.signal;fetch(pt.context.getStrFromEnv(this.url),{signal:n}).then(r=>r.json()).then(r=>{this.features=r}).catch(r=>{r.name!="AbortError"&&console.warn("ESGeoJson数据加载失败",r)})}this.pickedInfoType=((e=this.features)==null?void 0:e.type)??"FeatureCollection"}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",dataSource:[...e.dataSource,new Et([this,"url"],"服务地址",Lt.defaults.url),new D([this,"minFeatureVisibleDistance"],"要素最小可视距离",Lt.defaults.minFeatureVisibleDistance),new D([this,"maxFeatureVisibleDistance"],"要素最大可视距离",Lt.defaults.maxFeatureVisibleDistance),new ft([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考"),new ft([this,"classificationType"],Lt.classificationTypes,"贴地附着目标",Lt.defaults.classificationType),new D([this,"zIndex"],"层级排序",Lt.defaults.zIndex)],style:[...e.style,new wt("点样式集合"),new X([this,"textShow"],"是否显示",Lt.defaults.textShow),new Ke([this,"textAnchor"],"锚点",Lt.defaults.anchor),new mt([this,"textProperty"],"标注显示属性",Lt.defaults.textStyle.textProperty),new mt([this,"textDefaultText"],"默认文本",Lt.defaults.textStyle.defaultText),new Dt([this,"textColor"],"文本颜色",Lt.defaults.textStyle.color),new Dt([this,"textBackgroundColor"],"文本背景颜色",Lt.defaults.textStyle.backgroundColor),new mt([this,"textFontStyle"],"字体样式",Lt.defaults.textStyle.fontStyle),new mt([this,"textFontWeight"],"字体粗细",Lt.defaults.textStyle.fontWeight),new D([this,"textFontSize"],"字体大小",Lt.defaults.textStyle.fontSize),new Ke([this,"textOffset"],"像素偏移",Lt.defaults.textStyle.offset),new wt("点图片样式集合"),new X([this,"imageShow"],"是否显示",Lt.defaults.imageShow),new Ke([this,"imageAnchor"],"锚点",Lt.defaults.imageStyle.anchor),new Et([this,"imageUrl"],"图片地址",Lt.defaults.imageStyle.url),new Ke([this,"imageSize"],"图片大小",Lt.defaults.imageStyle.size),new Ke([this,"imageOffset"],"像素偏移",Lt.defaults.imageStyle.offset),new wt("线样式集合"),new X([this,"stroked"],"是否显示",Lt.defaults.stroked),new X([this,"strokeGround"],"贴地",Lt.defaults.strokeStyle.ground),new D([this,"strokeWidth"],"线宽",Lt.defaults.strokeStyle.width),new ft([this,"strokeWidthType"],Lt.strokeStyleWidthTypes,"线宽类型"),new Dt([this,"strokeColor"],"线颜色",Lt.defaults.strokeStyle.color),new mt([this,"strokeMaterial"],"线材质",Lt.defaults.strokeStyle.material),new Et([this,"strokeMaterialParams"],"线材质参数",Lt.defaults.strokeStyle.materialParams),new wt("面样式集合"),new X([this,"filled"],"是否显示",Lt.defaults.filled),new X([this,"fillGround"],"贴地",Lt.defaults.fillStyle.ground),new Dt([this,"fillColor"],"填充颜色",Lt.defaults.fillStyle.color),new mt([this,"fillMaterial"],"填充材质",Lt.defaults.fillStyle.material),new Et([this,"fillMaterialParams"],"填充材质参数",Lt.defaults.fillStyle.materialParams)],more:[...e.more,new wt("标注文本样式"),new mt([this,"textFontFamily"],"字体",Lt.defaults.textStyle.fontFamily),new D([this,"zOrder"],"点排序优先级",Lt.defaults.zOrder),new wt("通用"),new io([this,"loadFuncStr"],"loadFnStr",lv,_E,!0)]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(e){this.strokeStyle={...this.strokeStyle,width:e}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(e){this.strokeStyle={...this.strokeStyle,widthType:e}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(e){this.strokeStyle={...this.strokeStyle,color:[...e]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(e){this.strokeStyle={...this.strokeStyle,material:e}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(e){this.strokeStyle={...this.strokeStyle,materialParams:e}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(e){this.strokeStyle={...this.strokeStyle,ground:e}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(e){this.fillStyle={...this.fillStyle,color:[...e]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(e){this.fillStyle={...this.fillStyle,material:e}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(e){this.fillStyle={...this.fillStyle,materialParams:e}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(e){this.fillStyle={...this.fillStyle,ground:e}}get fillGroundChanged(){return this.fillStyleChanged}get textProperty(){return this.textStyle.textProperty}set textProperty(e){this.textStyle={...this.textStyle,textProperty:e}}get textPropertyChanged(){return this.textStyleChanged}get textDefaultText(){return this.textStyle.defaultText}set textDefaultText(e){this.textStyle={...this.textStyle,defaultText:e}}get textDefaultTextChanged(){return this.textStyleChanged}get textColor(){return this.textStyle.color}set textColor(e){this.textStyle={...this.textStyle,color:e}}get textColorChanged(){return this.textStyleChanged}get textBackgroundColor(){return this.textStyle.backgroundColor}set textBackgroundColor(e){this.textStyle={...this.textStyle,backgroundColor:e}}get textBackgroundColorChanged(){return this.textStyleChanged}get textFontFamily(){return this.textStyle.fontFamily}set textFontFamily(e){this.textStyle={...this.textStyle,fontFamily:e}}get textFontFamilyChanged(){return this.textStyleChanged}get textFontStyle(){return this.textStyle.fontStyle}set textFontStyle(e){this.textStyle={...this.textStyle,fontStyle:e}}get textFontStyleChanged(){return this.textStyleChanged}get textFontWeight(){return this.textStyle.fontWeight}set textFontWeight(e){this.textStyle={...this.textStyle,fontWeight:e}}get textFontWeightChanged(){return this.textStyleChanged}get textFontSize(){return this.textStyle.fontSize}set textFontSize(e){this.textStyle={...this.textStyle,fontSize:e}}get textFontSizeChanged(){return this.textStyleChanged}get textAnchor(){return this.textStyle.anchor}set textAnchor(e){this.textStyle={...this.textStyle,anchor:e}}get textAnchorChanged(){return this.textStyleChanged}get textOffset(){return this.textStyle.offset}set textOffset(e){this.textStyle={...this.textStyle,offset:e}}get textOffsetChanged(){return this.textStyleChanged}get imageUrl(){return this.imageStyle.url}set imageUrl(e){this.imageStyle={...this.imageStyle,url:e}}get imageUrlChanged(){return this.imageStyleChanged}get imageSize(){return this.imageStyle.size}set imageSize(e){this.imageStyle={...this.imageStyle,size:e}}get imageSizeChanged(){return this.imageStyleChanged}get imageAnchor(){return this.imageStyle.anchor}set imageAnchor(e){this.imageStyle={...this.imageStyle,anchor:e}}get imageAnchorChanged(){return this.imageStyleChanged}get imageOffset(){return this.imageStyle.offset}set imageOffset(e){this.imageStyle={...this.imageStyle,offset:e}}get imageOffsetChanged(){return this.imageStyleChanged}};f(Lt,"createDefaultProps",()=>({...Xt.createDefaultProps(),show:!0,allowPicking:!0,loadFuncStr:void 0,url:xD,stroked:!0,strokeStyle:bt({width:1,widthType:"world",color:[.79,.91,.06,1],material:"",materialParams:{},ground:!1}),filled:!0,fillStyle:bt({color:[.79,.91,.06,.2],material:"",materialParams:{},ground:!1}),imageShow:!0,imageStyle:bt({url:"${earthsdk3-assets-script-dir}/assets/img/location.png",size:[32,32],anchor:[.5,1],offset:[0,0]}),textShow:!0,textStyle:bt({textProperty:"",defaultText:"默认标注",color:[1,1,1,1],backgroundColor:void 0,fontFamily:"Arial",fontSize:16,fontStyle:"normal",fontWeight:"normal",anchor:[0,1],offset:[16,-8]}),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN",zIndex:0})),f(Lt,"type",Lt.register("ESGeoJson",Lt,{chsName:"ESGeoJson",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"GeoJson数据加载"})),f(Lt,"strokeStyleWidthTypes",[["screen","screen"],["world","world"]]),f(Lt,"classificationTypes",[["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]]);let kc=Lt;const wl=class wl extends Ot{constructor(e){super(e);f(this,"editingBindMode","doublePoints");f(this,"_height",this.disposeVar(z(0)));{const n=()=>{this.height=this.points&&this.points.length>=2?this.points[1][2]-this.points[0][2]:0};n(),this.ad(this.pointsChanged.don(n))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}};f(wl,"createDefaultProps",()=>({...Ot.createDefaultProps(),stroked:!0,strokeStyle:bt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(wl,"type",wl.register("ESHeightMeasurement",wl,{chsName:"高度测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"高度测量"})),f(wl,"supportEditingModes",[...Ot.supportEditingModes,nt.DoublePoints,nt.DoublePointsAppend,nt.DoublePointsModify]);let uv=wl;const El=class El extends wo{constructor(e){super(e);f(this,"_area",this.dv(z(0)));f(this,"_perimeter",this.dv(z(0)));f(this,"editingBindMode","doublePoints");const n=()=>{this._area.value=Math.PI*this.radius*this.radius,this._perimeter.value=2*Math.PI*this.radius};n(),this.d(this.radiusChanged.don(n))}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}toPolygon(e=10,n){return X1([...this.position],this.radius,e,n)[0].map(s=>[...s,this.position?this.position[2]:0])}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",basic:[...e.basic,new D([this,"radius"],"圆半径",1,!0),new Ne([this,"instances"],"实例化矩阵",El.defaults.instances,void 0,!0)],coordinate:[...e.coordinate,new X([this,"editing"],"是否编辑"),new _s([this,"position"],"三维坐标",[0,0,0],!0),new D([this,"area"],"面积",0,!1,!0),new D([this,"perimeter"],"周长",0,!1,!0)]}}};f(El,"createDefaultProps",()=>({...wo.createDefaultProps(),radius:1,filled:!0,collision:!1,fillStyle:bt({color:[1,1,1,.5],material:"",materialParams:{},ground:!1}),instances:oe([])})),f(El,"type",El.register("ESLocalCircle",El,{chsName:"局部坐标圆形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalCircle"}));let hv=El;const eh=class eh extends wo{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new Ne([this,"points"],"坐标",[])]}}};f(eh,"createDefaultProps",()=>({...wo.createDefaultProps(),points:xm([]),filled:!0})),f(eh,"type",eh.register("ESLocalPolygon",eh,{chsName:"局部2D坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygon"}));let Gc=eh;const ih=class ih extends Nu{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new Ne([this,"points"],"本地位置数组",[])]}}};f(ih,"createDefaultProps",()=>({...Nu.createDefaultProps(),points:Pa(void 0),filled:!0})),f(ih,"type",ih.register("ESLocalPolygonZ",ih,{chsName:"局部坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygonZ"}));let cv=ih;const nh=class nh extends wo{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new D([this,"width"],"宽度"),new D([this,"height"],"高度")]}}};f(nh,"createDefaultProps",()=>({...wo.createDefaultProps(),width:5e5,height:3e5,filled:!0})),f(nh,"type",nh.register("ESLocalRectangle",nh,{chsName:"局部坐标四边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalRectangle"}));let dv=nh;const qs=class qs extends Ot{constructor(e){super(e);f(this,"editingBindMode","lineString");f(this,"_distance",this.dv(z(0)));f(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);f(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());const n=()=>{if(this.points&&this.points.length>=2){const r=_o(this.points,"GEODESIC"),s=r[r.length-1];this._distance.value=s}else this._distance.value=0};n(),this.d(this.pointsChanged.don(n))}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new D([this,"height"],"高度",10),new D([this,"width"],"宽度",10),new ft([this,"materialMode"],qs.materialModes,"模式",qs.defaults.materialMode)],coordinate:[...e.coordinate,new D([this,"distance"],"距离",0,!1,!0)]}}};f(qs,"createDefaultProps",()=>({...Ot.createDefaultProps(),height:10,width:10,materialMode:"singleArrow",filled:!0,stroked:!0,fillStyle:bt({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),f(qs,"type",qs.register("ESPipeFence",qs,{chsName:"管道电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"管道电子围栏"})),f(qs,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","color"]]),f(qs,"supportEditingModes",[...Ot.supportEditingModes,nt.LineStringAppend,nt.LineStringInsert]);let qf=qs;const xo=class xo extends Jn{constructor(e){super(e);f(this,"_setLayerVisibleEvent",this.dv(new O));f(this,"_setLayerColorEvent",this.dv(new O))}get setLayerVisibleEvent(){return this._setLayerVisibleEvent}setLayerVisible(e,n){this._setLayerVisibleEvent.emit(e,n)}get setLayerColorEvent(){return this._setLayerColorEvent}setLayerColor(e,n){this._setLayerColorEvent.emit(e,n)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new wt("ESPipeserTileset"),new vt("设置图层可见性",this.setLayerVisible.bind(this),["",""],"setLayerVisible"),new vt("设置图层颜色",this.setLayerColor.bind(this),["",""],"setLayerColor"),new ft([this,"colorMode"],xo.colorModes,"colorMode",xo.defaults.colorMode,!0)]}}};f(xo,"createDefaultProps",()=>({...Jn.createDefaultProps(),colorMode:"default"})),f(xo,"type",xo.register("ESPipeserTileset",xo,{chsName:"PipeSer图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"PipeSer图层"})),f(xo,"colorModes",[["default","default"],["color","color"],["blend","blend"]]);let fv=xo;const Io=class Io extends Ot{constructor(e){super(e);f(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",coordinate:[...e.coordinate,new D([this,"area"],"面积",0,!1,!0),new D([this,"perimeter"],"周长",0,!1,!0)],basic:[...e.basic,new D([this,"height"],"高度",10),new ft([this,"materialMode"],Io.materialModes,"模式","danger")]}}};f(Io,"createDefaultProps",()=>({...Ot.createDefaultProps(),height:10,materialMode:"danger",filled:!0,collision:!1})),f(Io,"type",Io.register("ESPolygonFence",Io,{chsName:"多边形电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"多边形电子围栏"})),f(Io,"materialModes",[["模式一","danger"],["模式二","checkerboard"],["模式三","warning"],["模式四","cord"],["模式五","scanline"],["模式六","honeycomb"],["模式七","gradientColor"]]),f(Io,"supportEditingModes",[...Ot.supportEditingModes,nt.CircularAppend,nt.CircularInsert,nt.HeightModify]);let Wf=Io;const ya=class ya extends Ot{constructor(e){super(e);f(this,"_deprecated",["ground"]);f(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());f(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new wt("通用"),new X([this,"ground"],"是否贴地"),new X([this,"outlineTranslucent"],"轮廓线半透明"),new D([this,"height"],"高度"),new D([this,"extrudedHeight"],"拉伸高度"),new rr([this,"rectangle"],"范围",ya.defaults.rectangle,!0),new D([this,"stRotation"],"纹理旋转角度"),new D([this,"rotation"],"旋转角度"),new X([this,"pointEditing"],"是否单点编辑")]}}};f(ya,"createDefaultProps",()=>({...Ot.createDefaultProps(),ground:!1,outlineTranslucent:!0,height:0,extrudedHeight:0,rectangle:oe(void 0),rotation:0,stRotation:0,pointEditing:!1,filled:!0})),f(ya,"type",ya.register("ESRectangle",ya,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"矩形"})),f(ya,"supportEditingModes",[...Ot.supportEditingModes,nt.DoublePoints,nt.DoublePointsAppend,nt.DoublePointsModify]);let gv=ya;const rh=class rh extends Jt{getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Ne([this,"innerRings"],"裁切多边形数组",[],void 0,!0),new X([this,"gradient"],"是否使用渐变填充",!1),new X([this,"light"],"是否使用光照",!1)]}}};f(rh,"createDefaultProps",()=>({...Jt.createDefaultProps(),innerRings:yg([]),gradient:!1,light:!1})),f(rh,"type",rh.register("ESPolygonWithHole",rh,{chsName:"内部裁切多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"带洞多边形"}));let pv=rh;const _a=class _a extends Jt{constructor(e){super(e);f(this,"_startEvent",this.disposeVar(new O));f(this,"_stopEvent",this.dv(new O));f(this,"_surfaceArea",this.disposeVar(z(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get surfaceArea(){return this._surfaceArea.value}set surfaceArea(e){this._surfaceArea.value=e}get surfaceChanged(){return this._surfaceArea.changed}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new wt("表面积测量"),new vt("开始计算",()=>this.start(),[],"start"),new vt("停止计算",()=>this.stop(),[],"stop"),new D([this,"interpolation"],"插值距离",_a.defaults.interpolation),new D([this,"offsetHeight"],"偏移高度",_a.defaults.offsetHeight)]}}};f(_a,"createDefaultProps",()=>({...Jt.createDefaultProps(),interpolation:.5,offsetHeight:0,units:ot(["SquareMeter_SquareKilometer","MU_Hectare"]),fillStyle:bt({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),f(_a,"type",_a.register("ESSurfaceAreaMeasurement",_a,{chsName:"表面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"表面积测量"}));let mv=_a;const wa=class wa extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new D([this,"downloadProgress"],"下载进度",wa.defaults.downloadProgress,!0,!0),new Et([this,"importOptions"],"导入参数",wa.defaults.importOptions,void 0,!0)],dataSource:[...t.dataSource,new Et([this,"url"],"路径")]}}};f(wa,"createDefaultProps",()=>({...ct.createDefaultProps(),url:"",importOptions:fe({buildCollisions:"QueryAndPhysics",buildHierarchy:"Simplified",collisionType:"CTF_UseComplexAsSimple",bImportMetaData:!0}),downloadProgress:0})),f(wa,"type",wa.register("ESDatasmithRuntimeModel",wa,{chsName:"Datasmith Model",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Datasmith Model"}));let vv=wa;const Ki=class Ki extends Gc{constructor(t){super(t),this.ad(Ze([this.waterColorChanged,this.waterImageChanged,this.frequencyChanged,this.amplitudeChanged,this.flowDirectionChanged,this.waveVelocityChanged,this.specularIntensityChanged,this.murkinessChanged,this.flowSpeedChanged],()=>{this.waterType="custom"}))}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ft([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",Ki.defaults.waterType),new D([this,"frequency"],"频率",Ki.defaults.frequency),new Qe([this,"amplitude"],.01,[0,1],"振幅",Ki.defaults.amplitude),new Qe([this,"flowDirection"],1,[0,360],"流向",Ki.defaults.flowDirection),new Qe([this,"waveVelocity"],.01,[0,1],"波动频率",Ki.defaults.waveVelocity),new Qe([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Ki.defaults.specularIntensity),new Qe([this,"murkiness"],.1,[0,10],"水体浑浊度",Ki.defaults.murkiness),new D([this,"flowSpeed"],"水流速度",Ki.defaults.flowSpeed),new Dt([this,"waterColor"],"水的底色",Ki.defaults.waterColor),new Et([this,"waterImage"],"水的图片",Ki.defaults.waterImage)]}}};f(Ki,"createDefaultProps",()=>({...Gc.createDefaultProps(),allowPicking:!0,waterImage:fe(void 0),waterColor:[.15,.16,0,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5,stroked:!1,filled:!0})),f(Ki,"type",Ki.register("ESDynamicWater",Ki,{chsName:"动态水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"局部多边形水面"}));let yv=Ki;const Qi=class Qi extends Jt{constructor(t){super(t),this.ad(Ze([this.waterColorChanged,this.waterImageChanged,this.frequencyChanged,this.amplitudeChanged,this.flowDirectionChanged,this.waveVelocityChanged,this.specularIntensityChanged,this.murkinessChanged,this.flowSpeedChanged],()=>{this.waterType="custom"}))}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new ft([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",Qi.defaults.waterType),new D([this,"frequency"],"频率",Qi.defaults.frequency),new Qe([this,"amplitude"],.01,[0,1],"振幅",Qi.defaults.amplitude),new Qe([this,"flowDirection"],1,[0,360],"流向",Qi.defaults.flowDirection),new Qe([this,"waveVelocity"],.01,[0,1],"波动频率",Qi.defaults.waveVelocity),new Qe([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Qi.defaults.specularIntensity),new Qe([this,"murkiness"],.1,[0,10],"水体浑浊度",Qi.defaults.murkiness),new D([this,"flowSpeed"],"水流速度",Qi.defaults.flowSpeed),new Dt([this,"waterColor"],"水的底色",Qi.defaults.waterColor),new Et([this,"waterImage"],"水的图片",Qi.defaults.waterImage)]}}};f(Qi,"createDefaultProps",()=>({...Jt.createDefaultProps(),allowPicking:!0,waterImage:fe({}),waterColor:[.15,.16,0,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5})),f(Qi,"type",Qi.register("ESGeoWater",Qi,{chsName:"地理水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地理动态水面"}));let _v=Qi;const Sl=class Sl extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new D([this,"downloadProgress"],"下载进度",Sl.defaults.downloadProgress,!0,!0),new mt([this,"levelName"],"levelName",""),new D([this,"levelLoadDistance"],"levelLoadDistance",1e3),new ci([this,"levelOffset"],"levelOffset",[0,0,0])],dataSource:[...t.dataSource,new Et([this,"url"],"url","")]}}};f(Sl,"createDefaultProps",()=>({...ct.createDefaultProps(),url:"",downloadProgress:0,levelName:"",levelOffset:ot([0,0,0]),levelLoadDistance:1e3})),f(Sl,"type",Sl.register("ESLevelRuntimeModel",Sl,{chsName:"关卡包模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"关卡包模型"}));let wv=Sl;const er=class er extends Fi{constructor(e){super(e);f(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);f(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})())}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new D([this,"radius"],"半径",er.defaults.radius),new D([this,"sides"],"圆边数",er.defaults.sides),new D([this,"speed"],"材质速度",er.defaults.speed),new ft([this,"materialMode"],er.materialModes,"材质模式",er.defaults.materialMode),new Et([this,"materialImage"],"材质图片和重复度",er.defaults.materialImage)]}}};f(er,"createDefaultProps",()=>({...Fi.createDefaultProps(),radius:10,sides:10,materialMode:"singleArrow",materialImage:bt({url:"",uDis:50,vDis:10}),speed:1,filled:!0,stroked:!1,fillStyle:bt({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),f(er,"type",er.register("ESPipeline",er,{chsName:"管线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPipeline"})),f(er,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"]]);let Ev=er;const Ws=class Ws extends Ot{constructor(e){super(e);f(this,"editingBindMode","visibility")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Dt([this,"visibleColor"],"可视区域颜色",Ws.defaults.visibleColor),new Dt([this,"invisibleColor"],"遮挡区域颜色",Ws.defaults.invisibleColor),new D([this,"heightOffset"],"视点高度偏移",Ws.defaults.heightOffset)]}}};f(Ws,"createDefaultProps",()=>({...Ot.createDefaultProps(),visibleColor:ot([0,1,0,1]),invisibleColor:ot([1,0,0,1]),heightOffset:0})),f(Ws,"type",Ws.register("ESVisibilityAnalysis",Ws,{chsName:"通视分析,视线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"通视分析,视线分析"})),f(Ws,"supportEditingModes",[...Ot.supportEditingModes,nt.VisibilityAppend,nt.VisibilityModify]);let Sv=Ws;const sh=class sh extends Jt{constructor(e){super(e);f(this,"_startEvent",this.dv(new O));f(this,"_clearEvent",this.dv(new O));f(this,"_volume",this.disposeVar(z(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get volume(){return this._volume.value}set volume(e){this._volume.value=e}get volumeChanged(){return this._volume.changed}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new wt("通用"),new D([this,"planeHeight"],"基准面高程",void 0,!0),new D([this,"gridWidth"],"采样间距 m"),new D([this,"cutVolume"],"挖方",0,!1,!0),new D([this,"fillVolume"],"填方",0,!1,!0),new D([this,"cutAndFillVolume"],"挖填方",0,!1,!0),new D([this,"progress"],"计算进度",0,!1,!0),new vt("开始分析",()=>this.start(),[],"start"),new vt("清空分析结果",()=>this.clear(),[],"clear"),new X([this,"depthTest"],"是否开启深度检测")]}}};f(sh,"createDefaultProps",()=>({...Jt.createDefaultProps(),planeHeight:z(void 0),gridWidth:1,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,filled:!1,stroked:!0,strokeStyle:bt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(sh,"type",sh.register("ESVolumeMeasurement",sh,{chsName:"体积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"体积测量"}));let bv=sh;const oh=class oh extends Zn{constructor(e){super(e);f(this,"_human",this.dv(new Zn));f(this,"_poi",this.dv(new Fc));this.d(this.components.disposableAdd(this._human,!0)),this.d(this.components.disposableAdd(this._poi));{const{_human:n,_poi:r}=this;this.d(F([n,"show"],[this,"show"])),this.d(F([r,"show"],[this,"show"])),this.d(F([n,"allowPicking"],[this,"allowPicking"])),this.d(F([r,"allowPicking"],[this,"allowPicking"])),this.d(F([n,"scale"],[this,"scale"])),this.d(F([r,"scale"],[this,"scale"])),this.d(F([n,"collision"],[this,"collision"])),this.d(F([r,"collision"],[this,"collision"])),this.d(lt([n,"flyInParam"],[this,"flyInParam"])),this.d(lt([n,"flyToParam"],[this,"flyToParam"])),this.d(F([n,"animation"],[this,"animation"])),this.d(F([n,"mode"],[this,"mode"])),this.d(F([n,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(F([n,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(F([r,"name"],[this,"name"])),this.d(F([r,"mode"],[this,"poiMode"])),this.d(F([r,"autoAnchor"],[this,"autoAnchor"])),this.d(F([r,"screenRender"],[this,"screenRender"])),this.d(F([r,"size"],[this,"size"])),this.d(F([r,"anchor"],[this,"anchor"])),this.d(F([r,"sizeByContent"],[this,"sizeByContent"])),this.d(F([r,"renderMode"],[this,"renderMode"])),this.d(F([r,"rotationType"],[this,"rotationType"])),this.d(F([r,"zOrder"],[this,"zOrder"])),this.d(F([r,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(F([r,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(lt([n,"position"],[this,"position"])),this.d(lt([n,"rotation"],[this,"rotation"])),this.d(this.flyInEvent.don(s=>{n.flyIn(s)})),this.d(this.flyToEvent.don(s=>{n.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{n.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{n.calcFlyInParam()})),this.d(this.smoothMoveEvent.don((s,o)=>{n.smoothMove(s,o)})),this.d(this.smoothMoveWithRotationEvent.don((s,o,a)=>{n.smoothMoveWithRotation(s,o,a)})),this.d(this.smoothMoveOnGroundEvent.don((s,o,a,l)=>{n.smoothMoveOnGround(s,o,a,l)})),this.d(this.smoothMoveWithRotationOnGroundEvent.don((s,o,a,l,u)=>{n.smoothMoveWithRotationOnGround(s,o,a,l,u)})),this.d(this.automaticLandingEvent.don(()=>{n.automaticLanding()})),this.d(this._human.readyEvent.don(s=>{this.readyEvent.emit(s)}))}}get human(){return this._human}get poi(){return this._poi}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ft([this,"poiMode"],Fc.modes,"poi模式","SquareH01"),new D([this,"poiOffsetHeight"],"poi高度偏移",1.8)]}}};f(oh,"createDefaultProps",()=>({poiOffsetHeight:1.8,poiMode:"SquareH01",style:bt({}),autoAnchor:!0,screenRender:!0,size:ot([100,100]),anchor:ot([.5,1]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,...Zn.createDefaultProps()})),f(oh,"type",oh.register("ESHumanPoi",oh,{chsName:"人员poi",tags:["ESObjects"],description:"ESHuman + ESPoi2D组合对象"}));let Cv=oh;const Hs=class Hs extends ct{constructor(t){super(t)}getESProperties(){return{...{...super.getESProperties()},defaultMenu:"basic",basic:[new mt([this,"image"],"图片",Hs.defaults.image),new D([this,"height"],"喷泉高度",Hs.defaults.height),new D([this,"spread"],"扩散角度",Hs.defaults.spread),new D([this,"emissionRate"],"发射率",Hs.defaults.emissionRate)]}}};f(Hs,"createDefaultProps",()=>({...ct.createDefaultProps(),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",height:10,spread:5,emissionRate:50})),f(Hs,"type",Hs.register("ESFountainParticleSystem",Hs,{chsName:"粒子喷泉",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"粒子喷泉"}));let Hf=Hs;const ir=class ir extends Zn{constructor(e){super(e);f(this,"_human",this.dv(new Zn));f(this,"_fountain",this.dv(new Hf));this.d(this.components.disposableAdd(this._human,!0)),this.d(this.components.disposableAdd(this._fountain));{const{_human:n,_fountain:r}=this;this.ad(Ze([this.showChanged,this.humanShowChanged,this.fountainShowChanged],()=>{n.show=this.show&&this.humanShow,r.show=this.show&&this.fountainShow},{immediate:!0})),this.d(F([n,"allowPicking"],[this,"allowPicking"])),this.d(F([r,"allowPicking"],[this,"allowPicking"])),this.d(F([n,"scale"],[this,"scale"])),this.d(F([r,"scale"],[this,"scale"])),this.d(F([n,"collision"],[this,"collision"])),this.d(F([r,"collision"],[this,"collision"])),this.d(lt([n,"flyInParam"],[this,"flyInParam"])),this.d(lt([n,"flyToParam"],[this,"flyToParam"])),this.d(F([n,"animation"],[this,"animation"])),this.d(F([n,"mode"],[this,"mode"])),this.d(F([n,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(F([n,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.ad(Ze([this.positionOffsetChanged,this.fountainOffsetChanged],()=>{n.positionOffset=this.positionOffset,r.positionOffset=[this.positionOffset[0]+this.fountainOffset[0],this.positionOffset[1]+this.fountainOffset[1],this.positionOffset[2]+this.fountainOffset[2]]},{immediate:!0})),this.d(lt([n,"position"],[this,"position"])),this.d(lt([n,"rotation"],[this,"rotation"])),this.d(lt([r,"position"],[this,"position"])),this.ad(Ze(this.rotationChanged,()=>{r.rotation=[this.rotation[0],this.rotation[1]-30,this.rotation[2]]},{immediate:!0})),this.d(F([r,"image"],[this,"fountainImage"])),this.d(F([r,"height"],[this,"fountainHeight"])),this.d(F([r,"spread"],[this,"fountainSpread"])),this.d(F([r,"emissionRate"],[this,"fountainEmissionRate"])),this.d(this.flyInEvent.don(s=>{n.flyIn(s)})),this.d(this.flyToEvent.don(s=>{n.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{n.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{n.calcFlyInParam()})),this.d(this.smoothMoveEvent.don((s,o)=>{n.smoothMove(s,o)})),this.d(this.smoothMoveWithRotationEvent.don((s,o,a)=>{n.smoothMoveWithRotation(s,o,a)})),this.d(this.smoothMoveOnGroundEvent.don((s,o,a,l)=>{n.smoothMoveOnGround(s,o,a,l)})),this.d(this.smoothMoveWithRotationOnGroundEvent.don((s,o,a,l,u)=>{n.smoothMoveWithRotationOnGround(s,o,a,l,u)})),this.d(this.automaticLandingEvent.don(()=>{n.automaticLanding()})),this.d(this._human.readyEvent.don(s=>{this.readyEvent.emit(s)}))}}get human(){return this._human}get fountain(){return this._fountain}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new X([this,"humanShow"],"人物显隐",ir.defaults.humanShow),new X([this,"fountainShow"],"喷泉显隐",ir.defaults.fountainShow),new mt([this,"fountainImage"],"喷泉图片",ir.defaults.fountainImage),new ci([this,"fountainOffset"],"喷泉偏移",ir.defaults.fountainOffset),new D([this,"fountainHeight"],"喷泉高度",ir.defaults.fountainHeight),new D([this,"fountainSpread"],"喷泉扩散角度",ir.defaults.fountainSpread),new D([this,"fountainEmissionRate"],"喷泉发射率",ir.defaults.fountainEmissionRate)]}}};f(ir,"createDefaultProps",()=>({...Zn.createDefaultProps(),humanShow:!0,fountainShow:!0,fountainImage:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",fountainOffset:ot([0,0,0]),fountainHeight:10,fountainSpread:5,fountainEmissionRate:50})),f(ir,"type",ir.register("ESHumanFountain",ir,{chsName:"人员喷泉",tags:["ESObjects"],description:"ESHuman + ESFountainParticleSystem组合对象,喷泉从人物手中喷出"}));let Pv=ir;const Ar=class Ar extends Jt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new D([this,"depth"],"深度",Ar.defaults.depth),new D([this,"interpolation"],"插值",Ar.defaults.interpolation),new D([this,"opacity"],"透明度",Ar.defaults.opacity),new Et([this,"sideImage"],"侧面图片",Ar.defaults.sideImage),new Et([this,"bottomImage"],"底面图片",Ar.defaults.bottomImage),new D([this,"extendBoundary"],"外扩边界采样高度",Ar.defaults.extendBoundary)]}}};f(Ar,"createDefaultProps",()=>({...Jt.createDefaultProps(),depth:100,sideImage:bt({url:pt.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/side.jpg"),uDis:50,vDis:50}),bottomImage:bt({url:pt.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/bottom.jpg"),uDis:50,vDis:50}),opacity:1,interpolation:50,collision:!1,allowPicking:!1,filled:!0,extendBoundary:1})),f(Ar,"type",Ar.register("ESPit",Ar,{chsName:"坑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"坑"}));let Du=Ar;const ah=class ah extends Du{constructor(e){super(e);f(this,"_excavate",this.dv(new Ac));f(this,"_pit",this.dv(new Du));this.d(this.components.disposableAdd(this._excavate)),this.d(this.components.disposableAdd(this._pit,!0));{const{_excavate:n,_pit:r}=this;this.d(F([n,"show"],[this,"show"])),this.d(F([r,"show"],[this,"show"])),this.d(F([n,"allowPicking"],[this,"allowPicking"])),this.d(F([r,"allowPicking"],[this,"allowPicking"])),this.d(F([n,"collision"],[this,"collision"])),this.d(F([r,"collision"],[this,"collision"])),this.d(lt([r,"points"],[this,"points"])),this.d(F([n,"points"],[this,"points"])),this.d(F([r,"pointed"],[this,"pointed"])),this.d(F([n,"pointed"],[this,"pointed"])),this.d(F([r,"pointStyle"],[this,"pointStyle"])),this.d(F([n,"pointStyle"],[this,"pointStyle"])),this.d(F([r,"stroked"],[this,"stroked"])),this.d(F([n,"stroked"],[this,"stroked"])),this.d(F([r,"strokeStyle"],[this,"strokeStyle"])),this.d(F([n,"strokeStyle"],[this,"strokeStyle"])),this.d(F([r,"filled"],[this,"filled"])),this.d(F([r,"fillStyle"],[this,"fillStyle"])),this.d(F([n,"fillStyle"],[this,"fillStyle"])),this.d(F([n,"mode"],[this,"mode"])),this.d(F([n,"targetID"],[this,"targetID"])),this.d(F([r,"depth"],[this,"depth"])),this.d(F([r,"sideImage"],[this,"sideImage"])),this.d(F([r,"bottomImage"],[this,"bottomImage"])),this.d(F([r,"opacity"],[this,"opacity"])),this.d(F([r,"interpolation"],[this,"interpolation"])),this.d(lt([r,"flyInParam"],[this,"flyInParam"])),this.d(lt([r,"flyToParam"],[this,"flyToParam"])),this.ad(lt([r,"extendBoundary"],[this,"extendBoundary"])),this.d(this.flyInEvent.don(s=>{r.flyIn(s)})),this.d(this.flyToEvent.don(s=>{r.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{r.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{r.calcFlyInParam()}))}}get excavate(){return this._excavate}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ft([this,"mode"],Ac.modes,"模式","in"),new mt([this,"targetID"],"目标图层id","")]}}};f(ah,"createDefaultProps",()=>({...Du.createDefaultProps(),mode:"in",targetID:""})),f(ah,"type",ah.register("ESHole",ah,{chsName:"挖坑(带材质+深度)",tags:["ESObjects"],description:"挖坑"}));let xv=ah;function wE(i){return i.startsWith("/")&&!i.startsWith("//")}function Xf(i){var t;return!i||/^https?:\/\//i.test(i)?i:wE(i)&&typeof window<"u"&&((t=window.location)!=null&&t.origin)?`${window.location.origin}${i}`:i}function $f(i){var e;return(e=Xf(i).match(/^(https?:\/\/[^/]+)/i))==null?void 0:e[1]}function EE(i){var e;return(e=Xf(i).match(/^(https?:\/\/[^:]+)/i))==null?void 0:e[1]}function il(i){return i==="CesiumlabDesktop"?"/cim":""}function SE(i){if(/\/cim\/ts\//.test(i))return"CesiumlabDesktop";if(/\/ts\/(?:info|tiles|featuretiles)\//.test(i))return"CIMRTS"}function bE(i){const t=i.match(/(?:\/cim)?\/ts\/info\/([^?/]+)/);return t==null?void 0:t[1]}function ID(i,t,e){const n=il(t);return`${i}${n}/ts/info/${e}`}function CE(i,t,e,n=Date.now()){const r=il(t);return`${i}${r}/ts/tiles/${e}/tileset.json?t=${n}`}function PE(i,t,e,n){const r=il(t);return`${i}${r}/ts/featuretiles/${e}/${n}/tileset.json`}const Yf={layerconfigfind:"/ts/layer/config/get",layerconfigsave:"/ts/layer/config/put",featureproperty:"/ts/editor/property",featureeditormuti:"/ts/editor/update",getts:"/ts/info"},xE=async(i,t,e,n,r="CIMRTS")=>{try{const s=window.localStorage.getItem("Authorization"),o=il(r);let a=i+`${o}${Yf.layerconfigfind}?tileServiceName=${t}`;e&&(a+=`&earthdstoken=${encodeURIComponent(n)}`);const l={headers:{...!e&&s?{Authorization:s}:{}},mode:"cors"},h=await(await fetch(a,l)).text();return JSON.parse(h)}catch(s){console.error(s)}},IE=async(i,t,e,n,r,s="CIMRTS")=>{try{const o=window.localStorage.getItem("Authorization"),a=il(s);let l=i+`${a}${Yf.layerconfigsave}`;const u=r??{};e&&(l+=`?earthdstoken=${encodeURIComponent(n)}`);const h={method:"POST",headers:{"Content-Type":"application/json",...!e&&o?{Authorization:o}:{}},mode:"cors",body:JSON.stringify({tileServiceName:t,layerConfig:JSON.stringify(u)})},d=await(await fetch(l,h)).text();return JSON.parse(d)}catch(o){console.error(o)}},ME=async(i,t,e)=>{try{const n=window.localStorage.getItem("Authorization");let r=i;t&&(r+=`?earthdstoken=${encodeURIComponent(e)}`);const s={headers:{...!t&&n?{Authorization:n}:{}},mode:"cors"},a=await(await fetch(r,s)).text(),l=JSON.parse(a);if(l.status=="ok")return l.data.port;console.error(l.status);return}catch(n){console.error(n)}},TE=async(i,t,e,n,r,s="CIMRTS")=>{try{const o={tileServiceName:t,featureId:e},a=window.localStorage.getItem("Authorization"),l=il(s);let u=i+`${l}${Yf.featureproperty}`;n&&(u+=`?earthdstoken=${encodeURIComponent(r)}`);const c=await(await fetch(u,{method:"post",headers:{"Content-Type":"application/json",...!n&&a?{Authorization:a}:{}},body:JSON.stringify(o),mode:"cors"})).text(),d=JSON.parse(c);if(d.status=="ok")return d.data;console.error(d.data.status);return}catch(o){console.error(o)}},lh=class lh extends Jn{constructor(e){super(e);f(this,"_es3DTileset",this.dv(new Jn));f(this,"_ids",this.dv(bt([])));f(this,"_platform",this.dv(z("CIMRTS")));f(this,"_visJson",this.disposeVar(z({})));f(this,"_highlightInner3DtilesetEvent",this.dv(new O));f(this,"_removeHighlightInner3DtilesetEvent",this.dv(new O));f(this,"_tilesetServePort",this.dv(z("")));this.collision=!1;{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01");return}this.url?(this.syncPlatformFromUrl(),this.refresh()):this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()})),this.d(this.platformChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const n=this._es3DTileset;this.d(F([n,"allowPicking"],[this,"allowPicking"])),this.d(F([n,"collision"],[this,"collision"])),this.d(lt([n,"flyToParam"],[this,"flyToParam"])),this.d(F([n,"actorTag"],[this,"actorTag"])),this.d(F([n,"materialMode"],[this,"materialMode"])),this.d(F([n,"highlight"],[this,"highlight"])),this.d(F([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(F([n,"highlightID"],[this,"highlightID"])),this.d(F([n,"highlightColor"],[this,"highlightColor"])),this.d(lt([n,"offset"],[this,"offset"])),this.d(lt([n,"rotation"],[this,"rotation"])),this.d(F([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(F([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(F([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(F([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(F([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(F([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(F([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(F([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(F([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(F([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(F([n,"cacheBytes"],[this,"cacheBytes"])),this.d(F([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(F([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(F([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(F([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(F([n,"materialParams"],[this,"materialParams"])),this.d(lt([n,"supportEdit"],[this,"supportEdit"])),this.d(lt([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(lt([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(lt([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(lt([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(lt([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(lt([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...r)=>{n.highlightFeature(...r)})),this.d(this.highlightFeatureAndFlyToEvent.don((...r)=>{n.highlightFeatureAndFlyTo(...r)})),this.d(this.setFeatureColorEvent.don((...r)=>{n.setFeatureColor(...r)})),this.d(this.setFeatureVisableEvent.don((...r)=>{n.setFeatureVisable(...r)})),this.d(this.resetFeatureStyleEvent.don((...r)=>{n.resetFeatureStyle(...r)})),this.d(this.setFeatureStyleEvent.don((...r)=>{n.setFeatureStyle(...r)})),this.d(this.flyInEvent.don((...r)=>{n.flyIn(r[0])})),this.d(this.flyToEvent.don((...r)=>{n.flyTo(r[0])})),this.d(this.calcFlyToParamEvent.don((...r)=>{n.calcFlyToParam(...r)})),this.d(this.calcFlyInParamEvent.don((...r)=>{n.calcFlyInParam(...r)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(r=>{this.tilesetReady.emit(r)})),this.d(n.pickedEvent.don(r=>{r.assign({sceneObject:this}),this.pickedEvent.emit(r)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get ids(){return this._ids.value}get idsChanged(){return this._ids.changed}set ids(e){this._ids.value=e}get platform(){return this._platform.value}get platformChanged(){return this._platform.changed}set platform(e){this._platform.value=e}get visJson(){return this._visJson.value}set visJson(e){this._visJson.value=e}get visJsonChanged(){return this._visJson.changed}setFeatureVisable(e,n){var r;if((r=this.layerConfig)!=null&&r.length){const s={};s[n[0].value]=n[0].visable,this.visJson={...this.visJson,...s}}else this.setFeatureVisableEvent.emit(e,typeof n=="string"?JSON.parse(n):n,!0)}async getFeatureProperty(e){return await TE(this.baseUrl,this.tileServiceName,e,this.useEarthDSToken,this.earthdstoken,this.platform)}async getLayerConfig(){const e=await xE(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,this.platform);return!e||!Array.isArray(e)?this.layerConfig=[]:this.layerConfig=e,this.layerConfig}async saveLayerConfig(){const e=this.layerConfig;return await IE(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,e,this.platform)}get highlightInner3DtilesetEvent(){return this._highlightInner3DtilesetEvent}_highlightInner3Dtileset(e){this._highlightInner3DtilesetEvent.emit(e)}async highlightDSFeature(e){this._highlightInner3Dtileset(e)}get removeHighlightInner3DtilesetEvent(){return this._removeHighlightInner3DtilesetEvent}_removeHighlightInner3Dtileset(e){this._removeHighlightInner3DtilesetEvent.emit(e)}async removeHighlightDSFeature(e){this._removeHighlightInner3Dtileset(e)}async pickFeature(e,n){var a,l,u;const r=await e.pick(n),s=r.sceneObject;return!s||s.id!==this.id&&s.typeName!="ESRtsFeatureEditing"?void 0:s.typeName!="ESRtsFeatureEditing"?(this.ids=[...this.ids,(a=r==null?void 0:r.tilesetPickInfo)==null?void 0:a.id],{featureId:(l=r==null?void 0:r.tilesetPickInfo)==null?void 0:l.id,pickInnerFields:r==null?void 0:r.tilesetPickInfo}):{featureId:(u=r==null?void 0:r.sceneObject)==null?void 0:u.id,pickInnerFields:r==null?void 0:r.tilesetPickInfo}}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(e){this._tilesetServePort.value=e}async getport(){const e=await ME(Xf(this.url),this.useEarthDSToken,this.earthdstoken);if(e)return this.tilesetServePort=e,e;throw new Error("服务地址port获取失败!")}async refresh(){if(!this.url||typeof this.url!="string")return;const e=+new Date,n=$f(this.url);n&&(this.syncPlatformFromUrl(),this._es3DTileset.offset=[0,0,0],this._es3DTileset.rotation=[0,0,0],this._es3DTileset.url=CE(n,this.platform,this.tileServiceName,e),console.log("3dtileset url:",this._es3DTileset.url))}syncPlatformFromUrl(){if(typeof this.url!="string"||!this.url)return;const e=SE(this.url);e&&e!==this.platform&&(this._platform.value=e)}get baseUrl(){if(this.url&&typeof this.url=="string"){const e=$f(this.url);if(!e)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01");return e}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01")}get tileServiceName(){if(this.url&&typeof this.url=="string"){const e=bE(this.url);if(!e)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01 或 http://localhost:9109/cim/ts/info/ms01");return e}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01 或 http://localhost:9109/cim/ts/info/ms01")}get tileServiceIp(){if(this.url&&typeof this.url=="string"){const e=EE(this.url);if(!e)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01");return e}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Ne([this,"layerConfig"],"图层配置",[],void 0,!0)]}}};f(lh,"createDefaultProps",()=>({...Jn.createDefaultProps(),layerConfig:fe([]),isSameIP:!1,useEarthDSToken:!1,earthdstoken:""})),f(lh,"type",lh.register("ESRtsTileset",lh,{chsName:"CIMRTS实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let Iv=lh;function MD(i){return typeof i=="number"&&!isNaN(i)}const uh=class uh extends Jn{get json(){return{...this._innerGetJson(),show:this.show,materials:this.materials,changeMaterial:this.changeMaterial,props:this.props,rotation:this.rotation,offset:this.offset}}set json(t){this._innerSetJson(t)}async init(t,e){this.featureId=e;const n=await t.getFeatureProperty(e);this.uiShowprops=n.props.map(a=>({featureClassName:a.name,fields:a.props?a.props.map(l=>({key:l.name,type:l.type,value:l.type!="double"?l.value:MD(l.value)?Number(l.value.toFixed(3)):""})):[]})),this.datasetName=n.datasetName,t.setFeatureVisable("id",[{value:this.featureId,visable:!1}]),this.d(()=>{t.setFeatureVisable("id",[{value:this.featureId,visable:!0}])});const r=typeof t.url=="string"?t.url:"",s=$f(r),o=t.tileServiceName;if(!s)throw new Error("ESRtsFeatureEditing: 无法解析服务地址");this.url=PE(s,t.platform,o,this.featureId),this.allowPicking=!0,this.d(this.pickedEvent.don(a=>{a.assign({sceneObject:t}),t.pickedEvent.emit(a)})),this.d(()=>{this.editing=!1,t.removeHighlightDSFeature(this)})}constructor(t){super(t)}};f(uh,"createDefaultProps",()=>({...Jn.createDefaultProps(),datasetName:void 0,featureId:void 0,materials:bt({}),changeMaterial:fe(void 0),uiShowprops:bt({}),props:bt({})})),f(uh,"type",uh.register("ESRtsFeatureEditing",uh,{chsName:"ESRtsFeatureEditing",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let Mv=uh;const TD=async(i,t,e)=>{try{const n=window.localStorage.getItem("Authorization");let r=i;t&&(r+=`?earthdstoken=${encodeURIComponent(e)}`);const s={headers:{...!t&&n?{Authorization:n}:{}},mode:"cors"},a=await(await fetch(r,s)).text(),l=JSON.parse(a);if(l.status=="ok")return l.data.port;console.error(l.status);return}catch(n){console.error(n)}};function ND(i){return i==="CesiumlabDesktop"?"/osgb":""}function OD(i){if(/\/osgb\/ts\//.test(i))return"CesiumlabDesktop";if(/\/ts\/(?:info|tiles|featuretiles)\//.test(i))return"CIMRTS"}function NE(i){const t=i.match(/(?:\/osgb)?\/ts\/info\/([^?/]+)/);return t==null?void 0:t[1]}function DD(i,t,e,n=Date.now()){const r=ND(e);return`${i}:${t}${r}/tiles/tileset.json?t=${n}`}const hh=class hh extends Jn{constructor(e){super(e);f(this,"_es3DTileset",this.dv(new Jn));f(this,"_platform",this.dv(z("CIMRTS")));f(this,"_tilesetServePort",this.dv(z("")));this.collision=!1;{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ms01");return}this.url?(this.syncPlatformFromUrl(),this.refresh()):this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()})),this.d(this.platformChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const n=this._es3DTileset;this.d(F([n,"allowPicking"],[this,"allowPicking"])),this.d(F([n,"collision"],[this,"collision"])),this.d(lt([n,"flyToParam"],[this,"flyToParam"])),this.d(F([n,"actorTag"],[this,"actorTag"])),this.d(F([n,"materialMode"],[this,"materialMode"])),this.d(F([n,"highlight"],[this,"highlight"])),this.d(F([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(F([n,"highlightID"],[this,"highlightID"])),this.d(F([n,"highlightColor"],[this,"highlightColor"])),this.d(lt([n,"offset"],[this,"offset"])),this.d(lt([n,"rotation"],[this,"rotation"])),this.d(F([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(F([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(F([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(F([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(F([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(F([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(F([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(F([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(F([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(F([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(F([n,"cacheBytes"],[this,"cacheBytes"])),this.d(F([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(F([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(F([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(F([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(F([n,"materialParams"],[this,"materialParams"])),this.d(lt([n,"supportEdit"],[this,"supportEdit"])),this.d(lt([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(lt([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(lt([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(lt([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(lt([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(lt([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...r)=>{n.highlightFeature(...r)})),this.d(this.highlightFeatureAndFlyToEvent.don((...r)=>{n.highlightFeatureAndFlyTo(...r)})),this.d(this.setFeatureColorEvent.don((...r)=>{n.setFeatureColor(...r)})),this.d(this.setFeatureVisableEvent.don((...r)=>{n.setFeatureVisable(...r)})),this.d(this.resetFeatureStyleEvent.don((...r)=>{n.resetFeatureStyle(...r)})),this.d(this.setFeatureStyleEvent.don((...r)=>{n.setFeatureStyle(...r)})),this.d(this.flyInEvent.don((...r)=>{n.flyIn(r[0])})),this.d(this.flyToEvent.don((...r)=>{n.flyTo(r[0])})),this.d(this.calcFlyToParamEvent.don((...r)=>{n.calcFlyToParam(...r)})),this.d(this.calcFlyInParamEvent.don((...r)=>{n.calcFlyInParam(...r)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(r=>{this.tilesetReady.emit(r)})),this.d(n.pickedEvent.don(r=>{r.assign({sceneObject:this}),this.pickedEvent.emit(r)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get platform(){return this._platform.value}get platformChanged(){return this._platform.changed}set platform(e){this._platform.value=e}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(e){this._tilesetServePort.value=e}async getport(){const e=await TD(this.url,this.useEarthDSToken,this.earthdstoken);if(e)return this.tilesetServePort=e,e;throw new Error("服务地址port获取失败!")}async refresh(){if(!this.url||typeof this.url!="string"||!NE(this.url))return;const n=+new Date;this.syncPlatformFromUrl();const r=await this.getport(),s=this.tileServiceIp;this._es3DTileset.offset=[0,0,0],this._es3DTileset.rotation=[0,0,0],this._es3DTileset.url=DD(s,r,this.platform,n),console.log("3dtileset url:",this._es3DTileset.url)}syncPlatformFromUrl(){if(typeof this.url!="string"||!this.url)return;const e=OD(this.url);e&&e!==this.platform&&(this._platform.value=e)}get baseUrl(){var e;if(this.url&&typeof this.url=="string"){const n=(e=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:e[1];if(!n)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var e;if(this.url&&typeof this.url=="string"){const n=(e=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:e[1];if(!n)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceName(){if(this.url&&typeof this.url=="string"){const e=NE(this.url);if(!e)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01 或 http://localhost:9109/osgb/ts/info/ms01");return e}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01 或 http://localhost:9109/osgb/ts/info/ms01")}};f(hh,"createDefaultProps",()=>({...Jn.createDefaultProps(),isSameIP:!1,useEarthDSToken:!1,earthdstoken:""})),f(hh,"type",hh.register("ESMsTileset",hh,{chsName:"Modelser实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let Tv=hh;const OE={defaultValue:[{type:"2",widget:"WidgetBlueprint'/ESFoliage/PoiSheng.PoiSheng'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"3",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"4",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"5",widget:"WidgetBlueprint'/ESFoliage/PoiXiang.PoiXiang'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"6",widget:"WidgetBlueprint'/ESFoliage/PoiCun.PoiCun'",povit:[.5,1],worldScale:.1,hiddenDistance:40}],sampleValue:`
390
+ `,xD="${earthsdk3-assets-script-dir}/assets/misc/2.geojson",Lt=class Lt extends Xt{constructor(e){super(e);f(this,"_flyToFeatureEvent",this.dv(new O));f(this,"_flyToFeatureIndexEvent",this.dv(new O));f(this,"_setFeatureStyleEvent",this.disposeVar(new O));f(this,"_resetFeatureStyleEvent",this.disposeVar(new O));f(this,"_features",this.disposeVar(fe(void 0)));f(this,"pickedInfoType","FeatureCollection");f(this,"abortController");this._updateUrl(),this.ad(this.urlChanged.don(()=>{this._updateUrl()})),this.ad(this.editingChanged.don(()=>{console.warn("ESGeoJson暂不支持编辑!")}))}get flyToFeatureEvent(){return this._flyToFeatureEvent}flyToFeature(e,n,r){this._flyToFeatureEvent.emit(e,n,r)}get flyToFeatureIndexEvent(){return this._flyToFeatureIndexEvent}flyToFeatureIndex(e,n){this._flyToFeatureIndexEvent.emit(e,n)}get setFeatureStyleEvent(){return this._setFeatureStyleEvent}setFeatureStyle(e,n=!1){this._setFeatureStyleEvent.emit(e,n)}get resetFeatureStyleEvent(){return this._resetFeatureStyleEvent}resetFeatureStyle(){this._resetFeatureStyleEvent.emit()}get features(){return this._features.value}set features(e){this._features.value=e}get featuresChanged(){return this._features.changed}getFeatures(){if(this.features)return this.features;console.log("数据未加载完成,请稍后调用此方法getFeatures()")}getFeatureTable(){if(this.features){let e={};return Ay(this.features).features.forEach(n=>{Object.assign(e,n.properties)}),Object.keys(e).forEach(n=>{e[n]=typeof e[n]}),e}else console.log("数据未加载完成,请稍后调用此方法getFeatureTable()")}_updateUrl(){var e;if(this.abortController&&this.abortController.abort(),!this.url){this.features=void 0;return}if(typeof this.url=="object")this.features=this.url;else if(ip(this.url))this.features=JSON.parse(this.url);else{this.abortController=new AbortController;const n=this.abortController.signal;fetch(pt.context.getStrFromEnv(this.url),{signal:n}).then(r=>r.json()).then(r=>{this.features=r}).catch(r=>{r.name!="AbortError"&&console.warn("ESGeoJson数据加载失败",r)})}this.pickedInfoType=((e=this.features)==null?void 0:e.type)??"FeatureCollection"}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",dataSource:[...e.dataSource,new Et([this,"url"],"服务地址",Lt.defaults.url),new H([this,"usePrimitive"],"使用Primitive绘制",Lt.defaults.usePrimitive),new D([this,"minFeatureVisibleDistance"],"要素最小可视距离",Lt.defaults.minFeatureVisibleDistance),new D([this,"maxFeatureVisibleDistance"],"要素最大可视距离",Lt.defaults.maxFeatureVisibleDistance),new ft([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考"),new ft([this,"classificationType"],Lt.classificationTypes,"贴地附着目标",Lt.defaults.classificationType),new D([this,"zIndex"],"层级排序",Lt.defaults.zIndex)],style:[...e.style,new wt("点样式集合"),new H([this,"textShow"],"是否显示",Lt.defaults.textShow),new Ke([this,"textAnchor"],"锚点",Lt.defaults.anchor),new mt([this,"textProperty"],"标注显示属性",Lt.defaults.textStyle.textProperty),new mt([this,"textDefaultText"],"默认文本",Lt.defaults.textStyle.defaultText),new Dt([this,"textColor"],"文本颜色",Lt.defaults.textStyle.color),new Dt([this,"textBackgroundColor"],"文本背景颜色",Lt.defaults.textStyle.backgroundColor),new mt([this,"textFontStyle"],"字体样式",Lt.defaults.textStyle.fontStyle),new mt([this,"textFontWeight"],"字体粗细",Lt.defaults.textStyle.fontWeight),new D([this,"textFontSize"],"字体大小",Lt.defaults.textStyle.fontSize),new Ke([this,"textOffset"],"像素偏移",Lt.defaults.textStyle.offset),new wt("点图片样式集合"),new H([this,"imageShow"],"是否显示",Lt.defaults.imageShow),new Ke([this,"imageAnchor"],"锚点",Lt.defaults.imageStyle.anchor),new Et([this,"imageUrl"],"图片地址",Lt.defaults.imageStyle.url),new Ke([this,"imageSize"],"图片大小",Lt.defaults.imageStyle.size),new Ke([this,"imageOffset"],"像素偏移",Lt.defaults.imageStyle.offset),new wt("线样式集合"),new H([this,"stroked"],"是否显示",Lt.defaults.stroked),new H([this,"strokeGround"],"贴地",Lt.defaults.strokeStyle.ground),new D([this,"strokeWidth"],"线宽",Lt.defaults.strokeStyle.width),new ft([this,"strokeWidthType"],Lt.strokeStyleWidthTypes,"线宽类型"),new Dt([this,"strokeColor"],"线颜色",Lt.defaults.strokeStyle.color),new mt([this,"strokeMaterial"],"线材质",Lt.defaults.strokeStyle.material),new Et([this,"strokeMaterialParams"],"线材质参数",Lt.defaults.strokeStyle.materialParams),new wt("面样式集合"),new H([this,"filled"],"是否显示",Lt.defaults.filled),new H([this,"fillGround"],"贴地",Lt.defaults.fillStyle.ground),new Dt([this,"fillColor"],"填充颜色",Lt.defaults.fillStyle.color),new mt([this,"fillMaterial"],"填充材质",Lt.defaults.fillStyle.material),new Et([this,"fillMaterialParams"],"填充材质参数",Lt.defaults.fillStyle.materialParams)],more:[...e.more,new wt("标注文本样式"),new mt([this,"textFontFamily"],"字体",Lt.defaults.textStyle.fontFamily),new D([this,"zOrder"],"点排序优先级",Lt.defaults.zOrder),new wt("通用"),new io([this,"loadFuncStr"],"loadFnStr",lv,_E,!0)]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(e){this.strokeStyle={...this.strokeStyle,width:e}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(e){this.strokeStyle={...this.strokeStyle,widthType:e}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(e){this.strokeStyle={...this.strokeStyle,color:[...e]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(e){this.strokeStyle={...this.strokeStyle,material:e}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(e){this.strokeStyle={...this.strokeStyle,materialParams:e}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(e){this.strokeStyle={...this.strokeStyle,ground:e}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(e){this.fillStyle={...this.fillStyle,color:[...e]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(e){this.fillStyle={...this.fillStyle,material:e}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(e){this.fillStyle={...this.fillStyle,materialParams:e}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(e){this.fillStyle={...this.fillStyle,ground:e}}get fillGroundChanged(){return this.fillStyleChanged}get textProperty(){return this.textStyle.textProperty}set textProperty(e){this.textStyle={...this.textStyle,textProperty:e}}get textPropertyChanged(){return this.textStyleChanged}get textDefaultText(){return this.textStyle.defaultText}set textDefaultText(e){this.textStyle={...this.textStyle,defaultText:e}}get textDefaultTextChanged(){return this.textStyleChanged}get textColor(){return this.textStyle.color}set textColor(e){this.textStyle={...this.textStyle,color:e}}get textColorChanged(){return this.textStyleChanged}get textBackgroundColor(){return this.textStyle.backgroundColor}set textBackgroundColor(e){this.textStyle={...this.textStyle,backgroundColor:e}}get textBackgroundColorChanged(){return this.textStyleChanged}get textFontFamily(){return this.textStyle.fontFamily}set textFontFamily(e){this.textStyle={...this.textStyle,fontFamily:e}}get textFontFamilyChanged(){return this.textStyleChanged}get textFontStyle(){return this.textStyle.fontStyle}set textFontStyle(e){this.textStyle={...this.textStyle,fontStyle:e}}get textFontStyleChanged(){return this.textStyleChanged}get textFontWeight(){return this.textStyle.fontWeight}set textFontWeight(e){this.textStyle={...this.textStyle,fontWeight:e}}get textFontWeightChanged(){return this.textStyleChanged}get textFontSize(){return this.textStyle.fontSize}set textFontSize(e){this.textStyle={...this.textStyle,fontSize:e}}get textFontSizeChanged(){return this.textStyleChanged}get textAnchor(){return this.textStyle.anchor}set textAnchor(e){this.textStyle={...this.textStyle,anchor:e}}get textAnchorChanged(){return this.textStyleChanged}get textOffset(){return this.textStyle.offset}set textOffset(e){this.textStyle={...this.textStyle,offset:e}}get textOffsetChanged(){return this.textStyleChanged}get imageUrl(){return this.imageStyle.url}set imageUrl(e){this.imageStyle={...this.imageStyle,url:e}}get imageUrlChanged(){return this.imageStyleChanged}get imageSize(){return this.imageStyle.size}set imageSize(e){this.imageStyle={...this.imageStyle,size:e}}get imageSizeChanged(){return this.imageStyleChanged}get imageAnchor(){return this.imageStyle.anchor}set imageAnchor(e){this.imageStyle={...this.imageStyle,anchor:e}}get imageAnchorChanged(){return this.imageStyleChanged}get imageOffset(){return this.imageStyle.offset}set imageOffset(e){this.imageStyle={...this.imageStyle,offset:e}}get imageOffsetChanged(){return this.imageStyleChanged}};f(Lt,"createDefaultProps",()=>({...Xt.createDefaultProps(),show:!0,allowPicking:!0,usePrimitive:!0,loadFuncStr:void 0,url:xD,stroked:!0,strokeStyle:bt({width:1,widthType:"world",color:[.79,.91,.06,1],material:"",materialParams:{},ground:!1}),filled:!0,fillStyle:bt({color:[.79,.91,.06,.2],material:"",materialParams:{},ground:!1}),imageShow:!0,imageStyle:bt({url:"${earthsdk3-assets-script-dir}/assets/img/location.png",size:[32,32],anchor:[.5,1],offset:[0,0]}),textShow:!0,textStyle:bt({textProperty:"",defaultText:"默认标注",color:[1,1,1,1],backgroundColor:void 0,fontFamily:"Arial",fontSize:16,fontStyle:"normal",fontWeight:"normal",anchor:[0,1],offset:[16,-8]}),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN",zIndex:0})),f(Lt,"type",Lt.register("ESGeoJson",Lt,{chsName:"ESGeoJson",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"GeoJson数据加载"})),f(Lt,"strokeStyleWidthTypes",[["screen","screen"],["world","world"]]),f(Lt,"classificationTypes",[["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]]);let kc=Lt;const wl=class wl extends Ot{constructor(e){super(e);f(this,"editingBindMode","doublePoints");f(this,"_height",this.disposeVar(z(0)));{const n=()=>{this.height=this.points&&this.points.length>=2?this.points[1][2]-this.points[0][2]:0};n(),this.ad(this.pointsChanged.don(n))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}};f(wl,"createDefaultProps",()=>({...Ot.createDefaultProps(),stroked:!0,strokeStyle:bt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(wl,"type",wl.register("ESHeightMeasurement",wl,{chsName:"高度测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"高度测量"})),f(wl,"supportEditingModes",[...Ot.supportEditingModes,nt.DoublePoints,nt.DoublePointsAppend,nt.DoublePointsModify]);let uv=wl;const El=class El extends wo{constructor(e){super(e);f(this,"_area",this.dv(z(0)));f(this,"_perimeter",this.dv(z(0)));f(this,"editingBindMode","doublePoints");const n=()=>{this._area.value=Math.PI*this.radius*this.radius,this._perimeter.value=2*Math.PI*this.radius};n(),this.d(this.radiusChanged.don(n))}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}toPolygon(e=10,n){return X1([...this.position],this.radius,e,n)[0].map(s=>[...s,this.position?this.position[2]:0])}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",basic:[...e.basic,new D([this,"radius"],"圆半径",1,!0),new Ne([this,"instances"],"实例化矩阵",El.defaults.instances,void 0,!0)],coordinate:[...e.coordinate,new H([this,"editing"],"是否编辑"),new _s([this,"position"],"三维坐标",[0,0,0],!0),new D([this,"area"],"面积",0,!1,!0),new D([this,"perimeter"],"周长",0,!1,!0)]}}};f(El,"createDefaultProps",()=>({...wo.createDefaultProps(),radius:1,filled:!0,collision:!1,fillStyle:bt({color:[1,1,1,.5],material:"",materialParams:{},ground:!1}),instances:oe([])})),f(El,"type",El.register("ESLocalCircle",El,{chsName:"局部坐标圆形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalCircle"}));let hv=El;const eh=class eh extends wo{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new Ne([this,"points"],"坐标",[])]}}};f(eh,"createDefaultProps",()=>({...wo.createDefaultProps(),points:xm([]),filled:!0})),f(eh,"type",eh.register("ESLocalPolygon",eh,{chsName:"局部2D坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygon"}));let Gc=eh;const ih=class ih extends Nu{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new Ne([this,"points"],"本地位置数组",[])]}}};f(ih,"createDefaultProps",()=>({...Nu.createDefaultProps(),points:Pa(void 0),filled:!0})),f(ih,"type",ih.register("ESLocalPolygonZ",ih,{chsName:"局部坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygonZ"}));let cv=ih;const nh=class nh extends wo{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new D([this,"width"],"宽度"),new D([this,"height"],"高度")]}}};f(nh,"createDefaultProps",()=>({...wo.createDefaultProps(),width:5e5,height:3e5,filled:!0})),f(nh,"type",nh.register("ESLocalRectangle",nh,{chsName:"局部坐标四边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalRectangle"}));let dv=nh;const qs=class qs extends Ot{constructor(e){super(e);f(this,"editingBindMode","lineString");f(this,"_distance",this.dv(z(0)));f(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);f(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());const n=()=>{if(this.points&&this.points.length>=2){const r=_o(this.points,"GEODESIC"),s=r[r.length-1];this._distance.value=s}else this._distance.value=0};n(),this.d(this.pointsChanged.don(n))}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new D([this,"height"],"高度",10),new D([this,"width"],"宽度",10),new ft([this,"materialMode"],qs.materialModes,"模式",qs.defaults.materialMode)],coordinate:[...e.coordinate,new D([this,"distance"],"距离",0,!1,!0)]}}};f(qs,"createDefaultProps",()=>({...Ot.createDefaultProps(),height:10,width:10,materialMode:"singleArrow",filled:!0,stroked:!0,fillStyle:bt({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),f(qs,"type",qs.register("ESPipeFence",qs,{chsName:"管道电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"管道电子围栏"})),f(qs,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","color"]]),f(qs,"supportEditingModes",[...Ot.supportEditingModes,nt.LineStringAppend,nt.LineStringInsert]);let qf=qs;const xo=class xo extends Jn{constructor(e){super(e);f(this,"_setLayerVisibleEvent",this.dv(new O));f(this,"_setLayerColorEvent",this.dv(new O))}get setLayerVisibleEvent(){return this._setLayerVisibleEvent}setLayerVisible(e,n){this._setLayerVisibleEvent.emit(e,n)}get setLayerColorEvent(){return this._setLayerColorEvent}setLayerColor(e,n){this._setLayerColorEvent.emit(e,n)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new wt("ESPipeserTileset"),new vt("设置图层可见性",this.setLayerVisible.bind(this),["",""],"setLayerVisible"),new vt("设置图层颜色",this.setLayerColor.bind(this),["",""],"setLayerColor"),new ft([this,"colorMode"],xo.colorModes,"colorMode",xo.defaults.colorMode,!0)]}}};f(xo,"createDefaultProps",()=>({...Jn.createDefaultProps(),colorMode:"default"})),f(xo,"type",xo.register("ESPipeserTileset",xo,{chsName:"PipeSer图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"PipeSer图层"})),f(xo,"colorModes",[["default","default"],["color","color"],["blend","blend"]]);let fv=xo;const Io=class Io extends Ot{constructor(e){super(e);f(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",coordinate:[...e.coordinate,new D([this,"area"],"面积",0,!1,!0),new D([this,"perimeter"],"周长",0,!1,!0)],basic:[...e.basic,new D([this,"height"],"高度",10),new ft([this,"materialMode"],Io.materialModes,"模式","danger")]}}};f(Io,"createDefaultProps",()=>({...Ot.createDefaultProps(),height:10,materialMode:"danger",filled:!0,collision:!1})),f(Io,"type",Io.register("ESPolygonFence",Io,{chsName:"多边形电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"多边形电子围栏"})),f(Io,"materialModes",[["模式一","danger"],["模式二","checkerboard"],["模式三","warning"],["模式四","cord"],["模式五","scanline"],["模式六","honeycomb"],["模式七","gradientColor"]]),f(Io,"supportEditingModes",[...Ot.supportEditingModes,nt.CircularAppend,nt.CircularInsert,nt.HeightModify]);let Wf=Io;const ya=class ya extends Ot{constructor(e){super(e);f(this,"_deprecated",["ground"]);f(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());f(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new wt("通用"),new H([this,"ground"],"是否贴地"),new H([this,"outlineTranslucent"],"轮廓线半透明"),new D([this,"height"],"高度"),new D([this,"extrudedHeight"],"拉伸高度"),new rr([this,"rectangle"],"范围",ya.defaults.rectangle,!0),new D([this,"stRotation"],"纹理旋转角度"),new D([this,"rotation"],"旋转角度"),new H([this,"pointEditing"],"是否单点编辑")]}}};f(ya,"createDefaultProps",()=>({...Ot.createDefaultProps(),ground:!1,outlineTranslucent:!0,height:0,extrudedHeight:0,rectangle:oe(void 0),rotation:0,stRotation:0,pointEditing:!1,filled:!0})),f(ya,"type",ya.register("ESRectangle",ya,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"矩形"})),f(ya,"supportEditingModes",[...Ot.supportEditingModes,nt.DoublePoints,nt.DoublePointsAppend,nt.DoublePointsModify]);let gv=ya;const rh=class rh extends Jt{getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Ne([this,"innerRings"],"裁切多边形数组",[],void 0,!0),new H([this,"gradient"],"是否使用渐变填充",!1),new H([this,"light"],"是否使用光照",!1)]}}};f(rh,"createDefaultProps",()=>({...Jt.createDefaultProps(),innerRings:yg([]),gradient:!1,light:!1})),f(rh,"type",rh.register("ESPolygonWithHole",rh,{chsName:"内部裁切多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"带洞多边形"}));let pv=rh;const _a=class _a extends Jt{constructor(e){super(e);f(this,"_startEvent",this.disposeVar(new O));f(this,"_stopEvent",this.dv(new O));f(this,"_surfaceArea",this.disposeVar(z(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get surfaceArea(){return this._surfaceArea.value}set surfaceArea(e){this._surfaceArea.value=e}get surfaceChanged(){return this._surfaceArea.changed}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new wt("表面积测量"),new vt("开始计算",()=>this.start(),[],"start"),new vt("停止计算",()=>this.stop(),[],"stop"),new D([this,"interpolation"],"插值距离",_a.defaults.interpolation),new D([this,"offsetHeight"],"偏移高度",_a.defaults.offsetHeight)]}}};f(_a,"createDefaultProps",()=>({...Jt.createDefaultProps(),interpolation:.5,offsetHeight:0,units:ot(["SquareMeter_SquareKilometer","MU_Hectare"]),fillStyle:bt({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),f(_a,"type",_a.register("ESSurfaceAreaMeasurement",_a,{chsName:"表面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"表面积测量"}));let mv=_a;const wa=class wa extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new D([this,"downloadProgress"],"下载进度",wa.defaults.downloadProgress,!0,!0),new Et([this,"importOptions"],"导入参数",wa.defaults.importOptions,void 0,!0)],dataSource:[...t.dataSource,new Et([this,"url"],"路径")]}}};f(wa,"createDefaultProps",()=>({...ct.createDefaultProps(),url:"",importOptions:fe({buildCollisions:"QueryAndPhysics",buildHierarchy:"Simplified",collisionType:"CTF_UseComplexAsSimple",bImportMetaData:!0}),downloadProgress:0})),f(wa,"type",wa.register("ESDatasmithRuntimeModel",wa,{chsName:"Datasmith Model",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Datasmith Model"}));let vv=wa;const Ki=class Ki extends Gc{constructor(t){super(t),this.ad(Ze([this.waterColorChanged,this.waterImageChanged,this.frequencyChanged,this.amplitudeChanged,this.flowDirectionChanged,this.waveVelocityChanged,this.specularIntensityChanged,this.murkinessChanged,this.flowSpeedChanged],()=>{this.waterType="custom"}))}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ft([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",Ki.defaults.waterType),new D([this,"frequency"],"频率",Ki.defaults.frequency),new Qe([this,"amplitude"],.01,[0,1],"振幅",Ki.defaults.amplitude),new Qe([this,"flowDirection"],1,[0,360],"流向",Ki.defaults.flowDirection),new Qe([this,"waveVelocity"],.01,[0,1],"波动频率",Ki.defaults.waveVelocity),new Qe([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Ki.defaults.specularIntensity),new Qe([this,"murkiness"],.1,[0,10],"水体浑浊度",Ki.defaults.murkiness),new D([this,"flowSpeed"],"水流速度",Ki.defaults.flowSpeed),new Dt([this,"waterColor"],"水的底色",Ki.defaults.waterColor),new Et([this,"waterImage"],"水的图片",Ki.defaults.waterImage)]}}};f(Ki,"createDefaultProps",()=>({...Gc.createDefaultProps(),allowPicking:!0,waterImage:fe(void 0),waterColor:[.15,.16,0,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5,stroked:!1,filled:!0})),f(Ki,"type",Ki.register("ESDynamicWater",Ki,{chsName:"动态水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"局部多边形水面"}));let yv=Ki;const Qi=class Qi extends Jt{constructor(t){super(t),this.ad(Ze([this.waterColorChanged,this.waterImageChanged,this.frequencyChanged,this.amplitudeChanged,this.flowDirectionChanged,this.waveVelocityChanged,this.specularIntensityChanged,this.murkinessChanged,this.flowSpeedChanged],()=>{this.waterType="custom"}))}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new ft([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",Qi.defaults.waterType),new D([this,"frequency"],"频率",Qi.defaults.frequency),new Qe([this,"amplitude"],.01,[0,1],"振幅",Qi.defaults.amplitude),new Qe([this,"flowDirection"],1,[0,360],"流向",Qi.defaults.flowDirection),new Qe([this,"waveVelocity"],.01,[0,1],"波动频率",Qi.defaults.waveVelocity),new Qe([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Qi.defaults.specularIntensity),new Qe([this,"murkiness"],.1,[0,10],"水体浑浊度",Qi.defaults.murkiness),new D([this,"flowSpeed"],"水流速度",Qi.defaults.flowSpeed),new Dt([this,"waterColor"],"水的底色",Qi.defaults.waterColor),new Et([this,"waterImage"],"水的图片",Qi.defaults.waterImage)]}}};f(Qi,"createDefaultProps",()=>({...Jt.createDefaultProps(),allowPicking:!0,waterImage:fe({}),waterColor:[.15,.16,0,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5})),f(Qi,"type",Qi.register("ESGeoWater",Qi,{chsName:"地理水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地理动态水面"}));let _v=Qi;const Sl=class Sl extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new D([this,"downloadProgress"],"下载进度",Sl.defaults.downloadProgress,!0,!0),new mt([this,"levelName"],"levelName",""),new D([this,"levelLoadDistance"],"levelLoadDistance",1e3),new ci([this,"levelOffset"],"levelOffset",[0,0,0])],dataSource:[...t.dataSource,new Et([this,"url"],"url","")]}}};f(Sl,"createDefaultProps",()=>({...ct.createDefaultProps(),url:"",downloadProgress:0,levelName:"",levelOffset:ot([0,0,0]),levelLoadDistance:1e3})),f(Sl,"type",Sl.register("ESLevelRuntimeModel",Sl,{chsName:"关卡包模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"关卡包模型"}));let wv=Sl;const er=class er extends Fi{constructor(e){super(e);f(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);f(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})())}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new D([this,"radius"],"半径",er.defaults.radius),new D([this,"sides"],"圆边数",er.defaults.sides),new D([this,"speed"],"材质速度",er.defaults.speed),new ft([this,"materialMode"],er.materialModes,"材质模式",er.defaults.materialMode),new Et([this,"materialImage"],"材质图片和重复度",er.defaults.materialImage)]}}};f(er,"createDefaultProps",()=>({...Fi.createDefaultProps(),radius:10,sides:10,materialMode:"singleArrow",materialImage:bt({url:"",uDis:50,vDis:10}),speed:1,filled:!0,stroked:!1,fillStyle:bt({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),f(er,"type",er.register("ESPipeline",er,{chsName:"管线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPipeline"})),f(er,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"]]);let Ev=er;const Ws=class Ws extends Ot{constructor(e){super(e);f(this,"editingBindMode","visibility")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Dt([this,"visibleColor"],"可视区域颜色",Ws.defaults.visibleColor),new Dt([this,"invisibleColor"],"遮挡区域颜色",Ws.defaults.invisibleColor),new D([this,"heightOffset"],"视点高度偏移",Ws.defaults.heightOffset)]}}};f(Ws,"createDefaultProps",()=>({...Ot.createDefaultProps(),visibleColor:ot([0,1,0,1]),invisibleColor:ot([1,0,0,1]),heightOffset:0})),f(Ws,"type",Ws.register("ESVisibilityAnalysis",Ws,{chsName:"通视分析,视线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"通视分析,视线分析"})),f(Ws,"supportEditingModes",[...Ot.supportEditingModes,nt.VisibilityAppend,nt.VisibilityModify]);let Sv=Ws;const sh=class sh extends Jt{constructor(e){super(e);f(this,"_startEvent",this.dv(new O));f(this,"_clearEvent",this.dv(new O));f(this,"_volume",this.disposeVar(z(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get volume(){return this._volume.value}set volume(e){this._volume.value=e}get volumeChanged(){return this._volume.changed}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new wt("通用"),new D([this,"planeHeight"],"基准面高程",void 0,!0),new D([this,"gridWidth"],"采样间距 m"),new D([this,"cutVolume"],"挖方",0,!1,!0),new D([this,"fillVolume"],"填方",0,!1,!0),new D([this,"cutAndFillVolume"],"挖填方",0,!1,!0),new D([this,"progress"],"计算进度",0,!1,!0),new vt("开始分析",()=>this.start(),[],"start"),new vt("清空分析结果",()=>this.clear(),[],"clear"),new H([this,"depthTest"],"是否开启深度检测")]}}};f(sh,"createDefaultProps",()=>({...Jt.createDefaultProps(),planeHeight:z(void 0),gridWidth:1,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,filled:!1,stroked:!0,strokeStyle:bt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(sh,"type",sh.register("ESVolumeMeasurement",sh,{chsName:"体积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"体积测量"}));let bv=sh;const oh=class oh extends Zn{constructor(e){super(e);f(this,"_human",this.dv(new Zn));f(this,"_poi",this.dv(new Fc));this.d(this.components.disposableAdd(this._human,!0)),this.d(this.components.disposableAdd(this._poi));{const{_human:n,_poi:r}=this;this.d(F([n,"show"],[this,"show"])),this.d(F([r,"show"],[this,"show"])),this.d(F([n,"allowPicking"],[this,"allowPicking"])),this.d(F([r,"allowPicking"],[this,"allowPicking"])),this.d(F([n,"scale"],[this,"scale"])),this.d(F([r,"scale"],[this,"scale"])),this.d(F([n,"collision"],[this,"collision"])),this.d(F([r,"collision"],[this,"collision"])),this.d(lt([n,"flyInParam"],[this,"flyInParam"])),this.d(lt([n,"flyToParam"],[this,"flyToParam"])),this.d(F([n,"animation"],[this,"animation"])),this.d(F([n,"mode"],[this,"mode"])),this.d(F([n,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(F([n,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(F([r,"name"],[this,"name"])),this.d(F([r,"mode"],[this,"poiMode"])),this.d(F([r,"autoAnchor"],[this,"autoAnchor"])),this.d(F([r,"screenRender"],[this,"screenRender"])),this.d(F([r,"size"],[this,"size"])),this.d(F([r,"anchor"],[this,"anchor"])),this.d(F([r,"sizeByContent"],[this,"sizeByContent"])),this.d(F([r,"renderMode"],[this,"renderMode"])),this.d(F([r,"rotationType"],[this,"rotationType"])),this.d(F([r,"zOrder"],[this,"zOrder"])),this.d(F([r,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(F([r,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(lt([n,"position"],[this,"position"])),this.d(lt([n,"rotation"],[this,"rotation"])),this.d(this.flyInEvent.don(s=>{n.flyIn(s)})),this.d(this.flyToEvent.don(s=>{n.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{n.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{n.calcFlyInParam()})),this.d(this.smoothMoveEvent.don((s,o)=>{n.smoothMove(s,o)})),this.d(this.smoothMoveWithRotationEvent.don((s,o,a)=>{n.smoothMoveWithRotation(s,o,a)})),this.d(this.smoothMoveOnGroundEvent.don((s,o,a,l)=>{n.smoothMoveOnGround(s,o,a,l)})),this.d(this.smoothMoveWithRotationOnGroundEvent.don((s,o,a,l,u)=>{n.smoothMoveWithRotationOnGround(s,o,a,l,u)})),this.d(this.automaticLandingEvent.don(()=>{n.automaticLanding()})),this.d(this._human.readyEvent.don(s=>{this.readyEvent.emit(s)}))}}get human(){return this._human}get poi(){return this._poi}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ft([this,"poiMode"],Fc.modes,"poi模式","SquareH01"),new D([this,"poiOffsetHeight"],"poi高度偏移",1.8)]}}};f(oh,"createDefaultProps",()=>({poiOffsetHeight:1.8,poiMode:"SquareH01",style:bt({}),autoAnchor:!0,screenRender:!0,size:ot([100,100]),anchor:ot([.5,1]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,...Zn.createDefaultProps()})),f(oh,"type",oh.register("ESHumanPoi",oh,{chsName:"人员poi",tags:["ESObjects"],description:"ESHuman + ESPoi2D组合对象"}));let Cv=oh;const Hs=class Hs extends ct{constructor(t){super(t)}getESProperties(){return{...{...super.getESProperties()},defaultMenu:"basic",basic:[new mt([this,"image"],"图片",Hs.defaults.image),new D([this,"height"],"喷泉高度",Hs.defaults.height),new D([this,"spread"],"扩散角度",Hs.defaults.spread),new D([this,"emissionRate"],"发射率",Hs.defaults.emissionRate)]}}};f(Hs,"createDefaultProps",()=>({...ct.createDefaultProps(),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",height:10,spread:5,emissionRate:50})),f(Hs,"type",Hs.register("ESFountainParticleSystem",Hs,{chsName:"粒子喷泉",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"粒子喷泉"}));let Hf=Hs;const ir=class ir extends Zn{constructor(e){super(e);f(this,"_human",this.dv(new Zn));f(this,"_fountain",this.dv(new Hf));this.d(this.components.disposableAdd(this._human,!0)),this.d(this.components.disposableAdd(this._fountain));{const{_human:n,_fountain:r}=this;this.ad(Ze([this.showChanged,this.humanShowChanged,this.fountainShowChanged],()=>{n.show=this.show&&this.humanShow,r.show=this.show&&this.fountainShow},{immediate:!0})),this.d(F([n,"allowPicking"],[this,"allowPicking"])),this.d(F([r,"allowPicking"],[this,"allowPicking"])),this.d(F([n,"scale"],[this,"scale"])),this.d(F([r,"scale"],[this,"scale"])),this.d(F([n,"collision"],[this,"collision"])),this.d(F([r,"collision"],[this,"collision"])),this.d(lt([n,"flyInParam"],[this,"flyInParam"])),this.d(lt([n,"flyToParam"],[this,"flyToParam"])),this.d(F([n,"animation"],[this,"animation"])),this.d(F([n,"mode"],[this,"mode"])),this.d(F([n,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(F([n,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.ad(Ze([this.positionOffsetChanged,this.fountainOffsetChanged],()=>{n.positionOffset=this.positionOffset,r.positionOffset=[this.positionOffset[0]+this.fountainOffset[0],this.positionOffset[1]+this.fountainOffset[1],this.positionOffset[2]+this.fountainOffset[2]]},{immediate:!0})),this.d(lt([n,"position"],[this,"position"])),this.d(lt([n,"rotation"],[this,"rotation"])),this.d(lt([r,"position"],[this,"position"])),this.ad(Ze(this.rotationChanged,()=>{r.rotation=[this.rotation[0],this.rotation[1]-30,this.rotation[2]]},{immediate:!0})),this.d(F([r,"image"],[this,"fountainImage"])),this.d(F([r,"height"],[this,"fountainHeight"])),this.d(F([r,"spread"],[this,"fountainSpread"])),this.d(F([r,"emissionRate"],[this,"fountainEmissionRate"])),this.d(this.flyInEvent.don(s=>{n.flyIn(s)})),this.d(this.flyToEvent.don(s=>{n.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{n.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{n.calcFlyInParam()})),this.d(this.smoothMoveEvent.don((s,o)=>{n.smoothMove(s,o)})),this.d(this.smoothMoveWithRotationEvent.don((s,o,a)=>{n.smoothMoveWithRotation(s,o,a)})),this.d(this.smoothMoveOnGroundEvent.don((s,o,a,l)=>{n.smoothMoveOnGround(s,o,a,l)})),this.d(this.smoothMoveWithRotationOnGroundEvent.don((s,o,a,l,u)=>{n.smoothMoveWithRotationOnGround(s,o,a,l,u)})),this.d(this.automaticLandingEvent.don(()=>{n.automaticLanding()})),this.d(this._human.readyEvent.don(s=>{this.readyEvent.emit(s)}))}}get human(){return this._human}get fountain(){return this._fountain}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new H([this,"humanShow"],"人物显隐",ir.defaults.humanShow),new H([this,"fountainShow"],"喷泉显隐",ir.defaults.fountainShow),new mt([this,"fountainImage"],"喷泉图片",ir.defaults.fountainImage),new ci([this,"fountainOffset"],"喷泉偏移",ir.defaults.fountainOffset),new D([this,"fountainHeight"],"喷泉高度",ir.defaults.fountainHeight),new D([this,"fountainSpread"],"喷泉扩散角度",ir.defaults.fountainSpread),new D([this,"fountainEmissionRate"],"喷泉发射率",ir.defaults.fountainEmissionRate)]}}};f(ir,"createDefaultProps",()=>({...Zn.createDefaultProps(),humanShow:!0,fountainShow:!0,fountainImage:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",fountainOffset:ot([0,0,0]),fountainHeight:10,fountainSpread:5,fountainEmissionRate:50})),f(ir,"type",ir.register("ESHumanFountain",ir,{chsName:"人员喷泉",tags:["ESObjects"],description:"ESHuman + ESFountainParticleSystem组合对象,喷泉从人物手中喷出"}));let Pv=ir;const Ar=class Ar extends Jt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new D([this,"depth"],"深度",Ar.defaults.depth),new D([this,"interpolation"],"插值",Ar.defaults.interpolation),new D([this,"opacity"],"透明度",Ar.defaults.opacity),new Et([this,"sideImage"],"侧面图片",Ar.defaults.sideImage),new Et([this,"bottomImage"],"底面图片",Ar.defaults.bottomImage),new D([this,"extendBoundary"],"外扩边界采样高度",Ar.defaults.extendBoundary)]}}};f(Ar,"createDefaultProps",()=>({...Jt.createDefaultProps(),depth:100,sideImage:bt({url:pt.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/side.jpg"),uDis:50,vDis:50}),bottomImage:bt({url:pt.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/bottom.jpg"),uDis:50,vDis:50}),opacity:1,interpolation:50,collision:!1,allowPicking:!1,filled:!0,extendBoundary:1})),f(Ar,"type",Ar.register("ESPit",Ar,{chsName:"坑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"坑"}));let Du=Ar;const ah=class ah extends Du{constructor(e){super(e);f(this,"_excavate",this.dv(new Ac));f(this,"_pit",this.dv(new Du));this.d(this.components.disposableAdd(this._excavate)),this.d(this.components.disposableAdd(this._pit,!0));{const{_excavate:n,_pit:r}=this;this.d(F([n,"show"],[this,"show"])),this.d(F([r,"show"],[this,"show"])),this.d(F([n,"allowPicking"],[this,"allowPicking"])),this.d(F([r,"allowPicking"],[this,"allowPicking"])),this.d(F([n,"collision"],[this,"collision"])),this.d(F([r,"collision"],[this,"collision"])),this.d(lt([r,"points"],[this,"points"])),this.d(F([n,"points"],[this,"points"])),this.d(F([r,"pointed"],[this,"pointed"])),this.d(F([n,"pointed"],[this,"pointed"])),this.d(F([r,"pointStyle"],[this,"pointStyle"])),this.d(F([n,"pointStyle"],[this,"pointStyle"])),this.d(F([r,"stroked"],[this,"stroked"])),this.d(F([n,"stroked"],[this,"stroked"])),this.d(F([r,"strokeStyle"],[this,"strokeStyle"])),this.d(F([n,"strokeStyle"],[this,"strokeStyle"])),this.d(F([r,"filled"],[this,"filled"])),this.d(F([r,"fillStyle"],[this,"fillStyle"])),this.d(F([n,"fillStyle"],[this,"fillStyle"])),this.d(F([n,"mode"],[this,"mode"])),this.d(F([n,"targetID"],[this,"targetID"])),this.d(F([r,"depth"],[this,"depth"])),this.d(F([r,"sideImage"],[this,"sideImage"])),this.d(F([r,"bottomImage"],[this,"bottomImage"])),this.d(F([r,"opacity"],[this,"opacity"])),this.d(F([r,"interpolation"],[this,"interpolation"])),this.d(lt([r,"flyInParam"],[this,"flyInParam"])),this.d(lt([r,"flyToParam"],[this,"flyToParam"])),this.ad(lt([r,"extendBoundary"],[this,"extendBoundary"])),this.d(this.flyInEvent.don(s=>{r.flyIn(s)})),this.d(this.flyToEvent.don(s=>{r.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{r.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{r.calcFlyInParam()}))}}get excavate(){return this._excavate}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ft([this,"mode"],Ac.modes,"模式","in"),new mt([this,"targetID"],"目标图层id","")]}}};f(ah,"createDefaultProps",()=>({...Du.createDefaultProps(),mode:"in",targetID:""})),f(ah,"type",ah.register("ESHole",ah,{chsName:"挖坑(带材质+深度)",tags:["ESObjects"],description:"挖坑"}));let xv=ah;function wE(i){return i.startsWith("/")&&!i.startsWith("//")}function Xf(i){var t;return!i||/^https?:\/\//i.test(i)?i:wE(i)&&typeof window<"u"&&((t=window.location)!=null&&t.origin)?`${window.location.origin}${i}`:i}function $f(i){var e;return(e=Xf(i).match(/^(https?:\/\/[^/]+)/i))==null?void 0:e[1]}function EE(i){var e;return(e=Xf(i).match(/^(https?:\/\/[^:]+)/i))==null?void 0:e[1]}function il(i){return i==="CesiumlabDesktop"?"/cim":""}function SE(i){if(/\/cim\/ts\//.test(i))return"CesiumlabDesktop";if(/\/ts\/(?:info|tiles|featuretiles)\//.test(i))return"CIMRTS"}function bE(i){const t=i.match(/(?:\/cim)?\/ts\/info\/([^?/]+)/);return t==null?void 0:t[1]}function ID(i,t,e){const n=il(t);return`${i}${n}/ts/info/${e}`}function CE(i,t,e,n=Date.now()){const r=il(t);return`${i}${r}/ts/tiles/${e}/tileset.json?t=${n}`}function PE(i,t,e,n){const r=il(t);return`${i}${r}/ts/featuretiles/${e}/${n}/tileset.json`}const Yf={layerconfigfind:"/ts/layer/config/get",layerconfigsave:"/ts/layer/config/put",featureproperty:"/ts/editor/property",featureeditormuti:"/ts/editor/update",getts:"/ts/info"},xE=async(i,t,e,n,r="CIMRTS")=>{try{const s=window.localStorage.getItem("Authorization"),o=il(r);let a=i+`${o}${Yf.layerconfigfind}?tileServiceName=${t}`;e&&(a+=`&earthdstoken=${encodeURIComponent(n)}`);const l={headers:{...!e&&s?{Authorization:s}:{}},mode:"cors"},h=await(await fetch(a,l)).text();return JSON.parse(h)}catch(s){console.error(s)}},IE=async(i,t,e,n,r,s="CIMRTS")=>{try{const o=window.localStorage.getItem("Authorization"),a=il(s);let l=i+`${a}${Yf.layerconfigsave}`;const u=r??{};e&&(l+=`?earthdstoken=${encodeURIComponent(n)}`);const h={method:"POST",headers:{"Content-Type":"application/json",...!e&&o?{Authorization:o}:{}},mode:"cors",body:JSON.stringify({tileServiceName:t,layerConfig:JSON.stringify(u)})},d=await(await fetch(l,h)).text();return JSON.parse(d)}catch(o){console.error(o)}},ME=async(i,t,e)=>{try{const n=window.localStorage.getItem("Authorization");let r=i;t&&(r+=`?earthdstoken=${encodeURIComponent(e)}`);const s={headers:{...!t&&n?{Authorization:n}:{}},mode:"cors"},a=await(await fetch(r,s)).text(),l=JSON.parse(a);if(l.status=="ok")return l.data.port;console.error(l.status);return}catch(n){console.error(n)}},TE=async(i,t,e,n,r,s="CIMRTS")=>{try{const o={tileServiceName:t,featureId:e},a=window.localStorage.getItem("Authorization"),l=il(s);let u=i+`${l}${Yf.featureproperty}`;n&&(u+=`?earthdstoken=${encodeURIComponent(r)}`);const c=await(await fetch(u,{method:"post",headers:{"Content-Type":"application/json",...!n&&a?{Authorization:a}:{}},body:JSON.stringify(o),mode:"cors"})).text(),d=JSON.parse(c);if(d.status=="ok")return d.data;console.error(d.data.status);return}catch(o){console.error(o)}},lh=class lh extends Jn{constructor(e){super(e);f(this,"_es3DTileset",this.dv(new Jn));f(this,"_ids",this.dv(bt([])));f(this,"_platform",this.dv(z("CIMRTS")));f(this,"_visJson",this.disposeVar(z({})));f(this,"_highlightInner3DtilesetEvent",this.dv(new O));f(this,"_removeHighlightInner3DtilesetEvent",this.dv(new O));f(this,"_tilesetServePort",this.dv(z("")));this.collision=!1;{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01");return}this.url?(this.syncPlatformFromUrl(),this.refresh()):this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()})),this.d(this.platformChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const n=this._es3DTileset;this.d(F([n,"allowPicking"],[this,"allowPicking"])),this.d(F([n,"collision"],[this,"collision"])),this.d(lt([n,"flyToParam"],[this,"flyToParam"])),this.d(F([n,"actorTag"],[this,"actorTag"])),this.d(F([n,"materialMode"],[this,"materialMode"])),this.d(F([n,"highlight"],[this,"highlight"])),this.d(F([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(F([n,"highlightID"],[this,"highlightID"])),this.d(F([n,"highlightColor"],[this,"highlightColor"])),this.d(lt([n,"offset"],[this,"offset"])),this.d(lt([n,"rotation"],[this,"rotation"])),this.d(F([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(F([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(F([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(F([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(F([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(F([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(F([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(F([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(F([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(F([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(F([n,"cacheBytes"],[this,"cacheBytes"])),this.d(F([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(F([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(F([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(F([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(F([n,"materialParams"],[this,"materialParams"])),this.d(lt([n,"supportEdit"],[this,"supportEdit"])),this.d(lt([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(lt([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(lt([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(lt([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(lt([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(lt([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...r)=>{n.highlightFeature(...r)})),this.d(this.highlightFeatureAndFlyToEvent.don((...r)=>{n.highlightFeatureAndFlyTo(...r)})),this.d(this.setFeatureColorEvent.don((...r)=>{n.setFeatureColor(...r)})),this.d(this.setFeatureVisableEvent.don((...r)=>{n.setFeatureVisable(...r)})),this.d(this.resetFeatureStyleEvent.don((...r)=>{n.resetFeatureStyle(...r)})),this.d(this.setFeatureStyleEvent.don((...r)=>{n.setFeatureStyle(...r)})),this.d(this.flyInEvent.don((...r)=>{n.flyIn(r[0])})),this.d(this.flyToEvent.don((...r)=>{n.flyTo(r[0])})),this.d(this.calcFlyToParamEvent.don((...r)=>{n.calcFlyToParam(...r)})),this.d(this.calcFlyInParamEvent.don((...r)=>{n.calcFlyInParam(...r)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(r=>{this.tilesetReady.emit(r)})),this.d(n.pickedEvent.don(r=>{r.assign({sceneObject:this}),this.pickedEvent.emit(r)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get ids(){return this._ids.value}get idsChanged(){return this._ids.changed}set ids(e){this._ids.value=e}get platform(){return this._platform.value}get platformChanged(){return this._platform.changed}set platform(e){this._platform.value=e}get visJson(){return this._visJson.value}set visJson(e){this._visJson.value=e}get visJsonChanged(){return this._visJson.changed}setFeatureVisable(e,n){var r;if((r=this.layerConfig)!=null&&r.length){const s={};s[n[0].value]=n[0].visable,this.visJson={...this.visJson,...s}}else this.setFeatureVisableEvent.emit(e,typeof n=="string"?JSON.parse(n):n,!0)}async getFeatureProperty(e){return await TE(this.baseUrl,this.tileServiceName,e,this.useEarthDSToken,this.earthdstoken,this.platform)}async getLayerConfig(){const e=await xE(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,this.platform);return!e||!Array.isArray(e)?this.layerConfig=[]:this.layerConfig=e,this.layerConfig}async saveLayerConfig(){const e=this.layerConfig;return await IE(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,e,this.platform)}get highlightInner3DtilesetEvent(){return this._highlightInner3DtilesetEvent}_highlightInner3Dtileset(e){this._highlightInner3DtilesetEvent.emit(e)}async highlightDSFeature(e){this._highlightInner3Dtileset(e)}get removeHighlightInner3DtilesetEvent(){return this._removeHighlightInner3DtilesetEvent}_removeHighlightInner3Dtileset(e){this._removeHighlightInner3DtilesetEvent.emit(e)}async removeHighlightDSFeature(e){this._removeHighlightInner3Dtileset(e)}async pickFeature(e,n){var a,l,u;const r=await e.pick(n),s=r.sceneObject;return!s||s.id!==this.id&&s.typeName!="ESRtsFeatureEditing"?void 0:s.typeName!="ESRtsFeatureEditing"?(this.ids=[...this.ids,(a=r==null?void 0:r.tilesetPickInfo)==null?void 0:a.id],{featureId:(l=r==null?void 0:r.tilesetPickInfo)==null?void 0:l.id,pickInnerFields:r==null?void 0:r.tilesetPickInfo}):{featureId:(u=r==null?void 0:r.sceneObject)==null?void 0:u.id,pickInnerFields:r==null?void 0:r.tilesetPickInfo}}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(e){this._tilesetServePort.value=e}async getport(){const e=await ME(Xf(this.url),this.useEarthDSToken,this.earthdstoken);if(e)return this.tilesetServePort=e,e;throw new Error("服务地址port获取失败!")}async refresh(){if(!this.url||typeof this.url!="string")return;const e=+new Date,n=$f(this.url);n&&(this.syncPlatformFromUrl(),this._es3DTileset.offset=[0,0,0],this._es3DTileset.rotation=[0,0,0],this._es3DTileset.url=CE(n,this.platform,this.tileServiceName,e),console.log("3dtileset url:",this._es3DTileset.url))}syncPlatformFromUrl(){if(typeof this.url!="string"||!this.url)return;const e=SE(this.url);e&&e!==this.platform&&(this._platform.value=e)}get baseUrl(){if(this.url&&typeof this.url=="string"){const e=$f(this.url);if(!e)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01");return e}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01")}get tileServiceName(){if(this.url&&typeof this.url=="string"){const e=bE(this.url);if(!e)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01 或 http://localhost:9109/cim/ts/info/ms01");return e}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01 或 http://localhost:9109/cim/ts/info/ms01")}get tileServiceIp(){if(this.url&&typeof this.url=="string"){const e=EE(this.url);if(!e)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01");return e}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Ne([this,"layerConfig"],"图层配置",[],void 0,!0)]}}};f(lh,"createDefaultProps",()=>({...Jn.createDefaultProps(),layerConfig:fe([]),isSameIP:!1,useEarthDSToken:!1,earthdstoken:""})),f(lh,"type",lh.register("ESRtsTileset",lh,{chsName:"CIMRTS实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let Iv=lh;function MD(i){return typeof i=="number"&&!isNaN(i)}const uh=class uh extends Jn{get json(){return{...this._innerGetJson(),show:this.show,materials:this.materials,changeMaterial:this.changeMaterial,props:this.props,rotation:this.rotation,offset:this.offset}}set json(t){this._innerSetJson(t)}async init(t,e){this.featureId=e;const n=await t.getFeatureProperty(e);this.uiShowprops=n.props.map(a=>({featureClassName:a.name,fields:a.props?a.props.map(l=>({key:l.name,type:l.type,value:l.type!="double"?l.value:MD(l.value)?Number(l.value.toFixed(3)):""})):[]})),this.datasetName=n.datasetName,t.setFeatureVisable("id",[{value:this.featureId,visable:!1}]),this.d(()=>{t.setFeatureVisable("id",[{value:this.featureId,visable:!0}])});const r=typeof t.url=="string"?t.url:"",s=$f(r),o=t.tileServiceName;if(!s)throw new Error("ESRtsFeatureEditing: 无法解析服务地址");this.url=PE(s,t.platform,o,this.featureId),this.allowPicking=!0,this.d(this.pickedEvent.don(a=>{a.assign({sceneObject:t}),t.pickedEvent.emit(a)})),this.d(()=>{this.editing=!1,t.removeHighlightDSFeature(this)})}constructor(t){super(t)}};f(uh,"createDefaultProps",()=>({...Jn.createDefaultProps(),datasetName:void 0,featureId:void 0,materials:bt({}),changeMaterial:fe(void 0),uiShowprops:bt({}),props:bt({})})),f(uh,"type",uh.register("ESRtsFeatureEditing",uh,{chsName:"ESRtsFeatureEditing",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let Mv=uh;const TD=async(i,t,e)=>{try{const n=window.localStorage.getItem("Authorization");let r=i;t&&(r+=`?earthdstoken=${encodeURIComponent(e)}`);const s={headers:{...!t&&n?{Authorization:n}:{}},mode:"cors"},a=await(await fetch(r,s)).text(),l=JSON.parse(a);if(l.status=="ok")return l.data.port;console.error(l.status);return}catch(n){console.error(n)}};function ND(i){return i==="CesiumlabDesktop"?"/osgb":""}function OD(i){if(/\/osgb\/ts\//.test(i))return"CesiumlabDesktop";if(/\/ts\/(?:info|tiles|featuretiles)\//.test(i))return"CIMRTS"}function NE(i){const t=i.match(/(?:\/osgb)?\/ts\/info\/([^?/]+)/);return t==null?void 0:t[1]}function DD(i,t,e,n=Date.now()){const r=ND(e);return`${i}:${t}${r}/tiles/tileset.json?t=${n}`}const hh=class hh extends Jn{constructor(e){super(e);f(this,"_es3DTileset",this.dv(new Jn));f(this,"_platform",this.dv(z("CIMRTS")));f(this,"_tilesetServePort",this.dv(z("")));this.collision=!1;{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ms01");return}this.url?(this.syncPlatformFromUrl(),this.refresh()):this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()})),this.d(this.platformChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const n=this._es3DTileset;this.d(F([n,"allowPicking"],[this,"allowPicking"])),this.d(F([n,"collision"],[this,"collision"])),this.d(lt([n,"flyToParam"],[this,"flyToParam"])),this.d(F([n,"actorTag"],[this,"actorTag"])),this.d(F([n,"materialMode"],[this,"materialMode"])),this.d(F([n,"highlight"],[this,"highlight"])),this.d(F([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(F([n,"highlightID"],[this,"highlightID"])),this.d(F([n,"highlightColor"],[this,"highlightColor"])),this.d(lt([n,"offset"],[this,"offset"])),this.d(lt([n,"rotation"],[this,"rotation"])),this.d(F([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(F([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(F([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(F([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(F([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(F([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(F([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(F([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(F([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(F([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(F([n,"cacheBytes"],[this,"cacheBytes"])),this.d(F([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(F([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(F([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(F([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(F([n,"materialParams"],[this,"materialParams"])),this.d(lt([n,"supportEdit"],[this,"supportEdit"])),this.d(lt([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(lt([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(lt([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(lt([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(lt([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(lt([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...r)=>{n.highlightFeature(...r)})),this.d(this.highlightFeatureAndFlyToEvent.don((...r)=>{n.highlightFeatureAndFlyTo(...r)})),this.d(this.setFeatureColorEvent.don((...r)=>{n.setFeatureColor(...r)})),this.d(this.setFeatureVisableEvent.don((...r)=>{n.setFeatureVisable(...r)})),this.d(this.resetFeatureStyleEvent.don((...r)=>{n.resetFeatureStyle(...r)})),this.d(this.setFeatureStyleEvent.don((...r)=>{n.setFeatureStyle(...r)})),this.d(this.flyInEvent.don((...r)=>{n.flyIn(r[0])})),this.d(this.flyToEvent.don((...r)=>{n.flyTo(r[0])})),this.d(this.calcFlyToParamEvent.don((...r)=>{n.calcFlyToParam(...r)})),this.d(this.calcFlyInParamEvent.don((...r)=>{n.calcFlyInParam(...r)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(r=>{this.tilesetReady.emit(r)})),this.d(n.pickedEvent.don(r=>{r.assign({sceneObject:this}),this.pickedEvent.emit(r)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get platform(){return this._platform.value}get platformChanged(){return this._platform.changed}set platform(e){this._platform.value=e}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(e){this._tilesetServePort.value=e}async getport(){const e=await TD(this.url,this.useEarthDSToken,this.earthdstoken);if(e)return this.tilesetServePort=e,e;throw new Error("服务地址port获取失败!")}async refresh(){if(!this.url||typeof this.url!="string"||!NE(this.url))return;const n=+new Date;this.syncPlatformFromUrl();const r=await this.getport(),s=this.tileServiceIp;this._es3DTileset.offset=[0,0,0],this._es3DTileset.rotation=[0,0,0],this._es3DTileset.url=DD(s,r,this.platform,n),console.log("3dtileset url:",this._es3DTileset.url)}syncPlatformFromUrl(){if(typeof this.url!="string"||!this.url)return;const e=OD(this.url);e&&e!==this.platform&&(this._platform.value=e)}get baseUrl(){var e;if(this.url&&typeof this.url=="string"){const n=(e=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:e[1];if(!n)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var e;if(this.url&&typeof this.url=="string"){const n=(e=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:e[1];if(!n)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceName(){if(this.url&&typeof this.url=="string"){const e=NE(this.url);if(!e)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01 或 http://localhost:9109/osgb/ts/info/ms01");return e}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01 或 http://localhost:9109/osgb/ts/info/ms01")}};f(hh,"createDefaultProps",()=>({...Jn.createDefaultProps(),isSameIP:!1,useEarthDSToken:!1,earthdstoken:""})),f(hh,"type",hh.register("ESMsTileset",hh,{chsName:"Modelser实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let Tv=hh;const OE={defaultValue:[{type:"2",widget:"WidgetBlueprint'/ESFoliage/PoiSheng.PoiSheng'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"3",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"4",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"5",widget:"WidgetBlueprint'/ESFoliage/PoiXiang.PoiXiang'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"6",widget:"WidgetBlueprint'/ESFoliage/PoiCun.PoiCun'",povit:[.5,1],worldScale:.1,hiddenDistance:40}],sampleValue:`
391
391
  ## 参数类型为 ESPoiType[]
392
392
  \`\`\`js
393
393
  type Vector2D = [number, number]
@@ -400,7 +400,7 @@ ${lv}
400
400
  hiddenDistance: number
401
401
  }
402
402
  \`\`\`
403
- `},bl=class bl extends Xt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new wt("通用"),new Et([this,"url"],"路径"),new Ne([this,"poiTypes"],bl.defaults.poiTypes,OE.sampleValue),new D([this,"heightOffset"])]}}};f(bl,"createDefaultProps",()=>({...Xt.createDefaultProps(),url:"",poiTypes:fe(OE.defaultValue),heightOffset:40})),f(bl,"type",bl.register("ESPoiTileset",bl,{chsName:"ESPoiTileset",tags:["ESObjects","_ES_Impl_UE"],description:"ESPoiTileset"}));let Nv=bl;const ch=class ch extends pt{getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new wt("通用"),new X([this,"show"],"是否显示"),new ft([this,"screenPosition"],[["left","left"],["right","right"]],"定位","right"),new Ke([this,"cssPosition"],"位置")]}}};f(ch,"createDefaultProps",()=>({...pt.createDefaultProps(),show:!0,screenPosition:"right",cssPosition:[40,30]})),f(ch,"type",ch.register("ESScale",ch,{chsName:"比例尺",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"比例尺"}));let Ov=ch;const Xs=class Xs extends Jt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new D([this,"height"],"高度",Xs.defaults.height,!0),new D([this,"extrudedHeight"],"拉伸高度",Xs.defaults.extrudedHeight,!0),new X([this,"perPositionHeight"],"应用每个位置高度",Xs.defaults.perPositionHeight,!0)]}}};f(Xs,"createDefaultProps",()=>({...Jt.createDefaultProps(),height:0,extrudedHeight:10,perPositionHeight:!1,collision:!1})),f(Xs,"type",Xs.register("ESGeoExtrudedPolygon",Xs,{chsName:"拉升多边形体",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"拉升多边形体"})),f(Xs,"supportEditingModes",[...Jt.supportEditingModes,nt.HeightModify]);let nl=Xs;const Cl=class Cl extends Jt{constructor(e){super(e);f(this,"_classification",this.dv(new kf));f(this,"_geoExtrudedPolygon",this.dv(new nl));this.d(this.components.disposableAdd(this._classification)),this.d(this.components.disposableAdd(this._geoExtrudedPolygon,!0));{const{_classification:n,_geoExtrudedPolygon:r}=this;r.perPositionHeight=!0,this.d(F([n,"collision"],[this,"collision"])),this.d(F([r,"collision"],[this,"collision"])),this.d(lt([r,"flyInParam"],[this,"flyInParam"])),this.d(lt([r,"flyToParam"],[this,"flyToParam"])),this.d(lt([r,"points"],[this,"points"])),this.d(lt([r,"extrudedHeight"],[this,"height"])),this.d(lt([n,"fillColor"],[this,"overheightColor"])),this.d(lt([r,"fillColor"],[this,"standardColor"]));{const s=()=>{const{height:o,points:a,maxHeight:l}=this;if(!a)return;const u=a.map(h=>[h[0],h[1],o]);n.points=u,n.height=l-o,l-o<=0?n.show=!1:n.show=this.show&&this.filled};s(),this.d(Ze([this.heightChanged,this.pointsChanged,this.maxHeightChanged],s))}{const s=()=>{const{show:o,filled:a}=this;n.show=o&&a,r.show=o&&a};s(),this.d(Ze([this.showChanged,this.filledChanged],s))}this.d(this.flyInEvent.don(s=>{r.flyIn(s)})),this.d(this.flyToEvent.don(s=>{r.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{r.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{r.calcFlyInParam()}))}}get classification(){return this._classification}get geoExtrudedPolygon(){return this._geoExtrudedPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new D([this,"height"],"高度",10),new D([this,"maxHeight"],"最高高度",200),new Dt([this,"overheightColor"],"超高颜色",[1,0,0,.5]),new Dt([this,"standardColor"],"标准颜色",[0,1,0,.5])]}}};f(Cl,"createDefaultProps",()=>({...Jt.createDefaultProps(),height:10,maxHeight:200,overheightColor:[1,0,0,.5],standardColor:[0,1,0,.5]})),f(Cl,"type",Cl.register("ESHeightLimitAnalysis",Cl,{chsName:"控高分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"控高分析对象"})),f(Cl,"supportEditingModes",[...Jt.supportEditingModes,nt.HeightModify]);let Dv=Cl;const fs=class fs extends Xt{constructor(e){super(e);f(this,"_widgetEvent",this.dv(new O));f(this,"_data",this.dv(z(void 0)));{const n=()=>{this.url&&(typeof this.url=="object"?this.data=this.url:ip(this.url)?this.data=JSON.parse(this.url):fetch(pt.context.getStrFromEnv(this.url)).then(r=>r.json()).then(r=>{this.data=r}).catch(r=>{console.warn("ESEntityCluster数据加载失败",r)}))};n(),this.d(this.urlChanged.don(n))}}get widgetEvent(){return this._widgetEvent}get data(){return this._data.value}set data(e){this._data.value=e}get dataChanged(){return this._data.changed}getFeatures(){if(this._data)return this._data;console.log("数据未加载完成,请稍后重试")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Et([this,"url"],"地址",fs.defaults.url),new D([this,"pixelRange"],"集合范围",fs.defaults.pixelRange),new D([this,"minimumClusterSize"],"最小数量",fs.defaults.minimumClusterSize),new ft([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["CLAMP_TO_TERRAIN","CLAMP_TO_TERRAIN"]],"高度模式","NONE")],more:[...e.more,new Et([this,"style"],"style",fs.defaults.style),new X([this,"perspective"],"透视效果",fs.defaults.perspective)]}}};f(fs,"createDefaultProps",()=>({...Xt.createDefaultProps(),url:"",pixelRange:200,minimumClusterSize:2,style:fe({cluster:[{minValue:2,mode:"SquareV02",style:{}}],nonCluster:{mode:"SquareV03",style:{}}}),heightReference:"NONE",perspective:!1})),f(fs,"type",fs.register("ESEntityCluster",fs,{chsName:"Poi聚合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于聚合POI标注,提高性能。"}));let Rv=fs;class jc extends B{constructor(){super();f(this,"_player",this.disposeVar(new kr));const e=this._player;{const n=()=>{const r=(this.stopTime??0)-(this.startTime??0);e.duration=r>0?r:0};n(),this.d(this.startTimeChanged.don(n)),this.d(this.stopTimeChanged.don(n))}this.d(lt([e,"playing"],[this,"playing"])),this.d(lt([e,"loop"],[this,"loop"])),this.d(lt([e,"speed"],[this,"speed"])),this.d(e.currentTimeChanged.don(()=>{this.startTime!==void 0&&e.currentTime!==void 0&&(this.currentTime=e.currentTime+this.startTime)})),this.d(this.currentTimeChanged.don(()=>{if(this.currentTime===void 0||this.startTime===void 0)return;const n=this.currentTime-this.startTime;e.currentTime=vd(n,0,e.duration)}))}get player(){return this._player}get ratio(){return this._player.ratio}get ratioChanged(){return this._player.ratioChanged}set ratio(e){this._player.ratio=e}}(i=>{i.createDefaultProps=()=>({...pt.createDefaultProps(),currentTime:void 0,startTime:void 0,stopTime:void 0,playing:void 0,loop:void 0,speed:void 0})})(jc||(jc={})),Ro(jc.prototype,jc.createDefaultProps);const dh=class dh extends pt{constructor(e){super(e);f(this,"_absolutePlayer",this.dv(new jc));const n=this.absolutePlayer;this.d(lt([n,"currentTime"],[this,"currentTime"])),this.d(lt([n,"startTime"],[this,"startTime"])),this.d(lt([n,"stopTime"],[this,"stopTime"])),this.d(lt([n,"playing"],[this,"playing"])),this.d(lt([n,"loop"],[this,"loop"])),this.d(lt([n,"speed"],[this,"speed"]))}get absolutePlayer(){return this._absolutePlayer}get ratio(){return this._absolutePlayer.ratio}get ratioChanged(){return this._absolutePlayer.ratioChanged}set ratio(e){this._absolutePlayer.ratio=e}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Cd([this,"playing"],[this,"ratio"],[this,"loop"],"播放器"),new ys([this,"currentTime"],"currentTime"),new ys([this,"startTime"]),new ys([this,"stopTime"]),new X([this,"playing"]),new X([this,"loop"]),new D([this,"speed"])]}}};f(dh,"createDefaultProps",()=>({...pt.createDefaultProps(),currentTime:0,startTime:0,stopTime:0,playing:!1,loop:!1,speed:1})),f(dh,"type",dh.register("ESPlayer",dh,{chsName:"ESPlayer",tags:["ESObjects","_ES_Impl_UE"],description:"ESPlayer"}));let Ru=dh;function DE(i,t=!1){const e=i.map(r=>[r[0],[...r[1]],r[2]?[...r[2]]:void 0]),n=e.length;if(n===0)return e;if(n===1)return(!e[0][2]===void 0||t)&&(e[0][2]=void 0),e;for(let r=1;r<n;++r){if(e[r][2]!==void 0&&!t)continue;const s=e[r-1][1],o=e[r][1],a=jr(s),l=jr(o),u=w.Vector.distance(a,l);if(u===0){e[r][2]=e[r-1][2];continue}const h=Dc(s,o),c=o[2]-s[2],d=Math.asin(c/u)*180/Math.PI,g=Number.isFinite(h)?h:0,p=Number.isFinite(d)?d:0;e[r][2]=[g,p,0]}return(e[0][2]===void 0||t)&&(e[0][2]=n>1?e[1][2]:void 0),e}function RE(i,t=!1){const e=i.map(r=>[r[0],[...r[1]],r[2]?[...r[2]]:void 0]),n=e.length;if(n===0)return e;if(n===1)return(!e[0][2]===void 0||t)&&(e[0][2]=void 0),e;for(let r=n-2;r>=0;--r){if(e[r][2]!==void 0&&!t)continue;const s=e[r][1],o=e[r+1][1],a=jr(s),l=jr(o),u=w.Vector.distance(a,l);if(u===0){e[r][2]=e[r+1][2];continue}const h=Dc(s,o),c=o[2]-s[2],d=Math.asin(c/u)*180/Math.PI,g=Number.isFinite(h)?h:0,p=Number.isFinite(d)?d:0;e[r][2]=[g,p,0]}return(e[n-1][2]===void 0||t)&&(e[n-1][2]=n>1?e[n-2][2]:[0,0,0]),e}function RD(i,t=!1){const e=DE(i,t),n=RE(i,t);if(e.length!==n.length)throw new Error("p.length !== n.length");const r=e.length;for(let s=0;s<r;s++){const o=e[s][2],a=n[s][2];o===void 0&&a===void 0?e[s][2]=void 0:o===void 0?e[s][2]=a:a===void 0?e[s][2]=o:e[s][2]=np(o,a,.5)}return e}function AD(i,t,e){let r;if(!i.timePosRots)return;const s=[],o=i.timePosRots.length;if(!(o<=2)){s.push(i.timePosRots[0]);for(let a=1;a<o-1;++a){const l=i.timePosRots[a-1][0],u=i.timePosRots[a][0],h=i.timePosRots[a+1][0],c=i.accumDistances[a-1],d=i.accumDistances[a],g=i.accumDistances[a+1],p=d-c;if(p!==0){const b=p-(r??(t.length==1?t[0]:t[a-1]||t[t.length-1])*.5);let P=(b<0?0:b)/p;Number.isNaN(P)&&(P=0);const v=(1-P)*l+P*u,_=i.getCurrent(v);_&&s.push([v,_.position,_.rotation])}e&&s.push(i.timePosRots[a]);const E=g-d;if(E!==0){let b=(t.length==1?t[0]:t[a-1]||t[t.length-1])*.5;const P=(t.length==1?t[0]:t[a]||t[t.length-1])*.5||0;b+P>E?(b=E*(b/(b+P)),r=E-b):r=void 0;let v=(b<0?0:b)/E;Number.isNaN(v)&&(v=0);const _=(1-v)*u+v*h,m=i.getCurrent(_);m&&s.push([_,m.position,m.rotation])}}s.push(i.timePosRots[o-1]),i.timePosRots=s}}function AE(i,t){if(t<0)return[void 0,0];if(t>i.length-1)return[void 0,i.length-1];const e=[...i].slice(0,t+1).reverse().findIndex(r=>!!(r!=null&&r[2]));if(e===-1)return[void 0,0];const n=t-e;return[i[n][2],n]}function LE(i,t){if(t<0)return[void 0,0];if(t>=i.length)return[void 0,i.length-1];const e=i.slice(t).findIndex(([,,r])=>r!==void 0),n=e===-1?i.length-1:t+e;return[i[n][2],n]}function LD(i,t,e="Lerp"){let n,r,s,o;if(i.length!==0){if(t<=i[0][0])n=i[0][1],r=i[0][2],s=0,o=0;else if(t>=i[i.length-1][0]){const[l,u,h]=i[i.length-1];n=u,r=h,s=i.length-2,o=1}else{const l=i.findIndex(([u])=>t<=u);if(l===-1)throw new Error("nextIndex === -1");s=l-1;{const[u,h]=i[s],[c,d]=i[l],g=(t-u)/(c-u),p=Pm(h),E=Pm(d),b=w.Vector.lerp(p,E,g);n=Ip(b),o=g}{let[u,h]=AE(i,s),[c,d]=LE(i,l);if(e==="Lerp")if(u&&c){if(h<0||d>=i.length)throw new Error("Invalid rotation index");const g=(t-i[h][0])/(i[d][0]-i[h][0]);r=np(u,c,g)}else u?r=u:c?r=c:r=void 0;else e==="Prev"?u&&(r=u):e==="Next"&&c&&(r=c)}}return{position:n,rotation:r,index:s,ratio:o}}}function FD(i){try{const t=JSON.parse(i);if(Array.isArray(t)&&t.length>0){const e=typeof t[0][0]=="number",n=Array.isArray(t[0][1])&&t[0][1].length===3;return e&&n?t:void 0}throw new Error("解析有问题")}catch{const e=i.split(/\n|\r\n/),n=[],r=e.length;for(let s=0;s<r;++s){const o=e[s],a=o.split(/[^0-9e\.\+\-]+/).filter(l=>l!=="").map(l=>+l);a.length<4?console.warn(`第${s+1}行数据无法解析成路径的数据, 原内容为: ${o}`):a.length<7?n.push([a[0],[a[1],a[2],a[3]],void 0]):n.push([a[0],[a[1],a[2],a[3]],[a[4],a[5],a[6]]])}return n}}function kD(i,t,e){const{timePosRots:n}=i;if(!n)throw new Error("!timePosRots");if(n.length===0)throw new Error("timePosRots.length === 0");t=Math.max(t,n[0][0]),e=Math.min(e,n[n.length-1][0]);const r=i.getCurrent(t),s=i.getCurrent(e);if(!r||!s)return;const o=[];r.ratio<1&&o.push([t,r.position,r.rotation]);for(let a=r.index+1;a<=s.index;++a)o.push(n[a]);return s.ratio>0&&o.push([e,s.position,s.rotation]),o}const GD=`
403
+ `},bl=class bl extends Xt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new wt("通用"),new Et([this,"url"],"路径"),new Ne([this,"poiTypes"],bl.defaults.poiTypes,OE.sampleValue),new D([this,"heightOffset"])]}}};f(bl,"createDefaultProps",()=>({...Xt.createDefaultProps(),url:"",poiTypes:fe(OE.defaultValue),heightOffset:40})),f(bl,"type",bl.register("ESPoiTileset",bl,{chsName:"ESPoiTileset",tags:["ESObjects","_ES_Impl_UE"],description:"ESPoiTileset"}));let Nv=bl;const ch=class ch extends pt{getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new wt("通用"),new H([this,"show"],"是否显示"),new ft([this,"screenPosition"],[["left","left"],["right","right"]],"定位","right"),new Ke([this,"cssPosition"],"位置")]}}};f(ch,"createDefaultProps",()=>({...pt.createDefaultProps(),show:!0,screenPosition:"right",cssPosition:[40,30]})),f(ch,"type",ch.register("ESScale",ch,{chsName:"比例尺",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"比例尺"}));let Ov=ch;const Xs=class Xs extends Jt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new D([this,"height"],"高度",Xs.defaults.height,!0),new D([this,"extrudedHeight"],"拉伸高度",Xs.defaults.extrudedHeight,!0),new H([this,"perPositionHeight"],"应用每个位置高度",Xs.defaults.perPositionHeight,!0)]}}};f(Xs,"createDefaultProps",()=>({...Jt.createDefaultProps(),height:0,extrudedHeight:10,perPositionHeight:!1,collision:!1})),f(Xs,"type",Xs.register("ESGeoExtrudedPolygon",Xs,{chsName:"拉升多边形体",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"拉升多边形体"})),f(Xs,"supportEditingModes",[...Jt.supportEditingModes,nt.HeightModify]);let nl=Xs;const Cl=class Cl extends Jt{constructor(e){super(e);f(this,"_classification",this.dv(new kf));f(this,"_geoExtrudedPolygon",this.dv(new nl));this.d(this.components.disposableAdd(this._classification)),this.d(this.components.disposableAdd(this._geoExtrudedPolygon,!0));{const{_classification:n,_geoExtrudedPolygon:r}=this;r.perPositionHeight=!0,this.d(F([n,"collision"],[this,"collision"])),this.d(F([r,"collision"],[this,"collision"])),this.d(lt([r,"flyInParam"],[this,"flyInParam"])),this.d(lt([r,"flyToParam"],[this,"flyToParam"])),this.d(lt([r,"points"],[this,"points"])),this.d(lt([r,"extrudedHeight"],[this,"height"])),this.d(lt([n,"fillColor"],[this,"overheightColor"])),this.d(lt([r,"fillColor"],[this,"standardColor"]));{const s=()=>{const{height:o,points:a,maxHeight:l}=this;if(!a)return;const u=a.map(h=>[h[0],h[1],o]);n.points=u,n.height=l-o,l-o<=0?n.show=!1:n.show=this.show&&this.filled};s(),this.d(Ze([this.heightChanged,this.pointsChanged,this.maxHeightChanged],s))}{const s=()=>{const{show:o,filled:a}=this;n.show=o&&a,r.show=o&&a};s(),this.d(Ze([this.showChanged,this.filledChanged],s))}this.d(this.flyInEvent.don(s=>{r.flyIn(s)})),this.d(this.flyToEvent.don(s=>{r.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{r.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{r.calcFlyInParam()}))}}get classification(){return this._classification}get geoExtrudedPolygon(){return this._geoExtrudedPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new D([this,"height"],"高度",10),new D([this,"maxHeight"],"最高高度",200),new Dt([this,"overheightColor"],"超高颜色",[1,0,0,.5]),new Dt([this,"standardColor"],"标准颜色",[0,1,0,.5])]}}};f(Cl,"createDefaultProps",()=>({...Jt.createDefaultProps(),height:10,maxHeight:200,overheightColor:[1,0,0,.5],standardColor:[0,1,0,.5]})),f(Cl,"type",Cl.register("ESHeightLimitAnalysis",Cl,{chsName:"控高分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"控高分析对象"})),f(Cl,"supportEditingModes",[...Jt.supportEditingModes,nt.HeightModify]);let Dv=Cl;const fs=class fs extends Xt{constructor(e){super(e);f(this,"_widgetEvent",this.dv(new O));f(this,"_data",this.dv(z(void 0)));{const n=()=>{this.url&&(typeof this.url=="object"?this.data=this.url:ip(this.url)?this.data=JSON.parse(this.url):fetch(pt.context.getStrFromEnv(this.url)).then(r=>r.json()).then(r=>{this.data=r}).catch(r=>{console.warn("ESEntityCluster数据加载失败",r)}))};n(),this.d(this.urlChanged.don(n))}}get widgetEvent(){return this._widgetEvent}get data(){return this._data.value}set data(e){this._data.value=e}get dataChanged(){return this._data.changed}getFeatures(){if(this._data)return this._data;console.log("数据未加载完成,请稍后重试")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Et([this,"url"],"地址",fs.defaults.url),new D([this,"pixelRange"],"集合范围",fs.defaults.pixelRange),new D([this,"minimumClusterSize"],"最小数量",fs.defaults.minimumClusterSize),new ft([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["CLAMP_TO_TERRAIN","CLAMP_TO_TERRAIN"]],"高度模式","NONE")],more:[...e.more,new Et([this,"style"],"style",fs.defaults.style),new H([this,"perspective"],"透视效果",fs.defaults.perspective)]}}};f(fs,"createDefaultProps",()=>({...Xt.createDefaultProps(),url:"",pixelRange:200,minimumClusterSize:2,style:fe({cluster:[{minValue:2,mode:"SquareV02",style:{}}],nonCluster:{mode:"SquareV03",style:{}}}),heightReference:"NONE",perspective:!1})),f(fs,"type",fs.register("ESEntityCluster",fs,{chsName:"Poi聚合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于聚合POI标注,提高性能。"}));let Rv=fs;class jc extends B{constructor(){super();f(this,"_player",this.disposeVar(new kr));const e=this._player;{const n=()=>{const r=(this.stopTime??0)-(this.startTime??0);e.duration=r>0?r:0};n(),this.d(this.startTimeChanged.don(n)),this.d(this.stopTimeChanged.don(n))}this.d(lt([e,"playing"],[this,"playing"])),this.d(lt([e,"loop"],[this,"loop"])),this.d(lt([e,"speed"],[this,"speed"])),this.d(e.currentTimeChanged.don(()=>{this.startTime!==void 0&&e.currentTime!==void 0&&(this.currentTime=e.currentTime+this.startTime)})),this.d(this.currentTimeChanged.don(()=>{if(this.currentTime===void 0||this.startTime===void 0)return;const n=this.currentTime-this.startTime;e.currentTime=vd(n,0,e.duration)}))}get player(){return this._player}get ratio(){return this._player.ratio}get ratioChanged(){return this._player.ratioChanged}set ratio(e){this._player.ratio=e}}(i=>{i.createDefaultProps=()=>({...pt.createDefaultProps(),currentTime:void 0,startTime:void 0,stopTime:void 0,playing:void 0,loop:void 0,speed:void 0})})(jc||(jc={})),Ro(jc.prototype,jc.createDefaultProps);const dh=class dh extends pt{constructor(e){super(e);f(this,"_absolutePlayer",this.dv(new jc));const n=this.absolutePlayer;this.d(lt([n,"currentTime"],[this,"currentTime"])),this.d(lt([n,"startTime"],[this,"startTime"])),this.d(lt([n,"stopTime"],[this,"stopTime"])),this.d(lt([n,"playing"],[this,"playing"])),this.d(lt([n,"loop"],[this,"loop"])),this.d(lt([n,"speed"],[this,"speed"]))}get absolutePlayer(){return this._absolutePlayer}get ratio(){return this._absolutePlayer.ratio}get ratioChanged(){return this._absolutePlayer.ratioChanged}set ratio(e){this._absolutePlayer.ratio=e}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Cd([this,"playing"],[this,"ratio"],[this,"loop"],"播放器"),new ys([this,"currentTime"],"currentTime"),new ys([this,"startTime"]),new ys([this,"stopTime"]),new H([this,"playing"]),new H([this,"loop"]),new D([this,"speed"])]}}};f(dh,"createDefaultProps",()=>({...pt.createDefaultProps(),currentTime:0,startTime:0,stopTime:0,playing:!1,loop:!1,speed:1})),f(dh,"type",dh.register("ESPlayer",dh,{chsName:"ESPlayer",tags:["ESObjects","_ES_Impl_UE"],description:"ESPlayer"}));let Ru=dh;function DE(i,t=!1){const e=i.map(r=>[r[0],[...r[1]],r[2]?[...r[2]]:void 0]),n=e.length;if(n===0)return e;if(n===1)return(!e[0][2]===void 0||t)&&(e[0][2]=void 0),e;for(let r=1;r<n;++r){if(e[r][2]!==void 0&&!t)continue;const s=e[r-1][1],o=e[r][1],a=jr(s),l=jr(o),u=w.Vector.distance(a,l);if(u===0){e[r][2]=e[r-1][2];continue}const h=Dc(s,o),c=o[2]-s[2],d=Math.asin(c/u)*180/Math.PI,g=Number.isFinite(h)?h:0,p=Number.isFinite(d)?d:0;e[r][2]=[g,p,0]}return(e[0][2]===void 0||t)&&(e[0][2]=n>1?e[1][2]:void 0),e}function RE(i,t=!1){const e=i.map(r=>[r[0],[...r[1]],r[2]?[...r[2]]:void 0]),n=e.length;if(n===0)return e;if(n===1)return(!e[0][2]===void 0||t)&&(e[0][2]=void 0),e;for(let r=n-2;r>=0;--r){if(e[r][2]!==void 0&&!t)continue;const s=e[r][1],o=e[r+1][1],a=jr(s),l=jr(o),u=w.Vector.distance(a,l);if(u===0){e[r][2]=e[r+1][2];continue}const h=Dc(s,o),c=o[2]-s[2],d=Math.asin(c/u)*180/Math.PI,g=Number.isFinite(h)?h:0,p=Number.isFinite(d)?d:0;e[r][2]=[g,p,0]}return(e[n-1][2]===void 0||t)&&(e[n-1][2]=n>1?e[n-2][2]:[0,0,0]),e}function RD(i,t=!1){const e=DE(i,t),n=RE(i,t);if(e.length!==n.length)throw new Error("p.length !== n.length");const r=e.length;for(let s=0;s<r;s++){const o=e[s][2],a=n[s][2];o===void 0&&a===void 0?e[s][2]=void 0:o===void 0?e[s][2]=a:a===void 0?e[s][2]=o:e[s][2]=np(o,a,.5)}return e}function AD(i,t,e){let r;if(!i.timePosRots)return;const s=[],o=i.timePosRots.length;if(!(o<=2)){s.push(i.timePosRots[0]);for(let a=1;a<o-1;++a){const l=i.timePosRots[a-1][0],u=i.timePosRots[a][0],h=i.timePosRots[a+1][0],c=i.accumDistances[a-1],d=i.accumDistances[a],g=i.accumDistances[a+1],p=d-c;if(p!==0){const b=p-(r??(t.length==1?t[0]:t[a-1]||t[t.length-1])*.5);let P=(b<0?0:b)/p;Number.isNaN(P)&&(P=0);const v=(1-P)*l+P*u,_=i.getCurrent(v);_&&s.push([v,_.position,_.rotation])}e&&s.push(i.timePosRots[a]);const E=g-d;if(E!==0){let b=(t.length==1?t[0]:t[a-1]||t[t.length-1])*.5;const P=(t.length==1?t[0]:t[a]||t[t.length-1])*.5||0;b+P>E?(b=E*(b/(b+P)),r=E-b):r=void 0;let v=(b<0?0:b)/E;Number.isNaN(v)&&(v=0);const _=(1-v)*u+v*h,m=i.getCurrent(_);m&&s.push([_,m.position,m.rotation])}}s.push(i.timePosRots[o-1]),i.timePosRots=s}}function AE(i,t){if(t<0)return[void 0,0];if(t>i.length-1)return[void 0,i.length-1];const e=[...i].slice(0,t+1).reverse().findIndex(r=>!!(r!=null&&r[2]));if(e===-1)return[void 0,0];const n=t-e;return[i[n][2],n]}function LE(i,t){if(t<0)return[void 0,0];if(t>=i.length)return[void 0,i.length-1];const e=i.slice(t).findIndex(([,,r])=>r!==void 0),n=e===-1?i.length-1:t+e;return[i[n][2],n]}function LD(i,t,e="Lerp"){let n,r,s,o;if(i.length!==0){if(t<=i[0][0])n=i[0][1],r=i[0][2],s=0,o=0;else if(t>=i[i.length-1][0]){const[l,u,h]=i[i.length-1];n=u,r=h,s=i.length-2,o=1}else{const l=i.findIndex(([u])=>t<=u);if(l===-1)throw new Error("nextIndex === -1");s=l-1;{const[u,h]=i[s],[c,d]=i[l],g=(t-u)/(c-u),p=Pm(h),E=Pm(d),b=w.Vector.lerp(p,E,g);n=Ip(b),o=g}{let[u,h]=AE(i,s),[c,d]=LE(i,l);if(e==="Lerp")if(u&&c){if(h<0||d>=i.length)throw new Error("Invalid rotation index");const g=(t-i[h][0])/(i[d][0]-i[h][0]);r=np(u,c,g)}else u?r=u:c?r=c:r=void 0;else e==="Prev"?u&&(r=u):e==="Next"&&c&&(r=c)}}return{position:n,rotation:r,index:s,ratio:o}}}function FD(i){try{const t=JSON.parse(i);if(Array.isArray(t)&&t.length>0){const e=typeof t[0][0]=="number",n=Array.isArray(t[0][1])&&t[0][1].length===3;return e&&n?t:void 0}throw new Error("解析有问题")}catch{const e=i.split(/\n|\r\n/),n=[],r=e.length;for(let s=0;s<r;++s){const o=e[s],a=o.split(/[^0-9e\.\+\-]+/).filter(l=>l!=="").map(l=>+l);a.length<4?console.warn(`第${s+1}行数据无法解析成路径的数据, 原内容为: ${o}`):a.length<7?n.push([a[0],[a[1],a[2],a[3]],void 0]):n.push([a[0],[a[1],a[2],a[3]],[a[4],a[5],a[6]]])}return n}}function kD(i,t,e){const{timePosRots:n}=i;if(!n)throw new Error("!timePosRots");if(n.length===0)throw new Error("timePosRots.length === 0");t=Math.max(t,n[0][0]),e=Math.min(e,n[n.length-1][0]);const r=i.getCurrent(t),s=i.getCurrent(e);if(!r||!s)return;const o=[];r.ratio<1&&o.push([t,r.position,r.rotation]);for(let a=r.index+1;a<=s.index;++a)o.push(n[a]);return s.ratio>0&&o.push([e,s.position,s.rotation]),o}const GD=`
404
404
  timePosRots是一个内部包含三个元素的数组,第一个表示时间戳,单位毫秒,第二个表示经纬度,第三个表示姿态(偏航、俯仰、翻转)。示例代码如下:
405
405
  \`\`\`
406
406
  [
@@ -445,7 +445,7 @@ timePosRots是一个内部包含三个元素的数组,第一个表示时间戳
445
445
  ]
446
446
  ]
447
447
  \`\`\`
448
- `,yn=class yn extends B{constructor(e,n){super();f(this,"_scratchCurrentInfo",{position:[0,0,0],rotation:[0,0,0],index:0});f(this,"_currentInfo",this.disposeVar(z(void 0,(e,n)=>!1)));f(this,"_player");f(this,"_flyToEvent",this.disposeVar(new O));f(this,"_accumDistancesChanged",this.disposeVar(new O));f(this,"_accumDistancesChangedInit",this.dispose(this.timePosRotsChanged.disposableOn(()=>(this._accumDistancesDirty=!0,this._accumDistancesChanged.emit()))));f(this,"_accumDistancesDirty",!1);f(this,"_accumDistances",[]);f(this,"_getCurrentFunc",this.disposeVar(z(void 0)));this._player=this.disposeVar(new kr);const r=()=>{const s=this.getCurrent(this.currentTime??0);if(s===void 0)this._currentInfo.value=void 0;else{const{index:o,position:a,rotation:l,ratio:u}=s;this._scratchCurrentInfo.index=o,this._scratchCurrentInfo.position=a,this._scratchCurrentInfo.rotation=l,this._scratchCurrentInfo.ratio=u,this._currentInfo.value=this._scratchCurrentInfo}};r(),this.currentTimeChanged.disposableOn(r),this.timePosRotsChanged.disposableOn(r),this.rotLerpModeChanged.disposableOn(r),this.dispose(lt([this._player,"loop"],[this,"loop"]));{const s=()=>{if(this.startTime===void 0||this.currentTime===void 0)return;const o=this.currentTime-this.startTime;(this._player.currentTime===void 0||Math.abs(o-this._player.currentTime)>.01)&&(this._player.currentTime=o)};s(),this.dispose(this.currentTimeChanged.disposableOn(s))}{const s=()=>{if(this.startTime===void 0||this._player.currentTime===void 0)return;const o=this._player.currentTime+this.startTime;(this.currentTime===void 0||Math.abs(o-this.currentTime)>.01)&&(this.currentTime=o)};s(),this.dispose(this._player.currentTimeChanged.disposableOn(s))}this.dispose(lt([this._player,"duration"],[this,"duration"])),this.dispose(lt([this._player,"playing"],[this,"playing"])),this.dispose(lt([this._player,"speed"],[this,"speed"]));{const s=()=>{(this.autoComputeTimeFromTimePosRots??!0)&&this.computeTimeFromTimePosRots()};s();const o=this.disposeVar(Ve(this.autoComputeTimeFromTimePosRotsChanged,this.timePosRotsChanged));this.dispose(o.disposableOn(s))}{const s=()=>{const o=this.timePosRots;if(!o)return;let a=0;const l=o.length;for(let u=0;u<l;++u){const h=o[u][0];if(h<0)console.warn("地理路径的时间戳不能小于0!");else if(h<a){console.warn(`地理路径的时间戳需要满足从小到大的数据,元素越靠后,时间越靠后!当前不满足条件的元素是index: ${u} time: ${h}`);break}}};s(),this.dispose(this.timePosRotsChanged.disposableOn(s))}{const s=this.disposeVar(Ln(async o=>{if(!this.dataUri)return;await o.promise(Mh(1e3));const a=await o.promise(fetch(this.dataUri)),l=await o.promise(a.text());this.timePosRots=yn.parseData(l)}));this.dispose(this.dataUriChanged.disposableOn(()=>{s.restart()})),this.dispose(this.dataTextChanged.disposableOn(()=>{this.dataText&&(this.timePosRots=yn.parseData(this.dataText))}))}}get currentInfo(){return this._currentInfo.value}get currentInfoChanged(){return this._currentInfo.changed}get currentIndex(){return this._currentInfo.value&&this._currentInfo.value.index}get currentIndexChanged(){return this._currentInfo.changed}get currentPosition(){return this._currentInfo.value&&this._currentInfo.value.position}get currentPositionChanged(){return this._currentInfo.changed}get currentRotation(){return this._currentInfo.value&&this._currentInfo.value.rotation}get currentRotationChanged(){return this._currentInfo.changed}get player(){return this._player}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get accumDistancesChanged(){return this._accumDistancesChanged}get accumDistances(){if(!this._accumDistancesDirty)return this._accumDistances;if(!this.timePosRots||this.timePosRots.length<2)this._accumDistances=[];else{const e=this.timePosRots.length;let n=0;const r=[];let s=jr(this.timePosRots[0][1]);r.push(n);for(let o=1;o<e;++o){const a=jr(this.timePosRots[o][1]),l=w.Vector.distance(a,s);s=a,n+=l,r.push(n)}this._accumDistances=r}return this._accumDistances}get totalDistanceChanged(){return this._accumDistancesChanged}get totalDistance(){return this.accumDistances.length>0?this.accumDistances[this.accumDistances.length-1]:0}getCurrent(e){return this.getCurrentFunc?this.getCurrentFunc(e,this):this.timePosRots&&LD(this.timePosRots,e,this.rotLerpMode)}subPath(e,n){return this.timePosRots&&kD(this,e,n)}computeRotIfUndefinedUsingPrevLine(e=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=yn.computeRotIfUndefinedUsingPrevLine(this.timePosRots,e)}computeRotIfUndefinedUsingNextLine(e=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=yn.computeRotIfUndefinedUsingNextLine(this.timePosRots,e)}computeRotIfUndefinedUsingLerp(e=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=yn.computeRotIfUndefinedUsingLerp(this.timePosRots,e)}computeRotIfUndefined(e=!1){this.computeRotIfUndefinedUsingPrevLine(e)}addAroundPoints(e,n){AD(this,e,n)}get getCurrentFunc(){return this._getCurrentFunc.value}set getCurrentFunc(e){this._getCurrentFunc.value=e}get getCurrentFuncChanged(){return this._getCurrentFunc.changed}computeTimeFromTimePosRots(){const e=this.timePosRots;if(!e||e.length<=1){this.startTime=void 0,this.stopTime=void 0,this.duration=void 0;return}this.startTime=e[0][0],this.stopTime=e[e.length-1][0],this.duration=this.stopTime-this.startTime}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}};f(yn,"computeRotIfUndefinedUsingPrevLine",DE),f(yn,"computeRotIfUndefinedUsingNextLine",RE),f(yn,"computeRotIfUndefinedUsingLerp",RD),f(yn,"getLeftRotation",AE),f(yn,"getRightRotation",LE),f(yn,"parseData",FD),f(yn,"defaults",{timePosRots:[],startTime:0,stopTime:3e3,loop:!1,duration:3e3,playing:!1,dataText:""}),f(yn,"timePosRotsMd",GD);let aa=yn;(i=>{i.createDefaultProps=()=>({show:!1,currentPoiShow:!0,timePosRots:Do(void 0,(t,e)=>t[0]===e[0]&&t[1].every((n,r)=>n===e[1][r])&&t[2]===e[2]===void 0||t[2]!==void 0&&e[2]!==void 0&&t[2].every((n,r)=>e[2][r]),t=>[t[0],[...t[1]],t[2]&&[...t[2]]||void 0]),autoComputeTimeFromTimePosRots:!0,leadTime:0,trailTime:0,startTime:void 0,stopTime:void 0,loop:!1,currentTime:0,duration:void 0,speed:1,playing:!1,polylineShow:!0,width:1,ground:!1,color:ot([1,1,1,1]),hasDash:!1,gapColor:ot([0,0,0,0]),dashLength:16,dashPattern:255,depthTest:!1,arcType:"GEODESIC",allowPicking:!1,dataUri:"",dataText:void 0,rotLerpMode:"Lerp",debug:!1})})(aa||(aa={})),Ro(aa.prototype,aa.createDefaultProps);const Pl=class Pl extends Fi{constructor(e){super(e);f(this,"_path");f(this,"_currentPositionChanged",this.dv(new O));f(this,"_currentRotationChanged",this.dv(new O));f(this,"_currentChanged",this.dv(new O));f(this,"_deprecated",[]);f(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());this._path=this.dv(new aa),this.d(this._path.currentInfoChanged.don(()=>this._currentPositionChanged.emit(this._path.currentPosition))),this.d(this._path.currentInfoChanged.don(()=>this._currentRotationChanged.emit(this.currentRotation))),this.d(this._path.currentInfoChanged.don(()=>this._currentChanged.emit(this.current))),this._path.show=!0,this._path.polylineShow=!1,this._path.currentPoiShow=!1;{const n=()=>{if(!this.timeStamps||!this.points){this._path.timePosRots=void 0;return}const s=this.timeStamps.length,o=this.points.length,a=Math.min(s,o),l=[];for(let u=0;u<a;++u)l.push([this.timeStamps[u],this.points[u]]);this._path.timePosRots=l,this.rotationRadius.some(u=>u>0)?(this._path.addAroundPoints(this.rotationRadius,!0),this._path.computeRotIfUndefinedUsingLerp(!0),this._path.rotLerpMode="Lerp"):(this._path.computeRotIfUndefinedUsingPrevLine(!0),this._path.rotLerpMode="Next")},r=this.dv(Ve(this.timeStampsChanged,this.pointsChanged,this.rotationRadiusChanged));n(),this.d(r.don(n))}}get path(){return this._path}get currentPosition(){return this._path.currentPosition}get currentPositionChanged(){return this._currentPositionChanged}get currentRotation(){const e=this._path.currentRotation;if(e)return[Bl(e[0]-90),e[1],e[2]]}get currentRotationChanged(){return this._currentRotationChanged}get current(){return{position:this.currentPosition,rotation:this.currentRotation}}get currentChanged(){return this._currentChanged}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Kg([this,"timeStamps"],"时间序列",[],!0,void 0,void 0,()=>{if(!(!this.points||this.points.length<2))return _o(this.points,"GEODESIC")}),new D([this,"speed"],"线条流速",1),new ft([this,"materialMode"],[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","pureColor"]],"模式","singleArrow"),new Ne([this,"rotationRadius"],"拐弯半径",Pl.defaults.rotationRadius)],more:[...e.more,new ci([this,"currentPosition"],"当前位置",void 0,!0,!0)]}}};f(Pl,"createDefaultProps",()=>({...Fi.createDefaultProps(),timeStamps:oe(void 0),speed:1,materialMode:"singleArrow",stroked:!0,strokeStyle:bt({width:10,widthType:"world",color:[1,0,.73,1],material:"",materialParams:{arrowColor:[1,1,1,1]},ground:!1}),rotationRadius:[5]})),f(Pl,"type",Pl.register("ESPath",Pl,{chsName:"ESPath",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPath"}));let Au=Pl;const xl=class xl extends Ot{constructor(e){super(e);f(this,"_lineString",this.dv(new Fi));this.components.disposableAdd(this._lineString,!1),this.stroked=!0,this.d(Ze([this.pointsChanged,this.resolutionChanged,this.sharpnessChanged],()=>{try{if(this.points&&this.points.length>=2){const n=Tu(this.points,this.resolution,this.sharpness);this._lineString.points=n}else this._lineString.points=void 0}catch(n){console.error(n),this._lineString.points=void 0}},{immediate:!0})),this.d(F([this._lineString,"show"],[this,"show"])),this.d(F([this._lineString,"allowPicking"],[this,"allowPicking"])),this.d(F([this._lineString,"collision"],[this,"collision"])),this.d(F([this._lineString,"stroked"],[this,"stroked"])),this.d(F([this._lineString,"strokeStyle"],[this,"strokeStyle"])),this.d(lt([this._lineString,"flyInParam"],[this,"flyInParam"])),this.d(lt([this._lineString,"flyToParam"],[this,"flyToParam"])),this.d(this.flyInEvent.don(n=>{this._lineString.flyIn(n)})),this.d(this.flyToEvent.don(n=>{this._lineString.flyTo(n)})),this.d(this.calcFlyToParamEvent.don(()=>{this._lineString.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{this._lineString.calcFlyInParam()}))}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new D([this,"resolution"],"解析度",1e3),new D([this,"sharpness"],"锐利度",.85)]}}get lineString(){return this._lineString}};f(xl,"createDefaultProps",()=>({...Ot.createDefaultProps(),resolution:1e3,sharpness:.85})),f(xl,"type",xl.register("ESGeoBezierSpline",xl,{chsName:"贝塞尔曲线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"贝塞尔曲线"})),f(xl,"supportEditingModes",[...Ot.supportEditingModes,nt.LineStringAppend,nt.LineStringInsert]);let Av=xl;const Ea=class Ea extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new wt,new X([this,"textEditingInteraction"],"文本编辑交互"),new X([this,"textEditing"],"文本编辑"),new D([this,"width"],"宽度",Ea.defaults.width,!0),new bd([this,"text"],"内容",Ea.defaults.text,void 0,!0),new rr([this,"originRatioAndOffset"],"原点比例和偏移"),new D([this,"opacity"],"透明度"),new D([this,"fontSize"],"字体大小"),new Dt([this,"color"],"字体颜色"),new Dt([this,"backgroundColor"],"背景颜色"),new rr([this,"padding"],"内边距"),new rr([this,"borderRadius"],"边框圆角"),new Dt([this,"borderColor"],"边框颜色"),new D([this,"borderWidth"],"边框宽度"),new ft([this,"textAlign"],[["center","center"],["left","left"],["right","right"]],"文字位置"),new ft([this,"borderStyle"],[["none","none"],["hidden","hidden"],["dotted","dotted"],["dashed","dashed"],["solid","solid"],["double","double"],["groove","groove"],["ridge","ridge"],["inset","inset"],["outset","outset"]],"边框类型")]}}};f(Ea,"createDefaultProps",()=>({...ct.createDefaultProps(),text:"请输入文字",width:80,textEditingInteraction:!1,textEditing:!1,originRatioAndOffset:ot([.5,1,0,0]),opacity:1,fontSize:14,textAlign:"left",color:ot([1,1,1,1]),backgroundColor:ot([0,0,0,.8]),padding:ot([5,5,5,5]),borderRadius:ot([6,6,6,6]),borderWidth:0,borderColor:ot([1,1,1,1]),borderStyle:"solid"})),f(Ea,"type",Ea.register("ESGeoDivTextPoi",Ea,{chsName:"图标点",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"图标点"}));let Lv=Ea;const fh=class fh extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Dt([this,"color"],"颜色",[1,1,0,1])]}}};f(fh,"createDefaultProps",()=>({...ct.createDefaultProps(),color:ot([1,1,0,1])})),f(fh,"type",fh.register("ESCityBasePoint",fh,{chsName:"城市基点(Czm)",tags:["ESObjects","CityObjects","_ES_Impl_Cesium"],description:"城市基点(Czm)"}));let Fv=fh;const FE=`(dataSource) => {
448
+ `,yn=class yn extends B{constructor(e,n){super();f(this,"_scratchCurrentInfo",{position:[0,0,0],rotation:[0,0,0],index:0});f(this,"_currentInfo",this.disposeVar(z(void 0,(e,n)=>!1)));f(this,"_player");f(this,"_flyToEvent",this.disposeVar(new O));f(this,"_accumDistancesChanged",this.disposeVar(new O));f(this,"_accumDistancesChangedInit",this.dispose(this.timePosRotsChanged.disposableOn(()=>(this._accumDistancesDirty=!0,this._accumDistancesChanged.emit()))));f(this,"_accumDistancesDirty",!1);f(this,"_accumDistances",[]);f(this,"_getCurrentFunc",this.disposeVar(z(void 0)));this._player=this.disposeVar(new kr);const r=()=>{const s=this.getCurrent(this.currentTime??0);if(s===void 0)this._currentInfo.value=void 0;else{const{index:o,position:a,rotation:l,ratio:u}=s;this._scratchCurrentInfo.index=o,this._scratchCurrentInfo.position=a,this._scratchCurrentInfo.rotation=l,this._scratchCurrentInfo.ratio=u,this._currentInfo.value=this._scratchCurrentInfo}};r(),this.currentTimeChanged.disposableOn(r),this.timePosRotsChanged.disposableOn(r),this.rotLerpModeChanged.disposableOn(r),this.dispose(lt([this._player,"loop"],[this,"loop"]));{const s=()=>{if(this.startTime===void 0||this.currentTime===void 0)return;const o=this.currentTime-this.startTime;(this._player.currentTime===void 0||Math.abs(o-this._player.currentTime)>.01)&&(this._player.currentTime=o)};s(),this.dispose(this.currentTimeChanged.disposableOn(s))}{const s=()=>{if(this.startTime===void 0||this._player.currentTime===void 0)return;const o=this._player.currentTime+this.startTime;(this.currentTime===void 0||Math.abs(o-this.currentTime)>.01)&&(this.currentTime=o)};s(),this.dispose(this._player.currentTimeChanged.disposableOn(s))}this.dispose(lt([this._player,"duration"],[this,"duration"])),this.dispose(lt([this._player,"playing"],[this,"playing"])),this.dispose(lt([this._player,"speed"],[this,"speed"]));{const s=()=>{(this.autoComputeTimeFromTimePosRots??!0)&&this.computeTimeFromTimePosRots()};s();const o=this.disposeVar(Ve(this.autoComputeTimeFromTimePosRotsChanged,this.timePosRotsChanged));this.dispose(o.disposableOn(s))}{const s=()=>{const o=this.timePosRots;if(!o)return;let a=0;const l=o.length;for(let u=0;u<l;++u){const h=o[u][0];if(h<0)console.warn("地理路径的时间戳不能小于0!");else if(h<a){console.warn(`地理路径的时间戳需要满足从小到大的数据,元素越靠后,时间越靠后!当前不满足条件的元素是index: ${u} time: ${h}`);break}}};s(),this.dispose(this.timePosRotsChanged.disposableOn(s))}{const s=this.disposeVar(Ln(async o=>{if(!this.dataUri)return;await o.promise(Mh(1e3));const a=await o.promise(fetch(this.dataUri)),l=await o.promise(a.text());this.timePosRots=yn.parseData(l)}));this.dispose(this.dataUriChanged.disposableOn(()=>{s.restart()})),this.dispose(this.dataTextChanged.disposableOn(()=>{this.dataText&&(this.timePosRots=yn.parseData(this.dataText))}))}}get currentInfo(){return this._currentInfo.value}get currentInfoChanged(){return this._currentInfo.changed}get currentIndex(){return this._currentInfo.value&&this._currentInfo.value.index}get currentIndexChanged(){return this._currentInfo.changed}get currentPosition(){return this._currentInfo.value&&this._currentInfo.value.position}get currentPositionChanged(){return this._currentInfo.changed}get currentRotation(){return this._currentInfo.value&&this._currentInfo.value.rotation}get currentRotationChanged(){return this._currentInfo.changed}get player(){return this._player}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get accumDistancesChanged(){return this._accumDistancesChanged}get accumDistances(){if(!this._accumDistancesDirty)return this._accumDistances;if(!this.timePosRots||this.timePosRots.length<2)this._accumDistances=[];else{const e=this.timePosRots.length;let n=0;const r=[];let s=jr(this.timePosRots[0][1]);r.push(n);for(let o=1;o<e;++o){const a=jr(this.timePosRots[o][1]),l=w.Vector.distance(a,s);s=a,n+=l,r.push(n)}this._accumDistances=r}return this._accumDistances}get totalDistanceChanged(){return this._accumDistancesChanged}get totalDistance(){return this.accumDistances.length>0?this.accumDistances[this.accumDistances.length-1]:0}getCurrent(e){return this.getCurrentFunc?this.getCurrentFunc(e,this):this.timePosRots&&LD(this.timePosRots,e,this.rotLerpMode)}subPath(e,n){return this.timePosRots&&kD(this,e,n)}computeRotIfUndefinedUsingPrevLine(e=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=yn.computeRotIfUndefinedUsingPrevLine(this.timePosRots,e)}computeRotIfUndefinedUsingNextLine(e=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=yn.computeRotIfUndefinedUsingNextLine(this.timePosRots,e)}computeRotIfUndefinedUsingLerp(e=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=yn.computeRotIfUndefinedUsingLerp(this.timePosRots,e)}computeRotIfUndefined(e=!1){this.computeRotIfUndefinedUsingPrevLine(e)}addAroundPoints(e,n){AD(this,e,n)}get getCurrentFunc(){return this._getCurrentFunc.value}set getCurrentFunc(e){this._getCurrentFunc.value=e}get getCurrentFuncChanged(){return this._getCurrentFunc.changed}computeTimeFromTimePosRots(){const e=this.timePosRots;if(!e||e.length<=1){this.startTime=void 0,this.stopTime=void 0,this.duration=void 0;return}this.startTime=e[0][0],this.stopTime=e[e.length-1][0],this.duration=this.stopTime-this.startTime}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}};f(yn,"computeRotIfUndefinedUsingPrevLine",DE),f(yn,"computeRotIfUndefinedUsingNextLine",RE),f(yn,"computeRotIfUndefinedUsingLerp",RD),f(yn,"getLeftRotation",AE),f(yn,"getRightRotation",LE),f(yn,"parseData",FD),f(yn,"defaults",{timePosRots:[],startTime:0,stopTime:3e3,loop:!1,duration:3e3,playing:!1,dataText:""}),f(yn,"timePosRotsMd",GD);let aa=yn;(i=>{i.createDefaultProps=()=>({show:!1,currentPoiShow:!0,timePosRots:Do(void 0,(t,e)=>t[0]===e[0]&&t[1].every((n,r)=>n===e[1][r])&&t[2]===e[2]===void 0||t[2]!==void 0&&e[2]!==void 0&&t[2].every((n,r)=>e[2][r]),t=>[t[0],[...t[1]],t[2]&&[...t[2]]||void 0]),autoComputeTimeFromTimePosRots:!0,leadTime:0,trailTime:0,startTime:void 0,stopTime:void 0,loop:!1,currentTime:0,duration:void 0,speed:1,playing:!1,polylineShow:!0,width:1,ground:!1,color:ot([1,1,1,1]),hasDash:!1,gapColor:ot([0,0,0,0]),dashLength:16,dashPattern:255,depthTest:!1,arcType:"GEODESIC",allowPicking:!1,dataUri:"",dataText:void 0,rotLerpMode:"Lerp",debug:!1})})(aa||(aa={})),Ro(aa.prototype,aa.createDefaultProps);const Pl=class Pl extends Fi{constructor(e){super(e);f(this,"_path");f(this,"_currentPositionChanged",this.dv(new O));f(this,"_currentRotationChanged",this.dv(new O));f(this,"_currentChanged",this.dv(new O));f(this,"_deprecated",[]);f(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());this._path=this.dv(new aa),this.d(this._path.currentInfoChanged.don(()=>this._currentPositionChanged.emit(this._path.currentPosition))),this.d(this._path.currentInfoChanged.don(()=>this._currentRotationChanged.emit(this.currentRotation))),this.d(this._path.currentInfoChanged.don(()=>this._currentChanged.emit(this.current))),this._path.show=!0,this._path.polylineShow=!1,this._path.currentPoiShow=!1;{const n=()=>{if(!this.timeStamps||!this.points){this._path.timePosRots=void 0;return}const s=this.timeStamps.length,o=this.points.length,a=Math.min(s,o),l=[];for(let u=0;u<a;++u)l.push([this.timeStamps[u],this.points[u]]);this._path.timePosRots=l,this.rotationRadius.some(u=>u>0)?(this._path.addAroundPoints(this.rotationRadius,!0),this._path.computeRotIfUndefinedUsingLerp(!0),this._path.rotLerpMode="Lerp"):(this._path.computeRotIfUndefinedUsingPrevLine(!0),this._path.rotLerpMode="Next")},r=this.dv(Ve(this.timeStampsChanged,this.pointsChanged,this.rotationRadiusChanged));n(),this.d(r.don(n))}}get path(){return this._path}get currentPosition(){return this._path.currentPosition}get currentPositionChanged(){return this._currentPositionChanged}get currentRotation(){const e=this._path.currentRotation;if(e)return[Bl(e[0]-90),e[1],e[2]]}get currentRotationChanged(){return this._currentRotationChanged}get current(){return{position:this.currentPosition,rotation:this.currentRotation}}get currentChanged(){return this._currentChanged}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Kg([this,"timeStamps"],"时间序列",[],!0,void 0,void 0,()=>{if(!(!this.points||this.points.length<2))return _o(this.points,"GEODESIC")}),new D([this,"speed"],"线条流速",1),new ft([this,"materialMode"],[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","pureColor"]],"模式","singleArrow"),new Ne([this,"rotationRadius"],"拐弯半径",Pl.defaults.rotationRadius)],more:[...e.more,new ci([this,"currentPosition"],"当前位置",void 0,!0,!0)]}}};f(Pl,"createDefaultProps",()=>({...Fi.createDefaultProps(),timeStamps:oe(void 0),speed:1,materialMode:"singleArrow",stroked:!0,strokeStyle:bt({width:10,widthType:"world",color:[1,0,.73,1],material:"",materialParams:{arrowColor:[1,1,1,1]},ground:!1}),rotationRadius:[5]})),f(Pl,"type",Pl.register("ESPath",Pl,{chsName:"ESPath",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPath"}));let Au=Pl;const xl=class xl extends Ot{constructor(e){super(e);f(this,"_lineString",this.dv(new Fi));this.components.disposableAdd(this._lineString,!1),this.stroked=!0,this.d(Ze([this.pointsChanged,this.resolutionChanged,this.sharpnessChanged],()=>{try{if(this.points&&this.points.length>=2){const n=Tu(this.points,this.resolution,this.sharpness);this._lineString.points=n}else this._lineString.points=void 0}catch(n){console.error(n),this._lineString.points=void 0}},{immediate:!0})),this.d(F([this._lineString,"show"],[this,"show"])),this.d(F([this._lineString,"allowPicking"],[this,"allowPicking"])),this.d(F([this._lineString,"collision"],[this,"collision"])),this.d(F([this._lineString,"stroked"],[this,"stroked"])),this.d(F([this._lineString,"strokeStyle"],[this,"strokeStyle"])),this.d(lt([this._lineString,"flyInParam"],[this,"flyInParam"])),this.d(lt([this._lineString,"flyToParam"],[this,"flyToParam"])),this.d(this.flyInEvent.don(n=>{this._lineString.flyIn(n)})),this.d(this.flyToEvent.don(n=>{this._lineString.flyTo(n)})),this.d(this.calcFlyToParamEvent.don(()=>{this._lineString.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{this._lineString.calcFlyInParam()}))}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new D([this,"resolution"],"解析度",1e3),new D([this,"sharpness"],"锐利度",.85)]}}get lineString(){return this._lineString}};f(xl,"createDefaultProps",()=>({...Ot.createDefaultProps(),resolution:1e3,sharpness:.85})),f(xl,"type",xl.register("ESGeoBezierSpline",xl,{chsName:"贝塞尔曲线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"贝塞尔曲线"})),f(xl,"supportEditingModes",[...Ot.supportEditingModes,nt.LineStringAppend,nt.LineStringInsert]);let Av=xl;const Ea=class Ea extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new wt,new H([this,"textEditingInteraction"],"文本编辑交互"),new H([this,"textEditing"],"文本编辑"),new D([this,"width"],"宽度",Ea.defaults.width,!0),new bd([this,"text"],"内容",Ea.defaults.text,void 0,!0),new rr([this,"originRatioAndOffset"],"原点比例和偏移"),new D([this,"opacity"],"透明度"),new D([this,"fontSize"],"字体大小"),new Dt([this,"color"],"字体颜色"),new Dt([this,"backgroundColor"],"背景颜色"),new rr([this,"padding"],"内边距"),new rr([this,"borderRadius"],"边框圆角"),new Dt([this,"borderColor"],"边框颜色"),new D([this,"borderWidth"],"边框宽度"),new ft([this,"textAlign"],[["center","center"],["left","left"],["right","right"]],"文字位置"),new ft([this,"borderStyle"],[["none","none"],["hidden","hidden"],["dotted","dotted"],["dashed","dashed"],["solid","solid"],["double","double"],["groove","groove"],["ridge","ridge"],["inset","inset"],["outset","outset"]],"边框类型")]}}};f(Ea,"createDefaultProps",()=>({...ct.createDefaultProps(),text:"请输入文字",width:80,textEditingInteraction:!1,textEditing:!1,originRatioAndOffset:ot([.5,1,0,0]),opacity:1,fontSize:14,textAlign:"left",color:ot([1,1,1,1]),backgroundColor:ot([0,0,0,.8]),padding:ot([5,5,5,5]),borderRadius:ot([6,6,6,6]),borderWidth:0,borderColor:ot([1,1,1,1]),borderStyle:"solid"})),f(Ea,"type",Ea.register("ESGeoDivTextPoi",Ea,{chsName:"图标点",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"图标点"}));let Lv=Ea;const fh=class fh extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Dt([this,"color"],"颜色",[1,1,0,1])]}}};f(fh,"createDefaultProps",()=>({...ct.createDefaultProps(),color:ot([1,1,0,1])})),f(fh,"type",fh.register("ESCityBasePoint",fh,{chsName:"城市基点(Czm)",tags:["ESObjects","CityObjects","_ES_Impl_Cesium"],description:"城市基点(Czm)"}));let Fv=fh;const FE=`(dataSource) => {
449
449
  var entities = dataSource.entities.values;
450
450
 
451
451
  for (var i = 0; i < entities.length; i++) {
@@ -465,7 +465,7 @@ timePosRots是一个内部包含三个元素的数组,第一个表示时间戳
465
465
  ${FE}
466
466
  \`\`\`
467
467
 
468
- `,kv=Date.now(),$s=class $s extends pt{constructor(e){super(e);f(this,"_flyToEvent",this.disposeVar(new O));f(this,"_resetClockEvent",this.disposeVar(new O));this.ad(lt([this,"uri"],[this,"url"]))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new Et([this,"url"],"路径","${earthsdk3-assets-script-dir}/assets/misc/simple.czml",void 0,!0),new X([this,"clockEnabled"],"启用",!1),new D([this,"multiplier"],"倍速",$s.defaults.multiplier),new X([this,"autoResetClock"],"自动设置时钟",!0),new ys([this,"startTime"],"开始时间",$s.defaults.startTime,!0),new ys([this,"stopTime"],"结束时间",$s.defaults.stopTime,!0),new ys([this,"currentTime"],"当前时间",$s.defaults.currentTime,!0),new ft([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep","SYSTEM_CLOCK_MULTIPLIER"),new ft([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange","UNBOUNDED"),new X([this,"shouldAnimate"],"是否启用动画",!1)],general:[...e.general,new X([this,"show"],"是否显示",!0),new X([this,"collision"],"开启碰撞",!1),new X([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new vt("飞入",n=>this.flyTo(n),[1e3],"flyTo"),new vt("重置时钟",()=>this.resetClock(),[],"resetClock"),new io([this,"loadFuncStr"],"loadFnStr",FE,jD,!0)]}}};f($s,"createDefaultProps",()=>({show:!0,uri:void 0,url:void 0,allowPicking:!1,autoResetClock:!0,clockEnabled:!1,startTime:kv,stopTime:kv+864e5,currentTime:kv,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...pt.createDefaultProps()})),f($s,"type",$s.register("ESCzml",$s,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"}));let Gv=$s;const gh=class gh extends pt{getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new wt,new X([this,"show"],"是否显示"),new D([this,"cssSize"],"尺寸"),new Ke([this,"cssPosition"],"位置"),new mt([this,"imgUrl"],"图片地址")]}}};f(gh,"createDefaultProps",()=>({...pt.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:pt.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")})),f(gh,"type",gh.register("ESNavigator",gh,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"}));let jv=gh;const Ys=class Ys extends pt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new wt("通用"),new X([this,"show"],"是否显示",Ys.defaults.show),new D([this,"height"],"高度",Ys.defaults.height,!0),new D([this,"fontSize"],"文字大小",Ys.defaults.fontSize,!0),new Dt([this,"bgColor"],"背景颜色",Ys.defaults.bgColor,!0)]}}};f(Ys,"createDefaultProps",()=>({...pt.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:ot([.2784313725490196,.2784313725490196,.2784313725490196,.8])})),f(Ys,"type",Ys.register("ESViewerStatusBar",Ys,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let Vv=Ys;const Js=class Js extends pt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new wt("通用"),new X([this,"show"],"是否显示",Js.defaults.show),new D([this,"height"],"高度",Js.defaults.height,!0),new D([this,"fontSize"],"文字大小",Js.defaults.fontSize,!0),new Dt([this,"bgColor"],"背景颜色",Js.defaults.bgColor,!0)]}}};f(Js,"createDefaultProps",()=>({...pt.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:ot([.2784313725490196,.2784313725490196,.2784313725490196,.8])})),f(Js,"type",Js.register("ESViewerStatusBarScale",Js,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let zv=Js;const ph=class ph extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new mt([this,"url"],"路径","",!0),new D([this,"progress"],"进度",0,!1,!0)]}}};f(ph,"createDefaultProps",()=>({...ct.createDefaultProps(),url:"",progress:0})),f(ph,"type",ph.register("ESGaussianSplatting",ph,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"}));let Bv=ph;class VD extends B{constructor(t,e){if(super(),!e)return;const n=this.ad(new Jt);n.stroked=!0,this.ad(t.components.disposableAdd(n)),this.ad(lt([n,"points"],[t,"areaLiftingPoints"])),this.ad(n.editingChanged.don(()=>{n.editing||!this.isDestroyed()&&this.destroy()})),n.editing=!0}}var kE=(i=>(i[i.None=0]="None",i[i.Up=1]="Up",i[i.Down=2]="Down",i))(kE||{}),GE=(i=>(i[i.CLICK=0]="CLICK",i[i.MOVE=1]="MOVE",i))(GE||{}),jE=(i=>(i[i.Smooth=0]="Smooth",i[i.Linear=1]="Linear",i[i.Spherical=2]="Spherical",i[i.Tip=3]="Tip",i[i.Hard=4]="Hard",i))(jE||{});const vi=class vi extends ct{constructor(e){super(e);f(this,"_startEvent",this.disposeVar(new O));f(this,"_configs",this.disposeVar(oe(void 0)));f(this,"_heights",this.disposeVar(z({})));f(this,"_heightsEvent",this.ad(new O));f(this,"_areaLiftingUpdateEvent",this.disposeVar(new O));const n=this.ad(Ve(this.modeChanged,this.startEvent));this.ad(new qe(n,()=>{var r;if(this.areaLiftingPoints=void 0,this.mode=="areaLifting")return new VD(this,this.activeViewer);(r=this.activeViewer)==null||r.startEditing(this,nt.BrushErase)}))}updateEditing(){var e;Nf(this.position,[0,0,0])||(this.position=[0,0,0]),(e=this.activeViewer)==null||e.startEditing(this,nt.Place,{callSource:"inner"})}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get configs(){return this._configs.value}set configs(e){this._configs.value=e}get configsChanged(){return this._configs.changed}getConfig(...e){var n,r;if(typeof e[0]=="number")return(n=this.configs)==null?void 0:n.find(s=>s.x===e[0]&&s.y===e[1]);if(typeof e[0]=="string")return(r=this.configs)==null?void 0:r.find(s=>s.url===e[0])}get heights(){return this._heights.value}set heights(e){this._heights.value=e}get heightsChanged(){return this._heights.changed}get heightsEvent(){return this._heightsEvent}getHeights(){return new Promise((e,n)=>{const r=new B;r.ad(this._heightsEvent.don(o=>{o!=="start"&&(!r.isDestroyed()&&r.destroy(),e(o))})),this._heightsEvent.emit("start");const s=setTimeout(()=>{r.isDestroyed()||(r.destroy(),e(void 0))},2e3);r.ad(()=>clearTimeout(s))})}get areaLiftingUpdateEvent(){return this._areaLiftingUpdateEvent}areaLiftingUpdate(){this._areaLiftingUpdateEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new vt("开始编辑",()=>{this.start()},[],"start"),new ft([this,"mode"],vi.modes,"编辑模式",vi.defaults.mode)],basic:[...e.basic,new Et([this,"url"],"URL"),new Et([this,"tileInfo"],"瓦片信息配置"),new D([this,"maxHeight"],"最大高度"),new D([this,"minHeight"],"最小高度"),new D([this,"offset"],"偏移"),new X([this,"autoLoadHeights"],"自动加载高度"),new wt("刷写设置"),new D([this,"brushEraseRadius"],"编辑半径"),new Ke([this,"brushEraseRadiusRange"],"编辑半径范围",void 0,!0,!0),new ft([this,"brushEraseMode"],Object.entries(["CTRL","SHIFT","NONE"]),"刷写模式"),new ft([this,"brushErasePickReference"],vi.brushErasePickReferences,"选择参考"),new _s([this,"brushErasePosition"],"刷写位置"),new _s([this,"brushEraseStartPosition"],"刷写起始位置"),new ft([this,"brushEraseFalloff"],vi.brushEarseFalloffs,"刷写衰减函数"),new ft([this,"brushEraseRayDirection"],[["Up","Up"],["Down","Down"]],"刷写射线方向"),new wt("平整设置"),new ft([this,"flattenMode"],vi.flattenModes,"平整模式",0),new ft([this,"flattenPick"],vi.flattenPicks,"平整选择",0),new D([this,"flattenOffset"],"平整偏移",-.01),new wt("区域升降设置"),new Ne([this,"areaLiftingPoints"],"区域升降位置",[]),new D([this,"areaLiftingOffset"],"区域升降偏移",1),new vt("区域升降更新",()=>{this.areaLiftingUpdate()},[],"areaLiftingUpdate"),new wt("围栏设置"),new Ne([this,"fencePoints"],"围栏位置",[])]}}};f(vi,"createDefaultProps",()=>({...ct.createDefaultProps(),allowPicking:!0,url:"",maxHeight:0,minHeight:0,offset:.01,tileInfo:bt({tileCountX:65,tileCountY:65,tileMaximumLevel:15,tilesPerAxis:5,format:"heights"}),mode:z("sculpt"),autoLoadHeights:!1,brushEraseRadius:100,brushEraseRadiusRange:ot([0,100]),brushErasePosition:ot([0,0,0]),brushEraseStartPosition:ot([0,0,0]),brushEraseMode:z("NONE"),brushErasePickReference:z("NONE"),brushEraseRayDirection:z("Down"),brushEraseFalloff:z(4),flattenMode:z(0),flattenPick:z(1),flattenOffset:-.01,areaLiftingPoints:Pa(void 0),areaLiftingOffset:1,fencePoints:Pa(void 0),fenceMode:z("in")})),f(vi,"modes",[["雕刻","sculpt"],["抹除","erase"],["平滑","smooth"],["平整","flatten"],["区域升降","areaLifting"]]),f(vi,"brushErasePickReferences",[["无限制","NONE"],["地形图层","ESTerrainLayerEditing"],["3DTiles","ES3DTileset"]]),f(vi,"flattenModes",[["None",0],["Up",1],["Down",2]]),f(vi,"flattenPicks",[["CLICK",0],["MOVE",1]]),f(vi,"brushEarseFalloffs",[["平滑",0],["线性",1],["硬边",4],["球形",2],["尖顶",3]]),f(vi,"invalidValue",-1e4),f(vi,"type",vi.register("ESTerrainLayerEditing",vi,{chsName:"地形图层编辑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于对地形数据进行编辑"})),f(vi,"supportEditingModes",[...ct.supportEditingModes,nt.Place,nt.BrushErase]);let Vc=vi;const nr=class nr extends Ot{constructor(e){super(e);f(this,"editingBindMode","doublePoints");f(this,"_startEvent",this.disposeVar(new O));f(this,"_replayEvent",this.disposeVar(new O));this.ad(this.startEvent.don(()=>{var n;(n=this.activeViewer)==null||n.startEditing(this,nt.BrushErase)}))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get replayEvent(){return this._replayEvent}replay(){this._replayEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new vt("开始编辑",()=>this.start(),[]),new vt("重播",()=>this.replay(),[]),new X([this,"showImage"],"显示影像",nr.defaults.showImage),new D([this,"flowSpeed"],"流动速度",nr.defaults.flowSpeed),new D([this,"gravity"],"重力加速度",nr.defaults.gravity),new D([this,"strength"],"泥石流强度",nr.defaults.strength),new D([this,"resistance"],"泥石流阻力(越大越快平息)",nr.defaults.resistance),new D([this,"terrainOffset"],"地形高度偏移",nr.defaults.terrainOffset),new Ne([this,"slidePoints"],"滑坡点数组",Ot.defaults.slidePoints,void 0),new wt("刷写设置"),new D([this,"brushEraseRadius"],"编辑半径"),new Ke([this,"brushEraseRadiusRange"],"编辑半径范围",void 0,!0,!0),new ft([this,"brushEraseMode"],Object.entries(["CTRL","SHIFT","NONE"]),"刷写模式"),new ft([this,"brushErasePickReference"],Vc.brushErasePickReferences,"选择参考"),new _s([this,"brushErasePosition"],"刷写位置"),new _s([this,"brushEraseStartPosition"],"刷写起始位置"),new ft([this,"brushEraseFalloff"],Vc.brushEarseFalloffs,"刷写衰减函数"),new ft([this,"brushEraseRayDirection"],[["Up","Up"],["Down","Down"]],"刷写射线方向")]}}};f(nr,"createDefaultProps",()=>({...Ot.createDefaultProps(),brushEraseRadius:100,brushEraseRadiusRange:ot([0,1e3]),brushErasePosition:ot([0,0,0]),brushEraseStartPosition:ot([0,0,0]),brushEraseMode:z("NONE"),brushErasePickReference:z("NONE"),brushEraseRayDirection:z("Down"),terrainOffset:5,flowSpeed:1,gravity:9.8,slidePoints:ot([]),strength:1,showImage:!0,resistance:.98,stroked:!0,strokeStyle:bt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!0})})),f(nr,"type",nr.register("ESLandSlide",nr,{chsName:"滑坡泥石流分析",tags:["ESObjects","_ES_Impl_Cesium"],description:"滑坡泥石流分析对象"})),f(nr,"supportEditingModes",[...Ot.supportEditingModes,nt.DoublePoints,nt.DoublePointsAppend,nt.DoublePointsModify,nt.BrushErase]);let Uv=nr;const Il=class Il extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new mt([this,"mesh"],"mesh地址",Il.defaults.mesh)]}}};f(Il,"createDefaultProps",()=>({...ct.createDefaultProps(),mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"})),f(Il,"type",Il.register("ESStaticMesh",Il,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"}));let qv=Il;const mh=class mh extends Ot{constructor(e){super(e);f(this,"_startEvent",this.dv(new O));f(this,"_clearEvent",this.dv(new O));f(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new nl),this.ad(this.components.disposableAdd(this._eSGeoExtrudedPolygon)),this.eSGeoExtrudedPolygon.perPositionHeight=!0,this.eSGeoExtrudedPolygon.extrudedHeight=0,this.stroked=!0,this.strokeWidth=2,this.strokeColor=[1,0,0,1],this.ad(F([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(F([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(F([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(F([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(F([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(F([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(F([this.eSGeoExtrudedPolygon,"points"],[this,"points"])),this.ad(this.clearEvent.don(()=>{this.points=void 0,this.depths=void 0,this.windowPositions=void 0}))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get eSGeoExtrudedPolygon(){return this._eSGeoExtrudedPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new vt("开始分析",()=>this.start(),[],"start"),new vt("清除分析",()=>this.clear(),[],"clear"),new Ne([this,"windowPositions"],"屏幕坐标",[],void 0,!1,!0),new Ne([this,"depths"],"深度值",[],void 0,!1,!0),new D([this,"radius"],"半径",1e4,!0)]}}};f(mh,"createDefaultProps",()=>({...Ot.createDefaultProps(),windowPositions:xm([]),depths:oe([]),radius:z(1e4)})),f(mh,"type",mh.register("ESSkylineAnalysis",mh,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"}));let Wv=mh;const Mo=class Mo extends Xt{constructor(t){super(t)}getESProperties(){const t=super.getESProperties();return{...t,basic:[...t.basic,new Ne([this,"data"],"数据",[],void 0,!0),new Et([this,"gradient"],"渐变",Mo.defaults.gradient,void 0,!0),new D([this,"radius"],"半径",Mo.defaults.radius,void 0,!0),new D([this,"blur"],"模糊",Mo.defaults.blur,!0),new X([this,"is3D"],"is3D",!1,!0)]}}};f(Mo,"createDefaultProps",()=>({...Xt.createDefaultProps(),is3D:z(!1),data:Pa([]),gradient:fe({".5":"green",".7":"yellow",".95":"red"}),radius:z(10),blur:z(.85)})),f(Mo,"type",Mo.register("ESHeatMap",Mo,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"}));let Jf=Mo;const Ml=class Ml extends Ot{constructor(e){super(e);f(this,"editingBindMode","scatter")}};f(Ml,"createDefaultProps",()=>({...Ot.createDefaultProps(),pointed:!0})),f(Ml,"type",Ml.register("ESGeoPoints",Ml,{chsName:"地理点集合",tags:["ESObjects","_ES_Impl_Cesium"],description:"地图中的可视化地理点集合"})),f(Ml,"supportEditingModes",[...Ot.supportEditingModes,nt.ScatterAppend,nt.ScatterModify]);let zc=Ml;const VE=async(i,t=[],e)=>{const n=[];for(const r of t){const{coordinates:s}=r.geometry;for(const o of s){const a=await Promise.all(o.map(async l=>{let u=l[2]??0;if(e)if(e.type==="absolute")u=e.height??u;else if(e.type==="relative"){const h=await i.getTerrainHeight([l[0],l[1]])??0;u=(e.height??u)+h}else e.type==="terrain"&&(u=await i.getTerrainHeight([l[0],l[1]])??0);return[l[0],l[1],u]}));n.push({...r,points:a})}}return n},zE=async(i,t=[],e)=>await Promise.all(t.map(async n=>{var l,u,h,c,d,g,p,E,b;const r=((l=n.geometry)==null?void 0:l.x)??((h=(u=n.geometry)==null?void 0:u.coordinates)==null?void 0:h[0]),s=((c=n.geometry)==null?void 0:c.y)??((g=(d=n.geometry)==null?void 0:d.coordinates)==null?void 0:g[1]);let a=((p=n.geometry)==null?void 0:p.z)??((b=(E=n.geometry)==null?void 0:E.coordinates)==null?void 0:b[2])??0;if(e)if(e.type==="absolute")a=e.height??a;else if(e.type==="relative"){const P=await i.getTerrainHeight([r,s])??0;a=(e.height??a)+P}else e.type==="terrain"&&(a=await i.getTerrainHeight([r,s])??0);return{...n,points:[r,s,a]}})),BE=async(i,t=[],e)=>{const n=[];return await Promise.all(t.map(async r=>{const{coordinates:s}=r.geometry;await Promise.all(s.map(async o=>{const a=await Promise.all(o.map(async l=>{let u=l[2]??0;if(e)if(e.type==="absolute")u=e.height??u;else if(e.type==="relative"){const h=await i.getTerrainHeight([l[0],l[1]])??0;u=(e.height??u)+h}else e.type==="terrain"&&(u=await i.getTerrainHeight([l[0],l[1]])??0);return[l[0],l[1],u]}));n.push({...r,points:a})}))})),n};function zD(i){const t=yi(i),e=cw(t),n=jp(t,e/2);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function BD(i,t){const e=yi(i),n=cw(e),r=Math.floor(n/t),s=[];if(s.push(i[0]),r<1)return[i[0]];for(let o=1;o<r;o+=1){const a=jp(e,n*(o/r));s.push([a.geometry.coordinates[0],a.geometry.coordinates[1],a.geometry.coordinates[2]||0])}return s}function UD(i){const t=[...i];JSON.stringify(i[0])!==JSON.stringify(i[i.length-1])&&t.push(i[0]);const e=ue([t]),n=Y_(e);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function UE(i,t,e){const n=i.dv(new Ou);for(const r in e)r!=="type"&&(n[r]=e[r]);n.position=t,i.d(i.components.disposableAdd(n))}function Hv(i,t,e,n){let r=n.textTemplate||n.symbol.text||"";const s=/{{(.*?)}}/;for(;s.test(r);){const h=r.match(s);if(h){const c=h[1].trim(),d=e[`${c}`]||"-";r=r.replace(h[0],d)}}let o=n.symbol;const{minVisibleDistance:a,maxVisibleDistance:l}=n;a&&l&&(o={...o,minVisibleDistance:a,maxVisibleDistance:l});const u={...o,text:r};UE(i,t,u)}function Lu(i,t){const e={width:null,height:null,color:null,opacity:null,rotation:null};return t.forEach(n=>{n.type==="size"?n.axis==="width"?e.width=i[n.field]||null:n.axis==="height"&&(e.height=i[n.field]||null):n.type==="color"?e.color=i[n.field]||null:n.type==="opacity"?e.opacity=i[n.field]||null:n.type==="rotation"&&(e.rotation=i[n.field]||null)}),e}function Xv(i,t,e){const r={...t.symbol};if(e&&e.length>0){const s=Lu(i,e);for(let o in s)r[o]!==void 0&&s[o]!==null&&(r[o]=s[o])}return r}function $v(i,t,e){var u,h;const n=t,{uniqueValueInfos:r,field:s,fieldDelimiter:o,defaultSymbol:a}=n;let l={...a};if(Array.isArray(s)){const d=s.map(g=>i[g]??"").join(o);l=((u=r.find(g=>g.value==d))==null?void 0:u.symbol)||a}else l=((h=r.find(c=>c.value==i[s]))==null?void 0:h.symbol)||a;if(e&&e.length>0){const c=Lu(i,e);for(let d in c)l[d]!==void 0&&c[d]!==null&&(l[d]=c[d])}return l}function Yv(i,t,e){const n=t,{classBreakInfos:r,field:s,defaultSymbol:o}=n;let a=o;const l=i[s];if(l===void 0||typeof l!="number")a=o;else{const u=r.find(h=>l<=h.maxValue&&l>=h.minValue);u?a=u.symbol:a=o}if(e&&e.length>0){const u=Lu(i,e);for(let h in u)a[h]!==void 0&&u[h]!==null&&(a[h]=u[h])}return a}function qD(i,t){function e(u,h,c,d){const g=y=>y*Math.PI/180,p=y=>y*180/Math.PI,E=g(u),b=g(c),P=g(d-h),v=Math.sin(P)*Math.cos(b),_=Math.cos(E)*Math.sin(b)-Math.sin(E)*Math.cos(b)*Math.cos(P),m=Math.atan2(v,_);return(p(m)+360)%360}function n(u,h,c,d,g){const E=C=>C*Math.PI/180,b=C=>C*180/Math.PI,P=d/6371e3,v=E(g),_=E(u),m=E(h),y=Math.asin(Math.sin(_)*Math.cos(P)+Math.cos(_)*Math.sin(P)*Math.cos(v)),S=m+Math.atan2(Math.sin(v)*Math.sin(P)*Math.cos(_),Math.cos(P)-Math.sin(_)*Math.sin(y));return{lat:b(y),lng:b(S),alt:c}}function r(u){const h=[];u.length>1&&h.push(e(u[0].lat,u[0].lng,u[1].lat,u[1].lng));for(let c=1;c<u.length-1;c++){const d=e(u[c-1].lat,u[c-1].lng,u[c].lat,u[c].lng),g=e(u[c].lat,u[c].lng,u[c+1].lat,u[c+1].lng);let p=(d+g)/2;Math.abs(d-g)>180&&(p=(p+180)%360),h.push(p)}return u.length>1&&h.push(e(u[u.length-2].lat,u[u.length-2].lng,u[u.length-1].lat,u[u.length-1].lng)),u.length===1&&h.push(0),h}if(!i||i.length<2)throw new Error("至少需要两个点才能生成路径");if(t<=0)throw new Error("宽度必须大于0");const s=t/2,o=r(i),a=[],l=[];for(let u=0;u<i.length;u++){const h=(o[u]+90)%360,c=(o[u]+270)%360,d=i[u].alt!==void 0?i[u].alt:0;a.push(n(i[u].lat,i[u].lng,d,s,h)),l.push(n(i[u].lat,i[u].lng,d,s,c))}return a.concat(l.reverse())}function WD(i,t,e,n){function r(E){return E*(Math.PI/180)}const s=6378137,o=r(i),a=r(t),l=r(e),u=r(n),h=l-o,c=u-a,d=Math.sin(h/2)**2+Math.cos(o)*Math.cos(l)*Math.sin(c/2)**2,g=2*Math.atan2(Math.sqrt(d),Math.sqrt(1-d));return s*g}const qE=(i,t,e)=>Array.isArray(t)?t.map(s=>i[s]??"").join(e):i[t]??"";function WE(i,t){const n={...t.symbol};return{points:i.map(r=>r.points),symbol:n}}function HE(i,t){const e=t,{uniqueValueInfos:n,field:r,fieldDelimiter:s,defaultSymbol:o}=e,a=[],l=n.reduce((h,c)=>{const d=c.value.toString();return h[d]={points:[],value:c.value,symbol:c.symbol},h},{});for(let h=0;h<i.length;h++){const c=i[h],d=qE(c,r,s);if(d!==void 0&&d!==""){const g=l[d.toString()];g?g.points.push(c.points):a.push(c.points)}else a.push(c.points)}const u=[];for(let h in l){const{points:c,symbol:d}=l[h];c.length>0&&u.push({points:c,symbol:d})}return a.length>0&&u.push({points:a,symbol:o}),u}function XE(i,t){const e=t,{classBreakInfos:n,field:r,defaultSymbol:s}=e,o=[],a=n.map(u=>({...u,points:[]}));for(let u=0;u<i.length;u++){const h=i[u],c=h[r];if(c===void 0||typeof c!="number")o.push(h.points);else{const d=a.findIndex(g=>c<=g.maxValue&&c>=g.minValue);d!==-1?a[d].points.push(h.points):o.push(h.points)}}const l=[];return a.forEach(u=>{u.points.length>0&&l.push({points:u.points,symbol:u.symbol})}),o.length>0&&l.push({points:o,symbol:s}),l}function HD(i,t,e=[]){const r={...t.symbol},s=i.map(o=>{const a=Lu(o,e);return{position:o.points,rotation:a.rotation||r.rotation||[0,0,0],scale:r.scale||[1,1,1]}});return{url:r.url,locations:s}}function XD(i,t,e=[]){const n=t,{uniqueValueInfos:r,field:s,fieldDelimiter:o}=n,a=n.defaultSymbol,l=[],u=r.reduce((c,d)=>{const g=d.value.toString();return c[g]={locations:[],value:d.value,symbol:d.symbol},c},{});for(let c=0;c<i.length;c++){const d=i[c],g=qE(d,s,o);if(g){const p=u[g.toString()];if(p){const E=Lu(d,e);p.locations.push({position:d.points,rotation:E.rotation||a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else l.push({position:d.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else l.push({position:d.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}const h=[];for(let c in u){const{locations:d,symbol:g}=u[c];d.length>0&&h.push({url:g.url,locations:d})}return l.length>0&&h.push({url:a.url,locations:l}),h}function $D(i,t,e=[]){const n=t,{classBreakInfos:r,field:s}=n,o=n.defaultSymbol,a=[],l=r.map(h=>({...h,locations:[]}));for(let h=0;h<i.length;h++){const c=i[h],d=c[s];if(d===void 0||typeof d!="number")a.push({position:c.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]});else{const g=l.findIndex(p=>d<=p.maxValue&&d>=p.minValue);if(g!==-1){const p=Lu(c,e);l[g].locations.push({position:c.points,rotation:p.rotation||o.rotation||[0,0,0],scale:l[g].symbol.scale||[1,1,1]})}else a.push({position:c.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]})}}const u=[];return l.forEach(h=>{h.locations.length>0&&u.push({url:h.symbol.url,locations:h.locations})}),a.length>0&&u.push({url:o.url,locations:a}),u}class YD extends B{constructor(e,n,r,s){super();f(this,"labelingInfo");this.sceneObject=e;const o=n;if(s&&ms(o,a=>{this.renderLabel(a,s)}),r)if(r.type==="simple"){const{visualVariables:a}=r;if(r.symbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!");const l=WE(o,r);this._simplePointAllRender(l.points,l.symbol);return}if(r.symbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!");const l=WE(o,r);this._imageAllRender(l.points,l.symbol);return}if(r.symbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!");const{url:l,locations:u}=HD(o,r,a);this._modelAllRender(l,u);return}for(let l=0;l<o.length;l++){const u=Xv(o[l],r,a);this.render(o[l],u)}}else if(r.type==="unique-value"){const{visualVariables:a}=r;if(r.uniqueValueInfos.findIndex(c=>c.symbol.type!=="simple-point")===-1&&r.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),HE(o,r).forEach(({points:d,symbol:g})=>{this._simplePointAllRender(d,g)});return}if(r.uniqueValueInfos.findIndex(c=>c.symbol.type!=="ESImageLabel")===-1&&r.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),HE(o,r).forEach(({points:d,symbol:g})=>{this._imageAllRender(d,g)});return}if(r.uniqueValueInfos.findIndex(c=>c.symbol.type!=="ESGltfModel")===-1&&r.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),XD(o,r,a).forEach(({url:d,locations:g})=>{this._modelAllRender(d,g)});return}for(let c=0;c<o.length;c++){const d=$v(o[c],r,a);this.render(o[c],d)}}else if(r.type==="class-breaks"){const{visualVariables:a}=r;if(r.classBreakInfos.findIndex(c=>c.symbol.type!=="simple-point")===-1&&r.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),XE(o,r).forEach(({points:d,symbol:g})=>{this._simplePointAllRender(d,g)});return}if(r.classBreakInfos.findIndex(c=>c.symbol.type!=="ESImageLabel")===-1&&r.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),XE(o,r).forEach(({points:d,symbol:g})=>{this._imageAllRender(d,g)});return}if(r.classBreakInfos.findIndex(c=>c.symbol.type!=="ESGltfModel")===-1&&r.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),$D(o,r,a).forEach(({url:d,locations:g})=>{this._modelAllRender(d,g)});return}for(let c=0;c<o.length;c++){const d=Yv(o[c],r,a);this.render(o[c],d)}}else if(r.type==="heatmap"){const{field:a,fieldValueMax:l,fieldValueMin:u}=r;console.time();const h=o.map(c=>{const{points:d}=c;if(a&&typeof a=="string"){let g=c[a];typeof g=="number"&&(typeof l=="number"&&g>l&&(g=l),typeof u=="number"&&g<u&&(g=u),d[2]=g)}return d});this.renderHeatmap(h,r)}else console.error("PointLayer: renderer type is not supported")}renderLabel(e,n){const{points:r}=e;Hv(this.sceneObject,r,e,n)}renderHeatmap(e,n){const{is3D:r,radius:s,blur:o,gradient:a}=n,l=this.dv(new Jf);this.d(this.sceneObject.components.disposableAdd(l)),l.is3D=r,l.radius=s,l.blur=o,a&&(l.gradient={...a}),l.data=e}render(e,n){n.type==="simple-point"?this._simplePointRender(e,n):n.type==="ESImageLabel"?this._simpleImageRender(e,n):n.type==="ESGltfModel"?this._simpleModelRender(e,n):n.type==="ESTextLabel"?UE(this.sceneObject,e.points,n):n.type==="ESParticleSystemPrimitive"?this._simpleParticleRender(e,n):console.error(" PointLayer: symbol type is not supported")}_simplePointRender(e,n){const{points:r}=e,{size:s,color:o,outlineColor:a,outlineWidth:l}=n,u=this.dv(new zc);this.d(this.sceneObject.components.disposableAdd(u)),u.pointed=!0,u.pointOutlineColor=a,u.pointOutlineWidth=l,u.pointSize=s,u.pointColor=o,u.allowPicking=(n==null?void 0:n.allowPicking)??!0,u.extras={selected:!1},u.points=[r]}_simplePointAllRender(e,n){const{size:r,color:s,outlineColor:o,outlineWidth:a}=n,l=this.dv(new zc);this.d(this.sceneObject.components.disposableAdd(l)),l.pointed=!0,l.pointOutlineColor=o,l.pointOutlineWidth=a,l.pointSize=r,l.pointColor=s,l.allowPicking=(n==null?void 0:n.allowPicking)??!0,l.points=[...e]}_simpleImageRender(e,n){const{points:r}=e,{rotation:s,offset:o,size:a,url:l,screenRender:u,anchor:h,renderMode:c,rotationType:d}=n,g=this.dv(new Vf),p=this.dv(new Ou);this.d(this.sceneObject.components.disposableAdd(g)),this.d(this.sceneObject.components.disposableAdd(p)),g.url=l,g.renderMode=c??0,s&&(g.rotation=s),o&&(g.offset=o),g.size=a||[32,32],h&&(g.anchor=h),d&&(g.rotationType=d),g.screenRender=u??!0,g.allowPicking=(n==null?void 0:n.allowPicking)??!0,g.extras={selected:!1},g.position=[...r],g.sizeByContent=!1,p.allowPicking=(n==null?void 0:n.allowPicking)??!0;const E=a?Math.max(...a)+10:Math.max(...g.size)+10;p.sizeByContent=!1,p.screenRender=!0,p.size=[E,E],p.borderRadius=[E,E,E,E],p.padding=[E/2,E/2,E/2,E/2],p.borderWidth=E/10,p.offset=[0,E/10+5],p.text="",p.backgroundColor=[0,0,0,0],p.borderColor=[0,0,0,0]}_imageAllRender(e,n){const r={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:e}}]},s=this.dv(new kc);this.d(this.sceneObject.components.disposableAdd(s));const o=this.dv(new Ou);this.d(this.sceneObject.components.disposableAdd(o)),s.textDefaultText="";const{offset:a,size:l,url:u,anchor:h}=n;s.imageUrl=u,h&&(s.imageAnchor=h),a&&(s.imageOffset=a),s.imageSize=l||[32,32],s.url=r,s.allowPicking=(n==null?void 0:n.allowPicking)??!0,s.extras={selected:!1},o.allowPicking=!0;const c=l?Math.max(...l)+10:Math.max(...s.imageSize)+10;o.sizeByContent=!1,o.size=[c,c],o.borderRadius=[c,c,c,c],o.padding=[c/2,c/2,c/2,c/2],o.borderWidth=c/10,o.offset=[0,c/10+5],o.text="",o.backgroundColor=[0,0,0,0],o.borderColor=[0,0,0,0]}_simpleModelRender(e,n){const{points:r}=e,{rotation:s,scale:o,url:a}=n,l=this.dv(new Fs);this.d(this.sceneObject.components.disposableAdd(l)),l.url=a,s&&(l.rotation=s),o&&(l.scale=o),l.position=[...r]}_modelAllRender(e,n){const r=this.dv(new Fs);this.d(this.sceneObject.components.disposableAdd(r)),r.url=e,r.instances=n}_simpleParticleRender(e,n){const{points:r}=e,s=this.dv(new zf);this.d(this.sceneObject.components.disposableAdd(s)),s.position=[...r],Object.keys(n).forEach(o=>{s[o]=n[o]})}}class JD extends B{constructor(t,e,n,r){super(),this.sceneObject=t;const s=e;if(r&&ms(s,o=>{this.renderLabel(o,r)}),n)if(n.type==="simple"){const{visualVariables:o}=n;ms(s,a=>{const l=Xv(a,n,o);this.render(a,l)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;ms(s,a=>{const l=$v(a,n,o);this.render(a,l)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;ms(s,a=>{const l=Yv(a,n,o);this.render(a,l)})}else console.error("PolyLineLayer: renderer type is not supported")}render(t,e){console.log("PolyLineLayer: render",t,e),e.type==="simple-line"?this._simpleLineRender(t,e):e.type==="ESPolygonFence"?this._esPolygonFenceRender(t,e):e.type==="ESPipeFence"?this._esPipeFenceRender(t,e):e.type==="ESPath"?this._esPathRender(t,e):e.type==="ESlineInterpolationModel"?this._eslineInterpolationModelRender(t,e):e.type==="ESlineWall"?this._eslineWallRender(t,e):console.error("PolyLineLayer: symbol type is not supported")}_simpleLineRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Fi);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...n],r.stroked=!0,r.strokeColor=e.color,r.strokeWidth=e.width||1,r.allowPicking=(e==null?void 0:e.allowPicking)??!0,r.extras={selected:!1}}_esPolygonFenceRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Wf);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...n],r.height=e.height,r.materialMode=e.materialMode}_esPipeFenceRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new qf);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...n],r.height=e.height,r.width=e.width,r.materialMode=e.materialMode}_esPathRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Au),s=this.dv(new Ru);if(this.d(this.sceneObject.components.disposableAdd(r)),this.d(this.sceneObject.components.disposableAdd(s)),r.points=[...n],r.speed=e.speed,r.strokeColor=e.color,r.materialMode=e.materialMode,r.strokeWidth=e.width||1,e!=null&&e.runModel){const a=e==null?void 0:e.runSpeed,l=e==null?void 0:e.modelSymbol;let u;switch(e==null?void 0:e.runModel){case"ESHuman":u=this.dv(new Zn);break;case"ESCar":u=this.dv(new Ff);break;case"ESGltfModel":u=this.dv(new Fs)}if(this.d(this.sceneObject.components.disposableAdd(u)),l)for(let c in l)u[c]=l[c];const h=[0];for(var o=0;o<n.length-1;o+=1){const c=n[o],d=n[o+1],g=WD(c[1],c[0],d[1],d[0]);h.push(h[o]+Math.ceil(g/a)*1e3)}r.timeStamps=h,e!=null&&e.runSpeed&&(r.currentPositionChanged.don(c=>{r.currentPosition&&(u.position=r.currentPosition,r.currentRotation&&(u.rotation=r.currentRotation))}),s.startTime=0,s.stopTime=h[h.length-1],s.playing=!0,s.loop=(e==null?void 0:e.runLoop)??!0,s.currentTimeChanged.don(c=>{r.path.currentTime=c}))}}_eslineInterpolationModelRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=(e==null?void 0:e.interpolationDistance)??0;if(!r)return;const s=BD(n,r/1e3),o=this.dv(new Fs);this.d(this.sceneObject.components.disposableAdd(o)),o.url=e.url,o.instances=s.map(a=>({position:a,rotation:e.rotation,scale:e.scale}))}_eslineWallRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=e.height??0,s=e.width??0,o=e.extrudedHeight??0,a=n.map(h=>({lng:(h==null?void 0:h[0])??0,lat:(h==null?void 0:h[1])??0,alt:(h==null?void 0:h[2])??0})),l=qD(a,s).map(h=>[(h==null?void 0:h.lng)??0,(h==null?void 0:h.lat)??0,(h==null?void 0:h.alt)??0]),u=this.dv(new nl);this.d(this.sceneObject.components.disposableAdd(u)),u.height=r,u.extrudedHeight=o,u.filled=e.filled??!0,u.fillColor=e.fillColor,u.allowPicking=(e==null?void 0:e.allowPicking)??!0,u.extras={selected:!1},u.points=l}renderLabel(t,e){const{points:n}=t,r=zD(n);Hv(this.sceneObject,r,t,e)}}function $E(i,t){try{JSON.stringify(i[i.length-1])!==JSON.stringify(i[0])&&i.push(i[0]);const e=Fn(i.map(l=>Kt(l))),n=ue([i]);return OO(e,t,{gridType:"point",units:"meters"}).features.map(l=>l.geometry.coordinates)[0][0].filter(l=>_i(Kt(l),n))}catch(e){return console.error(e),[]}}class ZD extends B{constructor(t,e,n,r){super(),this.sceneObject=t;const s=e;if(r&&ms(s,o=>{this.renderLabel(o,r)}),n)if(n.type==="simple"){const{visualVariables:o}=n;ms(s,a=>{const l=Xv(a,n,o);this.render(a,l)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;ms(s,a=>{const l=$v(a,n,o);this.render(a,l)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;ms(s,a=>{const l=Yv(a,n,o);this.render(a,l)})}else console.error("PolyLineLayer: renderer type is not supported")}renderLabel(t,e){const{points:n}=t;console.log("PolygonLayer: renderLabel",n);const r=UD(n);Hv(this.sceneObject,r,t,e)}render(t,e){e.type==="simple-fill"?this._simplePolygonRender(t,e):e.type==="ESGeoExtrudedPolygon"?this._esGeoExtrudedPolygonRender(t,e):e.type==="PolygonInterpolateESGltfModel"?this._polygonInterpolateESGltfModelRender(t,e):e.type==="PolygonInterpolateESImageLabel"?this._polygonInterpolateESImageLabelRender(t,e):console.error("PolyLineLayer: symbol type is not supported")}_simplePolygonRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{color:r,outline:s,filled:o,ground:a}=e,{width:l,color:u,stroked:h}=s,c=this.dv(new Jt);this.d(this.sceneObject.components.disposableAdd(c)),c.stroked=h??!1,c.strokeColor=u??[1,1,1,1],c.strokeWidth=l??1,c.filled=o??!0,c.fillGround=a??!1,c.fillColor=r??[1,1,1,1],c.allowPicking=(e==null?void 0:e.allowPicking)??!0,c.extras={selected:!1},c.points=[...n]}_esGeoExtrudedPolygonRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,extrudedHeight:s,color:o}=e,a=this.dv(new nl);this.d(this.sceneObject.components.disposableAdd(a)),a.height=r,a.extrudedHeight=s,a.filled=!0,a.fillColor=o,a.allowPicking=(e==null?void 0:e.allowPicking)??!0,a.extras={selected:!1},a.points=[...n]}_polygonInterpolateESGltfModelRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,interpolateDistance:s,url:o,rotation:a,scale:l}=e,u=$E(n,s??10),h=this.dv(new Fs);this.d(this.sceneObject.components.disposableAdd(h)),h.url=o,h.instances=u.map(c=>({position:[...c,r??0],rotation:a??[0,0,0],scale:l??[1,1,1]}))}_polygonInterpolateESImageLabelRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,interpolateDistance:s,offset:o,size:a,url:l,anchor:u}=e,c={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:[...$E(n,s??10).map(g=>[...g,r??0])]}}]},d=this.dv(new kc);this.d(this.sceneObject.components.disposableAdd(d)),d.textDefaultText="",d.imageUrl=l,u&&(d.imageAnchor=u),o&&(d.imageOffset=o),a&&(d.imageSize=a),d.url=c}}class KD extends B{constructor(e,n){super();f(this,"_initEvent",this.dv(new O));const r=this,s=async()=>{try{const a=e.featureProps;if(!a)return;const{heightMode:l,features:u,layerType:h,url:c}=a;let d=[];if(!u&&c){let g=await fetch(c).then(p=>p.json());return g=(g==null?void 0:g.features)??g,h==="polylineVector"?d=await VE(n,g,l):h==="polygonVector"?d=await BE(n,g,l):h==="pointVector"&&(d=await zE(n,g,l)),d}else h==="polylineVector"?d=await VE(n,u,l):h==="polygonVector"?d=await BE(n,u,l):h==="pointVector"&&(d=await zE(n,u,l));return d}catch(a){console.error(a);return}},o=this.dv(Ve(this._initEvent,e.featurePropsChanged));r.dv(new qe(o,()=>{if(!e.featureProps)return;const a=e.featureProps;let l;return(async()=>{const{layerType:h,renderer:c,labelingInfo:d}=a,g=await s();!g||g.length===0||(h==="pointVector"?l=new YD(e,g,c,d):h==="polylineVector"?l=new JD(e,g,c,d):h==="polygonVector"&&(l=new ZD(e,g,c,d)),console.log("polygonVectorLayer","createLayer",l))})().catch(console.error),{destroy:()=>{var h;(h=l==null?void 0:l.destroy)==null||h.call(l),l=void 0}}}));{const a=(l,u=1)=>{const h=$1(l);if(!h)return;const{center:c,radius:d}=h;n.flyTo({distance:d*4,heading:0,pitch:-90,flyDuration:u??1,hDelta:0,pDelta:0},c)};r.d(e.flyToEvent.don(async l=>{const{featureProps:u}=e;if(!u)return;const h=await s();if(!h)return;let c=[];u.layerType==="polylineVector"?c=h.map(d=>d.points).flat():u.layerType==="polygonVector"?c=h.map(d=>d.points).flat():u.layerType==="pointVector"&&(c=h.map(d=>d.points)),c.length!==0&&a(c,l)}))}}init(){this._initEvent.emit()}}const vh=class vh extends Xt{constructor(e){super(e);f(this,"featureLayerMap",new Map);const n=this;n.d(n.viewerAttached.don(r=>{if(console.log("ESFeatureLayer","viewerAttached",r.id),n.featureLayerMap.has(r.id))return;const s=new KD(n,r);s.init(),n.featureLayerMap.set(r.id,s)})),n.d(n.viewerDetached.don(r=>{var s;console.log("ESFeatureLayer","viewerDetached",r.id),n.featureLayerMap.has(r.id)&&((s=n.featureLayerMap.get(r.id))==null||s.destroy(),n.featureLayerMap.delete(r.id))})),n.d(()=>{for(const r of n.featureLayerMap.values())r.destroy();n.featureLayerMap.clear()}),n.d(Ze(n.showChanged,()=>{for(const r of n.components.values())Reflect.has(r,"show")&&(r.show=n.show)},{immediate:!0}))}};f(vh,"createDefaultProps",()=>({...Xt.createDefaultProps(),featureProps:fe(void 0)})),f(vh,"type",vh.register("ESFeatureLayer",vh,{chsName:"矢量图层",tags:["ESObjects"],description:"ESFeatureLayer"}));let Jv=vh;const QD=[["256",256],["512",512],["1024",1024]],t4=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],Rn=class Rn extends Xt{constructor(e){super(e);f(this,"_pickFeaturesEvent",this.dv(new O));this.ad(lt([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(lt([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new mt([this,"accessToken"],"令牌",Rn.defaults.accessToken),new rr([this,"rectangle"],"矩形范围",Rn.defaults.rectangle),new Et([this,"url"],"服务地址",Rn.defaults.url),new Et([this,"style"],"样式配置",Rn.defaults.style),new D([this,"zIndex"],"层级序号",Rn.defaults.zIndex),new ft([this,"tileSize"],QD,"瓦片大小",256),new Qe([this,"maximumLevel"],1,[1,24],"最大层级",Rn.defaults.maximumLevel),new Qe([this,"minimumLevel"],1,[0,24],"最小层级",Rn.defaults.minimumLevel),new ft([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像切片规则",Rn.defaults.scheme),new ft([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考"),new mt([this,"targetID"],"targetID")],more:[...e.more,new wt("通用"),new ft([this,"splitDirection"],t4,"splitDirection","NONE"),new wt("czm"),new D([this,"czmAlpha"],"透明度"),new D([this,"czmBrightness"],"亮度"),new D([this,"czmContrast"],"对比度"),new D([this,"czmHue"],"色相"),new D([this,"czmSaturation"],"饱和度"),new D([this,"czmGamma"],"伽马值")]}}};f(Rn,"createDefaultProps",()=>({...Xt.createDefaultProps(),rectangle:fe([-180,-90,180,90]),url:bt(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:oe([]),scheme:z("xyz"),czmSplitDirection:"NONE",heightReference:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",targetID:"",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),f(Rn,"type",Rn.register("ESMVTLayer",Rn,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"用于加载矢量瓦片图层。"}));let Zv=Rn;const Zs=class Zs extends ct{constructor(t){super(t)}getESProperties(){return{...{...super.getESProperties()},basic:[new D([this,"radius"],"半径",Zs.defaults.radius),new D([this,"height"],"高度",Zs.defaults.height),new Dt([this,"color"],"颜色",Zs.defaults.color),new Et([this,"materialParams"],"材质参数",Zs.defaults.materialParams)]}}};f(Zs,"createDefaultProps",()=>({...ct.createDefaultProps(),radius:2,height:10,color:ot([.204,.596,.859,1]),materialParams:bt({ringSpeed:1,ringColor:[1,1,1,1],ringWidth:.03,sides:10,ringRatio:1,ringRepeat:1,ringBottomMove:!1})})),f(Zs,"type",Zs.register("ESCylinder",Zs,{chsName:"圆柱",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"圆柱体"}));let rl=Zs;const gs=class gs extends Lc{constructor(t){super(t)}getESProperties(){const t=super.getESProperties();return{...t,dataSource:[...t.dataSource,new ft([this,"videoStreamType"],gs.videoStreamTypes,"数据源类型",gs.defaults.videoStreamType),new X([this,"looping"],"循环播放",gs.defaults.looping),new X([this,"play"],"播放状态",gs.defaults.play)]}}};f(gs,"createDefaultProps",()=>({...Lc.createDefaultProps(),videoStreamType:"video",looping:!0,play:!0})),f(gs,"type",gs.register("ESMediaLayer",gs,{chsName:"媒体图层",tags:["ESObjects","_ES_Impl_Cesium"],description:"用于添加数据源为图片或者视频的图层"})),f(gs,"videoStreamTypes",[["video","video"],["hls","hls"],["flv","flv"],["img","img"]]);let Kv=gs;const Ks=class Ks extends Xt{constructor(e){super(e);f(this,"_getRepairPolygonEvent",this.disposeVar(new O));f(this,"_getIndicesEvent",this.disposeVar(new O));f(this,"_startEvent",this.disposeVar(new O))}getESProperties(){return{...{...super.getESProperties()},defaultMenu:"general",basic:[new Et([this,"urls"],"URL",Ks.defaults.urls),new ft([this,"mode"],Ks.modes,"模式",Ks.defaults.mode),new vt("开始编辑",()=>this.start(),[])]}}get getRepairPolygonEvent(){return this._getRepairPolygonEvent}getRepairPolygon(){return new Promise((e,n)=>{const r=new B;r.ad(this._getRepairPolygonEvent.don(o=>{o!="get"&&e(o)})),this.getRepairPolygonEvent.emit("get");const s=setTimeout(()=>{r.isDestroyed()||(r.destroy(),e(void 0))},2e3);r.ad(()=>clearTimeout(s))})}get getIndicesEvent(){return this._getIndicesEvent}getIndices(){return new Promise((e,n)=>{const r=new B;r.ad(this._getIndicesEvent.don(o=>{o!="get"&&e(o)})),this.getIndicesEvent.emit("get");const s=setTimeout(()=>{r.isDestroyed()||(r.destroy(),e(void 0))},2e3);r.ad(()=>clearTimeout(s))})}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}};f(Ks,"createDefaultProps",()=>({...Xt.createDefaultProps(),urls:oe([]),mode:"repair",allowPicking:!0})),f(Ks,"type",Ks.register("ESGltfModelEditing",Ks,{chsName:"GLTF模型编辑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载GLTF模型的 ES 对象"})),f(Ks,"modes",[["删除","delete"],["修复","repair"]]);let Qv=Ks;const Sa=class Sa extends Zn{constructor(e){super(e);f(this,"humans",[]);f(this,"humansOffset",new Map);this.ad(this.clear.bind(this)),this.updateHumans();const n=this.ad(Ve(this.instancesCountChanged,this.radiusChanged));this.ad(n.don(this.updateHumans.bind(this)))}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new D([this,"instancesCount"],"实例数量",1,Sa.defaults.instancesCount),new D([this,"radius"],"半径",1,Sa.defaults.radius)]}}updateHumans(){for(this.clear();this.humans.length+1<this.instancesCount;){const e=new Zn;this.humansOffset.set(e.id,[Math.random()*this.radius,Math.random()*this.radius,0]),this.humans.push(e),this.components.add(e),e.d(F([e,"show"],[this,"show"])),e.d(F([e,"allowPicking"],[this,"allowPicking"])),e.d(F([e,"scale"],[this,"scale"])),e.d(F([e,"collision"],[this,"collision"])),e.d(lt([e,"flyInParam"],[this,"flyInParam"])),e.d(lt([e,"flyToParam"],[this,"flyToParam"])),e.d(F([e,"animation"],[this,"animation"])),e.d(F([e,"mode"],[this,"mode"])),e.d(F([e,"minVisibleDistance"],[this,"minVisibleDistance"])),e.d(F([e,"maxVisibleDistance"],[this,"maxVisibleDistance"])),e.d(Ze([this.positionChanged],()=>{const n=bm(this.position,this.humansOffset.get(e.id)??[0,0,0]);n&&(e.position=n)},{immediate:!0})),e.d(lt([e,"rotation"],[this,"rotation"])),e.d(this.flyInEvent.don(n=>{e.flyIn(n)})),e.d(this.flyToEvent.don(n=>{e.flyTo(n)})),e.d(this.calcFlyToParamEvent.don(()=>{e.calcFlyToParam()})),e.d(this.calcFlyInParamEvent.don(()=>{e.calcFlyInParam()})),e.d(this.smoothMoveEvent.don((n,r)=>{e.smoothMove(n,r)})),e.d(this.smoothMoveWithRotationEvent.don((n,r,s)=>{e.smoothMoveWithRotation(n,r,s)})),e.d(this.smoothMoveOnGroundEvent.don((n,r,s,o)=>{e.smoothMoveOnGround(n,r,s,o)})),e.d(this.smoothMoveWithRotationOnGroundEvent.don((n,r,s,o,a)=>{e.smoothMoveWithRotationOnGround(n,r,s,o,a)})),e.d(this.automaticLandingEvent.don(()=>{e.automaticLanding()})),e.d(e.readyEvent.don(n=>{this.readyEvent.emit(n)}))}}clear(){this.humans.forEach(e=>{this.components.delete(e)}),this.humans=[],this.humansOffset.clear()}};f(Sa,"createDefaultProps",()=>({...Zn.createDefaultProps(),instancesCount:1,radius:1})),f(Sa,"type",Sa.register("ESHumans",Sa,{chsName:"人员(批量)",tags:["ESObjects"],description:"批量创建ESHumans对象"}));let t0=Sa;const Tl=class Tl extends Fi{constructor(e){super(e);f(this,"_line",this.ad(new Fi));f(this,"_arrowPolygon",this.ad(new Jt));this.ad(this.components.disposableAdd(this.line,!0)),this.line.show=!1,this.ad(this.components.disposableAdd(this.arrowPolygon));const{line:n,arrowPolygon:r}=this;this.ad(lt([n,"points"],[this,"points"])),this.ad(Ze([this.pointsChanged,this.modeChanged],()=>{this.updateArrowPolygon()},{immediate:!0})),this.ad(F([r,"show"],[this,"show"])),this.ad(F([r,"collision"],[this,"collision"])),this.ad(F([r,"allowPicking"],[this,"allowPicking"])),this.ad(F([r,"filled"],[this,"filled"])),this.ad(F([r,"fillGround"],[this,"fillGround"])),this.ad(F([r,"fillColor"],[this,"fillColor"])),this.ad(F([r,"fillMaterial"],[this,"fillMaterial"])),this.ad(F([r,"fillMaterialParams"],[this,"fillMaterialParams"])),this.ad(F([r,"stroked"],[this,"stroked"])),this.ad(F([r,"strokeGround"],[this,"strokeGround"])),this.ad(F([r,"strokeColor"],[this,"strokeColor"])),this.ad(F([r,"strokeMaterial"],[this,"strokeMaterial"])),this.ad(F([r,"strokeMaterialParams"],[this,"strokeMaterialParams"])),this.ad(F([r,"strokeWidth"],[this,"strokeWidth"])),this.ad(F([r,"strokeWidthType"],[this,"strokeWidthType"])),this.ad(F([r,"classificationType"],[this,"classificationType"]))}get line(){return this._line}get arrowPolygon(){return this._arrowPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,style:[...e.style,new ft([this,"mode"],ep,"箭头模式",Tl.defaults.mode)]}}updateArrowPolygon(){const e=this.points;if(!e||e.length<3){this._arrowPolygon.points=[];return}let n=Tm(e,this.mode,!0);n&&n.length>=3?this._arrowPolygon.points=[...n,n[0]]:this._arrowPolygon.points=[]}};f(Tl,"createDefaultProps",()=>({...Fi.createDefaultProps(),mode:"straightArrow",stroked:!1,filled:!0,fillStyle:bt({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),f(Tl,"type",Tl.register("ESAttackArrow",Tl,{chsName:"进攻箭头",tags:["ESObjects","_ES_Impl_Cesium"],description:"进攻箭头,军事标绘箭头类,支持直箭头和燕尾箭头"}));let e0=Tl;const Nl=class Nl extends Fs{constructor(e){super(e);f(this,"esCylinder",this.dv(new rl));const n=this.esCylinder;n.color=[1,1,1,0],this.ad(this.components.disposableAdd(this.esCylinder)),this.ad(F([n,"show"],[this,"show"])),this.ad(F([n,"collision"],[this,"collision"])),this.ad(F([n,"allowPicking"],[this,"allowPicking"])),this.ad(F([n,"position"],[this,"position"])),this.ad(F([n,"radius"],[this,"esCylinderRadius"])),this.ad(F([n,"height"],[this,"esCylinderHeight"])),this.ad(F([n,"materialParams"],[this,"esCylinderMaterialParams"])),this.ad(Ze(this.esCylinderRotationChanged,()=>{const r=this.esCylinderRotation;n.rotation=[r[0],r[1]-180,r[2]]},{immediate:!0}))}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new Ah([this,"esCylinderRotation"],"波动方向",Nl.defaults.esCylinderRotation),new D([this,"esCylinderRadius"],"半径",rl.defaults.esCylinderRadius),new D([this,"esCylinderHeight"],"高度",rl.defaults.esCylinderHeight),new Et([this,"esCylinderMaterialParams"],"材质参数",rl.defaults.esCylinderMaterialParams)]}}};f(Nl,"createDefaultProps",()=>({...Fs.createDefaultProps(),url:"${earthsdk3-assets-script-dir}/assets/glb/CesiumDrone.glb",esCylinderRotation:ot([0,0,0]),esCylinderRadius:2,esCylinderHeight:10,esCylinderMaterialParams:bt({ringSpeed:1,ringColor:[1,1,0,1],ringWidth:.03,sides:10,ringRatio:1,ringRepeat:10,ringBottomMove:!0})})),f(Nl,"type",Nl.register("ESSignalInterference",Nl,{chsName:"信号干扰",tags:["ESObjects"],description:"信号干扰"}));let i0=Nl;const To=class To extends B{constructor(){super();f(this,"_loading",!1);f(this,"_loadedEvent",this.disposeVar(new O));f(this,"_loaded",!1);f(this,"_loadedPromiseResolve");f(this,"_loadedPromise",new Promise(e=>{this._loadedPromiseResolve=e}));f(this,"_processing");this._processing=this.disposeVar(Ln(async e=>{if(this._loading=!0,window.Hls)console.info("可能系统已经加载hlsjs,此处不再加载!");else{const n=pt.context.getStrFromEnv(To.path);await e.promise(Mg(n))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})),this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return To._instance=To._instance||new To,To._instance}};f(To,"path","${xr-utils-script-dir}/xr-static/xr-utils/hlsjs/1.4.12/hls.min.js"),f(To,"_instance");let Zf=To,e4=class extends B{constructor(e,n){super();f(this,"_element");this._complexImage=e,this._videoSrc=n;var r=document.createElement("video");r.src=this._videoSrc,r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.zIndex="-100",r.style.visibility="hidden";{const s=()=>{r.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{r.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{r.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}r.muted=!0,document.body.appendChild(r),this._element=r,this.dispose(()=>document.body.removeChild(r))}get element(){return this._element}};class i4 extends B{constructor(e,n){super();f(this,"_videoDom");f(this,"_processing");this._complexImage=e,this._videoSrc=n,this._videoDom=this.disposeVar(new e4(this._complexImage,"")),this._processing=this.disposeVar(Ln(async r=>{const{videoSrc:s}=this,o=Zf.instance();await r.promise(o.loadedPromise);const a=window.Hls,l=new a,u=this.element;await Ia(r,()=>new Promise((h,c)=>{u.xbsjHLS=l,l.attachMedia(u),l.on(a.Events.MEDIA_ATTACHED,()=>{l.loadSource(s),l.on(a.Events.MANIFEST_PARSED,(d,g)=>{u.play(),h()})}),l.on(a.Events.ERROR,(d,g)=>{const{type:p,details:E,fatal:b}=g;b&&(l.destroy(),c(E))})}))})),this._processing.start()}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class YE extends B{constructor(e,n){super();f(this,"_videoDom");f(this,"_update");this._complexImage=e,this._imageUri=n,this._videoDom=this.disposeVar(new i4(this._complexImage,this._imageUri)),this._update=this.disposeVar(zl(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:n,videoHeight:r}=this.videoElement;e.size=[n,r],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}const No=class No extends B{constructor(){super();f(this,"_loading",!1);f(this,"_loadedEvent",this.disposeVar(new O));f(this,"_loaded",!1);f(this,"_loadedPromiseResolve");f(this,"_loadedPromise",new Promise(e=>{this._loadedPromiseResolve=e}));f(this,"_processing");this._processing=this.disposeVar(Ln(async e=>{if(this._loading=!0,window.flvjs)console.info("可能系统已经加载flvjs,此处不再加载!");else{const n=pt.context.getStrFromEnv(No.path);await e.promise(Mg(n))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})),this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return No._instance=No._instance||new No,No._instance}};f(No,"path","${xr-utils-script-dir}/xr-static/xr-utils/flvjs/1.6.2/flv.min.js"),f(No,"_instance");let Kf=No;class n4 extends B{constructor(e,n){super();f(this,"_element");this._complexImage=e,this._videoSrc=n;var r=document.createElement("video");r.src=this._videoSrc,r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.zIndex="-100",r.style.visibility="hidden";{const s=()=>{r.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{r.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{r.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}r.muted=!0,document.body.appendChild(r),this._element=r,this.dispose(()=>document.body.removeChild(r))}get element(){return this._element}}class r4 extends B{constructor(e,n){super();f(this,"_videoDom");f(this,"_processing");this._complexImage=e,this._videoSrc=n,this._videoDom=this.disposeVar(new n4(this._complexImage,"")),this._processing=this.disposeVar(Ln(async r=>{const{videoSrc:s}=this,o=Kf.instance();await r.promise(o.loadedPromise);const a=window.flvjs,l=this.element;await Ia(r,()=>new Promise((u,h)=>{if(!a.isSupported()){h("flvjs不支持!");return}var c=a.createPlayer({type:"flv",url:s});c.attachMediaElement(l),c.load(),c.play(),l.xbsjFlvPlayer=c}))})),this._processing.start()}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class JE extends B{constructor(e,n){super();f(this,"_videoDom");f(this,"_update");this._complexImage=e,this._imageUri=n,this._videoDom=this.disposeVar(new r4(e,this._imageUri)),this._update=this.disposeVar(zl(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:n,videoHeight:r}=this.videoElement;e.size=[n,r],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}function ZE(i){const t=i.substring(i.lastIndexOf(".")+1);return Bc.suffixTypes[t]}class Bc extends B{constructor(){super();f(this,"_enabled",this.disposeVar(z(!1)));f(this,"_uri",this.disposeVar(z("")));f(this,"_type",this.disposeVar(z(void 0)));f(this,"_size",this.disposeVar(oe(void 0)));f(this,"_pixelFormat",this.disposeVar(z("RGBA")));f(this,"_flipY",this.disposeVar(z(!0)));f(this,"_crossOriginReact",this.disposeVar(z("")));f(this,"_autoplayReact",this.disposeVar(z(!0)));f(this,"_loopReact",this.disposeVar(z(!0)));f(this,"_copyTextureEvent",this.disposeVar(new O));f(this,"_imageProcessingResettingEvent",this.disposeVar(Ve(this.enabledChanged,this.uriChanged,this.typeChanged)));f(this,"_imageProcessingResetting",this.disposeVar(new qe(this._imageProcessingResettingEvent,()=>{if(!this.enabled||!this.uri)return;let{type:e}=this;if(e||(e=ZE(this.uri)),!!e){if(e==="img")return new uy(this,this.uri);if(e==="video")return new dy(this,this.uri);if(e==="gif")return new Sy(this,this.uri);if(e==="hls")return new YE(this,this.uri);if(e==="flv")return new JE(this,this.uri)}})));f(this,"_createNativeTextureEvent",this.disposeVar(Ve(this.enabledChanged,this.sizeChanged,this.pixelFormatChanged,this.flipYChanged)))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get uri(){return this._uri.value}set uri(e){this._uri.value=e}get uriChanged(){return this._uri.changed}get type(){return this._type.value}set type(e){this._type.value=e}get typeChanged(){return this._type.changed}get size(){return this._size.value}set size(e){this._size.value=e}get sizeChanged(){return this._size.changed}get pixelFormat(){return this._pixelFormat.value}set pixelFormat(e){this._pixelFormat.value=e}get pixelFormatChanged(){return this._pixelFormat.changed}get flipY(){return this._flipY.value}set flipY(e){this._flipY.value=e}get flipYChanged(){return this._flipY.changed}get crossOrigin(){return this._crossOriginReact.value}set crossOrigin(e){this._crossOriginReact.value=e}get crossOriginChanged(){return this._crossOriginReact.changed}get autoplay(){return this._autoplayReact.value}set autoplay(e){this._autoplayReact.value=e}get autoplayChanged(){return this._autoplayReact.changed}get loop(){return this._loopReact.value}set loop(e){this._loopReact.value=e}get loopChanged(){return this._loopReact.changed}get copyTextureEvent(){return this._copyTextureEvent}copyTexture(e){this._createNativeTextureEvent.flush(),this._copyTextureEvent.emit(e)}get imageProcessingResetting(){return this._imageProcessingResetting}get createNativeTextureEvent(){return this._createNativeTextureEvent}copyFromCanvas(e){if(e.width<=0||e.height<=0){console.warn("canvas.width <= 0 || canvas.height <= 0");return}this.size=[e.width,e.height],this.pixelFormat="RGBA",this.copyTexture({source:e})}}f(Bc,"types",cy),f(Bc,"czmPixelFormats",hy),f(Bc,"suffixTypes",{png:"img",jpg:"img",svg:"img",webp:"img",gif:"gif",mp4:"video",mov:"video",webm:"video",flv:"flv",m3u8:"hls"});const s4=[0,0,0,0];class o4{constructor(){f(this,"_value",[]);f(this,"_valueStr","[]");f(this,"_valueChanged");this.value=[{ratio:0,rgba:[0,0,1,1]},{ratio:.2,rgba:[0,1,0,1]},{ratio:.8,rgba:[1,1,0,1]},{ratio:1,rgba:[1,0,0,1]}]}get valueChanged(){return this._valueChanged||(this._valueChanged=new O),this._valueChanged}set value(t){if(t.length===0){console.error("value.length === 0");return}let e;if(this._value.length===t.length){const r=[...t].sort((s,o)=>s.ratio-o.ratio);if(e=JSON.stringify(r),this._valueStr===e)return}e=e||JSON.stringify([...t].sort((r,s)=>r.ratio-s.ratio));const n=this._value;if(this._value=JSON.parse(e),this._value.length===0)throw console.error("this._colorStops.length === 0"),new Error("this._colorStops.length === 0");this._valueChanged&&this._valueChanged.emit(this._value,n)}get value(){return JSON.parse(JSON.stringify(this._value))}get valueStr(){return this._valueStr}get minRatio(){return this._value[0].ratio}get maxRatio(){return this._value[this._value.length-1].ratio}_getRatioIndex(t){if(t<this._value[0].ratio||t>this._value[this._value.length-1].ratio)throw console.error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio"),new Error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio");let e=this._value.length;for(let n=0;n<e-1;++n)if(t>=this._value[n].ratio&&t<=this._value[n+1].ratio)return n;throw console.error("shoud not be here!"),new Error("shoud not be here!")}getRatioColor(t,e){t=vd(t,this.minRatio,this.maxRatio);const n=this._getRatioIndex(t),r=this._value[n],s=this._value[n+1],o=(t-r.ratio)/(s.ratio-r.ratio);for(let a=0;a<4;++a)e[a]=r.rgba[a]*(1-o)+s.rgba[a]*o;if(e.some(Number.isNaN)){console.error("result NaN");return}return e}getColorsInUint8(t){if(t.length%4!==0)throw console.error("result.length % 4 !== 0"),new Error("result.length % 4 !== 0");const e=t.length/4,n=1/e;for(let r=0;r<e;++r){const s=s4;this.getRatioColor((r+.5)*n,s)||s.splice(0,4,0,0,0,0);for(let o=0;o<4;++o)t[r*4+o]=255*s[o]|0}return t}}class a4 extends B{constructor(){super(...arguments);f(this,"registerEngines",{})}register(e,n,r){const s=this.registerEngines[e]||new Map;return s.has(n)&&console.warn(`register warn:${e}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,r),this.registerEngines[e]=s,n}getEngineObjConstructor(e,n){const r=this.registerEngines[n];if(!r)return;let s=e.constructor,o=e.typeName,a=r.get(o);if(a)return a;if(e.components.main)return;const l=o;for(;o!=="ESSceneObject"&&(s=s.getParentClass(),!!s);)if(o=s.type,a=r.get(o),a)return console.warn(`未找到${l}在${n}中对应的实现类! 使用父类${o}的实现类!`),a}createEngineObject(e,n){const r=this.getEngineObjConstructor(e,n.typeName);if(r){const s=new r(e,n);return s.createdEvent.emit(),s}else{const s=new sl(e,n);return s.createdEvent.emit(),s}}}class l4 extends B{constructor(){super(...arguments);f(this,"registerEngines",{})}register(e,n,r){const s=this.registerEngines[e]||new Map;s.has(n)&&console.warn(`register warn:${e}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,r),this.registerEngines[e]=s}getEngineObjConstructor(e,n){const s=(this.registerEngines[n]||new Map).get(e);if(s)return s;console.warn(`未找到${e}在${n}中对应的实现类!`)}createEngineObject(e,n){const r=this.getEngineObjConstructor(e.typeName,n.typeName);if(r){const s=new r(e,n);return s.createdEvent.emit(),s}else{const s=new sl(e,n);return s.createdEvent.emit(),s}}}const Lr=class Lr extends B{constructor(e,n,r=!1){super();f(this,"_createdEvent",this.dv(new O));f(this,"_id",++Lr._accumId);this._sceneObject=e,this._viewer=n;{if(r)return;const s=(o,a)=>{for(let l of o)this._viewer.delete(l);for(let l of a)l.parentID=this.sceneObject.id,this._viewer.add(l)};s([],this._sceneObject.components.values()),this.d(this._sceneObject.components.toChange.don(s)),this.d(()=>s(this._sceneObject.components.values(),[]))}}get createdEvent(){return this._createdEvent}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get id(){return this._id}};f(Lr,"context",new a4),f(Lr,"contextEditing",new l4),f(Lr,"register",Lr.context.register.bind(Lr.context)),f(Lr,"registerEditing",Lr.contextEditing.register.bind(Lr.contextEditing)),f(Lr,"_accumId",-1);let sl=Lr;var Zt;(function(i){i.assertEqual=r=>{};function t(r){}i.assertIs=t;function e(r){throw new Error}i.assertNever=e,i.arrayToEnum=r=>{const s={};for(const o of r)s[o]=o;return s},i.getValidEnumValues=r=>{const s=i.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),o={};for(const a of s)o[a]=r[a];return i.objectValues(o)},i.objectValues=r=>i.objectKeys(r).map(function(s){return r[s]}),i.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&s.push(o);return s},i.find=(r,s)=>{for(const o of r)if(s(o))return o},i.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function n(r,s=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}i.joinValues=n,i.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(Zt||(Zt={}));var n0;(function(i){i.mergeShapes=(t,e)=>({...t,...e})})(n0||(n0={}));const ut=Zt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Eo=i=>{switch(typeof i){case"undefined":return ut.undefined;case"string":return ut.string;case"number":return Number.isNaN(i)?ut.nan:ut.number;case"boolean":return ut.boolean;case"function":return ut.function;case"bigint":return ut.bigint;case"symbol":return ut.symbol;case"object":return Array.isArray(i)?ut.array:i===null?ut.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?ut.promise:typeof Map<"u"&&i instanceof Map?ut.map:typeof Set<"u"&&i instanceof Set?ut.set:typeof Date<"u"&&i instanceof Date?ut.date:ut.object;default:return ut.unknown}},Y=Zt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),u4=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:");class Kn extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=t}format(t){const e=t||function(s){return s.message},n={_errors:[]},r=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)n._errors.push(e(o));else{let a=n,l=0;for(;l<o.path.length;){const u=o.path[l];l===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(e(o))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return r(this),n}static assert(t){if(!(t instanceof Kn))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Zt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=e=>e.message){const e={},n=[];for(const r of this.issues)if(r.path.length>0){const s=r.path[0];e[s]=e[s]||[],e[s].push(t(r))}else n.push(t(r));return{formErrors:n,fieldErrors:e}}get formErrors(){return this.flatten()}}Kn.create=i=>new Kn(i);const Fu=(i,t)=>{let e;switch(i.code){case Y.invalid_type:i.received===ut.undefined?e="Required":e=`Expected ${i.expected}, received ${i.received}`;break;case Y.invalid_literal:e=`Invalid literal value, expected ${JSON.stringify(i.expected,Zt.jsonStringifyReplacer)}`;break;case Y.unrecognized_keys:e=`Unrecognized key(s) in object: ${Zt.joinValues(i.keys,", ")}`;break;case Y.invalid_union:e="Invalid input";break;case Y.invalid_union_discriminator:e=`Invalid discriminator value. Expected ${Zt.joinValues(i.options)}`;break;case Y.invalid_enum_value:e=`Invalid enum value. Expected ${Zt.joinValues(i.options)}, received '${i.received}'`;break;case Y.invalid_arguments:e="Invalid function arguments";break;case Y.invalid_return_type:e="Invalid function return type";break;case Y.invalid_date:e="Invalid date";break;case Y.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(e=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(e=`${e} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?e=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?e=`Invalid input: must end with "${i.validation.endsWith}"`:Zt.assertNever(i.validation):i.validation!=="regex"?e=`Invalid ${i.validation}`:e="Invalid";break;case Y.too_small:i.type==="array"?e=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?e=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?e=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="bigint"?e=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?e=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:e="Invalid input";break;case Y.too_big:i.type==="array"?e=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?e=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?e=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?e=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?e=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:e="Invalid input";break;case Y.custom:e="Invalid input";break;case Y.invalid_intersection_types:e="Intersection results could not be merged";break;case Y.not_multiple_of:e=`Number must be a multiple of ${i.multipleOf}`;break;case Y.not_finite:e="Number must be finite";break;default:e=t.defaultError,Zt.assertNever(i)}return{message:e}};let KE=Fu;function h4(i){KE=i}function Qf(){return KE}const tg=i=>{const{data:t,path:e,errorMaps:n,issueData:r}=i,s=[...e,...r.path||[]],o={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let a="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:t,defaultError:a}).message;return{...r,path:s,message:a}},c4=[];function st(i,t){const e=Qf(),n=tg({issueData:t,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,e,e===Fu?void 0:Fu].filter(r=>!!r)});i.common.issues.push(n)}class Yi{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,e){const n=[];for(const r of e){if(r.status==="aborted")return Mt;r.status==="dirty"&&t.dirty(),n.push(r.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,e){const n=[];for(const r of e){const s=await r.key,o=await r.value;n.push({key:s,value:o})}return Yi.mergeObjectSync(t,n)}static mergeObjectSync(t,e){const n={};for(const r of e){const{key:s,value:o}=r;if(s.status==="aborted"||o.status==="aborted")return Mt;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(n[s.value]=o.value)}return{status:t.value,value:n}}}const Mt=Object.freeze({status:"aborted"}),ku=i=>({status:"dirty",value:i}),pn=i=>({status:"valid",value:i}),r0=i=>i.status==="aborted",s0=i=>i.status==="dirty",ol=i=>i.status==="valid",Uc=i=>typeof Promise<"u"&&i instanceof Promise;var yt;(function(i){i.errToObj=t=>typeof t=="string"?{message:t}:t||{},i.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(yt||(yt={}));class ks{constructor(t,e,n,r){this._cachedPath=[],this.parent=t,this.data=e,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const QE=(i,t)=>{if(ol(t))return{success:!0,data:t.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const e=new Kn(i.common.issues);return this._error=e,this._error}}};function Ft(i){if(!i)return{};const{errorMap:t,invalid_type_error:e,required_error:n,description:r}=i;if(t&&(e||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(o,a)=>{const{message:l}=i;return o.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??n??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:l??e??a.defaultError}},description:r}}class jt{get description(){return this._def.description}_getType(t){return Eo(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:Eo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Yi,ctx:{common:t.parent.common,data:t.data,parsedType:Eo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const e=this._parse(t);if(Uc(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(t){const e=this._parse(t);return Promise.resolve(e)}parse(t,e){const n=this.safeParse(t,e);if(n.success)return n.data;throw n.error}safeParse(t,e){const n={common:{issues:[],async:(e==null?void 0:e.async)??!1,contextualErrorMap:e==null?void 0:e.errorMap},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Eo(t)},r=this._parseSync({data:t,path:n.path,parent:n});return QE(n,r)}"~validate"(t){var n,r;const e={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Eo(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:e});return ol(s)?{value:s.value}:{issues:e.common.issues}}catch(s){(r=(n=s==null?void 0:s.message)==null?void 0:n.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),e.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:e}).then(s=>ol(s)?{value:s.value}:{issues:e.common.issues})}async parseAsync(t,e){const n=await this.safeParseAsync(t,e);if(n.success)return n.data;throw n.error}async safeParseAsync(t,e){const n={common:{issues:[],contextualErrorMap:e==null?void 0:e.errorMap,async:!0},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Eo(t)},r=this._parse({data:t,path:n.path,parent:n}),s=await(Uc(r)?r:Promise.resolve(r));return QE(n,s)}refine(t,e){const n=r=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(r):e;return this._refinement((r,s)=>{const o=t(r),a=()=>s.addIssue({code:Y.custom,...n(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,e){return this._refinement((n,r)=>t(n)?!0:(r.addIssue(typeof e=="function"?e(n,r):e),!1))}_refinement(t){return new is({schema:this,typeName:Z.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return js.create(this,this._def)}nullable(){return ca.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return es.create(this)}promise(){return zu.create(this,this._def)}or(t){return Xc.create([this,t],this._def)}and(t){return $c.create(this,t,this._def)}transform(t){return new is({...Ft(this._def),schema:this,typeName:Z.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const e=typeof t=="function"?t:()=>t;return new Qc({...Ft(this._def),innerType:this,defaultValue:e,typeName:Z.ZodDefault})}brand(){return new l0({typeName:Z.ZodBranded,type:this,...Ft(this._def)})}catch(t){const e=typeof t=="function"?t:()=>t;return new td({...Ft(this._def),innerType:this,catchValue:e,typeName:Z.ZodCatch})}describe(t){const e=this.constructor;return new e({...this._def,description:t})}pipe(t){return ed.create(this,t)}readonly(){return id.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const d4=/^c[^\s-]{8,}$/i,f4=/^[0-9a-z]+$/,g4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,p4=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,m4=/^[a-z0-9_-]{21}$/i,v4=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,y4=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_4=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,w4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let o0;const E4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,S4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,b4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,C4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,P4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,x4=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,tS="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",I4=new RegExp(`^${tS}$`);function eS(i){let t="[0-5]\\d";i.precision?t=`${t}\\.\\d{${i.precision}}`:i.precision==null&&(t=`${t}(\\.\\d+)?`);const e=i.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e}`}function M4(i){return new RegExp(`^${eS(i)}$`)}function iS(i){let t=`${tS}T${eS(i)}`;const e=[];return e.push(i.local?"Z?":"Z"),i.offset&&e.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${e.join("|")})`,new RegExp(`^${t}$`)}function T4(i,t){return!!((t==="v4"||!t)&&E4.test(i)||(t==="v6"||!t)&&b4.test(i))}function N4(i,t){if(!v4.test(i))return!1;try{const[e]=i.split(".");if(!e)return!1;const n=e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(4-e.length%4)%4,"="),r=JSON.parse(atob(n));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function O4(i,t){return!!((t==="v4"||!t)&&S4.test(i)||(t==="v6"||!t)&&C4.test(i))}class ts extends jt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ut.string){const s=this._getOrReturnCtx(t);return st(s,{code:Y.invalid_type,expected:ut.string,received:s.parsedType}),Mt}const n=new Yi;let r;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(r=this._getOrReturnCtx(t,r),st(r,{code:Y.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(r=this._getOrReturnCtx(t,r),st(r,{code:Y.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,a=t.data.length<s.value;(o||a)&&(r=this._getOrReturnCtx(t,r),o?st(r,{code:Y.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&st(r,{code:Y.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")_4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"email",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")o0||(o0=new RegExp(w4,"u")),o0.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"emoji",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")p4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"uuid",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")m4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"nanoid",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")d4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"cuid",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")f4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"cuid2",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")g4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"ulid",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),st(r,{validation:"url",code:Y.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"regex",code:Y.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?iS(s).test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?I4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?M4(s).test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?y4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"duration",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?T4(t.data,s.version)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"ip",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?N4(t.data,s.alg)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"jwt",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?O4(t.data,s.version)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"cidr",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?P4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"base64",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?x4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"base64url",code:Y.invalid_string,message:s.message}),n.dirty()):Zt.assertNever(s);return{status:n.value,value:t.data}}_regex(t,e,n){return this.refinement(r=>t.test(r),{validation:e,code:Y.invalid_string,...yt.errToObj(n)})}_addCheck(t){return new ts({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...yt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...yt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...yt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...yt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...yt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...yt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...yt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...yt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...yt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...yt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...yt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...yt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...yt.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...yt.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...yt.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...yt.errToObj(t)})}regex(t,e){return this._addCheck({kind:"regex",regex:t,...yt.errToObj(e)})}includes(t,e){return this._addCheck({kind:"includes",value:t,position:e==null?void 0:e.position,...yt.errToObj(e==null?void 0:e.message)})}startsWith(t,e){return this._addCheck({kind:"startsWith",value:t,...yt.errToObj(e)})}endsWith(t,e){return this._addCheck({kind:"endsWith",value:t,...yt.errToObj(e)})}min(t,e){return this._addCheck({kind:"min",value:t,...yt.errToObj(e)})}max(t,e){return this._addCheck({kind:"max",value:t,...yt.errToObj(e)})}length(t,e){return this._addCheck({kind:"length",value:t,...yt.errToObj(e)})}nonempty(t){return this.min(1,yt.errToObj(t))}trim(){return new ts({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ts({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ts({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxLength(){let t=null;for(const e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}}ts.create=i=>new ts({checks:[],typeName:Z.ZodString,coerce:(i==null?void 0:i.coerce)??!1,...Ft(i)});function D4(i,t){const e=(i.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,r=e>n?e:n,s=Number.parseInt(i.toFixed(r).replace(".","")),o=Number.parseInt(t.toFixed(r).replace(".",""));return s%o/10**r}class la extends jt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ut.number){const s=this._getOrReturnCtx(t);return st(s,{code:Y.invalid_type,expected:ut.number,received:s.parsedType}),Mt}let n;const r=new Yi;for(const s of this._def.checks)s.kind==="int"?Zt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),st(n,{code:Y.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?D4(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),st(n,{code:Y.not_finite,message:s.message}),r.dirty()):Zt.assertNever(s);return{status:r.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,yt.toString(e))}gt(t,e){return this.setLimit("min",t,!1,yt.toString(e))}lte(t,e){return this.setLimit("max",t,!0,yt.toString(e))}lt(t,e){return this.setLimit("max",t,!1,yt.toString(e))}setLimit(t,e,n,r){return new la({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:n,message:yt.toString(r)}]})}_addCheck(t){return new la({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:yt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:yt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:yt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:yt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:yt.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:yt.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:yt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:yt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:yt.toString(t)})}get minValue(){let t=null;for(const e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(const e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Zt.isInteger(t.value))}get isFinite(){let t=null,e=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(e===null||n.value>e)&&(e=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(e)&&Number.isFinite(t)}}la.create=i=>new la({checks:[],typeName:Z.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...Ft(i)});class ua extends jt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ut.bigint)return this._getInvalidInput(t);let n;const r=new Yi;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):Zt.assertNever(s);return{status:r.value,value:t.data}}_getInvalidInput(t){const e=this._getOrReturnCtx(t);return st(e,{code:Y.invalid_type,expected:ut.bigint,received:e.parsedType}),Mt}gte(t,e){return this.setLimit("min",t,!0,yt.toString(e))}gt(t,e){return this.setLimit("min",t,!1,yt.toString(e))}lte(t,e){return this.setLimit("max",t,!0,yt.toString(e))}lt(t,e){return this.setLimit("max",t,!1,yt.toString(e))}setLimit(t,e,n,r){return new ua({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:n,message:yt.toString(r)}]})}_addCheck(t){return new ua({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:yt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:yt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:yt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:yt.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:yt.toString(e)})}get minValue(){let t=null;for(const e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(const e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}}ua.create=i=>new ua({checks:[],typeName:Z.ZodBigInt,coerce:(i==null?void 0:i.coerce)??!1,...Ft(i)});class qc extends jt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ut.boolean){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.boolean,received:n.parsedType}),Mt}return pn(t.data)}}qc.create=i=>new qc({typeName:Z.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...Ft(i)});class al extends jt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ut.date){const s=this._getOrReturnCtx(t);return st(s,{code:Y.invalid_type,expected:ut.date,received:s.parsedType}),Mt}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return st(s,{code:Y.invalid_date}),Mt}const n=new Yi;let r;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(r=this._getOrReturnCtx(t,r),st(r,{code:Y.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(r=this._getOrReturnCtx(t,r),st(r,{code:Y.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Zt.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new al({...this._def,checks:[...this._def.checks,t]})}min(t,e){return this._addCheck({kind:"min",value:t.getTime(),message:yt.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:yt.toString(e)})}get minDate(){let t=null;for(const e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t!=null?new Date(t):null}}al.create=i=>new al({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:Z.ZodDate,...Ft(i)});class eg extends jt{_parse(t){if(this._getType(t)!==ut.symbol){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.symbol,received:n.parsedType}),Mt}return pn(t.data)}}eg.create=i=>new eg({typeName:Z.ZodSymbol,...Ft(i)});class Wc extends jt{_parse(t){if(this._getType(t)!==ut.undefined){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.undefined,received:n.parsedType}),Mt}return pn(t.data)}}Wc.create=i=>new Wc({typeName:Z.ZodUndefined,...Ft(i)});class Hc extends jt{_parse(t){if(this._getType(t)!==ut.null){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.null,received:n.parsedType}),Mt}return pn(t.data)}}Hc.create=i=>new Hc({typeName:Z.ZodNull,...Ft(i)});class Gu extends jt{constructor(){super(...arguments),this._any=!0}_parse(t){return pn(t.data)}}Gu.create=i=>new Gu({typeName:Z.ZodAny,...Ft(i)});class ll extends jt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return pn(t.data)}}ll.create=i=>new ll({typeName:Z.ZodUnknown,...Ft(i)});class So extends jt{_parse(t){const e=this._getOrReturnCtx(t);return st(e,{code:Y.invalid_type,expected:ut.never,received:e.parsedType}),Mt}}So.create=i=>new So({typeName:Z.ZodNever,...Ft(i)});class ig extends jt{_parse(t){if(this._getType(t)!==ut.undefined){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.void,received:n.parsedType}),Mt}return pn(t.data)}}ig.create=i=>new ig({typeName:Z.ZodVoid,...Ft(i)});class es extends jt{_parse(t){const{ctx:e,status:n}=this._processInputParams(t),r=this._def;if(e.parsedType!==ut.array)return st(e,{code:Y.invalid_type,expected:ut.array,received:e.parsedType}),Mt;if(r.exactLength!==null){const o=e.data.length>r.exactLength.value,a=e.data.length<r.exactLength.value;(o||a)&&(st(e,{code:o?Y.too_big:Y.too_small,minimum:a?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&e.data.length<r.minLength.value&&(st(e,{code:Y.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&e.data.length>r.maxLength.value&&(st(e,{code:Y.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),e.common.async)return Promise.all([...e.data].map((o,a)=>r.type._parseAsync(new ks(e,o,e.path,a)))).then(o=>Yi.mergeArray(n,o));const s=[...e.data].map((o,a)=>r.type._parseSync(new ks(e,o,e.path,a)));return Yi.mergeArray(n,s)}get element(){return this._def.type}min(t,e){return new es({...this._def,minLength:{value:t,message:yt.toString(e)}})}max(t,e){return new es({...this._def,maxLength:{value:t,message:yt.toString(e)}})}length(t,e){return new es({...this._def,exactLength:{value:t,message:yt.toString(e)}})}nonempty(t){return this.min(1,t)}}es.create=(i,t)=>new es({type:i,minLength:null,maxLength:null,exactLength:null,typeName:Z.ZodArray,...Ft(t)});function ju(i){if(i instanceof ke){const t={};for(const e in i.shape){const n=i.shape[e];t[e]=js.create(ju(n))}return new ke({...i._def,shape:()=>t})}else return i instanceof es?new es({...i._def,type:ju(i.element)}):i instanceof js?js.create(ju(i.unwrap())):i instanceof ca?ca.create(ju(i.unwrap())):i instanceof Gs?Gs.create(i.items.map(t=>ju(t))):i}class ke extends jt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),e=Zt.objectKeys(t);return this._cached={shape:t,keys:e},this._cached}_parse(t){if(this._getType(t)!==ut.object){const u=this._getOrReturnCtx(t);return st(u,{code:Y.invalid_type,expected:ut.object,received:u.parsedType}),Mt}const{status:n,ctx:r}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof So&&this._def.unknownKeys==="strip"))for(const u in r.data)o.includes(u)||a.push(u);const l=[];for(const u of o){const h=s[u],c=r.data[u];l.push({key:{status:"valid",value:u},value:h._parse(new ks(r,c,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof So){const u=this._def.unknownKeys;if(u==="passthrough")for(const h of a)l.push({key:{status:"valid",value:h},value:{status:"valid",value:r.data[h]}});else if(u==="strict")a.length>0&&(st(r,{code:Y.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const h of a){const c=r.data[h];l.push({key:{status:"valid",value:h},value:u._parse(new ks(r,c,r.path,h)),alwaysSet:h in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const u=[];for(const h of l){const c=await h.key,d=await h.value;u.push({key:c,value:d,alwaysSet:h.alwaysSet})}return u}).then(u=>Yi.mergeObjectSync(n,u)):Yi.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return yt.errToObj,new ke({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(e,n)=>{var s,o;const r=((o=(s=this._def).errorMap)==null?void 0:o.call(s,e,n).message)??n.defaultError;return e.code==="unrecognized_keys"?{message:yt.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new ke({...this._def,unknownKeys:"strip"})}passthrough(){return new ke({...this._def,unknownKeys:"passthrough"})}extend(t){return new ke({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ke({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Z.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new ke({...this._def,catchall:t})}pick(t){const e={};for(const n of Zt.objectKeys(t))t[n]&&this.shape[n]&&(e[n]=this.shape[n]);return new ke({...this._def,shape:()=>e})}omit(t){const e={};for(const n of Zt.objectKeys(this.shape))t[n]||(e[n]=this.shape[n]);return new ke({...this._def,shape:()=>e})}deepPartial(){return ju(this)}partial(t){const e={};for(const n of Zt.objectKeys(this.shape)){const r=this.shape[n];t&&!t[n]?e[n]=r:e[n]=r.optional()}return new ke({...this._def,shape:()=>e})}required(t){const e={};for(const n of Zt.objectKeys(this.shape))if(t&&!t[n])e[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof js;)s=s._def.innerType;e[n]=s}return new ke({...this._def,shape:()=>e})}keyof(){return nS(Zt.objectKeys(this.shape))}}ke.create=(i,t)=>new ke({shape:()=>i,unknownKeys:"strip",catchall:So.create(),typeName:Z.ZodObject,...Ft(t)}),ke.strictCreate=(i,t)=>new ke({shape:()=>i,unknownKeys:"strict",catchall:So.create(),typeName:Z.ZodObject,...Ft(t)}),ke.lazycreate=(i,t)=>new ke({shape:i,unknownKeys:"strip",catchall:So.create(),typeName:Z.ZodObject,...Ft(t)});class Xc extends jt{_parse(t){const{ctx:e}=this._processInputParams(t),n=this._def.options;function r(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return e.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Kn(a.ctx.common.issues));return st(e,{code:Y.invalid_union,unionErrors:o}),Mt}if(e.common.async)return Promise.all(n.map(async s=>{const o={...e,common:{...e.common,issues:[]},parent:null};return{result:await s._parseAsync({data:e.data,path:e.path,parent:o}),ctx:o}})).then(r);{let s;const o=[];for(const l of n){const u={...e,common:{...e.common,issues:[]},parent:null},h=l._parseSync({data:e.data,path:e.path,parent:u});if(h.status==="valid")return h;h.status==="dirty"&&!s&&(s={result:h,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return e.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new Kn(l));return st(e,{code:Y.invalid_union,unionErrors:a}),Mt}}get options(){return this._def.options}}Xc.create=(i,t)=>new Xc({options:i,typeName:Z.ZodUnion,...Ft(t)});const bo=i=>i instanceof Jc?bo(i.schema):i instanceof is?bo(i.innerType()):i instanceof Zc?[i.value]:i instanceof ha?i.options:i instanceof Kc?Zt.objectValues(i.enum):i instanceof Qc?bo(i._def.innerType):i instanceof Wc?[void 0]:i instanceof Hc?[null]:i instanceof js?[void 0,...bo(i.unwrap())]:i instanceof ca?[null,...bo(i.unwrap())]:i instanceof l0||i instanceof id?bo(i.unwrap()):i instanceof td?bo(i._def.innerType):[];class ng extends jt{_parse(t){const{ctx:e}=this._processInputParams(t);if(e.parsedType!==ut.object)return st(e,{code:Y.invalid_type,expected:ut.object,received:e.parsedType}),Mt;const n=this.discriminator,r=e.data[n],s=this.optionsMap.get(r);return s?e.common.async?s._parseAsync({data:e.data,path:e.path,parent:e}):s._parseSync({data:e.data,path:e.path,parent:e}):(st(e,{code:Y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Mt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,n){const r=new Map;for(const s of e){const o=bo(s.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(r.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);r.set(a,s)}}return new ng({typeName:Z.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:r,...Ft(n)})}}function a0(i,t){const e=Eo(i),n=Eo(t);if(i===t)return{valid:!0,data:i};if(e===ut.object&&n===ut.object){const r=Zt.objectKeys(t),s=Zt.objectKeys(i).filter(a=>r.indexOf(a)!==-1),o={...i,...t};for(const a of s){const l=a0(i[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(e===ut.array&&n===ut.array){if(i.length!==t.length)return{valid:!1};const r=[];for(let s=0;s<i.length;s++){const o=i[s],a=t[s],l=a0(o,a);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return e===ut.date&&n===ut.date&&+i==+t?{valid:!0,data:i}:{valid:!1}}class $c extends jt{_parse(t){const{status:e,ctx:n}=this._processInputParams(t),r=(s,o)=>{if(r0(s)||r0(o))return Mt;const a=a0(s.value,o.value);return a.valid?((s0(s)||s0(o))&&e.dirty(),{status:e.value,value:a.data}):(st(n,{code:Y.invalid_intersection_types}),Mt)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>r(s,o)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}$c.create=(i,t,e)=>new $c({left:i,right:t,typeName:Z.ZodIntersection,...Ft(e)});class Gs extends jt{_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.array)return st(n,{code:Y.invalid_type,expected:ut.array,received:n.parsedType}),Mt;if(n.data.length<this._def.items.length)return st(n,{code:Y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Mt;!this._def.rest&&n.data.length>this._def.items.length&&(st(n,{code:Y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty());const s=[...n.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new ks(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>Yi.mergeArray(e,o)):Yi.mergeArray(e,s)}get items(){return this._def.items}rest(t){return new Gs({...this._def,rest:t})}}Gs.create=(i,t)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gs({items:i,typeName:Z.ZodTuple,rest:null,...Ft(t)})};class Yc extends jt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.object)return st(n,{code:Y.invalid_type,expected:ut.object,received:n.parsedType}),Mt;const r=[],s=this._def.keyType,o=this._def.valueType;for(const a in n.data)r.push({key:s._parse(new ks(n,a,n.path,a)),value:o._parse(new ks(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Yi.mergeObjectAsync(e,r):Yi.mergeObjectSync(e,r)}get element(){return this._def.valueType}static create(t,e,n){return e instanceof jt?new Yc({keyType:t,valueType:e,typeName:Z.ZodRecord,...Ft(n)}):new Yc({keyType:ts.create(),valueType:t,typeName:Z.ZodRecord,...Ft(e)})}}class rg extends jt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.map)return st(n,{code:Y.invalid_type,expected:ut.map,received:n.parsedType}),Mt;const r=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,l],u)=>({key:r._parse(new ks(n,a,n.path,[u,"key"])),value:s._parse(new ks(n,l,n.path,[u,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,h=await l.value;if(u.status==="aborted"||h.status==="aborted")return Mt;(u.status==="dirty"||h.status==="dirty")&&e.dirty(),a.set(u.value,h.value)}return{status:e.value,value:a}})}else{const a=new Map;for(const l of o){const u=l.key,h=l.value;if(u.status==="aborted"||h.status==="aborted")return Mt;(u.status==="dirty"||h.status==="dirty")&&e.dirty(),a.set(u.value,h.value)}return{status:e.value,value:a}}}}rg.create=(i,t,e)=>new rg({valueType:t,keyType:i,typeName:Z.ZodMap,...Ft(e)});class ul extends jt{_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.set)return st(n,{code:Y.invalid_type,expected:ut.set,received:n.parsedType}),Mt;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(st(n,{code:Y.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),e.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(st(n,{code:Y.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),e.dirty());const s=this._def.valueType;function o(l){const u=new Set;for(const h of l){if(h.status==="aborted")return Mt;h.status==="dirty"&&e.dirty(),u.add(h.value)}return{status:e.value,value:u}}const a=[...n.data.values()].map((l,u)=>s._parse(new ks(n,l,n.path,u)));return n.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,e){return new ul({...this._def,minSize:{value:t,message:yt.toString(e)}})}max(t,e){return new ul({...this._def,maxSize:{value:t,message:yt.toString(e)}})}size(t,e){return this.min(t,e).max(t,e)}nonempty(t){return this.min(1,t)}}ul.create=(i,t)=>new ul({valueType:i,minSize:null,maxSize:null,typeName:Z.ZodSet,...Ft(t)});class Vu extends jt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:e}=this._processInputParams(t);if(e.parsedType!==ut.function)return st(e,{code:Y.invalid_type,expected:ut.function,received:e.parsedType}),Mt;function n(a,l){return tg({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Qf(),Fu].filter(u=>!!u),issueData:{code:Y.invalid_arguments,argumentsError:l}})}function r(a,l){return tg({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Qf(),Fu].filter(u=>!!u),issueData:{code:Y.invalid_return_type,returnTypeError:l}})}const s={errorMap:e.common.contextualErrorMap},o=e.data;if(this._def.returns instanceof zu){const a=this;return pn(async function(...l){const u=new Kn([]),h=await a._def.args.parseAsync(l,s).catch(g=>{throw u.addIssue(n(l,g)),u}),c=await Reflect.apply(o,this,h);return await a._def.returns._def.type.parseAsync(c,s).catch(g=>{throw u.addIssue(r(c,g)),u})})}else{const a=this;return pn(function(...l){const u=a._def.args.safeParse(l,s);if(!u.success)throw new Kn([n(l,u.error)]);const h=Reflect.apply(o,this,u.data),c=a._def.returns.safeParse(h,s);if(!c.success)throw new Kn([r(h,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Vu({...this._def,args:Gs.create(t).rest(ll.create())})}returns(t){return new Vu({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,e,n){return new Vu({args:t||Gs.create([]).rest(ll.create()),returns:e||ll.create(),typeName:Z.ZodFunction,...Ft(n)})}}class Jc extends jt{get schema(){return this._def.getter()}_parse(t){const{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}}Jc.create=(i,t)=>new Jc({getter:i,typeName:Z.ZodLazy,...Ft(t)});class Zc extends jt{_parse(t){if(t.data!==this._def.value){const e=this._getOrReturnCtx(t);return st(e,{received:e.data,code:Y.invalid_literal,expected:this._def.value}),Mt}return{status:"valid",value:t.data}}get value(){return this._def.value}}Zc.create=(i,t)=>new Zc({value:i,typeName:Z.ZodLiteral,...Ft(t)});function nS(i,t){return new ha({values:i,typeName:Z.ZodEnum,...Ft(t)})}class ha extends jt{_parse(t){if(typeof t.data!="string"){const e=this._getOrReturnCtx(t),n=this._def.values;return st(e,{expected:Zt.joinValues(n),received:e.parsedType,code:Y.invalid_type}),Mt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const e=this._getOrReturnCtx(t),n=this._def.values;return st(e,{received:e.data,code:Y.invalid_enum_value,options:n}),Mt}return pn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const e of this._def.values)t[e]=e;return t}get Values(){const t={};for(const e of this._def.values)t[e]=e;return t}get Enum(){const t={};for(const e of this._def.values)t[e]=e;return t}extract(t,e=this._def){return ha.create(t,{...this._def,...e})}exclude(t,e=this._def){return ha.create(this.options.filter(n=>!t.includes(n)),{...this._def,...e})}}ha.create=nS;class Kc extends jt{_parse(t){const e=Zt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ut.string&&n.parsedType!==ut.number){const r=Zt.objectValues(e);return st(n,{expected:Zt.joinValues(r),received:n.parsedType,code:Y.invalid_type}),Mt}if(this._cache||(this._cache=new Set(Zt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const r=Zt.objectValues(e);return st(n,{received:n.data,code:Y.invalid_enum_value,options:r}),Mt}return pn(t.data)}get enum(){return this._def.values}}Kc.create=(i,t)=>new Kc({values:i,typeName:Z.ZodNativeEnum,...Ft(t)});class zu extends jt{unwrap(){return this._def.type}_parse(t){const{ctx:e}=this._processInputParams(t);if(e.parsedType!==ut.promise&&e.common.async===!1)return st(e,{code:Y.invalid_type,expected:ut.promise,received:e.parsedType}),Mt;const n=e.parsedType===ut.promise?e.data:Promise.resolve(e.data);return pn(n.then(r=>this._def.type.parseAsync(r,{path:e.path,errorMap:e.common.contextualErrorMap})))}}zu.create=(i,t)=>new zu({type:i,typeName:Z.ZodPromise,...Ft(t)});class is extends jt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:e,ctx:n}=this._processInputParams(t),r=this._def.effect||null,s={addIssue:o=>{st(n,o),o.fatal?e.abort():e.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const o=r.transform(n.data,s);if(n.common.async)return Promise.resolve(o).then(async a=>{if(e.value==="aborted")return Mt;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?Mt:l.status==="dirty"||e.value==="dirty"?ku(l.value):l});{if(e.value==="aborted")return Mt;const a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?Mt:a.status==="dirty"||e.value==="dirty"?ku(a.value):a}}if(r.type==="refinement"){const o=a=>{const l=r.refinement(a,s);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Mt:(a.status==="dirty"&&e.dirty(),o(a.value),{status:e.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Mt:(a.status==="dirty"&&e.dirty(),o(a.value).then(()=>({status:e.value,value:a.value}))))}if(r.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ol(o))return Mt;const a=r.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>ol(o)?Promise.resolve(r.transform(o.value,s)).then(a=>({status:e.value,value:a})):Mt);Zt.assertNever(r)}}is.create=(i,t,e)=>new is({schema:i,typeName:Z.ZodEffects,effect:t,...Ft(e)}),is.createWithPreprocess=(i,t,e)=>new is({schema:t,effect:{type:"preprocess",transform:i},typeName:Z.ZodEffects,...Ft(e)});class js extends jt{_parse(t){return this._getType(t)===ut.undefined?pn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}js.create=(i,t)=>new js({innerType:i,typeName:Z.ZodOptional,...Ft(t)});class ca extends jt{_parse(t){return this._getType(t)===ut.null?pn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ca.create=(i,t)=>new ca({innerType:i,typeName:Z.ZodNullable,...Ft(t)});class Qc extends jt{_parse(t){const{ctx:e}=this._processInputParams(t);let n=e.data;return e.parsedType===ut.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:e.path,parent:e})}removeDefault(){return this._def.innerType}}Qc.create=(i,t)=>new Qc({innerType:i,typeName:Z.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ft(t)});class td extends jt{_parse(t){const{ctx:e}=this._processInputParams(t),n={...e,common:{...e.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Uc(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Kn(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Kn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}td.create=(i,t)=>new td({innerType:i,typeName:Z.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ft(t)});class sg extends jt{_parse(t){if(this._getType(t)!==ut.nan){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.nan,received:n.parsedType}),Mt}return{status:"valid",value:t.data}}}sg.create=i=>new sg({typeName:Z.ZodNaN,...Ft(i)});const R4=Symbol("zod_brand");class l0 extends jt{_parse(t){const{ctx:e}=this._processInputParams(t),n=e.data;return this._def.type._parse({data:n,path:e.path,parent:e})}unwrap(){return this._def.type}}class ed extends jt{_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Mt:s.status==="dirty"?(e.dirty(),ku(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?Mt:r.status==="dirty"?(e.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(t,e){return new ed({in:t,out:e,typeName:Z.ZodPipeline})}}class id extends jt{_parse(t){const e=this._def.innerType._parse(t),n=r=>(ol(r)&&(r.value=Object.freeze(r.value)),r);return Uc(e)?e.then(r=>n(r)):n(e)}unwrap(){return this._def.innerType}}id.create=(i,t)=>new id({innerType:i,typeName:Z.ZodReadonly,...Ft(t)});function rS(i,t){const e=typeof i=="function"?i(t):typeof i=="string"?{message:i}:i;return typeof e=="string"?{message:e}:e}function sS(i,t={},e){return i?Gu.create().superRefine((n,r)=>{const s=i(n);if(s instanceof Promise)return s.then(o=>{if(!o){const a=rS(t,n),l=a.fatal??e??!0;r.addIssue({code:"custom",...a,fatal:l})}});if(!s){const o=rS(t,n),a=o.fatal??e??!0;r.addIssue({code:"custom",...o,fatal:a})}}):Gu.create()}const A4={object:ke.lazycreate};var Z;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(Z||(Z={}));const L4=(i,t={message:`Input not instance of ${i.name}`})=>sS(e=>e instanceof i,t),oS=ts.create,aS=la.create,F4=sg.create,k4=ua.create,lS=qc.create,G4=al.create,j4=eg.create,V4=Wc.create,z4=Hc.create,B4=Gu.create,U4=ll.create,q4=So.create,W4=ig.create,H4=es.create,u0=ke.create,X4=ke.strictCreate,$4=Xc.create,Y4=ng.create,J4=$c.create,Z4=Gs.create,K4=Yc.create,Q4=rg.create,tR=ul.create,eR=Vu.create,iR=Jc.create,nR=Zc.create,rR=ha.create,sR=Kc.create,oR=zu.create,uS=is.create,aR=js.create,lR=ca.create,uR=is.createWithPreprocess,hR=ed.create,Je=Object.freeze(Object.defineProperty({__proto__:null,BRAND:R4,DIRTY:ku,EMPTY_PATH:c4,INVALID:Mt,NEVER:Mt,OK:pn,ParseStatus:Yi,Schema:jt,ZodAny:Gu,ZodArray:es,ZodBigInt:ua,ZodBoolean:qc,ZodBranded:l0,ZodCatch:td,ZodDate:al,ZodDefault:Qc,ZodDiscriminatedUnion:ng,ZodEffects:is,ZodEnum:ha,ZodError:Kn,get ZodFirstPartyTypeKind(){return Z},ZodFunction:Vu,ZodIntersection:$c,ZodIssueCode:Y,ZodLazy:Jc,ZodLiteral:Zc,ZodMap:rg,ZodNaN:sg,ZodNativeEnum:Kc,ZodNever:So,ZodNull:Hc,ZodNullable:ca,ZodNumber:la,ZodObject:ke,ZodOptional:js,ZodParsedType:ut,ZodPipeline:ed,ZodPromise:zu,ZodReadonly:id,ZodRecord:Yc,ZodSchema:jt,ZodSet:ul,ZodString:ts,ZodSymbol:eg,ZodTransformer:is,ZodTuple:Gs,ZodType:jt,ZodUndefined:Wc,ZodUnion:Xc,ZodUnknown:ll,ZodVoid:ig,addIssueToContext:st,any:B4,array:H4,bigint:k4,boolean:lS,coerce:{string:(i=>ts.create({...i,coerce:!0})),number:(i=>la.create({...i,coerce:!0})),boolean:(i=>qc.create({...i,coerce:!0})),bigint:(i=>ua.create({...i,coerce:!0})),date:(i=>al.create({...i,coerce:!0}))},custom:sS,date:G4,datetimeRegex:iS,defaultErrorMap:Fu,discriminatedUnion:Y4,effect:uS,enum:rR,function:eR,getErrorMap:Qf,getParsedType:Eo,instanceof:L4,intersection:J4,isAborted:r0,isAsync:Uc,isDirty:s0,isValid:ol,late:A4,lazy:iR,literal:nR,makeIssue:tg,map:Q4,nan:F4,nativeEnum:sR,never:q4,null:z4,nullable:lR,number:aS,object:u0,get objectUtil(){return n0},oboolean:()=>lS().optional(),onumber:()=>aS().optional(),optional:aR,ostring:()=>oS().optional(),pipeline:hR,preprocess:uR,promise:oR,quotelessJson:u4,record:K4,set:tR,setErrorMap:h4,strictObject:X4,string:oS,symbol:j4,transformer:uS,tuple:Z4,undefined:V4,union:$4,unknown:U4,get util(){return Zt},void:W4},Symbol.toStringTag,{value:"Module"})),cR=Symbol("Let zodToJsonSchema decide on which parser to use"),hS={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},dR=i=>typeof i=="string"?{...hS,name:i}:{...hS,...i},fR=i=>{const t=dR(i),e=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:e,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}};function cS(i,t,e,n){n!=null&&n.errorMessages&&e&&(i.errorMessage={...i.errorMessage,[t]:e})}function ce(i,t,e,n,r){i[t]=e,cS(i,t,n,r)}const dS=(i,t)=>{let e=0;for(;e<i.length&&e<t.length&&i[e]===t[e];e++);return[(i.length-e).toString(),...t.slice(e)].join("/")};function On(i){if(i.target!=="openAi")return{};const t=[...i.basePath,i.definitionPath,i.openAiAnyTypeName];return i.flags.hasReferencedOpenAiAnyType=!0,{$ref:i.$refStrategy==="relative"?dS(t,i.currentPath):t.join("/")}}function gR(i,t){var n,r,s;const e={type:"array"};return(n=i.type)!=null&&n._def&&((s=(r=i.type)==null?void 0:r._def)==null?void 0:s.typeName)!==Z.ZodAny&&(e.items=se(i.type._def,{...t,currentPath:[...t.currentPath,"items"]})),i.minLength&&ce(e,"minItems",i.minLength.value,i.minLength.message,t),i.maxLength&&ce(e,"maxItems",i.maxLength.value,i.maxLength.message,t),i.exactLength&&(ce(e,"minItems",i.exactLength.value,i.exactLength.message,t),ce(e,"maxItems",i.exactLength.value,i.exactLength.message,t)),e}function pR(i,t){const e={type:"integer",format:"int64"};if(!i.checks)return e;for(const n of i.checks)switch(n.kind){case"min":t.target==="jsonSchema7"?n.inclusive?ce(e,"minimum",n.value,n.message,t):ce(e,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(e.exclusiveMinimum=!0),ce(e,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?ce(e,"maximum",n.value,n.message,t):ce(e,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(e.exclusiveMaximum=!0),ce(e,"maximum",n.value,n.message,t));break;case"multipleOf":ce(e,"multipleOf",n.value,n.message,t);break}return e}function mR(){return{type:"boolean"}}function fS(i,t){return se(i.type._def,t)}const vR=(i,t)=>se(i.innerType._def,t);function gS(i,t,e){const n=e??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,s)=>gS(i,t,r))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return yR(i,t)}}const yR=(i,t)=>{const e={type:"integer",format:"unix-time"};if(t.target==="openApi3")return e;for(const n of i.checks)switch(n.kind){case"min":ce(e,"minimum",n.value,n.message,t);break;case"max":ce(e,"maximum",n.value,n.message,t);break}return e};function _R(i,t){return{...se(i.innerType._def,t),default:i.defaultValue()}}function wR(i,t){return t.effectStrategy==="input"?se(i.schema._def,t):On(t)}function ER(i){return{type:"string",enum:Array.from(i.values)}}const SR=i=>"type"in i&&i.type==="string"?!1:"allOf"in i;function bR(i,t){const e=[se(i.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),se(i.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(s=>!!s);let n=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const r=[];return e.forEach(s=>{if(SR(s))r.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:a,...l}=s;o=l}else n=void 0;r.push(o)}}),r.length?{allOf:r,...n}:void 0}function CR(i,t){const e=typeof i.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(i.value)?"array":"object"}:t.target==="openApi3"?{type:e==="bigint"?"integer":e,enum:[i.value]}:{type:e==="bigint"?"integer":e,const:i.value}}let h0;const ns={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(h0===void 0&&(h0=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),h0),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function pS(i,t){const e={type:"string"};if(i.checks)for(const n of i.checks)switch(n.kind){case"min":ce(e,"minLength",typeof e.minLength=="number"?Math.max(e.minLength,n.value):n.value,n.message,t);break;case"max":ce(e,"maxLength",typeof e.maxLength=="number"?Math.min(e.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":rs(e,"email",n.message,t);break;case"format:idn-email":rs(e,"idn-email",n.message,t);break;case"pattern:zod":mn(e,ns.email,n.message,t);break}break;case"url":rs(e,"uri",n.message,t);break;case"uuid":rs(e,"uuid",n.message,t);break;case"regex":mn(e,n.regex,n.message,t);break;case"cuid":mn(e,ns.cuid,n.message,t);break;case"cuid2":mn(e,ns.cuid2,n.message,t);break;case"startsWith":mn(e,RegExp(`^${c0(n.value,t)}`),n.message,t);break;case"endsWith":mn(e,RegExp(`${c0(n.value,t)}$`),n.message,t);break;case"datetime":rs(e,"date-time",n.message,t);break;case"date":rs(e,"date",n.message,t);break;case"time":rs(e,"time",n.message,t);break;case"duration":rs(e,"duration",n.message,t);break;case"length":ce(e,"minLength",typeof e.minLength=="number"?Math.max(e.minLength,n.value):n.value,n.message,t),ce(e,"maxLength",typeof e.maxLength=="number"?Math.min(e.maxLength,n.value):n.value,n.message,t);break;case"includes":{mn(e,RegExp(c0(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&rs(e,"ipv4",n.message,t),n.version!=="v4"&&rs(e,"ipv6",n.message,t);break}case"base64url":mn(e,ns.base64url,n.message,t);break;case"jwt":mn(e,ns.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&mn(e,ns.ipv4Cidr,n.message,t),n.version!=="v4"&&mn(e,ns.ipv6Cidr,n.message,t);break}case"emoji":mn(e,ns.emoji(),n.message,t);break;case"ulid":{mn(e,ns.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{rs(e,"binary",n.message,t);break}case"contentEncoding:base64":{ce(e,"contentEncoding","base64",n.message,t);break}case"pattern:zod":{mn(e,ns.base64,n.message,t);break}}break}case"nanoid":mn(e,ns.nanoid,n.message,t)}return e}function c0(i,t){return t.patternStrategy==="escape"?xR(i):i}const PR=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function xR(i){let t="";for(let e=0;e<i.length;e++)PR.has(i[e])||(t+="\\"),t+=i[e];return t}function rs(i,t,e,n){var r;i.format||(r=i.anyOf)!=null&&r.some(s=>s.format)?(i.anyOf||(i.anyOf=[]),i.format&&(i.anyOf.push({format:i.format,...i.errorMessage&&n.errorMessages&&{errorMessage:{format:i.errorMessage.format}}}),delete i.format,i.errorMessage&&(delete i.errorMessage.format,Object.keys(i.errorMessage).length===0&&delete i.errorMessage)),i.anyOf.push({format:t,...e&&n.errorMessages&&{errorMessage:{format:e}}})):ce(i,"format",t,e,n)}function mn(i,t,e,n){var r;i.pattern||(r=i.allOf)!=null&&r.some(s=>s.pattern)?(i.allOf||(i.allOf=[]),i.pattern&&(i.allOf.push({pattern:i.pattern,...i.errorMessage&&n.errorMessages&&{errorMessage:{pattern:i.errorMessage.pattern}}}),delete i.pattern,i.errorMessage&&(delete i.errorMessage.pattern,Object.keys(i.errorMessage).length===0&&delete i.errorMessage)),i.allOf.push({pattern:mS(t,n),...e&&n.errorMessages&&{errorMessage:{pattern:e}}})):ce(i,"pattern",mS(t,n),e,n)}function mS(i,t){var l;if(!t.applyRegexFlags||!i.flags)return i.source;const e={i:i.flags.includes("i"),m:i.flags.includes("m"),s:i.flags.includes("s")},n=e.i?i.source.toLowerCase():i.source;let r="",s=!1,o=!1,a=!1;for(let u=0;u<n.length;u++){if(s){r+=n[u],s=!1;continue}if(e.i){if(o){if(n[u].match(/[a-z]/)){a?(r+=n[u],r+=`${n[u-2]}-${n[u]}`.toUpperCase(),a=!1):n[u+1]==="-"&&((l=n[u+2])!=null&&l.match(/[a-z]/))?(r+=n[u],a=!0):r+=`${n[u]}${n[u].toUpperCase()}`;continue}}else if(n[u].match(/[a-z]/)){r+=`[${n[u]}${n[u].toUpperCase()}]`;continue}}if(e.m){if(n[u]==="^"){r+=`(^|(?<=[\r
468
+ `,kv=Date.now(),$s=class $s extends pt{constructor(e){super(e);f(this,"_flyToEvent",this.disposeVar(new O));f(this,"_resetClockEvent",this.disposeVar(new O));this.ad(lt([this,"uri"],[this,"url"]))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new Et([this,"url"],"路径","${earthsdk3-assets-script-dir}/assets/misc/simple.czml",void 0,!0),new H([this,"clockEnabled"],"启用",!1),new D([this,"multiplier"],"倍速",$s.defaults.multiplier),new H([this,"autoResetClock"],"自动设置时钟",!0),new ys([this,"startTime"],"开始时间",$s.defaults.startTime,!0),new ys([this,"stopTime"],"结束时间",$s.defaults.stopTime,!0),new ys([this,"currentTime"],"当前时间",$s.defaults.currentTime,!0),new ft([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep","SYSTEM_CLOCK_MULTIPLIER"),new ft([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange","UNBOUNDED"),new H([this,"shouldAnimate"],"是否启用动画",!1)],general:[...e.general,new H([this,"show"],"是否显示",!0),new H([this,"collision"],"开启碰撞",!1),new H([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new vt("飞入",n=>this.flyTo(n),[1e3],"flyTo"),new vt("重置时钟",()=>this.resetClock(),[],"resetClock"),new io([this,"loadFuncStr"],"loadFnStr",FE,jD,!0)]}}};f($s,"createDefaultProps",()=>({show:!0,uri:void 0,url:void 0,allowPicking:!1,autoResetClock:!0,clockEnabled:!1,startTime:kv,stopTime:kv+864e5,currentTime:kv,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...pt.createDefaultProps()})),f($s,"type",$s.register("ESCzml",$s,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"}));let Gv=$s;const gh=class gh extends pt{getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new wt,new H([this,"show"],"是否显示"),new D([this,"cssSize"],"尺寸"),new Ke([this,"cssPosition"],"位置"),new mt([this,"imgUrl"],"图片地址")]}}};f(gh,"createDefaultProps",()=>({...pt.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:pt.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")})),f(gh,"type",gh.register("ESNavigator",gh,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"}));let jv=gh;const Ys=class Ys extends pt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new wt("通用"),new H([this,"show"],"是否显示",Ys.defaults.show),new D([this,"height"],"高度",Ys.defaults.height,!0),new D([this,"fontSize"],"文字大小",Ys.defaults.fontSize,!0),new Dt([this,"bgColor"],"背景颜色",Ys.defaults.bgColor,!0)]}}};f(Ys,"createDefaultProps",()=>({...pt.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:ot([.2784313725490196,.2784313725490196,.2784313725490196,.8])})),f(Ys,"type",Ys.register("ESViewerStatusBar",Ys,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let Vv=Ys;const Js=class Js extends pt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new wt("通用"),new H([this,"show"],"是否显示",Js.defaults.show),new D([this,"height"],"高度",Js.defaults.height,!0),new D([this,"fontSize"],"文字大小",Js.defaults.fontSize,!0),new Dt([this,"bgColor"],"背景颜色",Js.defaults.bgColor,!0)]}}};f(Js,"createDefaultProps",()=>({...pt.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:ot([.2784313725490196,.2784313725490196,.2784313725490196,.8])})),f(Js,"type",Js.register("ESViewerStatusBarScale",Js,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let zv=Js;const ph=class ph extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new mt([this,"url"],"路径","",!0),new D([this,"progress"],"进度",0,!1,!0)]}}};f(ph,"createDefaultProps",()=>({...ct.createDefaultProps(),url:"",progress:0})),f(ph,"type",ph.register("ESGaussianSplatting",ph,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"}));let Bv=ph;class VD extends B{constructor(t,e){if(super(),!e)return;const n=this.ad(new Jt);n.stroked=!0,this.ad(t.components.disposableAdd(n)),this.ad(lt([n,"points"],[t,"areaLiftingPoints"])),this.ad(n.editingChanged.don(()=>{n.editing||!this.isDestroyed()&&this.destroy()})),n.editing=!0}}var kE=(i=>(i[i.None=0]="None",i[i.Up=1]="Up",i[i.Down=2]="Down",i))(kE||{}),GE=(i=>(i[i.CLICK=0]="CLICK",i[i.MOVE=1]="MOVE",i))(GE||{}),jE=(i=>(i[i.Smooth=0]="Smooth",i[i.Linear=1]="Linear",i[i.Spherical=2]="Spherical",i[i.Tip=3]="Tip",i[i.Hard=4]="Hard",i))(jE||{});const vi=class vi extends ct{constructor(e){super(e);f(this,"_startEvent",this.disposeVar(new O));f(this,"_configs",this.disposeVar(oe(void 0)));f(this,"_heights",this.disposeVar(z({})));f(this,"_heightsEvent",this.ad(new O));f(this,"_areaLiftingUpdateEvent",this.disposeVar(new O));const n=this.ad(Ve(this.modeChanged,this.startEvent));this.ad(new qe(n,()=>{var r;if(this.areaLiftingPoints=void 0,this.mode=="areaLifting")return new VD(this,this.activeViewer);(r=this.activeViewer)==null||r.startEditing(this,nt.BrushErase)}))}updateEditing(){var e;Nf(this.position,[0,0,0])||(this.position=[0,0,0]),(e=this.activeViewer)==null||e.startEditing(this,nt.Place,{callSource:"inner"})}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get configs(){return this._configs.value}set configs(e){this._configs.value=e}get configsChanged(){return this._configs.changed}getConfig(...e){var n,r;if(typeof e[0]=="number")return(n=this.configs)==null?void 0:n.find(s=>s.x===e[0]&&s.y===e[1]);if(typeof e[0]=="string")return(r=this.configs)==null?void 0:r.find(s=>s.url===e[0])}get heights(){return this._heights.value}set heights(e){this._heights.value=e}get heightsChanged(){return this._heights.changed}get heightsEvent(){return this._heightsEvent}getHeights(){return new Promise((e,n)=>{const r=new B;r.ad(this._heightsEvent.don(o=>{o!=="start"&&(!r.isDestroyed()&&r.destroy(),e(o))})),this._heightsEvent.emit("start");const s=setTimeout(()=>{r.isDestroyed()||(r.destroy(),e(void 0))},2e3);r.ad(()=>clearTimeout(s))})}get areaLiftingUpdateEvent(){return this._areaLiftingUpdateEvent}areaLiftingUpdate(){this._areaLiftingUpdateEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new vt("开始编辑",()=>{this.start()},[],"start"),new ft([this,"mode"],vi.modes,"编辑模式",vi.defaults.mode)],basic:[...e.basic,new Et([this,"url"],"URL"),new Et([this,"tileInfo"],"瓦片信息配置"),new D([this,"maxHeight"],"最大高度"),new D([this,"minHeight"],"最小高度"),new D([this,"offset"],"偏移"),new H([this,"autoLoadHeights"],"自动加载高度"),new wt("刷写设置"),new D([this,"brushEraseRadius"],"编辑半径"),new Ke([this,"brushEraseRadiusRange"],"编辑半径范围",void 0,!0,!0),new ft([this,"brushEraseMode"],Object.entries(["CTRL","SHIFT","NONE"]),"刷写模式"),new ft([this,"brushErasePickReference"],vi.brushErasePickReferences,"选择参考"),new _s([this,"brushErasePosition"],"刷写位置"),new _s([this,"brushEraseStartPosition"],"刷写起始位置"),new ft([this,"brushEraseFalloff"],vi.brushEarseFalloffs,"刷写衰减函数"),new ft([this,"brushEraseRayDirection"],[["Up","Up"],["Down","Down"]],"刷写射线方向"),new wt("平整设置"),new ft([this,"flattenMode"],vi.flattenModes,"平整模式",0),new ft([this,"flattenPick"],vi.flattenPicks,"平整选择",0),new D([this,"flattenOffset"],"平整偏移",-.01),new wt("区域升降设置"),new Ne([this,"areaLiftingPoints"],"区域升降位置",[]),new D([this,"areaLiftingOffset"],"区域升降偏移",1),new vt("区域升降更新",()=>{this.areaLiftingUpdate()},[],"areaLiftingUpdate"),new wt("围栏设置"),new Ne([this,"fencePoints"],"围栏位置",[])]}}};f(vi,"createDefaultProps",()=>({...ct.createDefaultProps(),allowPicking:!0,url:"",maxHeight:0,minHeight:0,offset:.01,tileInfo:bt({tileCountX:65,tileCountY:65,tileMaximumLevel:15,tilesPerAxis:5,format:"heights"}),mode:z("sculpt"),autoLoadHeights:!1,brushEraseRadius:100,brushEraseRadiusRange:ot([0,100]),brushErasePosition:ot([0,0,0]),brushEraseStartPosition:ot([0,0,0]),brushEraseMode:z("NONE"),brushErasePickReference:z("NONE"),brushEraseRayDirection:z("Down"),brushEraseFalloff:z(4),flattenMode:z(0),flattenPick:z(1),flattenOffset:-.01,areaLiftingPoints:Pa(void 0),areaLiftingOffset:1,fencePoints:Pa(void 0),fenceMode:z("in")})),f(vi,"modes",[["雕刻","sculpt"],["抹除","erase"],["平滑","smooth"],["平整","flatten"],["区域升降","areaLifting"]]),f(vi,"brushErasePickReferences",[["无限制","NONE"],["地形图层","ESTerrainLayerEditing"],["3DTiles","ES3DTileset"]]),f(vi,"flattenModes",[["None",0],["Up",1],["Down",2]]),f(vi,"flattenPicks",[["CLICK",0],["MOVE",1]]),f(vi,"brushEarseFalloffs",[["平滑",0],["线性",1],["硬边",4],["球形",2],["尖顶",3]]),f(vi,"invalidValue",-1e4),f(vi,"type",vi.register("ESTerrainLayerEditing",vi,{chsName:"地形图层编辑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于对地形数据进行编辑"})),f(vi,"supportEditingModes",[...ct.supportEditingModes,nt.Place,nt.BrushErase]);let Vc=vi;const nr=class nr extends Ot{constructor(e){super(e);f(this,"editingBindMode","doublePoints");f(this,"_startEvent",this.disposeVar(new O));f(this,"_replayEvent",this.disposeVar(new O));this.ad(this.startEvent.don(()=>{var n;(n=this.activeViewer)==null||n.startEditing(this,nt.BrushErase)}))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get replayEvent(){return this._replayEvent}replay(){this._replayEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new vt("开始编辑",()=>this.start(),[]),new vt("重播",()=>this.replay(),[]),new H([this,"showImage"],"显示影像",nr.defaults.showImage),new D([this,"flowSpeed"],"流动速度",nr.defaults.flowSpeed),new D([this,"gravity"],"重力加速度",nr.defaults.gravity),new D([this,"strength"],"泥石流强度",nr.defaults.strength),new D([this,"resistance"],"泥石流阻力(越大越快平息)",nr.defaults.resistance),new D([this,"terrainOffset"],"地形高度偏移",nr.defaults.terrainOffset),new Ne([this,"slidePoints"],"滑坡点数组",Ot.defaults.slidePoints,void 0),new wt("刷写设置"),new D([this,"brushEraseRadius"],"编辑半径"),new Ke([this,"brushEraseRadiusRange"],"编辑半径范围",void 0,!0,!0),new ft([this,"brushEraseMode"],Object.entries(["CTRL","SHIFT","NONE"]),"刷写模式"),new ft([this,"brushErasePickReference"],Vc.brushErasePickReferences,"选择参考"),new _s([this,"brushErasePosition"],"刷写位置"),new _s([this,"brushEraseStartPosition"],"刷写起始位置"),new ft([this,"brushEraseFalloff"],Vc.brushEarseFalloffs,"刷写衰减函数"),new ft([this,"brushEraseRayDirection"],[["Up","Up"],["Down","Down"]],"刷写射线方向")]}}};f(nr,"createDefaultProps",()=>({...Ot.createDefaultProps(),brushEraseRadius:100,brushEraseRadiusRange:ot([0,1e3]),brushErasePosition:ot([0,0,0]),brushEraseStartPosition:ot([0,0,0]),brushEraseMode:z("NONE"),brushErasePickReference:z("NONE"),brushEraseRayDirection:z("Down"),terrainOffset:5,flowSpeed:1,gravity:9.8,slidePoints:ot([]),strength:1,showImage:!0,resistance:.98,stroked:!0,strokeStyle:bt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!0})})),f(nr,"type",nr.register("ESLandSlide",nr,{chsName:"滑坡泥石流分析",tags:["ESObjects","_ES_Impl_Cesium"],description:"滑坡泥石流分析对象"})),f(nr,"supportEditingModes",[...Ot.supportEditingModes,nt.DoublePoints,nt.DoublePointsAppend,nt.DoublePointsModify,nt.BrushErase]);let Uv=nr;const Il=class Il extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new mt([this,"mesh"],"mesh地址",Il.defaults.mesh)]}}};f(Il,"createDefaultProps",()=>({...ct.createDefaultProps(),mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"})),f(Il,"type",Il.register("ESStaticMesh",Il,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"}));let qv=Il;const mh=class mh extends Ot{constructor(e){super(e);f(this,"_startEvent",this.dv(new O));f(this,"_clearEvent",this.dv(new O));f(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new nl),this.ad(this.components.disposableAdd(this._eSGeoExtrudedPolygon)),this.eSGeoExtrudedPolygon.perPositionHeight=!0,this.eSGeoExtrudedPolygon.extrudedHeight=0,this.stroked=!0,this.strokeWidth=2,this.strokeColor=[1,0,0,1],this.ad(F([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(F([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(F([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(F([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(F([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(F([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(F([this.eSGeoExtrudedPolygon,"points"],[this,"points"])),this.ad(this.clearEvent.don(()=>{this.points=void 0,this.depths=void 0,this.windowPositions=void 0}))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get eSGeoExtrudedPolygon(){return this._eSGeoExtrudedPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new vt("开始分析",()=>this.start(),[],"start"),new vt("清除分析",()=>this.clear(),[],"clear"),new Ne([this,"windowPositions"],"屏幕坐标",[],void 0,!1,!0),new Ne([this,"depths"],"深度值",[],void 0,!1,!0),new D([this,"radius"],"半径",1e4,!0)]}}};f(mh,"createDefaultProps",()=>({...Ot.createDefaultProps(),windowPositions:xm([]),depths:oe([]),radius:z(1e4)})),f(mh,"type",mh.register("ESSkylineAnalysis",mh,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"}));let Wv=mh;const Mo=class Mo extends Xt{constructor(t){super(t)}getESProperties(){const t=super.getESProperties();return{...t,basic:[...t.basic,new Ne([this,"data"],"数据",[],void 0,!0),new Et([this,"gradient"],"渐变",Mo.defaults.gradient,void 0,!0),new D([this,"radius"],"半径",Mo.defaults.radius,void 0,!0),new D([this,"blur"],"模糊",Mo.defaults.blur,!0),new H([this,"is3D"],"is3D",!1,!0)]}}};f(Mo,"createDefaultProps",()=>({...Xt.createDefaultProps(),is3D:z(!1),data:Pa([]),gradient:fe({".5":"green",".7":"yellow",".95":"red"}),radius:z(10),blur:z(.85)})),f(Mo,"type",Mo.register("ESHeatMap",Mo,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"}));let Jf=Mo;const Ml=class Ml extends Ot{constructor(e){super(e);f(this,"editingBindMode","scatter")}};f(Ml,"createDefaultProps",()=>({...Ot.createDefaultProps(),pointed:!0})),f(Ml,"type",Ml.register("ESGeoPoints",Ml,{chsName:"地理点集合",tags:["ESObjects","_ES_Impl_Cesium"],description:"地图中的可视化地理点集合"})),f(Ml,"supportEditingModes",[...Ot.supportEditingModes,nt.ScatterAppend,nt.ScatterModify]);let zc=Ml;const VE=async(i,t=[],e)=>{const n=[];for(const r of t){const{coordinates:s}=r.geometry;for(const o of s){const a=await Promise.all(o.map(async l=>{let u=l[2]??0;if(e)if(e.type==="absolute")u=e.height??u;else if(e.type==="relative"){const h=await i.getTerrainHeight([l[0],l[1]])??0;u=(e.height??u)+h}else e.type==="terrain"&&(u=await i.getTerrainHeight([l[0],l[1]])??0);return[l[0],l[1],u]}));n.push({...r,points:a})}}return n},zE=async(i,t=[],e)=>await Promise.all(t.map(async n=>{var l,u,h,c,d,g,p,E,b;const r=((l=n.geometry)==null?void 0:l.x)??((h=(u=n.geometry)==null?void 0:u.coordinates)==null?void 0:h[0]),s=((c=n.geometry)==null?void 0:c.y)??((g=(d=n.geometry)==null?void 0:d.coordinates)==null?void 0:g[1]);let a=((p=n.geometry)==null?void 0:p.z)??((b=(E=n.geometry)==null?void 0:E.coordinates)==null?void 0:b[2])??0;if(e)if(e.type==="absolute")a=e.height??a;else if(e.type==="relative"){const P=await i.getTerrainHeight([r,s])??0;a=(e.height??a)+P}else e.type==="terrain"&&(a=await i.getTerrainHeight([r,s])??0);return{...n,points:[r,s,a]}})),BE=async(i,t=[],e)=>{const n=[];return await Promise.all(t.map(async r=>{const{coordinates:s}=r.geometry;await Promise.all(s.map(async o=>{const a=await Promise.all(o.map(async l=>{let u=l[2]??0;if(e)if(e.type==="absolute")u=e.height??u;else if(e.type==="relative"){const h=await i.getTerrainHeight([l[0],l[1]])??0;u=(e.height??u)+h}else e.type==="terrain"&&(u=await i.getTerrainHeight([l[0],l[1]])??0);return[l[0],l[1],u]}));n.push({...r,points:a})}))})),n};function zD(i){const t=yi(i),e=cw(t),n=jp(t,e/2);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function BD(i,t){const e=yi(i),n=cw(e),r=Math.floor(n/t),s=[];if(s.push(i[0]),r<1)return[i[0]];for(let o=1;o<r;o+=1){const a=jp(e,n*(o/r));s.push([a.geometry.coordinates[0],a.geometry.coordinates[1],a.geometry.coordinates[2]||0])}return s}function UD(i){const t=[...i];JSON.stringify(i[0])!==JSON.stringify(i[i.length-1])&&t.push(i[0]);const e=ue([t]),n=Y_(e);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function UE(i,t,e){const n=i.dv(new Ou);for(const r in e)r!=="type"&&(n[r]=e[r]);n.position=t,i.d(i.components.disposableAdd(n))}function Hv(i,t,e,n){let r=n.textTemplate||n.symbol.text||"";const s=/{{(.*?)}}/;for(;s.test(r);){const h=r.match(s);if(h){const c=h[1].trim(),d=e[`${c}`]||"-";r=r.replace(h[0],d)}}let o=n.symbol;const{minVisibleDistance:a,maxVisibleDistance:l}=n;a&&l&&(o={...o,minVisibleDistance:a,maxVisibleDistance:l});const u={...o,text:r};UE(i,t,u)}function Lu(i,t){const e={width:null,height:null,color:null,opacity:null,rotation:null};return t.forEach(n=>{n.type==="size"?n.axis==="width"?e.width=i[n.field]||null:n.axis==="height"&&(e.height=i[n.field]||null):n.type==="color"?e.color=i[n.field]||null:n.type==="opacity"?e.opacity=i[n.field]||null:n.type==="rotation"&&(e.rotation=i[n.field]||null)}),e}function Xv(i,t,e){const r={...t.symbol};if(e&&e.length>0){const s=Lu(i,e);for(let o in s)r[o]!==void 0&&s[o]!==null&&(r[o]=s[o])}return r}function $v(i,t,e){var u,h;const n=t,{uniqueValueInfos:r,field:s,fieldDelimiter:o,defaultSymbol:a}=n;let l={...a};if(Array.isArray(s)){const d=s.map(g=>i[g]??"").join(o);l=((u=r.find(g=>g.value==d))==null?void 0:u.symbol)||a}else l=((h=r.find(c=>c.value==i[s]))==null?void 0:h.symbol)||a;if(e&&e.length>0){const c=Lu(i,e);for(let d in c)l[d]!==void 0&&c[d]!==null&&(l[d]=c[d])}return l}function Yv(i,t,e){const n=t,{classBreakInfos:r,field:s,defaultSymbol:o}=n;let a=o;const l=i[s];if(l===void 0||typeof l!="number")a=o;else{const u=r.find(h=>l<=h.maxValue&&l>=h.minValue);u?a=u.symbol:a=o}if(e&&e.length>0){const u=Lu(i,e);for(let h in u)a[h]!==void 0&&u[h]!==null&&(a[h]=u[h])}return a}function qD(i,t){function e(u,h,c,d){const g=y=>y*Math.PI/180,p=y=>y*180/Math.PI,E=g(u),b=g(c),P=g(d-h),v=Math.sin(P)*Math.cos(b),_=Math.cos(E)*Math.sin(b)-Math.sin(E)*Math.cos(b)*Math.cos(P),m=Math.atan2(v,_);return(p(m)+360)%360}function n(u,h,c,d,g){const E=C=>C*Math.PI/180,b=C=>C*180/Math.PI,P=d/6371e3,v=E(g),_=E(u),m=E(h),y=Math.asin(Math.sin(_)*Math.cos(P)+Math.cos(_)*Math.sin(P)*Math.cos(v)),S=m+Math.atan2(Math.sin(v)*Math.sin(P)*Math.cos(_),Math.cos(P)-Math.sin(_)*Math.sin(y));return{lat:b(y),lng:b(S),alt:c}}function r(u){const h=[];u.length>1&&h.push(e(u[0].lat,u[0].lng,u[1].lat,u[1].lng));for(let c=1;c<u.length-1;c++){const d=e(u[c-1].lat,u[c-1].lng,u[c].lat,u[c].lng),g=e(u[c].lat,u[c].lng,u[c+1].lat,u[c+1].lng);let p=(d+g)/2;Math.abs(d-g)>180&&(p=(p+180)%360),h.push(p)}return u.length>1&&h.push(e(u[u.length-2].lat,u[u.length-2].lng,u[u.length-1].lat,u[u.length-1].lng)),u.length===1&&h.push(0),h}if(!i||i.length<2)throw new Error("至少需要两个点才能生成路径");if(t<=0)throw new Error("宽度必须大于0");const s=t/2,o=r(i),a=[],l=[];for(let u=0;u<i.length;u++){const h=(o[u]+90)%360,c=(o[u]+270)%360,d=i[u].alt!==void 0?i[u].alt:0;a.push(n(i[u].lat,i[u].lng,d,s,h)),l.push(n(i[u].lat,i[u].lng,d,s,c))}return a.concat(l.reverse())}function WD(i,t,e,n){function r(E){return E*(Math.PI/180)}const s=6378137,o=r(i),a=r(t),l=r(e),u=r(n),h=l-o,c=u-a,d=Math.sin(h/2)**2+Math.cos(o)*Math.cos(l)*Math.sin(c/2)**2,g=2*Math.atan2(Math.sqrt(d),Math.sqrt(1-d));return s*g}const qE=(i,t,e)=>Array.isArray(t)?t.map(s=>i[s]??"").join(e):i[t]??"";function WE(i,t){const n={...t.symbol};return{points:i.map(r=>r.points),symbol:n}}function HE(i,t){const e=t,{uniqueValueInfos:n,field:r,fieldDelimiter:s,defaultSymbol:o}=e,a=[],l=n.reduce((h,c)=>{const d=c.value.toString();return h[d]={points:[],value:c.value,symbol:c.symbol},h},{});for(let h=0;h<i.length;h++){const c=i[h],d=qE(c,r,s);if(d!==void 0&&d!==""){const g=l[d.toString()];g?g.points.push(c.points):a.push(c.points)}else a.push(c.points)}const u=[];for(let h in l){const{points:c,symbol:d}=l[h];c.length>0&&u.push({points:c,symbol:d})}return a.length>0&&u.push({points:a,symbol:o}),u}function XE(i,t){const e=t,{classBreakInfos:n,field:r,defaultSymbol:s}=e,o=[],a=n.map(u=>({...u,points:[]}));for(let u=0;u<i.length;u++){const h=i[u],c=h[r];if(c===void 0||typeof c!="number")o.push(h.points);else{const d=a.findIndex(g=>c<=g.maxValue&&c>=g.minValue);d!==-1?a[d].points.push(h.points):o.push(h.points)}}const l=[];return a.forEach(u=>{u.points.length>0&&l.push({points:u.points,symbol:u.symbol})}),o.length>0&&l.push({points:o,symbol:s}),l}function HD(i,t,e=[]){const r={...t.symbol},s=i.map(o=>{const a=Lu(o,e);return{position:o.points,rotation:a.rotation||r.rotation||[0,0,0],scale:r.scale||[1,1,1]}});return{url:r.url,locations:s}}function XD(i,t,e=[]){const n=t,{uniqueValueInfos:r,field:s,fieldDelimiter:o}=n,a=n.defaultSymbol,l=[],u=r.reduce((c,d)=>{const g=d.value.toString();return c[g]={locations:[],value:d.value,symbol:d.symbol},c},{});for(let c=0;c<i.length;c++){const d=i[c],g=qE(d,s,o);if(g){const p=u[g.toString()];if(p){const E=Lu(d,e);p.locations.push({position:d.points,rotation:E.rotation||a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else l.push({position:d.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else l.push({position:d.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}const h=[];for(let c in u){const{locations:d,symbol:g}=u[c];d.length>0&&h.push({url:g.url,locations:d})}return l.length>0&&h.push({url:a.url,locations:l}),h}function $D(i,t,e=[]){const n=t,{classBreakInfos:r,field:s}=n,o=n.defaultSymbol,a=[],l=r.map(h=>({...h,locations:[]}));for(let h=0;h<i.length;h++){const c=i[h],d=c[s];if(d===void 0||typeof d!="number")a.push({position:c.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]});else{const g=l.findIndex(p=>d<=p.maxValue&&d>=p.minValue);if(g!==-1){const p=Lu(c,e);l[g].locations.push({position:c.points,rotation:p.rotation||o.rotation||[0,0,0],scale:l[g].symbol.scale||[1,1,1]})}else a.push({position:c.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]})}}const u=[];return l.forEach(h=>{h.locations.length>0&&u.push({url:h.symbol.url,locations:h.locations})}),a.length>0&&u.push({url:o.url,locations:a}),u}class YD extends B{constructor(e,n,r,s){super();f(this,"labelingInfo");this.sceneObject=e;const o=n;if(s&&ms(o,a=>{this.renderLabel(a,s)}),r)if(r.type==="simple"){const{visualVariables:a}=r;if(r.symbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!");const l=WE(o,r);this._simplePointAllRender(l.points,l.symbol);return}if(r.symbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!");const l=WE(o,r);this._imageAllRender(l.points,l.symbol);return}if(r.symbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!");const{url:l,locations:u}=HD(o,r,a);this._modelAllRender(l,u);return}for(let l=0;l<o.length;l++){const u=Xv(o[l],r,a);this.render(o[l],u)}}else if(r.type==="unique-value"){const{visualVariables:a}=r;if(r.uniqueValueInfos.findIndex(c=>c.symbol.type!=="simple-point")===-1&&r.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),HE(o,r).forEach(({points:d,symbol:g})=>{this._simplePointAllRender(d,g)});return}if(r.uniqueValueInfos.findIndex(c=>c.symbol.type!=="ESImageLabel")===-1&&r.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),HE(o,r).forEach(({points:d,symbol:g})=>{this._imageAllRender(d,g)});return}if(r.uniqueValueInfos.findIndex(c=>c.symbol.type!=="ESGltfModel")===-1&&r.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),XD(o,r,a).forEach(({url:d,locations:g})=>{this._modelAllRender(d,g)});return}for(let c=0;c<o.length;c++){const d=$v(o[c],r,a);this.render(o[c],d)}}else if(r.type==="class-breaks"){const{visualVariables:a}=r;if(r.classBreakInfos.findIndex(c=>c.symbol.type!=="simple-point")===-1&&r.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),XE(o,r).forEach(({points:d,symbol:g})=>{this._simplePointAllRender(d,g)});return}if(r.classBreakInfos.findIndex(c=>c.symbol.type!=="ESImageLabel")===-1&&r.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),XE(o,r).forEach(({points:d,symbol:g})=>{this._imageAllRender(d,g)});return}if(r.classBreakInfos.findIndex(c=>c.symbol.type!=="ESGltfModel")===-1&&r.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),$D(o,r,a).forEach(({url:d,locations:g})=>{this._modelAllRender(d,g)});return}for(let c=0;c<o.length;c++){const d=Yv(o[c],r,a);this.render(o[c],d)}}else if(r.type==="heatmap"){const{field:a,fieldValueMax:l,fieldValueMin:u}=r;console.time();const h=o.map(c=>{const{points:d}=c;if(a&&typeof a=="string"){let g=c[a];typeof g=="number"&&(typeof l=="number"&&g>l&&(g=l),typeof u=="number"&&g<u&&(g=u),d[2]=g)}return d});this.renderHeatmap(h,r)}else console.error("PointLayer: renderer type is not supported")}renderLabel(e,n){const{points:r}=e;Hv(this.sceneObject,r,e,n)}renderHeatmap(e,n){const{is3D:r,radius:s,blur:o,gradient:a}=n,l=this.dv(new Jf);this.d(this.sceneObject.components.disposableAdd(l)),l.is3D=r,l.radius=s,l.blur=o,a&&(l.gradient={...a}),l.data=e}render(e,n){n.type==="simple-point"?this._simplePointRender(e,n):n.type==="ESImageLabel"?this._simpleImageRender(e,n):n.type==="ESGltfModel"?this._simpleModelRender(e,n):n.type==="ESTextLabel"?UE(this.sceneObject,e.points,n):n.type==="ESParticleSystemPrimitive"?this._simpleParticleRender(e,n):console.error(" PointLayer: symbol type is not supported")}_simplePointRender(e,n){const{points:r}=e,{size:s,color:o,outlineColor:a,outlineWidth:l}=n,u=this.dv(new zc);this.d(this.sceneObject.components.disposableAdd(u)),u.pointed=!0,u.pointOutlineColor=a,u.pointOutlineWidth=l,u.pointSize=s,u.pointColor=o,u.allowPicking=(n==null?void 0:n.allowPicking)??!0,u.extras={selected:!1},u.points=[r]}_simplePointAllRender(e,n){const{size:r,color:s,outlineColor:o,outlineWidth:a}=n,l=this.dv(new zc);this.d(this.sceneObject.components.disposableAdd(l)),l.pointed=!0,l.pointOutlineColor=o,l.pointOutlineWidth=a,l.pointSize=r,l.pointColor=s,l.allowPicking=(n==null?void 0:n.allowPicking)??!0,l.points=[...e]}_simpleImageRender(e,n){const{points:r}=e,{rotation:s,offset:o,size:a,url:l,screenRender:u,anchor:h,renderMode:c,rotationType:d}=n,g=this.dv(new Vf),p=this.dv(new Ou);this.d(this.sceneObject.components.disposableAdd(g)),this.d(this.sceneObject.components.disposableAdd(p)),g.url=l,g.renderMode=c??0,s&&(g.rotation=s),o&&(g.offset=o),g.size=a||[32,32],h&&(g.anchor=h),d&&(g.rotationType=d),g.screenRender=u??!0,g.allowPicking=(n==null?void 0:n.allowPicking)??!0,g.extras={selected:!1},g.position=[...r],g.sizeByContent=!1,p.allowPicking=(n==null?void 0:n.allowPicking)??!0;const E=a?Math.max(...a)+10:Math.max(...g.size)+10;p.sizeByContent=!1,p.screenRender=!0,p.size=[E,E],p.borderRadius=[E,E,E,E],p.padding=[E/2,E/2,E/2,E/2],p.borderWidth=E/10,p.offset=[0,E/10+5],p.text="",p.backgroundColor=[0,0,0,0],p.borderColor=[0,0,0,0]}_imageAllRender(e,n){const r={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:e}}]},s=this.dv(new kc);this.d(this.sceneObject.components.disposableAdd(s));const o=this.dv(new Ou);this.d(this.sceneObject.components.disposableAdd(o)),s.textDefaultText="";const{offset:a,size:l,url:u,anchor:h}=n;s.imageUrl=u,h&&(s.imageAnchor=h),a&&(s.imageOffset=a),s.imageSize=l||[32,32],s.url=r,s.allowPicking=(n==null?void 0:n.allowPicking)??!0,s.extras={selected:!1},o.allowPicking=!0;const c=l?Math.max(...l)+10:Math.max(...s.imageSize)+10;o.sizeByContent=!1,o.size=[c,c],o.borderRadius=[c,c,c,c],o.padding=[c/2,c/2,c/2,c/2],o.borderWidth=c/10,o.offset=[0,c/10+5],o.text="",o.backgroundColor=[0,0,0,0],o.borderColor=[0,0,0,0]}_simpleModelRender(e,n){const{points:r}=e,{rotation:s,scale:o,url:a}=n,l=this.dv(new Fs);this.d(this.sceneObject.components.disposableAdd(l)),l.url=a,s&&(l.rotation=s),o&&(l.scale=o),l.position=[...r]}_modelAllRender(e,n){const r=this.dv(new Fs);this.d(this.sceneObject.components.disposableAdd(r)),r.url=e,r.instances=n}_simpleParticleRender(e,n){const{points:r}=e,s=this.dv(new zf);this.d(this.sceneObject.components.disposableAdd(s)),s.position=[...r],Object.keys(n).forEach(o=>{s[o]=n[o]})}}class JD extends B{constructor(t,e,n,r){super(),this.sceneObject=t;const s=e;if(r&&ms(s,o=>{this.renderLabel(o,r)}),n)if(n.type==="simple"){const{visualVariables:o}=n;ms(s,a=>{const l=Xv(a,n,o);this.render(a,l)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;ms(s,a=>{const l=$v(a,n,o);this.render(a,l)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;ms(s,a=>{const l=Yv(a,n,o);this.render(a,l)})}else console.error("PolyLineLayer: renderer type is not supported")}render(t,e){console.log("PolyLineLayer: render",t,e),e.type==="simple-line"?this._simpleLineRender(t,e):e.type==="ESPolygonFence"?this._esPolygonFenceRender(t,e):e.type==="ESPipeFence"?this._esPipeFenceRender(t,e):e.type==="ESPath"?this._esPathRender(t,e):e.type==="ESlineInterpolationModel"?this._eslineInterpolationModelRender(t,e):e.type==="ESlineWall"?this._eslineWallRender(t,e):console.error("PolyLineLayer: symbol type is not supported")}_simpleLineRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Fi);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...n],r.stroked=!0,r.strokeColor=e.color,r.strokeWidth=e.width||1,r.allowPicking=(e==null?void 0:e.allowPicking)??!0,r.extras={selected:!1}}_esPolygonFenceRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Wf);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...n],r.height=e.height,r.materialMode=e.materialMode}_esPipeFenceRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new qf);this.d(this.sceneObject.components.disposableAdd(r)),r.points=[...n],r.height=e.height,r.width=e.width,r.materialMode=e.materialMode}_esPathRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=this.dv(new Au),s=this.dv(new Ru);if(this.d(this.sceneObject.components.disposableAdd(r)),this.d(this.sceneObject.components.disposableAdd(s)),r.points=[...n],r.speed=e.speed,r.strokeColor=e.color,r.materialMode=e.materialMode,r.strokeWidth=e.width||1,e!=null&&e.runModel){const a=e==null?void 0:e.runSpeed,l=e==null?void 0:e.modelSymbol;let u;switch(e==null?void 0:e.runModel){case"ESHuman":u=this.dv(new Zn);break;case"ESCar":u=this.dv(new Ff);break;case"ESGltfModel":u=this.dv(new Fs)}if(this.d(this.sceneObject.components.disposableAdd(u)),l)for(let c in l)u[c]=l[c];const h=[0];for(var o=0;o<n.length-1;o+=1){const c=n[o],d=n[o+1],g=WD(c[1],c[0],d[1],d[0]);h.push(h[o]+Math.ceil(g/a)*1e3)}r.timeStamps=h,e!=null&&e.runSpeed&&(r.currentPositionChanged.don(c=>{r.currentPosition&&(u.position=r.currentPosition,r.currentRotation&&(u.rotation=r.currentRotation))}),s.startTime=0,s.stopTime=h[h.length-1],s.playing=!0,s.loop=(e==null?void 0:e.runLoop)??!0,s.currentTimeChanged.don(c=>{r.path.currentTime=c}))}}_eslineInterpolationModelRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=(e==null?void 0:e.interpolationDistance)??0;if(!r)return;const s=BD(n,r/1e3),o=this.dv(new Fs);this.d(this.sceneObject.components.disposableAdd(o)),o.url=e.url,o.instances=s.map(a=>({position:a,rotation:e.rotation,scale:e.scale}))}_eslineWallRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const r=e.height??0,s=e.width??0,o=e.extrudedHeight??0,a=n.map(h=>({lng:(h==null?void 0:h[0])??0,lat:(h==null?void 0:h[1])??0,alt:(h==null?void 0:h[2])??0})),l=qD(a,s).map(h=>[(h==null?void 0:h.lng)??0,(h==null?void 0:h.lat)??0,(h==null?void 0:h.alt)??0]),u=this.dv(new nl);this.d(this.sceneObject.components.disposableAdd(u)),u.height=r,u.extrudedHeight=o,u.filled=e.filled??!0,u.fillColor=e.fillColor,u.allowPicking=(e==null?void 0:e.allowPicking)??!0,u.extras={selected:!1},u.points=l}renderLabel(t,e){const{points:n}=t,r=zD(n);Hv(this.sceneObject,r,t,e)}}function $E(i,t){try{JSON.stringify(i[i.length-1])!==JSON.stringify(i[0])&&i.push(i[0]);const e=Fn(i.map(l=>Kt(l))),n=ue([i]);return OO(e,t,{gridType:"point",units:"meters"}).features.map(l=>l.geometry.coordinates)[0][0].filter(l=>_i(Kt(l),n))}catch(e){return console.error(e),[]}}class ZD extends B{constructor(t,e,n,r){super(),this.sceneObject=t;const s=e;if(r&&ms(s,o=>{this.renderLabel(o,r)}),n)if(n.type==="simple"){const{visualVariables:o}=n;ms(s,a=>{const l=Xv(a,n,o);this.render(a,l)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;ms(s,a=>{const l=$v(a,n,o);this.render(a,l)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;ms(s,a=>{const l=Yv(a,n,o);this.render(a,l)})}else console.error("PolyLineLayer: renderer type is not supported")}renderLabel(t,e){const{points:n}=t;console.log("PolygonLayer: renderLabel",n);const r=UD(n);Hv(this.sceneObject,r,t,e)}render(t,e){e.type==="simple-fill"?this._simplePolygonRender(t,e):e.type==="ESGeoExtrudedPolygon"?this._esGeoExtrudedPolygonRender(t,e):e.type==="PolygonInterpolateESGltfModel"?this._polygonInterpolateESGltfModelRender(t,e):e.type==="PolygonInterpolateESImageLabel"?this._polygonInterpolateESImageLabelRender(t,e):console.error("PolyLineLayer: symbol type is not supported")}_simplePolygonRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{color:r,outline:s,filled:o,ground:a}=e,{width:l,color:u,stroked:h}=s,c=this.dv(new Jt);this.d(this.sceneObject.components.disposableAdd(c)),c.stroked=h??!1,c.strokeColor=u??[1,1,1,1],c.strokeWidth=l??1,c.filled=o??!0,c.fillGround=a??!1,c.fillColor=r??[1,1,1,1],c.allowPicking=(e==null?void 0:e.allowPicking)??!0,c.extras={selected:!1},c.points=[...n]}_esGeoExtrudedPolygonRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,extrudedHeight:s,color:o}=e,a=this.dv(new nl);this.d(this.sceneObject.components.disposableAdd(a)),a.height=r,a.extrudedHeight=s,a.filled=!0,a.fillColor=o,a.allowPicking=(e==null?void 0:e.allowPicking)??!0,a.extras={selected:!1},a.points=[...n]}_polygonInterpolateESGltfModelRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,interpolateDistance:s,url:o,rotation:a,scale:l}=e,u=$E(n,s??10),h=this.dv(new Fs);this.d(this.sceneObject.components.disposableAdd(h)),h.url=o,h.instances=u.map(c=>({position:[...c,r??0],rotation:a??[0,0,0],scale:l??[1,1,1]}))}_polygonInterpolateESImageLabelRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:r,interpolateDistance:s,offset:o,size:a,url:l,anchor:u}=e,c={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:[...$E(n,s??10).map(g=>[...g,r??0])]}}]},d=this.dv(new kc);this.d(this.sceneObject.components.disposableAdd(d)),d.textDefaultText="",d.imageUrl=l,u&&(d.imageAnchor=u),o&&(d.imageOffset=o),a&&(d.imageSize=a),d.url=c}}class KD extends B{constructor(e,n){super();f(this,"_initEvent",this.dv(new O));const r=this,s=async()=>{try{const a=e.featureProps;if(!a)return;const{heightMode:l,features:u,layerType:h,url:c}=a;let d=[];if(!u&&c){let g=await fetch(c).then(p=>p.json());return g=(g==null?void 0:g.features)??g,h==="polylineVector"?d=await VE(n,g,l):h==="polygonVector"?d=await BE(n,g,l):h==="pointVector"&&(d=await zE(n,g,l)),d}else h==="polylineVector"?d=await VE(n,u,l):h==="polygonVector"?d=await BE(n,u,l):h==="pointVector"&&(d=await zE(n,u,l));return d}catch(a){console.error(a);return}},o=this.dv(Ve(this._initEvent,e.featurePropsChanged));r.dv(new qe(o,()=>{if(!e.featureProps)return;const a=e.featureProps;let l;return(async()=>{const{layerType:h,renderer:c,labelingInfo:d}=a,g=await s();!g||g.length===0||(h==="pointVector"?l=new YD(e,g,c,d):h==="polylineVector"?l=new JD(e,g,c,d):h==="polygonVector"&&(l=new ZD(e,g,c,d)),console.log("polygonVectorLayer","createLayer",l))})().catch(console.error),{destroy:()=>{var h;(h=l==null?void 0:l.destroy)==null||h.call(l),l=void 0}}}));{const a=(l,u=1)=>{const h=$1(l);if(!h)return;const{center:c,radius:d}=h;n.flyTo({distance:d*4,heading:0,pitch:-90,flyDuration:u??1,hDelta:0,pDelta:0},c)};r.d(e.flyToEvent.don(async l=>{const{featureProps:u}=e;if(!u)return;const h=await s();if(!h)return;let c=[];u.layerType==="polylineVector"?c=h.map(d=>d.points).flat():u.layerType==="polygonVector"?c=h.map(d=>d.points).flat():u.layerType==="pointVector"&&(c=h.map(d=>d.points)),c.length!==0&&a(c,l)}))}}init(){this._initEvent.emit()}}const vh=class vh extends Xt{constructor(e){super(e);f(this,"featureLayerMap",new Map);const n=this;n.d(n.viewerAttached.don(r=>{if(console.log("ESFeatureLayer","viewerAttached",r.id),n.featureLayerMap.has(r.id))return;const s=new KD(n,r);s.init(),n.featureLayerMap.set(r.id,s)})),n.d(n.viewerDetached.don(r=>{var s;console.log("ESFeatureLayer","viewerDetached",r.id),n.featureLayerMap.has(r.id)&&((s=n.featureLayerMap.get(r.id))==null||s.destroy(),n.featureLayerMap.delete(r.id))})),n.d(()=>{for(const r of n.featureLayerMap.values())r.destroy();n.featureLayerMap.clear()}),n.d(Ze(n.showChanged,()=>{for(const r of n.components.values())Reflect.has(r,"show")&&(r.show=n.show)},{immediate:!0}))}};f(vh,"createDefaultProps",()=>({...Xt.createDefaultProps(),featureProps:fe(void 0)})),f(vh,"type",vh.register("ESFeatureLayer",vh,{chsName:"矢量图层",tags:["ESObjects"],description:"ESFeatureLayer"}));let Jv=vh;const QD=[["256",256],["512",512],["1024",1024]],t4=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],Rn=class Rn extends Xt{constructor(e){super(e);f(this,"_pickFeaturesEvent",this.dv(new O));this.ad(lt([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(lt([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new mt([this,"accessToken"],"令牌",Rn.defaults.accessToken),new rr([this,"rectangle"],"矩形范围",Rn.defaults.rectangle),new Et([this,"url"],"服务地址",Rn.defaults.url),new Et([this,"style"],"样式配置",Rn.defaults.style),new D([this,"zIndex"],"层级序号",Rn.defaults.zIndex),new ft([this,"tileSize"],QD,"瓦片大小",256),new Qe([this,"maximumLevel"],1,[1,24],"最大层级",Rn.defaults.maximumLevel),new Qe([this,"minimumLevel"],1,[0,24],"最小层级",Rn.defaults.minimumLevel),new ft([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像切片规则",Rn.defaults.scheme),new ft([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考"),new mt([this,"targetID"],"targetID")],more:[...e.more,new wt("通用"),new ft([this,"splitDirection"],t4,"splitDirection","NONE"),new wt("czm"),new D([this,"czmAlpha"],"透明度"),new D([this,"czmBrightness"],"亮度"),new D([this,"czmContrast"],"对比度"),new D([this,"czmHue"],"色相"),new D([this,"czmSaturation"],"饱和度"),new D([this,"czmGamma"],"伽马值")]}}};f(Rn,"createDefaultProps",()=>({...Xt.createDefaultProps(),rectangle:fe([-180,-90,180,90]),url:bt(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:oe([]),scheme:z("xyz"),czmSplitDirection:"NONE",heightReference:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",targetID:"",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),f(Rn,"type",Rn.register("ESMVTLayer",Rn,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"用于加载矢量瓦片图层。"}));let Zv=Rn;const Zs=class Zs extends ct{constructor(t){super(t)}getESProperties(){return{...{...super.getESProperties()},basic:[new D([this,"radius"],"半径",Zs.defaults.radius),new D([this,"height"],"高度",Zs.defaults.height),new Dt([this,"color"],"颜色",Zs.defaults.color),new Et([this,"materialParams"],"材质参数",Zs.defaults.materialParams)]}}};f(Zs,"createDefaultProps",()=>({...ct.createDefaultProps(),radius:2,height:10,color:ot([.204,.596,.859,1]),materialParams:bt({ringSpeed:1,ringColor:[1,1,1,1],ringWidth:.03,sides:10,ringRatio:1,ringRepeat:1,ringBottomMove:!1})})),f(Zs,"type",Zs.register("ESCylinder",Zs,{chsName:"圆柱",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"圆柱体"}));let rl=Zs;const gs=class gs extends Lc{constructor(t){super(t)}getESProperties(){const t=super.getESProperties();return{...t,dataSource:[...t.dataSource,new ft([this,"videoStreamType"],gs.videoStreamTypes,"数据源类型",gs.defaults.videoStreamType),new H([this,"looping"],"循环播放",gs.defaults.looping),new H([this,"play"],"播放状态",gs.defaults.play)]}}};f(gs,"createDefaultProps",()=>({...Lc.createDefaultProps(),videoStreamType:"video",looping:!0,play:!0})),f(gs,"type",gs.register("ESMediaLayer",gs,{chsName:"媒体图层",tags:["ESObjects","_ES_Impl_Cesium"],description:"用于添加数据源为图片或者视频的图层"})),f(gs,"videoStreamTypes",[["video","video"],["hls","hls"],["flv","flv"],["img","img"]]);let Kv=gs;const Ks=class Ks extends Xt{constructor(e){super(e);f(this,"_getRepairPolygonEvent",this.disposeVar(new O));f(this,"_getIndicesEvent",this.disposeVar(new O));f(this,"_startEvent",this.disposeVar(new O))}getESProperties(){return{...{...super.getESProperties()},defaultMenu:"general",basic:[new Et([this,"urls"],"URL",Ks.defaults.urls),new ft([this,"mode"],Ks.modes,"模式",Ks.defaults.mode),new vt("开始编辑",()=>this.start(),[])]}}get getRepairPolygonEvent(){return this._getRepairPolygonEvent}getRepairPolygon(){return new Promise((e,n)=>{const r=new B;r.ad(this._getRepairPolygonEvent.don(o=>{o!="get"&&e(o)})),this.getRepairPolygonEvent.emit("get");const s=setTimeout(()=>{r.isDestroyed()||(r.destroy(),e(void 0))},2e3);r.ad(()=>clearTimeout(s))})}get getIndicesEvent(){return this._getIndicesEvent}getIndices(){return new Promise((e,n)=>{const r=new B;r.ad(this._getIndicesEvent.don(o=>{o!="get"&&e(o)})),this.getIndicesEvent.emit("get");const s=setTimeout(()=>{r.isDestroyed()||(r.destroy(),e(void 0))},2e3);r.ad(()=>clearTimeout(s))})}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}};f(Ks,"createDefaultProps",()=>({...Xt.createDefaultProps(),urls:oe([]),mode:"repair",allowPicking:!0})),f(Ks,"type",Ks.register("ESGltfModelEditing",Ks,{chsName:"GLTF模型编辑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载GLTF模型的 ES 对象"})),f(Ks,"modes",[["删除","delete"],["修复","repair"]]);let Qv=Ks;const Sa=class Sa extends Zn{constructor(e){super(e);f(this,"humans",[]);f(this,"humansOffset",new Map);this.ad(this.clear.bind(this)),this.updateHumans();const n=this.ad(Ve(this.instancesCountChanged,this.radiusChanged));this.ad(n.don(this.updateHumans.bind(this)))}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new D([this,"instancesCount"],"实例数量",1,Sa.defaults.instancesCount),new D([this,"radius"],"半径",1,Sa.defaults.radius)]}}updateHumans(){for(this.clear();this.humans.length+1<this.instancesCount;){const e=new Zn;this.humansOffset.set(e.id,[Math.random()*this.radius,Math.random()*this.radius,0]),this.humans.push(e),this.components.add(e),e.d(F([e,"show"],[this,"show"])),e.d(F([e,"allowPicking"],[this,"allowPicking"])),e.d(F([e,"scale"],[this,"scale"])),e.d(F([e,"collision"],[this,"collision"])),e.d(lt([e,"flyInParam"],[this,"flyInParam"])),e.d(lt([e,"flyToParam"],[this,"flyToParam"])),e.d(F([e,"animation"],[this,"animation"])),e.d(F([e,"mode"],[this,"mode"])),e.d(F([e,"minVisibleDistance"],[this,"minVisibleDistance"])),e.d(F([e,"maxVisibleDistance"],[this,"maxVisibleDistance"])),e.d(Ze([this.positionChanged],()=>{const n=bm(this.position,this.humansOffset.get(e.id)??[0,0,0]);n&&(e.position=n)},{immediate:!0})),e.d(lt([e,"rotation"],[this,"rotation"])),e.d(this.flyInEvent.don(n=>{e.flyIn(n)})),e.d(this.flyToEvent.don(n=>{e.flyTo(n)})),e.d(this.calcFlyToParamEvent.don(()=>{e.calcFlyToParam()})),e.d(this.calcFlyInParamEvent.don(()=>{e.calcFlyInParam()})),e.d(this.smoothMoveEvent.don((n,r)=>{e.smoothMove(n,r)})),e.d(this.smoothMoveWithRotationEvent.don((n,r,s)=>{e.smoothMoveWithRotation(n,r,s)})),e.d(this.smoothMoveOnGroundEvent.don((n,r,s,o)=>{e.smoothMoveOnGround(n,r,s,o)})),e.d(this.smoothMoveWithRotationOnGroundEvent.don((n,r,s,o,a)=>{e.smoothMoveWithRotationOnGround(n,r,s,o,a)})),e.d(this.automaticLandingEvent.don(()=>{e.automaticLanding()})),e.d(e.readyEvent.don(n=>{this.readyEvent.emit(n)}))}}clear(){this.humans.forEach(e=>{this.components.delete(e)}),this.humans=[],this.humansOffset.clear()}};f(Sa,"createDefaultProps",()=>({...Zn.createDefaultProps(),instancesCount:1,radius:1})),f(Sa,"type",Sa.register("ESHumans",Sa,{chsName:"人员(批量)",tags:["ESObjects"],description:"批量创建ESHumans对象"}));let t0=Sa;const Tl=class Tl extends Fi{constructor(e){super(e);f(this,"_line",this.ad(new Fi));f(this,"_arrowPolygon",this.ad(new Jt));this.ad(this.components.disposableAdd(this.line,!0)),this.line.show=!1,this.ad(this.components.disposableAdd(this.arrowPolygon));const{line:n,arrowPolygon:r}=this;this.ad(lt([n,"points"],[this,"points"])),this.ad(Ze([this.pointsChanged,this.modeChanged],()=>{this.updateArrowPolygon()},{immediate:!0})),this.ad(F([r,"show"],[this,"show"])),this.ad(F([r,"collision"],[this,"collision"])),this.ad(F([r,"allowPicking"],[this,"allowPicking"])),this.ad(F([r,"filled"],[this,"filled"])),this.ad(F([r,"fillGround"],[this,"fillGround"])),this.ad(F([r,"fillColor"],[this,"fillColor"])),this.ad(F([r,"fillMaterial"],[this,"fillMaterial"])),this.ad(F([r,"fillMaterialParams"],[this,"fillMaterialParams"])),this.ad(F([r,"stroked"],[this,"stroked"])),this.ad(F([r,"strokeGround"],[this,"strokeGround"])),this.ad(F([r,"strokeColor"],[this,"strokeColor"])),this.ad(F([r,"strokeMaterial"],[this,"strokeMaterial"])),this.ad(F([r,"strokeMaterialParams"],[this,"strokeMaterialParams"])),this.ad(F([r,"strokeWidth"],[this,"strokeWidth"])),this.ad(F([r,"strokeWidthType"],[this,"strokeWidthType"])),this.ad(F([r,"classificationType"],[this,"classificationType"]))}get line(){return this._line}get arrowPolygon(){return this._arrowPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,style:[...e.style,new ft([this,"mode"],ep,"箭头模式",Tl.defaults.mode)]}}updateArrowPolygon(){const e=this.points;if(!e||e.length<3){this._arrowPolygon.points=[];return}let n=Tm(e,this.mode,!0);n&&n.length>=3?this._arrowPolygon.points=[...n,n[0]]:this._arrowPolygon.points=[]}};f(Tl,"createDefaultProps",()=>({...Fi.createDefaultProps(),mode:"straightArrow",stroked:!1,filled:!0,fillStyle:bt({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),f(Tl,"type",Tl.register("ESAttackArrow",Tl,{chsName:"进攻箭头",tags:["ESObjects","_ES_Impl_Cesium"],description:"进攻箭头,军事标绘箭头类,支持直箭头和燕尾箭头"}));let e0=Tl;const Nl=class Nl extends Fs{constructor(e){super(e);f(this,"esCylinder",this.dv(new rl));const n=this.esCylinder;n.color=[1,1,1,0],this.ad(this.components.disposableAdd(this.esCylinder)),this.ad(F([n,"show"],[this,"show"])),this.ad(F([n,"collision"],[this,"collision"])),this.ad(F([n,"allowPicking"],[this,"allowPicking"])),this.ad(F([n,"position"],[this,"position"])),this.ad(F([n,"radius"],[this,"esCylinderRadius"])),this.ad(F([n,"height"],[this,"esCylinderHeight"])),this.ad(F([n,"materialParams"],[this,"esCylinderMaterialParams"])),this.ad(Ze(this.esCylinderRotationChanged,()=>{const r=this.esCylinderRotation;n.rotation=[r[0],r[1]-180,r[2]]},{immediate:!0}))}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new Ah([this,"esCylinderRotation"],"波动方向",Nl.defaults.esCylinderRotation),new D([this,"esCylinderRadius"],"半径",rl.defaults.esCylinderRadius),new D([this,"esCylinderHeight"],"高度",rl.defaults.esCylinderHeight),new Et([this,"esCylinderMaterialParams"],"材质参数",rl.defaults.esCylinderMaterialParams)]}}};f(Nl,"createDefaultProps",()=>({...Fs.createDefaultProps(),url:"${earthsdk3-assets-script-dir}/assets/glb/CesiumDrone.glb",esCylinderRotation:ot([0,0,0]),esCylinderRadius:2,esCylinderHeight:10,esCylinderMaterialParams:bt({ringSpeed:1,ringColor:[1,1,0,1],ringWidth:.03,sides:10,ringRatio:1,ringRepeat:10,ringBottomMove:!0})})),f(Nl,"type",Nl.register("ESSignalInterference",Nl,{chsName:"信号干扰",tags:["ESObjects"],description:"信号干扰"}));let i0=Nl;const To=class To extends B{constructor(){super();f(this,"_loading",!1);f(this,"_loadedEvent",this.disposeVar(new O));f(this,"_loaded",!1);f(this,"_loadedPromiseResolve");f(this,"_loadedPromise",new Promise(e=>{this._loadedPromiseResolve=e}));f(this,"_processing");this._processing=this.disposeVar(Ln(async e=>{if(this._loading=!0,window.Hls)console.info("可能系统已经加载hlsjs,此处不再加载!");else{const n=pt.context.getStrFromEnv(To.path);await e.promise(Mg(n))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})),this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return To._instance=To._instance||new To,To._instance}};f(To,"path","${xr-utils-script-dir}/xr-static/xr-utils/hlsjs/1.4.12/hls.min.js"),f(To,"_instance");let Zf=To,e4=class extends B{constructor(e,n){super();f(this,"_element");this._complexImage=e,this._videoSrc=n;var r=document.createElement("video");r.src=this._videoSrc,r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.zIndex="-100",r.style.visibility="hidden";{const s=()=>{r.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{r.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{r.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}r.muted=!0,document.body.appendChild(r),this._element=r,this.dispose(()=>document.body.removeChild(r))}get element(){return this._element}};class i4 extends B{constructor(e,n){super();f(this,"_videoDom");f(this,"_processing");this._complexImage=e,this._videoSrc=n,this._videoDom=this.disposeVar(new e4(this._complexImage,"")),this._processing=this.disposeVar(Ln(async r=>{const{videoSrc:s}=this,o=Zf.instance();await r.promise(o.loadedPromise);const a=window.Hls,l=new a,u=this.element;await Ia(r,()=>new Promise((h,c)=>{u.xbsjHLS=l,l.attachMedia(u),l.on(a.Events.MEDIA_ATTACHED,()=>{l.loadSource(s),l.on(a.Events.MANIFEST_PARSED,(d,g)=>{u.play(),h()})}),l.on(a.Events.ERROR,(d,g)=>{const{type:p,details:E,fatal:b}=g;b&&(l.destroy(),c(E))})}))})),this._processing.start()}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class YE extends B{constructor(e,n){super();f(this,"_videoDom");f(this,"_update");this._complexImage=e,this._imageUri=n,this._videoDom=this.disposeVar(new i4(this._complexImage,this._imageUri)),this._update=this.disposeVar(zl(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:n,videoHeight:r}=this.videoElement;e.size=[n,r],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}const No=class No extends B{constructor(){super();f(this,"_loading",!1);f(this,"_loadedEvent",this.disposeVar(new O));f(this,"_loaded",!1);f(this,"_loadedPromiseResolve");f(this,"_loadedPromise",new Promise(e=>{this._loadedPromiseResolve=e}));f(this,"_processing");this._processing=this.disposeVar(Ln(async e=>{if(this._loading=!0,window.flvjs)console.info("可能系统已经加载flvjs,此处不再加载!");else{const n=pt.context.getStrFromEnv(No.path);await e.promise(Mg(n))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})),this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return No._instance=No._instance||new No,No._instance}};f(No,"path","${xr-utils-script-dir}/xr-static/xr-utils/flvjs/1.6.2/flv.min.js"),f(No,"_instance");let Kf=No;class n4 extends B{constructor(e,n){super();f(this,"_element");this._complexImage=e,this._videoSrc=n;var r=document.createElement("video");r.src=this._videoSrc,r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.zIndex="-100",r.style.visibility="hidden";{const s=()=>{r.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{r.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{r.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}r.muted=!0,document.body.appendChild(r),this._element=r,this.dispose(()=>document.body.removeChild(r))}get element(){return this._element}}class r4 extends B{constructor(e,n){super();f(this,"_videoDom");f(this,"_processing");this._complexImage=e,this._videoSrc=n,this._videoDom=this.disposeVar(new n4(this._complexImage,"")),this._processing=this.disposeVar(Ln(async r=>{const{videoSrc:s}=this,o=Kf.instance();await r.promise(o.loadedPromise);const a=window.flvjs,l=this.element;await Ia(r,()=>new Promise((u,h)=>{if(!a.isSupported()){h("flvjs不支持!");return}var c=a.createPlayer({type:"flv",url:s});c.attachMediaElement(l),c.load(),c.play(),l.xbsjFlvPlayer=c}))})),this._processing.start()}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class JE extends B{constructor(e,n){super();f(this,"_videoDom");f(this,"_update");this._complexImage=e,this._imageUri=n,this._videoDom=this.disposeVar(new r4(e,this._imageUri)),this._update=this.disposeVar(zl(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:n,videoHeight:r}=this.videoElement;e.size=[n,r],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}function ZE(i){const t=i.substring(i.lastIndexOf(".")+1);return Bc.suffixTypes[t]}class Bc extends B{constructor(){super();f(this,"_enabled",this.disposeVar(z(!1)));f(this,"_uri",this.disposeVar(z("")));f(this,"_type",this.disposeVar(z(void 0)));f(this,"_size",this.disposeVar(oe(void 0)));f(this,"_pixelFormat",this.disposeVar(z("RGBA")));f(this,"_flipY",this.disposeVar(z(!0)));f(this,"_crossOriginReact",this.disposeVar(z("")));f(this,"_autoplayReact",this.disposeVar(z(!0)));f(this,"_loopReact",this.disposeVar(z(!0)));f(this,"_copyTextureEvent",this.disposeVar(new O));f(this,"_imageProcessingResettingEvent",this.disposeVar(Ve(this.enabledChanged,this.uriChanged,this.typeChanged)));f(this,"_imageProcessingResetting",this.disposeVar(new qe(this._imageProcessingResettingEvent,()=>{if(!this.enabled||!this.uri)return;let{type:e}=this;if(e||(e=ZE(this.uri)),!!e){if(e==="img")return new uy(this,this.uri);if(e==="video")return new dy(this,this.uri);if(e==="gif")return new Sy(this,this.uri);if(e==="hls")return new YE(this,this.uri);if(e==="flv")return new JE(this,this.uri)}})));f(this,"_createNativeTextureEvent",this.disposeVar(Ve(this.enabledChanged,this.sizeChanged,this.pixelFormatChanged,this.flipYChanged)))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get uri(){return this._uri.value}set uri(e){this._uri.value=e}get uriChanged(){return this._uri.changed}get type(){return this._type.value}set type(e){this._type.value=e}get typeChanged(){return this._type.changed}get size(){return this._size.value}set size(e){this._size.value=e}get sizeChanged(){return this._size.changed}get pixelFormat(){return this._pixelFormat.value}set pixelFormat(e){this._pixelFormat.value=e}get pixelFormatChanged(){return this._pixelFormat.changed}get flipY(){return this._flipY.value}set flipY(e){this._flipY.value=e}get flipYChanged(){return this._flipY.changed}get crossOrigin(){return this._crossOriginReact.value}set crossOrigin(e){this._crossOriginReact.value=e}get crossOriginChanged(){return this._crossOriginReact.changed}get autoplay(){return this._autoplayReact.value}set autoplay(e){this._autoplayReact.value=e}get autoplayChanged(){return this._autoplayReact.changed}get loop(){return this._loopReact.value}set loop(e){this._loopReact.value=e}get loopChanged(){return this._loopReact.changed}get copyTextureEvent(){return this._copyTextureEvent}copyTexture(e){this._createNativeTextureEvent.flush(),this._copyTextureEvent.emit(e)}get imageProcessingResetting(){return this._imageProcessingResetting}get createNativeTextureEvent(){return this._createNativeTextureEvent}copyFromCanvas(e){if(e.width<=0||e.height<=0){console.warn("canvas.width <= 0 || canvas.height <= 0");return}this.size=[e.width,e.height],this.pixelFormat="RGBA",this.copyTexture({source:e})}}f(Bc,"types",cy),f(Bc,"czmPixelFormats",hy),f(Bc,"suffixTypes",{png:"img",jpg:"img",svg:"img",webp:"img",gif:"gif",mp4:"video",mov:"video",webm:"video",flv:"flv",m3u8:"hls"});const s4=[0,0,0,0];class o4{constructor(){f(this,"_value",[]);f(this,"_valueStr","[]");f(this,"_valueChanged");this.value=[{ratio:0,rgba:[0,0,1,1]},{ratio:.2,rgba:[0,1,0,1]},{ratio:.8,rgba:[1,1,0,1]},{ratio:1,rgba:[1,0,0,1]}]}get valueChanged(){return this._valueChanged||(this._valueChanged=new O),this._valueChanged}set value(t){if(t.length===0){console.error("value.length === 0");return}let e;if(this._value.length===t.length){const r=[...t].sort((s,o)=>s.ratio-o.ratio);if(e=JSON.stringify(r),this._valueStr===e)return}e=e||JSON.stringify([...t].sort((r,s)=>r.ratio-s.ratio));const n=this._value;if(this._value=JSON.parse(e),this._value.length===0)throw console.error("this._colorStops.length === 0"),new Error("this._colorStops.length === 0");this._valueChanged&&this._valueChanged.emit(this._value,n)}get value(){return JSON.parse(JSON.stringify(this._value))}get valueStr(){return this._valueStr}get minRatio(){return this._value[0].ratio}get maxRatio(){return this._value[this._value.length-1].ratio}_getRatioIndex(t){if(t<this._value[0].ratio||t>this._value[this._value.length-1].ratio)throw console.error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio"),new Error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio");let e=this._value.length;for(let n=0;n<e-1;++n)if(t>=this._value[n].ratio&&t<=this._value[n+1].ratio)return n;throw console.error("shoud not be here!"),new Error("shoud not be here!")}getRatioColor(t,e){t=vd(t,this.minRatio,this.maxRatio);const n=this._getRatioIndex(t),r=this._value[n],s=this._value[n+1],o=(t-r.ratio)/(s.ratio-r.ratio);for(let a=0;a<4;++a)e[a]=r.rgba[a]*(1-o)+s.rgba[a]*o;if(e.some(Number.isNaN)){console.error("result NaN");return}return e}getColorsInUint8(t){if(t.length%4!==0)throw console.error("result.length % 4 !== 0"),new Error("result.length % 4 !== 0");const e=t.length/4,n=1/e;for(let r=0;r<e;++r){const s=s4;this.getRatioColor((r+.5)*n,s)||s.splice(0,4,0,0,0,0);for(let o=0;o<4;++o)t[r*4+o]=255*s[o]|0}return t}}class a4 extends B{constructor(){super(...arguments);f(this,"registerEngines",{})}register(e,n,r){const s=this.registerEngines[e]||new Map;return s.has(n)&&console.warn(`register warn:${e}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,r),this.registerEngines[e]=s,n}getEngineObjConstructor(e,n){const r=this.registerEngines[n];if(!r)return;let s=e.constructor,o=e.typeName,a=r.get(o);if(a)return a;if(e.components.main)return;const l=o;for(;o!=="ESSceneObject"&&(s=s.getParentClass(),!!s);)if(o=s.type,a=r.get(o),a)return console.warn(`未找到${l}在${n}中对应的实现类! 使用父类${o}的实现类!`),a}createEngineObject(e,n){const r=this.getEngineObjConstructor(e,n.typeName);if(r){const s=new r(e,n);return s.createdEvent.emit(),s}else{const s=new sl(e,n);return s.createdEvent.emit(),s}}}class l4 extends B{constructor(){super(...arguments);f(this,"registerEngines",{})}register(e,n,r){const s=this.registerEngines[e]||new Map;s.has(n)&&console.warn(`register warn:${e}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,r),this.registerEngines[e]=s}getEngineObjConstructor(e,n){const s=(this.registerEngines[n]||new Map).get(e);if(s)return s;console.warn(`未找到${e}在${n}中对应的实现类!`)}createEngineObject(e,n){const r=this.getEngineObjConstructor(e.typeName,n.typeName);if(r){const s=new r(e,n);return s.createdEvent.emit(),s}else{const s=new sl(e,n);return s.createdEvent.emit(),s}}}const Lr=class Lr extends B{constructor(e,n,r=!1){super();f(this,"_createdEvent",this.dv(new O));f(this,"_id",++Lr._accumId);this._sceneObject=e,this._viewer=n;{if(r)return;const s=(o,a)=>{for(let l of o)this._viewer.delete(l);for(let l of a)l.parentID=this.sceneObject.id,this._viewer.add(l)};s([],this._sceneObject.components.values()),this.d(this._sceneObject.components.toChange.don(s)),this.d(()=>s(this._sceneObject.components.values(),[]))}}get createdEvent(){return this._createdEvent}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get id(){return this._id}};f(Lr,"context",new a4),f(Lr,"contextEditing",new l4),f(Lr,"register",Lr.context.register.bind(Lr.context)),f(Lr,"registerEditing",Lr.contextEditing.register.bind(Lr.contextEditing)),f(Lr,"_accumId",-1);let sl=Lr;var Zt;(function(i){i.assertEqual=r=>{};function t(r){}i.assertIs=t;function e(r){throw new Error}i.assertNever=e,i.arrayToEnum=r=>{const s={};for(const o of r)s[o]=o;return s},i.getValidEnumValues=r=>{const s=i.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),o={};for(const a of s)o[a]=r[a];return i.objectValues(o)},i.objectValues=r=>i.objectKeys(r).map(function(s){return r[s]}),i.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&s.push(o);return s},i.find=(r,s)=>{for(const o of r)if(s(o))return o},i.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function n(r,s=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}i.joinValues=n,i.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(Zt||(Zt={}));var n0;(function(i){i.mergeShapes=(t,e)=>({...t,...e})})(n0||(n0={}));const ut=Zt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Eo=i=>{switch(typeof i){case"undefined":return ut.undefined;case"string":return ut.string;case"number":return Number.isNaN(i)?ut.nan:ut.number;case"boolean":return ut.boolean;case"function":return ut.function;case"bigint":return ut.bigint;case"symbol":return ut.symbol;case"object":return Array.isArray(i)?ut.array:i===null?ut.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?ut.promise:typeof Map<"u"&&i instanceof Map?ut.map:typeof Set<"u"&&i instanceof Set?ut.set:typeof Date<"u"&&i instanceof Date?ut.date:ut.object;default:return ut.unknown}},Y=Zt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),u4=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:");class Kn extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=t}format(t){const e=t||function(s){return s.message},n={_errors:[]},r=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)n._errors.push(e(o));else{let a=n,l=0;for(;l<o.path.length;){const u=o.path[l];l===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(e(o))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return r(this),n}static assert(t){if(!(t instanceof Kn))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Zt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=e=>e.message){const e={},n=[];for(const r of this.issues)if(r.path.length>0){const s=r.path[0];e[s]=e[s]||[],e[s].push(t(r))}else n.push(t(r));return{formErrors:n,fieldErrors:e}}get formErrors(){return this.flatten()}}Kn.create=i=>new Kn(i);const Fu=(i,t)=>{let e;switch(i.code){case Y.invalid_type:i.received===ut.undefined?e="Required":e=`Expected ${i.expected}, received ${i.received}`;break;case Y.invalid_literal:e=`Invalid literal value, expected ${JSON.stringify(i.expected,Zt.jsonStringifyReplacer)}`;break;case Y.unrecognized_keys:e=`Unrecognized key(s) in object: ${Zt.joinValues(i.keys,", ")}`;break;case Y.invalid_union:e="Invalid input";break;case Y.invalid_union_discriminator:e=`Invalid discriminator value. Expected ${Zt.joinValues(i.options)}`;break;case Y.invalid_enum_value:e=`Invalid enum value. Expected ${Zt.joinValues(i.options)}, received '${i.received}'`;break;case Y.invalid_arguments:e="Invalid function arguments";break;case Y.invalid_return_type:e="Invalid function return type";break;case Y.invalid_date:e="Invalid date";break;case Y.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(e=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(e=`${e} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?e=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?e=`Invalid input: must end with "${i.validation.endsWith}"`:Zt.assertNever(i.validation):i.validation!=="regex"?e=`Invalid ${i.validation}`:e="Invalid";break;case Y.too_small:i.type==="array"?e=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?e=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?e=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="bigint"?e=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?e=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:e="Invalid input";break;case Y.too_big:i.type==="array"?e=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?e=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?e=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?e=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?e=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:e="Invalid input";break;case Y.custom:e="Invalid input";break;case Y.invalid_intersection_types:e="Intersection results could not be merged";break;case Y.not_multiple_of:e=`Number must be a multiple of ${i.multipleOf}`;break;case Y.not_finite:e="Number must be finite";break;default:e=t.defaultError,Zt.assertNever(i)}return{message:e}};let KE=Fu;function h4(i){KE=i}function Qf(){return KE}const tg=i=>{const{data:t,path:e,errorMaps:n,issueData:r}=i,s=[...e,...r.path||[]],o={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let a="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:t,defaultError:a}).message;return{...r,path:s,message:a}},c4=[];function st(i,t){const e=Qf(),n=tg({issueData:t,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,e,e===Fu?void 0:Fu].filter(r=>!!r)});i.common.issues.push(n)}class Yi{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,e){const n=[];for(const r of e){if(r.status==="aborted")return Mt;r.status==="dirty"&&t.dirty(),n.push(r.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,e){const n=[];for(const r of e){const s=await r.key,o=await r.value;n.push({key:s,value:o})}return Yi.mergeObjectSync(t,n)}static mergeObjectSync(t,e){const n={};for(const r of e){const{key:s,value:o}=r;if(s.status==="aborted"||o.status==="aborted")return Mt;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(n[s.value]=o.value)}return{status:t.value,value:n}}}const Mt=Object.freeze({status:"aborted"}),ku=i=>({status:"dirty",value:i}),pn=i=>({status:"valid",value:i}),r0=i=>i.status==="aborted",s0=i=>i.status==="dirty",ol=i=>i.status==="valid",Uc=i=>typeof Promise<"u"&&i instanceof Promise;var yt;(function(i){i.errToObj=t=>typeof t=="string"?{message:t}:t||{},i.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(yt||(yt={}));class ks{constructor(t,e,n,r){this._cachedPath=[],this.parent=t,this.data=e,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const QE=(i,t)=>{if(ol(t))return{success:!0,data:t.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const e=new Kn(i.common.issues);return this._error=e,this._error}}};function Ft(i){if(!i)return{};const{errorMap:t,invalid_type_error:e,required_error:n,description:r}=i;if(t&&(e||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(o,a)=>{const{message:l}=i;return o.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??n??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:l??e??a.defaultError}},description:r}}class jt{get description(){return this._def.description}_getType(t){return Eo(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:Eo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Yi,ctx:{common:t.parent.common,data:t.data,parsedType:Eo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const e=this._parse(t);if(Uc(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(t){const e=this._parse(t);return Promise.resolve(e)}parse(t,e){const n=this.safeParse(t,e);if(n.success)return n.data;throw n.error}safeParse(t,e){const n={common:{issues:[],async:(e==null?void 0:e.async)??!1,contextualErrorMap:e==null?void 0:e.errorMap},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Eo(t)},r=this._parseSync({data:t,path:n.path,parent:n});return QE(n,r)}"~validate"(t){var n,r;const e={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Eo(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:e});return ol(s)?{value:s.value}:{issues:e.common.issues}}catch(s){(r=(n=s==null?void 0:s.message)==null?void 0:n.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),e.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:e}).then(s=>ol(s)?{value:s.value}:{issues:e.common.issues})}async parseAsync(t,e){const n=await this.safeParseAsync(t,e);if(n.success)return n.data;throw n.error}async safeParseAsync(t,e){const n={common:{issues:[],contextualErrorMap:e==null?void 0:e.errorMap,async:!0},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Eo(t)},r=this._parse({data:t,path:n.path,parent:n}),s=await(Uc(r)?r:Promise.resolve(r));return QE(n,s)}refine(t,e){const n=r=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(r):e;return this._refinement((r,s)=>{const o=t(r),a=()=>s.addIssue({code:Y.custom,...n(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,e){return this._refinement((n,r)=>t(n)?!0:(r.addIssue(typeof e=="function"?e(n,r):e),!1))}_refinement(t){return new is({schema:this,typeName:Z.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return js.create(this,this._def)}nullable(){return ca.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return es.create(this)}promise(){return zu.create(this,this._def)}or(t){return Xc.create([this,t],this._def)}and(t){return $c.create(this,t,this._def)}transform(t){return new is({...Ft(this._def),schema:this,typeName:Z.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const e=typeof t=="function"?t:()=>t;return new Qc({...Ft(this._def),innerType:this,defaultValue:e,typeName:Z.ZodDefault})}brand(){return new l0({typeName:Z.ZodBranded,type:this,...Ft(this._def)})}catch(t){const e=typeof t=="function"?t:()=>t;return new td({...Ft(this._def),innerType:this,catchValue:e,typeName:Z.ZodCatch})}describe(t){const e=this.constructor;return new e({...this._def,description:t})}pipe(t){return ed.create(this,t)}readonly(){return id.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const d4=/^c[^\s-]{8,}$/i,f4=/^[0-9a-z]+$/,g4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,p4=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,m4=/^[a-z0-9_-]{21}$/i,v4=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,y4=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_4=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,w4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let o0;const E4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,S4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,b4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,C4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,P4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,x4=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,tS="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",I4=new RegExp(`^${tS}$`);function eS(i){let t="[0-5]\\d";i.precision?t=`${t}\\.\\d{${i.precision}}`:i.precision==null&&(t=`${t}(\\.\\d+)?`);const e=i.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e}`}function M4(i){return new RegExp(`^${eS(i)}$`)}function iS(i){let t=`${tS}T${eS(i)}`;const e=[];return e.push(i.local?"Z?":"Z"),i.offset&&e.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${e.join("|")})`,new RegExp(`^${t}$`)}function T4(i,t){return!!((t==="v4"||!t)&&E4.test(i)||(t==="v6"||!t)&&b4.test(i))}function N4(i,t){if(!v4.test(i))return!1;try{const[e]=i.split(".");if(!e)return!1;const n=e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(4-e.length%4)%4,"="),r=JSON.parse(atob(n));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function O4(i,t){return!!((t==="v4"||!t)&&S4.test(i)||(t==="v6"||!t)&&C4.test(i))}class ts extends jt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ut.string){const s=this._getOrReturnCtx(t);return st(s,{code:Y.invalid_type,expected:ut.string,received:s.parsedType}),Mt}const n=new Yi;let r;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(r=this._getOrReturnCtx(t,r),st(r,{code:Y.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(r=this._getOrReturnCtx(t,r),st(r,{code:Y.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,a=t.data.length<s.value;(o||a)&&(r=this._getOrReturnCtx(t,r),o?st(r,{code:Y.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&st(r,{code:Y.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")_4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"email",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")o0||(o0=new RegExp(w4,"u")),o0.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"emoji",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")p4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"uuid",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")m4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"nanoid",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")d4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"cuid",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")f4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"cuid2",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")g4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"ulid",code:Y.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),st(r,{validation:"url",code:Y.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"regex",code:Y.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?iS(s).test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?I4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?M4(s).test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{code:Y.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?y4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"duration",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?T4(t.data,s.version)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"ip",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?N4(t.data,s.alg)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"jwt",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?O4(t.data,s.version)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"cidr",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?P4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"base64",code:Y.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?x4.test(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{validation:"base64url",code:Y.invalid_string,message:s.message}),n.dirty()):Zt.assertNever(s);return{status:n.value,value:t.data}}_regex(t,e,n){return this.refinement(r=>t.test(r),{validation:e,code:Y.invalid_string,...yt.errToObj(n)})}_addCheck(t){return new ts({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...yt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...yt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...yt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...yt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...yt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...yt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...yt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...yt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...yt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...yt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...yt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...yt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...yt.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...yt.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...yt.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...yt.errToObj(t)})}regex(t,e){return this._addCheck({kind:"regex",regex:t,...yt.errToObj(e)})}includes(t,e){return this._addCheck({kind:"includes",value:t,position:e==null?void 0:e.position,...yt.errToObj(e==null?void 0:e.message)})}startsWith(t,e){return this._addCheck({kind:"startsWith",value:t,...yt.errToObj(e)})}endsWith(t,e){return this._addCheck({kind:"endsWith",value:t,...yt.errToObj(e)})}min(t,e){return this._addCheck({kind:"min",value:t,...yt.errToObj(e)})}max(t,e){return this._addCheck({kind:"max",value:t,...yt.errToObj(e)})}length(t,e){return this._addCheck({kind:"length",value:t,...yt.errToObj(e)})}nonempty(t){return this.min(1,yt.errToObj(t))}trim(){return new ts({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ts({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ts({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxLength(){let t=null;for(const e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}}ts.create=i=>new ts({checks:[],typeName:Z.ZodString,coerce:(i==null?void 0:i.coerce)??!1,...Ft(i)});function D4(i,t){const e=(i.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,r=e>n?e:n,s=Number.parseInt(i.toFixed(r).replace(".","")),o=Number.parseInt(t.toFixed(r).replace(".",""));return s%o/10**r}class la extends jt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ut.number){const s=this._getOrReturnCtx(t);return st(s,{code:Y.invalid_type,expected:ut.number,received:s.parsedType}),Mt}let n;const r=new Yi;for(const s of this._def.checks)s.kind==="int"?Zt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),st(n,{code:Y.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?D4(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),st(n,{code:Y.not_finite,message:s.message}),r.dirty()):Zt.assertNever(s);return{status:r.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,yt.toString(e))}gt(t,e){return this.setLimit("min",t,!1,yt.toString(e))}lte(t,e){return this.setLimit("max",t,!0,yt.toString(e))}lt(t,e){return this.setLimit("max",t,!1,yt.toString(e))}setLimit(t,e,n,r){return new la({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:n,message:yt.toString(r)}]})}_addCheck(t){return new la({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:yt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:yt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:yt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:yt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:yt.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:yt.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:yt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:yt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:yt.toString(t)})}get minValue(){let t=null;for(const e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(const e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Zt.isInteger(t.value))}get isFinite(){let t=null,e=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(e===null||n.value>e)&&(e=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(e)&&Number.isFinite(t)}}la.create=i=>new la({checks:[],typeName:Z.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...Ft(i)});class ua extends jt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ut.bigint)return this._getInvalidInput(t);let n;const r=new Yi;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),st(n,{code:Y.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):Zt.assertNever(s);return{status:r.value,value:t.data}}_getInvalidInput(t){const e=this._getOrReturnCtx(t);return st(e,{code:Y.invalid_type,expected:ut.bigint,received:e.parsedType}),Mt}gte(t,e){return this.setLimit("min",t,!0,yt.toString(e))}gt(t,e){return this.setLimit("min",t,!1,yt.toString(e))}lte(t,e){return this.setLimit("max",t,!0,yt.toString(e))}lt(t,e){return this.setLimit("max",t,!1,yt.toString(e))}setLimit(t,e,n,r){return new ua({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:n,message:yt.toString(r)}]})}_addCheck(t){return new ua({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:yt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:yt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:yt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:yt.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:yt.toString(e)})}get minValue(){let t=null;for(const e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(const e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}}ua.create=i=>new ua({checks:[],typeName:Z.ZodBigInt,coerce:(i==null?void 0:i.coerce)??!1,...Ft(i)});class qc extends jt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ut.boolean){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.boolean,received:n.parsedType}),Mt}return pn(t.data)}}qc.create=i=>new qc({typeName:Z.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...Ft(i)});class al extends jt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ut.date){const s=this._getOrReturnCtx(t);return st(s,{code:Y.invalid_type,expected:ut.date,received:s.parsedType}),Mt}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return st(s,{code:Y.invalid_date}),Mt}const n=new Yi;let r;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(r=this._getOrReturnCtx(t,r),st(r,{code:Y.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(r=this._getOrReturnCtx(t,r),st(r,{code:Y.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Zt.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new al({...this._def,checks:[...this._def.checks,t]})}min(t,e){return this._addCheck({kind:"min",value:t.getTime(),message:yt.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:yt.toString(e)})}get minDate(){let t=null;for(const e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t!=null?new Date(t):null}}al.create=i=>new al({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:Z.ZodDate,...Ft(i)});class eg extends jt{_parse(t){if(this._getType(t)!==ut.symbol){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.symbol,received:n.parsedType}),Mt}return pn(t.data)}}eg.create=i=>new eg({typeName:Z.ZodSymbol,...Ft(i)});class Wc extends jt{_parse(t){if(this._getType(t)!==ut.undefined){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.undefined,received:n.parsedType}),Mt}return pn(t.data)}}Wc.create=i=>new Wc({typeName:Z.ZodUndefined,...Ft(i)});class Hc extends jt{_parse(t){if(this._getType(t)!==ut.null){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.null,received:n.parsedType}),Mt}return pn(t.data)}}Hc.create=i=>new Hc({typeName:Z.ZodNull,...Ft(i)});class Gu extends jt{constructor(){super(...arguments),this._any=!0}_parse(t){return pn(t.data)}}Gu.create=i=>new Gu({typeName:Z.ZodAny,...Ft(i)});class ll extends jt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return pn(t.data)}}ll.create=i=>new ll({typeName:Z.ZodUnknown,...Ft(i)});class So extends jt{_parse(t){const e=this._getOrReturnCtx(t);return st(e,{code:Y.invalid_type,expected:ut.never,received:e.parsedType}),Mt}}So.create=i=>new So({typeName:Z.ZodNever,...Ft(i)});class ig extends jt{_parse(t){if(this._getType(t)!==ut.undefined){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.void,received:n.parsedType}),Mt}return pn(t.data)}}ig.create=i=>new ig({typeName:Z.ZodVoid,...Ft(i)});class es extends jt{_parse(t){const{ctx:e,status:n}=this._processInputParams(t),r=this._def;if(e.parsedType!==ut.array)return st(e,{code:Y.invalid_type,expected:ut.array,received:e.parsedType}),Mt;if(r.exactLength!==null){const o=e.data.length>r.exactLength.value,a=e.data.length<r.exactLength.value;(o||a)&&(st(e,{code:o?Y.too_big:Y.too_small,minimum:a?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&e.data.length<r.minLength.value&&(st(e,{code:Y.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&e.data.length>r.maxLength.value&&(st(e,{code:Y.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),e.common.async)return Promise.all([...e.data].map((o,a)=>r.type._parseAsync(new ks(e,o,e.path,a)))).then(o=>Yi.mergeArray(n,o));const s=[...e.data].map((o,a)=>r.type._parseSync(new ks(e,o,e.path,a)));return Yi.mergeArray(n,s)}get element(){return this._def.type}min(t,e){return new es({...this._def,minLength:{value:t,message:yt.toString(e)}})}max(t,e){return new es({...this._def,maxLength:{value:t,message:yt.toString(e)}})}length(t,e){return new es({...this._def,exactLength:{value:t,message:yt.toString(e)}})}nonempty(t){return this.min(1,t)}}es.create=(i,t)=>new es({type:i,minLength:null,maxLength:null,exactLength:null,typeName:Z.ZodArray,...Ft(t)});function ju(i){if(i instanceof ke){const t={};for(const e in i.shape){const n=i.shape[e];t[e]=js.create(ju(n))}return new ke({...i._def,shape:()=>t})}else return i instanceof es?new es({...i._def,type:ju(i.element)}):i instanceof js?js.create(ju(i.unwrap())):i instanceof ca?ca.create(ju(i.unwrap())):i instanceof Gs?Gs.create(i.items.map(t=>ju(t))):i}class ke extends jt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),e=Zt.objectKeys(t);return this._cached={shape:t,keys:e},this._cached}_parse(t){if(this._getType(t)!==ut.object){const u=this._getOrReturnCtx(t);return st(u,{code:Y.invalid_type,expected:ut.object,received:u.parsedType}),Mt}const{status:n,ctx:r}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof So&&this._def.unknownKeys==="strip"))for(const u in r.data)o.includes(u)||a.push(u);const l=[];for(const u of o){const h=s[u],c=r.data[u];l.push({key:{status:"valid",value:u},value:h._parse(new ks(r,c,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof So){const u=this._def.unknownKeys;if(u==="passthrough")for(const h of a)l.push({key:{status:"valid",value:h},value:{status:"valid",value:r.data[h]}});else if(u==="strict")a.length>0&&(st(r,{code:Y.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const h of a){const c=r.data[h];l.push({key:{status:"valid",value:h},value:u._parse(new ks(r,c,r.path,h)),alwaysSet:h in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const u=[];for(const h of l){const c=await h.key,d=await h.value;u.push({key:c,value:d,alwaysSet:h.alwaysSet})}return u}).then(u=>Yi.mergeObjectSync(n,u)):Yi.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return yt.errToObj,new ke({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(e,n)=>{var s,o;const r=((o=(s=this._def).errorMap)==null?void 0:o.call(s,e,n).message)??n.defaultError;return e.code==="unrecognized_keys"?{message:yt.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new ke({...this._def,unknownKeys:"strip"})}passthrough(){return new ke({...this._def,unknownKeys:"passthrough"})}extend(t){return new ke({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ke({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Z.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new ke({...this._def,catchall:t})}pick(t){const e={};for(const n of Zt.objectKeys(t))t[n]&&this.shape[n]&&(e[n]=this.shape[n]);return new ke({...this._def,shape:()=>e})}omit(t){const e={};for(const n of Zt.objectKeys(this.shape))t[n]||(e[n]=this.shape[n]);return new ke({...this._def,shape:()=>e})}deepPartial(){return ju(this)}partial(t){const e={};for(const n of Zt.objectKeys(this.shape)){const r=this.shape[n];t&&!t[n]?e[n]=r:e[n]=r.optional()}return new ke({...this._def,shape:()=>e})}required(t){const e={};for(const n of Zt.objectKeys(this.shape))if(t&&!t[n])e[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof js;)s=s._def.innerType;e[n]=s}return new ke({...this._def,shape:()=>e})}keyof(){return nS(Zt.objectKeys(this.shape))}}ke.create=(i,t)=>new ke({shape:()=>i,unknownKeys:"strip",catchall:So.create(),typeName:Z.ZodObject,...Ft(t)}),ke.strictCreate=(i,t)=>new ke({shape:()=>i,unknownKeys:"strict",catchall:So.create(),typeName:Z.ZodObject,...Ft(t)}),ke.lazycreate=(i,t)=>new ke({shape:i,unknownKeys:"strip",catchall:So.create(),typeName:Z.ZodObject,...Ft(t)});class Xc extends jt{_parse(t){const{ctx:e}=this._processInputParams(t),n=this._def.options;function r(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return e.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Kn(a.ctx.common.issues));return st(e,{code:Y.invalid_union,unionErrors:o}),Mt}if(e.common.async)return Promise.all(n.map(async s=>{const o={...e,common:{...e.common,issues:[]},parent:null};return{result:await s._parseAsync({data:e.data,path:e.path,parent:o}),ctx:o}})).then(r);{let s;const o=[];for(const l of n){const u={...e,common:{...e.common,issues:[]},parent:null},h=l._parseSync({data:e.data,path:e.path,parent:u});if(h.status==="valid")return h;h.status==="dirty"&&!s&&(s={result:h,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return e.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new Kn(l));return st(e,{code:Y.invalid_union,unionErrors:a}),Mt}}get options(){return this._def.options}}Xc.create=(i,t)=>new Xc({options:i,typeName:Z.ZodUnion,...Ft(t)});const bo=i=>i instanceof Jc?bo(i.schema):i instanceof is?bo(i.innerType()):i instanceof Zc?[i.value]:i instanceof ha?i.options:i instanceof Kc?Zt.objectValues(i.enum):i instanceof Qc?bo(i._def.innerType):i instanceof Wc?[void 0]:i instanceof Hc?[null]:i instanceof js?[void 0,...bo(i.unwrap())]:i instanceof ca?[null,...bo(i.unwrap())]:i instanceof l0||i instanceof id?bo(i.unwrap()):i instanceof td?bo(i._def.innerType):[];class ng extends jt{_parse(t){const{ctx:e}=this._processInputParams(t);if(e.parsedType!==ut.object)return st(e,{code:Y.invalid_type,expected:ut.object,received:e.parsedType}),Mt;const n=this.discriminator,r=e.data[n],s=this.optionsMap.get(r);return s?e.common.async?s._parseAsync({data:e.data,path:e.path,parent:e}):s._parseSync({data:e.data,path:e.path,parent:e}):(st(e,{code:Y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Mt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,n){const r=new Map;for(const s of e){const o=bo(s.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(r.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);r.set(a,s)}}return new ng({typeName:Z.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:r,...Ft(n)})}}function a0(i,t){const e=Eo(i),n=Eo(t);if(i===t)return{valid:!0,data:i};if(e===ut.object&&n===ut.object){const r=Zt.objectKeys(t),s=Zt.objectKeys(i).filter(a=>r.indexOf(a)!==-1),o={...i,...t};for(const a of s){const l=a0(i[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(e===ut.array&&n===ut.array){if(i.length!==t.length)return{valid:!1};const r=[];for(let s=0;s<i.length;s++){const o=i[s],a=t[s],l=a0(o,a);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return e===ut.date&&n===ut.date&&+i==+t?{valid:!0,data:i}:{valid:!1}}class $c extends jt{_parse(t){const{status:e,ctx:n}=this._processInputParams(t),r=(s,o)=>{if(r0(s)||r0(o))return Mt;const a=a0(s.value,o.value);return a.valid?((s0(s)||s0(o))&&e.dirty(),{status:e.value,value:a.data}):(st(n,{code:Y.invalid_intersection_types}),Mt)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>r(s,o)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}$c.create=(i,t,e)=>new $c({left:i,right:t,typeName:Z.ZodIntersection,...Ft(e)});class Gs extends jt{_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.array)return st(n,{code:Y.invalid_type,expected:ut.array,received:n.parsedType}),Mt;if(n.data.length<this._def.items.length)return st(n,{code:Y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Mt;!this._def.rest&&n.data.length>this._def.items.length&&(st(n,{code:Y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty());const s=[...n.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new ks(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>Yi.mergeArray(e,o)):Yi.mergeArray(e,s)}get items(){return this._def.items}rest(t){return new Gs({...this._def,rest:t})}}Gs.create=(i,t)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gs({items:i,typeName:Z.ZodTuple,rest:null,...Ft(t)})};class Yc extends jt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.object)return st(n,{code:Y.invalid_type,expected:ut.object,received:n.parsedType}),Mt;const r=[],s=this._def.keyType,o=this._def.valueType;for(const a in n.data)r.push({key:s._parse(new ks(n,a,n.path,a)),value:o._parse(new ks(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Yi.mergeObjectAsync(e,r):Yi.mergeObjectSync(e,r)}get element(){return this._def.valueType}static create(t,e,n){return e instanceof jt?new Yc({keyType:t,valueType:e,typeName:Z.ZodRecord,...Ft(n)}):new Yc({keyType:ts.create(),valueType:t,typeName:Z.ZodRecord,...Ft(e)})}}class rg extends jt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.map)return st(n,{code:Y.invalid_type,expected:ut.map,received:n.parsedType}),Mt;const r=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,l],u)=>({key:r._parse(new ks(n,a,n.path,[u,"key"])),value:s._parse(new ks(n,l,n.path,[u,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,h=await l.value;if(u.status==="aborted"||h.status==="aborted")return Mt;(u.status==="dirty"||h.status==="dirty")&&e.dirty(),a.set(u.value,h.value)}return{status:e.value,value:a}})}else{const a=new Map;for(const l of o){const u=l.key,h=l.value;if(u.status==="aborted"||h.status==="aborted")return Mt;(u.status==="dirty"||h.status==="dirty")&&e.dirty(),a.set(u.value,h.value)}return{status:e.value,value:a}}}}rg.create=(i,t,e)=>new rg({valueType:t,keyType:i,typeName:Z.ZodMap,...Ft(e)});class ul extends jt{_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.set)return st(n,{code:Y.invalid_type,expected:ut.set,received:n.parsedType}),Mt;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(st(n,{code:Y.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),e.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(st(n,{code:Y.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),e.dirty());const s=this._def.valueType;function o(l){const u=new Set;for(const h of l){if(h.status==="aborted")return Mt;h.status==="dirty"&&e.dirty(),u.add(h.value)}return{status:e.value,value:u}}const a=[...n.data.values()].map((l,u)=>s._parse(new ks(n,l,n.path,u)));return n.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,e){return new ul({...this._def,minSize:{value:t,message:yt.toString(e)}})}max(t,e){return new ul({...this._def,maxSize:{value:t,message:yt.toString(e)}})}size(t,e){return this.min(t,e).max(t,e)}nonempty(t){return this.min(1,t)}}ul.create=(i,t)=>new ul({valueType:i,minSize:null,maxSize:null,typeName:Z.ZodSet,...Ft(t)});class Vu extends jt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:e}=this._processInputParams(t);if(e.parsedType!==ut.function)return st(e,{code:Y.invalid_type,expected:ut.function,received:e.parsedType}),Mt;function n(a,l){return tg({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Qf(),Fu].filter(u=>!!u),issueData:{code:Y.invalid_arguments,argumentsError:l}})}function r(a,l){return tg({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Qf(),Fu].filter(u=>!!u),issueData:{code:Y.invalid_return_type,returnTypeError:l}})}const s={errorMap:e.common.contextualErrorMap},o=e.data;if(this._def.returns instanceof zu){const a=this;return pn(async function(...l){const u=new Kn([]),h=await a._def.args.parseAsync(l,s).catch(g=>{throw u.addIssue(n(l,g)),u}),c=await Reflect.apply(o,this,h);return await a._def.returns._def.type.parseAsync(c,s).catch(g=>{throw u.addIssue(r(c,g)),u})})}else{const a=this;return pn(function(...l){const u=a._def.args.safeParse(l,s);if(!u.success)throw new Kn([n(l,u.error)]);const h=Reflect.apply(o,this,u.data),c=a._def.returns.safeParse(h,s);if(!c.success)throw new Kn([r(h,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Vu({...this._def,args:Gs.create(t).rest(ll.create())})}returns(t){return new Vu({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,e,n){return new Vu({args:t||Gs.create([]).rest(ll.create()),returns:e||ll.create(),typeName:Z.ZodFunction,...Ft(n)})}}class Jc extends jt{get schema(){return this._def.getter()}_parse(t){const{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}}Jc.create=(i,t)=>new Jc({getter:i,typeName:Z.ZodLazy,...Ft(t)});class Zc extends jt{_parse(t){if(t.data!==this._def.value){const e=this._getOrReturnCtx(t);return st(e,{received:e.data,code:Y.invalid_literal,expected:this._def.value}),Mt}return{status:"valid",value:t.data}}get value(){return this._def.value}}Zc.create=(i,t)=>new Zc({value:i,typeName:Z.ZodLiteral,...Ft(t)});function nS(i,t){return new ha({values:i,typeName:Z.ZodEnum,...Ft(t)})}class ha extends jt{_parse(t){if(typeof t.data!="string"){const e=this._getOrReturnCtx(t),n=this._def.values;return st(e,{expected:Zt.joinValues(n),received:e.parsedType,code:Y.invalid_type}),Mt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const e=this._getOrReturnCtx(t),n=this._def.values;return st(e,{received:e.data,code:Y.invalid_enum_value,options:n}),Mt}return pn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const e of this._def.values)t[e]=e;return t}get Values(){const t={};for(const e of this._def.values)t[e]=e;return t}get Enum(){const t={};for(const e of this._def.values)t[e]=e;return t}extract(t,e=this._def){return ha.create(t,{...this._def,...e})}exclude(t,e=this._def){return ha.create(this.options.filter(n=>!t.includes(n)),{...this._def,...e})}}ha.create=nS;class Kc extends jt{_parse(t){const e=Zt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ut.string&&n.parsedType!==ut.number){const r=Zt.objectValues(e);return st(n,{expected:Zt.joinValues(r),received:n.parsedType,code:Y.invalid_type}),Mt}if(this._cache||(this._cache=new Set(Zt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const r=Zt.objectValues(e);return st(n,{received:n.data,code:Y.invalid_enum_value,options:r}),Mt}return pn(t.data)}get enum(){return this._def.values}}Kc.create=(i,t)=>new Kc({values:i,typeName:Z.ZodNativeEnum,...Ft(t)});class zu extends jt{unwrap(){return this._def.type}_parse(t){const{ctx:e}=this._processInputParams(t);if(e.parsedType!==ut.promise&&e.common.async===!1)return st(e,{code:Y.invalid_type,expected:ut.promise,received:e.parsedType}),Mt;const n=e.parsedType===ut.promise?e.data:Promise.resolve(e.data);return pn(n.then(r=>this._def.type.parseAsync(r,{path:e.path,errorMap:e.common.contextualErrorMap})))}}zu.create=(i,t)=>new zu({type:i,typeName:Z.ZodPromise,...Ft(t)});class is extends jt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:e,ctx:n}=this._processInputParams(t),r=this._def.effect||null,s={addIssue:o=>{st(n,o),o.fatal?e.abort():e.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const o=r.transform(n.data,s);if(n.common.async)return Promise.resolve(o).then(async a=>{if(e.value==="aborted")return Mt;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?Mt:l.status==="dirty"||e.value==="dirty"?ku(l.value):l});{if(e.value==="aborted")return Mt;const a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?Mt:a.status==="dirty"||e.value==="dirty"?ku(a.value):a}}if(r.type==="refinement"){const o=a=>{const l=r.refinement(a,s);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Mt:(a.status==="dirty"&&e.dirty(),o(a.value),{status:e.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Mt:(a.status==="dirty"&&e.dirty(),o(a.value).then(()=>({status:e.value,value:a.value}))))}if(r.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ol(o))return Mt;const a=r.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>ol(o)?Promise.resolve(r.transform(o.value,s)).then(a=>({status:e.value,value:a})):Mt);Zt.assertNever(r)}}is.create=(i,t,e)=>new is({schema:i,typeName:Z.ZodEffects,effect:t,...Ft(e)}),is.createWithPreprocess=(i,t,e)=>new is({schema:t,effect:{type:"preprocess",transform:i},typeName:Z.ZodEffects,...Ft(e)});class js extends jt{_parse(t){return this._getType(t)===ut.undefined?pn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}js.create=(i,t)=>new js({innerType:i,typeName:Z.ZodOptional,...Ft(t)});class ca extends jt{_parse(t){return this._getType(t)===ut.null?pn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ca.create=(i,t)=>new ca({innerType:i,typeName:Z.ZodNullable,...Ft(t)});class Qc extends jt{_parse(t){const{ctx:e}=this._processInputParams(t);let n=e.data;return e.parsedType===ut.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:e.path,parent:e})}removeDefault(){return this._def.innerType}}Qc.create=(i,t)=>new Qc({innerType:i,typeName:Z.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ft(t)});class td extends jt{_parse(t){const{ctx:e}=this._processInputParams(t),n={...e,common:{...e.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Uc(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Kn(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Kn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}td.create=(i,t)=>new td({innerType:i,typeName:Z.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ft(t)});class sg extends jt{_parse(t){if(this._getType(t)!==ut.nan){const n=this._getOrReturnCtx(t);return st(n,{code:Y.invalid_type,expected:ut.nan,received:n.parsedType}),Mt}return{status:"valid",value:t.data}}}sg.create=i=>new sg({typeName:Z.ZodNaN,...Ft(i)});const R4=Symbol("zod_brand");class l0 extends jt{_parse(t){const{ctx:e}=this._processInputParams(t),n=e.data;return this._def.type._parse({data:n,path:e.path,parent:e})}unwrap(){return this._def.type}}class ed extends jt{_parse(t){const{status:e,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Mt:s.status==="dirty"?(e.dirty(),ku(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?Mt:r.status==="dirty"?(e.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(t,e){return new ed({in:t,out:e,typeName:Z.ZodPipeline})}}class id extends jt{_parse(t){const e=this._def.innerType._parse(t),n=r=>(ol(r)&&(r.value=Object.freeze(r.value)),r);return Uc(e)?e.then(r=>n(r)):n(e)}unwrap(){return this._def.innerType}}id.create=(i,t)=>new id({innerType:i,typeName:Z.ZodReadonly,...Ft(t)});function rS(i,t){const e=typeof i=="function"?i(t):typeof i=="string"?{message:i}:i;return typeof e=="string"?{message:e}:e}function sS(i,t={},e){return i?Gu.create().superRefine((n,r)=>{const s=i(n);if(s instanceof Promise)return s.then(o=>{if(!o){const a=rS(t,n),l=a.fatal??e??!0;r.addIssue({code:"custom",...a,fatal:l})}});if(!s){const o=rS(t,n),a=o.fatal??e??!0;r.addIssue({code:"custom",...o,fatal:a})}}):Gu.create()}const A4={object:ke.lazycreate};var Z;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(Z||(Z={}));const L4=(i,t={message:`Input not instance of ${i.name}`})=>sS(e=>e instanceof i,t),oS=ts.create,aS=la.create,F4=sg.create,k4=ua.create,lS=qc.create,G4=al.create,j4=eg.create,V4=Wc.create,z4=Hc.create,B4=Gu.create,U4=ll.create,q4=So.create,W4=ig.create,H4=es.create,u0=ke.create,X4=ke.strictCreate,$4=Xc.create,Y4=ng.create,J4=$c.create,Z4=Gs.create,K4=Yc.create,Q4=rg.create,tR=ul.create,eR=Vu.create,iR=Jc.create,nR=Zc.create,rR=ha.create,sR=Kc.create,oR=zu.create,uS=is.create,aR=js.create,lR=ca.create,uR=is.createWithPreprocess,hR=ed.create,Je=Object.freeze(Object.defineProperty({__proto__:null,BRAND:R4,DIRTY:ku,EMPTY_PATH:c4,INVALID:Mt,NEVER:Mt,OK:pn,ParseStatus:Yi,Schema:jt,ZodAny:Gu,ZodArray:es,ZodBigInt:ua,ZodBoolean:qc,ZodBranded:l0,ZodCatch:td,ZodDate:al,ZodDefault:Qc,ZodDiscriminatedUnion:ng,ZodEffects:is,ZodEnum:ha,ZodError:Kn,get ZodFirstPartyTypeKind(){return Z},ZodFunction:Vu,ZodIntersection:$c,ZodIssueCode:Y,ZodLazy:Jc,ZodLiteral:Zc,ZodMap:rg,ZodNaN:sg,ZodNativeEnum:Kc,ZodNever:So,ZodNull:Hc,ZodNullable:ca,ZodNumber:la,ZodObject:ke,ZodOptional:js,ZodParsedType:ut,ZodPipeline:ed,ZodPromise:zu,ZodReadonly:id,ZodRecord:Yc,ZodSchema:jt,ZodSet:ul,ZodString:ts,ZodSymbol:eg,ZodTransformer:is,ZodTuple:Gs,ZodType:jt,ZodUndefined:Wc,ZodUnion:Xc,ZodUnknown:ll,ZodVoid:ig,addIssueToContext:st,any:B4,array:H4,bigint:k4,boolean:lS,coerce:{string:(i=>ts.create({...i,coerce:!0})),number:(i=>la.create({...i,coerce:!0})),boolean:(i=>qc.create({...i,coerce:!0})),bigint:(i=>ua.create({...i,coerce:!0})),date:(i=>al.create({...i,coerce:!0}))},custom:sS,date:G4,datetimeRegex:iS,defaultErrorMap:Fu,discriminatedUnion:Y4,effect:uS,enum:rR,function:eR,getErrorMap:Qf,getParsedType:Eo,instanceof:L4,intersection:J4,isAborted:r0,isAsync:Uc,isDirty:s0,isValid:ol,late:A4,lazy:iR,literal:nR,makeIssue:tg,map:Q4,nan:F4,nativeEnum:sR,never:q4,null:z4,nullable:lR,number:aS,object:u0,get objectUtil(){return n0},oboolean:()=>lS().optional(),onumber:()=>aS().optional(),optional:aR,ostring:()=>oS().optional(),pipeline:hR,preprocess:uR,promise:oR,quotelessJson:u4,record:K4,set:tR,setErrorMap:h4,strictObject:X4,string:oS,symbol:j4,transformer:uS,tuple:Z4,undefined:V4,union:$4,unknown:U4,get util(){return Zt},void:W4},Symbol.toStringTag,{value:"Module"})),cR=Symbol("Let zodToJsonSchema decide on which parser to use"),hS={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},dR=i=>typeof i=="string"?{...hS,name:i}:{...hS,...i},fR=i=>{const t=dR(i),e=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:e,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}};function cS(i,t,e,n){n!=null&&n.errorMessages&&e&&(i.errorMessage={...i.errorMessage,[t]:e})}function ce(i,t,e,n,r){i[t]=e,cS(i,t,n,r)}const dS=(i,t)=>{let e=0;for(;e<i.length&&e<t.length&&i[e]===t[e];e++);return[(i.length-e).toString(),...t.slice(e)].join("/")};function On(i){if(i.target!=="openAi")return{};const t=[...i.basePath,i.definitionPath,i.openAiAnyTypeName];return i.flags.hasReferencedOpenAiAnyType=!0,{$ref:i.$refStrategy==="relative"?dS(t,i.currentPath):t.join("/")}}function gR(i,t){var n,r,s;const e={type:"array"};return(n=i.type)!=null&&n._def&&((s=(r=i.type)==null?void 0:r._def)==null?void 0:s.typeName)!==Z.ZodAny&&(e.items=se(i.type._def,{...t,currentPath:[...t.currentPath,"items"]})),i.minLength&&ce(e,"minItems",i.minLength.value,i.minLength.message,t),i.maxLength&&ce(e,"maxItems",i.maxLength.value,i.maxLength.message,t),i.exactLength&&(ce(e,"minItems",i.exactLength.value,i.exactLength.message,t),ce(e,"maxItems",i.exactLength.value,i.exactLength.message,t)),e}function pR(i,t){const e={type:"integer",format:"int64"};if(!i.checks)return e;for(const n of i.checks)switch(n.kind){case"min":t.target==="jsonSchema7"?n.inclusive?ce(e,"minimum",n.value,n.message,t):ce(e,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(e.exclusiveMinimum=!0),ce(e,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?ce(e,"maximum",n.value,n.message,t):ce(e,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(e.exclusiveMaximum=!0),ce(e,"maximum",n.value,n.message,t));break;case"multipleOf":ce(e,"multipleOf",n.value,n.message,t);break}return e}function mR(){return{type:"boolean"}}function fS(i,t){return se(i.type._def,t)}const vR=(i,t)=>se(i.innerType._def,t);function gS(i,t,e){const n=e??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,s)=>gS(i,t,r))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return yR(i,t)}}const yR=(i,t)=>{const e={type:"integer",format:"unix-time"};if(t.target==="openApi3")return e;for(const n of i.checks)switch(n.kind){case"min":ce(e,"minimum",n.value,n.message,t);break;case"max":ce(e,"maximum",n.value,n.message,t);break}return e};function _R(i,t){return{...se(i.innerType._def,t),default:i.defaultValue()}}function wR(i,t){return t.effectStrategy==="input"?se(i.schema._def,t):On(t)}function ER(i){return{type:"string",enum:Array.from(i.values)}}const SR=i=>"type"in i&&i.type==="string"?!1:"allOf"in i;function bR(i,t){const e=[se(i.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),se(i.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(s=>!!s);let n=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const r=[];return e.forEach(s=>{if(SR(s))r.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:a,...l}=s;o=l}else n=void 0;r.push(o)}}),r.length?{allOf:r,...n}:void 0}function CR(i,t){const e=typeof i.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(i.value)?"array":"object"}:t.target==="openApi3"?{type:e==="bigint"?"integer":e,enum:[i.value]}:{type:e==="bigint"?"integer":e,const:i.value}}let h0;const ns={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(h0===void 0&&(h0=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),h0),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function pS(i,t){const e={type:"string"};if(i.checks)for(const n of i.checks)switch(n.kind){case"min":ce(e,"minLength",typeof e.minLength=="number"?Math.max(e.minLength,n.value):n.value,n.message,t);break;case"max":ce(e,"maxLength",typeof e.maxLength=="number"?Math.min(e.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":rs(e,"email",n.message,t);break;case"format:idn-email":rs(e,"idn-email",n.message,t);break;case"pattern:zod":mn(e,ns.email,n.message,t);break}break;case"url":rs(e,"uri",n.message,t);break;case"uuid":rs(e,"uuid",n.message,t);break;case"regex":mn(e,n.regex,n.message,t);break;case"cuid":mn(e,ns.cuid,n.message,t);break;case"cuid2":mn(e,ns.cuid2,n.message,t);break;case"startsWith":mn(e,RegExp(`^${c0(n.value,t)}`),n.message,t);break;case"endsWith":mn(e,RegExp(`${c0(n.value,t)}$`),n.message,t);break;case"datetime":rs(e,"date-time",n.message,t);break;case"date":rs(e,"date",n.message,t);break;case"time":rs(e,"time",n.message,t);break;case"duration":rs(e,"duration",n.message,t);break;case"length":ce(e,"minLength",typeof e.minLength=="number"?Math.max(e.minLength,n.value):n.value,n.message,t),ce(e,"maxLength",typeof e.maxLength=="number"?Math.min(e.maxLength,n.value):n.value,n.message,t);break;case"includes":{mn(e,RegExp(c0(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&rs(e,"ipv4",n.message,t),n.version!=="v4"&&rs(e,"ipv6",n.message,t);break}case"base64url":mn(e,ns.base64url,n.message,t);break;case"jwt":mn(e,ns.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&mn(e,ns.ipv4Cidr,n.message,t),n.version!=="v4"&&mn(e,ns.ipv6Cidr,n.message,t);break}case"emoji":mn(e,ns.emoji(),n.message,t);break;case"ulid":{mn(e,ns.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{rs(e,"binary",n.message,t);break}case"contentEncoding:base64":{ce(e,"contentEncoding","base64",n.message,t);break}case"pattern:zod":{mn(e,ns.base64,n.message,t);break}}break}case"nanoid":mn(e,ns.nanoid,n.message,t)}return e}function c0(i,t){return t.patternStrategy==="escape"?xR(i):i}const PR=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function xR(i){let t="";for(let e=0;e<i.length;e++)PR.has(i[e])||(t+="\\"),t+=i[e];return t}function rs(i,t,e,n){var r;i.format||(r=i.anyOf)!=null&&r.some(s=>s.format)?(i.anyOf||(i.anyOf=[]),i.format&&(i.anyOf.push({format:i.format,...i.errorMessage&&n.errorMessages&&{errorMessage:{format:i.errorMessage.format}}}),delete i.format,i.errorMessage&&(delete i.errorMessage.format,Object.keys(i.errorMessage).length===0&&delete i.errorMessage)),i.anyOf.push({format:t,...e&&n.errorMessages&&{errorMessage:{format:e}}})):ce(i,"format",t,e,n)}function mn(i,t,e,n){var r;i.pattern||(r=i.allOf)!=null&&r.some(s=>s.pattern)?(i.allOf||(i.allOf=[]),i.pattern&&(i.allOf.push({pattern:i.pattern,...i.errorMessage&&n.errorMessages&&{errorMessage:{pattern:i.errorMessage.pattern}}}),delete i.pattern,i.errorMessage&&(delete i.errorMessage.pattern,Object.keys(i.errorMessage).length===0&&delete i.errorMessage)),i.allOf.push({pattern:mS(t,n),...e&&n.errorMessages&&{errorMessage:{pattern:e}}})):ce(i,"pattern",mS(t,n),e,n)}function mS(i,t){var l;if(!t.applyRegexFlags||!i.flags)return i.source;const e={i:i.flags.includes("i"),m:i.flags.includes("m"),s:i.flags.includes("s")},n=e.i?i.source.toLowerCase():i.source;let r="",s=!1,o=!1,a=!1;for(let u=0;u<n.length;u++){if(s){r+=n[u],s=!1;continue}if(e.i){if(o){if(n[u].match(/[a-z]/)){a?(r+=n[u],r+=`${n[u-2]}-${n[u]}`.toUpperCase(),a=!1):n[u+1]==="-"&&((l=n[u+2])!=null&&l.match(/[a-z]/))?(r+=n[u],a=!0):r+=`${n[u]}${n[u].toUpperCase()}`;continue}}else if(n[u].match(/[a-z]/)){r+=`[${n[u]}${n[u].toUpperCase()}]`;continue}}if(e.m){if(n[u]==="^"){r+=`(^|(?<=[\r
469
469
  ]))`;continue}else if(n[u]==="$"){r+=`($|(?=[\r
470
470
  ]))`;continue}}if(e.s&&n[u]==="."){r+=o?`${n[u]}\r
471
471
  `:`[${n[u]}\r
@@ -509,4 +509,4 @@ ${FE}
509
509
  `,inputSchema:{roll:Je.number().describe("翻滚角(°),0度时画面保持水平,必须参数,取值范围 -180~180").min(-180).max(180)}},func:async({roll:t})=>{var e,n;try{const r=(e=i.activeViewer)==null?void 0:e.getCurrentCameraInfo();if(!r)return Pe("cameraRoll",null,"未查询到当前相机信息");const s=[r.rotation[0],r.rotation[1],t];return(n=i.activeViewer)==null||n.flyIn(r.position,s),ss("cameraRoll",{newRotation:s})}catch(r){return Pe("cameraRoll",r)}}},{name:"cameraDistance",params:{description:"控制相机与当前目标或视点之间的距离变化,实现相机画面的拉近或拉远。通过 mode 参数指定缩放方向(near 表示拉近,far 表示拉远)",inputSchema:{mode:Je.enum(["near","far"]).describe("缩放模式,near表示相机画面拉近,far表示相机画面拉远")}},func:async({mode:t})=>{var e,n,r,s,o;try{console.log("cameraDistance",t);const a=(e=i.activeViewer)==null?void 0:e.getCurrentCameraInfo();if(!a)return Pe("cameraDistance",null,"未查询到当前相机信息");const l=(r=(n=i.activeViewer)==null?void 0:n.container)==null?void 0:r.getBoundingClientRect();if(!l)return Pe("cameraDistance",null,"未查询到当前相机容器信息");const u=[l.width/2,l.height/2],h=await((s=i.activeViewer)==null?void 0:s.pickPosition(u));if(!h)return Pe("cameraDistance",null,"未查询到视点位置");const c=t==="near"?.2:-.2,d=[a.position[0]+(h[0]-a.position[0])*c,a.position[1]+(h[1]-a.position[1])*c,a.position[2]+(h[2]-a.position[2])*c];return(o=i.activeViewer)==null||o.flyIn(d,a.rotation),ss("cameraDistance",{mode:t,newPosition:d})}catch(a){return Pe("cameraDistance",a)}}}],wS=i=>[{name:"deleteSceneObject",params:{description:"提供对象id来删除单个或多个场景对象,把对象从场景中移除",inputSchema:{ids:Je.array(Je.string().describe("场景对象 id")).describe("需要删除的场景对象 id 列表").default([])}},func:async({ids:t})=>{var e;try{if(t.length===0)return Pe("deleteSceneObject",null,"未指定对象id");const n=[];for(const r of t){const s=i.sceneTree.getTreeItemFromSceneObjId(r);if(!s){n.push(`删除失败,未查询到ID为 ${r} 的对象`);continue}i.sceneTree.destroySceneObjectTreeItem(s),n.push(`成功删除对象 ${(e=s==null?void 0:s.sceneObject)==null?void 0:e.id}`)}return ss("deleteSceneObject",n)}catch(n){return Pe("deleteSceneObject",n)}}},{name:"createSceneObjectFromJson",params:{description:"根据对象JSON来创建场景对象,必须符合格式 { type: string,id: string, ...} ",inputSchema:{json:Je.object({id:Je.string().describe("对象id"),type:Je.string().describe("对象类型,例如:ESImageLayer")}).passthrough().describe("场景对象JSON,必须保证 id 和 type 存在,严格使用用户提供的JSON,不允许添加额外属性")}},func:async({json:t})=>{var e;try{if(![...pt.context.typeNames].includes(t.type))return Pe("createSceneObjectFromJson",null,`未查询到类型为 ${t.type} 的对象类型`);const r=i.sceneTree.createSceneObjectTreeItemFromJson(t);return r?ss("createSceneObjectFromJson",(e=r==null?void 0:r.sceneObject)==null?void 0:e.completeJson):Pe("createSceneObjectFromJson",null,`创建 ${t.type} 对象失败`)}catch(n){return Pe("createSceneObjectFromJson",n)}}},{name:"setSceneObjectProperty",params:{description:"设置对象的属性值,更改指定对象的某个属性值,参数从场景JSON中查询",inputSchema:{id:Je.string().describe("对象id"),property:Je.string().describe("对象属性名,例如:show"),value:Je.any().describe("对象属性值,例如: true")}},func:async({id:t,property:e,value:n})=>{try{const r=i.getSceneObjectById(t);return r?Reflect.has(r,e)?(r[e]=n,ss("setSceneObjectProperty",`对象 ${r.name} 的 ${e} 属性为 ${JSON.stringify(n)}`)):Pe("setSceneObjectProperty",null,`对象 ${r.name} 没有属性 ${e}`):Pe("setSceneObjectProperty",null,`未查询到ID为 ${t} 的对象`)}catch(r){return Pe("setSceneObjectProperty",r)}}}],ES=i=>[..._S(i),...wS(i)],YR=$R;function SS(i){return YR(i)}class JR extends B{constructor(e){super();f(this,"_tools",new Map);e&&ES(e).forEach(r=>{this.registerTool(r)})}toolTransformParams(e){const{description:n,inputSchema:r,outputSchema:s}=e.params,o=u0(r||{}),a=u0(s||{}),l=SS(o),u=SS(a);return{name:e.name,description:n,inputSchema:l,outputSchema:u}}async listTools(){return Promise.resolve(Array.from(this._tools.values()).map(this.toolTransformParams))}registerTool(e){this._tools.set(e.name,e)}async callTool(e){const{name:n,arguments:r}=e,s=this._tools.get(n);if(!s||!s.func)throw new Error(`ESTool "${n}" does not exist.`);return await s.func(r)}getTools(){return Array.from(this._tools.values())}}function bS(i){return typeof i=="string"?document.getElementById(i):i}function d0(i){if(!i)throw new Error("container is not defined");i.innerHTML="";const t=document.createElement("div");return t.style.cssText="width: 100%; height: 100%; margin: 0px; padding: 0px; border: none; overflow: hidden; position: relative; z-index: 0; background: rgba(0,0,0,0);",i.appendChild(t),t}class CS extends B{constructor(e,n){super();f(this,"_listeningSceneObjects",new Map);this._sceneObjectsMananger=e,this._createSceneObjectListeningFunc=n;const r=this._listeningSceneObjects,s=(o,a)=>{if(o)for(let l of o){const u=r.get(l);u&&(u.destroy(),r.delete(l))}if(a)for(let l of a){if(r.get(l)){console.warn(`listeningSceneObjects已存在某对象:${l.name}`,l);debugger}const h=this.createSceneObjectListeningFunc(l);h&&r.set(l,h)}};s(void 0,this._sceneObjectsMananger.sceneObjects),this.dispose(this._sceneObjectsMananger.sceneObjectsToChange.disposableOn(s)),this.dispose(()=>{for(let o of this._listeningSceneObjects.values())o.destroy();this._listeningSceneObjects.clear()})}get listeningSceneObjects(){return this._listeningSceneObjects}get createSceneObjectListeningFunc(){return this._createSceneObjectListeningFunc}}class ZR extends B{constructor(t){super(),this._esObjectsManager=t;{const e=this._esObjectsManager;class n extends B{constructor(s){super(),this._esPath=s,this.dv(new qe(e.activeViewerChanged,()=>{const o=e.activeViewer;if(!o)return;class a extends B{constructor(u){if(super(),this._esPath=u,!o)throw new Error("!viewer");const h=()=>{const c=e.activeViewer;c&&(this._esPath.path.currentTime=c.simulationTime)};h(),this.d(o.simulationTimeChanged.don(h))}}return new a(this._esPath)}))}}this.dv(new CS(e.sceneObjectsManager,r=>{if(r instanceof Au)return new n(r)}))}{const e=this._esObjectsManager;class n extends B{constructor(s){super();const o=()=>{const a=e.activeViewer;a&&(a.simulationTime=s.currentTime??0)};o(),this.d(s.currentTimeChanged.don(o))}}this.dv(new CS(e.sceneObjectsManager,r=>{if(r instanceof Ru)return new n(r)}))}}}class KR extends B{constructor(t){super(),t.forEach(e=>{this.d(e.path.currentPositionChanged.don(n=>{n&&e.sceneObjects.forEach(r=>{Reflect.has(r,"position")&&(r.position=[...n])})})),this.d(e.path.currentRotationChanged.don(n=>{n&&e.sceneObjects.forEach(r=>{Reflect.has(r,"rotation")&&(r.rotation=[...n])})}))})}}class QR extends B{constructor(e){super();f(this,"_player");f(this,"_channels",this.dv(ot([])));this._objectManager=e,this._player=this._objectManager.player,this.dv(new qe(this.channelsChanged,()=>{if(this.channels.length===0)return;const n=[];for(let r=0;r<this.channels.length;r++){const s=this.channels[r],o=pt.getSceneObjById(s.pathId);if(!o||!(o instanceof Au))continue;const l=s.sceneObjectIds.map(u=>pt.getSceneObjById(u)).filter(u=>u!==void 0);l.length!==0&&n.push({path:o,sceneObjects:l})}if(n.length!==0)return new KR(n)}))}get player(){return this._player}get channels(){return this._channels.value}get channelsChanged(){return this._channels.changed}set channels(e){this._channels.value=e}}function PS(i,t,e,n){if(e)n.currentActiveEditing=[i,t];else if(n.currentActiveEditing){const[r,s]=n.currentActiveEditing;r===i&&s===t&&(e||(n.currentActiveEditing=void 0))}}const tA=["editing","positionEditing","locationEditing","pointEditing","rotationEditing"];class eA extends B{constructor(t,e){super(),this._sceneObject=t;const n=this._sceneObject;for(let r of tA){const s=r+"Changed",o=n[s];if(o){{const a=n[r];PS(n,r,a,e)}this.dispose(o.disposableOn((a=>PS(n,r,a,e))))}}}get sceneObject(){return this._sceneObject}}class iA extends B{constructor(){super();f(this,"_currentActiveEditing",this.disposeVar(oe(void 0)));f(this,"_currentActiveEditingLastChangedTime",0);this.dispose(this._currentActiveEditing.changed.disposableOn((e,n)=>{if(this._currentActiveEditingLastChangedTime=Date.now(),n){const[r,s]=n;r[s]===!0&&(r[s]=!1)}if(e){const[r,s]=e;r[s]=!0}})),pt.context.sceneObjCreatedEvent.don(e=>{e.dv(new eA(e,this))})}get currentActiveEditing(){return this._currentActiveEditing.value}set currentActiveEditing(e){this._currentActiveEditing.value=e}get currentActiveEditingChanged(){return this._currentActiveEditing.changed}get currentActiveEditingLastChangedTime(){return this._currentActiveEditingLastChangedTime}}class nA extends B{constructor(){super();f(this,"_sceneObjects",new Set);f(this,"_sceneObjectsToChange",this.dv(new O));this.d(()=>{const e=Pg(this._sceneObjects);e!==0&&console.warn(`场景对象管理器销毁时仍然管理着${e}个场景对象!`)})}get sceneObjects(){return this._sceneObjects}get sceneObjectsToChange(){return this._sceneObjectsToChange}addSceneObject(e){return this._sceneObjects.has(e)?(console.warn(`创建失败:对象${e.typeName+":"+e.id}已经存在于场景对象管理器中!}`),!1):(this._sceneObjectsToChange.emit([],[e]),this._sceneObjects.add(e),!0)}deleteSceneObject(e){return this._sceneObjects.has(e)?(this._sceneObjectsToChange.emit([e],[]),this._sceneObjects.delete(e),!0):(console.warn(`删除失败:对象${e.typeName+":"+e.id}不存在于场景对象管理器中!}`),!1)}createSceneObject(e,n){const r=pt.context.createSceneObject(e,n);return r&&this.addSceneObject(r),r}createSceneObjectFromUrl(e,n){const r=pt.context.createSceneObjectFromUrl(e,n);return r&&this.addSceneObject(r),r}createSceneObjectFromClass(e,n){const r=pt.context.createSceneObjectFromClass(e,n);return r&&this.addSceneObject(r),r}createSceneObjectFromJson(e){const n=pt.context.createSceneObjectFromJson(e);return n&&this.addSceneObject(n),n}}class rA extends B{constructor(e){super();f(this,"_enabled",this.dv(z(!1)));f(this,"_cursorPosition",z(void 0));f(this,"quickPickPosition",!0);let n=new B;const r=()=>{n&&(n.destroy(),n=void 0)};this.d(r);const s=()=>{if(r(),!e||!this._enabled.value)return;n=new B;const o=n.dv(z(void 0)),a=n.dv(Ve(o.changed));n.d(e.pointerMoveEvent.don(u=>{u.pointerEvent&&(o.value=ji(u.pointerEvent))}));const l=n.dv(Ln(async u=>{if(o.value)if(this.quickPickPosition){const h=await u.promise(Vl(e.quickPickPosition(o.value)));this._cursorPosition.value=h}else{const h=await u.promise(Vl(e.pickPosition(o.value)));this._cursorPosition.value=h}}));n.d(a.don(()=>{l.restart()}))};s(),this.d(this._enabled.changed.don(s))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}class sA extends B{constructor(e){super();f(this,"cursorPositionInfo");this.viewer=e,this.cursorPositionInfo=this.dv(new rA(this.viewer))}}class oA extends B{constructor(e){super();f(this,"viewer");const n=this.viewer=e;this.ad(new qe(n.rollerShutterChanged,()=>{const r=n.container;if(!r||!n.rollerShutter)return;const s=new B;this.viewer.splitPosition=.5;let o=this.getRollerShutterDIV();return r.appendChild(o),s.d(()=>{this.viewer.splitPosition=0,r.removeChild(o)}),s}))}getRollerShutterDIV(){let e=document.createElement("div");e.style.position="absolute",e.style.left="50%",e.style.top="0",e.style.backgroundColor="#d3d3d3",e.style.width="5px",e.style.height="100%",e.style.zIndex="9999";const n=r=>{if(!e.parentElement)return;r.preventDefault?r.preventDefault():r.returnValue=!1;const o=r.x/e.parentElement.offsetWidth;e.style.left=`${100*o}%`,this.viewer.splitPosition=o};return e.addEventListener("mouseenter",r=>{e.style.cursor="ew-resize"}),e.addEventListener("mouseleave",r=>{e.style.cursor="default"}),e.addEventListener("mousedown",r=>{e.style.cursor="ew-resize",document.addEventListener("mousemove",n)}),document.addEventListener("mouseup",r=>{e.style.cursor="default",document.removeEventListener("mousemove",n)}),e}}class aA extends B{constructor(e){super();f(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new oA(e))}}function xS(i,t){return i.length===t.length&&i.every((e,n)=>e===t[n])}class lA extends B{constructor(t){super(),this._viewer=t,this.d(F([this._viewer,"currentTime"],[this._viewer,"simulationTime"]))}}class uA extends B{constructor(t,e){super(),this._viewer=t,this._activeViewer=e;const n=os.createCommonProps(),r=[];Object.keys(n).forEach(l=>{const u=this._activeViewer[l+"Changed"];r.push(u)});const s=this.dv(Ve(...r)),o=()=>{this._viewer.status!=="Created"||this._activeViewer.status!=="Created"||Object.keys(n).forEach(l=>{this._viewer[l]=this._activeViewer[l]})};this.d(s.don(o));const a=this.dv(Ih());a.restart(void 0,async()=>{if(this._viewer.status!=="Created"||this._activeViewer.status!=="Created")return;const l=this._activeViewer.getCurrentCameraInfo(),u=this._viewer.getCurrentCameraInfo();if(!l)return;const{position:h,rotation:c}=l;u&&xS(h,u.position)&&xS(c,u.rotation)||this._viewer.flyIn(h,c,0)}),this.d(()=>a.cancel())}}const hA=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="40" height="40" style="shape-rendering: auto; display: block; background: rgba(255, 255, 255, 0);" xmlns:xlink="http://www.w3.org/1999/xlink"><g><circle stroke-linecap="round" fill="none" stroke-dasharray="50.26548245743669 50.26548245743669" stroke="#ffffff" stroke-width="8" r="32" cy="50" cx="50">
510
510
  <animateTransform values="0 50 50;360 50 50" keyTimes="0;1" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"></animateTransform>
511
511
  </circle><g></g></g></svg>
512
- `,cA='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',dA='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',Ol=class Ol extends B{constructor(t){super();const e=()=>{const n=this.dv(new Gf);this.d(F([n,"show"],[t,"useDefaultStatusDiv"]));{const r=()=>{n.show=(t.useDefaultStatusDiv??!0)&&t.status!=="Created"};r(),this.d(t.useDefaultStatusDivChanged.don(r)),this.d(t.statusChanged.don(r)),n.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}t.add(n),this.d(()=>t.delete(n)),n.instanceClass=class extends B{constructor(o,a,l){super();f(this,"_div",document.createElement("div"));if(this._subContainer=o,!l)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const p=()=>{a.show?this._div.style.opacity="1":this._div.style.opacity="0"};p(),this.d(a.showChanged.don(p))}let u,h,c,d,g;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",u=document.createElement("div"),this._div.appendChild(u),u.style.width="auto",u.style.position="absolute",u.style.left="50%",u.style.top="50%",u.style.transform="translate(-50%,-50%)",u.style.background="rgba(120, 120, 0, 0.7)",u.style.color="white",u.style.fontSize="10px",u.style.background="none",u.style.display="flex",u.style.justifyContent="center",u.style.alignItems="center",h=document.createElement("div"),u.appendChild(h),h.style.pointerEvents="none",h.style.display="block",h.style.width="40px",h.innerHTML=Ol.defaultsSvg.loadingSvg,h.style.filter="drop-shadow(0px 0px 1px black)",c=document.createElement("div"),u.appendChild(c),c.style.pointerEvents="none",c.style.marginLeft="10px",c.style.display="flex",c.style.flexFlow="column",c.style.maxWidth="300px",d=document.createElement("div"),c.appendChild(d),d.style.fontSize="14px",d.style.fontWeight="800",d.style.marginBottom="5px",d.style.textShadow="0 0 2px black",g=document.createElement("div"),c.appendChild(g),g.style.fontWeight="400",g.style.textShadow="0 0 2px black";{const p=()=>{let b="Raw";l.status==="Raw"?b="初始状态":l.status==="Creating"?b="正在创建":l.status==="Created"?b="创建完成":l.status==="Error"?b="创建失败":l.status==="Reconnecting"&&(b="重新连接"),d.innerText=`${b}(${l.status})`,g.innerText=`${l.statusLog}`,(l.status==="Creating"||l.status==="Reconnecting")&&(h.innerHTML=Ol.defaultsSvg.loadingSvg),l.status==="Created"&&(h.innerHTML=Ol.defaultsSvg.successSvg),l.status==="Error"&&(h.innerHTML=Ol.defaultsSvg.warnSvg)};p();const E=this.dv(Ve(l.statusLogChanged,l.statusChanged));this.d(E.don(p))}}update(){const o=255*Math.random()|0,a=255*Math.random()|0,l=255*Math.random()|0;this._div.style.background=`rgba(${o}, ${a}, ${l}, 0.8)`}}};this.d(t.containerChanged.don(()=>{e()}))}};f(Ol,"defaultsSvg",{loadingSvg:hA,successSvg:cA,warnSvg:dA});let f0=Ol;class fA extends B{constructor(t,e,n){super(),this._subContainer=t,this._overlayContainer=e,this._viewer=n;const r=this._subContainer,s=this._overlayContainer,o=this._viewer,a=()=>{const h=o.zIndex??"";r.style.zIndex=h,s.style.zIndex=h};a(),this.d(o.zIndexChanged.don(a));const l=()=>{r.style.display=o.show??!0?"block":"none"};l(),this.d(o.showChanged.don(l));const u=()=>{r.style.opacity=`${o.opacity??1}`};u(),this.d(o.opacityChanged.don(u))}}function ag(i){let t=An(i,"_relativeContainer");return t||(t=document.createElement("div"),t.style.position="relative",t.style.width="100%",t.style.height="100%",t.style.padding="0",t.style.margin="0",i.appendChild(t),ps(i,"_relativeContainer",t)),t}class gA extends B{constructor(e,n){super();f(this,"_subContainer",document.createElement("div"));f(this,"_overlayContainer",document.createElement("div"));f(this,"_containerStyleController");this._container=e,this._viewer=n,this._containerStyleController=this.dv(new fA(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:r,overlayContainer:s}=this;r.tabIndex=-1,r.style.outline="none",r.style.width="100%",r.style.height="100%",r.onpointerdown=()=>r.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),r.setAttribute("earthsdk3","earthsdk3-subContainer"),ag(this._container).appendChild(r),this.d(()=>ag(this._container).removeChild(r)),ag(this._container).appendChild(s),this.d(()=>ag(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class pA extends B{constructor(){super(...arguments);f(this,"registerObjsMap",new Map)}register(e,n){return this.registerObjsMap.has(e)&&console.warn(`register warn:${e}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(e,n),e}getViewerConstructor(e){const n=this.registerObjsMap.get(e);if(!n){console.warn(`未找到${e}类!`);return}return n}createViewer(e){const n=e.type;console.log(e);const r=this.getViewerConstructor(n);if(!r)throw new Error(`没有找到类型为${n}的Viewer构造器!`);return new r(e)}}class IS extends B{constructor(t,e,n=!1,r=!1){if(super(),this._viewer=t,!e)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(xe.create(e,"pointerdown")),o=this.dv(xe.create(e,"pointermove")),a=this.dv(xe.create(e,"pointerup")),l=this.dv(xe.create(e,"pointerout")),u=this.dv(xe.create(e,"pointerover")),h=this.dv(new Vg),c=this.dv(new k0),d=()=>{const m=this._viewer.hoverTime*1e3;c.delayTime=m};this.d(this._viewer.hoverTimeChanged.don(()=>{d()})),this.d(s.don(m=>h.pointerDown(m))),this.d(o.don(m=>h.pointerMove(m))),this.d(a.don(m=>h.pointerUp(m))),this.d(l.don(m=>h.pointerOut(m))),this.d(s.don(m=>c.pointerDown(m))),this.d(o.don(m=>c.pointerMove(m))),this.d(a.don(m=>c.pointerUp(m))),this.d(l.don(m=>c.pointerOut(m)));const{x:g,y:p}=e.getBoundingClientRect(),E=r?g:0,b=r?p:0;this.d(c.hoverEvent.don(m=>{const[y,S]=kl(m,n);this._viewer.hoverEvent.emit({screenPosition:[y+E,S+b],pointerEvent:m})})),this.d(h.clickEvent.don(m=>{const[y,S]=kl(m,n);this._viewer.clickEvent.emit({screenPosition:[y+E,S+b],pointerEvent:m})})),this.d(h.dbclickEvent.don(m=>{const[y,S]=kl(m,n);m.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[y+E,S+b],pointerEvent:m})})),this.d(s.don(m=>{const[y,S]=kl(m,n);m.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[y+E,S+b],pointerEvent:m})})),this.d(a.don(m=>{const[y,S]=kl(m,n);m.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[y+E,S+b],pointerEvent:m})})),this.d(o.don(m=>{const[y,S]=ji(m,n);this._viewer.pointerMoveEvent.emit({screenPosition:[y+E,S+b],pointerEvent:m})})),this.d(u.don(m=>{const[y,S]=ji(m,n);this._viewer.pointerOverEvent.emit({screenPosition:[y+E,S+b],pointerEvent:m})})),this.d(l.don(m=>{const[y,S]=ji(m,n);this._viewer.pointerOutEvent.emit({screenPosition:[y+E,S+b],pointerEvent:m})}));const P=this.dv(xe.create(e,"keydown"));this.d(P.don(m=>this._viewer.keyDownEvent.emit(m)));const v=this.dv(xe.create(e,"keyup"));this.d(v.don(m=>this._viewer.keyUpEvent.emit(m)));const _=this.dv(xe.create(e,"wheel"));this.d(_.don(m=>this._viewer.wheelEvent.emit(m)))}}const Oo=class Oo extends B{constructor(e){super();f(this,"_forceRecreateEvent",this.dv(new O));f(this,"_container",this.dv(z(void 0)));f(this,"_containerSize",this.dv(z(void 0)));f(this,"_editingEvent",this.disposeVar(new O));f(this,"_esViewerExtensions",this.dv(new sA(this)));f(this,"_status",this.dv(z("Raw")));f(this,"_statusLog",this.dv(z("")));f(this,"_statusContainer",this.dv(new f0(this)));f(this,"_useCustomInteraction",this.dv(z(!0)));f(this,"_resetInteractionEvent",this.dv(Ve(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));f(this,"_interactionResetting",this.dv(new qe(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new IS(this,this.container)})));f(this,"_viewerChanged",this.dv(new O));f(this,"_cameraChanged",this.dv(new O));f(this,"_containerResetEvent",this.dv(Ve(this.containerChanged,this._forceRecreateEvent)));f(this,"_containerResetting",this.dv(new qe(this._containerResetEvent,()=>{if(this.container)return new gA(this.container,this)})));f(this,"_sceneObjectsMap",new Map);f(this,"_id");f(this,"_typeName");f(this,"_updateFuncReact",this.dv(z(void 0)));f(this,"_toDestroyFuncReact",this.dv(z(void 0)));f(this,"_statusInfo",Oo.defaults.statusInfo);f(this,"_navigationMode",this.dv(z("Map")));f(this,"_navigationEvent",this.disposeVar(new O));f(this,"_syncViewer",this.dv(z(void 0)));f(this,"_syncEventDon",this.dv(new qe(this.syncViewerChanged,()=>{const e=this.syncViewer;if(e)return new uA(this,e)})));f(this,"_timeSyncdon",this.dv(new qe(this.timeSyncChanged,()=>{if(this.timeSync)return new lA(this)})));f(this,"_hoverEvent",this.dv(new O));f(this,"_pointerOverEvent",this.dv(new O));f(this,"_pointerMoveEvent",this.dv(new O));f(this,"_pointerDownEvent",this.dv(new O));f(this,"_pointerUpEvent",this.dv(new O));f(this,"_pointerOutEvent",this.dv(new O));f(this,"_clickEvent",this.dv(new O));f(this,"_dblclickEvent",this.dv(new O));f(this,"_keyDownEvent",this.dv(new O));f(this,"_keyUpEvent",this.dv(new O));f(this,"_wheelEvent",this.dv(new O));f(this,"_actived",this.dv(z(!1)));this._id=e.id??Ll();const n=bS(e.container);if(n)this._container.value=d0(n),this._typeName=e.type,this._initName();else throw new Error("container is not defined");{const r=()=>{n&&(this.show??!0?n.style.display="block":n.style.display="none")};r(),this.d(this.showChanged.don(r))}{const r=this._sceneObjectsMap,s=()=>{for(let[a,l]of r.entries())if(!l&&a){const u=sl.context.createEngineObject(a,this);u&&r.set(a,u)}},o=()=>{for(let[a,l]of r.entries())l&&!l.isDestroyed()&&l.destroy(),r.set(a,void 0)};this.d(o),this.d(this.viewerChanged.don(a=>{o(),a&&s()}))}{const r=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};r(),this.d(this.execOnceFuncStrChanged.don(r))}{const r=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(o){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};r(),this.d(this.updateFuncStrChanged.don(r));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||Ih(),s.restart(void 0,o=>{this.updateFunc&&this.updateFunc(this,o)}))}))}{const r=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};r(),this.d(this.toDestroyFuncStrChanged.don(r)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new aA(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(e){this._container.value=e}set containerOrId(e){if(typeof e=="string"){const n=document.getElementById(e);n&&n instanceof HTMLDivElement?this._container.value=d0(n):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else e instanceof HTMLDivElement?this._container.value=d0(e):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(e){this._containerSize.value=e}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get esViewerExtensions(){return this._esViewerExtensions}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(e){this._status.value=e}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(e){this._statusLog.value=e}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(e){this._useCustomInteraction.value=e}get viewerChanged(){return this._viewerChanged}get cameraChanged(){return this._cameraChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(e){return this.sceneObjectsMap.get(e)}add(...e){for(let n of e)if(!this.has(n)){pt.context.addSceneObject(n);const r=sl.context.createEngineObject(n,this);r&&this._sceneObjectsMap.set(n,r),n.viewerAttached.emit(this)}}delete(...e){for(let n of e)if(this.has(n)){const r=this._sceneObjectsMap.get(n);r&&r.destroy(),pt.context.deleteSceneObject(n),this._sceneObjectsMap.delete(n),n.viewerDetached.emit(this)}}disposableAdd(...e){return this.add(...e),()=>this.delete(...e)}disAdd(...e){return this.disposableAdd(...e)}has(e){return this._sceneObjectsMap.has(e)}clearAllSceneObjects(){for(let e of this.sceneObjects)this.delete(e)}get id(){return this._id}set id(e){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return Oo.createDefaultProps()}get completeJson(){return this._getJson(!1)}_getJson(e=!0){const n={id:this.id,type:this.typeName};for(let r of Object.keys(this.defaultProps))if(e){let s,o=this.defaultProps[r];o instanceof ui?s=o.equals(this[r]):s=o===this[r],s||(n[r]=this[r])}else n[r]=this[r];return n}_setJson(e,n,r){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const s=n||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in e)this[a]=e[a]===null?void 0:e[a];else if(!(r??!1)){let l=this.defaultProps[a];l instanceof ui&&(l=l.value),this[a]=l}}get json(){return this._getJson()}set json(e){this._setJson(e,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}get navigationEvent(){return this._navigationEvent}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(e){this._syncViewer.value=e}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(e){e&&e.syncViewer&&(e.syncViewer=void 0),e===this?this._syncViewer.value=void 0:this._syncViewer.value=e}setCurrentTime(e){try{this.currentTime=typeof e=="string"?Date.parse(e):e}catch(n){console.warn(`时间格式不正确! value: ${e} error: ${n}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}get actived(){return this._actived.value}set actived(e){this._actived.value=e}get activedChanged(){return this._actived.changed}getESProperties(){return{defaultMenu:"general",basic:[],general:[],dataSource:[],location:[],coordinate:[],style:[],more:[]}}async getCurrentRectangle(){var e;try{const n=(e=this.container)==null?void 0:e.getBoundingClientRect();if(!n)return;const{width:r,height:s}=n,o=await this.quickPickPosition([0,0]),a=await this.quickPickPosition([r,s]);return!o||!a?void 0:[o[0],a[1],a[0],o[1]]}catch(n){console.error(n);return}}};f(Oo,"context",new pA),f(Oo,"register",Oo.context.register.bind(Oo.context)),f(Oo,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0,cameraMovableRegion:[0,0,0,0,0,0],depthTestAgainstTerrain:!0,terrainOpacity:1});let os=Oo;(i=>{i.createBaseProps=()=>({name:"未命名场景对象",extras:bt(void 0),devTags:oe(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),i.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:1024,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:oe(void 0),editingAuxiliaryPointColor:oe(void 0),editingLineWidth:void 0,editingLineColor:oe(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:i.defaults.terrainShader,splitPosition:z(void 0),rollerShutter:!1,cameraMovableRegion:oe(void 0),depthTestAgainstTerrain:!0,terrainOpacity:1,sceneGlobeBaseColor:ot([1,1,1,1]),sceneBackgroundColor:ot([0,0,0,0])}),i.createDefaultProps=()=>({...(0,i.createBaseProps)(),...(0,i.createCommonProps)()})})(os||(os={})),Ro(os.prototype,os.createDefaultProps);function MS(i,t){const e=i._lastCameraInfo;if(e){const n=t.viewerChanged.don(r=>{if(!r||!e)return;const{position:s,rotation:o}=e;t.flyIn(s,o,0),i._lastCameraInfo=void 0,n()})}}const mA=i=>{const t=os.createCommonProps(),e={};try{Object.keys(t).forEach(n=>{e[n]=i[n]})}catch(n){console.warn(n)}return e},TS=(i,t)=>{const e=os.createCommonProps();try{Object.keys(e).forEach(n=>{i[n]=t[n]})}catch(n){console.warn(n)}};class vA extends B{constructor(e){super();f(this,"_viewersChanged",this.disposeVar(new O));f(this,"_viewers",new Set);f(this,"_viewersToChange",this.dv(new O));this._sceneObjectsManager=e,(async()=>{for(let n of this.viewers){const r=this._sceneObjectsManager.sceneObjects;for(const s of r)await this.addSceneObject(s,n)}this.d(()=>{const n=this._sceneObjectsManager.sceneObjects;for(const r of this.viewers)r.delete(...n),this.destroyViewer(r);this._viewers.clear()}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don(async(n,r)=>{for(let s of this.viewers){n.forEach(o=>{this.deleteSceneObject(o,s)});for(let o of r)await this.addSceneObject(o,s)}if(r.length>0)for(let s of r)s.d(s.devTagsChanged.don(async()=>{for(let o of this.viewers){if(o.has(s)&&!Lh(o.devTags,s.devTags)){o.delete(s);continue}await this.addSceneObject(s,o)}})),s.ad(s.reloadEvent.don(async()=>{for(let o of this.viewers)o.has(s)&&(o.delete(s),await this.addSceneObject(s,o))}))})),this.d(this.viewersChanged.don(async(n,r)=>{const s=this._sceneObjectsManager.sceneObjects;n.forEach(o=>{for(let a of s)this.deleteSceneObject(a,o)});for(let o of r)for(let a of s)await this.addSceneObject(a,o);r.length>0&&r.forEach(o=>{o.d(o.devTagsChanged.don(async()=>{o.clearAllSceneObjects();const a=this._sceneObjectsManager.sceneObjects;for(let l of a)console.log("viewersChanged",o.devTags,l.devTags,Lh(o.devTags,l.devTags)),await this.addSceneObject(l,o)}))})}))})()}get viewersChanged(){return this._viewersChanged}get viewers(){return[...this._viewers]}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(e){const n=os.context.createViewer(e);return this._viewers.add(n),this._viewersChanged.emit([],[n]),n}destroyViewer(e){return e.isDestroyed()?!0:this._viewers.has(e)?(this._viewers.delete(e),this._viewersChanged.emit([e],[]),e.destroy(),e.isDestroyed()):!1}async addSceneObject(e,n){Lh(n.devTags,e.devTags)&&(n.has(e)?console.warn(`${n.typeName}中已存${e.typeName},检查逻辑是否有问题!`):n.add(e))}deleteSceneObject(e,n){Lh(n.devTags,e.devTags)&&(n.has(e)?n.delete(e):console.warn(`${n.typeName}中不存在${e.typeName},检查逻辑是否有问题!`))}}class lg extends B{constructor(...e){super();f(this,"_drgm",this.dv(new My));f(this,"_sobjm",this.dv(new nA));f(this,"_vrm",this.dv(new vA(this._sobjm)));f(this,"_sceneObjectEditingManager",this.disposeVar(new iA));f(this,"_activeViewer",this.dv(z(void 0)));f(this,"_syncOtherViewersToActived",this.dv(z(!1)));f(this,"_cmrvm",this.createSceneObjectFromClass(Lf));f(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));f(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});f(this,"_sceneTree",this.dv(new Rc("default",this.dragstartDataMananger,24,this)));f(this,"_sceneTreeMap",new Map);f(this,"_viewerCreatedEvent",this.dv(new O));f(this,"_lastCameraInfo");f(this,"_lastActiveViewerJson");f(this,"_syncEventDonFunc",this.d(Ze([this.activeViewerChanged,this.syncOtherViewersToActivedChanged],()=>{const e=this.syncOtherViewersToActived;this.viewers.forEach(n=>{e?n.syncOtherViewer(this.activeViewer):n.syncOtherViewer(void 0)})})));f(this,"_player",this.createSceneObjectFromClass(Ru));f(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));f(this,"_esPlyarAndPathTime",this.dv(new ZR(this)));f(this,"_pathAnimationManager",this.dv(new QR(this)))}getBrowserEnv(){return globalThis.ue&&globalThis.ue.es&&globalThis.ue.esinput?"ESWebView":"Browser"}static get envs(){return pt.context.environmentVariables}getSceneObjectById(e){return pt.getSceneObjectById(e)}getSceneObject(e){return pt.getSceneObject(e)}get $refs(){return pt.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(e){this._activeViewer.value=e,this.viewers.forEach(n=>n.actived=n===e)}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(e){this._syncOtherViewersToActived.value=e}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get completeJson(){var c;const e=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),r=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:e,modifiedTime:n,name:r},a=this.sceneTree.completeJson,l=this._cmrvm.views,u=[...this.viewers].map(d=>d.completeJson),h=(c=this.activeViewer)==null?void 0:c.getCurrentCameraInfo();return{asset:o,viewers:u,sceneTree:a,viewCollection:l,lastView:h}}get json(){var c;const e=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),r=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:e,modifiedTime:n,name:r},a=this.sceneTree.json,l=this._cmrvm.views,u=[...this.viewers].map(d=>d.json),h=(c=this.activeViewer)==null?void 0:c.getCurrentCameraInfo();return{asset:o,viewers:u,sceneTree:a,viewCollection:l,lastView:h}}set json(e){try{if(!e.asset)return;if(!e.asset.type||e.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=e.asset&&e.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=e.asset&&e.asset.modifiedTime||"",this._asset.name=e.asset&&e.asset.name||"未命名项目",this._asset.version=e.asset&&e.asset.version||"0.1.0",e.sceneTree&&(this.sceneTree.json=e.sceneTree),e.viewCollection&&(this._cmrvm.views=e.viewCollection),!e.viewers||!Array.isArray(e.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this.viewers.length===0||e.viewers.length===0){console.warn("viewers is empty !");return}this.viewers.forEach(n=>{const r=e.viewers.find(s=>s.id===n.id);r&&(n.json=r)})}catch(n){console.error(`ESObjectsManager解析json数据时发生错误! error: ${n}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(e="default"){if(e==="default")return this._sceneTree;if(!this._sceneTreeMap.has(e)){console.warn(`id为${e}的SceneTree不存在!`);return}return this._sceneTreeMap.get(e)}createSceneTree(e,n=24){if(this._sceneTreeMap.has(e)||e==="default")console.warn(`id为${e}的SceneTree已存在!`);else{const r=this.dv(new Rc(e,this.dragstartDataMananger,n,this));this._sceneTreeMap.set(e,r)}return this.getSceneTree(e)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(e){const n=this._vrm.createViewer(e);this.activeViewer||(this.activeViewer=n);const r=this.d(n.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(n),r())}));return n}destroyViewer(e){return this._activeViewer.value===e&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(e)}switchViewer(e,n=!0,r=!0,s=!0){var u,h;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&n&&(this._lastCameraInfo=(u=this.activeViewer)==null?void 0:u.getCurrentCameraInfo(),((h=this.activeViewer)==null?void 0:h.typeName)=="ESOlViewer"&&this._lastCameraInfo&&(this._lastCameraInfo.rotation[1]=-90)),!this._lastActiveViewerJson&&r&&(this._lastActiveViewerJson=this.activeViewer?mA(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const o=e.id,a=o?[...this.getViewers()].find(c=>c.id===o):[...this.getViewers()].find(c=>c.typeName===e.type&&!c.container);if(a)if(o&&a.typeName!==e.type)console.warn(`id为${o}的viewer的typeName和option.type${e.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(a);else return console.log("ESViewer exists, will be used"),n&&MS(this,a),r&&this._lastActiveViewerJson&&(TS(a,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),a.container===bS(e.container)?(a.containerOrId=e.container,a.forceRecreate()):a.containerOrId=e.container,this.activeViewer=a,a;console.log("No ESViewer exists, will be created");const l=this.createViewer(e);return console.log(e),console.log(this),n&&MS(this,l),r&&this._lastActiveViewerJson&&(TS(l,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=l,l}switchToCesiumViewer(...e){if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)){const{container:n,viewSync:r,attributeSync:s,destroy:o,id:a}=e[0];return this.switchViewer({type:"ESCesiumViewer",container:n,id:a},r??!0,s??!0,o??!0)}else if(typeof e[0]=="string"||e[0]instanceof HTMLDivElement){const n={container:e[0],viewSync:e[1]??!0,attributeSync:e[2]??!0,destroy:e[3]??!0,id:e[4]},{container:r,viewSync:s,attributeSync:o,destroy:a,id:l}=n;return this.switchViewer({type:"ESCesiumViewer",container:r,id:l},s,o,a)}}switchToUEViewer(...e){let n,r={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("uri")){const{container:l,uri:u,app:h,token:c,viewSync:d,attributeSync:g,destroy:p,id:E,silentTime:b}=e[0];n={type:"ESUeViewer",container:l,id:E,options:{uri:u,app:h,token:c,silentTime:b}},r={viewSync:d??!0,attributeSync:g??!0,destroy:p??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("ws")){const{container:l,ws:u,esmsg:h,viewSync:c,attributeSync:d,id:g,destroy:p,silentTime:E}=e[0];n={type:"ESUeViewer",container:l,id:g,options:{ws:u,esmsg:h,silentTime:E}},r={viewSync:c??!0,attributeSync:d??!0,destroy:p??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("project")){const{container:l,project:u,baseUrl:h,viewSync:c,attributeSync:d,id:g,destroy:p}=e[0];n={type:"ESUeViewer",container:l,id:g,options:{project:u,baseUrl:h}},r={viewSync:c??!0,attributeSync:d??!0,destroy:p??!0}}else(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?(n={type:"ESUeViewer",container:e[0],id:e[6],options:{ws:e[1],esmsg:e[2]??void 0,silentTime:e[7]??void 0}},r={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}):typeof e[1]=="string"&&e[1].startsWith("http")?(n={type:"ESUeViewer",container:e[0],id:e[7],options:{uri:e[1],app:e[2],token:e[3]??void 0,silentTime:e[8]??void 0}},r={viewSync:e[4]??!0,attributeSync:e[5]??!0,destroy:e[6]??!0}):(n={type:"ESUeViewer",container:e[0],id:e[6],options:{project:e[1],baseUrl:e[2]??void 0}},r={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}));if(!n)throw new Error("参数错误");const{viewSync:s,attributeSync:o,destroy:a}=r;return this.switchViewer(n,s,o,a)}createCesiumViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESCesiumViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(n={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESCesiumViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createOpenLayersViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESOlViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(n={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESOlViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createUeViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESUeViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?n={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{ws:e[1],esmsg:e[2]??void 0,silentTime:e[4]??void 0}}:typeof e[1]=="string"&&e[1].startsWith("http")?n={type:"ESUeViewer",container:e[0],id:e[4]??void 0,options:{uri:e[1],app:e[2],token:e[3]??void 0,silentTime:e[5]??void 0}}:n={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{project:e[1],baseUrl:e[2]??void 0}}),!n)throw new Error("参数错误");return this.createViewer(n)}createSceneObject(e,n){return this._sobjm.createSceneObject(e,n)}createSceneObjectFromUrl(e,n){return this._sobjm.createSceneObjectFromUrl(e,n)}createSceneObjectFromClass(e,n){return this._sobjm.createSceneObjectFromClass(e,n)}createSceneObjectFromJson(e){return this._sobjm.createSceneObjectFromJson(e)}destroySceneObject(e){const n=this._sobjm.deleteSceneObject(e);return e.destroy(),n}destroyAllSceneObjects(){const e=[...this._sobjm.sceneObjects];for(let n of e)n!=this._player&&n!=this._cmrvm&&this.destroySceneObject(n)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}return f(lg,"getSceneObjById",pt.context.getSceneObjectById.bind(pt.context)),f(lg,"getEnv",pt.context.getEnv.bind(pt.context)),f(lg,"setEnv",pt.context.setEnv.bind(pt.context)),w.BooleanProperty=X,w.BorderedPosFloatDiv=K0,w.BoxPicker=Rg,w.CancelError=Fr,w.CancelsManager=Fg,w.CanvasImagePoi=qb,w.CanvasPoi=zg,w.CanvasPointPoi=Wb,w.CanvasPrimitive=G0,w.CanvasPrimitivesContext=Hb,w.ColorProperty=Dt,w.ColorStops=o4,w.ComplexImage=Bc,w.CursorFloatDiv=Zb,w.CursorInfo=Kb,w.DashPatternProperty=Py,w.DateProperty=ys,w.DatesProperty=Kg,w.Debouncing=wb,w.DebouncingDeprecated=Ng,w.DebouncingWithStartValues=Eb,w.Destroyable=B,w.DivBoxPicker=vb,w.DivPoi=Y0,w.DivPointerClick=zb,w.DivideProperty=wt,w.DomElementEvent=xe,w.DoublyLinkedList=E0,w.DragStartDataManager=My,w.ES3DTileset=Jn,w.ESAlarm=Om,w.ESApertureEffect=Dm,w.ESAreaMeasurement=Rm,w.ESAttackArrow=e0,w.ESBlastParticleSystem=Am,w.ESBoxClipping=Lm,w.ESCameraView=Rf,w.ESCameraViewCollection=Lf,w.ESCameraVisibleRange=Fm,w.ESCar=Ff,w.ESCityBasePoint=Fv,w.ESClassification=kf,w.ESClippingPlane=km,w.ESCustomDiv=Gf,w.ESCylinder=rl,w.ESCzml=Gv,w.ESDataMesh=Gm,w.ESDatasmithRuntimeModel=vv,w.ESDirectionMeasurement=av,w.ESDistanceMeasurement=jm,w.ESDynamicWater=yv,w.ESEntityCluster=Rv,w.ESExcavate=Ac,w.ESFeatureLayer=Jv,w.ESFireParticleSystem=jf,w.ESFireWall=qm,w.ESForestTileset=Vm,w.ESFountainParticleSystem=Hf,w.ESGaussianSplatting=Bv,w.ESGeoBezierSpline=Av,w.ESGeoDiv=zm,w.ESGeoDivTextPoi=Lv,w.ESGeoExtrudedPolygon=nl,w.ESGeoJson=kc,w.ESGeoLineString=Fi,w.ESGeoPoints=zc,w.ESGeoPolygon=Jt,w.ESGeoPolygonWithFire=Um,w.ESGeoRectangle=Wm,w.ESGeoVector=Ot,w.ESGeoWater=_v,w.ESGltfModel=Fs,w.ESGltfModelEditing=Qv,w.ESHeatMap=Jf,w.ESHeightLimitAnalysis=Dv,w.ESHeightMeasurement=uv,w.ESHole=xv,w.ESHuman=Zn,w.ESHumanFountain=Pv,w.ESHumanPoi=Cv,w.ESHumans=t0,w.ESImageLabel=Vf,w.ESImageryLayer=Lc,w.ESJArrowModeArray=ep,w.ESJClassificationTypeArray=tp,w.ESJEditingMode=nt,w.ESJLonLatFormat=Iy,w.ESJPickedResult=EC,w.ESLabel=Yn,w.ESLandSlide=Uv,w.ESLevelRuntimeModel=wv,w.ESLocalCircle=hv,w.ESLocalPolygon=Gc,w.ESLocalPolygonZ=cv,w.ESLocalRectangle=dv,w.ESLocalSkyBox=Xm,w.ESLocalVector=Nu,w.ESLocalVector2D=wo,w.ESLocationMeasurement=$m,w.ESMCPClient=JR,w.ESMVTLayer=Zv,w.ESMediaLayer=Kv,w.ESMsTileset=Tv,w.ESNavigator=jv,w.ESObjectWithLocation=ct,w.ESObjectsManager=lg,w.ESParticleSystemPrimitive=zf,w.ESPath=Au,w.ESPathImpl=aa,w.ESPipeFence=qf,w.ESPipeline=Ev,w.ESPipeserTileset=fv,w.ESPit=Du,w.ESPlayer=Ru,w.ESPoi2D=Fc,w.ESPoi3D=Ym,w.ESPoiTileset=Nv,w.ESPolygonFence=Wf,w.ESPolygonFlattenedPlane=Jm,w.ESPolygonWithHole=pv,w.ESPolygonsFlattenedPlane=Zm,w.ESRectangle=gv,w.ESRtsFeatureEditing=Mv,w.ESRtsTileset=Iv,w.ESScale=Ov,w.ESSceneObject=pt,w.ESSceneObjectWithId=ky,w.ESSeparateFoliage=Km,w.ESSignalInterference=i0,w.ESSkylineAnalysis=Wv,w.ESSquadCombatArrow=Bm,w.ESStaticMesh=qv,w.ESSubmergingAnalysis=Qm,w.ESSunshineAnalysis=tv,w.ESSurfaceAreaMeasurement=mv,w.ESTerrainLayer=ev,w.ESTerrainLayerEditing=Vc,w.ESTerrainLayerEditingBrushEarseFalloff=jE,w.ESTerrainLayerEditingFlattenMode=kE,w.ESTerrainLayerEditingFlattenPick=GE,w.ESTestObject=Nm,w.ESTextLabel=Ou,w.ESUEWidget=iv,w.ESUnrealActor=nv,w.ESVideoFusion=rv,w.ESViewShed=sv,w.ESViewer=os,w.ESViewerStatusBar=Vv,w.ESViewerStatusBarScale=zv,w.ESVisibilityAnalysis=Sv,w.ESVisualObject=Xt,w.ESVolumeMeasurement=bv,w.ESWidget=ov,w.EngineObject=sl,w.EnumProperty=ft,w.EvalStringProperty=io,w.Event=O,w.EventFromArrayUpdating=ob,w.EventListenerHandler=mg,w.Fetching=db,w.FloatDiv=qg,w.FlvJsLoading=Kf,w.FlvProcessing=JE,w.GetSetProperty=Qg,w.Gif=Ey,w.GifPlayer=wy,w.GifProcessing=Sy,w.HasOwner=nb,w.HlsJsLoading=Zf,w.HlsProcessing=YE,w.IFrameBorderedPosFloatDiv=Yb,w.ImageProcessing=uy,w.IntervalDeprecated=Dg,w.JsonArrayProperty=Ne,w.JsonProperty=Et,w.ListenerPipe=pg,w.LocalFileServer=ay,w.LocalRootDir=oy,w.LongStringProperty=bd,w.MethodProperty=vt,w.NextAnimateFrameEvent=fd,w.NextAnimateFrameWeakEvent=S0,w.NextMicroTaskEvent=Sg,w.NextMicroTaskWeakEvent=$S,w.Number2Property=Ke,w.Number3Property=ci,w.Number4Property=rr,w.NumberProperty=D,w.NumberSliderProperty=Qe,w.ObjPool=ad,w.ObjResetting=eC,w.ObjResettingWithEvent=qe,w.ObservableArray=Ph,w.ObservableSet=Sd,w.PickColorMananger=X0,w.PickedInfo=wC,w.Player=kr,w.PlayerProperty=Cd,w.PointerClick=Vg,w.PointerClickDeprecated=D0,w.PointerHover=k0,w.PointerHoverDeprecated=Bb,w.PosFloatDiv=Xg,w.PositionProperty=_s,w.Processing=hi,w.Property=Fo,w.ReactVarProperty=nn,w.ReactiveVariable=ui,w.RotationProperty=Ah,w.SceneObjectFromId=rp,w.SceneTree=Rc,w.SceneTreeContextMenu=eE,w.SceneTreeItem=gn,w.SceneTreeItemDragDrop=tE,w.SmartListenerHandler=_h,w.SmartListenerPipe=GS,w.SmoothMoveController=iD,w.StringProperty=mt,w.Throttling=jb,w.ThrottlingWithStartValues=Vb,w.TimingDeprecated=N0,w.ToolTipDiv=Jb,w.Transition=Th,w.TransitionDeprecated=pb,w.Tree=Oa,w.TreeItem=Rh,w.TreeItemDragDrop=Ty,w.UiTree=iy,w.UiTreeObject=ey,w.VideoProcessing=dy,w.ViewPlayerProperty=xy,w.ViewerCustomInteraction=IS,w.Watcher=Fh,w.WatcherTools=Gy,w.WithUndefinedProperty=Zg,w.XrPlayer=wd,w.Xyzw2Ns=md,w._getFeatureProperty=TE,w._getLayerConfig=xE,w._getport=ME,w._saveLayerConfig=IE,w.addTreesCallFunc=cE,w.animateFrame=cd,w.apis=Yf,w.ary2Ns=cb,w.asyncFuncToCancelablePromise=Pb,w.bind=lt,w.bindCustomEditing=Dy,w.bindu=HS,w.booleanPointInPolygon=DO,w.buildFeatureTilesetUrl=PE,w.buildInfoUrl=ID,w.buildTilesetUrl=CE,w.calcArrowPoints=Tm,w.canMoveToTreeItem=Dh,w.canMoveToTreeItems=Q0,w.cancelFuncToCancelablePromise=Cb,w.cancelPromise=Ag,w.cancelableFetch=Gg,w.cancelableFetchDeprecated=T0,w.cancelableFetchWithProgress=Ib,w.cartesianDistance=Y1,w.clamp=vd,w.clamp0_360=Bl,w.clampN180_180=Oy,w.complexImageTypes=cy,w.createAnimateFrame=Ih,w.createAnimateFrameWithStartValues=zl,w.createBottomTriangleElement=Z0,w.createCancelablePromise=Vl,w.createCloseDiv=J0,w.createEventsCallFunc=Ze,w.createFetching=Mb,w.createFetchingWithStartValues=Tb,w.createGuid=Ll,w.createInterval=Ab,w.createIntervalWithStartValues=Lb,w.createNextAnimateFrame=Nb,w.createNextAnimateFrameEvent=Ve,w.createNextAnimateFrameEventCallFunc=JS,w.createNextAnimateFrameWeakEvent=ZS,w.createNextAnimateFrameWithStartValues=Ob,w.createNextMicroTask=Db,w.createNextMicroTaskEvent=XS,w.createNextMicroTaskWeakEvent=YS,w.createNextMicroTaskWithStartValues=Rb,w.createNumbers=pd,w.createProcessingFromAsyncFunc=Ln,w.createProcessingFromAsyncFuncWithStartValues=xb,w.createProcessingFromPromiseCreateFunc=_d,w.createProcessingFromPromiseCreateFuncWithStartValues=kg,w.createSleeping=Fb,w.createSleepingWithStartValues=kb,w.createStartFuncFromAsyncFunc=xh,w.createTimeout=A0,w.createTimeoutWithStartValues=L0,w.cutDownTreesCallFunc=gE,w.czmPixelFormats=hy,w.data=CD,w.dataMd=PD,w.debounce=hd,w.defaultGetLocalFilePath=iC,w.defaultInitSceneObjectOnCreatingFunc=bC,w.defaultLight122FromEnvironmentMapManager=Mm,w.defaultLoadFuncDocStr=_E,w.defaultLoadFuncStr=lv,w.defaultLocalFileServer=ly,w.defaultStartUpdateFunc=gd,w.defaultUpdateSceneObjectOnPickingFunc=SC,w.defineReactiveProp=Og,w.destroyObject=v0,w.diffGeoJson=FC,w.downloadLink=eb,w.drawBubble=Ta,w.drawPoint=Ub,w.drawRoundRectPath=j0,w.drawText=V0,w.drawTextBlock=Bg,w.engineObjectCreatedUpdate=Z1,w.equalsN3=Nf,w.every=Cg,w.extendClassProps=Ro,w.fetchArrayBuffer=sb,w.fetchImage=x0,w.forEach=ms,w.forEachWithBreak=bg,w.geoAlong=RO,w.geoArea=Sm,w.geoBuffer=W1,w.geoCenterOfMass=AO,w.geoDestination=bm,w.geoDifference=H1,w.geoDistance=Mf,w.geoHeading=Dc,w.geoIntersect=U1,w.geoLineIntersect=LO,w.geoNearestPointOnLine=kO,w.geoPointToLineDistance=GO,w.geoPolygonFromCircle=X1,w.geoPolygonOverlap=Cm,w.geoPolylineToBezierSpline=Tu,w.geoRhumbDestination=jO,w.geoRhumbDistance=B1,w.geoRhumbHeading=VO,w.geoUnion=q1,w.getCameraTools=_S,w.getColorHexStr=Oh,w.getCompleteReactParams=ud,w.getDefaultValue=IC,w.getDistancesFromPositions=_o,w.getDomEventCurrentTargetPos=ji,w.getDrawRect=Ma,w.getESMCPTools=ES,w.getElementBounds=LC,w.getErrorResult=Pe,w.getEventFromPromise=_b,w.getEventPosInCurrentTarget=kl,w.getExtProp=An,w.getFileArrayBuffer=sy,w.getFileJson=ry,w.getFileText=$g,w.getFloatDivPool=Hg,w.getGeoBoundingSphereFromPositions=$1,w.getIterator=Eh,w.getMidpoint=FO,w.getMinMaxCorner=Tf,w.getMinMaxPosition=rb,w.getPromiseCancel=Gl,w.getPromiseFromEvent=yb,w.getPromiseFromProcessing=jg,w.getReactFuncs=yh,w.getRtsServicePrefix=il,w.getSceneObjectTools=wS,w.getSceneObjectTreeItem=CC,w.getSubEntriesFromDir=ny,w.getSuccessResult=ss,w.getTypeFromImageUri=ZE,w.getValueFromProps=b0,w.getXyzFromPostion=Pm,w.growthSimulationCallFunc=pE,w.hasSameTags=Ny,w.hasSameViewerTags=Lh,w.imageToCanvas=z0,w.inOrderRunning=MC,w.interval=wg,w.isFeatureEqual=Ly,w.isGeometryEqual=Fy,w.isJSON=ip,w.isPromiseCancelable=jl,w.isRelativeRtsInfoUrl=wE,w.isXML=xC,w.lbhToWebMerc=W2,w.lbhToXyz=jr,w.length=Pg,w.lerpAngle=xd,w.lerpRotation=np,w.loadGifFrames=yy,w.loadJs=Mg,w.map=J1,w.max=to,w.min=Ao,w.moveToTreeItem=Ed,w.moveToTreeItems=ty,w.nextAnimateFrame=Fl,w.nextMicroTask=wh,w.objsIterator=xa,w.oneTimeWarning=Rl,w.optionsStr=yD,w.pairToPromise=Lg,w.parsePlatformFromUrl=SE,w.parseRtsHost=EE,w.parseRtsOrigin=$f,w.parseTileServiceName=bE,w.pluckProperty=xg,w.react=z,w.reactArray=ot,w.reactArrayCollection=zS,w.reactArrayCollectionWithUndefined=vg,w.reactArrayWithUndefined=oe,w.reactDeepArray=ld,w.reactDeepArrayWithUndefined=Do,w.reactJson=bt,w.reactJsonCollection=BS,w.reactJsonCollectionWithUndefined=US,w.reactJsonWithUndefined=fe,w.reactPlainObject=jS,w.reactPlainObjectWithUndefined=VS,w.reactPosition2Ds=xm,w.reactPosition2DsSet=qS,w.reactPositions=Pa,w.reactPositionsSet=yg,w.reduce=Ch,w.registerEventCtor=y0,w.registerEventUpdate=WO,w.removeAllTreesCallFunc=dE,w.requestAnimationFrameTimeStampTest=ib,w.resolveRtsInfoUrl=Xf,w.rpToap=PC,w.saveOnBrowser=tb,w.setCanvasUniformColor=B0,w.setExtProp=ps,w.setPromiseCancel=Lo,w.setSceneObjectTreeItem=Pd,w.setValueFromProps=QS,w.sleep=Mh,w.sleepDeprecated=fb,w.step=Ia,w.stepProcessing=Gb,w.throttle=Ig,w.timeout=Eg,w.toGeoJson=Ay,w.track=F,w.uint32ToUint8s=W0,w.uint8ToHexStr=Nh,w.uint8sToUint32=H0,w.updateTreeParamsCallFunc=fE,w.webMercToLbh=H2,w.xyz2N2=ab,w.xyz2N3=lb,w.xyzToLbh=Ip,w.xyzw2N4=ub,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),w})({});
512
+ `,cA='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',dA='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',Ol=class Ol extends B{constructor(t){super();const e=()=>{const n=this.dv(new Gf);this.d(F([n,"show"],[t,"useDefaultStatusDiv"]));{const r=()=>{n.show=(t.useDefaultStatusDiv??!0)&&t.status!=="Created"};r(),this.d(t.useDefaultStatusDivChanged.don(r)),this.d(t.statusChanged.don(r)),n.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}t.add(n),this.d(()=>t.delete(n)),n.instanceClass=class extends B{constructor(o,a,l){super();f(this,"_div",document.createElement("div"));if(this._subContainer=o,!l)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const p=()=>{a.show?this._div.style.opacity="1":this._div.style.opacity="0"};p(),this.d(a.showChanged.don(p))}let u,h,c,d,g;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",u=document.createElement("div"),this._div.appendChild(u),u.style.width="auto",u.style.position="absolute",u.style.left="50%",u.style.top="50%",u.style.transform="translate(-50%,-50%)",u.style.background="rgba(120, 120, 0, 0.7)",u.style.color="white",u.style.fontSize="10px",u.style.background="none",u.style.display="flex",u.style.justifyContent="center",u.style.alignItems="center",h=document.createElement("div"),u.appendChild(h),h.style.pointerEvents="none",h.style.display="block",h.style.width="40px",h.innerHTML=Ol.defaultsSvg.loadingSvg,h.style.filter="drop-shadow(0px 0px 1px black)",c=document.createElement("div"),u.appendChild(c),c.style.pointerEvents="none",c.style.marginLeft="10px",c.style.display="flex",c.style.flexFlow="column",c.style.maxWidth="300px",d=document.createElement("div"),c.appendChild(d),d.style.fontSize="14px",d.style.fontWeight="800",d.style.marginBottom="5px",d.style.textShadow="0 0 2px black",g=document.createElement("div"),c.appendChild(g),g.style.fontWeight="400",g.style.textShadow="0 0 2px black";{const p=()=>{let b="Raw";l.status==="Raw"?b="初始状态":l.status==="Creating"?b="正在创建":l.status==="Created"?b="创建完成":l.status==="Error"?b="创建失败":l.status==="Reconnecting"&&(b="重新连接"),d.innerText=`${b}(${l.status})`,g.innerText=`${l.statusLog}`,(l.status==="Creating"||l.status==="Reconnecting")&&(h.innerHTML=Ol.defaultsSvg.loadingSvg),l.status==="Created"&&(h.innerHTML=Ol.defaultsSvg.successSvg),l.status==="Error"&&(h.innerHTML=Ol.defaultsSvg.warnSvg)};p();const E=this.dv(Ve(l.statusLogChanged,l.statusChanged));this.d(E.don(p))}}update(){const o=255*Math.random()|0,a=255*Math.random()|0,l=255*Math.random()|0;this._div.style.background=`rgba(${o}, ${a}, ${l}, 0.8)`}}};this.d(t.containerChanged.don(()=>{e()}))}};f(Ol,"defaultsSvg",{loadingSvg:hA,successSvg:cA,warnSvg:dA});let f0=Ol;class fA extends B{constructor(t,e,n){super(),this._subContainer=t,this._overlayContainer=e,this._viewer=n;const r=this._subContainer,s=this._overlayContainer,o=this._viewer,a=()=>{const h=o.zIndex??"";r.style.zIndex=h,s.style.zIndex=h};a(),this.d(o.zIndexChanged.don(a));const l=()=>{r.style.display=o.show??!0?"block":"none"};l(),this.d(o.showChanged.don(l));const u=()=>{r.style.opacity=`${o.opacity??1}`};u(),this.d(o.opacityChanged.don(u))}}function ag(i){let t=An(i,"_relativeContainer");return t||(t=document.createElement("div"),t.style.position="relative",t.style.width="100%",t.style.height="100%",t.style.padding="0",t.style.margin="0",i.appendChild(t),ps(i,"_relativeContainer",t)),t}class gA extends B{constructor(e,n){super();f(this,"_subContainer",document.createElement("div"));f(this,"_overlayContainer",document.createElement("div"));f(this,"_containerStyleController");this._container=e,this._viewer=n,this._containerStyleController=this.dv(new fA(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:r,overlayContainer:s}=this;r.tabIndex=-1,r.style.outline="none",r.style.width="100%",r.style.height="100%",r.onpointerdown=()=>r.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),r.setAttribute("earthsdk3","earthsdk3-subContainer"),ag(this._container).appendChild(r),this.d(()=>ag(this._container).removeChild(r)),ag(this._container).appendChild(s),this.d(()=>ag(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class pA extends B{constructor(){super(...arguments);f(this,"registerObjsMap",new Map)}register(e,n){return this.registerObjsMap.has(e)&&console.warn(`register warn:${e}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(e,n),e}getViewerConstructor(e){const n=this.registerObjsMap.get(e);if(!n){console.warn(`未找到${e}类!`);return}return n}createViewer(e){const n=e.type;console.log(e);const r=this.getViewerConstructor(n);if(!r)throw new Error(`没有找到类型为${n}的Viewer构造器!`);return new r(e)}}class IS extends B{constructor(t,e,n=!1,r=!1){if(super(),this._viewer=t,!e)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(xe.create(e,"pointerdown")),o=this.dv(xe.create(e,"pointermove")),a=this.dv(xe.create(e,"pointerup")),l=this.dv(xe.create(e,"pointerout")),u=this.dv(xe.create(e,"pointerover")),h=this.dv(new Vg),c=this.dv(new k0),d=()=>{const m=this._viewer.hoverTime*1e3;c.delayTime=m};this.d(this._viewer.hoverTimeChanged.don(()=>{d()})),this.d(s.don(m=>h.pointerDown(m))),this.d(o.don(m=>h.pointerMove(m))),this.d(a.don(m=>h.pointerUp(m))),this.d(l.don(m=>h.pointerOut(m))),this.d(s.don(m=>c.pointerDown(m))),this.d(o.don(m=>c.pointerMove(m))),this.d(a.don(m=>c.pointerUp(m))),this.d(l.don(m=>c.pointerOut(m)));const{x:g,y:p}=e.getBoundingClientRect(),E=r?g:0,b=r?p:0;this.d(c.hoverEvent.don(m=>{const[y,S]=kl(m,n);this._viewer.hoverEvent.emit({screenPosition:[y+E,S+b],pointerEvent:m})})),this.d(h.clickEvent.don(m=>{const[y,S]=kl(m,n);this._viewer.clickEvent.emit({screenPosition:[y+E,S+b],pointerEvent:m})})),this.d(h.dbclickEvent.don(m=>{const[y,S]=kl(m,n);m.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[y+E,S+b],pointerEvent:m})})),this.d(s.don(m=>{const[y,S]=kl(m,n);m.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[y+E,S+b],pointerEvent:m})})),this.d(a.don(m=>{const[y,S]=kl(m,n);m.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[y+E,S+b],pointerEvent:m})})),this.d(o.don(m=>{const[y,S]=ji(m,n);this._viewer.pointerMoveEvent.emit({screenPosition:[y+E,S+b],pointerEvent:m})})),this.d(u.don(m=>{const[y,S]=ji(m,n);this._viewer.pointerOverEvent.emit({screenPosition:[y+E,S+b],pointerEvent:m})})),this.d(l.don(m=>{const[y,S]=ji(m,n);this._viewer.pointerOutEvent.emit({screenPosition:[y+E,S+b],pointerEvent:m})}));const P=this.dv(xe.create(e,"keydown"));this.d(P.don(m=>this._viewer.keyDownEvent.emit(m)));const v=this.dv(xe.create(e,"keyup"));this.d(v.don(m=>this._viewer.keyUpEvent.emit(m)));const _=this.dv(xe.create(e,"wheel"));this.d(_.don(m=>this._viewer.wheelEvent.emit(m)))}}const Oo=class Oo extends B{constructor(e){super();f(this,"_forceRecreateEvent",this.dv(new O));f(this,"_container",this.dv(z(void 0)));f(this,"_containerSize",this.dv(z(void 0)));f(this,"_editingEvent",this.disposeVar(new O));f(this,"_esViewerExtensions",this.dv(new sA(this)));f(this,"_status",this.dv(z("Raw")));f(this,"_statusLog",this.dv(z("")));f(this,"_statusContainer",this.dv(new f0(this)));f(this,"_useCustomInteraction",this.dv(z(!0)));f(this,"_resetInteractionEvent",this.dv(Ve(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));f(this,"_interactionResetting",this.dv(new qe(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new IS(this,this.container)})));f(this,"_viewerChanged",this.dv(new O));f(this,"_cameraChanged",this.dv(new O));f(this,"_containerResetEvent",this.dv(Ve(this.containerChanged,this._forceRecreateEvent)));f(this,"_containerResetting",this.dv(new qe(this._containerResetEvent,()=>{if(this.container)return new gA(this.container,this)})));f(this,"_sceneObjectsMap",new Map);f(this,"_id");f(this,"_typeName");f(this,"_updateFuncReact",this.dv(z(void 0)));f(this,"_toDestroyFuncReact",this.dv(z(void 0)));f(this,"_statusInfo",Oo.defaults.statusInfo);f(this,"_navigationMode",this.dv(z("Map")));f(this,"_navigationEvent",this.disposeVar(new O));f(this,"_syncViewer",this.dv(z(void 0)));f(this,"_syncEventDon",this.dv(new qe(this.syncViewerChanged,()=>{const e=this.syncViewer;if(e)return new uA(this,e)})));f(this,"_timeSyncdon",this.dv(new qe(this.timeSyncChanged,()=>{if(this.timeSync)return new lA(this)})));f(this,"_hoverEvent",this.dv(new O));f(this,"_pointerOverEvent",this.dv(new O));f(this,"_pointerMoveEvent",this.dv(new O));f(this,"_pointerDownEvent",this.dv(new O));f(this,"_pointerUpEvent",this.dv(new O));f(this,"_pointerOutEvent",this.dv(new O));f(this,"_clickEvent",this.dv(new O));f(this,"_dblclickEvent",this.dv(new O));f(this,"_keyDownEvent",this.dv(new O));f(this,"_keyUpEvent",this.dv(new O));f(this,"_wheelEvent",this.dv(new O));f(this,"_actived",this.dv(z(!1)));this._id=e.id??Ll();const n=bS(e.container);if(n)this._container.value=d0(n),this._typeName=e.type,this._initName();else throw new Error("container is not defined");{const r=()=>{n&&(this.show??!0?n.style.display="block":n.style.display="none")};r(),this.d(this.showChanged.don(r))}{const r=this._sceneObjectsMap,s=()=>{for(let[a,l]of r.entries())if(!l&&a){const u=sl.context.createEngineObject(a,this);u&&r.set(a,u)}},o=()=>{for(let[a,l]of r.entries())l&&!l.isDestroyed()&&l.destroy(),r.set(a,void 0)};this.d(o),this.d(this.viewerChanged.don(a=>{o(),a&&s()}))}{const r=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};r(),this.d(this.execOnceFuncStrChanged.don(r))}{const r=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(o){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};r(),this.d(this.updateFuncStrChanged.don(r));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||Ih(),s.restart(void 0,o=>{this.updateFunc&&this.updateFunc(this,o)}))}))}{const r=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};r(),this.d(this.toDestroyFuncStrChanged.don(r)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new aA(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(e){this._container.value=e}set containerOrId(e){if(typeof e=="string"){const n=document.getElementById(e);n&&n instanceof HTMLDivElement?this._container.value=d0(n):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else e instanceof HTMLDivElement?this._container.value=d0(e):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(e){this._containerSize.value=e}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get esViewerExtensions(){return this._esViewerExtensions}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(e){this._status.value=e}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(e){this._statusLog.value=e}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(e){this._useCustomInteraction.value=e}get viewerChanged(){return this._viewerChanged}get cameraChanged(){return this._cameraChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(e){return this.sceneObjectsMap.get(e)}add(...e){for(let n of e)if(!this.has(n)){pt.context.addSceneObject(n);const r=sl.context.createEngineObject(n,this);r&&this._sceneObjectsMap.set(n,r),n.viewerAttached.emit(this)}}delete(...e){for(let n of e)if(this.has(n)){const r=this._sceneObjectsMap.get(n);r&&r.destroy(),pt.context.deleteSceneObject(n),this._sceneObjectsMap.delete(n),n.viewerDetached.emit(this)}}disposableAdd(...e){return this.add(...e),()=>this.delete(...e)}disAdd(...e){return this.disposableAdd(...e)}has(e){return this._sceneObjectsMap.has(e)}clearAllSceneObjects(){for(let e of this.sceneObjects)this.delete(e)}get id(){return this._id}set id(e){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return Oo.createDefaultProps()}get completeJson(){return this._getJson(!1)}_getJson(e=!0){const n={id:this.id,type:this.typeName};for(let r of Object.keys(this.defaultProps))if(e){let s,o=this.defaultProps[r];o instanceof ui?s=o.equals(this[r]):s=o===this[r],s||(n[r]=this[r])}else n[r]=this[r];return n}_setJson(e,n,r){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const s=n||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in e)this[a]=e[a]===null?void 0:e[a];else if(!(r??!1)){let l=this.defaultProps[a];l instanceof ui&&(l=l.value),this[a]=l}}get json(){return this._getJson()}set json(e){this._setJson(e,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}get navigationEvent(){return this._navigationEvent}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(e){this._syncViewer.value=e}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(e){e&&e.syncViewer&&(e.syncViewer=void 0),e===this?this._syncViewer.value=void 0:this._syncViewer.value=e}setCurrentTime(e){try{this.currentTime=typeof e=="string"?Date.parse(e):e}catch(n){console.warn(`时间格式不正确! value: ${e} error: ${n}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}get actived(){return this._actived.value}set actived(e){this._actived.value=e}get activedChanged(){return this._actived.changed}getESProperties(){return{defaultMenu:"general",basic:[],general:[],dataSource:[],location:[],coordinate:[],style:[],more:[]}}async getCurrentRectangle(){var e;try{const n=(e=this.container)==null?void 0:e.getBoundingClientRect();if(!n)return;const{width:r,height:s}=n,o=await this.quickPickPosition([0,0]),a=await this.quickPickPosition([r,s]);return!o||!a?void 0:[o[0],a[1],a[0],o[1]]}catch(n){console.error(n);return}}};f(Oo,"context",new pA),f(Oo,"register",Oo.context.register.bind(Oo.context)),f(Oo,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0,cameraMovableRegion:[0,0,0,0,0,0],depthTestAgainstTerrain:!0,terrainOpacity:1});let os=Oo;(i=>{i.createBaseProps=()=>({name:"未命名场景对象",extras:bt(void 0),devTags:oe(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),i.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:1024,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:oe(void 0),editingAuxiliaryPointColor:oe(void 0),editingLineWidth:void 0,editingLineColor:oe(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingPointTooltipShow:!0,editingEventListening:!0,terrainShader:i.defaults.terrainShader,splitPosition:z(void 0),rollerShutter:!1,cameraMovableRegion:oe(void 0),depthTestAgainstTerrain:!0,terrainOpacity:1,sceneGlobeBaseColor:ot([1,1,1,1]),sceneBackgroundColor:ot([0,0,0,0])}),i.createDefaultProps=()=>({...(0,i.createBaseProps)(),...(0,i.createCommonProps)()})})(os||(os={})),Ro(os.prototype,os.createDefaultProps);function MS(i,t){const e=i._lastCameraInfo;if(e){const n=t.viewerChanged.don(r=>{if(!r||!e)return;const{position:s,rotation:o}=e;t.flyIn(s,o,0),i._lastCameraInfo=void 0,n()})}}const mA=i=>{const t=os.createCommonProps(),e={};try{Object.keys(t).forEach(n=>{e[n]=i[n]})}catch(n){console.warn(n)}return e},TS=(i,t)=>{const e=os.createCommonProps();try{Object.keys(e).forEach(n=>{i[n]=t[n]})}catch(n){console.warn(n)}};class vA extends B{constructor(e){super();f(this,"_viewersChanged",this.disposeVar(new O));f(this,"_viewers",new Set);f(this,"_viewersToChange",this.dv(new O));this._sceneObjectsManager=e,(async()=>{for(let n of this.viewers){const r=this._sceneObjectsManager.sceneObjects;for(const s of r)await this.addSceneObject(s,n)}this.d(()=>{const n=this._sceneObjectsManager.sceneObjects;for(const r of this.viewers)r.delete(...n),this.destroyViewer(r);this._viewers.clear()}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don(async(n,r)=>{for(let s of this.viewers){n.forEach(o=>{this.deleteSceneObject(o,s)});for(let o of r)await this.addSceneObject(o,s)}if(r.length>0)for(let s of r)s.d(s.devTagsChanged.don(async()=>{for(let o of this.viewers){if(o.has(s)&&!Lh(o.devTags,s.devTags)){o.delete(s);continue}await this.addSceneObject(s,o)}})),s.ad(s.reloadEvent.don(async()=>{for(let o of this.viewers)o.has(s)&&(o.delete(s),await this.addSceneObject(s,o))}))})),this.d(this.viewersChanged.don(async(n,r)=>{const s=this._sceneObjectsManager.sceneObjects;n.forEach(o=>{for(let a of s)this.deleteSceneObject(a,o)});for(let o of r)for(let a of s)await this.addSceneObject(a,o);r.length>0&&r.forEach(o=>{o.d(o.devTagsChanged.don(async()=>{o.clearAllSceneObjects();const a=this._sceneObjectsManager.sceneObjects;for(let l of a)console.log("viewersChanged",o.devTags,l.devTags,Lh(o.devTags,l.devTags)),await this.addSceneObject(l,o)}))})}))})()}get viewersChanged(){return this._viewersChanged}get viewers(){return[...this._viewers]}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(e){const n=os.context.createViewer(e);return this._viewers.add(n),this._viewersChanged.emit([],[n]),n}destroyViewer(e){return e.isDestroyed()?!0:this._viewers.has(e)?(this._viewers.delete(e),this._viewersChanged.emit([e],[]),e.destroy(),e.isDestroyed()):!1}async addSceneObject(e,n){Lh(n.devTags,e.devTags)&&(n.has(e)?console.warn(`${n.typeName}中已存${e.typeName},检查逻辑是否有问题!`):n.add(e))}deleteSceneObject(e,n){Lh(n.devTags,e.devTags)&&(n.has(e)?n.delete(e):console.warn(`${n.typeName}中不存在${e.typeName},检查逻辑是否有问题!`))}}class lg extends B{constructor(...e){super();f(this,"_drgm",this.dv(new My));f(this,"_sobjm",this.dv(new nA));f(this,"_vrm",this.dv(new vA(this._sobjm)));f(this,"_sceneObjectEditingManager",this.disposeVar(new iA));f(this,"_activeViewer",this.dv(z(void 0)));f(this,"_syncOtherViewersToActived",this.dv(z(!1)));f(this,"_cmrvm",this.createSceneObjectFromClass(Lf));f(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));f(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});f(this,"_sceneTree",this.dv(new Rc("default",this.dragstartDataMananger,24,this)));f(this,"_sceneTreeMap",new Map);f(this,"_viewerCreatedEvent",this.dv(new O));f(this,"_lastCameraInfo");f(this,"_lastActiveViewerJson");f(this,"_syncEventDonFunc",this.d(Ze([this.activeViewerChanged,this.syncOtherViewersToActivedChanged],()=>{const e=this.syncOtherViewersToActived;this.viewers.forEach(n=>{e?n.syncOtherViewer(this.activeViewer):n.syncOtherViewer(void 0)})})));f(this,"_player",this.createSceneObjectFromClass(Ru));f(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));f(this,"_esPlyarAndPathTime",this.dv(new ZR(this)));f(this,"_pathAnimationManager",this.dv(new QR(this)))}getBrowserEnv(){return globalThis.ue&&globalThis.ue.es&&globalThis.ue.esinput?"ESWebView":"Browser"}static get envs(){return pt.context.environmentVariables}getSceneObjectById(e){return pt.getSceneObjectById(e)}getSceneObject(e){return pt.getSceneObject(e)}get $refs(){return pt.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(e){this._activeViewer.value=e,this.viewers.forEach(n=>n.actived=n===e)}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(e){this._syncOtherViewersToActived.value=e}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get completeJson(){var c;const e=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),r=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:e,modifiedTime:n,name:r},a=this.sceneTree.completeJson,l=this._cmrvm.views,u=[...this.viewers].map(d=>d.completeJson),h=(c=this.activeViewer)==null?void 0:c.getCurrentCameraInfo();return{asset:o,viewers:u,sceneTree:a,viewCollection:l,lastView:h}}get json(){var c;const e=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),r=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:e,modifiedTime:n,name:r},a=this.sceneTree.json,l=this._cmrvm.views,u=[...this.viewers].map(d=>d.json),h=(c=this.activeViewer)==null?void 0:c.getCurrentCameraInfo();return{asset:o,viewers:u,sceneTree:a,viewCollection:l,lastView:h}}set json(e){try{if(!e.asset)return;if(!e.asset.type||e.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=e.asset&&e.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=e.asset&&e.asset.modifiedTime||"",this._asset.name=e.asset&&e.asset.name||"未命名项目",this._asset.version=e.asset&&e.asset.version||"0.1.0",e.sceneTree&&(this.sceneTree.json=e.sceneTree),e.viewCollection&&(this._cmrvm.views=e.viewCollection),!e.viewers||!Array.isArray(e.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this.viewers.length===0||e.viewers.length===0){console.warn("viewers is empty !");return}this.viewers.forEach(n=>{const r=e.viewers.find(s=>s.id===n.id);r&&(n.json=r)})}catch(n){console.error(`ESObjectsManager解析json数据时发生错误! error: ${n}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(e="default"){if(e==="default")return this._sceneTree;if(!this._sceneTreeMap.has(e)){console.warn(`id为${e}的SceneTree不存在!`);return}return this._sceneTreeMap.get(e)}createSceneTree(e,n=24){if(this._sceneTreeMap.has(e)||e==="default")console.warn(`id为${e}的SceneTree已存在!`);else{const r=this.dv(new Rc(e,this.dragstartDataMananger,n,this));this._sceneTreeMap.set(e,r)}return this.getSceneTree(e)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(e){const n=this._vrm.createViewer(e);this.activeViewer||(this.activeViewer=n);const r=this.d(n.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(n),r())}));return n}destroyViewer(e){return this._activeViewer.value===e&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(e)}switchViewer(e,n=!0,r=!0,s=!0){var u,h;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&n&&(this._lastCameraInfo=(u=this.activeViewer)==null?void 0:u.getCurrentCameraInfo(),((h=this.activeViewer)==null?void 0:h.typeName)=="ESOlViewer"&&this._lastCameraInfo&&(this._lastCameraInfo.rotation[1]=-90)),!this._lastActiveViewerJson&&r&&(this._lastActiveViewerJson=this.activeViewer?mA(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const o=e.id,a=o?[...this.getViewers()].find(c=>c.id===o):[...this.getViewers()].find(c=>c.typeName===e.type&&!c.container);if(a)if(o&&a.typeName!==e.type)console.warn(`id为${o}的viewer的typeName和option.type${e.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(a);else return console.log("ESViewer exists, will be used"),n&&MS(this,a),r&&this._lastActiveViewerJson&&(TS(a,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),a.container===bS(e.container)?(a.containerOrId=e.container,a.forceRecreate()):a.containerOrId=e.container,this.activeViewer=a,a;console.log("No ESViewer exists, will be created");const l=this.createViewer(e);return console.log(e),console.log(this),n&&MS(this,l),r&&this._lastActiveViewerJson&&(TS(l,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=l,l}switchToCesiumViewer(...e){if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)){const{container:n,viewSync:r,attributeSync:s,destroy:o,id:a}=e[0];return this.switchViewer({type:"ESCesiumViewer",container:n,id:a},r??!0,s??!0,o??!0)}else if(typeof e[0]=="string"||e[0]instanceof HTMLDivElement){const n={container:e[0],viewSync:e[1]??!0,attributeSync:e[2]??!0,destroy:e[3]??!0,id:e[4]},{container:r,viewSync:s,attributeSync:o,destroy:a,id:l}=n;return this.switchViewer({type:"ESCesiumViewer",container:r,id:l},s,o,a)}}switchToUEViewer(...e){let n,r={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("uri")){const{container:l,uri:u,app:h,token:c,viewSync:d,attributeSync:g,destroy:p,id:E,silentTime:b}=e[0];n={type:"ESUeViewer",container:l,id:E,options:{uri:u,app:h,token:c,silentTime:b}},r={viewSync:d??!0,attributeSync:g??!0,destroy:p??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("ws")){const{container:l,ws:u,esmsg:h,viewSync:c,attributeSync:d,id:g,destroy:p,silentTime:E}=e[0];n={type:"ESUeViewer",container:l,id:g,options:{ws:u,esmsg:h,silentTime:E}},r={viewSync:c??!0,attributeSync:d??!0,destroy:p??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("project")){const{container:l,project:u,baseUrl:h,viewSync:c,attributeSync:d,id:g,destroy:p}=e[0];n={type:"ESUeViewer",container:l,id:g,options:{project:u,baseUrl:h}},r={viewSync:c??!0,attributeSync:d??!0,destroy:p??!0}}else(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?(n={type:"ESUeViewer",container:e[0],id:e[6],options:{ws:e[1],esmsg:e[2]??void 0,silentTime:e[7]??void 0}},r={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}):typeof e[1]=="string"&&e[1].startsWith("http")?(n={type:"ESUeViewer",container:e[0],id:e[7],options:{uri:e[1],app:e[2],token:e[3]??void 0,silentTime:e[8]??void 0}},r={viewSync:e[4]??!0,attributeSync:e[5]??!0,destroy:e[6]??!0}):(n={type:"ESUeViewer",container:e[0],id:e[6],options:{project:e[1],baseUrl:e[2]??void 0}},r={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}));if(!n)throw new Error("参数错误");const{viewSync:s,attributeSync:o,destroy:a}=r;return this.switchViewer(n,s,o,a)}createCesiumViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESCesiumViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(n={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESCesiumViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createOpenLayersViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESOlViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(n={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESOlViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createUeViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESUeViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?n={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{ws:e[1],esmsg:e[2]??void 0,silentTime:e[4]??void 0}}:typeof e[1]=="string"&&e[1].startsWith("http")?n={type:"ESUeViewer",container:e[0],id:e[4]??void 0,options:{uri:e[1],app:e[2],token:e[3]??void 0,silentTime:e[5]??void 0}}:n={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{project:e[1],baseUrl:e[2]??void 0}}),!n)throw new Error("参数错误");return this.createViewer(n)}createSceneObject(e,n){return this._sobjm.createSceneObject(e,n)}createSceneObjectFromUrl(e,n){return this._sobjm.createSceneObjectFromUrl(e,n)}createSceneObjectFromClass(e,n){return this._sobjm.createSceneObjectFromClass(e,n)}createSceneObjectFromJson(e){return this._sobjm.createSceneObjectFromJson(e)}destroySceneObject(e){const n=this._sobjm.deleteSceneObject(e);return e.destroy(),n}destroyAllSceneObjects(){const e=[...this._sobjm.sceneObjects];for(let n of e)n!=this._player&&n!=this._cmrvm&&this.destroySceneObject(n)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}return f(lg,"getSceneObjById",pt.context.getSceneObjectById.bind(pt.context)),f(lg,"getEnv",pt.context.getEnv.bind(pt.context)),f(lg,"setEnv",pt.context.setEnv.bind(pt.context)),w.BooleanProperty=H,w.BorderedPosFloatDiv=K0,w.BoxPicker=Rg,w.CancelError=Fr,w.CancelsManager=Fg,w.CanvasImagePoi=qb,w.CanvasPoi=zg,w.CanvasPointPoi=Wb,w.CanvasPrimitive=G0,w.CanvasPrimitivesContext=Hb,w.ColorProperty=Dt,w.ColorStops=o4,w.ComplexImage=Bc,w.CursorFloatDiv=Zb,w.CursorInfo=Kb,w.DashPatternProperty=Py,w.DateProperty=ys,w.DatesProperty=Kg,w.Debouncing=wb,w.DebouncingDeprecated=Ng,w.DebouncingWithStartValues=Eb,w.Destroyable=B,w.DivBoxPicker=vb,w.DivPoi=Y0,w.DivPointerClick=zb,w.DivideProperty=wt,w.DomElementEvent=xe,w.DoublyLinkedList=E0,w.DragStartDataManager=My,w.ES3DTileset=Jn,w.ESAlarm=Om,w.ESApertureEffect=Dm,w.ESAreaMeasurement=Rm,w.ESAttackArrow=e0,w.ESBlastParticleSystem=Am,w.ESBoxClipping=Lm,w.ESCameraView=Rf,w.ESCameraViewCollection=Lf,w.ESCameraVisibleRange=Fm,w.ESCar=Ff,w.ESCityBasePoint=Fv,w.ESClassification=kf,w.ESClippingPlane=km,w.ESCustomDiv=Gf,w.ESCylinder=rl,w.ESCzml=Gv,w.ESDataMesh=Gm,w.ESDatasmithRuntimeModel=vv,w.ESDirectionMeasurement=av,w.ESDistanceMeasurement=jm,w.ESDynamicWater=yv,w.ESEntityCluster=Rv,w.ESExcavate=Ac,w.ESFeatureLayer=Jv,w.ESFireParticleSystem=jf,w.ESFireWall=qm,w.ESForestTileset=Vm,w.ESFountainParticleSystem=Hf,w.ESGaussianSplatting=Bv,w.ESGeoBezierSpline=Av,w.ESGeoDiv=zm,w.ESGeoDivTextPoi=Lv,w.ESGeoExtrudedPolygon=nl,w.ESGeoJson=kc,w.ESGeoLineString=Fi,w.ESGeoPoints=zc,w.ESGeoPolygon=Jt,w.ESGeoPolygonWithFire=Um,w.ESGeoRectangle=Wm,w.ESGeoVector=Ot,w.ESGeoWater=_v,w.ESGltfModel=Fs,w.ESGltfModelEditing=Qv,w.ESHeatMap=Jf,w.ESHeightLimitAnalysis=Dv,w.ESHeightMeasurement=uv,w.ESHole=xv,w.ESHuman=Zn,w.ESHumanFountain=Pv,w.ESHumanPoi=Cv,w.ESHumans=t0,w.ESImageLabel=Vf,w.ESImageryLayer=Lc,w.ESJArrowModeArray=ep,w.ESJClassificationTypeArray=tp,w.ESJEditingMode=nt,w.ESJLonLatFormat=Iy,w.ESJPickedResult=EC,w.ESLabel=Yn,w.ESLandSlide=Uv,w.ESLevelRuntimeModel=wv,w.ESLocalCircle=hv,w.ESLocalPolygon=Gc,w.ESLocalPolygonZ=cv,w.ESLocalRectangle=dv,w.ESLocalSkyBox=Xm,w.ESLocalVector=Nu,w.ESLocalVector2D=wo,w.ESLocationMeasurement=$m,w.ESMCPClient=JR,w.ESMVTLayer=Zv,w.ESMediaLayer=Kv,w.ESMsTileset=Tv,w.ESNavigator=jv,w.ESObjectWithLocation=ct,w.ESObjectsManager=lg,w.ESParticleSystemPrimitive=zf,w.ESPath=Au,w.ESPathImpl=aa,w.ESPipeFence=qf,w.ESPipeline=Ev,w.ESPipeserTileset=fv,w.ESPit=Du,w.ESPlayer=Ru,w.ESPoi2D=Fc,w.ESPoi3D=Ym,w.ESPoiTileset=Nv,w.ESPolygonFence=Wf,w.ESPolygonFlattenedPlane=Jm,w.ESPolygonWithHole=pv,w.ESPolygonsFlattenedPlane=Zm,w.ESRectangle=gv,w.ESRtsFeatureEditing=Mv,w.ESRtsTileset=Iv,w.ESScale=Ov,w.ESSceneObject=pt,w.ESSceneObjectWithId=ky,w.ESSeparateFoliage=Km,w.ESSignalInterference=i0,w.ESSkylineAnalysis=Wv,w.ESSquadCombatArrow=Bm,w.ESStaticMesh=qv,w.ESSubmergingAnalysis=Qm,w.ESSunshineAnalysis=tv,w.ESSurfaceAreaMeasurement=mv,w.ESTerrainLayer=ev,w.ESTerrainLayerEditing=Vc,w.ESTerrainLayerEditingBrushEarseFalloff=jE,w.ESTerrainLayerEditingFlattenMode=kE,w.ESTerrainLayerEditingFlattenPick=GE,w.ESTestObject=Nm,w.ESTextLabel=Ou,w.ESUEWidget=iv,w.ESUnrealActor=nv,w.ESVideoFusion=rv,w.ESViewShed=sv,w.ESViewer=os,w.ESViewerStatusBar=Vv,w.ESViewerStatusBarScale=zv,w.ESVisibilityAnalysis=Sv,w.ESVisualObject=Xt,w.ESVolumeMeasurement=bv,w.ESWidget=ov,w.EngineObject=sl,w.EnumProperty=ft,w.EvalStringProperty=io,w.Event=O,w.EventFromArrayUpdating=ob,w.EventListenerHandler=mg,w.Fetching=db,w.FloatDiv=qg,w.FlvJsLoading=Kf,w.FlvProcessing=JE,w.GetSetProperty=Qg,w.Gif=Ey,w.GifPlayer=wy,w.GifProcessing=Sy,w.HasOwner=nb,w.HlsJsLoading=Zf,w.HlsProcessing=YE,w.IFrameBorderedPosFloatDiv=Yb,w.ImageProcessing=uy,w.IntervalDeprecated=Dg,w.JsonArrayProperty=Ne,w.JsonProperty=Et,w.ListenerPipe=pg,w.LocalFileServer=ay,w.LocalRootDir=oy,w.LongStringProperty=bd,w.MethodProperty=vt,w.NextAnimateFrameEvent=fd,w.NextAnimateFrameWeakEvent=S0,w.NextMicroTaskEvent=Sg,w.NextMicroTaskWeakEvent=$S,w.Number2Property=Ke,w.Number3Property=ci,w.Number4Property=rr,w.NumberProperty=D,w.NumberSliderProperty=Qe,w.ObjPool=ad,w.ObjResetting=eC,w.ObjResettingWithEvent=qe,w.ObservableArray=Ph,w.ObservableSet=Sd,w.PickColorMananger=X0,w.PickedInfo=wC,w.Player=kr,w.PlayerProperty=Cd,w.PointerClick=Vg,w.PointerClickDeprecated=D0,w.PointerHover=k0,w.PointerHoverDeprecated=Bb,w.PosFloatDiv=Xg,w.PositionProperty=_s,w.Processing=hi,w.Property=Fo,w.ReactVarProperty=nn,w.ReactiveVariable=ui,w.RotationProperty=Ah,w.SceneObjectFromId=rp,w.SceneTree=Rc,w.SceneTreeContextMenu=eE,w.SceneTreeItem=gn,w.SceneTreeItemDragDrop=tE,w.SmartListenerHandler=_h,w.SmartListenerPipe=GS,w.SmoothMoveController=iD,w.StringProperty=mt,w.Throttling=jb,w.ThrottlingWithStartValues=Vb,w.TimingDeprecated=N0,w.ToolTipDiv=Jb,w.Transition=Th,w.TransitionDeprecated=pb,w.Tree=Oa,w.TreeItem=Rh,w.TreeItemDragDrop=Ty,w.UiTree=iy,w.UiTreeObject=ey,w.VideoProcessing=dy,w.ViewPlayerProperty=xy,w.ViewerCustomInteraction=IS,w.Watcher=Fh,w.WatcherTools=Gy,w.WithUndefinedProperty=Zg,w.XrPlayer=wd,w.Xyzw2Ns=md,w._getFeatureProperty=TE,w._getLayerConfig=xE,w._getport=ME,w._saveLayerConfig=IE,w.addTreesCallFunc=cE,w.animateFrame=cd,w.apis=Yf,w.ary2Ns=cb,w.asyncFuncToCancelablePromise=Pb,w.bind=lt,w.bindCustomEditing=Dy,w.bindu=HS,w.booleanPointInPolygon=DO,w.buildFeatureTilesetUrl=PE,w.buildInfoUrl=ID,w.buildTilesetUrl=CE,w.calcArrowPoints=Tm,w.canMoveToTreeItem=Dh,w.canMoveToTreeItems=Q0,w.cancelFuncToCancelablePromise=Cb,w.cancelPromise=Ag,w.cancelableFetch=Gg,w.cancelableFetchDeprecated=T0,w.cancelableFetchWithProgress=Ib,w.cartesianDistance=Y1,w.clamp=vd,w.clamp0_360=Bl,w.clampN180_180=Oy,w.complexImageTypes=cy,w.createAnimateFrame=Ih,w.createAnimateFrameWithStartValues=zl,w.createBottomTriangleElement=Z0,w.createCancelablePromise=Vl,w.createCloseDiv=J0,w.createEventsCallFunc=Ze,w.createFetching=Mb,w.createFetchingWithStartValues=Tb,w.createGuid=Ll,w.createInterval=Ab,w.createIntervalWithStartValues=Lb,w.createNextAnimateFrame=Nb,w.createNextAnimateFrameEvent=Ve,w.createNextAnimateFrameEventCallFunc=JS,w.createNextAnimateFrameWeakEvent=ZS,w.createNextAnimateFrameWithStartValues=Ob,w.createNextMicroTask=Db,w.createNextMicroTaskEvent=XS,w.createNextMicroTaskWeakEvent=YS,w.createNextMicroTaskWithStartValues=Rb,w.createNumbers=pd,w.createProcessingFromAsyncFunc=Ln,w.createProcessingFromAsyncFuncWithStartValues=xb,w.createProcessingFromPromiseCreateFunc=_d,w.createProcessingFromPromiseCreateFuncWithStartValues=kg,w.createSleeping=Fb,w.createSleepingWithStartValues=kb,w.createStartFuncFromAsyncFunc=xh,w.createTimeout=A0,w.createTimeoutWithStartValues=L0,w.cutDownTreesCallFunc=gE,w.czmPixelFormats=hy,w.data=CD,w.dataMd=PD,w.debounce=hd,w.defaultGetLocalFilePath=iC,w.defaultInitSceneObjectOnCreatingFunc=bC,w.defaultLight122FromEnvironmentMapManager=Mm,w.defaultLoadFuncDocStr=_E,w.defaultLoadFuncStr=lv,w.defaultLocalFileServer=ly,w.defaultStartUpdateFunc=gd,w.defaultUpdateSceneObjectOnPickingFunc=SC,w.defineReactiveProp=Og,w.destroyObject=v0,w.diffGeoJson=FC,w.downloadLink=eb,w.drawBubble=Ta,w.drawPoint=Ub,w.drawRoundRectPath=j0,w.drawText=V0,w.drawTextBlock=Bg,w.engineObjectCreatedUpdate=Z1,w.equalsN3=Nf,w.every=Cg,w.extendClassProps=Ro,w.fetchArrayBuffer=sb,w.fetchImage=x0,w.forEach=ms,w.forEachWithBreak=bg,w.geoAlong=RO,w.geoArea=Sm,w.geoBuffer=W1,w.geoCenterOfMass=AO,w.geoDestination=bm,w.geoDifference=H1,w.geoDistance=Mf,w.geoHeading=Dc,w.geoIntersect=U1,w.geoLineIntersect=LO,w.geoNearestPointOnLine=kO,w.geoPointToLineDistance=GO,w.geoPolygonFromCircle=X1,w.geoPolygonOverlap=Cm,w.geoPolylineToBezierSpline=Tu,w.geoRhumbDestination=jO,w.geoRhumbDistance=B1,w.geoRhumbHeading=VO,w.geoUnion=q1,w.getCameraTools=_S,w.getColorHexStr=Oh,w.getCompleteReactParams=ud,w.getDefaultValue=IC,w.getDistancesFromPositions=_o,w.getDomEventCurrentTargetPos=ji,w.getDrawRect=Ma,w.getESMCPTools=ES,w.getElementBounds=LC,w.getErrorResult=Pe,w.getEventFromPromise=_b,w.getEventPosInCurrentTarget=kl,w.getExtProp=An,w.getFileArrayBuffer=sy,w.getFileJson=ry,w.getFileText=$g,w.getFloatDivPool=Hg,w.getGeoBoundingSphereFromPositions=$1,w.getIterator=Eh,w.getMidpoint=FO,w.getMinMaxCorner=Tf,w.getMinMaxPosition=rb,w.getPromiseCancel=Gl,w.getPromiseFromEvent=yb,w.getPromiseFromProcessing=jg,w.getReactFuncs=yh,w.getRtsServicePrefix=il,w.getSceneObjectTools=wS,w.getSceneObjectTreeItem=CC,w.getSubEntriesFromDir=ny,w.getSuccessResult=ss,w.getTypeFromImageUri=ZE,w.getValueFromProps=b0,w.getXyzFromPostion=Pm,w.growthSimulationCallFunc=pE,w.hasSameTags=Ny,w.hasSameViewerTags=Lh,w.imageToCanvas=z0,w.inOrderRunning=MC,w.interval=wg,w.isFeatureEqual=Ly,w.isGeometryEqual=Fy,w.isJSON=ip,w.isPromiseCancelable=jl,w.isRelativeRtsInfoUrl=wE,w.isXML=xC,w.lbhToWebMerc=W2,w.lbhToXyz=jr,w.length=Pg,w.lerpAngle=xd,w.lerpRotation=np,w.loadGifFrames=yy,w.loadJs=Mg,w.map=J1,w.max=to,w.min=Ao,w.moveToTreeItem=Ed,w.moveToTreeItems=ty,w.nextAnimateFrame=Fl,w.nextMicroTask=wh,w.objsIterator=xa,w.oneTimeWarning=Rl,w.optionsStr=yD,w.pairToPromise=Lg,w.parsePlatformFromUrl=SE,w.parseRtsHost=EE,w.parseRtsOrigin=$f,w.parseTileServiceName=bE,w.pluckProperty=xg,w.react=z,w.reactArray=ot,w.reactArrayCollection=zS,w.reactArrayCollectionWithUndefined=vg,w.reactArrayWithUndefined=oe,w.reactDeepArray=ld,w.reactDeepArrayWithUndefined=Do,w.reactJson=bt,w.reactJsonCollection=BS,w.reactJsonCollectionWithUndefined=US,w.reactJsonWithUndefined=fe,w.reactPlainObject=jS,w.reactPlainObjectWithUndefined=VS,w.reactPosition2Ds=xm,w.reactPosition2DsSet=qS,w.reactPositions=Pa,w.reactPositionsSet=yg,w.reduce=Ch,w.registerEventCtor=y0,w.registerEventUpdate=WO,w.removeAllTreesCallFunc=dE,w.requestAnimationFrameTimeStampTest=ib,w.resolveRtsInfoUrl=Xf,w.rpToap=PC,w.saveOnBrowser=tb,w.setCanvasUniformColor=B0,w.setExtProp=ps,w.setPromiseCancel=Lo,w.setSceneObjectTreeItem=Pd,w.setValueFromProps=QS,w.sleep=Mh,w.sleepDeprecated=fb,w.step=Ia,w.stepProcessing=Gb,w.throttle=Ig,w.timeout=Eg,w.toGeoJson=Ay,w.track=F,w.uint32ToUint8s=W0,w.uint8ToHexStr=Nh,w.uint8sToUint32=H0,w.updateTreeParamsCallFunc=fE,w.webMercToLbh=H2,w.xyz2N2=ab,w.xyz2N3=lb,w.xyzToLbh=Ip,w.xyzw2N4=ub,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),w})({});